1
1
mirror of https://gitlab.gnome.org/GNOME/gimp.git synced 2025-10-06 05:22:40 +02:00

Compare commits

...

5055 Commits

Author SHA1 Message Date
Alx Sa
5655e63a4f menu: Add option to change transparency type in View menu
This allows quicker access rather than repeatedly going to the Preferences dialogue.
2024-08-11 19:52:16 +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
Luming Zh
273a633f24 Update Chinese (China) translation 2024-08-11 11:12:10 +00:00
Luming Zh
c777608a96 Update Chinese (China) translation 2024-08-11 11:07:05 +00:00
Martin
51c67d7fbe Update Slovenian translation 2024-08-11 10:40:13 +00:00
Martin
e4e8ee0a1e Update Slovenian translation 2024-08-11 10:37:33 +00:00
Bruno
89f7ddb2ca gitlab-ci: Change appimage comment following #6798
I and Jehan researched then concluded that reverse naming is NOT
the 'de facto' standard yet so the word "exotic" isn't appropriate.
2024-08-11 10:00:45 +00:00
Yuri Chornoivan
3a3a5f1c81 Update Ukrainian translation 2024-08-11 06:29:54 +00:00
Bruno
0310fbae15 devel-docs: Complete 063324cff0 2024-08-10 21:52:57 -03:00
Bruno
2eb4f579f1 build/linux: Sync with Beta manifest regarding suitesparse and openblas
Ported from: 537cbf411c
2024-08-10 20:31:23 -03:00
Alx Sa
a04befa65f plug-ins: Fix CRITICAL on Add Unit Dialog
Resolves #11892.
The new_unit_dialog () now initializes the default GimpUnit
to NULL instead of GIMP_UNIT_PIXEL. So we need to update the
check to prevent it from running when the user cancels the dialogue.
2024-08-10 23:21:36 +00:00
Jacob Boerema
3323988e9a plug-ins: be consistent and use Name in Add Unit
The name was changed from ID to Name in the Unit Editor, so it makes
sense to do the same for the Add Unit Dialog.
2024-08-10 17:51:36 -04:00
Jehan
34af64b70f extensions, plug-ins: fixing CamelCase on the "Plug-In Examples" items.
First of all: sorry to all translators who started working on these new
strings!

We use CamelCase for our titles, and in particular "Plug-In" is
capitalized with 'I'.

Furthermore, let's use understandable titles like "Plug-In Example in C"
and not just "In C", because while the short title works OK in the menu,
it makes for very broken action names in non-contextual parts of the
software, such as the action search.

Note that we in fact have a concept of short label for actions since
commit 89772351c9. I added support for it to GEGL actions (cf. commit
6dc5f6792e), and to a few core actions (e.g. commit ea1205f094).
Unfortunately I don't think I added an API yet for short label in
plug-ins. Maybe I'll add it soon. But for now, if we have to have a
single label, it should be long, so that it works in every situation.

P.S.: not sure if it's useful to keep documentation strings just
repeating the title, but for now, let's leave them.
2024-08-10 23:33:57 +02:00
Alx Sa
546e41c540 app/menus: Fix "vectors" group to "paths"
Resolves #11890.
The Selection Editor's "vectors" group was not renamed
to "paths" during the GimpPath API update. This caused it
to be registered to a non-existent group, thus crashing.
2024-08-10 20:32:25 +00:00
Yuri Chornoivan
4bae06c8b3 Update Ukrainian translation 2024-08-10 19:27:21 +00:00
Yuri Chornoivan
dc9b777343 Update Ukrainian translation 2024-08-10 19:24:07 +00:00
Kolbjørn Stuestøl
3dab84b5ef Update Norwegian Nynorsk translation 2024-08-10 16:46:42 +00:00
Kolbjørn Stuestøl
b7bc9ed732 Update Norwegian Nynorsk translation 2024-08-10 16:29:08 +00:00
Kolbjørn Stuestøl
04f41a9882 Update Norwegian Nynorsk translation 2024-08-10 16:25:59 +00:00
Kolbjørn Stuestøl
1e092dd969 Update Norwegian Nynorsk translation 2024-08-10 16:18:21 +00:00
Kolbjørn Stuestøl
09d273bc27 Update Norwegian Nynorsk translation 2024-08-10 15:40:04 +00:00
Kolbjørn Stuestøl
002a696b2e Update Norwegian Nynorsk translation 2024-08-10 15:34:12 +00:00
lloyd konneker
a5544af91d Translation: plugins: translate the Scheme example plugin
Since it will be distributed in a release.

Only translate the menu item and help.
Not translate dialog labels, they will only be read by plugin authors.
2024-08-10 14:58:58 +00:00
lloyd konneker
634f3d674f build: plugins: ensure test plugins not installed in stable version
Menu Filters>Development>Demos not appear in a stable version,
and not appear in unstable version unless buildtype==debug.
2024-08-10 14:58:58 +00:00
lloyd konneker
f0e09494e1 GUI: plugins: Move "Sphere.." example to menu "Plug-in Examples"
Also only ship "Hello World" in unstable release.
2024-08-10 14:58:58 +00:00
bootchk
fef971fa8d GUI: Rename menu Filters>Development>Goat exercises => Plug-in Examples
The old menu label was confusing to users.

Remove translatable strings having joke "goat" so translators not confused.

Move the goat plugins to the menu.

The items under the menu should all be example plugins.
The menu is in a release.

Test plugins should not be in this menu.
Test plugins should not ship in a stable release.

!!! Note that 2.10 does not ship with example plugins.
If we don't want 3.0 to ship stable build with example plugins,
then the meson.build for goat-exercises needs to change
and the menu removed entirely in menus/image-menu.ui.in.in.
2024-08-10 14:58:58 +00:00
Jordi Mas
3bec618d1b Fix in Catalan translation 2024-08-10 16:44:55 +02:00
Alx Sa
cdd5174055 tools: Add option for destructive filters
Adds a checkbox in the Filter tool so that
users can choose to apply a filter
destructively or non-destructively.
Currently only layers can have NDE effects
so it's not shown for masks and other
drawables.
Additionally, filters are moved to the top
or the bottom of the filter stack depending on
the setting (as destructive filters are applied
directly to the layer while NDE filters are
put on the top by default).
2024-08-10 13:47:42 +00:00
Martin
946a4d1af9 Update Slovenian translation 2024-08-10 13:36:09 +00:00
Anders Jonsson
5a9f76ca6b Update Swedish translation 2024-08-10 11:15:07 +00:00
Bruno
9e4cf76228 build/linux: Sync with Beta manifest regarding poppler
Ported from: 7a71694e85
2024-08-10 08:02:17 -03:00
Anders Jonsson
8c5f281047 Update Swedish translation 2024-08-10 10:26:53 +00:00
Yuri Chornoivan
0389fe8cda Update Ukrainian translation 2024-08-10 06:14:25 +00:00
Bruno
7c64f26caa build/windows, meson: Complete 93cc81281c 2024-08-10 00:59:53 +00:00
Luming Zh
d5cb5a67d8 Update Chinese (China) translation 2024-08-10 00:47:44 +00:00
Jehan
d0be4828ce app, pdb: improve cut error message and fix return value.
This fixes 2 issues:

1. Since gimp_edit_cut() uses gimp_edit_copy(), it had the same error
   message when no selected drawables were within the selection.
2. When there was a previously existing clipboard image, gimp_edit_cut()
   could return it as though the cut succeded, even when it did not.
2024-08-09 20:39:26 +02:00
Jehan
d5ff0360b1 app, libgimp, pdb: also tweak a bit gimp_edit_copy|cut() docs per…
… Lloyd comment in #10471.
2024-08-09 20:10:06 +02:00
Jehan
471a92e5ed Issue #10471: gimp_edit_copy(): doesn't behave like docs. 2024-08-09 19:52:05 +02:00
Jehan
3c388c78ac app: fixing bug created in commit cde861a0e6.
While other parts of the commits were fine, this specific change was
clearly me going too fast. This is the format for a printf() call.

Fixes:

> app/widgets/gimpimagepropview.c:461:50: warning: format ‘%a’ expects argument of type ‘double’, but argument 4 has type ‘const gchar *’ {aka ‘const char *’} [-Wformat=]
2024-08-09 19:29:55 +02:00
Kolbjørn Stuestøl
e9fd83c5ec Update Norwegian Nynorsk translation 2024-08-09 16:07:40 +00:00
Jehan
9c3884c605 meson: parse lua version when the binary is unversioned.
I had the case on my machine where `lua` was version 5.4.4 and the
lua-lgi test succeeded fine, but then the demo plug-in would fail to run
with the error message from #11876.

Let's parse the output of `lua -v` to detect the version ourselves and
therefore be able to output proper error messages for packagers not to
assume that the Lua interpreter they are using will work fine.
2024-08-09 17:12:44 +02:00
Bruno
1c08f08e97 build/linux: Sync with Beta manifest updating gexiv2 and exiv2
Ported from: 3772514155

Just to note, ALL the previous "Sync with..." commits were tested in flathub
and gnome-nightly flatpaks, and this actual one (and future ones will be) too.
2024-08-09 11:48:07 -03:00
Kolbjørn Stuestøl
108f1a2d24 Update Norwegian Nynorsk translation 2024-08-09 14:46:27 +00:00
Jehan
063324cff0 extensions: install the lua interpreter for all non-relocatable builds.
As discussed in #11876, the interp files work fine on Linux (and other
platforms) too, and this allows to properly redirect to the working
interpreter found at configure time, without touching the scripts'
shebang.
2024-08-09 16:31:00 +02:00
Kolbjørn Stuestøl
7fd75ee074 Update Norwegian Nynorsk translation 2024-08-09 14:24:35 +00:00
Bruno
7037297526 meson: Prevent broken lua plug-ins
See: https://gitlab.gnome.org/GNOME/gimp/-/issues/11876

For 3.0 we will support only Lua 5.1, since we need to figure out how
much of the Lua 5.1 API is compatible with newer versions (Lua minor
versions aren't like Python minor versions, there is API breakage so
plug-ins would be completely unreliable, this commit prevent this).

Also, change some files to not force luajit since it isn't mandatory.
2024-08-09 12:26:26 +00:00
Alx Sa
f5d14a5d66 plug-ins: Convert custom GFig icons to vectors
As in f9df9805, adds SVG versions of GFig
custom icons and conditionally uses them if
have_vector_icons is enabled. If not, we
fall back to the original PNG icons.

Also resolves #10012 by adding white
outlines around the thin dark lines to
make them more visible in dark mode.
2024-08-09 11:30:44 +00:00
Jehan
84471f397a Issue #5331: use the $XDG_CONFIG_HOME config folder unconditionally.
This is the pendant commit to the one I'm going to commit on the beta
branch for RC1. There in fact was a way to always use the
$XDG_CONFIG_HOME folder, unconditionally (and prevent the weird
inconsistencies of having config folder in .var for some flatpak
installations and in XDG folder for others).

See: https://github.com/flathub/org.gimp.GIMP/pull/287
2024-08-09 13:12:04 +02:00
Jehan
21ac02eabb Issue #11401: inexistent fonts folder in MSIX installation directory.
Apparentely `makeappx` tool deletes empty folders and MSIX runs with
system paths read-only. So calling g_file_make_directory_with_parents()
is just not enough.

Therefore when opening font folders recursively for font parsing, let's
just ignore the specific error of non-existing folders.
2024-08-09 12:53:37 +02:00
Alx Sa
649d121380 plug-ins: Load layers in Sketchbook TIFFs
This patch adds support for loading Sketchbook
TIFF layers.
Alias/Autodesk Sketchbook used metadata tags
to store information about layers. This is a
separate implementation compared to Adobe,
stored in TIFFTAG_ALIAS_LAYER_METADATA.
The first directory contains the image metadata
and the layers are stored in SubIFDs, using the
same metadata tag for layer-specific properties
such as opacity and visibility.
2024-08-09 01:03:44 +00:00
Jehan
2fcdae277b app: fix canvas' size request with a scale factor != 1.0.
This is a followup of commit f2d47ee53a.
I realized that the window's size was too big for the case when there is
an image as well because the scale factor of 1.0 was hardcoded. We now
use the scale factor from the display the shell is displayed on.
2024-08-09 01:53:02 +02:00
Jehan
93cc81281c Issue #11317: make Python plug-ins mandatory.
Unlike the other bindings (Lua, JS, Vala) where we only have a demo
plug-in, we actually have a bunch of interesting and useful Python
plug-ins.

Furthermore, we are running several Python scripts through GIMP during
our build (to generate a few images), so pygobject becomes a build
dependency anyway, even if it may not be a run dependency with
-Dpython=disabled.

This all becomes a bit confusing and in fact handling this case (of not
installing Python plug-ins) seems like an annoyance while we lose good
core plug-ins. So let's just make Python plug-ins mandatory. It's not
like Python is very controversial these days, and AFAWK, it is available
on every platform out there.
2024-08-09 01:01:58 +02:00
Jehan
f2d47ee53a app: fix too big canvas with small display.
I was testing with a 2560×1440 display, yet with ×2 scale factor, which
is kinda equivalent with 1280×720 for scaled dimensions code.
And so anyway the default size request for an empty canvas was far too
big (bigger than the work area in fact).

I'm now using small default. As for the 3:1 ratio comment, not sure
about it, since shell_width is in fact changed to -1, so it feels very
specific to someone's setup. But anyway… I left the comment.
2024-08-09 00:26:36 +02:00
Alx Sa
2286a447c1 libgimpwidgets, app/core: Fix babl formats to float
This patch converts the last instances of
non-RGBA color models from double to
float for babl formats.
2024-08-08 21:44:53 +00:00
Alx Sa
3833ab2b1d libgimpwidgets: Convert CIE LCH(ab) babl format to float
This patch converts the
few instances of CIE LCH(ab) double
to float to match babl's precision.
2024-08-08 19:25:07 +00:00
Alx Sa
ddfb4d4f73 plug-ins: Fix crash when editing Gradient Flare
As Lloyd Konneker noted, the calc.sflare_list was not being
accessed at the right location when the Edit Dialog preview of
the gradient was updated. The API page for g_list_free_full ()
recommends using g_steal_pointer () to ensure the head element
is not left dangling. This aligns with other usage in the GIMP codebase
and seems to stop the crash. Additional safety checks were
also added.
2024-08-08 11:10:45 +00:00
Bruno
c95fe605cd build/windows: Add verbosity to MSIX script
Now, some basic things will be output on runner and others saved in winsdk.log
2024-08-07 21:53:37 -03:00
Bruno
c748b3d286 build/windows: Make 'clean' function more silent
This improves bundling script after c808d13b.

No need to a waterfall of "(INFO): cleaning" outputs, one is enough.
2024-08-07 21:53:34 -03:00
Luming Zh
cb796c57d6 Update Chinese (China) translation 2024-08-08 00:52:18 +00:00
Jehan
bf62c41bc9 app: also rename <Vectors> to <Paths> menu. 2024-08-07 19:33:48 +02:00
Anders Jonsson
438209c30a app: rename vectors-popup to paths-popup
GIMP crashed in the Paths menu since the name wasn't changed everywhere.

Fixes #11881
2024-08-07 18:22:48 +02:00
Alx Sa
b11ea66cf0 menus: Add option for "Huge" Preview Size
The GIMP_VIEW_SIZE_ENORMOUS enum setting was missing from
the Preview Size menu. This patch adds it in so that users have a
preview size option between Extra Large and Enormous.
2024-08-07 12:42:02 +00:00
Yuri Chornoivan
eb0f82cd39 Update Ukrainian translation 2024-08-07 11:43:36 +00:00
Yuri Chornoivan
f39d43bd9e Update Ukrainian translation 2024-08-07 11:39:53 +00:00
Yuri Chornoivan
abe156a2a2 Update Ukrainian translation 2024-08-07 11:38:31 +00:00
Alx Sa
498042b66c tools, xcf: Don't load gegl:nop filters
In earlier development, we accidentally
allowed users to save gegl:nop filters.
Since they are valid operations, they were
not triggering our unsupported operations
delete code. This patch adds a second
check to see if the operation is a nop, and
deletes it as well.
This patch also adds a check to make sure
a filter is in the filter stack before reordering
it. This was revealed by the nop bug, so
it makes sense to patch both at once.
2024-08-07 02:14:12 +00:00
Luming Zh
9cd5bc3bca Update Chinese (China) translation 2024-08-07 01:41:17 +00:00
Luming Zh
0d3e735451 Update Chinese (China) translation 2024-08-07 01:36:18 +00:00
Luming Zh
7a7e7f686c Update Chinese (China) translation 2024-08-07 01:33:43 +00:00
Bruno
1f24aa5f7c build/windows: Move splitting script to its right dir
Following 0199faac and 884b05f1

It's clearer than ever that this is an installer-only thing
so let's move the script to the right place.
2024-08-06 17:52:01 +00:00
Jehan
b93c77d014 gimp-data: update to go forward with #5507. 2024-08-06 19:35:07 +02:00
Jehan
f325c27c93 Issue #11630: Improve Welcome Dialog height on small screens.
Improve the previous commit with a bit more subtlety:

* Try to get the proper monitor (if the the widget's window is already
  realized).
* While we try not to display too small an image (quarter of work area),
  we also try not to display it too big (third of the work area).
* After the image has been loaded and displayed, the dialog will likely
  reallocate to its finale size. When this happens, we should check if
  it's not higher than work area. Only then should we try to make the
  first page scrollable. Not only this, but we also queue the window for
  resize (otherwise it's too late, the window is already too big).
  This later point avoid having ugly scrollbars when unneeded (i.e. when
  the dialog is perfectly fitting within the work area).
2024-08-06 17:16:27 +02:00
Alx Sa
766e7325ff dialogs: Improve Welcome Dialog height on small screens
This patch makes the first page of the
Welcome Dialog scrollable vertically.
This should help reduce the screen height
for users with smaller screen sizes.
2024-08-06 17:16:09 +02:00
Bruno
5891854fa6 build/windows: Don't pollute source nor screen when installing Inno
Don't download Inno in-source and don't display annoying dialogs anymore
for better quality of life.
2024-08-06 13:27:03 +00:00
Bruno
1656a807d6 build/windows: Don't pollute source when creating installer
Until now, the installer script had a very invasive behavior of copying
things from _build. Let's stop this since it is extremely annoying.
2024-08-06 13:27:03 +00:00
Jehan
deea10ed82 libgimp: fixing python unit test for GimpUnit API. 2024-08-06 14:32:25 +02:00
Martin
c5119afc39 Update Slovenian translation 2024-08-06 11:26:00 +00:00
Martin
2d4c7e38b8 Update Slovenian translation 2024-08-06 11:25:13 +00:00
Martin
6fdfdebd17 Update Slovenian translation 2024-08-06 11:24:09 +00:00
Jehan
cde861a0e6 app, libgimpwidgets: fixing some obsolete unit format strings I missed. 2024-08-06 13:13:24 +02:00
Jehan
68242eb0cc libgimp: properly initialize GIMP_TYPE_UNIT.
Fixes:

> (file-png:318550): LibGimp-CRITICAL **: 12:44:57.852: gimp_gp_param_to_value: type name GimpUnit is not registered
2024-08-06 12:45:19 +02:00
Jehan
2a00a9e60a Issue #434: remove broken plural support for GimpUnit.
Rather than trying to implement full i18n plural support, we just remove
this failed attempt from the past. The fact is that to get proper
support, we'd basically need to reimplement a Gettext-like plural
definition syntax within our API, then ask people to write down this
plural definition for their language, then to write every plural form…
all this for custom units which only them will ever see!

Moreover code investigation shows that the singular form was simply
never used, and the plural form was always used (whatever the actual
unit value displayed).

As for the "identifier", this was a text which was never shown anywhere
(except in the unit editor) and for all built-in units, as well as
default unitrc units, it was equivalent to the English plural value.

So we now just have a unique name which is the "long label" to be used
everywhere in the GUI, and abbreviation will be basically the "short
label". That's it. No useless (or worse, not actually usable because it
was not generic internationalization) values anymore!
2024-08-06 11:39:57 +02:00
Jehan
a9af5509ab app: fix crashes after having closed Colors dockable.
Various signal handlers must be removed when the dockable is closed, by
using g_signal_connect_object() when relevant.
2024-08-06 11:39:57 +02:00
Bruno
64e44ca490 build/windows: Prevent contributors from bundling GIMP wrongly
This makes the bundling script an "extension" of the building script, similar
to what Cmake-based projects does on Windows. By the way, this is inline with
the recent changes which clarified that bundling is just a finalization of the
building process when a bundle is aimed. See: d09a2a6f, 2dc6f411 and 9d86492b
2024-08-05 15:16:47 +00:00
Martin
5f142dec44 Update Slovenian translation 2024-08-05 13:50:49 +00:00
Yuri Chornoivan
f6c02d3309 Update Ukrainian translation 2024-08-05 13:43:57 +00:00
Jehan
f75e0aa321 app: fix random crash when GimpColorHistory is finalized.
I encountered this one when closing GIMP. Issue #9591 seems to be the
same crash, though when just closing the Colors dockable. I fail to
reproduce willingly now, though it looks like the problem could happen
in some cases when the stored GimpContext is freed before
GimpColorHistory is freed.
Let's increment the reference to make sure the referenced object stays
alive as long the history is alive.
2024-08-05 13:20:44 +02:00
Jehan
970fc86548 meson: bump harfbuzz's minimum requirement to version 2.8.2.
Commit 81a68ae758 added usage of hb_blob_create_from_file_or_fail().

Since Debian bookworm has harfbuzz 6.0.0, this is not a big deal, but
the minimum requirement should still be bumped in our build scripts.
2024-08-05 12:36:57 +02:00
Jehan
d11e45967f po: mass fix changed gettext context: s/vectors-action/paths-action/
Normally we should avoid touching the Gettext files, but changing a
message context massively broke many strings in all languages. So I am
just reassigning the correct context (not touching any translations), by
running:

> sed 's/msgctxt "vectors-action"/msgctxt "paths-action"/g' -i po/*
2024-08-05 12:36:57 +02:00
Jehan
cb18908d15 app, menus: rename the files too.
I did it in 2 commits otherwise git has a hard time seeing the move+edit
as a file move and the `git show` on previous commit is much less
useful.
2024-08-05 12:08:59 +02:00
Jehan
d46d26933b app, menus: rename all "vectors-" actions to "paths-".
Though these are not as user-facing as other strings, the action names
still are somewhat user-facing. Let's rename them consistently with the
GUI and the API.

This commit also handles user config migration so that custom shortcuts
are not lost.
2024-08-05 12:08:59 +02:00
Alx Sa
6bbaaeb39e dialogs, gui, widgets: Connect GimpPrefsBox to icon size changes
Inspired by Mark Sweeney's work.
This patch allows the icons in the tree
view in Preferences Dialog to scale based
on user icon scale preferences.
Rather than add a GimpGuiConfig to
GimpPrefsBox, we make a call to style_updated ()
from the Preferences Dialog to signal a
change.
2024-08-04 12:55:58 +00:00
Luming Zh
86cf17e09c Update Chinese (China) translation 2024-08-04 11:28:39 +00:00
Luming Zh
8709628299 Update Chinese (China) translation 2024-08-04 11:18:21 +00:00
Luming Zh
afa3bb5a6a Update Chinese (China) translation 2024-08-04 11:12:42 +00:00
Idriss Fekir
73557d011b text: keep fonts usable if the current one becomes missing
If a font is being used and becomes missing all other fonts become
unusable, setting the fontconfig object to the pango fontmap
fixes this.
2024-08-04 11:02:09 +01:00
Idriss Fekir
fe32265b61 GimpText: Fix saving to xcf with text in an alias font
Alias fonts don't have a generated name, their alias name is used
instead. But the serialization code assumed that all fonts had a
generated name of the format "gimpfont%d" and this was causing a crash.
2024-08-04 11:02:09 +01:00
Idriss Fekir
81a68ae758 GimpFontFactory: More reliable font checking
check for font validity (whether it is usable by pango), using
harfbuzz instead of relying on file extentions.

We do this in the first place because pango when given a font it can't
support will look for the closest matching supported font, but we
iterate through all fonts, so that would create redundancy.
2024-08-04 11:02:09 +01:00
Idriss Fekir
cd26f49b7a GimpFont: Improve font matching with old XCF files
Compare the font file gotten from the PangoFont object
related to the PangoFontDescription rather than just comparing
font names. This Helps because when pango is given an unsupported
font (Type1 or Bitmap fonts) it choses the closest matching ttf/otf
font, but reports the name of the unsupported font.
2024-08-04 11:02:09 +01:00
Bruno
180f6e1aa0 build/windows: Install crossroad deps in gimp job too
I forgot about it in 101bcca329
2024-08-03 20:25:19 -03:00
Bruno
748908aaf0 gitlab-ci, build/windows: Use Universal variables in native gimp-console wrapper 2024-08-03 20:22:42 -03:00
Yuri Chornoivan
6f387d94b3 Update Ukrainian translation 2024-08-03 18:28:53 +00:00
Yuri Chornoivan
3536841667 Update Ukrainian translation 2024-08-03 18:27:24 +00:00
Yuri Chornoivan
d08d095b6f Update Ukrainian translation 2024-08-03 18:26:05 +00:00
Alx Sa
5161c53f3c libgimpwidgets: Make GimpPickButton a derivable type
Per Jehan, we should remove gimppickbutton-default.[ch] and
move the functions into gimppickbutton.c. Then we can
make the GimpPickButtonPrivate API actually private without
any additional public functions.
2024-08-03 18:24:46 +00:00
Alx Sa
0d112b2999 themes: Define background color for GtkToolBar
This widget is used primarily in plug-ins like GFig and IFS Compose
which have toolbar buttons. This patch explicitly defines the style to
prevent system theme leaks and too dark colors on Middle Gray theme.
2024-08-03 12:20:06 +00:00
Jehan
be0a4ab12a Issue #11828: Lock Path stroke not working as expected.
The "selected-layers-changed" signal was emitted while there were still
selected channels (which is an inconsistent state). And since
gimp_image_get_selected_drawables() returns selected channels first when
the image has any, vectors_actions_update() was using the previously
selected channel's lock information for deciding which actions to set
sensitive.
2024-08-03 13:34:17 +02:00
Martin
4bef89d0e5 Update Slovenian translation 2024-08-03 10:49:07 +00:00
Jehan
9f5db5c153 Issue #11828: reverting a string change in commit f036812a94.
This had already been handled in commit 8bd3d5e0bb, but somehow the old
name slipped back in commit f036812a94.
2024-08-03 12:45:50 +02:00
Martin
bd7bda57b1 Update Slovenian translation 2024-08-03 10:21:03 +00:00
Martin
805c6a3e8a Update Slovenian translation 2024-08-03 10:19:45 +00:00
Martin
76b264a607 Update Slovenian translation 2024-08-03 10:15:09 +00:00
Alx Sa
f759b17e45 libgimpwidgets: Reverting GimpPickButton for 80f09fac
Temporarily reverting as the private struct
is shared between various OS versions of
the object and needs to be accessible.
A different approach will be needed to resolve,
and until then, I'd like the Debian pipeline to
work properly.
2024-08-03 08:08:31 +00:00
Alx Sa
80f09fac59 libgimpwidgets: Finish converting classes to derivable type 2024-08-03 06:39:55 +00:00
Ekaterine Papava
c1a40a18d3 Update Georgian translation 2024-08-03 04:39:19 +00:00
Ekaterine Papava
aa269997d2 Update Georgian translation 2024-08-03 04:37:35 +00:00
Alx Sa
175b50ead5 libgimpthumb, app: Make gimpthumbnail attributes private
Move all public attributes of GimpThumbnail
from the header to a private struct in
GimpThumbnail.c. Also replace direct
access of these attributes in app/core and
app/widget with get/set calls.
2024-08-03 04:25:33 +00:00
Alx Sa
438bc4f229 libgimp, libgimpmodule, libgimpwidgets: Port more widgets to derivable type 2024-08-03 02:48:07 +00:00
Jehan
8d598ec3a3 NEWS: update. 2024-08-03 02:23:31 +02:00
Andre Klapper
be944b20c5 Rename "Intelligent Scissors" menu item to "Scissors Select"
Be consistent with tool dialog and tooltip.

Fixes #10793
2024-08-03 00:02:49 +00:00
Jehan
bc73232cd9 app, libgimpwidgets: fix CRITICAL on NULL GimpUnit.
I missed this one because it was using 0 instead of the GIMP_UNIT_PIXEL
macro. This was triggering CRITICALs when using the text tool.
2024-08-03 01:50:27 +02:00
Jehan
07196f371b Issue #11865: properly pass ui_meta() from GeglParamColor to GimpParamColor. 2024-08-03 01:50:27 +02:00
Anders Jonsson
9219c1eaba libgimp, plug-ins: update POTFILES.in 2024-08-02 23:02:36 +00:00
Jacob Boerema
0610f60014 libgimp: fix #11421 Some legacy filters have lost their Help button
Legacy plug-ins like Checkerboard (legacy) under Render Patterns lost
their Help button, although using F1 was still working.

Due to changes in how procedures are called, `gimp_dialog_constructed`
was called before the help-id was set.
The simplest way to fix this, is to call
 `G_OBJECT_CLASS (parent_class)->constructed (object);`
at a later time in `gimp_procedure_dialog_constructed` after we have
set the help-id there.
2024-08-02 20:50:29 +00:00
Jehan
f8fa0d056d libgimp: fix annotation. 2024-08-02 20:33:46 +02:00
Jehan
ea7e1bcc85 libgimpconfig: fixing resetting GeglColor and GimpUnit properties to default values.
After fixing GeglColor arguments in filters, I realized that these
parameters cannot even be resetted (button "Reset" of GEGL filters).
2024-08-02 19:25:33 +02:00
Jehan
318342039d Issue #11422: gimp_prop_widget_new_from_pspec: not supported: GeglParamColor
In all core code, transform GeglParamColor to GimpParamColor with alpha.
2024-08-02 18:44:00 +02:00
Alx Sa
048b2c437d libgimp, libgimpcolor, libgimpconfig: Convert to derivable types
Also converted GimpPreview and
GimpScrolledPreview as they are the
parents of several of these widgets.
2024-08-02 14:02:30 +00:00
Jehan
eb1e21f9f7 libgimpbase: some code cleanup I missed. 2024-08-02 15:47:08 +02:00
Jehan
6f4f1e8ccd libgimpbase: remove Returns annotation on function without return value!
Fixes:

> libgimpbase/gimpchoice.c:366: Warning: Gimp: gimp_choice_set_sensitive: invalid return annotation

Introspection step is now fully without any warning! \o/
2024-08-02 14:23:18 +02:00
Jehan
1add3343ad libgimpbase: removing wrong annotations.
I thought that such annotations would work and be useful to tell GIR that
a type is nothing more than a NULL-terminated array of a specific type.
But apparently GIR doesn't like these annotations and complain. So let's
just clean these out.

Fixes:

> ./../../../../../../dev/src/gimp/libgimpbase/gimpparamspecs.h:254: Warning: Gimp: unexpected annotation: array
> ../../../../../../../dev/src/gimp/libgimpbase/gimpparamspecs.h:254: Warning: Gimp: unexpected annotation: element-type
2024-08-02 14:18:44 +02:00
Jehan
624e3772e9 libgimp: new unit tests around GimpImage and item API.
Right now, it only tests a few API, such as creating an image, then a
text layer, then inserting it in the image.

This is a test to avoid regression bug after having fixed #9923 in a
previous commit.
2024-08-02 14:12:10 +02:00
Jehan
c1fec7809b meson: built-time run of GIMP should set GIMP3_SYSCONFDIR environment variable.
Without this, build-time GIMP cannot find the etc/ files unless GIMP is
installed. This becomes even more annoying now as I want to run tests
(for GimpUnit) depending on etc/unitrc contents.

This will also ensure that tests run properly in environments where the
etc/unitrc may have been modified.
2024-08-02 12:46:31 +02:00
Jehan
a92e694a19 libgimp: new unit tests for GimpUnit. 2024-08-02 12:14:54 +02:00
Jehan
d493f0537f Issue #8900 and #9923: reimplementing GimpUnit as a proper class.
This fixes all our GObject Introspection issues with GimpUnit which was
both an enum and an int-derived type of user-defined units *completing*
the enum values. GIR clearly didn't like this!

Now GimpUnit is a proper class and units are unique objects, allowing to
compare them with an identity test (i.e. `unit == gimp_unit_pixel ()`
tells us if unit is the pixel unit or not), which makes it easy to use,
just like with int, yet adding also methods, making for nicer
introspected API.

As an aside, this also fixes #10738, by having all the built-in units
retrievable even if libgimpbase had not been properly initialized with
gimp_base_init().
I haven't checked in details how GIR works to introspect, but it looks
like it loads the library to inspect and runs functions, hence
triggering some CRITICALS because virtual methods (supposed to be
initialized with gimp_base_init() run by libgimp) are not set. This new
code won't trigger any critical because the vtable method are now not
necessary, at least for all built-in units.

Note that GimpUnit is still in libgimpbase. It could have been moved to
libgimp in order to avoid any virtual method table (since we need to
keep core and libgimp side's units in sync, PDB is required), but too
many libgimpwidgets widgets were already using GimpUnit. And technically
most of GimpUnit logic doesn't require PDB (only the creation/sync
part). This is one of the reasons why user-created GimpUnit list is
handled and stored differently from other types of objects.

Globally this simplifies the code a lot too and we don't need separate
implementations of various utils for core and libgimp, which means less
prone to errors.
2024-08-02 10:46:38 +02:00
Alx Sa
f9df980585 plug-ins: Convert custom ImageMap icons to vectors
Adds SVG versions of ImageMap custom
icons and conditionally uses them if
have_vector_icons is enabled. If not, we
fall back to the original PNG icons.
Since ImageMap mixes custom and
stock icons, this keeps the icon size
consistent across the UI.

Per Denis Rangelov, tooltips for the
coordinates and area displays as well
as the shortcut menu were added.

Also, removes a reference to IMAP_ARROW
which no longer applies since that icon
was removed in favor of using the stock
cursor icon.
2024-08-02 00:01:55 +00:00
Bruno
75446c4316 gitlab-ci: Clarify a bit better Debian 'build' deps
Clang and others are not GIMP deps 'per se'. GCC also exists.
2024-08-01 19:12:05 -03:00
Bruno
101bcca329 gitlab-ci, build/windows: Separate (again) Debian and Crossroad deps
Despite the good intentions, 4f965557 makes Debian contributors who
follows gimp-web-devel instructions to download more deps than needed
and makes unclear what are the crossroad deps. Let's fix it.
2024-08-01 18:18:34 -03:00
Alx Sa
afce1c1f02 libgimpwidgets: Convert more gimpwidgets to derivable type
Continuation of work from 74e7e16e
2024-08-01 03:55:31 +00:00
Alx Sa
9b6e6effeb libgimpwidgets: Make GimpButton a derivable type 2024-07-30 19:04:53 +00:00
Bruno
f73bf7fb07 build/windows: Make sources downloading more neutral
This makes crossroad and msys2 scripts clone without the "_" prefix, which
will improve quality of life of most contributors that just clone them.

Just for consistency, also remove the "_" prefix from other pices of code.
2024-07-30 13:05:09 -03:00
Alx Sa
47c7bfba29 libgimp: Make GimpProgressBar a final type 2024-07-30 13:52:26 +00:00
Yuri Chornoivan
f543b2c799 Update Ukrainian translation 2024-07-30 11:58:04 +00:00
Bruno
bd28861785 build/windows: Refactor MSIX .ps1 a bit to not impose strict SDK or .msixbundle
The original script required a specific WinSDK version. Now, it autodetects.
This is useful if we need to move to another runner and welcome locally too.

Also, downloading the arm64 artifact was mandatory to get a x64 msix, which
is silly. Now, packagers are free to package to either arm64 or x64 alone.
This is useful locally but could be useful on CI too when some arch fail(?).
2024-07-29 18:45:01 -03:00
Alx Sa
60897f1700 plug-ins: Unreference image used in PSD metadata loading
Resolves #11313.
We reference JPEG and TIFF images when
we send them from their loading plug-ins
to the PSD plug-in for PSD formatted
metadata. We should remove this extra
reference when returning the image back
to its original loading plug-in.
2024-07-29 16:10:17 +00:00
Luming Zh
3b4b5e2479 Update Chinese (China) translation 2024-07-29 12:16:19 +00:00
Ekaterine Papava
c7e92ae43d Update Georgian translation 2024-07-29 04:31:54 +00:00
Alx Sa
74e7e16ec3 libgimpwidgets: Convert widgets to final/derived type
This patch converts libgimpwidgets with
no signals to be final or derived types.
The remaining widgets will be converted
in a subsequent patch.
2024-07-29 01:51:38 +00:00
Alx Sa
70ae12eb16 widgets, gui: Connect GimpToolBox to icon size changes
Inspired by Mark Sweeney's work.
This patch allows the active image, brush,
pattern, and gradient areas in the toolbox
to scale based on user icon scale
preferences.
Note that if the pattern itself is smaller
than the icon size, it currently won't scale
larger. This is a separate issue in the
renderer.
2024-07-28 13:25:51 +00:00
Martin
c1ec6a5c0b Update Slovenian translation 2024-07-28 13:11:09 +00:00
Anders Jonsson
f9711673b8 plug-ins: remove parenthesis in string 2024-07-28 12:16:32 +00:00
Bruno
87aabad121 build/linux: Clarify some flatpak scripts comments 2024-07-28 11:02:17 +00:00
Alx Sa
d73c71e861 libgimpcolor: Make GimpColorProfile a final type 2024-07-28 05:28:31 +00:00
Bruno
641f58b801 build/linux: Sync with beta manifest regarding mess
Ported from: b67fdab3bc
2024-07-27 21:43:13 -03:00
Yuri Chornoivan
e4643ba55c Update Ukrainian translation 2024-07-27 13:12:08 +00:00
Martin
79ffa712f5 Update Slovenian translation 2024-07-27 09:04:25 +00:00
Luming Zh
841e7ff7f3 Update Chinese (China) translation 2024-07-27 00:36:32 +00:00
Alx Sa
6effe7d38c plug-ins: Port int_combo properties to GimpChoice
web-page.c was left as additional font
sizes besides the GUI choices could be set
via a PDB call. The export plug-ins int
combos will be updated in a separate
merge request.
Additionally, the region choice in screenshot.c
was hidden on Windows since it does not
yet implement that option.
2024-07-26 18:56:53 +00:00
Alx Sa
acefb593c1 libgimpwidgets: Make GimpRuler a final type 2024-07-26 16:51:51 +00:00
Martin
08f6184e14 Update Slovenian translation 2024-07-26 16:26:43 +00:00
Alx Sa
b7532766ad plug-ins: Allow Zoom Out in ImageMap
This patch converts the image map
plug-in to use a floating point ratio rather
than an integer zoom factor. This allows
us to zoom out past the 1:1 ratio.
Additionally, it fixes the statusbar display
so that it shows 2:1 for zoomed in rather
than 1:2.
2024-07-26 13:33:51 +00:00
Luming Zh
c700e7d48f Update Chinese (China) translation 2024-07-26 12:58:51 +00:00
Bruno
12c2680c4f build/linux: Move 'suitesparse' to GEGL module
'suitesparse' is NOT a direct GIMP dependency!
2024-07-24 21:37:58 +00:00
Jehan
accc9011ed NEWS: update. 2024-07-24 19:14:50 +02:00
Bruno
c100b01031 build: Add support to running build scripts in their respective dirs
It's perfectly reasonable that someone can misunderstand the scripts info in
gimp-web-devel and try to run them not from git root but from their dirs. So,
let's add that possibility as a fallback (a pretty natural one by the way).

Also, change the error message to direct contributors to gimp-web-devel.
2024-07-24 15:37:10 +00:00
Jehan
cc17e3456c libgimpbase: make GimpMetadata a finale type. 2024-07-24 16:20:34 +02:00
Alx Sa
45f390ffc4 display, gui: Connect GimpDisplayShell to icon size changes
Inspired by Mark Sweeney's work.
This patch allows the four buttons on the
sides of the canvas (Zoom, Quick Mask,
Image Menu, and Navigation Image)
to resize based on the user's icon size
preferences.
2024-07-23 22:01:55 +00:00
Andrzej Hunt
fe26086e16 xcf: don't use potentially dangling pointer in xcf_load_layer_mask
layer_mask points to the original mask created by xcf_load_layer_mask. We copy
this pointer into channel, and xcf_load_channel_props can overwrite this
pointer and free the original mask. If this happens, layer_mask points to
the now-freed original mask, and should not be used.

Therefore we need to change later parts of xcf_load_layer_mask to use channel
instead of layer_mask. Additionally, we add a block and move layer_mask into
this block to guarantee that layer_mask cannot be used after it has
potentially been freed.

Adjustments by Jacob Boerema:
Follow GIMP's code style regarding variables, comment style and
position of braces

See also ASAN output below:

==5247==ERROR: AddressSanitizer: heap-use-after-free on address 0x615000010fd0 at pc 0x7f4e2dbbf31b bp 0x7ffca8a95cd0 sp 0x7ffca8a95cc8
READ of size 8 at 0x615000010fd0 thread T0
    #0 0x7f4e2dbbf31a in g_type_check_instance_cast /home/ahunt/git/glib/_build/../gobject/gtype.c:4117:26
    #1 0xb200fe in xcf_load_layer_mask /home/ahunt/git/gimp/app/xcf/xcf-load.c:2305:52
    #2 0xb18eea in xcf_load_layer /home/ahunt/git/gimp/app/xcf/xcf-load.c:2133:20
    #3 0xb13d91 in xcf_load_image /home/ahunt/git/gimp/app/xcf/xcf-load.c:499:15
    #4 0xb11deb in xcf_load_stream /home/ahunt/git/gimp/app/xcf/xcf.c:305:19
    #5 0x619dfd in LLVMFuzzerTestOneInput /home/ahunt/git/gimp/app/fuzzers/xcf_fuzzer.c:50:17
    #6 0x51d364 in fuzzer::Fuzzer::ExecuteCallback(unsigned char const*, unsigned long) /home/abuild/rpmbuild/BUILD/llvm-12.0.0.src/build/../projects/compiler-rt/lib/fuzzer/FuzzerLoop.cpp:599:15
    #7 0x506fe2 in fuzzer::RunOneTest(fuzzer::Fuzzer*, char const*, unsigned long) /home/abuild/rpmbuild/BUILD/llvm-12.0.0.src/build/../projects/compiler-rt/lib/fuzzer/FuzzerDriver.cpp:323:6
    #8 0x50d350 in fuzzer::FuzzerDriver(int*, char***, int (*)(unsigned char const*, unsigned long)) /home/abuild/rpmbuild/BUILD/llvm-12.0.0.src/build/../projects/compiler-rt/lib/fuzzer/FuzzerDriver.cpp:856:9
    #9 0x5373a2 in main /home/abuild/rpmbuild/BUILD/llvm-12.0.0.src/build/../projects/compiler-rt/lib/fuzzer/FuzzerMain.cpp:20:10
    #10 0x7f4e2c84c349 in __libc_start_main (/lib64/libc.so.6+0x24349)
    #11 0x4e0779 in _start /home/abuild/rpmbuild/BUILD/glibc-2.26/csu/../sysdeps/x86_64/start.S:120

0x615000010fd0 is located 336 bytes inside of 504-byte region [0x615000010e80,0x615000011078)
freed by thread T0 here:
    #0 0x5e8562 in free /home/abuild/rpmbuild/BUILD/llvm-12.0.0.src/build/../projects/compiler-rt/lib/asan/asan_malloc_linux.cpp:127:3
    #1 0x7f4e2d76ce08 in g_free /home/ahunt/git/glib/_build/../glib/gmem.c:199:3
    #2 0x7f4e2d797a6b in g_slice_free1 /home/ahunt/git/glib/_build/../glib/gslice.c:1183:7
    #3 0x7f4e2dbb7b04 in g_type_free_instance /home/ahunt/git/glib/_build/../gobject/gtype.c:2008:5
    #4 0x7f4e2db8fe3a in g_object_unref /home/ahunt/git/glib/_build/../gobject/gobject.c:3604:11
    #5 0xb22fff in xcf_load_channel_props /home/ahunt/git/gimp/app/xcf/xcf-load.c:1738:13
    #6 0xb20037 in xcf_load_layer_mask /home/ahunt/git/gimp/app/xcf/xcf-load.c:2292:9
    #7 0xb18eea in xcf_load_layer /home/ahunt/git/gimp/app/xcf/xcf-load.c:2133:20
    #8 0xb13d91 in xcf_load_image /home/ahunt/git/gimp/app/xcf/xcf-load.c:499:15
    #9 0xb11deb in xcf_load_stream /home/ahunt/git/gimp/app/xcf/xcf.c:305:19
    #10 0x619dfd in LLVMFuzzerTestOneInput /home/ahunt/git/gimp/app/fuzzers/xcf_fuzzer.c:50:17
    #11 0x51d364 in fuzzer::Fuzzer::ExecuteCallback(unsigned char const*, unsigned long) /home/abuild/rpmbuild/BUILD/llvm-12.0.0.src/build/../projects/compiler-rt/lib/fuzzer/FuzzerLoop.cpp:599:15
    #12 0x506fe2 in fuzzer::RunOneTest(fuzzer::Fuzzer*, char const*, unsigned long) /home/abuild/rpmbuild/BUILD/llvm-12.0.0.src/build/../projects/compiler-rt/lib/fuzzer/FuzzerDriver.cpp:323:6
    #13 0x50d350 in fuzzer::FuzzerDriver(int*, char***, int (*)(unsigned char const*, unsigned long)) /home/abuild/rpmbuild/BUILD/llvm-12.0.0.src/build/../projects/compiler-rt/lib/fuzzer/FuzzerDriver.cpp:856:9
    #14 0x5373a2 in main /home/abuild/rpmbuild/BUILD/llvm-12.0.0.src/build/../projects/compiler-rt/lib/fuzzer/FuzzerMain.cpp:20:10
    #15 0x7f4e2c84c349 in __libc_start_main (/lib64/libc.so.6+0x24349)

previously allocated by thread T0 here:
    #0 0x5e87cd in malloc /home/abuild/rpmbuild/BUILD/llvm-12.0.0.src/build/../projects/compiler-rt/lib/asan/asan_malloc_linux.cpp:145:3
    #1 0x7f4e2d76ccf2 in g_malloc /home/ahunt/git/glib/_build/../glib/gmem.c:106:13
    #2 0x7f4e2d7972e0 in g_slice_alloc /home/ahunt/git/glib/_build/../glib/gslice.c:1072:11
    #3 0x7f4e2d7978ae in g_slice_alloc0 /home/ahunt/git/glib/_build/../glib/gslice.c:1098:18
    #4 0x7f4e2dbb6e0a in g_type_create_instance /home/ahunt/git/glib/_build/../gobject/gtype.c:1911:17
    #5 0x7f4e2db9215e in g_object_new_internal /home/ahunt/git/glib/_build/../gobject/gobject.c:1945:24
    #6 0x7f4e2db91d1f in g_object_new_valist /home/ahunt/git/glib/_build/../gobject/gobject.c:2288:16
    #7 0x7f4e2db90e8b in g_object_new /home/ahunt/git/glib/_build/../gobject/gobject.c:1788:12
    #8 0xdb69e0 in gimp_item_new /home/ahunt/git/gimp/app/core/gimpitem.c:723:10
    #9 0xce11c8 in gimp_drawable_new /home/ahunt/git/gimp/app/core/gimpdrawable.c:1067:14
    #10 0xddf5d8 in gimp_layer_mask_new /home/ahunt/git/gimp/app/core/gimplayermask.c:254:5
    #11 0xb1ffc5 in xcf_load_layer_mask /home/ahunt/git/gimp/app/xcf/xcf-load.c:2279:31
    #12 0xb18eea in xcf_load_layer /home/ahunt/git/gimp/app/xcf/xcf-load.c:2133:20
    #13 0xb13d91 in xcf_load_image /home/ahunt/git/gimp/app/xcf/xcf-load.c:499:15
    #14 0xb11deb in xcf_load_stream /home/ahunt/git/gimp/app/xcf/xcf.c:305:19
    #15 0x619dfd in LLVMFuzzerTestOneInput /home/ahunt/git/gimp/app/fuzzers/xcf_fuzzer.c:50:17
    #16 0x51d364 in fuzzer::Fuzzer::ExecuteCallback(unsigned char const*, unsigned long) /home/abuild/rpmbuild/BUILD/llvm-12.0.0.src/build/../projects/compiler-rt/lib/fuzzer/FuzzerLoop.cpp:599:15
    #17 0x506fe2 in fuzzer::RunOneTest(fuzzer::Fuzzer*, char const*, unsigned long) /home/abuild/rpmbuild/BUILD/llvm-12.0.0.src/build/../projects/compiler-rt/lib/fuzzer/FuzzerDriver.cpp:323:6
    #18 0x50d350 in fuzzer::FuzzerDriver(int*, char***, int (*)(unsigned char const*, unsigned long)) /home/abuild/rpmbuild/BUILD/llvm-12.0.0.src/build/../projects/compiler-rt/lib/fuzzer/FuzzerDriver.cpp:856:9
    #19 0x5373a2 in main /home/abuild/rpmbuild/BUILD/llvm-12.0.0.src/build/../projects/compiler-rt/lib/fuzzer/FuzzerMain.cpp:20:10
    #20 0x7f4e2c84c349 in __libc_start_main (/lib64/libc.so.6+0x24349)

SUMMARY: AddressSanitizer: heap-use-after-free /home/ahunt/git/glib/_build/../gobject/gtype.c:4117:26 in g_type_check_instance_cast
Shadow bytes around the buggy address:
  0x0c2a7fffa1a0: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd
  0x0c2a7fffa1b0: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd
  0x0c2a7fffa1c0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x0c2a7fffa1d0: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd
  0x0c2a7fffa1e0: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd
=>0x0c2a7fffa1f0: fd fd fd fd fd fd fd fd fd fd[fd]fd fd fd fd fd
  0x0c2a7fffa200: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fa
  0x0c2a7fffa210: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x0c2a7fffa220: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x0c2a7fffa230: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x0c2a7fffa240: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
Shadow byte legend (one shadow byte represents 8 application bytes):
  Addressable:           00
  Partially addressable: 01 02 03 04 05 06 07
  Heap left redzone:       fa
  Freed heap region:       fd
  Stack left redzone:      f1
  Stack mid redzone:       f2
  Stack right redzone:     f3
  Stack after return:      f5
  Stack use after scope:   f8
  Global redzone:          f9
  Global init order:       f6
  Poisoned by user:        f7
  Container overflow:      fc
  Array cookie:            ac
  Intra object redzone:    bb
  ASan internal:           fe
  Left alloca redzone:     ca
  Right alloca redzone:    cb
  Shadow gap:              cc
==5247==ABORTING
./crash-0507799c3e4291570e060f53332b58b8a96f95e5
2024-07-23 13:30:33 -04:00
Kolbjørn Stuestøl
62ab75661b Update Norwegian Nynorsk translation 2024-07-22 19:09:32 +00:00
Alx Sa
42300d9db0 dialogs, libgimpwidgets: Prevent wide dialogs due to image/profile name
Currently if your image history includes an
image with a long name, the Welcome
Dialog will stretch out to match its width.
If the color profile name is long, then the
color scales will also stretch out due to
the profile label.
This patch adds ellipses to the Welcome
Dialog and a scrollwindow to the
ColorScales to prevent this.
2024-07-22 16:32:47 +00:00
Luming Zh
21f74286db Update Chinese (China) translation 2024-07-22 12:34:43 +00:00
Luming Zh
0b6e9ade42 Update Chinese (China) translation 2024-07-22 11:02:57 +00:00
Yuri Chornoivan
04de26d379 Update Ukrainian translation 2024-07-22 05:56:49 +00:00
Martin
5f4c101935 Update Slovenian translation 2024-07-21 20:02:04 +00:00
Bruno
08294f9c34 build/linux: Sync with beta manifest regarding x265
Ported from ca5688bf6d

Just to note, we are already not using Assembly code
in 10bit and 12bit libraries. So, no feature dropped.

---

Also, little fixes to some dev docs regarding Clang.
2024-07-21 19:33:01 +00:00
Alx Sa
36f5956f3b plug-ins: Add warning about multi-layer indexed PSD export
Unlike GIMP, Photoshop does not support indexed images with
multiple layers. We have been silently merging layers down when
exporting to PSD, but this may be confusing to users.
This patch adds a label that notifies the user if they export an
indexed image with more than one layer.
2024-07-21 18:36:24 +00:00
Alx Sa
9d40d79e4a gui, widgets: Scale Swap & Default Color icons...
...based on icon size preferences.
Inspired by Mark Sweeney's work.
Since the icon size is based on a formula,
the CSS value determines the maximum
size rather than being used directly.
2024-07-21 03:05:43 +00:00
bootchk
4a50143ba6 Fix 9066 Encapsulate access to dock_columns of dock_window
Needs backport to 2.10

gimp_dock_windows_constructed creates a GimpDockColumns, a child widget,
and keeps a private reference to it at dock_window->p->dock_columns.
Then it connects the signal dock_columns.doc_removed to two callbacks:
gimp_dock_window_dock_removed() and gimp_dock_window_update_title().
gimp_dock_window_dock_removed() callback is called first and can
destroy the GimpDockWindow widget and its child widget GimpDockColumns.
Then gimp_dock_window_update_title is called
and tries to call dock_window->p->dock_columns.get_docks()
but it is already destroyed.

The fix is to nullify the internal pointer to dock_columns when destroyed,
and encapsulate access to dock_columns.get_docks so that it
returns a valid but empty list when dock_columns has already been destroyed.

Alternatively, you might be able to fix it by rearranging the order
of connections to dock-removed signal, but then the title would be wrong.

Another alternative might be to rethink the whole destruction sequence.
2024-07-20 21:26:59 +00:00
Bruno
a90ee6f196 build: Make infos, warnings and errors outputs consistent
This verbose style is inspired by 2_bundle-gimp-uni_dep.py
2024-07-20 21:09:47 +00:00
Bruno
617a49fa75 build: Slightly improve script comments to match gimp-web-devel
Also, fix an inconsistency in the local compatibility of flatpak deps script.
2024-07-20 21:09:47 +00:00
Bruno
e01973b911 build: Simplify all the arch stuff
The ARTIFACTS_SUFFIX is being dropped on building scripts because:

1) This will make possible to further simplify Installer scripts in other commit

2) There is no script that uses multi-arch _build/_install at same time on CI
   However, there are two use cases: to build Debian and flatpak; and, on Win,
   to build on CLANGARM64 and CLANG64 (?). But probably they are pretty niche.
   I suppose that people who build on Debian (or other dev-oriented distro)
   willn't want to mantain deps in two sys prefixes (pkg and GNOME runtime)
   + two gimp prefixes (out of sandbox and sandbox) due to huge storage use.
   Why someone would want to build with emulation on Win ARM64 I don't know.
   Anyway, people that know how to do this stuff probably can change the .sh.

3) When building locally, the contributor doesn't need to know the arch at all.
   Indeed, without this suffix, the scripts are inline with gimp-web-devel and
   prevent some first-sight confusion when reading them that I've seen on IRC.

4) These arch suffixes can be understood as '_install-*' being distributable
   which is not true. So, without this suffix we could make more clear
   what is a package (when GitLab fix the glob bug in 'expose_as' someday).

---

Despite .gitlab-ci.yml not being a script, it needed to be touched too
because cross scripts depends on Debian jobs due to gimp-data MR.
2024-07-20 21:09:47 +00:00
Bruno
25734cb579 build/linux: Make 'flatpak update' more consistent with other scripts
Like updating MSYS2, let's update GNOME runtime only in deps script.
2024-07-20 21:09:47 +00:00
Bruno
d5da1568f4 build/windows: Don't try to install deps again when local 2024-07-20 21:09:47 +00:00
Mark Sweeney
fa70b794e2 plug-ins: script-fu-paste-as-new-pattern, adjusted call to (file-pat-export) 2024-07-20 19:02:27 +00:00
Alx Sa
44a87140d5 scripts: Remove drawables argument from export calls
These PDB scripts were missed in 443947c6,
as noticed by Anders Jonsson.
A separate commit should fix the
call in paste-as-pattern.scm.
2024-07-20 18:35:41 +00:00
Andrzej Hunt
7d949423ed xcf-load: avoid use-after-free for layers with multiple PROP_ACTIVE_LAYER
If a given layer's properties contain multiple PROP_ACTIVE_LAYER entries, we
could add multiple entries for the same layer in info->selected_layers.

However, xcf_load_layer_props and xcf_load_layer both contain logic that
overwrites the layer pointer - they do take care of updating
info->selected_layers and and info->floating_sel (both of which could contain
or point to the current layer). Crucially, they both assume that
info->selected_layers can only contain this layer once - hence they only
remove it from the list once. This logic also frees the old layer because it
thinks that it's no longer in use.

But if we've added the original layer to selected_layers multiple times,
and then use the logic that overwrites layer, selected_layers will still
contain an invalid pointer to the now-freed original layer. Any later
code that tries to read info->selected_layers will hit a user-after-free.

Therefore we need to check if the current layer is already in the
selected_layers list, and avoid adding it again if it's already there.
(It also seems illogical to say that a layer is selected twice, but I'm
 focusing on the code-correctness aspect in my analysis.)

Adjustment by Jacob Boerema: the correct way to test that a value does
not exist in a list is to check for the value being negative. Also add
a message to warn users.

ASAN output:

==21241==ERROR: AddressSanitizer: heap-use-after-free on address 0x615000012150 at pc 0x000000d54dbf bp 0x7ffcf813bb60 sp 0x7ffcf813bb58
READ of size 8 at 0x615000012150 thread T0
    #0 0xd54dbe in gimp_image_set_selected_layers /home/ahunt/git/gimp/app/core/gimpimage.c:4743:7
    #1 0xb146c6 in xcf_load_image /home/ahunt/git/gimp/app/xcf/xcf-load.c:690:7
    #2 0xb1199b in xcf_load_stream /home/ahunt/git/gimp/app/xcf/xcf.c:305:19
    #3 0x619cad in LLVMFuzzerTestOneInput /home/ahunt/git/gimp/app/fuzzers/xcf_fuzzer.c:35:17
    #4 0x51d2e4 in fuzzer::Fuzzer::ExecuteCallback(unsigned char const*, unsigned long) /home/abuild/rpmbuild/BUILD/llvm-12.0.0.src/build/../projects/compiler-rt/lib/fuzzer/FuzzerLoop.cpp:599:15
    #5 0x506f62 in fuzzer::RunOneTest(fuzzer::Fuzzer*, char const*, unsigned long) /home/abuild/rpmbuild/BUILD/llvm-12.0.0.src/build/../projects/compiler-rt/lib/fuzzer/FuzzerDriver.cpp:323:6
    #6 0x50d2d0 in fuzzer::FuzzerDriver(int*, char***, int (*)(unsigned char const*, unsigned long)) /home/abuild/rpmbuild/BUILD/llvm-12.0.0.src/build/../projects/compiler-rt/lib/fuzzer/FuzzerDriver.cpp:856:9
    #7 0x537322 in main /home/abuild/rpmbuild/BUILD/llvm-12.0.0.src/build/../projects/compiler-rt/lib/fuzzer/FuzzerMain.cpp:20:10
    #8 0x7f064a594349 in __libc_start_main (/lib64/libc.so.6+0x24349)
    #9 0x4e06f9 in _start /home/abuild/rpmbuild/BUILD/glibc-2.26/csu/../sysdeps/x86_64/start.S:120

0x615000012150 is located 336 bytes inside of 504-byte region [0x615000012000,0x6150000121f8)
freed by thread T0 here:
    #0 0x5e84e2 in free /home/abuild/rpmbuild/BUILD/llvm-12.0.0.src/build/../projects/compiler-rt/lib/asan/asan_malloc_linux.cpp:127:3
    #1 0x7f064b3f81c8 in g_free (/usr/lib64/libglib-2.0.so.0+0x581c8)
    #2 0x7f064b41133f in g_slice_free1 (/usr/lib64/libglib-2.0.so.0+0x7133f)
    #3 0x7f064b7015c0 in g_type_free_instance /usr/src/debug/glib2-2.62.6-lp152.2.3.1.x86_64/build/../gobject/gtype.c:1946
    #4 0xb187d8 in xcf_load_layer /home/ahunt/git/gimp/app/xcf/xcf-load.c:2146:3
    #5 0xb13997 in xcf_load_image /home/ahunt/git/gimp/app/xcf/xcf-load.c:504:15
    #6 0xb1199b in xcf_load_stream /home/ahunt/git/gimp/app/xcf/xcf.c:305:19
    #7 0x619cad in LLVMFuzzerTestOneInput /home/ahunt/git/gimp/app/fuzzers/xcf_fuzzer.c:35:17
    #8 0x51d2e4 in fuzzer::Fuzzer::ExecuteCallback(unsigned char const*, unsigned long) /home/abuild/rpmbuild/BUILD/llvm-12.0.0.src/build/../projects/compiler-rt/lib/fuzzer/FuzzerLoop.cpp:599:15
    #9 0x506f62 in fuzzer::RunOneTest(fuzzer::Fuzzer*, char const*, unsigned long) /home/abuild/rpmbuild/BUILD/llvm-12.0.0.src/build/../projects/compiler-rt/lib/fuzzer/FuzzerDriver.cpp:323:6
    #10 0x50d2d0 in fuzzer::FuzzerDriver(int*, char***, int (*)(unsigned char const*, unsigned long)) /home/abuild/rpmbuild/BUILD/llvm-12.0.0.src/build/../projects/compiler-rt/lib/fuzzer/FuzzerDriver.cpp:856:9
    #11 0x537322 in main /home/abuild/rpmbuild/BUILD/llvm-12.0.0.src/build/../projects/compiler-rt/lib/fuzzer/FuzzerMain.cpp:20:10
    #12 0x7f064a594349 in __libc_start_main (/lib64/libc.so.6+0x24349)
    #13 0x4e06f9 in _start /home/abuild/rpmbuild/BUILD/glibc-2.26/csu/../sysdeps/x86_64/start.S:120

previously allocated by thread T0 here:
    #0 0x5e874d in malloc /home/abuild/rpmbuild/BUILD/llvm-12.0.0.src/build/../projects/compiler-rt/lib/asan/asan_malloc_linux.cpp:145:3
    #1 0x7f064b3f80c8 in g_malloc (/usr/lib64/libglib-2.0.so.0+0x580c8)
    #2 0x7f064b410da5 in g_slice_alloc (/usr/lib64/libglib-2.0.so.0+0x70da5)
    #3 0x7f064b411258 in g_slice_alloc0 (/usr/lib64/libglib-2.0.so.0+0x71258)
    #4 0x7f064b7011d5 in g_type_create_instance /usr/src/debug/glib2-2.62.6-lp152.2.3.1.x86_64/build/../gobject/gtype.c:1849
    #5 0x7f064b6e164f in g_object_new_internal /usr/src/debug/glib2-2.62.6-lp152.2.3.1.x86_64/build/../gobject/gobject.c:1827
    #6 0x7f064b6e354d in g_object_new_valist /usr/src/debug/glib2-2.62.6-lp152.2.3.1.x86_64/build/../gobject/gobject.c:2152
    #7 0x7f064b6e38c8 in g_object_new /usr/src/debug/glib2-2.62.6-lp152.2.3.1.x86_64/build/../gobject/gobject.c:1670
    #8 0xdb5b90 in gimp_item_new /home/ahunt/git/gimp/app/core/gimpitem.c:723:10
    #9 0xce0358 in gimp_drawable_new /home/ahunt/git/gimp/app/core/gimpdrawable.c:1067:14
    #10 0xddd8db in gimp_layer_new /home/ahunt/git/gimp/app/core/gimplayer-new.c:65:11
    #11 0xb182a6 in xcf_load_layer /home/ahunt/git/gimp/app/xcf/xcf-load.c:2027:11
    #12 0xb13997 in xcf_load_image /home/ahunt/git/gimp/app/xcf/xcf-load.c:504:15
    #13 0xb1199b in xcf_load_stream /home/ahunt/git/gimp/app/xcf/xcf.c:305:19
    #14 0x619cad in LLVMFuzzerTestOneInput /home/ahunt/git/gimp/app/fuzzers/xcf_fuzzer.c:35:17
    #15 0x51d2e4 in fuzzer::Fuzzer::ExecuteCallback(unsigned char const*, unsigned long) /home/abuild/rpmbuild/BUILD/llvm-12.0.0.src/build/../projects/compiler-rt/lib/fuzzer/FuzzerLoop.cpp:599:15
    #16 0x506f62 in fuzzer::RunOneTest(fuzzer::Fuzzer*, char const*, unsigned long) /home/abuild/rpmbuild/BUILD/llvm-12.0.0.src/build/../projects/compiler-rt/lib/fuzzer/FuzzerDriver.cpp:323:6
    #17 0x50d2d0 in fuzzer::FuzzerDriver(int*, char***, int (*)(unsigned char const*, unsigned long)) /home/abuild/rpmbuild/BUILD/llvm-12.0.0.src/build/../projects/compiler-rt/lib/fuzzer/FuzzerDriver.cpp:856:9
    #18 0x537322 in main /home/abuild/rpmbuild/BUILD/llvm-12.0.0.src/build/../projects/compiler-rt/lib/fuzzer/FuzzerMain.cpp:20:10
    #19 0x7f064a594349 in __libc_start_main (/lib64/libc.so.6+0x24349)
    #20 0x4e06f9 in _start /home/abuild/rpmbuild/BUILD/glibc-2.26/csu/../sysdeps/x86_64/start.S:120

SUMMARY: AddressSanitizer: heap-use-after-free /home/ahunt/git/gimp/app/core/gimpimage.c:4743:7 in gimp_image_set_selected_layers
Shadow bytes around the buggy address:
  0x0c2a7fffa3d0: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd
  0x0c2a7fffa3e0: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd
  0x0c2a7fffa3f0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x0c2a7fffa400: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd
  0x0c2a7fffa410: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd
=>0x0c2a7fffa420: fd fd fd fd fd fd fd fd fd fd[fd]fd fd fd fd fd
  0x0c2a7fffa430: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fa
  0x0c2a7fffa440: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x0c2a7fffa450: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd
  0x0c2a7fffa460: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd
  0x0c2a7fffa470: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd
Shadow byte legend (one shadow byte represents 8 application bytes):
  Addressable:           00
  Partially addressable: 01 02 03 04 05 06 07
  Heap left redzone:       fa
  Freed heap region:       fd
  Stack left redzone:      f1
  Stack mid redzone:       f2
  Stack right redzone:     f3
  Stack after return:      f5
  Stack use after scope:   f8
  Global redzone:          f9
  Global init order:       f6
  Poisoned by user:        f7
  Container overflow:      fc
  Array cookie:            ac
  Intra object redzone:    bb
  ASan internal:           fe
  Left alloca redzone:     ca
  Right alloca redzone:    cb
  Shadow gap:              cc
==21241==ABORTING

( crash-f37f84bd7072e65348ca0e2c920d1e08165356fd )
2024-07-20 13:26:31 -04:00
Alx Sa
ff9f71e9a6 widgets: Connect GimpToolPresetEditor to icon size changes
Inspired by Mark Sweeney's work.
GimpToolPresetEditor has an icon next to its title which does
not react to icon size changes.
GimpToolPresetEditor's parent_instance, GimpEditor, already
has a "button-icon-size" CSS style which can be accessed in
its children. This patch adds signals to listen for icon size
changes and update the icon size accordingly.
2024-07-20 01:55:01 +00:00
Alx Sa
e4ae257ae7 dialogs: Retain XCF compression setting after export
Resolves #9105
The XCF compression setting is initially
set to FALSE. It was only updated from the
Save Dialog, so if the user exports then
compression is reset if they save the XCF
again.

This patch adds a condition on export
where we get the image's compression
setting, instead of always defaulting to
FALSE. This allows you to save and export
the same image without having to
re-enable the compression setting each
time.
2024-07-20 00:06:03 +00:00
Jacob Boerema
1f06286717 plug-ins, tga: don't crash when generating a huge amount of messages
A follow-up to the previous commits, that address the tga issues from
issue #11822.

On Windows, when using the error console for messages, a huge amount
of error messages, that can be generated with special fuzzed images,
like crash-f65fd5404bff32c1d9d10ee049d9c98d02bbbdc2.tga from
the above mentioned issue, can cause GIMP to crash.

Although this is most likely caused in the error console or its
dependencies, we should not let it cause problems here until that is
fixed. There is also no real need to generate a huge amount of similar
repeated error messages, so let's limit it to 10 per read line of input.
2024-07-19 14:42:17 -04:00
Andrzej Hunt
2ba35e5b3d tga: don't copy more bytes than necessary
We are trying to copy all bytes in the current row, which is the width times
the number of bytes per pixel (stored in info->bytes), not width times bits
per pixel.

Copying too much data allows certain inputs to induce a heap-buffer-buffer
overflow read, and probably also a write, see ASAN output below:

ERROR: AddressSanitizer: heap-buffer-overflow on address 0x61d000008088 at pc 0x00000052be17 bp 0x7ffd8bbe8e20 sp 0x7ffd8bbe85e8
READ of size 16448 at 0x61d000008088 thread T0
    #0 0x52be16 in __asan_memcpy /home/abuild/rpmbuild/BUILD/llvm-12.0.0.src/build/../projects/compiler-rt/lib/asan/asan_interceptors_memintrinsics.cpp:22:3
    #1 0x5641ca in read_line /home/ahunt/git/gimp/plug-ins/common/file-tga.c:982:7
    #2 0x560218 in ReadImage /home/ahunt/git/gimp/plug-ins/common/file-tga.c:1147:15
    #3 0x55f526 in load_image /home/ahunt/git/gimp/plug-ins/common/file-tga.c:646:11
    #4 0x56519b in LLVMFuzzerTestOneInput /home/ahunt/git/gimp/plug-ins/common/file-tga_fuzzer.c:69:17
    #5 0x461624 in fuzzer::Fuzzer::ExecuteCallback(unsigned char const*, unsigned long) /home/abuild/rpmbuild/BUILD/llvm-12.0.0.src/build/../projects/compiler-rt/lib/fuzzer/FuzzerLoop.cpp:599:15
    #6 0x460b2a in fuzzer::Fuzzer::RunOne(unsigned char const*, unsigned long, bool, fuzzer::InputInfo*, bool, bool*) /home/abuild/rpmbuild/BUILD/llvm-12.0.0.src/build/../projects/compiler-rt/lib/fuzzer/FuzzerLoop.cpp:505:3
    #7 0x462ec4 in fuzzer::Fuzzer::ReadAndExecuteSeedCorpora(std::__Fuzzer::vector<fuzzer::SizedFile, fuzzer::fuzzer_allocator<fuzzer::SizedFile> >&) /home/abuild/rpmbuild/BUILD/llvm-12.0.0.src/build/../projects/compiler-rt/lib/fuzzer/FuzzerLoop.cpp:814:7
    #8 0x4630d9 in fuzzer::Fuzzer::Loop(std::__Fuzzer::vector<fuzzer::SizedFile, fuzzer::fuzzer_allocator<fuzzer::SizedFile> >&) /home/abuild/rpmbuild/BUILD/llvm-12.0.0.src/build/../projects/compiler-rt/lib/fuzzer/FuzzerLoop.cpp:845:3
    #9 0x451686 in fuzzer::FuzzerDriver(int*, char***, int (*)(unsigned char const*, unsigned long)) /home/abuild/rpmbuild/BUILD/llvm-12.0.0.src/build/../projects/compiler-rt/lib/fuzzer/FuzzerDriver.cpp:906:6
    #10 0x47b662 in main /home/abuild/rpmbuild/BUILD/llvm-12.0.0.src/build/../projects/compiler-rt/lib/fuzzer/FuzzerMain.cpp:20:10
    #11 0x7fdbd277c349 in __libc_start_main (/lib64/libc.so.6+0x24349)
    #12 0x424a39 in _start /home/abuild/rpmbuild/BUILD/glibc-2.26/csu/../sysdeps/x86_64/start.S:120

0x61d000008088 is located 0 bytes to the right of 2056-byte region [0x61d000007880,0x61d000008088)
allocated by thread T0 here:
    #0 0x52ca8d in malloc /home/abuild/rpmbuild/BUILD/llvm-12.0.0.src/build/../projects/compiler-rt/lib/asan/asan_malloc_linux.cpp:145:3
    #1 0x7fdbd37fccf2 in g_malloc /home/ahunt/git/glib/_build/../glib/gmem.c:106:13
    #2 0x56009b in ReadImage /home/ahunt/git/gimp/plug-ins/common/file-tga.c:1134:10
    #3 0x55f526 in load_image /home/ahunt/git/gimp/plug-ins/common/file-tga.c:646:11
    #4 0x56519b in LLVMFuzzerTestOneInput /home/ahunt/git/gimp/plug-ins/common/file-tga_fuzzer.c:69:17
    #5 0x461624 in fuzzer::Fuzzer::ExecuteCallback(unsigned char const*, unsigned long) /home/abuild/rpmbuild/BUILD/llvm-12.0.0.src/build/../projects/compiler-rt/lib/fuzzer/FuzzerLoop.cpp:599:15
    #6 0x460b2a in fuzzer::Fuzzer::RunOne(unsigned char const*, unsigned long, bool, fuzzer::InputInfo*, bool, bool*) /home/abuild/rpmbuild/BUILD/llvm-12.0.0.src/build/../projects/compiler-rt/lib/fuzzer/FuzzerLoop.cpp:505:3
    #7 0x462ec4 in fuzzer::Fuzzer::ReadAndExecuteSeedCorpora(std::__Fuzzer::vector<fuzzer::SizedFile, fuzzer::fuzzer_allocator<fuzzer::SizedFile> >&) /home/abuild/rpmbuild/BUILD/llvm-12.0.0.src/build/../projects/compiler-rt/lib/fuzzer/FuzzerLoop.cpp:814:7
    #8 0x4630d9 in fuzzer::Fuzzer::Loop(std::__Fuzzer::vector<fuzzer::SizedFile, fuzzer::fuzzer_allocator<fuzzer::SizedFile> >&) /home/abuild/rpmbuild/BUILD/llvm-12.0.0.src/build/../projects/compiler-rt/lib/fuzzer/FuzzerLoop.cpp:845:3
    #9 0x451686 in fuzzer::FuzzerDriver(int*, char***, int (*)(unsigned char const*, unsigned long)) /home/abuild/rpmbuild/BUILD/llvm-12.0.0.src/build/../projects/compiler-rt/lib/fuzzer/FuzzerDriver.cpp:906:6
    #10 0x47b662 in main /home/abuild/rpmbuild/BUILD/llvm-12.0.0.src/build/../projects/compiler-rt/lib/fuzzer/FuzzerMain.cpp:20:10
    #11 0x7fdbd277c349 in __libc_start_main (/lib64/libc.so.6+0x24349)

SUMMARY: AddressSanitizer: heap-buffer-overflow /home/abuild/rpmbuild/BUILD/llvm-12.0.0.src/build/../projects/compiler-rt/lib/asan/asan_interceptors_memintrinsics.cpp:22:3 in __asan_memcpy
Shadow bytes around the buggy address:
  0x0c3a7fff8fc0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x0c3a7fff8fd0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x0c3a7fff8fe0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x0c3a7fff8ff0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x0c3a7fff9000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
=>0x0c3a7fff9010: 00[fa]fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x0c3a7fff9020: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x0c3a7fff9030: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x0c3a7fff9040: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x0c3a7fff9050: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x0c3a7fff9060: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
Shadow byte legend (one shadow byte represents 8 application bytes):
  Addressable:           00
  Partially addressable: 01 02 03 04 05 06 07
  Heap left redzone:       fa
  Freed heap region:       fd
  Stack left redzone:      f1
  Stack mid redzone:       f2
  Stack right redzone:     f3
  Stack after return:      f5
  Stack use after scope:   f8
  Global redzone:          f9
  Global init order:       f6
  Poisoned by user:        f7
  Container overflow:      fc
  Array cookie:            ac
  Intra object redzone:    bb
  ASan internal:           fe
  Left alloca redzone:     ca
  Right alloca redzone:    cb
  Shadow gap:              cc
==26560==ABORTING

crash-4b13aca1db7bb795a815431b86cc20284f3aa6da
2024-07-19 14:04:44 -04:00
Andrzej Hunt
723d383e57 tga: check for valid color ID in apply_colormap
A malformed colourmapped tga file could specify color IDs that are not
contained in the colourmap. Therefore we add some bounds checking to
ensure that we only use entries that actually exist.

We could completely give up on such files, but it's just as easy to fall
back to the first colour in the map in this case. However we can only
fall back to the first colour in the map IF the colourmap contains
at least one entry. Therefore we add an up-front check to verify that
colourmapped images actually do contain at least one entry.

Without this bounds-checking, it's possible to induce a heap-buffer-overflow
read in apply-colormap(), see ASAN output below:

ERROR: AddressSanitizer: heap-buffer-overflow on address 0x61900002257c at pc 0x000000564f99 bp 0x7ffe65fdb040 sp 0x7ffe65fdb038
READ of size 1 at 0x61900002257c thread T0
    #0 0x564f98 in apply_colormap /home/ahunt/git/gimp/plug-ins/common/file-tga.c:901:23
    #1 0x56411a in read_line /home/ahunt/git/gimp/plug-ins/common/file-tga.c:975:7
    #2 0x560648 in ReadImage /home/ahunt/git/gimp/plug-ins/common/file-tga.c:1202:15
    #3 0x55f4ee in load_image /home/ahunt/git/gimp/plug-ins/common/file-tga.c:647:11
    #4 0x5653ab in LLVMFuzzerTestOneInput /home/ahunt/git/gimp/plug-ins/common/file-tga_fuzzer.c:69:17
    #5 0x461624 in fuzzer::Fuzzer::ExecuteCallback(unsigned char const*, unsigned long) /home/abuild/rpmbuild/BUILD/llvm-12.0.0.src/build/../projects/compiler-rt/lib/fuzzer/FuzzerLoop.cpp:599:15
    #6 0x460b2a in fuzzer::Fuzzer::RunOne(unsigned char const*, unsigned long, bool, fuzzer::InputInfo*, bool, bool*) /home/abuild/rpmbuild/BUILD/llvm-12.0.0.src/build/../projects/compiler-rt/lib/fuzzer/FuzzerLoop.cpp:505:3
    #7 0x462847 in fuzzer::Fuzzer::MutateAndTestOne() /home/abuild/rpmbuild/BUILD/llvm-12.0.0.src/build/../projects/compiler-rt/lib/fuzzer/FuzzerLoop.cpp:745:19
    #8 0x4633d5 in fuzzer::Fuzzer::Loop(std::__Fuzzer::vector<fuzzer::SizedFile, fuzzer::fuzzer_allocator<fuzzer::SizedFile> >&) /home/abuild/rpmbuild/BUILD/llvm-12.0.0.src/build/../projects/compiler-rt/lib/fuzzer/FuzzerLoop.cpp:883:5
    #9 0x451686 in fuzzer::FuzzerDriver(int*, char***, int (*)(unsigned char const*, unsigned long)) /home/abuild/rpmbuild/BUILD/llvm-12.0.0.src/build/../projects/compiler-rt/lib/fuzzer/FuzzerDriver.cpp:906:6
    #10 0x47b662 in main /home/abuild/rpmbuild/BUILD/llvm-12.0.0.src/build/../projects/compiler-rt/lib/fuzzer/FuzzerMain.cpp:20:10
    #11 0x7fe76a5dc349 in __libc_start_main (/lib64/libc.so.6+0x24349)
    #12 0x424a39 in _start /home/abuild/rpmbuild/BUILD/glibc-2.26/csu/../sysdeps/x86_64/start.S:120

0x61900002257c is located 0 bytes to the right of 1020-byte region [0x619000022180,0x61900002257c)
allocated by thread T0 here:
    #0 0x52ca8d in malloc /home/abuild/rpmbuild/BUILD/llvm-12.0.0.src/build/../projects/compiler-rt/lib/asan/asan_malloc_linux.cpp:145:3
    #1 0x7fe76b65ccf2 in g_malloc /home/ahunt/git/glib/_build/../glib/gmem.c:106:13
    #2 0x55fdc6 in ReadImage /home/ahunt/git/gimp/plug-ins/common/file-tga.c:1049:26
    #3 0x55f4ee in load_image /home/ahunt/git/gimp/plug-ins/common/file-tga.c:647:11
    #4 0x5653ab in LLVMFuzzerTestOneInput /home/ahunt/git/gimp/plug-ins/common/file-tga_fuzzer.c:69:17
    #5 0x461624 in fuzzer::Fuzzer::ExecuteCallback(unsigned char const*, unsigned long) /home/abuild/rpmbuild/BUILD/llvm-12.0.0.src/build/../projects/compiler-rt/lib/fuzzer/FuzzerLoop.cpp:599:15
    #6 0x460b2a in fuzzer::Fuzzer::RunOne(unsigned char const*, unsigned long, bool, fuzzer::InputInfo*, bool, bool*) /home/abuild/rpmbuild/BUILD/llvm-12.0.0.src/build/../projects/compiler-rt/lib/fuzzer/FuzzerLoop.cpp:505:3
    #7 0x462847 in fuzzer::Fuzzer::MutateAndTestOne() /home/abuild/rpmbuild/BUILD/llvm-12.0.0.src/build/../projects/compiler-rt/lib/fuzzer/FuzzerLoop.cpp:745:19
    #8 0x4633d5 in fuzzer::Fuzzer::Loop(std::__Fuzzer::vector<fuzzer::SizedFile, fuzzer::fuzzer_allocator<fuzzer::SizedFile> >&) /home/abuild/rpmbuild/BUILD/llvm-12.0.0.src/build/../projects/compiler-rt/lib/fuzzer/FuzzerLoop.cpp:883:5
    #9 0x451686 in fuzzer::FuzzerDriver(int*, char***, int (*)(unsigned char const*, unsigned long)) /home/abuild/rpmbuild/BUILD/llvm-12.0.0.src/build/../projects/compiler-rt/lib/fuzzer/FuzzerDriver.cpp:906:6
    #10 0x47b662 in main /home/abuild/rpmbuild/BUILD/llvm-12.0.0.src/build/../projects/compiler-rt/lib/fuzzer/FuzzerMain.cpp:20:10
    #11 0x7fe76a5dc349 in __libc_start_main (/lib64/libc.so.6+0x24349)

SUMMARY: AddressSanitizer: heap-buffer-overflow /home/ahunt/git/gimp/plug-ins/common/file-tga.c:901:23 in apply_colormap
Shadow bytes around the buggy address:
  0x0c327fffc450: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x0c327fffc460: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x0c327fffc470: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x0c327fffc480: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x0c327fffc490: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
=>0x0c327fffc4a0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00[04]
  0x0c327fffc4b0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x0c327fffc4c0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x0c327fffc4d0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x0c327fffc4e0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x0c327fffc4f0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
Shadow byte legend (one shadow byte represents 8 application bytes):
  Addressable:           00
  Partially addressable: 01 02 03 04 05 06 07
  Heap left redzone:       fa
  Freed heap region:       fd
  Stack left redzone:      f1
  Stack mid redzone:       f2
  Stack right redzone:     f3
  Stack after return:      f5
  Stack use after scope:   f8
  Global redzone:          f9
  Global init order:       f6
  Poisoned by user:        f7
  Container overflow:      fc
  Array cookie:            ac
  Intra object redzone:    bb
  ASan internal:           fe
  Left alloca redzone:     ca
  Right alloca redzone:    cb
  Shadow gap:              cc
==16309==ABORTING

( crash-f70628d4df7a65babc8e57d890425771a1d67e06 )
2024-07-19 14:00:42 -04:00
Andrzej Hunt
49755f085a tga: always convert colour-mapped images to RGBA if image claims to contain alpha
If the colourmap contains more than 256 items AND has alpha, it should always
be promoted to RGBA. Therefore we move the "if (info->alphaBits)" check into
the first if clause, to avoid accidentally demoting to RGB in this scenario.

Other parts of the tga parser assume that the destination array is RGBA
when alphaBits is not zero. For example, upsample() will always write 4 bytes
per pixel when alpha is set - (even if we only allocated 3 because we thought
we should use RGB). Erronously allocating only 3 bytes makes it easy to induce
a heap-buffer-overflow write, see ASAN output below. (apply_colormap makes the
same assumption and would probably do the same thing, but upsample is the
first location that we'd hit this issue.)

ERROR: AddressSanitizer: heap-buffer-overflow on address 0x61700002ae00 at pc 0x000000563d97 bp 0x7ffde8677890 sp 0x7ffde8677888
WRITE of size 1 at 0x61700002ae00 thread T0
    #0 0x563d96 in upsample /home/ahunt/git/gimp/plug-ins/common/file-tga.c:830:15
    #1 0x560b59 in ReadImage /home/ahunt/git/gimp/plug-ins/common/file-tga.c
    #2 0x55f4ee in load_image /home/ahunt/git/gimp/plug-ins/common/file-tga.c:647:11
    #3 0x5652ab in LLVMFuzzerTestOneInput /home/ahunt/git/gimp/plug-ins/common/file-tga_fuzzer.c:69:17
    #4 0x461624 in fuzzer::Fuzzer::ExecuteCallback(unsigned char const*, unsigned long) /home/abuild/rpmbuild/BUILD/llvm-12.0.0.src/build/../projects/compiler-rt/lib/fuzzer/FuzzerLoop.cpp:599:15
    #5 0x460b2a in fuzzer::Fuzzer::RunOne(unsigned char const*, unsigned long, bool, fuzzer::InputInfo*, bool, bool*) /home/abuild/rpmbuild/BUILD/llvm-12.0.0.src/build/../projects/compiler-rt/lib/fuzzer/FuzzerLoop.cpp:505:3
    #6 0x462847 in fuzzer::Fuzzer::MutateAndTestOne() /home/abuild/rpmbuild/BUILD/llvm-12.0.0.src/build/../projects/compiler-rt/lib/fuzzer/FuzzerLoop.cpp:745:19
    #7 0x4633d5 in fuzzer::Fuzzer::Loop(std::__Fuzzer::vector<fuzzer::SizedFile, fuzzer::fuzzer_allocator<fuzzer::SizedFile> >&) /home/abuild/rpmbuild/BUILD/llvm-12.0.0.src/build/../projects/compiler-rt/lib/fuzzer/FuzzerLoop.cpp:883:5
    #8 0x451686 in fuzzer::FuzzerDriver(int*, char***, int (*)(unsigned char const*, unsigned long)) /home/abuild/rpmbuild/BUILD/llvm-12.0.0.src/build/../projects/compiler-rt/lib/fuzzer/FuzzerDriver.cpp:906:6
    #9 0x47b662 in main /home/abuild/rpmbuild/BUILD/llvm-12.0.0.src/build/../projects/compiler-rt/lib/fuzzer/FuzzerMain.cpp:20:10
    #10 0x7fd894a94349 in __libc_start_main (/lib64/libc.so.6+0x24349)
    #11 0x424a39 in _start /home/abuild/rpmbuild/BUILD/glibc-2.26/csu/../sysdeps/x86_64/start.S:120

0x61700002ae00 is located 0 bytes to the right of 768-byte region [0x61700002ab00,0x61700002ae00)
allocated by thread T0 here:
    #0 0x52ca8d in malloc /home/abuild/rpmbuild/BUILD/llvm-12.0.0.src/build/../projects/compiler-rt/lib/asan/asan_malloc_linux.cpp:145:3
    #1 0x7fd895b14cf2 in g_malloc /home/ahunt/git/glib/_build/../glib/gmem.c:106:13
    #2 0x55fce9 in ReadImage /home/ahunt/git/gimp/plug-ins/common/file-tga.c:1039:26
    #3 0x55f4ee in load_image /home/ahunt/git/gimp/plug-ins/common/file-tga.c:647:11
    #4 0x5652ab in LLVMFuzzerTestOneInput /home/ahunt/git/gimp/plug-ins/common/file-tga_fuzzer.c:69:17
    #5 0x461624 in fuzzer::Fuzzer::ExecuteCallback(unsigned char const*, unsigned long) /home/abuild/rpmbuild/BUILD/llvm-12.0.0.src/build/../projects/compiler-rt/lib/fuzzer/FuzzerLoop.cpp:599:15
    #6 0x460b2a in fuzzer::Fuzzer::RunOne(unsigned char const*, unsigned long, bool, fuzzer::InputInfo*, bool, bool*) /home/abuild/rpmbuild/BUILD/llvm-12.0.0.src/build/../projects/compiler-rt/lib/fuzzer/FuzzerLoop.cpp:505:3
    #7 0x462847 in fuzzer::Fuzzer::MutateAndTestOne() /home/abuild/rpmbuild/BUILD/llvm-12.0.0.src/build/../projects/compiler-rt/lib/fuzzer/FuzzerLoop.cpp:745:19
    #8 0x4633d5 in fuzzer::Fuzzer::Loop(std::__Fuzzer::vector<fuzzer::SizedFile, fuzzer::fuzzer_allocator<fuzzer::SizedFile> >&) /home/abuild/rpmbuild/BUILD/llvm-12.0.0.src/build/../projects/compiler-rt/lib/fuzzer/FuzzerLoop.cpp:883:5
    #9 0x451686 in fuzzer::FuzzerDriver(int*, char***, int (*)(unsigned char const*, unsigned long)) /home/abuild/rpmbuild/BUILD/llvm-12.0.0.src/build/../projects/compiler-rt/lib/fuzzer/FuzzerDriver.cpp:906:6
    #10 0x47b662 in main /home/abuild/rpmbuild/BUILD/llvm-12.0.0.src/build/../projects/compiler-rt/lib/fuzzer/FuzzerMain.cpp:20:10
    #11 0x7fd894a94349 in __libc_start_main (/lib64/libc.so.6+0x24349)

SUMMARY: AddressSanitizer: heap-buffer-overflow /home/ahunt/git/gimp/plug-ins/common/file-tga.c:830:15 in upsample
Shadow bytes around the buggy address:
  0x0c2e7fffd570: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x0c2e7fffd580: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x0c2e7fffd590: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x0c2e7fffd5a0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x0c2e7fffd5b0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
=>0x0c2e7fffd5c0:[fa]fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x0c2e7fffd5d0: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd
  0x0c2e7fffd5e0: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd
  0x0c2e7fffd5f0: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd
  0x0c2e7fffd600: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd
  0x0c2e7fffd610: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd
Shadow byte legend (one shadow byte represents 8 application bytes):
  Addressable:           00
  Partially addressable: 01 02 03 04 05 06 07
  Heap left redzone:       fa
  Freed heap region:       fd
  Stack left redzone:      f1
  Stack mid redzone:       f2
  Stack right redzone:     f3
  Stack after return:      f5
  Stack use after scope:   f8
  Global redzone:          f9
  Global init order:       f6
  Poisoned by user:        f7
  Container overflow:      fc
  Array cookie:            ac
  Intra object redzone:    bb
  ASan internal:           fe
  Left alloca redzone:     ca
  Right alloca redzone:    cb
  Shadow gap:              cc
==12179==ABORTING

( crash-f65fd5404bff32c1d9d10ee049d9c98d02bbbdc2 )
2024-07-19 13:56:16 -04:00
Alx Sa
d701b70336 pdb, libgimpbase: Rename GIMP_VECTORS_STROKE_TYPE...
...to GIMP_PATH_STROKE_TYPE as part of
the GimpVectors -> GimpPath API
update.
2024-07-19 15:07:43 +00:00
bootchk
3fbfb21cff libgimp: fix #11813 CRITICAL on NULL GimpObjectArray to plugin
We allow passing NULL gvalue for an empty GimpObjectArray, for convenience.
For example to plugin sel2path which doesn't use drawables.
But crossing the wire, create an empty GimpObjectArray
having an arbitrary type for elements.
2024-07-19 07:16:03 +00:00
Alx Sa
85c0d0d600 plug-ins: Port file-icns/file-ico to GimpProcedureDialog
Note that the widgets are still made
with GTK directly. The primary goal of this
initial port is to remove the last usage of
gimp_export_dialog_new (). Future work
will be needed as currently we can not
automatically generate widgets from
array parameters.
2024-07-19 02:29:38 +00:00
Cheesequake
6b611a4802 actions: move top and bottom item check code 2024-07-18 17:57:17 +00:00
Ekaterine Papava
c47b1d67d1 Update Georgian translation 2024-07-18 03:38:36 +00:00
Alx Sa
0a3613e48d actions: Rename return_if_no_vectors_list macro...
...to return_if_no_paths to match the
change to GimpPath as well as the format
of the layers and channels macro.
2024-07-17 23:25:48 +00:00
Luming Zh
a4e8f4e986 Update Chinese (China) translation 2024-07-17 10:11:18 +00:00
Martin
6eb24f5b65 Update Slovenian translation 2024-07-17 07:06:16 +00:00
Yuri Chornoivan
d23ad6c490 Update Ukrainian translation 2024-07-17 06:35:35 +00:00
Jacob Boerema
97df731de1 app: be consistent and use plural for multi-select path actions 2024-07-16 17:21:55 -04:00
Martin
5c4a8f08c4 Update Slovenian translation 2024-07-16 21:01:36 +00:00
Martin
33ffd7fa7f Update Slovenian translation 2024-07-16 20:59:16 +00:00
Rodrigo Lledó
ea110b1a8c Update Spanish translation 2024-07-16 19:39:43 +00:00
Alx Sa
f036812a94 libgimpwidgets, widgets: Fix icons on Path locks
The visibility lock icon and help ID was accidentally
left off the PathsTreeView set-up.
The Path Attributes also used the wrong icon to indicate
the paths were locked (compared to the one shown in the
Path Attributes dialogue).
2024-07-16 17:50:41 +00:00
Rodrigo Lledó
443f27b6ed Update Spanish translation 2024-07-16 17:46:53 +00:00
Rodrigo Lledó
d7d88aa2e5 Update Spanish translation 2024-07-16 17:07:47 +00:00
Cheesequake
afea82ed6c Issue #11809: Fix raise and lower actions for channels and paths 2024-07-16 15:21:44 +00:00
Luming Zh
711027a5ca Update Chinese (China) translation 2024-07-16 11:03:27 +00:00
bootchk
f4f71e4296 PDB: fix #11815 CRITCALS from defaulted args for gegl wrapper procs
Revise the tests that can't default the args.

Actual args default to the min value formal declared in the PDB.
The declared min value must correspond with declaration in GEGL.
2024-07-16 10:25:41 +00:00
Yuri Chornoivan
0dd05e6467 Update Ukrainian translation 2024-07-16 05:53:25 +00:00
Ekaterine Papava
3698a42ca2 Update Georgian translation 2024-07-16 03:52:25 +00:00
Alx Sa
ba635d83a7 pdb: Remove item_is_attached restriction from NDE filters
As of fcdddad2, the requirement for layers
to be attached before NDE filters can be
applied has been removed on app/core. 
This patch removes the restriction from 
the PDB call for filters as well.
2024-07-15 21:12:17 +00:00
bootchk
de9b1b5b10 ScriptFu: Testing: add test of PDB procedures wrapping GEGL filters 2024-07-15 16:16:02 -04:00
Alx Sa
bfd374ed1a plug-ins: Additional radio frame changes from d7a3a161
* file-sunras, sparkle, and fractal-explorer
were converted to use GimpChoice with
the RadioFrame setting
* Unnecessary store variables were
removed from hot and file-psp
2024-07-15 18:12:30 +00:00
Michael Schumacher
febb2126c9 gitlab-ci: allow gimp-win-x64-cross to fail until we have a fix for #11756 2024-07-15 17:58:39 +02:00
Bruno
48fc6b40b9 build/linux: Sync with beta manifest regarding appstream and xmu 2024-07-15 13:38:33 +00:00
Alx Sa
d8b984a4eb pdb: Add check for indexed image to gimp_image_get_colormap ()
The description promises that we return
NULL if the image is not in indexed mode,
but we didn't actually verify that it was
before continuing with the colormap
code. This patch adds that verification step.
2024-07-15 12:31:58 +00:00
bootchk
4ad5760aa9 Fix unreported Clang compile error from 899b4536
An obvious typo that is not caught by CI until the weekly clang build?
2024-07-15 12:28:15 +00:00
Rodrigo Lledó
1bdc3187aa Update Spanish translation 2024-07-15 11:54:14 +00:00
Alx Sa
d8892cde4f libgimpconfig: Let GimpGroupLayer params be copied
Resolves #11805
This patch adds GimpGroupLayer as a valid param to be copied.
This allows functions like gimp-group-layer-merge to work.
2024-07-15 11:20:11 +00:00
Yuri Chornoivan
546835fc65 Update Ukrainian translation 2024-07-15 06:07:49 +00:00
Yuri Chornoivan
1386760aca Update Ukrainian translation 2024-07-15 06:02:13 +00:00
Ekaterine Papava
f7c16a3897 Update Georgian translation 2024-07-15 03:47:16 +00:00
Ekaterine Papava
01d959814c Update Georgian translation 2024-07-15 03:42:38 +00:00
Alx Sa
899b45366e libgimp, plug-ins: Run gimp_export_image ()...
...in non-interactive cases.
gimp_export_image () handles various
tasks like rasterizing NDE filters. It only
runs in interactive cases however, so if the
users calls gimp-file-save the filters are
not exported.
Since Jehan removed the hidden dialogue
in 0dc9ff7c, we can now safely call
gimp_export_image () in all cases to make
image export more consistent. This step is
also preparation for setting up the new
API with GimpExportOptions.
2024-07-14 20:12:57 +00:00
Alexander Shopov
3cab898d61 Update Bulgarian translation 2024-07-14 19:44:33 +00:00
Alexander Shopov
e97c80c0f2 Update Bulgarian translation 2024-07-14 19:37:34 +00:00
Cheesequake
bdab00d04b Issue #11732: Fix Raise and Lower actions for Multi-Layer selections 2024-07-14 19:21:53 +00:00
Bruno
f1a69c3eae build/linux: Sync with beta manifest regarding debloating
The effect, however, will be subtle, since Flatpak 'cleanup' is broken:
https://github.com/flatpak/flatpak-builder/issues/14
2024-07-14 17:31:12 +00:00
Kolbjørn Stuestøl
d21436236c Update Norwegian Nynorsk translation 2024-07-14 16:08:37 +00:00
Kolbjørn Stuestøl
9bea933bca Update Norwegian Nynorsk translation 2024-07-14 15:55:08 +00:00
Kolbjørn Stuestøl
f0d027284c Update Norwegian Nynorsk translation 2024-07-14 15:33:12 +00:00
Kolbjørn Stuestøl
0ee3ac6cb0 Update Norwegian Nynorsk translation 2024-07-14 15:31:55 +00:00
bootchk
f8450c7ae3 fix #10590 libgimp: resource choosers using freed proxy
GimpPlugin improperly destroys proxies after each run of a temporary procedure.
A temporary procedure may pass reference to proxy to main procedure.
Proxies should live as long as the main procedure of a plugin,
or for an extension plugin, until only the extension main procedure
is on the procedure stack.  More discussion in the issue.

Extract method gimp_plug_in_proc_run.
Call it from two new methods: main_proc_run and temp_proc_run,
which do more e.g. cleanup.

Extract methods for cleanup, main_proc_cleanup and temp_proc_cleanup

Add method is_proc_stack_empty
2024-07-14 09:15:58 -04:00
Luming Zh
c5e7e56ed3 Update Chinese (China) translation 2024-07-14 11:03:43 +00:00
Luming Zh
0f67f4199e Update Chinese (China) translation 2024-07-14 10:48:38 +00:00
Martin
a43bc8c65c Update Slovenian translation 2024-07-14 09:34:20 +00:00
Martin
f5a870916e Update Slovenian translation 2024-07-14 09:16:31 +00:00
Alx Sa
d7a3a161e0 plug-ins: Use GimpProcedureDialog's Radio widget...
...from GimpChoice.
0b2d8fed let us display GimpChoice
options as IntRadioFrames. Therefore, we
can convert a number of plug-in parameters
that were being built manually to use
GimpChoice instead. This decreases the
amount of GUI code and makes the
non-interactive inputs more descriptive.
2024-07-14 04:12:26 +00:00
Alx Sa
f2699aaeeb app: Specify Levels meaning for translation
Some languages like Chinese use separate
words for Levels when referring to a color
scale versus a unit of measure. Currently
we group all of them together.
This patch distinguishes between Levels
as Color Scales versus "measurements" for
translation purposes.
2024-07-14 01:31:24 +00:00
Anders Jonsson
221f8ab14d plug-ins: fix pyconsole syntax for Python 3.12
With Python 3.12, every run of the Python console shows
a SyntaxWarning about invalid escape sequence unless the
string is marked as a raw string.
2024-07-13 20:09:25 +00:00
bootchk
2d0e741b1b SF tests: revise for renamed API procedures
vector(s) => path(s)
layer-group => group-layer

Add a few tests.

(script-fu-use-v3) in more tests, code becomes more terse.

Added some aliases in script-fu-compat.c for renamed procedures, for compatibility third party.
2024-07-13 15:00:58 -04:00
Alan Mortensen
61f7812378 Update Danish translation 2024-07-13 13:01:23 +00:00
Luming Zh
7f72eafe4c Update Chinese (China) translation 2024-07-13 12:16:27 +00:00
Jehan
7ff0a35f72 libgimp: GimpPDB and GimpPlugIn use G_DECLARE_(DERIVABLE|FINAL)_TYPE. 2024-07-13 12:24:49 +02:00
Jehan
d08f751626 libgimp, libgimpwidgets: use G_DECLARE_(DERIVABLE|FINAL)_TYPE macros for GimpProcedureDialog…
… and its subclasses, as well as for GimpDialog.
2024-07-13 12:24:49 +02:00
Jehan
9feaf02596 libgimp: use G_DECLARE_(DERIVABLE|FINAL)_TYPE macros for all Gimp*Procedure.
Though I am not fond of these macros for our core code (it makes the
code more cumbersome especially for using private data in derivable
types), this definitely makes sense for public API, since it would allow
easier modifications with less chances of messing API/ABI stability.
2024-07-13 12:24:49 +02:00
Alan Mortensen
eb5a44d8a7 Update Danish translation 2024-07-13 10:01:25 +00:00
Alx Sa
2e6938b3da app: Rename app/core GimpVectors vectors API...
...to path.
Changes the names of
gimp_vectors_* () API to
gimp_path[s]_* (). Renames related files
to [path] instead of [vectors], along with
relevant enums and functions.
2024-07-13 05:07:57 +00:00
Luming Zh
2d8d5e1e81 Update Chinese (China) translation 2024-07-12 08:42:25 +00:00
Alx Sa
e8df68fb65 libgimp, app, pdb: Rename GimpVectors to GimpPath
This commit renames the GimpVectors
object to GimpPath in both app/core and
in libgimp. It also renames the files
to gimppath.[ch] and updates the relevant
build and translation files.
There are still outstanding gimp_vectors_* ()
functions on the app side that need to be renamed
in a subsequent commit.
2024-07-12 06:16:25 +00:00
Martin
813277ebe4 Update Slovenian translation 2024-07-11 22:13:26 +00:00
Jordi Mas
aacd5f379f Update Catalan translation 2024-07-11 21:07:33 +02:00
Yuri Chornoivan
73128f88af Update Ukrainian translation 2024-07-11 18:33:17 +00:00
Rodrigo Lledó
89bafa50a6 Update Spanish translation 2024-07-11 15:37:36 +00:00
Anders Jonsson
bcbbb8b159 po: update POTFILES.in 2024-07-11 16:35:15 +02:00
bootchk
24554d7fe2 app/plugin fix #11407 PLUGIN_DEBUG_WRAP=all
So a tester can valgrind all plugins.
2024-07-11 13:29:57 +00:00
Luming Zh
20de1e0560 Update Chinese (China) translation 2024-07-11 13:08:16 +00:00
Alx Sa
7fe398ca1a display: Fix regression accidentally introduced 2024-07-11 01:38:13 +00:00
Alx Sa
d1af2efa95 vectors: Swap code files also 2024-07-11 01:17:49 +00:00
Alx Sa
5cd7c5c2f8 actions: Swapped text actions 2024-07-11 01:17:49 +00:00
Alx Sa
853f37bed9 app: Rename app/core GimpImage vectors API...
...to paths.
Similar to d0bdbdfd, but covering the
app/core versions of the API instead of
libgimp. Changes the names of
gimp_image_*_vectors () API to
gimp_image_*_path[s] ().
Also renames some related functions such
as gimp_image_pick_path (). The next step
will be to rename the gimp_vectors_* () to
gimp_path_* ().
2024-07-11 01:17:49 +00:00
Alx Sa
c1bd108bba widgets: Connect Configure this tab icon to icon size changes
Inspired by Mark Sweeney's work.
GimpDockbook's dockable tabs update whenever the icon size is
changed. However, the Configure this tab button icon does not,
so it always remains at 12px. This patch adds code to resize it to 75%
of the current tab icon's size, which mirrors the default relationship
of 12px to 16px. This allows the icon to grow when the icon size is
set to Large or Huge.
2024-07-10 10:03:32 +00:00
Bruno
9d86492b14 build: Make scripts numbering and storing consistent
The numbering is now inline with actual the order of jobs on CI
to make easier to understand what the numbers represent.
To understand why bundling is number 2 see: d09a2a6f and 2dc6f411

The storing of Windows scripts was changed to make easier to
call them, to better convey that they work outside CI and
to be consistent with other build/ subdirectories.
2024-07-10 00:04:03 +00:00
bootchk
0dae61772a Fix #11613 crash Wayland flatpak unreffing GBytes window handle
Refactor: extract method gimp_widget_free_native_handle.
This reduces duplication of code and encapsulates Wayland specific code.

Call the new function in more places.
This is expected to fix #11613 but it is hard to be sure
since the exact sequence of events in 11613 was never determined
and only reproduceable in some flatpak builds.

Calling the new function in more places also should eliminate leaks.
But I did not test there was a leak prior to this fix.
2024-07-09 17:48:53 +00:00
bootchk
bdddc94151 libgimpwidgets: fix #11339 chroma slider fail on small increments
In GimpColorSelector setter, don't change the model if perceptually same.
More than just don't emit changed, don't change the model value.

Also, fix leak by freeing old color.
2024-07-09 15:56:07 +00:00
bootchk
5cc187b597 Fix #9851 radio menu groups fail show any active item
End the radio group of a submenu when the submenu ends.
So subsequent radio menu items are in a new radio group.
2024-07-09 15:42:50 +00:00
Lukas Oberhuber
2341259f36 os-support: Remove mention of 2.10 2024-07-09 15:24:54 +00:00
Lukas Oberhuber
15f5adae0b os-support: Update MacOS supported platforms for GIMP 3.0 2024-07-09 14:57:57 +00:00
Bruno
d3ccac8d2f build/windows: Bundle 'share/poppler' again following 25701f6c 2024-07-09 14:36:14 +00:00
Alx Sa
b90b6bce00 pdb, libgimp: Rename libgimp GimpVectors vectors API...
...to paths
Follow-up to d0bdbdfd. Changes all
gimp_vectors_* () PDB to gimp_path_* ()
and renames relevant PDB files from
vectors to path.
The next step will be to rename
GimpVectors in libgimp to GimpPath,
removing the last (public) trace of it.
2024-07-08 23:39:51 +00:00
Jordi Mas
cdde11b19d Update Catalan translation 2024-07-08 17:19:31 +02:00
Alx Sa
00d07e028f libgimp: Fix gimp.def order 2024-07-08 02:22:57 +00:00
Alx Sa
d0bdbdfdf6 pdb, libgimp: Rename libgimp GimpImage vectors API...
...to paths

The first step in converting GimpVectors
to GimpPath. The PDB API for any
gimp_image_*_vectors () is now
gimp_image_*_paths ().
This commit only covers libgimp, and
the app/core versions will be renamed in
a following commit.
2024-07-08 02:09:42 +00:00
Bruno
40ecfd40ad Issue #11455: Split flatpak jobs
- Dependencies not present in GNOME runtime are now built in deps stage
  This makes easier to follow the progress of the overall pipeline and
  to know how much time was spent on each stage
  (like crossbuilds, the artifact size is brutal but only lasts 2 hours)

- babl and GEGL build now have output in GitLab runner, unlike others deps
  This makes clearer to spot if something goes wrong in these crucial deps

- GIMP is still built in its stage but now alone, like Debian and Windows
  This makes possible to retrigger only this job when runner errors occours,
  without needing to start monolithically the deps+gimp build from scratch

Also:

- babl, GEGL and GIMP now have meson-log.txt artifact like other builds

- dist job now have all commands self-contained on its script (needs to
  be merged to be tested according to my tests)
2024-07-07 21:46:52 +00:00
Jehan
dac11f11aa libgimp: add G_GNUC_WARN_UNUSED_RESULT to several functions.
Functions creating a new GeglBuffer should trigger a warning if the
result if unused, because this is potentially a big memory leak.

Similarly objects created by functions creating new layers should be
handled (usually by adding the layer to the image with
gimp_image_insert_layer()), because they also come with a buffer and
possibly quite some important memory leak.
2024-07-07 22:39:13 +02:00
Jehan
ebc4f9afab app, libgimp: initialize GimpGroupLayer.
If the type is not registered, g_type_from_name() is not able to find
the GType from the type name.

Fixes:

> gimp_gp_param_to_value: type name GimpGroupLayer is not registered

Also add a bit more type handling code.
2024-07-07 22:27:22 +02:00
Alx Sa
d10a8c357f plug-ins: Allow Python GUI resources to be empty
Resolves #11772
While ba79fd00 fixed the number of
arguments in the resource arguments,
setting them to False prevented the GUI
from opening if the gradient wasn't set.
This patch switches the value to True to
fix the problem.
2024-07-07 19:19:16 +00:00
Alx Sa
86ef74ae95 plug-ins, tests: Update Python plug-ins after b1736a67
Two instances of Gimp.Layer.group_new ()
were missed during the initial port.
2024-07-07 12:37:33 +00:00
Alx Sa
ba79fd00d3 plug-ins: Update Python plug-ins after 6d36d143
A new parameter was added to indicate if
it was okay to run without setting these
resource values.
2024-07-07 12:05:54 +00:00
Alx Sa
8e6fb3d0e4 pdb: Remove uchar type
Resolves #10855
Replaces the uchar arguments in
plug_in_exchange () with floats to better
match gegl:color-exchange's arguments.
Since this was the last plug-in that used
uchar, we also remove the datatype from
PDB.
2024-07-07 11:14:41 +00:00
Alexander Shopov
d213235d37 Update Bulgarian translation 2024-07-07 09:00:14 +00:00
Alexander Shopov
d69e8abfa6 Update Bulgarian translation 2024-07-07 08:54:55 +00:00
Jehan
fc3cfc7771 app, libgimp: oups, fixing some generated sources.
These were some last minute fixes in the PDB and it looks like I forgot
to amend commit b1736a6736 with these!
2024-07-07 10:43:51 +02:00
Jehan
87d89ba062 libgimp: some object's header cleanup.
Using G_DECLARE_*() macros everywhere, aligning functions, including the
parent class header…
2024-07-07 10:27:04 +02:00
Jehan
b1736a6736 app, libgimp, pdb, plug-ins: new GimpGroupLayer class in libgimp.
Also:

- renaming gimp_layer_group_new() to gimp_group_layer_new() in order to keep the
  same name as in core code (i.e. GimpGroupLayer, not GimpLayerGroup).
- renaming gimp_image_merge_layer_group() to gimp_group_layer_merge()
- new functions: gimp_procedure_add_group_layer_argument(),
  gimp_procedure_add_group_layer_aux_argument() and
  gimp_procedure_add_group_layer_return_value().

This can be tested, e.g. in Python with these calls:

```py
i = Gimp.get_images()[0]
g = Gimp.GroupLayer.new(i, "hello")
i.insert_layer(g, None, 1)
g2 = Gimp.GroupLayer.new(i, "world")
i.insert_layer(g2, g, 1)
g.merge()
```

This was work started long ago, stored in an old stash which I finally
finish now! :-)
2024-07-07 10:27:04 +02:00
Bruno
98d3956fef build/linux: Fix flatpak ignoring fork source code
See: https://gitlab.gnome.org/GNOME/gimp/-/merge_requests/1670#note_2152565

This makes the NIGHTLY flatpak use the local GIMP source. This reduces the
internet usage and makes possible to generate .flatpak from every branch out
there, which turns the flatpak finally really useful to code development.

Of course, this makes impossible to run 'flatpak-builder NIGHTLY_manifest.json'
without cloning or downloading GIMP code, but this is not a regression since:

1) the NIGHTLY manifest is in-source to begin with, so same thing as our other
   building methods (except macOS), which runs over the code they are stored

2) the chances of someone downloading partial source code (the NIGHTLY manifest
   alone) so being unable to build are low since this file isn't too easy to find

3) even if someone do this and don't like, we are not violating flatpak building
   pratices since this option exists to be used (and will be in NIGHTLY only)
2024-07-06 13:08:47 -03:00
Jehan
703305d270 libgimp, gimp-data: now skipping the _list_ array functions.
In most bindings, they would just result in the same signature as the
_get_ variants (which people have been used to, since the GIMP 2
series). Also I was told that apparently in some bindings where this
would make a different signature, the (skip) annotation could be ignored
anyway.
2024-07-06 14:51:23 +02:00
Jehan
8b6d90700a libgimp, pdb, plug-ins: don't skip gimp_*get_*() API from GObject Introspection anymore.
The original reason to skip these was because the new _list_ API were
introspected basically to a similar function signature, except with a
useless return value, at least in pygobject binding where the list size
was also returned.
Though it seems that in fact, only the docstring was wrong. The real
signature was apparently already the same.
See: https://gitlab.gnome.org/GNOME/pygobject/-/issues/352

Therefore since the _get_ naming is more consistent compared to other
existing function, let's re-integrate the _get_ functions for array of
items or images.

This basically reverts commit 15ec254148.
2024-07-06 14:44:45 +02:00
Jehan
38946716f2 NEWS: update. 2024-07-06 14:44:45 +02:00
Jehan
ac030a0cd7 libgimp, plug-ins: make generic gimp_procedure_add_argument() private.
Same for gimp_procedure_add_aux_argument() and gimp_procedure_add_return_value().

We now have specific public functions for every supported type and it's
in fact much better to use them. The generic functions gave the feeling
that we could use any GParamSpec as procedure argument, whereas we in
fact depend on what the PDB support, and only these subtypes.
2024-07-06 14:44:45 +02:00
Jehan
6d36d143e8 libgimp, plug-ins: fix gimp_procedure_add_*_argument() where * is a resource type.
The correspondant param specs' fourth arg was a `none_ok` boolean, not a
type. Carry over this argument to the gimp_procedure_add_*() function.
2024-07-06 14:44:45 +02:00
Bruno
26645ab404 build/linux: Temporarily drop 'aalib'
It's failing badly even with the gcc trick.
I hope re-adding it soon with the MSYS2 patches.
2024-07-06 11:19:41 +00:00
Bruno
ad7ef08ea0 build/linux: Antecipate some Clang changes to properly work on aarch64
Despite we not building gimp nightly on aarch64 we need to sync with beta.

So, this updates to LLVM/Clang 18, which fixes 'gexiv2' and 'poppler'
problems with deps on that arch. 'json-c' and 'luajit'  were adjusted too
with the use of proper build options to fix errors.
2024-07-06 11:19:41 +00:00
Bruno
78c85f6f45 build/linux: Sync poppler, ghostscript and openblas with beta manifest 2024-07-06 11:19:41 +00:00
Alx Sa
ea63e99ab8 widgets: Cast GimpColorDialog to GtkWidget...
...when passing it in gimp_color_dialog_style_updated ().
This fixes a compiler error introduced in c5efa0b8 on
some Windows builds.
2024-07-05 11:43:40 +00:00
Fran Dieguez
a5c91110b4 Update Galician translation 2024-07-05 10:37:04 +00:00
Jehan
caffd09b5b libgimp, plug-ins: getting rid of gimp_procedure_add_*_from_property() functions.
These were created because of some limitation/bug in pygobject, which is
now much better worked around by having specific functions for every
argument type supported by the PDB.
2024-07-04 22:11:53 +02:00
Jehan
25701f6c1b Issue #11760: explain why poppler-data is a hard dependency. 2024-07-04 21:50:11 +02:00
cheesequake
8ebe9b090d core: Fix layer regeneration after crop undo
Resolves #10523
As we loop through every layer, we enable resizing
of the drawable on undo.
2024-07-03 11:26:55 +00:00
Luming Zh
8d3d408b14 Update Chinese (China) translation 2024-07-02 11:09:04 +00:00
Alx Sa
b3b32c7765 widgets: Disconnect gimp_color_editor_display_changed...
...when dockable is closed.
Resolves #11748

gimp_color_editor_display_changed () was still connected to
the user context when the Color dockable was closed. This
resulted in either a critical or crash if a new Color dockable
was opened or if the GIMP was closed. This patch should
cause the signal to be disconnected automatically when
the editor is destroyed.
2024-06-30 04:14:48 +00:00
Alx Sa
c5efa0b874 gui, widgets: Connect GimpColorNotebook to icon size changes
Inspired by Mark Sweeney's work.
GimpColorNotebook has existing code to
update the color selector tab icon sizes
via CSS. However, it was not set up to be
notified of icon size changes from the GUI.
Since GimpColorNotebook is in libgimpwidgets,
we call its style_updated () function from
the style_updated () functions of the two
widgets its created in - GimpColorEditor
and GimpColorDialog.
2024-06-29 20:10:26 +00:00
dimspingos
c31faab2c0 Updated Greek translation 2024-06-29 13:23:26 +03:00
Luming Zh
0a8bf6857d Update Chinese (China) translation 2024-06-29 00:09:41 +00:00
Joachim Priesner
35deb1eb30 dialogs: Don't escape underscores in Welcome Dialog recent files list
It seems unnecessary – at least on my system, files with underscores in
their names are shown with two underscores in the recent files list.
This patch fixes that.
2024-06-28 20:50:21 +00:00
Alexander Shopov
92b8670c21 Update Bulgarian translation 2024-06-28 05:15:59 +00:00
Anders Jonsson
7f9e819b50 Export histogram: fix blank lines on Windows
For the Python 3 case in issue #6096 following the
instructions of zjw and the Python 3 manual.
2024-06-27 21:21:30 +00:00
Alx Sa
87eadbf5d1 dialogs: Fix theme selection on reset
The Preference settings for themes and icon themes
are not directly connected to the property due to
the possibility of custom themes. Instead, we create
GtkListBoxes and load all the theme values. As a result,
when the preferences are reset, the row selection is not
updated.

This patch adds signals to the config object that update
the listbox selections when the Reset button is clicked.
The handler IDs are stored in the dialogue so that we
can remove them when the dialogue is closed.
2024-06-27 14:14:15 +00:00
Alx Sa
2bd598bcfd plug-ins: Fix crash in Export Histogram on file save
Resolves #11742
gimp_procedure_dialog_get_file_chooser () does not
work with GtkFileChooserAction.SAVE enums yet.
This was incorrectly left in by f5b7f734.
This patch removes the command to fix a crash.
2024-06-27 11:14:12 +00:00
Jacob Boerema
0c3bf56d83 app: fix help id for layer-lock-visibility is not set 2024-06-26 15:16:45 -04:00
Daniel
82fa7dccc1 Updated Spanish translation 2024-06-26 14:03:14 +02:00
Bruno
e59dec503e build/windows: Include only the bare minimum files to run TWAIN
As decided in #10922, 32-bit will be tolerated in 3.0 series because of TWAIN.
So, let's package only the bare minimum files to the 32-bit TWAIN plug-in work.

This reduces the final installation size by approximately 215MB.
2024-06-25 14:52:14 -03:00
Luming Zh
8a927753d9 Update Chinese (China) translation 2024-06-25 12:27:49 +00:00
Luming Zh
314e03a5ce Update Chinese (China) translation 2024-06-25 12:20:16 +00:00
Yuri Chornoivan
5af2599500 Update Ukrainian translation 2024-06-25 11:25:40 +00:00
Bruno
adda94e4d2 build/windows: Mimic 'AppVerName' against Inno pervasive behavior
It's a common pratice to tell the user what version is being installed
even if this is somewhat obvious (the user opened the installer, he
should know it). Many installers do this and Win MSIX installer too.

However, there is no sign in our Installer about what version is
being installed (the reused splash/intro image doesn't count because
it isn't always different at each micro or revision, and text is small).

---

To accomplish that feature, the Inno langs needed to be patched since
Inno actually forbidden to use that feature when we have a Welcome page.
https://groups.google.com/g/innosetup/c/w0sebw5YAeg

But 'UninstallAppFullTitle' from the following langs couldn't be patched:
- Japanese
- Lativian
2024-06-24 19:56:46 +00:00
Jacob Boerema
1e0be3d063 app: fix CI build failure core-enums.c is generated from core-enums.h
I only updated the mask strings to plural in core-enums.c, overlooking
that it is generated from core-enums.h.
So, update the same strings there after "desc".
2024-06-24 19:25:25 +00:00
Bruno
2450b93062 meson, build/linux: Fix 'sed' hell in Flatpak build
Thanks @Jehan for noticing the right fix, way better than !1281
and subsequent tortuous workarounds.
2024-06-24 17:39:46 +00:00
Bruno
e5b6dab298 build/windows: Merge '(INFO): moving DWARF...' with '(INFO): extracting...'
This makes easier to understand to where the .debug files are being moved.
2024-06-24 12:21:18 +00:00
Rodrigo Lledó
bf457a9fc8 Update Spanish translation 2024-06-24 12:09:37 +00:00
Rodrigo Lledó
75f42834f7 Update Spanish translation 2024-06-24 11:22:27 +00:00
Martin
bd1f0e4c36 Update Slovenian translation 2024-06-24 07:07:53 +00:00
Ekaterine Papava
4970f72044 Update Georgian translation 2024-06-24 03:37:25 +00:00
Bruno
51b2f2b037 build/windows: Silence 'glib-compile-schemas' in Crossroad Deps script
Wine always outputs an ugly warning, even the command running fine.
Some first-time contributors got confused about this on IRC.
2024-06-24 00:01:08 +00:00
Bruno
00e11df317 build/windows: Debloat 'share/locale' bundling
Only iso_639.mo is needed. This also reduces the bundle and installs in 15MB.
2024-06-23 23:38:49 +00:00
Ekaterine Papava
d46f15f253 Update Georgian translation 2024-06-23 23:24:07 +00:00
Jacob Boerema
51b444b846 app, actions: be consistent and use plural for layer moving ...
commands that work on multiple layers:
Raise Layer -> Raise Layers
Layer to Top -> Layers to Top
Lower Layer -> Lower Layers
Layer to Bottom -> Layers to Bottom
Also update the hint strings.
2024-06-23 19:05:01 -04:00
Martin
d875f09b51 Update Slovenian translation 2024-06-23 21:11:58 +00:00
Rodrigo Lledó
e928bc96c2 Update Spanish translation 2024-06-23 20:44:33 +00:00
Bruno
56269a68f6 build/windows: Add custom icon to the Installer setup
There are two approaches regarding the icon for Windows installers .exe:
1) same icon as the app: this give more identity, but creates confusion if
   you saved the installer in the same dir of the installed app shortcut.
   This approach is also confusing in the task bar (e.g.: running GIMP
   stable while installing GIMP unstable);
2) generic icon (e.g. a box, a cd) provided by the tool: more generic if
   you downloaded two installers generated by the same tool (ours is Inno)

I choose a middle ground and created a icon with: the app icon and an
"installer" symbol (a package box), which conveys the best of two words.

This also fixes the Inno inborn bug of the unninstaller with install icon.
2024-06-23 20:30:36 +00:00
Yuri Chornoivan
bc2917b1f3 Update Ukrainian translation 2024-06-23 18:57:03 +00:00
Jacob Boerema
5f41b4460c app, actions: be consistent and call Duplicate Layer -> Duplicate Layers
Since it works on multiple selected layers use the plural like we
also do in other similar cases.
2024-06-23 14:09:06 -04:00
Yuri Chornoivan
680d84292b Update Ukrainian translation 2024-06-23 17:24:29 +00:00
Alx Sa
9c46d0a689 libgimp: Use RGB/A u8 format for indexed color params
Resolves #11018.
Currently, babl formats are saved as strings when
passed as params. However, indexed palettes do not
use a "standard" encoding string but are created from
palettes (with a custom format). This results in an
error when we attempt to recreate the babl format from
the custom string encoding, as it doesn't exist at that
point.

This patch mitigates the problem by converting the indexed
color to RGB/A 8-bit when used in params. In the future when
indexed mode supports different color spaces and higher
precision, we will need to remove the hard coding. For now,
it solves the immediate problem.
2024-06-23 16:09:38 +00:00
Bruno
16dc7b4047 build/windows: Debloat 'lib/python3.11' bundling
After running almost all the py plug-ins, I noticed that few py modules and
pkgs are used to justify the need of a slightly faster build time with .pyc.
In the actual bloated status (with all .pyc), lib/python* is about 260 MB big.
With the bare minimum .pyc after the tests above, python*/ is less than 90.

So, let's purge the .pyc at bundling time (I'm not reinventing the wheel,
Krita do this too), which reduces the .zip bundles (so the Inno and MSIX
installs) in 170MB, the Installer .exe in 45MB and MSIX download in 60MB.

---

Let's also disable any .pyc generation, since GIMP installed with Inno in the
system-wide (aka admin) mode or installed with MSIX both doesn't handle well:
py plug-ins work but have CLI errors, unlike Inno user-mode and .zip bundle.
2024-06-23 14:09:22 +00:00
Martin
47edc69c6d Update Slovenian translation 2024-06-23 13:12:49 +00:00
Bruno
8a2ce9d16f build/windows: Make Installer's Language dialog automatic
Actually, the Language dialog is always displayed, which is not too good since:

1) This is inconsistent: the install mode dialog (to choose user or system)
   appears before using the system lang automatically. Even if Inno fix this:

2) This is tiring: depending on the context, the user can see up to 5 dialogs:
   SmartScreen (1) > Install mode (2) > installer lang (3) > dev warning (4)
   > SetupMutex (5): https://groups.google.com/g/innosetup/c/bkRtnHz2ygg

3) This is redundant: even if only 2 and 3 are displayed, why 2? Inno will
   auto select the sys lang, which the user understand to search GIMP for PC;

4) This is confusing: even the lang dialog message being clear, some users
   genuinely conclude that the selection will carry over to GIMP install like
   the old Adobe CS installer (#5515). !1628 makes more clear that not, but
   reducing confusion even more is a welcome plus considering points above.

So, let's use 'ShowLanguageDialog=auto'. That option ensures that the dialog
will NOT appear if the sys lang have a translation present in the installer,
which matches what every program does and even installers like Inkscape one.

If the lang isn't included in the installer, the dialog WILL appear so the
user can choose one which he is more fluent, being is a nice middle ground.
2024-06-22 21:53:25 +00:00
Jacob Boerema
6dbf144f6b app: add missing help ids for the text tool 2024-06-22 16:47:44 -04:00
Jacob Boerema
9c432f6505 app, actions: use consistent naming for Text to Path
In the main menu and layers dialog context menu it is called
`Text to Path`, let's use that same name in the text tool actions
instead of `Path from Text`.
2024-06-22 16:11:57 -04:00
Bruno
dfceba448f build/windows: Fix Inno wrong components size calc (part 1)
This solves an old bug that makes Inno report GIMP as being almost 1.8GB,
which is not true (it's 1.3GB at most). That was probably caused by the
overuse of components intersections (e.g.: gs + gimp, py + deps), which
Inno does not handle well (sometimes it not even displayed the cmp size).

TWAIN component is still reporting a wrong size since it's a totally
different beast, it will be fixed later.
2024-06-22 18:52:20 +00:00
Bruno
9b29cc35be build/windows: Reduce redundancy on [Files] flags 2024-06-22 18:52:20 +00:00
Jacob Boerema
a3ecca3487 app: fix some layer mask strings
Not all layer mask menu commands and help texts were updated to reflect
that they work on multiple masks.
Updates
- Apply Layer Mask -> Apply Layer Masks
- Delete Layer Mask -> Delete Layer Masks
- Their text hints and the one for Disable Layer Masks

Updates the undo strings, even though these don't seem to be used
anymore? Looks like undo always picks the menu command now.
2024-06-22 14:20:02 -04:00
Alx Sa
3842efd524 libgimpcolor: Remove GimpCMYK code
Part of the color space invasion API
updates. CMYK conversion should be
done through babl/GEGL now.
2024-06-21 16:00:18 +00:00
Bruno
04a9771c9c gitlab: Comment 'Contribution guidelines' in MR template
This is inline with our pratice in issue templates and it is welcome because
contributors who are subscribed to MRs can be annoyed by generic descs.
2024-06-21 15:06:29 +00:00
Bruno
d071d01666 Revert "build/linux: Drop 'cfitsio' for now due to security concerns"
This reverts commit d64cbf1993.

By the way, change to a more trustful source repo in the hope of working.
2024-06-21 14:20:39 +00:00
Alx Sa
26fe9713e1 modules: Remove last usage of GimpCMYK
It had actually been made unnecessary by 1c81c426.
This will allow for the full removal of GimpCMYK from
the codebase as part of the color space invasion.
2024-06-21 12:44:08 +00:00
Rodrigo Lledó
5f9e939e09 Update Spanish translation 2024-06-21 12:43:09 +00:00
Alx Sa
fcdddad2a7 core: Include NDE filters when opening as layers
Adds code to copy any NDE filters when
importing an .xcf file as layers in an
existing project.
This also requires removing the check
for the layer being attached to an image,
which historically made sense because
filter effects were immediately merged
down. Now that filters can exist separately
the check is no longer required.
2024-06-20 19:06:57 +00:00
Bruno
ebeef5d7ef build/linux: Move HEIC support to an extension
Ported from downstream (with proper adaptations):
3d7f13ff3c
2024-06-20 14:33:47 -03:00
Bruno
744abbbd6b build: Respect contributor's own GIMP_PREFIX
This makes the scripts less pervasive locally.
2024-06-20 16:20:11 +00:00
Yuri Chornoivan
990f9b7871 Update Ukrainian translation 2024-06-20 15:37:34 +00:00
Alx Sa
134100fb8a app/tools: Allow locked layers to be used as sources
GimpSourceTools like Clone and Heal use GimpPaintTool's
code for determining if they can work on a pixel-locked
layer. This means that they can not set a locked layer as a
source even though that would not affect the locked layer's
pixels.
This patch adds an additional condition to GimpPaintTool, to
allow operations if the tool is a GimpSourceTool AND only
Ctrl is held down. This allows the layer to be set as a source
while preventing it from being drawn on.
2024-06-20 13:13:47 +00:00
Nils Philippsen
05b470eba7 Fix gobject introspection references
Newer gi-docgen will fail otherwise.

Signed-off-by: Nils Philippsen <nils@tiptoe.de>
2024-06-20 12:14:23 +00:00
Bruno
3ea2fd4e19 build/windows: Avoid bloated .mo in Crossbuild bundling
Since CROSSROAD_PREFIX have system and GIMP_PREFIX mixed, we shouldn't
rely on that folder to list the supported langs. Let's do it more smartly.
2024-06-20 12:10:02 +00:00
Bruno
5e500aeb78 Issue #11714: Temporary fix failing Flatpak builds 2024-06-20 08:03:22 -03:00
Jacob Boerema
d190c37a2c app: add missing help-id for layer effects
Note that this isn't enough for F1 to work, but that is a separate
issue.
I think that for now one help-id for all the layer effects is enough,
until we get a more final UI.
2024-06-19 13:42:49 -04:00
Bruno
d83c254ce1 meson: Clarify Lua state on Windows
lua-lgi now works with Lua 5.3 on Windows:
https://github.com/msys2/MINGW-packages/issues/21171

According to my tests, after installing lua53-lgi MSYS2 package,
lua5.3.exe tries to run the goat exercise (fails since the goat
uses different lua API). Anyway, lua5.1 isn't required per se.
2024-06-19 10:17:51 -03:00
Bruno
46698e25d5 build/windows: Clarify Installer optional params 2024-06-19 13:03:03 +00:00
Bruno
5c3620cbe7 build/windows: Move *associations.isi and *configoverride.isi to main .iss
Following c6634d66 and 09d6402a

These files are too small and aren't reused so no point keeping them modular.
Also, with them inside .iss we reduce the clutter in the installer/ folder.
2024-06-19 13:03:03 +00:00
Luming Zh
6762874412 Update Chinese (China) translation 2024-06-19 11:34:14 +00:00
Ekaterine Papava
49af594a69 Update Georgian translation 2024-06-19 03:52:23 +00:00
Bruno
3ee8c4e9a5 build/windows: Debloat 'share/glib-2.0' bundling
According to my tests, seems that only 'gschemas.compiled' is needed
2024-06-18 22:52:54 -03:00
Bruno
18187926cd build/windows: Bundle 'share/lua' again on Windows
Despite that folder mysteriously not being mandatory on Linux
(the contents are different), on Windows (in PCs without MSYS2)
this is required by a warning. So, partially reverts c808d13b
2024-06-18 22:52:38 -03:00
Bruno
a1cb43d977 build/linux: Add way to locally emulate flatpak CI building
This is useful to debugging only
2024-06-19 01:02:58 +00:00
Martin
f23b0744d7 Update Slovenian translation 2024-06-18 21:38:53 +00:00
Bruno
c7f7c5d147 build/windows: Direct Installer users to the specific updates page
The gimp.org main page was being used as the updates URL but the
downloads page is more direct, avoiding confusion with news or with
the stable big red button (remember: we also have dev installers).
2024-06-18 16:57:03 -03:00
Alx Sa
0ace660248 plug-ins: Fix crash with OpenEXR chroma images
The OpenEXR plugin was specifically set
to throw an exception if a chroma image
(Y/BY/RY) image was loaded.
This patch removes the exception and loads
the luminance channel only as a grayscale image,
which is how Krita currently handles it.
Future work is needed to properly convert the
chroma channels to import as a RGB(A) image.
2024-06-18 19:42:59 +00:00
Bruno
bb9716d609 build/linux: Enable colorful output under 'flatpak-builder'
Following 0f425554

Ninja and Cmake (which some modules use) supports colorful output.
To enable it, we need to set in the manifest due to the sandboxing.

See also: https://github.com/flatpak/flatpak-builder/issues/605
2024-06-18 16:09:05 -03:00
Bruno
d64cbf1993 build/linux: Drop 'cfitsio' for now due to security concerns
Temporarily drops 'cfitsio' which started weeks ago to change its hash.
In my tests, after "fixing" the hash, sometimes it alternates to another,
which breaks the build again. This is too hard to maintain and unsafe(?).
2024-06-18 14:58:07 -03:00
Bruno Lopes
3a54c37daa gitlab-ci, build/linux: Move Flatpak CI code to scripts that works
This will make easier to debug problems locally if needed and
have the potential to reduce the first barrier for Linux newbies.
2024-06-18 14:57:39 -03:00
Anders Jonsson
36f6b476f0 python: don't translate test plug-in
Following the note of 'no i18n' in the header
2024-06-18 11:13:06 +00:00
Rodrigo Lledó
1e48badea2 Update Spanish translation 2024-06-18 11:08:23 +00:00
Rodrigo Lledó
4deb132243 Update Spanish translation 2024-06-18 10:58:44 +00:00
Alx Sa
dc0449b05e widgets: Fix label background on Curves tool
Resolves #11702
In 2.10, the x/y label background on the Curves tool used
GtkStateType enums to get the widget's background color.
These enums were depreciated in GTK3, and during the
port the gdk_cairo_set_source_rgba() command was left
out. This resulted in the current line color being used instead,
making it hard to read the label in some instances.

This patch restores the Cairo color update command, using
the gridline color as an equivalent to the background color
from 2.10.
2024-06-17 13:05:38 +00:00
Alx Sa
9256a15363 widgets: Prevent image name from affecting the dialogue width
Resolves #7588
After the port to GTK3, the Filter dialogue's width started
to be affected the length of the image name. If the name
was very long, the filter dialogue would expand to fit it.

This patch encloses the image title label in a GtkScrolledWindow
with polices of EXTERNAL width and NEVER height. This ensures
there will not be a scrollbar, and the label will not influence the
width of the dialogue. A tooltip was added in case the user wants
to hover to see the full name.
2024-06-16 16:12:16 +00:00
Bruno
de556c0734 build/windows: Move Installer (fully) to Win32 Vista design
Following e93e0f49

This defaults 'Segoe UI' for Installer texts and for license's body. This
font is still used as the default in Windows 11 and even in online docs.

We are also bumping to 9 pt as outlined in the final Win32 guidelines:
https://learn.microsoft.com/en-us/windows/win32/uxguide/vis-fonts
I've done microscopic pixel checks and confirmed that this produces a Win32
compliant design, which renders kerning and spacing equal as 'Win + R' and
UWP Notepad (please note that some "legacier" Win32 apps renders different)

---

Also, change from Lucida Console to 'Consolas' (default console font since
at least Win8). Today it is Cascadia Mono but not included with Win 10.
2024-06-16 08:17:20 -03:00
Rodrigo Lledó
5da85f6a31 Update Spanish translation 2024-06-16 01:20:29 +00:00
Bruno
8315967735 build/windows: Little fix after b38d0455 2024-06-15 15:40:45 +00:00
cheesequake
fb4cd9aedc core: Fix drawable filter duplication
Resolves #11690
While exporting, the image is duplicated, in turn,
filters are also duplicated. This patch fixes the
duplication by also copying the parent
GimpFilter's properties.
2024-06-15 13:58:33 +00:00
Bruno
b38d0455c3 build/windows: Make clear crossbuild awful situation
Some contributors got confused about how to crossbuild on IRC. Let's help them.
2024-06-15 08:47:18 -03:00
Bruno
0397132184 gitlab-ci: Restore 'meson-log.txt' as artifact
Restores the build log artifact which was lost partly due to my fault.
The log is very useful in the rare cases of breaking the build system.
So, following our experience, let's save it for, at minimum:
- Native Linux
- Native Linux flatpak: will be adressed later in another commit
- Cross Win
- Native Win (aarch64)
2024-06-15 07:27:31 -03:00
Bruno
0f42555484 gitlab-ci, meson: Enable colored Clang output
This makes easier to spot warnings.
2024-06-15 00:34:54 +00:00
Bruno
fa26f20e9f gitlab-ci: Disable CI scripts 'debug mode'
If we were in the first days of our CI (so script bugs are common),
the scripts "debug mode" (bash -x) would be crucial, but we are not.

To be fair, running scripts in "debug mode" is pretty harmful today:
1) the produced logs consume our quota more and more (e.x.: adding a
   bit more complicated .sh function can double the output size); and
2) the long white logs tends to be specially hard to read by the way.
2024-06-15 00:34:54 +00:00
Bruno
c808d13b6e build/windows: Debloat a bit Windows bundling
This makes the output more complete but at the same time less
polluted regarding the bundling scripts (base, deps and sym).

---

Also, packaging scripts (inno and msix) were touched as consequence
of experiments about drop bundling, for saving space (~20MB), of:
- etc/gtk (MSYS2 don't build immodules)

- share/ghostscript (macOS .dmg don't package it)
- share/libthai (macOS .dmg don't package it)
- share/locale (???, decided to kept only gtk and iso-codes to test)
- share/man (installer don't package it, maybe because Windows can't open)
- share/poppler (macOS .dmg don't package it)

- bin/bzip2.exe (???)
- bin/gdk-pixbuf-query-loaders.exe (loaders.cache already bundled)
- bin/gspawn*.exe. (???)

- share/gir-1.0 (installer don't package it)
- share/lua (???)
- share/vala (installer don't package it)

The "???" ones seems to not be used according to my local tests. If
they are, a bug will appear so we will be able to know, comment in
the script (for maximum clarity towards the future) then revert.
2024-06-15 00:34:54 +00:00
Martin
08701da730 Update Slovenian translation 2024-06-14 20:08:50 +00:00
Yuri Chornoivan
a69cb1be2f Update Ukrainian translation 2024-06-14 19:17:31 +00:00
Luming Zh
be0a6dfb12 Update Chinese (China) translation 2024-06-14 08:35:26 +00:00
Ekaterine Papava
7f2f3e7e99 Update Georgian translation 2024-06-14 03:51:00 +00:00
Ekaterine Papava
4058db1f70 Update Georgian translation 2024-06-14 03:48:16 +00:00
Alx Sa
bac368af0b libgimp: Remove GIMP_PROC_* macros
These have been replaced with
gimp_procedure_*_argument () functions.
2024-06-13 23:17:48 +00:00
Alx Sa
4bf5dc7b97 plug-ins: Port argument macros to functions
With the new API introduced int d1c4457f,
we next need to port all plug-ins using
the argument macros to functions.
This will allow us to remove the macros
as part of the 3.0 API clean-up.
2024-06-13 23:17:48 +00:00
Yuri Chornoivan
0de33a0462 Update Ukrainian translation 2024-06-12 17:36:08 +00:00
Bruno Lopes
21ffb58903 Issue #811: Make each language a component for the Installer
In the process, make the Installer localization process less 'masochist'
(in other words: less manual). The custom '.xml' was the only way since
the iso-codes, Dammed Lies and Inno namings don't match.
2024-06-12 11:38:36 -03:00
Alx Sa
0be5db0b77 widgets: Allow deleting inactive filters
Resolves #11687
Previously gimp_drawable_has_filters () was used to check
if a drawable had filters before deleting them. However,
this function actually only checks if there's an active filter -
if filters are attached but set to invisible, this returns false.
This mean that you could not delete filters if they were
invisible.
This patch switches to using gimp_container_have () instead
as it checks if the filter is in the drawable's filter stack.
2024-06-12 13:44:21 +00:00
Luming Zh
d4046c24ed Update Chinese (China) translation 2024-06-12 12:10:09 +00:00
Martin
389b6d98b4 Update Slovenian translation 2024-06-11 21:11:02 +00:00
Anders Jonsson
ef91ab25eb python: remove accelerator in title bar 2024-06-11 20:22:15 +00:00
Martin
7ee8558033 Update Slovenian translation 2024-06-11 19:48:52 +00:00
Jacob Boerema
3fc861e186 tips: remove tip about dynamic keyboard shortcuts
Since dynamic keyboard shortcuts are not available anymore, remove
the obsolete tip about it.
2024-06-11 14:57:24 -04:00
Yuri Chornoivan
128e99f76b Update Ukrainian translation 2024-06-11 18:27:29 +00:00
Alx Sa
f5b7f734e2 python: Minor enhancements to python plug-ins
* colorxhtml.py was converted to use
GimpProcedureDialog. A new aux
argument was added so that a widget
could be created in the GUI. The text
field and the file widgets were made
to be sensitive to the source-file bool to
better indicate to the user which one will
be used.

* palette-sort.py now uses babl instead of
colormath libraries to get CIE LAB and
CIE LCH(ab) values. This means all users
will be able to sort by those options even
if the colormath library isn't installed.

* histogram-export.py's out-format
widget was converted to a radio frame
as it is in 2.10.
2024-06-11 17:17:41 +00:00
Martin
2a8e75de6a Update Slovenian translation 2024-06-11 15:33:33 +00:00
Alx Sa
d00aacfea2 libgimpwidgets: Fix Procedure Browser description size
Currently when you open the Procedure Browser, part of the
description text is off-screen.
This patch changes the values for the GtkPaned panels so that
the description is completely visible horizontally. It also makes
the vertical scrollbar conditional on the widget height rather
than always showing.
2024-06-11 15:00:00 +00:00
Alx Sa
2260e8bbe8 core: Fix palette error handling
Resolves #11679
The loading code for ASE, ACB, and ACO palettes
set any errors with g_prefix_error (). However, the
error object is NULL at that point for those palettes.
Therefore, a NULL error object is returned to
palette_import_make_palette () which then tries to
access its attributes. This resulted in a crash.
This patch fixes the issue by using g_set_error () for
those three formats instead.
2024-06-11 12:43:39 +00:00
Marco Ciampa
e576ac421d Update Italian translation 2024-06-11 06:45:13 +00:00
Yuri Chornoivan
3107eb61a8 Update Ukrainian translation 2024-06-11 06:38:24 +00:00
Anders Jonsson
5841e9f8af python: translation fixes
Followup to 292cb01fc2,
taking care of remaining untranslated strings and a stray
accelerator in a tooltip.
2024-06-10 20:58:39 +00:00
Yuri Chornoivan
19a94fa4ba Update Ukrainian translation 2024-06-10 18:51:55 +00:00
Alx Sa
292cb01fc2 python: Port arguments code to use functions
This patch ports the first-party Python plug-ins
to use the new argument API.
This restores the ability to add dropdown menus from
enums and Gimp.Choice parameters, and also allows
defaults to be set for custom datatypes like Gegl.Color.
2024-06-10 15:22:02 +00:00
Alx Sa
d1c4457fa3 libgimp: Convert gimpprocedure-params macros to functions
In order for Python plug-ins to be able
to create custom parameters like
GeglColor and GimpChoice, we need to
create actual functions rather than
using macros. A subsequent commit
will update all plug-ins to use them.
2024-06-10 15:22:02 +00:00
Alx Sa
ceb9747e23 libgimpwidgets: New API to check system animation status
Ports the animation code started in e13cc635
to an independent gimp_widget_animation_enabled()
function. This allows plug-in authors to
also conditionally turn off animations if
the user's system settings say to do so.

The function is applied to the About
Dialogue animation as well as two Easter
Egg animations:
* Wilber's eyes blinking after 23 minutes
on an empty canvas
* Wilber's eyes following the mouse after
a certain sequence of tools is clicked
2024-06-10 13:47:25 +00:00
Bruno
c02160a949 build/windows: No need to download Inno Korean translation
It is shipped with Inno by default in version 6.3.
2024-06-09 18:26:02 -03:00
Bruno
2f74496ebf build/windows: No need to add BOM anymore
Inno Installer 6.3 added support to UTF-8 *.isl files without a BOM
2024-06-09 18:21:27 -03:00
Bruno
8e576fb741 build/windows: Add fractional scaling to Installer Intro (actually End) image
Following a1ce459a
2024-06-09 16:58:03 +00:00
Cheesequake
22c59503b5 app/tools: Fix Filter GUI when expanding vertically,
Resolves #11656
Since e4b1f37e, Filter Tool widgets above the Blend
Mode frame do not expand vertically when the dialogue
is resized.
This especially impacts GeglGraph, as you can no longer
increase the text area to see more graph code.
This patch resolves the issue by adding a GtkExpander
to the GUI so that it allows the inner area to resize
vertically.
2024-06-09 15:02:48 +00:00
Yuri Chornoivan
f2c14573c3 Update Ukrainian translation 2024-06-09 14:58:34 +00:00
Yuri Chornoivan
19e0a45e60 Update Ukrainian translation 2024-06-09 14:53:46 +00:00
Luming Zh
843faff192 Update Chinese (China) translation 2024-06-09 12:55:24 +00:00
Luming Zh
18b659dd12 Update Chinese (China) translation 2024-06-09 12:43:43 +00:00
Anders Jonsson
a8e2c4e663 Update Swedish translation 2024-06-09 10:47:11 +00:00
Bruno
a3621cecca images/logo: Reduce size of Installer right-top icon
Following 6276d9d7

Reasons are explained in gimp-data commit message.
2024-06-09 02:39:30 +00:00
Jehan
61eca5d05b plug-ins: fix scale value in file-pdf-load. 2024-06-09 03:18:21 +02:00
Jehan
cca637135b app, libgimp, pdb, plug-ins: fix failure to set plug-in as transient.
While setting a plug-in as transient usually worked, it was failing in
cases the plug-in's progress bar was not initialized (i.e. if
progress_init() was not called before setting the dialog transient).

This commit stores the calling display, core side too (libgimp side, the
plug-in already had the calling display ID information), and we use this
when a GimpProgress has not been created yet.
2024-06-08 21:54:21 +02:00
Martin
e710457b4c Update Slovenian translation 2024-06-08 19:22:17 +00:00
Martin
81a16c4f9a Update Slovenian translation 2024-06-08 19:21:19 +00:00
Alexander Shopov
3fdbea6804 Update Bulgarian translation 2024-06-08 17:38:37 +00:00
Jehan
221bdd61c6 libgimp, plug-ins: GimpVectorLoadProcedureDialog will have thumbnail and…
… native dimensions/ratio display by default.

Also adding gimp_vector_load_procedure_extract_dimensions() public
function allowing plug-ins to query the native size or ratio of a vector
file.
2024-06-08 18:58:06 +02:00
Jehan
a4bb3a48a2 libgimp: reimplement gimp_procedure_run_config() for public usage.
Previous gimp_procedure_run_config() was in fact only good for private usage
inside the various run() methods for the different GimpProcedure subtypes. The
problem with this implementation is that the returned config object is not
complete. For instance, for a GimpLoadProcedure, the "run-mode" and "file"
properties are not part of the config object so you cannot call a
GimpLoadProcedure with any of the gimp_procedure_run*() functions.

Note: we had some working usage, e.g. in file-openraster, but only because it
was running the load procedure as a GimpPDBProcedure whose returned config
object was indeed always complete!

As a consequence, I rename gimp_procedure_run_config() as an internal-only
function _gimp_procedure_create_run_config() and I create a new
gimp_procedure_run_config() which always return a full config with all
arguments.
2024-06-08 18:58:06 +02:00
Jehan
5bcc6bfe52 libgimp: disengage pixel density from dimensions in GimpResolutionEntry.
It was a bad idea to bind width/height with pixel density. These are separate
things. You may want to set specific pixel dimensions while keeping a given
resolution.

Moreover I am now properly storing aspect ratio in the widget, otherwise with
integer computation, we are just losing too much precision and the ratio is in
fact changing constantly as you change dimensions.
2024-06-08 18:58:06 +02:00
Jehan
5784d1eba6 plug-ins: port file-pdf-load to the new GimpVectorLoadProcedure logic. 2024-06-08 18:58:06 +02:00
Jehan
3d25182ea7 libgimp: "Reset to Factory Defaults" resets to extracted size.
The bogus 0×0 default values for width×height properties are only because we
don't know the real native size of the image. Once we have computed it, we can
change the param spec defaults, so that hitting "Reset to Factory Defaults" sets
width, height and resolution to the actual file's default values (if resolution
is not a metadata in the format, which is apparently the case for all vector
formats we currently support, then 300.0 stays the default resolution).
2024-06-08 18:58:06 +02:00
Jehan
7f2b54db1f plug-ins: port file-ps to new GimpVectorLoadProcedure logic. 2024-06-08 18:58:06 +02:00
Jehan
48babeab3d plug-ins: port to the updated GimpVectorLoadProcedure logic. 2024-06-08 18:58:06 +02:00
Jehan
39ea23ed52 app, libgimp, plug-ins: improve GimpVectorLoadProcedure workflow.
I'm moving the logic of choosing a correct default for width/height by adding an
"extract dimensions" callback in the procedure. The logic is that every vector
format out there should likely have metadata either for pixel dimensions or
physical dimensions, or at the very least for no-unit dimensions (ratio only).

Vector load procedures will have to implement only the extraction of such data
in a callback called by GIMP but not how to act upon them, so that we have a
common logic for all vector images.

I am implementing this callback first in the SVG plug-in, moving all the code
to extract dimensions (and improving it) in this callback.

Also I am deleting "file-svg-load-thumb" procedure. I could simply reimplement
it using the same code, but it looks to me like this is very useless for vector
formats to have a specific thumbnail procedure (unless it were to use very
specific metadata for faster result). This is vector data, just ask it directly
at the proper bounding box size.
2024-06-08 18:58:06 +02:00
Jehan
b0d1668594 desktop: sync AppStream metadata after GIMP 2.10.38 release. 2024-06-06 21:12:32 +02:00
Jehan
a73881478c libgimpwidgets: new gimp_int_radio_frame_set_title().
This new function allows to set a title with mnemonic.

But also it properly sets the frame label as the mnemonic widget for the
radio buttons, otherwise the mnemonic is mostly bogus and doesn't
actually give focus to the editable widgets (i.e. the radio group).
2024-06-06 21:08:08 +02:00
Jehan
0b2d8fedc3 libgimp, libgimpwidgets: ability to generate a GimpIntRadioFrame for GimpChoice arguments.
This includes a new function gimp_prop_choice_radio_frame_new() which
creates GimpIntRadioFrame from GimpChoice properties.

GimpChoice GimpProcedure arguments are still creating a combo box by
default, but it is now possible to override this default behavior to get
a radio frame by calling first:

```C
gimp_procedure_dialog_get_widget (dialog, "arg-name", GIMP_TYPE_INT_RADIO_FRAME);
```
2024-06-06 20:20:30 +02:00
Bruno
12707592c2 build/windows: Add 'libxslt' to unified deps list
Some package stopped to need 'libxslt' out of nowhere.
Don't know when and why that happened, best I found was:
c3a5cacbaf
2024-06-06 14:07:10 +00:00
Alx Sa
6be4e7029a plug-ins: Use combobox in histogram-export
Currently, we can not use Gimp.Choice as a parameter type for
Python plug-ins. This means that we're using a string instead for
the "output-format" parameter, which creates a textbox in the GUI.

This patch manually creates a GimpStringComboBox in the GUI and
syncs it with the "output-format" string parameter. Once Gimp.Choice
can be used in Python, we should be able to swap this out without
impacting plug-in developers (since it would also take in a string)
2024-06-06 04:54:05 +00:00
Bruno
a8b9bedf3c Issue #5146: Change Installer ProductInfo in revisions
This allows better versioning control by ITs.
2024-06-05 20:33:16 -03:00
Bruno
fb5474ae4d Issue #4053: Add "*default_bin" support on Windows and enable it
Almost every program have a non-versioned .exe on Windows. MSYS2 does this too.
2024-06-05 11:51:14 -03:00
Alx Sa
29bb5b3608 dialogs: Respect Windows Show Animation option
Building on d25d8778, this patch checks the Window
"Show Animation" option and uses it to determine
if the About Dialogue animations should be active.
2024-06-05 12:49:20 +00:00
Alx Sa
d25d877899 dialogs: Respect MacOS Reduced Motion option
e13cc635 uses gtk-enable-animation to determine whether
the more dynamic motion animation should be used for the
About Dialog credits. However, gtk-enable-animation does
not take into account the MacOS preferences.
This patch adds a check for this value using NSWorkspace's
accessibilityDisplayShouldReduceMotion boolean. Since the
value is TRUE on MacOS if the user wants animations turned
off, the boolean is inverted.
2024-06-04 16:46:01 +00:00
Bruno
a2bd501cee build/windows: Move Store assets generation to gimp-data
gimp-data is the correct place, along with the installer assets.
2024-06-04 16:29:59 +00:00
Bruno
1a70eba570 Revert "build/windows: generate a default XCF file to be copied by Windows"
This reverts commit 085d8a02b5.

For some reason, Windows doesn't allow us to use that feature
(confirmed this after using the version from the Store itself,
not the .msixbundle)
2024-06-04 16:29:59 +00:00
Jehan
349191b8ab Issue #10406: get rid completely of the animated authors list when…
… "Reduce Animation" is checked.

This is an alternate version for commit e13cc63525.
Instead of proposing a simpler animation (fade-in/out instead of wave
animation), let's just completely get rid of the whole thing when
someone enabled an accessibility option saying that long animated
contents are basically disturbing to them, which is how I understand
additional issue #11647.

In fact, reading Mozilla docs about such option:
https://developer.mozilla.org/en-US/docs/Web/CSS/@media/prefers-reduced-motion#user_preferences
… they even mention vestibular motion disorders, which seem pretty
serious and would make our About dialog quite uncomfortable.

I tried to experiment with just showing a part of the authors list, then
ending on a link text to the Credits tab after a few second, but it
didn't feel that interesting nor useful. Anyway the whole animated
widget is redundant with said Credits tab, and therefore more on the
"fancy" side of things than on the useful one. Hence let's make simple:
if someone configure their OS saying that animated elements are a
discomfort, let's just get rid of useless ones! Done!
2024-06-04 17:25:37 +02:00
Alx Sa
5bd293340f dialogs: Redesign Welcome Dialogue options layout
Currently, the additional customization
options are laid out horizontally.
Depending on the translation, this might
cause the dialogue window to become
much wider.

This patch converts those options to
GtkSwitch and puts them in a column.
prefs_switch_add () was modified to also
return the GtkSwitch object, so we could
bind its active property for the icon
override property.
2024-06-04 01:57:51 +00:00
Bruno
fad40afe45 build/windows: Organize *gimp3264.iss [Code] to not look like Assembly
The installer is probably the most complex packaging format so one of the
biggest examples of packaging love over the years into it in our repo.
But the readability of installer scripts... leave a lot to be desired.

Now, the main script is organized following the order of installer pages
with some comments. This will make easier to future contributors work
(but this commit probably isn't perfect since it's a big change to read)
2024-06-03 16:42:13 -03:00
Bruno
09d6402a5b build/windows: Update Installer dir code following latest changes 2024-06-03 06:49:22 -03:00
Alexandre Prokoudine
14250debdd Update Russian translation 2024-06-03 01:34:27 +02:00
Ekaterine Papava
1ccc31648f Update Georgian translation 2024-06-02 21:17:07 +00:00
Kolbjørn Stuestøl
ffc9f85f48 Update Norwegian Nynorsk translation 2024-06-02 19:50:46 +00:00
Kolbjørn Stuestøl
ceb982225e Update Norwegian Nynorsk translation 2024-06-02 19:48:32 +00:00
Alx Sa
e13cc63525 dialogs: Reduce About Dialog animations if requested
The About Dialog shows authors names using motion effects.
Since this is done with Cairo, it does not respect the
"gtk-enable-animations" setting or OSX's "Reduced Motion"
option.

This patch retrieves the "gtk-enable-animations" value.
If it is set to false, then the simple fade-in effect is used
for author names in place of the motion effects.
2024-06-02 02:05:24 +00:00
Bruno Lopes
57012174fb build/windows: Don't allow multiple Installers at same time
We have counter measures to avoid installing while gimp opened at 'prep time',
but until now none for the installer itself. Let's fix it with SetupMutex.

The final UX is just less worse (than today): the user needs first to select a
language, then only after this the dialog about two installer will be prompt.
Seems that Inno devs willn't fix: https://github.com/jrsoftware/issrc/pull/461
2024-06-01 20:42:06 +00:00
Alx Sa
6d1db0d7d5 plug-ins: Fix crash in Van Gogh plug-in
As noted by Wormnest, if the effect-image drawable is
smaller than the source image, the Van Gogh plug-in crashes.
This is because the source image's dimensions were being
used to traverse the effect-image drawable in rgb_to_hsl ().
This patch fixes the nested for loop to use the correct
width and height values as limits.
2024-06-01 17:33:41 +00:00
Alx Sa
b6c69ad9cd plug-ins: Set default image for Van Gogh
Unlike 2.10, the Van Gogh plug-in does not set the effect image
to the current layer by default. This means that if you don't set
it yourself, the plug-in does nothing.
This patch restores the 2.10 behavior by passing the drawable
to the plug-in dialogue and setting it by default with
gimp_drawable_chooser_set_drawable ().
2024-06-01 16:39:08 +00:00
Bruno Lopes
a91599c454 build/linux: Reduce bashisms on AppImage script 2024-06-01 16:27:20 +00:00
Bruno
796005216d build/windows: Very small clean-up to PowerShell scripts 2024-06-01 13:47:35 +00:00
Bruno Lopes
375782fd64 gitlab-ci: Use LLD linker in Debian and Flatpak jobs
Following 55427487 and 85ed2847

It is a bit unusual to use 'clang' + 'GNU ld' combo.
Also, lld is advertised to be way faster.
2024-06-01 11:28:21 +00:00
Bruno Lopes
884b05f168 gitlab-ci, build/windows: Move back split of 32-bit symbols to gimp job
Following 0199faac

We use arm64 runners for the installer job to avoid queues, but...
llvm-objcopy is well know to lack parity and one sympthom is the
'invalid SymbolTableIndex' warning when handling x86 debug symbols.
2024-06-01 10:57:24 +00:00
Bruno Lopes
2f49ff0810 build/windows: Offer option to launch GIMP after install
This commit just makes the installer display a (unchecked) checkbox, like Win
pkg manager (WinGet) so it's doesn't change the actual behavior. It also don't
break string freeze since the .isl string already exists and have translations.

The benefit to some users is having one less click to launch GIMP: [checkbox] >
[close]; instead of: [close] > [start menu icon] > [gimp in 'recommendations'].
2024-06-01 10:53:14 +00:00
Luming Zh
e5ac62990d Update Chinese (China) translation 2024-06-01 02:38:30 +00:00
Nils Philippsen
ffa8be0351 plug-ins: Fix parameter type in psd_read_len()
The function expects *data to be 64bit wide which is incidentally true
on some architectures but not others. Make it explicit (and portable).

Signed-off-by: Nils Philippsen <nils@tiptoe.de>
2024-05-31 23:04:54 +00:00
Yuri Chornoivan
4f0333b60d Update Ukrainian translation 2024-05-31 17:25:43 +00:00
Alx Sa
1426701143 scriptfu, tools: Allow off-canvas guides in more places
Resolves #10609

Continuing from 1759174d, this patch
removes the on-canvas restrictions for
guides from the New Guide dialogue and
the Measure Tool's guide creation feature.
2024-05-31 12:03:44 +00:00
Martin
bb65b1aca1 Update Slovenian translation 2024-05-31 07:06:33 +00:00
Alx Sa
e9f2e9012f plug-ins: Port file-tiff-load to GimpProcedureDialog
Note that GimpPageSelector is still added
manually as there is no GimpProcedureDialog 
equivalent yet.
2024-05-31 04:34:51 +00:00
Marco Ciampa
583dfbd8a3 Update Italian translation 2024-05-30 16:12:17 +00:00
Marco Ciampa
d497188ec3 Update Italian translation 2024-05-30 16:12:06 +00:00
Marco Ciampa
38223a5d6e Update Italian translation 2024-05-30 16:11:56 +00:00
Alan Mortensen
3ce095edd6 Update Danish translation 2024-05-30 15:16:50 +00:00
lillolollo
a21b18bbec app/widgets: Fix deprecated code in GimpToolBox
Replaces gtk_widget_show () with gtk_widget_set_visible ()
and replaces margin-left/margin-right with margin-start and
margin-end properties.
2024-05-29 13:43:17 +00:00
Luming Zh
05bbcc81d0 Update Chinese (China) translation 2024-05-29 12:41:31 +00:00
Bruno Lopes
9a4d46f077 build/windows: Don't generate .interp files for Native .zip bundles
Following 59b62c33
2024-05-29 10:43:39 +00:00
Alx Sa
83141ba62d actions, plug-ins: Minor clean-up and warning fix
*In file-pnm, format_name is no longer
used due to changes in exporting
functions. This was creating a warning
about an unused variable.

*In 519f301c, an attempt to add a
short-key for MacOS Settings was left in.
It did not work because "comma" should
be spelled out rather than using ",". This
patch removes the accelerator.
2024-05-28 16:16:29 +00:00
Jehan
e2748a2e4f NEWS: update. 2024-05-28 15:33:28 +02:00
Bruno Lopes
cb8c8711a6 build/windows: Enable GEGL dev docs building on Windows
This is not broken according to my tests but babl is.
2024-05-28 13:32:03 +00:00
Marco Ciampa
a1a22afe1b Update Italian translation 2024-05-28 12:56:13 +00:00
Bruno Lopes
2e748ddbfc build/windows: Make crossroad GIMP script work locally
Following fdc2f080.
2024-05-28 09:39:16 +00:00
Bruno Lopes
00af02fa19 build/windows: Make crossroad Deps script work locally
Following fdc2f080.

Also, do some cleanups.
2024-05-28 09:39:16 +00:00
Alx Sa
394ca66037 plug-ins: Fix issue with drawing Cylinder face
Resolves #11617

When we ported Map Object to GimpProcedure API,
the wrong index was set for the Cylinder's bottom face.
As a result, the top and bottom faces both appeared on the top.
This patch fixes the array index to the right value.
2024-05-27 18:50:36 +00:00
Jacob Boerema
aab6f4eab8 modules: fix CI failure in gimp-win-x86 job
Our gimp-win-x86 job fails with the following error:
../modules/gimpinputdevicestore-dx.c:207:28: error: passing argument 2
 of 'GetModuleHandleExW' from incompatible pointer type
 [-Wincompatible-pointer-types]

Fairly Recent the call to `GetModuleHandleEx` was changed to
`GetModuleHandleExW`. This new call expects a wide char pointer
instead of a char pointer.
So replace it with the wide variant (LPCWSTR). Since in this call
an address is actually expected, the actual contents don't need to
be a wide string.
2024-05-27 13:32:54 -04:00
Alx Sa
1759174d9d pdb: Allow off-canvas guides with Script-fu
Commit 015f4946 allowed guides to be
placed off-canvas in the GUI. However,
the restrictions were not removed from
the Script-fu implementation.
This patch fixes the Script-fu parameters
and conditional checks to match the
GUI implementation.
2024-05-27 15:42:10 +00:00
Marco Ciampa
fb94e576df Update Italian translation 2024-05-27 14:58:25 +00:00
Marco Ciampa
c62ef5eb12 Update Italian translation 2024-05-27 14:58:22 +00:00
Martin
d32d8d9ccf Update Slovenian translation 2024-05-27 12:26:22 +00:00
Marco Ciampa
94e57486a0 Small fixies in Italian translation 2024-05-27 12:23:17 +02:00
Jacob Boerema
85561c7ff0 libgimp: fix #6126 Invalid charset: InvalidCharsetId
Some apps that write EXIF metadata, forgot to add the charset to
certain tags that require it. The main case is Exif.Photo.UserComment.
This caused us to show a warning about an invalid charset, in addition
to not showing it in our Metdata Viewer.

We fix this by reading the raw data for that tag when we encounter the
above error. The raw data is then validated as utf-8 and converted
to a string if valid.

We then resave this tag to our metadata to force it to have the
correct charset; that way we don't have to do any checking in other
places in our code.

Note: there are a few other tags that also use a charset. We may have
to check those too, eventually.
2024-05-26 14:46:20 -04:00
Bruno Lopes
3ad39c3866 gitlab-ci: Expose .flatpak as artifact from the distribution job
Completing d09a2a6f, since the dist job wasn't added to MR pipelines that time

Note: this doesn't change the actual behavior. The job will upload to nightly
repo only when triggered from schedule pipelines. I repeat, nothing changed.

What is new is that the .flatpak bundle now is an artifact from dist job, since:
- Despite the name, it isn't a real bundle, so no need to be only in gimp stage
- In dist, it reduces storage use because only the .flatpak file lasts 8 days,
  not the .tar and other files from gimp job which lasts 2 days (5495483c)
2024-05-26 13:48:28 -03:00
Bruno Lopes
445def2109 gitlab-ci: Align again the logical operator '&&' in dev-docs 2024-05-26 10:50:32 -03:00
Alx Sa
c8049f2ed5 app/tools: Fix editing custom NDE filters
Resolves #11211

The code that moves the temporary "editing" filter
when modifying an NDE filter was not being run
on custom GIMP filters like Curves. This meant that
editing Curves would always place the temporary
"editing" filter at the top of the filter stack, giving
an incorrect preview of what the changes would do.

This patch moves the reorder code from being in
gimp_filter_tool_create_filter () to being in
gimp_filter_tool_set_config (), which always runs
when any filter is created.

This change also fixes a separate issue where the
filter mask would not be copied over for Curves.
2024-05-26 12:37:47 +00:00
Yuri Chornoivan
965bd8daa2 Update Ukrainian translation 2024-05-26 06:03:16 +00:00
Bruno Lopes
ed97f08d0b build/windows: Delete Splash images from 2.9 era not used anymore
They should have been deleted by !1373 but there were so many things to
do that it is completely natural that these two files went unnoticed.
2024-05-25 17:44:22 -03:00
Bruno Lopes
e93e0f49a0 build/windows: Move Inno installer to 'modern' style
This style mimics the color scheme used by Win32 applications since Vista (and
still used in Win11). The all grey scheme ended in XP. Let's move on.

But we will keep the actual window size and without being able to resize since
these two Inno features (WizardSizePercent and WizardResizable) are broken.

(The progress bar was changed too to conform with the defaults and uninstaller)
2024-05-25 19:15:54 +00:00
Alx Sa
a28b1bad14 plug-ins: Update Darktable API check
Darktable 4.6 updated the version output format to conform
to standards. This broke the regex check that GIMP uses to
test if Darktable is installed. The developers of Darktable
have added a new --gimp flag for us to use for checking
support. This patch updates our check code to use this
API first, then fallback on the original regex code if a
version of Darktable before 4.6 is installed.
2024-05-25 17:59:37 +00:00
Bruno Lopes
c7d271d892 build/windows: Silence Inno warnings regarding langs
We have no control over lang teams. No reason to keep the output polluted.
2024-05-25 07:44:57 -03:00
Bruno Lopes
f34f55dd65 build/windows: Organize Installer [Setup] to make some sense 2024-05-25 07:44:49 -03:00
Bruno Lopes
6276d9d777 build/windows: Drop hardcoded Installer right-top icon
Now, the icon is generated from the (new) logo .svg in gimp-data.
Also, it now have full HiPPI (aka fractional scaling) support.
2024-05-24 16:22:23 -03:00
Bruno Lopes
a1ce459a1b build/windows: Drop hardcoded Intro image from 2.9 (pre-2.10) series
Now, the image is generated from splash image in gimp-data
2024-05-24 12:16:07 -03:00
Bruno Lopes
c6634d66ff build/windows: Make Installer versioning vars more neutral
Now, the installer files match the meson config.h naming:
'gimp_version', 'gimp_app_version' and 'gimp_api_version'.
"devel" was replaced by meson 'gimp_unstable' too.

util_version was dropped since it lost its utility.
2024-05-24 13:22:03 +00:00
Bruno Lopes
2758965731 meson: Optimize DWARF symbols to Dr. Mingw 2024-05-24 13:11:18 +00:00
Bruno Lopes
0199faac2c gitlab-ci, build: Make DWARF (.debug) symbols splitting an Installer only script
Splitted .debug are not needed by crossbuilds, and breaks .msix certification.
2024-05-24 13:11:18 +00:00
Bruno Lopes
dc21fb7601 meson, build: Disable CodeView (.pdb) generation and bundling for now
1) Right now, MS Partner Center doesn't tell us if the .pdb bunbled as .appxsym
are fine and we only have "Unknow" dumps in the Health page from MS Par. Cen.

My theory, according to my tests with 'SymChk', 'PDBCopy' and 'llvm-pdbutil',
is that this is happening because .pdb from clang or gcc are not "perfect", but
I really have no proof to afirm this, since Partner Center tell us nothing
about them, and we don't even know if the .appxsym were uploaded to begin with.

---

2) The compiler can't generate DWARF (.debug*) symbols when generating .pdb,
which breaks debugging in DrMingw and even lldb according to my tests.
(This is not a fault of the .pdb format but a circumstance: our debuggers
only support DWARF, which is the format already used by MSYS2 packages)

---

So, the .pdb will return probably only in the potential vcpkg transition.
2024-05-24 13:11:18 +00:00
Alx Sa
742ec5689d widgets: Block removing tool-based NDE filters
Currently, messing with filters that are
being managed by tools (like Warp or
Gradient) causes crashes. For now, we'll
prevent removing NDE filters which are
tool-based, and revist after 3.0 is released.
2024-05-22 19:59:40 +00:00
Bruno Lopes
edddb83784 build/windows: Fixes and cleanup to native scripts
Previous changes broken local building courtesy and probably DirectInput too.
Noticed that the universal variables can not work in some contexts, fixed.

Also, done some little cleanups.
2024-05-21 22:59:44 +00:00
Cheesequake
e4b1f37e4e tools: Improve Filter Tool UI for Blending Options...
...by having it stay in the same position when expanded
and closed rather than moving to the bottom afterwards.
2024-05-21 19:15:43 +00:00
Alx Sa
acf2756e4a widgets: Update image display on imageview select
In the Image Dockable, clicking on an image will update the layers and 
navigation views. However, the actual canvas image will not update
unless you double-click the item.
This adds a select_item function so the canvas is updated on a single 
click as well.
2024-05-21 17:31:05 +00:00
Idriss Fekir
4a174206af text: Fix loading XCFs with XLFD fonts 2024-05-21 17:19:33 +01:00
Alx Sa
5f38c37b98 tools, core: Don't stroke/fill paths on pixel locked layers
Resolves #11568

Currently, the Stroke/Fill Paths options on
the Path tool disregard the Pixel Locked
flag for layers. This patch resolves this as
follows:

* On the Paths tool, the Stroke/Fill button
does not pull up a dialogue if a single
layer is selected and it's pixel locked.
* If multiple layers are selected, only those
that are not pixel-locked have the Fill/Stroke
applied to them.

In both cases, a warning is also displayed.
2024-05-21 12:57:55 +00:00
Niels De Graef
36c201e426 libgimpwidget: Mark gimpcolorscale as introspectable
There's no seemingly good reason for it not to be introspected, so let's
add it to the files. This also fixes an issue where the documentation
for it is not properly generated.
2024-05-21 10:08:07 +02:00
Niels De Graef
5efb05825c meson: Undef GIM_DISABLE_DEPRECATED on GIR
By defining `GIMP_DISABLE_DEPRECATED` when creating the GObject
Introspection file, we're actually not (or only partially) generating
some of the documentation of some files that are marked as deprecated.

One example that should now properly generate documentation is
`GimpFileEntry`.
2024-05-21 10:01:48 +02:00
Martin
9acd62a0fa Update Slovenian translation 2024-05-20 13:52:09 +00:00
Rodrigo Lledó
bf66900493 Update Spanish translation 2024-05-19 16:44:50 +00:00
Rodrigo Lledó
291e049df5 Update Spanish translation 2024-05-19 16:14:40 +00:00
Rodrigo Lledó
74673f431a Update Spanish translation 2024-05-19 15:49:02 +00:00
Rodrigo Lledó
61f75b3541 Update Spanish translation 2024-05-19 15:41:26 +00:00
Rodrigo Lledó
cf717f4add Update Spanish translation 2024-05-19 15:23:41 +00:00
Rodrigo Lledó
1f95fc8e05 Update Spanish translation 2024-05-19 14:07:02 +00:00
Rodrigo Lledó
5567b67de5 Update Spanish translation 2024-05-19 13:12:41 +00:00
Luming Zh
ed070d10b7 Update Chinese (China) translation 2024-05-19 11:08:57 +00:00
Luming Zh
691e96bb10 Update Chinese (China) translation 2024-05-19 11:04:32 +00:00
Balázs Úr
e4fd431970 Update Hungarian translation 2024-05-19 10:01:09 +00:00
Balázs Úr
88eb404ab3 Update Hungarian translation 2024-05-19 09:55:32 +00:00
Yuri Chornoivan
f5f99bdfdd Update Ukrainian translation 2024-05-19 06:45:04 +00:00
Alx Sa
519f301c65 actions: Use Settings rather than Preferences on MacOS
Per Lukas Oberhuber, Preferences should be called Settings
on MacOS, as it was before the GTK3 menu port.
2024-05-19 02:12:44 +00:00
Alx Sa
47dde0580a libgimpwidgets: Fix formatting from 8adcc0cd
Some minor code style issues remained 
that I missed in 8adcc0cd.
After further reflection, I also converted
the code to be a private/internal function.
gimp_prop_check_button_new () should
cover the majority of GtkCheckButtons,
and the function is currently only used
to fix the size of those widgets. We could
revisit it as a public function in the
future if more use cases are found.
2024-05-19 02:10:23 +00:00
Rodrigo Lledó
5a4afd39eb Update Spanish translation 2024-05-19 01:20:57 +00:00
Rodrigo Lledó
ef405918f8 Update Spanish translation 2024-05-18 23:49:43 +00:00
Rodrigo Lledó
86465e4aff Update Spanish translation 2024-05-18 21:41:39 +00:00
Mark Sweeney
8adcc0cdcb libgimpwidgets: Fix GUI twitching due to bold label sizing
Resolves #10026

Selecting a checkbutton makes the label bold. This increases the
width of its label, and if it's the longest item in a box, this
causes minor "twitching" and resizing of the dialogue.
This patch calculates the size of the label when bold and then
requests the label width be set accordingly to resolve the issue.
2024-05-18 21:33:51 +00:00
Alx Sa
e51a128acd text: Update font property to GimpFront
Resolves #11550
The import code for X Logical Font Description fontnames
was not updated to use GimpFont instead of strings.
This caused crashes when we tried to set GimpFont properties
with gchars. This patch updates the code to create a new
GimpFont object from the font name string.
Additionally, it increases the read length by one, as we were losing
the last character of each field as it was split on the "-" character.
2024-05-17 14:47:29 +00:00
Marco Ciampa
bed62a077c Updated Italian translation 2024-05-17 12:12:52 +02:00
Andre Klapper
dff524d7e6 pdb: Update URL for GLib API docs 2024-05-17 09:12:14 +02:00
Bruno Lopes
75f59c7602 gitlab-ci: Remove unnoticed keyword by fdc2f080 2024-05-16 14:00:46 -03:00
Oleg Kapitonov
7ccfad1716 app: Fix localization language in Windows 2024-05-16 16:42:47 +00:00
Alx Sa
4de7c7defb themes: Removing padding constraints on GimpToolDialog
Resolves Issue #9955.
GimpToolDialog CSD buttons were being singled out to only
have padding of 2px. This was inconsistent with other dialogues
without this constraint. Since the larger padding style seems to
be preferred, we'll remove the constraint for GimpToolDialog
CSD buttons.
2024-05-16 15:49:10 +00:00
Bruno Lopes
fdc2f080a8 gitlab-ci, build/windows: Make crossroad scripts self-contained
This make them easier to understand and to run local, as we do with native ones

(They can't be run local yet, further changes will try to acomplish this a bit)
2024-05-16 10:05:38 -03:00
Bruno Lopes
26e2f693dc build/windows: Enable .pdb bundling in x86 (32-bit)
Following 8cf688ac. Since GCC 14 was finally released with this feature.
Clang have it for years in advance so no change is needed for arm64 and x64.
2024-05-15 21:20:36 -03:00
Bruno Lopes
36ce192a53 build/windows: Reduce some bashisms on Windows scripts 2024-05-16 00:02:25 +00:00
Bruno Lopes
b42b18de24 gitlab-ci: Re-enable pkg caching for deps-*cross job
Reintroduce pkg caching for crossroad. The possibility of using it is one
in thousands since we don't have distributed cache, but it's better than
rely totally on MSYS2 mirrors, which can be be extremely sick sometimes.
2024-05-15 19:29:07 -03:00
Rodrigo Lledó
e59231d659 Update Spanish translation 2024-05-14 15:52:07 +00:00
Alx Sa
bcf5697289 themes: Define GtkListBox row styles
Resolves #11531

GtkListBox's CSS was previously defined, but GtkListBoxRow
did not inherit those values. This patch explicitly defines this
so we do not have system theme leaks.
2024-05-14 15:13:49 +00:00
Alx Sa
aa30b40fee core, xcf: Prevent copying tool-based NDE filters
For now, we can't keep certain GEGL ops
like Gradient as NDE filters, since they are
connected to tools. If the layer is copied
or saved as an .XCF while the tool is still
active, it attempts to save it and causes a
crash.
This patch adds a check to make sure the
copied filter has been commited and that
it's not a tool-based NDE filter before
being copied. It also adds some NULL
checks where gimp_drawable_filter_duplicate
is used to prevent NULL from being
added to the filter stack.
2024-05-14 04:05:06 +00:00
Nils Philippsen
29fda469d1 meson: Detect Lua 5.4 and fall back to plain name
Lua-lgi works with Lua 5.4 meanwhile which is the only implementation on
some architectures.

Signed-off-by: Nils Philippsen <nils@tiptoe.de>
2024-05-13 23:49:42 +02:00
Alexander Shopov
f35a0bb3be Update Bulgarian translation 2024-05-13 20:54:10 +00:00
Alexander Shopov
fa9ceb4411 Update Bulgarian translation 2024-05-13 20:47:04 +00:00
Kolbjørn Stuestøl
fcbe556704 Update Norwegian Nynorsk translation 2024-05-13 19:35:03 +00:00
Luming Zh
f3711e9750 Update Chinese (China) translation 2024-05-13 11:28:37 +00:00
Luming Zh
19bac162de Update Chinese (China) translation 2024-05-13 11:18:01 +00:00
Luming Zh
9b16976879 Update Chinese (China) translation 2024-05-13 11:12:55 +00:00
Luming Zh
49a2b7eb3d Update Chinese (China) translation 2024-05-13 11:08:42 +00:00
Alx Sa
d9125c58f9 libgimp: Fix description of gimp_export_image ()
As noted by Anders Jonsson, the wrong parameter description
was removed when the API was updated. Other aspects of the
descriptions were also updated to account for the change.
2024-05-12 15:26:29 +00:00
Alx Sa
1bb515eb64 plug-ins: Fix call to internal GIH export after 443947c6
After 443947c6, the image layers were being passed as a
GList to the internal GIH export code rather than GimpDrawable
pointers.
2024-05-12 11:38:53 +00:00
Alexander Shopov
0471439ed4 Update Bulgarian translation 2024-05-12 07:58:13 +00:00
Alexander Shopov
ba04867d71 Update Bulgarian translation 2024-05-11 14:18:06 +00:00
Alexander Shopov
dd128d2748 Update Bulgarian translation 2024-05-11 14:05:41 +00:00
Alexander Shopov
bf60369e74 Update Bulgarian translation 2024-05-11 14:02:09 +00:00
Niels De Graef
c2971f000a libgimpwidgets: Add missing GIR annotations 2024-05-11 15:30:45 +02:00
Niels De Graef
d44a9c942b libgimpmath: Add missing (out) annotations 2024-05-11 15:01:23 +02:00
Niels De Graef
f08aca656d libgimpcolor: Add missing (out) in gimpcolorprofile 2024-05-11 14:46:10 +02:00
Niels De Graef
2bc7ec8ef6 libgimpbase: Add GIR annotation for memsize deserialize
The memsize argument was missing an `(out)` argument
2024-05-11 14:40:38 +02:00
Niels De Graef
c15c180eab libgimpconfig: Fix gimpconfigwriter GIR annotation
Make sure to mark the data argument in `gimp_config_writer_data()` as an
array.
2024-05-11 14:34:32 +02:00
Rodrigo Lledó
8038cc1d62 Update Spanish translation 2024-05-11 11:48:53 +00:00
Ekaterine Papava
1b29e77c17 Update Georgian translation 2024-05-11 03:09:37 +00:00
Rodrigo Lledó
ac4de97855 Update Spanish translation 2024-05-10 23:55:39 +00:00
Rodrigo Lledó
f15a605ed9 Update Spanish translation 2024-05-10 21:47:25 +00:00
Bruno Lopes
bad250429c build/linux: Fix stuck AppImage
* Since the appimage is for testing purposes, let's use system 'libc'
* Hardcode python path since the wildcard wasn't expanding misteriously
* Improve system theme recognition making way simpler
2024-05-08 22:02:23 +00:00
Jordi Mas
5556735d22 Update Catalan translation 2024-05-08 18:50:11 +02:00
Rodrigo Lledó
735ca5a1ab Update Spanish translation 2024-05-06 21:05:35 +00:00
Rodrigo Lledó
6ccb043873 Update Spanish translation 2024-05-06 20:49:43 +00:00
Michael Schumacher
aff33e2d18 gitlab: Add url to the Duplicate candidate report search for both open and closed reports.
This may help to reduce the number of duplicate reports we get about some (temporarily) frequently reported issues, like the current crash
happening since GLib 2.79/2.80, or the crash happening with older GIMP versions on macOS Sonoma.

This won't be perfect because not everyone will use or read the template, or notice the url in it, or use the url to find and check the
reports, but I count on it getting more known than right now.
2024-05-05 22:48:05 +00:00
Simon Budig
1b142eb604 app: don't leak the GeglColor in GimpPaletteEntries. 2024-05-06 00:35:51 +02:00
Simon Budig
e0564ae69d libgimpwidgets: don't leak dest_profile 2024-05-06 00:35:51 +02:00
Simon Budig
32336a2350 app: avoid uninitialized memory for color names 2024-05-06 00:35:51 +02:00
Yuri Chornoivan
12c13f0f11 Update Ukrainian translation 2024-05-05 17:42:42 +00:00
Simon Budig
6877a3cd43 app: use the logical rectangle for positioning the splash text.
This avoids jiggeling baselines for texts with/without descenders.
2024-05-05 16:55:41 +02:00
Martin
f1a2bbb1cc Update Slovenian translation 2024-05-05 08:42:48 +00:00
Jacob Boerema
64b9a00484 plug-ins, ci: add basic support for junit reports for...
file plug-in testing.
The name and location of the xml results will be the same as for the
log file, but with the extension replaced by .xml.

Just some basic support is added which adds failed testcases when
a plug-in has a failure result, which should be the most common
case of failures.
Not all cases where we make errors in our test setup will generate
failed testcases yet, although they should show up in the number of
failures.
Disabled tests won't show up as skipped tests.
We also don't track time.
2024-05-04 19:06:38 +00:00
Anders Jonsson
dfae02038a libgimp: make vector load strings translatable 2024-05-04 13:17:39 +00:00
Daniel Novomeský
b8eea758d7 plug-ins: JPEG XL half-float import support 2024-05-04 04:58:28 +00:00
Hugo Carvalho
01858bd0de Update Portuguese translation 2024-05-03 21:46:31 +00:00
Alx Sa
3260299f4a libgimp, plug-ins: Remove n_drawables parameter from gimp_file_save () 2024-05-03 15:22:39 +00:00
Alx Sa
443947c6aa plug-ins: Remove n_drawables parameter
Port all plug-ins to retrieve the layers
directly from the image rather than
having them passed in. This resolves some
issues with introspection and sets the
foundation for future API work.
2024-05-03 15:22:39 +00:00
Alx Sa
bb3c28689a libgimp, plug-ins: Remove GIMP_EXPORT_CANCEL
Per Jehan, as of 0dc9ff7c we can't
cancel gimp_export_image, so we can
safely remove this enum.
2024-05-03 15:22:39 +00:00
Bruno Lopes
e96494d5a3 build/linux: Re-enable ccache in Flatpak builds
The move to Clang in 85ed2847 didn't take into account caching,
Now, this is fixed or, better saying, reintroduced(?): e545116b

Also, flatpak-builder output was confined to the .log file to make
possible checking the end of the CI output, which was being cut.
2024-05-02 08:58:29 -03:00
Marco Ciampa
254d4270e6 Updated Italian translation 2024-05-01 16:41:18 +02:00
bootchk
3a4d6387b3 ScriptFu: TinyScheme: fix closing of ports
Formerly, closing a port cleared all the attribute bits.
Then the port was not disposed of properly (leaked memory)
when the port was garbage collected.

Now, closing a port only clears the direction bits.
The kind of port is still known for a closed port.

Add test script for file port methods of Scheme.
2024-05-01 12:08:46 +00:00
Bruno Lopes
17ae809fd6 gitlab-ci: Fix Installer job using cache 2024-04-30 18:01:29 +00:00
Bruno Lopes
91811c4638 gitlab-ci: Improve the order of beginning of .yml
Pure cosmetical change to more linear reading. This makes related Keywords
more closer to each other.
2024-04-30 18:01:29 +00:00
Bruno Lopes
aef0348229 gitlab-ci: More little fixes regarding 'file-plug-in-tests' 2024-04-30 18:01:29 +00:00
Bruno Lopes
e2b77df5a2 gitlab-ci: Update cppcheck exclude dirs
To follow the latest changes (e.g. cross 32-bit drop).
2024-04-30 18:01:29 +00:00
Rodrigo Lledó
9f5e8604ca Update Spanish translation 2024-04-30 15:30:35 +00:00
Rodrigo Lledó
71ad6425bd Update Spanish translation 2024-04-30 15:29:12 +00:00
Rodrigo Lledó
b5a13b7cc8 Update Spanish translation 2024-04-30 15:26:36 +00:00
Alx Sa
0b171e9bae core: Copy NDE filters in layer group children
Resolves #10765
This allows us to retain any filters that a
layer group's children might have when
copied or exported. They were previously
lost when the group layer was duplicated.
Note that an OR condition was added to
GimpDrawableFilter creation, to allow
one to be created if the layer was 
attached to a parent layer rather than the
image.
2024-04-29 20:51:36 +00:00
Bruno Lopes
59b62c3355 build/windows: Make possible to execute Win cross artifact without the wrapper
The wrapper, like in native artifact, exists just for avoid searching the exe.
But, if the user wanted, wasn't possible to execute gimp-*.exe directly since
the wrapper was needed to generate loaders.cache. Now, loaders.cache are built.
2024-04-29 15:51:33 +00:00
Bruno Lopes
bf0671dac2 build/windows: Make clear that our Windows builds are not incomplete
This improves the gimp.cmd wrapper wording a bit to not need the README
anymore. Our dev site was improved some time ago to clarify this:
the Windows builds aren't not incomplete if run correctly (under MSYS2)

Also, add cleanup commands to make the .typelib wizardy less invasive.
2024-04-29 15:51:33 +00:00
Bruno Lopes
649f0c7747 build/windows: Update 'project_subdir' in gimp.cmd wrapper following 973c2dd7 2024-04-29 15:51:33 +00:00
Rodrigo Lledó
99d29f0345 Update Spanish translation 2024-04-29 11:48:35 +00:00
Cheesequake
10cc33b28e widgets: Deleting effects now deletes the selected effect instead of the topmost effect
Resolves #11404
Since the GimpContainer selected function automatically updates which filter is the
"active" selected filter, we can remove the code that sets it to NULL after a filter
is deleted. This fixes a bug where the top effect was always deleted in subsequent
attempts rather than the highlighted one.
A now unnecessary gimp_drawable_remove_last_filter () function was also removed.
2024-04-29 11:34:59 +00:00
Bruno Lopes
b080180955 gitlab-ci: Little changes in 'file-plug-in-tests' for consistency
Some details went unnoticed by me when reviewing the MR,
so Jacob authorized me to fix them separately.
2024-04-28 23:34:06 +00:00
Bruno Lopes
f7c5c5a6e0 build/windows: Update 'project_subdir' in MSIX following 973c2dd7
Also, drops manual removing of test plug-ins since they willn't be
installed at build time for stable versions, I suppose.
2024-04-28 19:05:18 -03:00
Bruno Lopes
e53d6df611 build/windows: Add 'GIMP.GIMPPreview' identity for testing purposes
Without this, Partner Center refuses the .MSIX by not matching the
entry Identity and DisplayName (which isn't the same as the stable).

Also, rework the naming of the .msix's to be more Microsoft-ish
2024-04-28 17:55:22 -03:00
Alan Mortensen
ef62625c27 Update Danish translation 2024-04-28 16:28:41 +00:00
Alan Mortensen
f80353e8ee Update Danish translation 2024-04-28 16:28:00 +00:00
Bruno Lopes
0a2433c062 build/linux: Fix failing Flatpak jobs due to old path 2024-04-28 14:24:48 +00:00
Yuri Chornoivan
6075afd70d Update Ukrainian translation 2024-04-28 05:58:56 +00:00
Jacob Boerema
97671dbab7 plug-ins, tests: fix #11408 test-file-plug-ins: permission error ...
for gimp-tests.log

On Linux we may not have permission to create a log at our default
location, so we need to check for that.

First we should not init the log when our plug-in is asked for info.
Only create it when we actually run the import or export tests.

Second, try to catch the permission error and write a message either
in GIMP or in the terminal for non-interactive.
2024-04-27 22:46:02 +00:00
Martin
b5c6b48bee Update Slovenian translation 2024-04-27 21:49:18 +00:00
Bruno Lopes
7503dd449a build/windows: Add 'qoi' back to the unified deps list
Following 93722e81. I forgot adding into the list
2024-04-27 16:37:05 -03:00
Jacob Boerema
5def9ffd09 plug-ins: don't crash file export tests when sections is None 2024-04-27 13:10:18 -04:00
Bruno Lopes
93722e81b5 build/windows: Remove a bit of actually dead code in msys2 scripts
This commit is mostly a little cleanup:
- Reduce redundancy in Local compatibility layer regarding build commands,
  which partily reverts !1171 regarding buggy "ninja && ninja install"
- Reduce redundancy of some variables (MSYS_PREFIX and GIMP_DISTRIB)
- Remove manual QOI install since MSYS2 granted a exception in the win32 drop

This commit also reverts 7cca69cd, a fix from the autotools era that isn't
actually needed according to my tests in CI.
2024-04-27 17:00:43 +00:00
Alx Sa
b283d9fe08 plug-ins: Port file-ps to GimpChoice
Resolves #9946
2024-04-27 16:49:31 +00:00
Martin
e1cc217057 Update Slovenian translation 2024-04-26 21:36:55 +00:00
Martin
76bf9174ad Update Slovenian translation 2024-04-26 21:34:49 +00:00
Yuri Chornoivan
510b557fc8 Update Ukrainian translation 2024-04-26 19:58:04 +00:00
Yuri Chornoivan
ac56004fd0 Update Ukrainian translation 2024-04-26 19:49:25 +00:00
Yuri Chornoivan
62f94d8746 Update Ukrainian translation 2024-04-26 19:44:08 +00:00
Sabri Ünal
bc6dbf87d6 Update Turkish translation 2024-04-26 17:31:21 +00:00
Sabri Ünal
339db86473 Update Turkish translation 2024-04-26 17:29:06 +00:00
Jacob Boerema
3478e1c00f plug-ins: add file-plug-in testing framework
Copied over from the original separate work in:
https://gitlab.gnome.org/Wormnest/gimp-file-plugin-tests
After that further improved and changed and added more file format
tests.

Added meson.build files to integrate it in our build, but we do not
install it for releases.
2024-04-26 12:28:47 -04:00
Rodrigo Lledó
44225ef1c0 Update Spanish translation 2024-04-26 12:11:08 +00:00
Jordi Mas
628a8d1f5b Update Catalan translation 2024-04-26 13:53:07 +02:00
Alx Sa
9a4d365d59 core: Copy correct filters to new layers
Should resolve #11392

In dfb26f37, the NDE filters in the copied image are
retrieved with gimp_image_get_layer_iter (). This works
fine for single layer images or when all the layers are copied
at once. However, if a subset is copied then the filters are always
copied starting from the top level of the image. This can result
in an incorrect filter being copied to the wrong layer.
To fix this, we get the filters from the provided drawables list
instead. This matches the number of layers in the copied
image exactly, since it was used to create the copied image.
2024-04-26 04:17:08 +00:00
Martin
9f1a099202 Update Slovenian translation 2024-04-25 19:59:07 +00:00
Bruno Lopes
ab4267d620 gitlab-ci: Fix custom builds being interrupted
This regression was added by c064148a and it's similar to fb7a9954. Now, that
we are using 'interruptible: false' in custom rules, this is probably fixed.

Also, organize a bit better some pipelines with official GitLab .yml wizardy.
I was hesitating to use "<<: *" since this creates a new layer of complexity,
but this was the better way and the trick have a distinct marking by the way.
2024-04-25 19:03:12 +00:00
Anders Jonsson
d83cf4d9b6 plug-ins: fix typo in file-raw-data 2024-04-25 18:18:38 +02:00
Ekaterine Papava
c28f63f119 Update Georgian translation 2024-04-25 14:51:19 +00:00
Alx Sa
ed557ad2bd plug-ins: Typo correction from 1247c8ba 2024-04-25 14:49:21 +00:00
Ekaterine Papava
596619d928 Update Georgian translation 2024-04-25 14:46:30 +00:00
Ekaterine Papava
62b3df3aa5 Update Georgian translation 2024-04-25 14:45:09 +00:00
Ekaterine Papava
81975732c0 Update Georgian translation 2024-04-25 14:43:10 +00:00
Alx Sa
62cdbfbafa plug-ins: Port file-jpeg to GimpChoice parameters 2024-04-25 14:04:23 +00:00
bootchk
20b19b960e ScriptFu: fix #10307 plugin call display not effective
This benefits script authors and testers of ScriptFu.

Now a call to (display "foo") in a plugin goes to the terminal where GIMP started.
Whether interactive or in batch mode.

Make TS errors go to an error port instead of the output port.

Tool plugins: Console, Eval, Server get error messages from the error port.
TextConsole not changed. Tools behave per new doc "ScriptFu Tools" at dev web site.

Driveby fix of SF Server: send whole message instead of byte by byte.

Driveby comments and more semantic checking of set-output-port in TS.

Add test plugin test-display.scm
2024-04-25 12:51:00 +00:00
Alx Sa
1247c8ba2e plug-ins: Port file-raw-data parameters to GimpChoice
In addition, this restores the palette options for HGT import
that were accidentally removed from 2.10. Mnemonics
were also added to parameters which were missing them
earlier.
2024-04-25 12:40:42 +00:00
Jehan
973c2dd710 meson: fixing the datadir/libdir/sysconfdir.
As noticd by Bruno, the meson port is inconsistent with our 2.10
autotools build here too (and therefore our data path standards).
Fixing.
2024-04-25 01:13:38 +02:00
Jehan
9d93160de6 Issue #11384: new Image automatically uses comment from active image. 2024-04-25 00:20:32 +02:00
Bruno Lopes
b494944f2f build: Add pedagogic README towards 'gimp-macos-build' repo
It's not obvious (when browsing in the repo) where the macOS files are.
Now, that we have one folder per OS, this became desirable for clarity.
2024-04-24 22:02:32 +00:00
Martin
9406b61a05 Update Slovenian translation 2024-04-24 21:31:47 +00:00
Jehan
c40dc612a5 tools: update the rm command for macOS.
Hopefully now the CI jobs can run?!
2024-04-24 23:31:05 +02:00
Martin
16d15dccf2 Update Slovenian translation 2024-04-24 21:30:11 +00:00
Anders Jonsson
80b7727770 Update POTFILES.in 2024-04-24 22:32:03 +02:00
Jehan
4e8f7c5be6 tools: fix in-build-gimp.sh on macOS.
This should hopefully fix:

> realpath: /Users/circleci/macports-gimp3-arm64/var/macports/build/_Users_circleci_project_ports_graphics_gimp3/gimp3/work/build/.GIMP3-build-config-: No such file or directory

Though it's harder to verify because of the "Intel macOS resource brownouts"
going on on CircleCI infra, and only x86_64 runners allowed me to SSH to them.
But I think that's the right fix seeing the error.
2024-04-24 21:57:15 +02:00
Jehan
55b5e14f69 plug-ins: port file-wmf-load to GimpVectorLoadProcedure.
The preview widget is a bit stretched, though at least I fix the contents to be
distorted (instead, the preview is fine but we've got black-filled parts
around). I'm not focusing on it because anyway, I'm not sure either if the
preview is that important, or (if it is) whether we should not just integrate it
as part of GimpVectorLoadProcedureDialog, i.e. for every vector images.
2024-04-24 21:57:15 +02:00
Martin
ecec798548 Update Slovenian translation 2024-04-24 19:32:10 +00:00
Bruno Lopes
5495483c76 gitlab-ci: Unify artifacts 'expire_in' time a bit more rationally
For our two "development" sub-stages, the expiration is as follows:
The 'dependencies' stage artifacts continues to expire in 2 hours.
Now, all 'gimp' ones expires in 2 days (to avoid time zone limbo).

For "stage"/tests and "production"/dist, the expire time depends
on the source of the CI pipeline. If the artifact is oriented to a
'short-span' source (e.g. MRs and commits), it expires in 2 days.
If is oriented to a 'LONG-span' one (e.g. web, schedule), 8 days
(we choose 8 to have a +1 day artifact just in case if something
goes wrong in the weekly schedule day, which isn't rare actually).
2024-04-24 18:35:56 +00:00
Jehan
390340b433 app: fix cases of missing data directories by always trying to mkdir them.
This happens in particular for in-build runs (or when using
GIMP3_DIRECTORY environment variable on an empty directory). In any
case, I don't see why we wouldn't try and create a directory which was
configured for data storage.
2024-04-24 19:48:59 +02:00
Jehan
3fbf34dabc meson: fails to compile with -Dpython=disabled flag.
We compile GObject-Introspection anyway (except for cross-builds, where
anyway we don't rely on local Python scripts), so even if not installing
the Python plug-ins, still use them locally.
2024-04-24 19:48:59 +02:00
Alx Sa
106706ca31 plug-ins: Fix IFS color updates
Resolves #11176

After the initial color space invasion, changing colors in the IFS color
transformation section no longer affected the image. It seems that
ifsD->*_cmap->color held the actual color selected by the user, but
this value was not making it into elements[ifsD->current_element]->v.*_color.
This patch connects the *_cmap->color values to the functions used
to draw the image on the screen.
2024-04-24 16:05:32 +00:00
bootchk
283ec65d79 ScriptFu: build: "stable release" not install test framework or test plugins
meson.build exclude subdirs script-fu/test/
and script-fu/scripts/test
on a stable release.
2024-04-24 14:32:53 +00:00
bootchk
60a584f91a ScriptFu: move test plugins and install more in unstable build
Move test plugins from /scripts to /scripts/test.
POTFILES.skip that directory.

Add a readme to scripts dir.

Revise readme in scripts/test

Rename test9.scm which tests the new byte type support in Scheme.
Install it in unstable build, it is an important test,
long and sophisticated.

Install contactsheet.scm as a test plugin in unstable build.
See test/meson.build for comments about its issue.
2024-04-24 14:32:53 +00:00
bootchk
deb4dc8190 Plugins: GUI: Fix redundant Clothify plugins
Formerly, both Clothify and "Clothify v3" are installed
in menu Filters>Artistic.
They are duplicates.

Clothify is the original using the old-style, homegrown interface.
"Clothify v3" is new-style, GimpProcedureDialog interface.

Both are marked for translation.
Only Clothify (v2) is translated (in potfiles.in)
"Clothify v3" is not translated (in potfiles.skip)
This commit does not break string freeze.

Moves "Clothify v3" to Demos menu.
It only installs in an unstable build.
The new is installed in unstable only for comparison with the old.

FUTURE: when no string freeze:
Swap the new and the old.
Move "Clothify v3" clothify-v3.scm to potfiles.in
and move "Clothify" clothify.scm to potfiles.skip.
Swap the menu items, so the user doesn't see "v3."
2024-04-24 14:32:53 +00:00
Jehan
25b9f677b1 libgimp: fix libgimp introspection.
- Fix a few broken references and an inconsistent argument name.
- Add the new headers in the introspectable header list.
- Add a few missing class descriptions for GimpProcedure and subclasses.
2024-04-24 16:05:41 +02:00
Jehan
dd6acc86fb libgimp: new fill_start() and fill_end() class method for GimpProcedureDialog.
Instead of filling default GUI for a specific type of plug-in procedure in
fill_list(), we add 2 methods:

* fill_start() is ensured to run once (and only once) before any fill_list()
  code runs.
* fill_end() is ensured to run once (and only once) after all fill_list() ran.

This takes care of 2 kind of GUI bugs which we could have:

1. First if no explicit fill were run (i.e. neither gimp_procedure_dialog_fill()
   nor gimp_procedure_dialog_fill_list() were ever run), then the default
   interface would not be added to the dialog. Yet this case could happen when
   we don't want anything else but the default GUI (this will be the case in the
   upcoming file-wmf-load GUI).
2. Second if at the opposite, you fill several times fill functions (I hadn't
   thought of this, but noticed some already started to do this in our ported
   plug-ins), we obviously don't want the default GUI to be added several times
   either.
2024-04-24 15:50:22 +02:00
Alx Sa
9a2774f7f9 libgimp: Fix casing in documentation 2024-04-24 11:34:01 +00:00
Jehan
c22515e0b7 plug-ins: port file-ps and file-svg to GimpVectorLoadProcedure. 2024-04-24 01:16:46 +02:00
Jehan
a931f4c93e plug-ins: port file-pdf-load to GimpVectorLoadProcedure and…
… GimpVectorLoadProcedureDialog.
2024-04-24 01:16:46 +02:00
Jehan
bed41ea3c0 libgimp: new GimpVectorLoadProcedureDialog widget.
As expected, it is made to reuse shared code for every GimpVectorLoadProcedure.
In particular, they all need to choose dimensions to load at, so we are sharing
a same GimpResolutionEntry widget logic everywhere now.

I am in fact still very unsure about the code logic for this widget by the way
for these reasons:

* It still puts too much emphasis on the "resolution" (pixel density) part,
  which makes people believe it's important, while they should in fact choose
  the pixel dimensions most of the time and not care about the pixel density.
* Right now we can't break ratio (which in fact was already impossible in most
  vector format plug-ins we had). Do we want to add a chain and allow this?
* If we consider the pixel density as the one we want to set the document with
  (which may not be the same thing as the one from when we load the document),
  we also want to break link between width/height dimensions and pixel density.
  Right now we can't (updating one field updates the others too).
* There is always this issue of precision with pixel density vs. pixel
  dimensions because we don't necessarily find the same values when computing
  from one side to another because of lack of precision and this confuses
  people.
* Finally there is the question of multi-page documents (e.g. PDF) where the
  chosen dimensions are the document dimensions whereas each page may have a
  different size which has to be recomputed independently and this got me
  off-by-one errors. I think I'll need to review a bit the logic, but I'll do
  once I've ported all the vector format load plug-ins first to see the most
  common usages.
2024-04-24 01:16:46 +02:00
Jehan
3a3f67ef95 libgimp: re-promote GimpResolutionEntry in its own file and improve its API.
The code comes from plug-ins/common/file-pdf-load.c and apparently it used to be
in libgimpwidgets (very long ago). I'm copying it to its own file and massively
improve the code (depending on property binding which makes the behavior much
more robust).

Still I left it as private because I don't want to say the API is finale without
having tested it a bit more. But eventually we should make it public for
plug-ins to use it directly too. When this happens, it should get back to
libgimpwidgets.
2024-04-24 01:16:46 +02:00
Jehan
768f871bc7 app, libgimp, pdb: new GimpVectorLoadProcedure class.
It's still basic but will help to share code for support of various vector-able
formats, such as the logic for dimensioning them, but also the generated GUI.

Not only this, but we are paving the way for the link layers (though it'll be
after GIMP 3, we want plug-in procedures' API to stay stable) by giving a way
for a plug-in procedure to advertize a vector format support. This way, the core
will know when a source file is vector and can be directly reloaded at any
target size (right now, in my MR for link layers, the list of "vector" formats
is hardcoded, which is not reliable).
2024-04-24 01:16:46 +02:00
Martin
c363991cad Update Slovenian translation 2024-04-23 21:58:44 +00:00
cheesequake
5c646830a5 Fixes #11338: Layers do not teleport to the bottom of the list if dragged onto the headers 2024-04-24 00:23:40 +05:30
Yuri Chornoivan
6c6ad24119 Update Ukrainian translation 2024-04-23 17:32:39 +00:00
Anders Jonsson
83dee0e43a app: translate link labels and tooltip in Welcome dialog 2024-04-23 14:57:25 +00:00
Bruno Lopes
f40ecca648 gitlab-ci, build: Enable ccache for win crossbuilds
Due to design, crossroad install everything in the same prefix. So, let's
drop the pkg caching (.cache) and reuse ccache path inherited from .default.
2024-04-23 14:08:55 +00:00
Alx Sa
47aabfc93a core, libgimpcolor: CMKY & HSL to float
Continuing 32d64ab1, this converts the
few instances of CMYK and HSL/A double
to float to match babl's precision.
2024-04-23 13:38:59 +00:00
Bruno Lopes
bffe62d43e gitlab-ci, build: Drop custom "CI_*" variables
Let's figure out what job is running using the predefined GitLab variables.
2024-04-23 13:20:29 +00:00
Yuri Chornoivan
1420e60f45 Update Ukrainian translation 2024-04-23 13:20:11 +00:00
bootchk
7b37d5bee8 GUI: Eliminate menu Filters>Development>Script-Fu>Test
Only affects unstable build.

Move remaining items to Demos.
They have names like "Test foo."
They only install on an unstable build.

The ScriptFu>Test menu is only in an unstable release.
It is untranslated.

The ScriptFu menus don't need to be so deep.
The Demos menu is an appropriate place for test plugins.

If the Demos menu is not in the stable release and translated,
Gimp creates the Demos menu and it is untranslated.
2024-04-23 07:57:32 -04:00
bootchk
f64115d3b2 Plugins: GUI: Move HelloWorld and Sphere plugin menu items to Demos menu.
The "Sphere" plugin demonstrate all the widgets for arguments of a plugin.
Only its menu label is translated.

The "Hello World" plugin demonstrates an independently interpreted SF plugin.
It has no translations, even of its menu label.

Formerly in ..ScriptFu>Test menu.

They still are installed even in a stable release.
If we don't want 3.0 stable to ship with demos,
need more changes to meson.build.

They are akin to the goat exercise plugins.
These plugins are expected to ship with the goat plugins in a stable build.
!!! But 2.10 did not ship with any demo plugins in stable build.

There are duplicate "Sphere" (v2) and "Sphere v3" plugins.

Does not break string freeze.

The new-style "Sphere v3" plugin moves to Demos.
It will be installed with stable build.
No translations will change.

"Sphere" (v2) will only be installed in an unstable build.

FUTURE: we should translate Hello World and Sphere v3.
If they are to ship as demos, their GUI should be translated.

FUTURE: low priority we could rename "Sphere v3" to just Sphere,
and Sphere to "Sphere v2" so there is no conflict.
2024-04-23 11:46:48 +00:00
Bruno Lopes
42356db4b4 gitlab-ci, build: Clarify DWARF debug symbols "extraction"
Partially reverts af79bbe0 (regarding .debug "extraction" in cross builds)

Now, we call the split debug script from the main bundling script, which makes
similar to our macOS .app bundling script. This cleans a bit of code in .yml
and make things clearer to the mere mortals in the scripts.
2024-04-23 07:53:48 -03:00
bootchk
c5c0976ed7 app: GUI: Delete root menu "Test", move its item to Demos
Its contents is a test plugin, "Test dialog".
I am responsible for it, and it is ugly, even in unstable.
Is only installed in an unstable build.

We need a convention that menu items for plugins named like "Test foo"
should only be installed in unstable build,
and should require no translations.

Note that if the Demos menu does not exist,
Gimp creates it, and it is not translated,
but only present in an unstable build.
2024-04-22 16:06:38 -04:00
Bruno Lopes
8ef4b40c8c build/windows: Fix Installer after native x64 and arm64 TWAIN drop
Native arm64 and x64 TWAIN binaries are not built anymore. No need to
discard at dist time what doesn't exist. (32-bit TWAIN not affected)

Also, start to using our own ARM64 runners to do the dist. This is more
reliable since the shared x64 runners can (and indeed) cause long queue.
2024-04-22 18:52:25 +00:00
Jacob Boerema
b3f8ad3eea libgimp: fix #11382 oversized export dialog with long comment
When there is a very long comment shown in the export dialog, the
dialog expands horizontally. Possibly making it wider than your screen
instead of wrapping the text.

Let's set word wrapping for the text view. That way the text will
wrap at a reasonable length and use the multiline text view instead
of just the first line.
2024-04-22 13:26:29 -04:00
Jürgen Benvenuti
5569e40b8c Update German translation 2024-04-22 17:16:15 +00:00
Alan Mortensen
44a3d88802 Update Danish translation 2024-04-22 16:38:14 +00:00
Alan Mortensen
5bf2bb901e Update Danish translation 2024-04-22 16:36:30 +00:00
Martin
290d5ccd67 Update Slovenian translation 2024-04-22 14:19:28 +00:00
Bruno Lopes
28ba5d6918 gitlab-ci: Silence universal variables
They were generating a distracting output in CLANG* shells, as noted by
@lillolollo in a comment from MR: Infrastructure/gimp-web-devel!65

In the process, make AppImage and Windows (native) scripts use these
variables, without hardcoding the same variables from .yml anymore.
2024-04-22 13:22:31 +00:00
bootchk
55cc32e7f4 ScriptFu: Plugins: fix #11346 broken "Export Palette" plugin.
Fix ScriptFu, CRITICAL handling filename args user-entered in old-style interface.

Fix plugin, changes to API re Resource i.e. Palette and Colormap

Add message giving mangled name of output file.

Driveby minor refactoring of plugin.

Driveby cleanup, remove old email addresses.

Driveby use script-fu-use-v3 binding to PDB.
2024-04-22 06:17:13 -04:00
Alx Sa
c691bd2a0b actions: Prevent crash due to non-existent editors
Resolves #10914

Some dockables such as "gimp-pattern-editor" and
"gimp-mybrush-editor" are listed as Editors even though
we don't yet have dedicated GimpDataEditors for them.
This causes problems when using certain features like
duplicating. To resolve for now, we check if
gimp_window_strategy_show_dockable_dialog () returns a
valid GimpDataEditor before trying to use it.
Per Jehan, we also verify that an edit button exists
and is visible before we try to call the edit command.
2024-04-22 01:24:36 +00:00
Jehan
2f9881c03f build, tools, gimp-data: removing gimp_exe_config_dir from the root meson.build.
Creating a temporary config directory for the in-build GIMP (run as a tool or
for unit-testing) is not done as a build target anymore, but in the
in-build-gimp.sh script as a unique temp directory, then cleaned out on exit.
This has a few advantages:

- It is properly cleaned out once the build ends (instead of leaving a full
  config dir as trash inside the build dir).
- It is not reused from one build to another (with risk of carrying bugs and
  issues over).
- Every use of the in-build GIMP will have its own config directory, and in
  particular when they are called in parallel.

As a side update, make sure that all `gimp_exe` runs depend on
`gimp_exe_depends`.
2024-04-21 20:43:29 -03:00
Jehan
a54253db04 build, gimp-data: all 'file-*-save' plug-in procedures got renamed to 'file-*-export'. 2024-04-21 18:18:44 -03:00
Bruno Lopes
a56cfc9080 build/windows: add UTF-8 support to non MS Store manifest
This is recommended by Microsoft for "*nix apps" and adding it to the
.exe manifest will avoid disparity between MSIX and other versions
(e.g. CI crossbuilds and CI native builds/installer/local builds).
2024-04-21 18:18:44 -03:00
Bruno Lopes
3f0532ba86 app, devel-docs: add a bit of MS Store documentation
See also: Infrastructure/gimp-web-devel!46
2024-04-21 18:18:35 -03:00
Jehan
a9c8420368 build/windows: fix submodule checkout failure
Bruno note: This commit was repurposed after ad132ad0.

---

For some reason, on the Windows/Aarch64 runners only, submodule updates fails
with:

> + git submodule update --init
> From https://gitlab.gnome.org/GNOME/gimp-data
>  * branch            d1041a4d97871c85538938872d0ace69d2fc44c2 -> FETCH_HEAD
> error: Your local changes to the following files would be overwritten by checkout:
>         images/README.md
>         images/logo/meson.build
>         images/meson.build

The big question was: why are there edits to begin with? This is supposed to be
a brand new clone!
After a bit of investigation, it turns out that the whole files have incorrect
EOL endings (a `git diff` returns every possible lines in the whole
repositories, but `git diff --ignore-cr-at-eol` returns nothing). It looks like
this breaks the submodule update.
2024-04-21 18:15:32 -03:00
Jehan
194eaf1312 build/windows: drop plug-ins .ico (it is now generated by gimp-data) 2024-04-21 18:15:32 -03:00
Jehan
b41fe61698 build/windows: generate fileicon .png's for MS Store and drop .ico
Also update the gimp.rc and delete the committed fileicon.ico now that
gimp-data generates this file the same way as these PNG fileicon-s.
2024-04-21 18:15:32 -03:00
Jehan
085d8a02b5 build/windows: generate a default XCF file to be copied by Windows
Attribute uap4:ShellNewFileName is meant as a template file to be copied when
someone initiate the Shell "New" command (via the Explorer context menu).
2024-04-21 18:15:31 -03:00
Bruno Lopes
4c968d9aa0 meson, build/windows: generate AppList, StoreLogo and *Tile .png's
Most of the work in this commit is by @Jehan.

These icons are used only by the .msix (MS Store) distribution of GIMP.

Some legacy icons are used only by Windows 10 and need to have smaller logo
than full image dimensions, so let's not use colorsvg2png. We just pass the
dimensions to use by configuring variants of the same base script.
2024-04-21 18:15:31 -03:00
Bruno Lopes
37045e477b gitlab-ci, build/windows: Add MS Store job to CI
The new dist job can produce two artifacts: a *.msixupload file
ready for submission and/or a *.msixbundle only for testing.

See the commit about the script for more details.
2024-04-21 18:15:18 -03:00
Jehan
8cf688ac16 meson, build/windows: generate .pdb (CodeView) debug symbols
This makes possible to debug with DIA SDK, if wanted by the developer.
Also, this is needed to create .appxsym files for MS Store debugging.

Ideally meson should be able to install for us, but apparently it doesn't.
See https://github.com/mesonbuild/meson/issues/12977
2024-04-21 18:13:47 -03:00
Bruno Lopes
184e2704a4 build/windows: Add MS Store dist script
Adds PowerShell script and proper manifest for making .msixupload
(only for releases) and/or .msixbundle (always, for testing).

As authorized by Jehan, 32-bit willn't be supported. The reasons are:
1. 32-bit is going to die when WIA plug-in is done. This can hurt reviews
2. 32-bit is being restricted in ARM64 version. This causes disparity
3. 32-bit is generating a big footprint. "This is bad for the environment"
   To be clear: we are discarding most of 32-bit artifact (see point 1)
   and what could not (TWAIN for x64 only, point 2) almost doubles .msix.

There is one small circumstantial reason too:
4. 32-bit wouldn't have .pdb even after GCC 14 because bins have same name
   as x64, and MS don't allow multiarch debug symbols in the same .appxsym
2024-04-21 18:12:38 -03:00
Jacob Boerema
9d133add5b build: openjpeg dependency was missing
Both in our Debian and Windows deps the openjpeg dependency was
missing, so let's add it back.
2024-04-21 12:40:41 -04:00
Jehan
c65aca8b17 plug-ins: rename various '*-save.[ch]' files to '*-export.[ch]'.
Though it's not visible and could happily wait for after GIMP 3 release, this
was annoying when grepping. Just did a quick cleanup.

I also removed gimprc.common which is a forgotten remnant from the autotools
build.
2024-04-21 16:48:58 +02:00
Alx Sa
32d64ab1c9 core, widgets: Convert HSV/A to float
Per Pippin, the only color model that can
have double precision is RGB/A.
Therefore, we need to switch all others to
use float instead. This patch converts the
HSV and HSVA double babl formats.
2024-04-21 03:42:27 +00:00
Bruno Lopes
2dc6f41114 gitlab-ci, build: Use 'bundling' naming instead of 'packaging'
As hinted in d09a2a6f

We now use the word 'bundle' to signify "program files in the same prefix"
(e.g. .appimage, .zip, .app). This is in line with our source and dev-docs
(just take a search in the repo). So, appimage and windows scripts changed.

The word 'package' normally means "program files distributed for install in
the same prefix or not" (e.g. .deb, .msi, .dmg). This is in line with CMake
naming of some commands, but meson prefers to call 'dist', which we use more.

So, this partly reverts some things of GNOME/gimp!1171 and reinforce others
for even more "rationality" in the overall build structure of GIMP.
2024-04-20 22:32:46 -03:00
Bruno Lopes
b1c25ca5dc gitlab-ci: Clarify some CI-wide variables 2024-04-20 23:23:39 +00:00
Jehan
0dc9ff7c06 libgimp: clean out the "interactive" intermediate dialog which was hidden…
… since forever anyway!

GIMP used to have a second export dialog, a generically generated one, appearing
either before or after (depending on when gimp_export_image() was called) the
custom export dialog implemented by the plug-in code. This has been hidden deep
in code since forever (since version 2.8.0 in fact, I believe) and only kept
hidden behind an environment variable "GIMP_INTERACTIVE_EXPORT". I don't think
we'll ever revive this, so let's clean up.

In fact, not one, but in worst case even 2 more dialogs were hidden behind this
variable! The first dialog (confirm_save_dialog()) was a confirmation when the
selected drawable was a layer mask or a channel (and not a layer). Most export
code don't even seem to care about the selected drawables anymore anyway (cf.
issue #7370), except with gimp_file_save() non-interactively (issue #8855),
which is a real mess of inconsistency anyway.

The second dialog (export_dialog()) was listing the various actions to do on a
copy of the image to help the plug-in (e.g. merge layers/flatten image, etc.)
and possibly give choices to some of these actions. Though there is definitely
no reason to request this kind of thing anymore, especially for a short-lasting
image copy, the list of action could still be interesting in the future, not as
information of what is going to be done, but as information of the kind of data
loss of the exported format. I could imagine we want to be able to reuse such
information for generating types of data loss per format in the export dialog,
in particular in the context of my long-term export workflow refactoring (from
which resizing before export such as #2531 are part of, but the whole
refactoring project is much wider).

In the whole discussion of #5858, there will be the question on whether we don't
want plug-ins to be directly given a "ready-to-use" image depending on
capabilities they advertized in create_procedure().
2024-04-21 00:16:27 +02:00
Jehan
b4f84dfd8f NEWS: update. 2024-04-20 23:51:53 +02:00
Alx Sa
7abcc97c6a modules: Swap ColorWheel to HSV float
Should resolve #11370

Per Pippin, HSV double is not a valid
color model for babl. We need to change
to HSV float to resolve the warning when
selecting colors on the Color Wheel.
2024-04-20 21:31:58 +00:00
Bruno Lopes
0c32125f1c gitlab-ci: Fix duplicate merge and push pipelines
This is a well know problem documented in GitLab docs that happens when
the CI isn't properly configured that was causing double pipelines in MRs.
Let's fix it, and reduce some redundancy.
2024-04-20 20:50:04 +00:00
Jehan
ef314804c4 Issue #11361: building fails on macOS.
This line should have never been pushed (in commit a78c41d2a3), my bad! It was
an early (extremely ugly and bad!) attempt to try and have the bindings see the
libraries another way than using DYLD_LIBRARY_PATH (which was instead resolved
with commit 3e980d5ad4).

This omission went unnoticed until I add `set -e` very likely as this failed
command would stop the script in failure.
2024-04-20 20:17:59 +02:00
Jehan
d661e8efb1 libgimpcolor: gimprgb-parse finally deleted.
- gimp_rgb_list_names() ported as gimp_color_list_names() using NUL-terminated
  GimpColorArray.
- GimpColorHexEntry uses the new function (and is therefore now GimpRGB free!).
- gimp_rgb_parse_name() deleted as it's unused since my previous commit.

With all this, gimprgb-parse.c is now deleted from the repository! \o/
2024-04-20 20:04:32 +02:00
Jehan
b31a465a9e plug-ins: port ifs-compose to GeglColor. 2024-04-20 20:04:32 +02:00
Bruno Lopes
6428e51f2a gitlab-ci: Move 'analysis' stage to a more "mainstream" position
I suppose the intention of having this stage at the end was to make clear: no
job depends on it. However, this place is not common or ideal but one of two:
1) before building, which is more linear; or 2) after building (the choosen)
even if this isn't dynamic analysis (tests), since they are both related and
some compilers and build systems do static analysis. Anyway, not after dist.

The new place is a bit  more clear to devs used at "build, test, deploy" praxis
and maybe will be now better noticed by the existing devs before distributing.
It's not perfect, since I explained above that there are two places/approaches.

Obviously, the stage continues to be OPTIONAL to pass, nothing was changed.

---

Also, dropped the deprecated "only:" (in clang-format job) in favor of "rules:"
and made the artifacts paths of clang-format and cppcheck more consistent.
2024-04-20 17:35:45 +00:00
Jehan
0f9b08c37e libgimpcolor: more GimpRGB-based functions are now unused. 2024-04-20 16:10:32 +02:00
bootchk
2914fd40ff ScriptFu: Test: maintenance, fix tests broken by changes to Gimp, add tests.
Fix tests broken by changes to gimp_data, wilber.png=>gimp-logo.png

Uncomment failing tests whose issue was fixed.

Remove calls to deprecated functions.

Make more test files use v3 binding script-fu-use-v3

Compare floats relatively by epsilon.

Add some missing tests.
2024-04-20 08:25:35 -04:00
Alx Sa
a0d040bddc libgimp: GimpSaveProcedure to GimpExportProcedure
This patch continues porting save API to
export for the 3.0 release.
2024-04-20 07:50:42 -04:00
Jehan
62ab8e2604 libgimp, libgimpcolor: make real unit test of old (compiled but unused) …
… test-color-parser.c file.

The file libgimpcolor/test-color-parser.c was compiled but never actually called
by the build. Now that we have a nice infrastructure to test libgimp API, I am
moving it there with the new format. Doing this also allowed me to discover some
bugs in CSS parsing, as well as discover Python binding was failing here (cf.
the few previous commits).

Only one test is disabled so far, the one where 4 digits are used per channel in
hexadecimal notation: "#64649595eded". This format simply doesn't appear
anywhere in the spec, and also the result values in the samples listing don't
even fit. So far, I'm just unsure what to do with it, if we want to keep this
support (of some kind of higher precision hex notation, but not specified, so is
it even used by anyone?) or not.

All the other tests just work in both C and Python!
2024-04-20 12:39:52 +02:00
Jehan
106d18605a libgimpcolor, app: gimp_color_parse_(css|hex|name)() renamed with _substring() suffix.
New functions with the same name as these functions are created, except without
the length argument (i.e. it's equivalent to calling these with -1).

The reason for this is that using strings with a length variant which may be
negative to switch to NUL-terminated strings are not bindable. At least in our
case, when testing in Python, the input string ended up as corrupted garbage and
GObject Introspection docs warns about such interfaces:

> In particular, avoid functions taking a const char * with a signed length that
> can be set to a negative value to let the function compute the string length
> in bytes. These functions are hard to bind, and require manual overrides.

(see: https://gi.readthedocs.io/en/latest/writingbindableapis.html#strings)

So instead, I create a simple version which runs on NUL-terminated strings only
and which is bound, whereas unbinding the generic length-version (making it
C-only, or maybe usable in some other bindings which ignore the (skip)
annotation; apparently some do this).
2024-04-20 12:37:20 +02:00
Jehan
d51cde85c1 plug-ins: script-fu is now GimpRGB-free. 2024-04-20 12:06:41 +02:00
Jehan
6a85efe92c libgimpcolor: gimp_rgb_parse_hex() is also unused. 2024-04-20 03:41:27 +02:00
Jehan
9f205ca63e libgimpcolor: fix CSS parsing.
- "transparent" is now recognized. It was forgotten (probably because on the
  GimpRGB interface, we separated the API in a _rgb_ and a _rgba_ variant).
- rgba() and hsla() formats are now fixed (implementation was there but the
  function names were not recognized.
- Adding some comment about limitations of the hexadecimal notation (we don't
  support the alpha channel which is now in the CSS specs, while we also support
  some non-specified variant with every channel on 3 or 4 digits) for future
  work.
2024-04-20 03:03:41 +02:00
Bruno Lopes
685fe6c0c5 data: Restrict 'default.env' to relocatable builds
The lack of distinction after 975c1891 was causing crashes in local builds.
2024-04-19 22:25:18 +00:00
Jehan
fde0b27754 plug-ins: add missing include.
This fixes:

> plug-ins/script-fu/script-fu-refresh.c:70:1: warning: no previous declaration for ‘script_fu_register_refresh_procedure’ [-Wmissing-declarations]
2024-04-19 23:58:18 +02:00
Jehan
0d39458d8d libgimpcolor: remove all gimp_rgb_*() utilities not in use anymore. 2024-04-19 23:58:18 +02:00
Martin
d23fd3fc9d Update Slovenian translation 2024-04-19 21:43:37 +00:00
Jehan
2b27feb2fd app, libgimp*, modules, pdb, plug-ins: new GimpParamColor.
This is meant to obsolete GeglParamColor with at least an additional argument
has_alpha which we need in GIMP. It allows to advertize when a parameter wants
an opaque color, which in particular means we know when displaying a GUI to pick
colors with alpha or not.
2024-04-19 23:25:13 +02:00
Jehan
cbb333c220 app: accept a NULL default color in plug-ins.
Our pluginrc code is already able to output NULL for a default NULL color, but
reading was failing with the following error:

> GIMP-Error: Error while parsing '/home/jehan/.config/GIMP/2.99/pluginrc' in line 289: unexpected identifier 'NULL', expected number (integer) - fatal parse error

Let's support reading such a value now, especially as for Python plug-ins, we
are not even able to add a default value to GeglColor arguments (cf. previous
commit).
2024-04-19 19:13:53 +02:00
Jehan
634fe62f74 Issue #11319: support GeglColor as generic GParamObject of type GeglColor.
In some binding (e.g. Python), we have not found how to create GeglParamColor
specs for PDB procedures, so we use GParamObject specs with `GeglColor`
object_type. Have our code handle both variants.

Fixes:

> GIMP-WARNING: _gimp_gp_param_def_to_param_spec: GParamSpec type unsupported 'GeglParamColor'

Of course such generic spec won't have any future option which we may add to a
dedicated param spec (and despite adding code to handle a default value, adding
a default color still doesn't work according to tests).
2024-04-19 19:13:53 +02:00
Yuri Chornoivan
642f12639a Update Ukrainian translation 2024-04-19 14:53:51 +00:00
Jehan
e7b7efafe9 app, libgimpcolor: no GValue GimpRGB anymore! 2024-04-19 14:42:08 +02:00
Jehan
a50759cda8 app, libgimp*, pdb, plug-ins: remove GimpRGB support in GIMP protocol.
There are no plug-ins which uses GimpRGB for procedure argument, nor is there
any base PDB procedure. We don't pass this type anymore through from/to
core/plug-ins. So let's clean the whole code out as a next step to get rid of
GimpRGB from our codebase!
2024-04-19 14:34:22 +02:00
Anders Jonsson
70b8e49e01 script-fu: fix calls to gimp-context-set-[pattern/brush]
Like in e31de151fa
these now need to work on an object rather than a name.
2024-04-19 12:37:45 +02:00
Alx Sa
97d6aa5904 widgets: Close Layer Effects popover when changing images
Resolves #11347

In multi-window mode, it is possible to change images without
causing the layer effects popover to close. This results in the prior
image's layer effects being shown over the new image, which is
confusing. This patch causes the popover to automatically close
when the image is changed to prevent this problem.
2024-04-19 01:58:56 +00:00
Bruno Lopes
9653e50e5f gitlab-ci, build: Unify Debian jobs and add AppImage artifact
AppImage is pretty fast to make, like the win crossbuild; and portable,
being very appropriate to do quick tests on Linux when pushing to git.

The overall organization of Debian jobs was changed to take advantage
of this and make things less complicated (but less clear at first sight).
I reinforce that this was the most efficent way to make the AppImage.
2024-04-18 20:54:49 -03:00
Jehan
df915494d1 gitlab-ci: hack-fix the broken job gimp-flatpak-x64.
This fix doesn't feel right. The whole point of having a generated manifest from
the build was to use it for our flatpak job (through job dependency). Right now,
it has been rendered useless. We must either re-implement the proper job
dependency or find another way to fill the proper "command" with the right
version (maybe just a standalone script to be used in Gitlab CI and which we
could tell about to people who wish to build the nightly flatpak themselves).

Anyway for now, it should do as I don't want to spend too long on this. It
should fix this error in the log generated as artefact of the "gimp-flatpak-x64"
job:

> ../build/flatpak/meson.build:6:2: ERROR: File org.gimp.GIMP-nightly.json.in does not exist.
2024-04-18 23:40:30 +00:00
Jehan
a9814c9e51 build: syncing dependencies with the beta flatpak.
Syncing dependencies back and forth with the current branch, preparing for 3.0.0
RC1 release: https://github.com/flathub/org.gimp.GIMP/pull/287
2024-04-18 23:40:30 +00:00
Alx Sa
e31de151fa scripts: Use GimpFont object in Render Font Map
Resolves #11354

Due to improvements in the text API, we have to pass a GimpFont
object as the last parameter of gimp-text-get-extents-font rather
than just a String.
2024-04-18 23:06:31 +00:00
Jordi Mas
26e116d9b1 Update Catalan translation 2024-04-18 22:23:21 +02:00
Bruno Lopes
975c1891ae data: Generate .env files at build time
These files has been generated by the installer scripts for historical reasons.
Now that we have full-blown local builds and the upcoming MS Store version,
this pervasive pratice can't continue since it creates disparity between builds.
2024-04-18 19:04:25 +00:00
Alx Sa
094ae8eec3 themes: Apply 77ee80f3 to generic spinbuttons
Resolves #11337
2024-04-18 18:57:37 +00:00
Alx Sa
77ee80f329 themes: Removing more instances of -gtk-icon-shadow
Per Bruno Lopes, we should extend aefdb84b to also cover
dropdown box arrows and GimpSpinScale buttons.
2024-04-18 18:06:35 +00:00
Sveinn í Felli
8b181f9925 Update Icelandic translation 2024-04-18 17:51:07 +00:00
Jacob Boerema
a367dec2f8 plug-ins: fix #10787 Page Setup warning/critical
When closing the Page Setup dialog we had warnings and criticals in
the terminal.
The cause for this was that we were looking for the temp procedure
to notify the print plug-in. However, this temp procedure is only
installed if the print plug-in is running, not when running the
Page Setup directly, in which case it is not needed.

We now check if the procedure is valid (meaning the print plug-in is
running) before calling the temp notify procedure.
2024-04-18 12:43:08 -04:00
Sveinn í Felli
bcf30d6c2f Update Icelandic translation 2024-04-18 16:42:49 +00:00
Sveinn í Felli
f04e01aa41 Update Icelandic translation 2024-04-18 16:41:08 +00:00
Alx Sa
ad5e612a1c plug-ins: Fix palette_sort after GeglColorPort
Resolves #11324

Similar to 403af188, we needed to update function calls
that assumed they were receiving a GimpRGB struct rather
than a GeglColor object. Future plans including adding Gegl
functions to retrieve HSV and HSL automatically, rather than
using gegl_color_get_bytes().
2024-04-18 15:42:27 +00:00
Jehan
2434c41a12 app, plug-ins: renaming the file-*-save-internal procs to file-*-export-internal. 2024-04-18 16:02:00 +02:00
Jehan
94853968b3 libgimp: also update unit testing for GimpColorArray.
Making sure not only that the PDB passes correctly the number of colors, but
taking one random color in the array and verifying it is correct.
2024-04-18 16:00:42 +02:00
Jehan
9f149ef3a2 app, libgimp*, plug-ins: get rid of GimpRGB arrays now that we have GeglColor arrays. 2024-04-18 16:00:42 +02:00
Anders Jonsson
2e536b6df1 plug-ins: change file-[gbr/gih/pat]-save to export
Fixes some scripts, followup to
c92cf7e8f2
2024-04-18 12:28:53 +00:00
megakite
e961ff0fe2 app/menus: update tool options menu while initializing menus 2024-04-18 10:22:11 +00:00
Alx Sa
403af1880f plug-ins: Fix GeglColor port of palette-offset
Removes an index that was needed to GimpRGB, but no longer
valid now that gimp_palette_entry_get_color () returns a GeglColor
object. Also, fixed an issue in Interactive Mode where the first
valid palette would be used for every other attempt, no matter which
palette you clicked on.
2024-04-18 04:02:48 +00:00
Alx Sa
dbbdbb45e1 core: Fix filter mask when copied to new image
Switch to using gimp_item_convert ()
instead of gimp_item_duplicate () so that
the filter mask can be properly associated
with a new image when copy/pasted.
2024-04-18 02:25:14 +00:00
Alx Sa
dfb26f37e7 core: Allow copy/pasting NDE filters
Previously, filters were lost when copying
individual layers. This patch copies them
to the clipboard image on cut or copy,
then copies them back to the pasted
image.
It also fixes an issue where filters would
be merged down if a selection was
copied instead of the entire layer.
2024-04-18 02:25:14 +00:00
Jehan
252f991cfb app: swapping gimp_prop_color_button_new() and gimp_prop_gegl_color_button_new().
Color propwidgets now use GeglColor only.
2024-04-18 00:37:20 +02:00
Jehan
80334f0eba app: gimp_gegl_color_new() is not used anywhere anymore.
We don't need to convert GimpRGB to GeglColor now as we work directly with
GeglColor!
2024-04-18 00:25:14 +02:00
Jehan
266e694920 libgimp: library unit testing should use a separate environment.
The comment I had written back then was wrong. Meson in fact can create an env
object from another with a simple assignment (which copies the object, rather
than pointing to a same object), per the answer which has been given to me in:
https://github.com/mesonbuild/meson/issues/13045

This allows to have a properly separate environment (when using GIMP as a build
tool, we don't want to load the test files).
2024-04-18 00:01:30 +02:00
Jehan
354970c0eb tools: make sure in-build-gimp.sh fails when the gimp-console command fails. 2024-04-18 00:01:30 +02:00
Jacob Boerema
204bc9390e plug-ins: compose needs to add .xcf filename extension
We are using `gimp_image_set_file` to set the filename, which
requires an extension, not doing so caused an error.
So let's add .xcf to all compose filenames.
2024-04-17 16:58:27 -04:00
Jacob Boerema
4aa3e7a475 plug-ins: fix #3480 decompose extension needs to be .xcf
When decomposing, the plug-in sets the filename without changing the
extension. However, gimp_image_set_file requires the filename to be
an .xcf file.

To fix this we simplified `generate_filename` to always add an
.xcf extension.
While doing this we also fixed a critical that happened when no
filename was set (new image), by testing `gimp_image_get_file` for
being NULL first.
When no filename was set it also didn't use the type when
config_as_layers was set, this is also fixed.
2024-04-17 16:58:27 -04:00
Alx Sa
2af0218d23 widgets: Do not show internal procedures as search actions
Resolves #11334

GBR, GIH, and PAT have internal save functions which are not meant
to be run directly. However, they were showing up in the Search dialogue
as valid options. This patch adds an additional check for "-internal" to
prevent users from accidentally running them, as they only give a warning.
2024-04-17 17:10:18 +00:00
Sveinn í Felli
64d994b198 Update Icelandic translation 2024-04-17 16:37:37 +00:00
Jehan
88d4033b98 Issue #9578: crash accessing tab menu.
The whole action name prefixing will definitely need to be straightened up in
our codebase at some point (differenciating the global actions and the local
ones).
2024-04-17 18:22:53 +02:00
Martin
3d2207558c Update Slovenian translation 2024-04-17 13:38:45 +00:00
Alx Sa
337ec4cd57 themes: Prevent "bold" button icons when focused
Extends aefdb84b to all buttons with images.
2024-04-17 10:37:49 +00:00
Yuri Chornoivan
5c287b9b9d Update Ukrainian translation 2024-04-17 10:16:55 +00:00
Sveinn í Felli
756e12efa1 Update Icelandic translation 2024-04-17 09:18:01 +00:00
Sveinn í Felli
5c610c203c Update Icelandic translation 2024-04-17 09:16:21 +00:00
Sveinn í Felli
7dd8b62860 Update Icelandic translation 2024-04-17 08:58:02 +00:00
Sveinn í Felli
554bb34371 Update Icelandic translation 2024-04-17 08:46:35 +00:00
Alx Sa
aefdb84bb4 themes: Prevent too thick image button border
Resolves #11337

"gtk-icon-shadow" is applied to all buttons with images,
which creates a bold effect on symbolic icons.
This patch zeroes this effect out and makes them highlight
the background in the same way as the toolbox buttons.
2024-04-17 04:15:17 +00:00
Jacob Boerema
ae2cf562e8 libgimpwidgets: fix #10821 Problem with LabelSpin widget
For certain min/max values of the LabelSpin widget, in combination with
zero digits, it proves impossible to change the initial value.
The reason for this is that the step size may become less than 1.0.
In which case, stepping doesn't work because the number of digits is
set to zero.

Let's check for this situation and when digits is zero set the step
to 1.0 and make sure that page is at least the same value.

While testing this I also noticed another issue: when initializing
the upper value was set to 0.0 and the lower to 1.0 which leads to
a critical because lower > upper.
We fix this by switching the initial upper and lower values.
2024-04-16 21:44:22 -04:00
Jordi Mas
b71464804d Fixes to Catalan translation 2024-04-16 21:58:22 +02:00
Jacob Boerema
f574dc7f0f plug-ins: add missing error message when TWAIN driver isn't found
There was no user feedback when our twain plug-in couldn't find the
(32-bit) TWAIN driver, making for a poor user experience.

Especially since nowadays the availability of the twain driver is
less likely, let's add an error message for the user, so they will
know what's going on.
2024-04-16 15:09:49 -04:00
Jehan
956a9fac6c Issue #10715: icon for effects.
We now have a proper icon thanks to Denis Rangelov!
2024-04-16 19:54:06 +02:00
Jehan
3e980d5ad4 libgimp: generate build-only GIR/Typelib variants for macOS.
The previous commit worked for all the compiled executables, but for Python
plug-ins (and likely all other GObject-Introspected bindings), we need to
generate a temporary typelib linking to the in-build-directory libgimp*
libraries.

This is similar to what the script `package/macports_build_app.sh` does for
packaging in gimp-macos-build repository.
2024-04-16 17:43:15 +00:00
Jehan
a78c41d2a3 meson: on macOS temporarily update rpath to find libraries of non-installed GIMP.
The DYLD_LIBRARY_PATH trick was working fine on CI, but not on local builds for
Lukas. Apparently there are security measures disabling the environment
variable. Instead let's temporarily add then remove libgimp libraries folders
from rpath.

See: https://gitlab.gnome.org/Infrastructure/gimp-macos-build/-/merge_requests/292#note_2075291
2024-04-16 17:43:15 +00:00
Yuri Chornoivan
7f76285bc8 Update Ukrainian translation 2024-04-16 17:16:31 +00:00
Alx Sa
c92cf7e8f2 plug-ins: Convert file_*_save to file_*_export
Resolves #10932

Since GIMP distinguishes between saving
XCF and exporting image like PNG,
we should change the PDB to show
export rather than save in the function
calls.
2024-04-16 16:07:10 +00:00
Bruno Lopes
d09a2a6f7a gitlab-ci: Drop 'packaging' stage
This stage was introduced in 076e4d68 and it fulfilled well its purpose. But
the side effects were: more (sometimes slow) uploading and downloading of
packages and artifacts. Even if we have caching, this is far from ideal.

Now, the so-called "packaging" jobs were moved inside in the "build" jobs.
The advantages are: just one pacman install (ideally cached from deps job);
direct packaging without waiting for upload/download; and less confusion,
since "packaging" naming was implying that the .zips are somewhat official,
which isn't totally true, and sometimes overlaps the dist/deploy concept.

---

Also, the flatpak job now uses config.h instead of triggering a GIMP build.
In other words, I'm reverting part of my work in some old commits.
2024-04-16 12:08:07 -03:00
Jehan
bf91e454fd app: fix build warnings.
Fix 2 "discards ‘const’ qualifier from pointer target type" warnings.
2024-04-16 16:40:36 +02:00
Jehan
f10d9a706d app: keep image reference with weak pointer in GimpStatusBar.
Unlike the previous 2 commits, this was not making an error but was the reason
why our code was keeping the last closed GimpImage alive a bit longer than it
should. In particular, the status bar code was keeping a hard reference to the
image until the focus changed, hence preventing the object to get finalized
longer than necessary.

Now it will also be a weak reference, so the image is immediately freed when the
view is closed.
2024-04-16 15:48:54 +02:00
Jehan
d888e95cfa app: keep track of image with a weak pointer.
Similar to the previous commit, but this time for the GimpAlignOptions.
2024-04-16 15:43:40 +02:00
Jehan
9abda0ab00 Issue #10826: crash when closing view.
Using weak pointers to make sure that the previously pointed image is still a
valid GimpImage.
2024-04-16 15:43:40 +02:00
Bruno Lopes
c064148a95 gitlab-ci: Make the CI a little more smart
Now, the CI will auto cancel jobs after a new commit is pushed and retry when
the runners fails. The first case is frequent, the last is rare but happened.
2024-04-16 08:57:14 -03:00
bootchk
4048556171 libgimpwidgets: fix #11255 unterminated Wayland window ID string
Copy the NULL when creating GBytes from a string.
2024-04-16 09:26:00 +00:00
Alx Sa
5b5a8f58e4 python: Fix ColorXHTML export
Since the GeglColor port, gimp_drawable_get_pixel () returns
a GeglColor rather than a GimpRGB structure. We needed to
update the supporting code in ColorXHTML to handle the change.
2024-04-16 01:57:01 +00:00
nb1
d8c98e74f3 Refreshing the templaterc 2024-04-15 23:46:32 +00:00
Anders Jonsson
bca4679fa3 python: fix translation of Spyrograph dropdowns 2024-04-15 23:19:02 +00:00
cheesequake
8153dffb92 Issue #9727: Reduced text area to improve Slider UX 2024-04-15 22:31:35 +00:00
Jacob Boerema
af8ef61a04 app, pdb: fix incorrect group checks for edit-cut and edit-named-cut
As a follow up to the previous commit, I noticed that the pdb functions
gimp-edit-cut and gimp-edit-named-cut also incorrectly used
gimp_pdb_item_is_group.

This can be seen by calling Filters/Blur/Tileable blur when a group
layer is selected. The error message was incorrect.
We replace the call here also to `! gimp_pdb_item_is_not_group`.
2024-04-15 18:13:32 -04:00
Jacob Boerema
7aa33bf771 app, pdb: fix #8363 gimp_selection_float() crash
Calling gimp_selection_float from a Python plug-in could make it crash
with an error like Calling error for procedure 'gimp-selection-float':
Item x cannot be used because it is not a group item.

This is caused by an incorrect check for group layers.
gimp_pdb_item_is_group returns an error when the condition is False,
while we only want an error when a group layer is selected (True).
Thus we need to use gimp_pdb_item_is_not_group, which returns an error
when the item is a group, which is what we want.

These function names are a little confusing, we might need to think
about better naming sometime.

I added C/Python tests for this function, so that we can test whether
this works correctly.
2024-04-15 18:13:32 -04:00
Jehan
140a3c82d0 Issue #10713: API versioning got broken with meson.
This is now back in sync with how it used to be up to GIMP 2.10. Basically our
API version should always be <major>.0 in the shared libraries naming, as well
as in pkg-config and docs. Otherwise we would break library compatibility with
every minor version bump.
2024-04-15 23:35:37 +02:00
Jehan
d7ec3a5ca4 tools: delete a remnant from autotools paths.
Library binaries are not under a hidden .libs/ directory anymore.
2024-04-15 23:35:37 +02:00
Alx Sa
167066a468 plug-ins: Get Blue channel in Palette-Sort
Per Elad Shahar, this should be v.b instead of v.r.
2024-04-15 18:12:29 +00:00
Alx Sa
15ffc4a6c0 plug-ins: Improve FITS import error handling
Code that checked if an image was NULL was run
*after* the variable was used in a function,
gimp_image_resize_to_layers (). This patch moves
the NULL check before the function call is made.
Additionally, we now verify there are at least two axis
before trying to access indexes in the naxis array.
2024-04-14 17:20:40 +00:00
Bruno Lopes
876c709a29 gitlab-ci: Move 'image:' from deprecated global to .default 2024-04-14 13:52:29 +00:00
Bruno Lopes
18079e176f gitlab-ci, build/windows: Unify a bit Windows (cross and native) jobs 2024-04-14 10:36:04 +00:00
Martin
d9694a6e38 Update Slovenian translation 2024-04-14 10:27:48 +00:00
Ngọc Quân Trần
761d740f9b Update Vietnamese translation 2024-04-14 08:01:24 +00:00
Ngọc Quân Trần
6ee9158cca Update Vietnamese translation 2024-04-14 03:10:09 +00:00
Ngọc Quân Trần
26d6aa4c6d Update Vietnamese translation 2024-04-14 03:08:43 +00:00
Bruno Lopes
ad132ad0fa gitlab-ci, build/windows: Organize 'git' variables 2024-04-13 20:47:47 -03:00
Bruno Lopes
5202935db7 gitlab-ci: Make use of 'before_script' less unorthodox
Since !1171 the 'before_script' was being used by me for organization, but
this is at least unexpected to "mainstream" .yml pratice and can be wrong.
For example, the universal variables can't be properly used this way.
So, let's use 'before_script' only for the (official) purpose: save code.
2024-04-13 23:12:34 +00:00
Alx Sa
437cb6b366 plug-ins: Use correct colormap in Flame
Resolves #11292

Since the GimpProcedureDialog port, the "settings-data"
parameter has been used to save and load the selected
color map. However, the parameter was not being updated
when the user switched colormaps in the GUI - therefore, it
always used the "Custom Gradient" option.
This patch updates the "settings-data" parameter after the
change to resolve the issue.
2024-04-13 22:42:01 +00:00
Bruno Lopes
28c65b8a5f gitlab-ci: Drop x86 (aka 32-bit) cross builds for Windows
This isn't directly related with #10922 and does NOT affect 32-bit support.

After talk with @Jehan, author of 'crossroad' and main dev of crossbuilds,
we decided that the x86 crossroad builds can be dropped by these reasons:

1) 32-bit crossbuilds weren't being built. They are used since c8ec0ae7 but
after the native 32-bit builds they ended in a state that they are the only
pipeline that isn't automatically triggered in any way, a complete limbo.

2) 32-bit crossbuilds weren't being autonomous. They are not working fine
with wine32 so the win-x64-cross artifact is a 'need' and now debian-x64,
so we were spending way more time fixing than using the 32-bit cross jobs
(sometimes the 32-bit cross jobs are just broken and we even noticed).
We have other jobs not autonomous but they don't have additional bugs
like not being able to build with .mng and .wmf (32-bit cross only bugs).

---

The x64 crossbuilds will continue to be supported. They are very useful to
develop on Linux, and test MRs on Windows. I'm an assiduous user of them :)
2024-04-13 18:25:47 +00:00
Alx Sa
1f2ce6fe58 plug-ins: Fix Flame crash on interactive run
Resolves #11283

In the GUI, set_flame_preview () is connected to GimpProcedureConfig's
"notify" signal. However it is not disconnected afterwards, so it runs again
after the plug-in is finished and the "setting-data" parameter is updated.
Since the preview area no longer exists, this causes a crash.
This patch resolves the issue by storing the callback ID and then disconnecting
after the GUI is closed.
2024-04-13 17:23:45 +00:00
Bruno Lopes
694e4f382c gitlab-ci: Remove unnecessary manual _ccache/ folder creation
This was added in a22393a6 and e96b751e, following old 2_build-gimp-msys2.sh.
But, according to my tests (local and in the CI, in both Debian and Windows),
meson creates this in setup time so the manual folder creation is redundant.
2024-04-13 16:44:36 +00:00
Bruno Lopes
28f893293a gitlab-ci: Reduce redundancy on Windows cross jobs (take 3)
Following 2c2e779f and 70886e55.
2024-04-13 15:51:32 +00:00
Yuri Chornoivan
9be2e641d1 Update Ukrainian translation 2024-04-13 15:48:39 +00:00
Anders Jonsson
3f0120578d plug-ins: fix duplicate Brightness labels in Flame 2024-04-13 14:37:19 +00:00
Jordi Mas
3d5ce372f9 Update Catalan translation 2024-04-13 15:52:50 +02:00
Bruno Lopes
2c2e779f92 gitlab-ci: Reduce redundancy on Windows cross jobs (take 2)
Following 129c1637a9
2024-04-13 10:00:56 -03:00
Bruno Lopes
bc8ef7998c gitlab-ci: Remove paradoxical redundancy on Windows native jobs
a22393a6 introduced redundancy while removing redundancy
2024-04-13 10:40:21 +00:00
Anders Jonsson
d7c693cc57 Update Swedish translation 2024-04-13 10:04:24 +00:00
Alx Sa
2ee847d8d0 actions: Hide Preview Size dockable option if not needed
Resolves #11250

In 2.10, we explicitly hid "dockable-preview-size-menu", the submenu
for Preview Size, if there were no previews to set sizes for in the
dockable dialogue. In 2.99, this code was removed as part of the
GAction port and code clean-up.
As a result, the Preview Size submenu is always visible even if the
options have no effect on the display. To restore the 2.10 behavior,
we set each Preview Size option's visibility. If all options are hidden,
the submenu does not appear.
2024-04-13 01:43:31 +00:00
Bruno Lopes
129c1637a9 gitlab-ci: Reduce redundancy on Windows cross jobs (take 1)
Our crossroad jobs are too "sensible" and prone to broke so let's go gradually.
2024-04-12 22:02:52 -03:00
Bruno Lopes
dcaaf8a48b gitlab-ci: Overall cosmetic change following e96b751e
Also, drops 'apt-cache' caching since after some experimenting with !1171
this proved to be of little use; and reorganize some dist and analysis jobs.
2024-04-12 21:57:29 +00:00
Guntupalli Karunakar
b35a105f99 Add Hindi translation 2024-04-12 16:36:24 +00:00
Bruno Lopes
e96b751e35 gitlab-ci: Reduce redundancy on Debian native jobs
* Move common things to the new .default section extensible for all jobs
* Reorganize order of job elements to be way more consistent and rational:
  from general (pipeline/rules) to specific (job artifacts) in a liner way
* The order of rules was changed to be a bit more easier to understand
- Drops 'dependencies' which is redudant, and 'needs' have more options
- Drop apt-cache which lost use and it is sometimes troublesome to cache
+ First try to boost the use of ccache in all build jobs, when possible
+ Fix the problem of non-failing jobs introduced by GNOME/gimp!1171
2024-04-12 16:05:42 +00:00
Jehan
9a353b9db9 libgimpwidgets: fix undeclared identifier.
Build for macOS on CI breaks with:

> ../gimp3-2.99.19/libgimpwidgets/gimppickbutton-quartz.c:210:45: error: use of undeclared identifier 'monitor_profile'
>       space = gimp_color_profile_get_space (monitor_profile,
2024-04-12 12:24:53 +02:00
Jehan
ef9de3c263 app: initialize font to NULL.
In case there are no fonts loaded (which may happen in particular when starting
with --no-fonts), we need to make sure that font is initialized to NULL so that
we can return the standard GimpFont object and not a broken pointer.

Thanks to Idriss for the additional diagnosis, which would hopefully complete
commit 5dc86277e6 and take care of #11219.
2024-04-12 12:23:00 +02:00
Martin
0df73ade6c Update Slovenian translation 2024-04-11 20:05:28 +00:00
Bruno Lopes
a22393a67e gitlab-ci: Reduce redundancy on Windows native jobs
This commit uses definitions and references to reduce repetition of CI code.
Some people (like the GitLab devs?) prefer (almost imposes) this to be done in
multiple .yml's using 'worfklow:' but this makes the CI way more complicated
and very slow to read. So, let's just keep simple in one human readable file.

---
Other changes are:
- The custom native arch pipelines now they always generate a .zip package.
  This helps to ensure that everything is in place and facilitate testing;
- The pacman update (-Syyuu) was removed since it is auto done by runners;
- The ccache config was moved to .yml. This does NOT affect local builds
  since meson saves ccache by default for user in '%LocalAppData%/ccache'.
2024-04-11 19:02:49 +00:00
Cheesequake
702d5e1e80 Issue #11071: Changed detailed_signal from "map" to "realize" to enable opening animations 2024-04-11 14:59:15 +00:00
Bruno Lopes
4652022368 gitlab-ci: Expose job artifacts in UI
Makes a bit easier to newcomers download the main artifacts in MRs.
(This feature doesn't support variables or wildcards in paths)
2024-04-11 07:42:13 -03:00
Yuri Chornoivan
c7b2bacbe2 Update Ukrainian translation 2024-04-11 10:28:06 +00:00
Jehan
5dc86277e6 app: set font factory as GimpFont class member regardless of fonts being loaded.
Previous code would only set the class member when we were actually
loading fonts, so we ended with code paths where the member was NULL.

Fixes:

> GIMP-CRITICAL: gimp_container_get_n_children: assertion 'GIMP_IS_CONTAINER (container)' failed

It should hopefully also fix #11219 (though I couldn't reproduce this
failure).
2024-04-11 12:15:59 +02:00
Jehan
3001c2d523 plug-ins: fix include.
This will fix the following warnings:

[1/30] Compiling C object plug-ins/script-fu/libscriptfu/libgimp-scriptfu-3.0.so.0.9900.19.p/script-fu-version.c.o
../../../../../../../greenmarmot/gimp/plug-ins/script-fu/libscriptfu/script-fu-version.c:49:1: warning: no previous declaration for ‘begin_interpret_v3_dialect’ [-Wmissing-declarations]
   49 | begin_interpret_v3_dialect (void)
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~
../../../../../../../greenmarmot/gimp/plug-ins/script-fu/libscriptfu/script-fu-version.c:55:1: warning: no previous declaration for ‘begin_interpret_v2_dialect’ [-Wmissing-declarations]
   55 | begin_interpret_v2_dialect (void)
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~
../../../../../../../greenmarmot/gimp/plug-ins/script-fu/libscriptfu/script-fu-version.c:62:1: warning: no previous declaration for ‘begin_interpret_default_dialect’ [-Wmissing-declarations]
   62 | begin_interpret_default_dialect (void)
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../../../../../../greenmarmot/gimp/plug-ins/script-fu/libscriptfu/script-fu-version.c:69:1: warning: no previous declaration for ‘is_interpret_v3_dialect’ [-Wmissing-declarations]
   69 | is_interpret_v3_dialect (void)
      | ^~~~~~~~~~~~~~~~~~~~~~~
2024-04-11 10:47:20 +02:00
lillolollo
9f86d6b8d0 libgimpwidgets: Replace deprecated CGColorSpaceCopyICCProfile with CGColorSpaceCopyICCData 2024-04-11 01:28:16 +00:00
Alx Sa
49c820e620 dialogs: Use error variable in Welcome Dialog
Resolves #11256

A GError variable was created but not passed to
file_open_with_display () when opening recent files.
As a result, if an error did occur the variable would be
used while it was still NULL. This patch fixes this
by passing a reference to error as the last parameter
of file_open_with_display ().
2024-04-11 01:25:42 +00:00
Anders Jonsson
8e8d2dd4c4 plug-ins: mark DDS progress strings as translatable 2024-04-10 15:30:00 +00:00
Jacob Boerema
5bda6e0623 plug-ins: fix failure to load certain mipmapped DDS images
We compute the size of the mipmapped layers wrong. We assume that
width, height are always exactly a power of 2, which is the normal case
for dds images. See issue #11256.

Since other sizes are possible, we adjust this by computing the width
times height times bytes per pixel of the current mimmap level.
2024-04-09 13:33:36 -04:00
Alx Sa
f346b1783b widgets: Disable DrawableChooser if no layer/channel selected
Resolves #11075

In the DrawableChooser pop-up, choosing an image without
also picking a layer or channel causes the pop-up not to
reappear on subsequent attempts to click it. This is because
the callback is only recreated when the drawable is updated,
and choosing just an image does not update the drawable.
For 3.0, we'll set the Okay button to insensitive unless a layer
or channel is picked.
2024-04-09 12:51:30 +00:00
Alx Sa
f726efba76 Don't convert to float before storing...
...in GeglColor. Just use the "u8" format.
2024-04-09 00:48:35 +00:00
Alx Sa
cc74d40769 libgimpwidgets: Port GimpPickButton to GeglColor
Also have "color-picked" signal send a
GeglColor object rather than GimpRGB.
2024-04-09 00:48:35 +00:00
Jacob Boerema
97e29cb7f6 plug-ins: some improvements to Photoshop layer reading code
I added a few improvements to how we load the Photoshop layers:
- When included from TIFF, we forgot to decrease the data_length for
the parts we already read.
- Also when included from TIFF, we need to skip the global layer mask
info.
- The block length for the layer data needs to be a multiple of 4.
- Catch an invalid data condition where block_len is greater than
total_len. This could cause a change total_len to a very large
value, so protect against that.
2024-04-08 18:07:33 -04:00
Jacob Boerema
c4de209322 plug-ins: incorrect size of Photoshop metadata in TIFF
When loading Photoshop metadata from TIFF images, the size of the data
in the temp file was often incorrect.
This happens because run_mode is usually GIMP_RUN_INTERACTIVE when
run from within GIMP. In interactive mode, the last saved config values
take precedence over the ones set in the function call, which is not
what we want in this case.
We would prefer to use interactive here, because then we can show a
dialog with a list of unsupported Photoshop features that were found
inside the image.
For now, we will use GIMP_RUN_NONINTERACTIVE and accept that we can't
do that at this time. This way we will at least have the correct values
when processing the Photoshop data.
2024-04-08 18:07:32 -04:00
Jacob Boerema
61614a39ca plug-ins: fix reading Photoshop clipping path
The clipping path values are all 2 bytes, but we were only reading in
1 byte for each value. In addition to that, the path_flatness_fixed
value was not converted to the correct Endian representation.

Since these values are usually 0 and get clamped to valid values, this
went unnoticed until now.
2024-04-08 18:07:31 -04:00
Jehan
adb479a63e plug-ins: fix warnings in recent libscriptfu commits.
Fixes 2 such warnings:

> warning: format ‘%i’ expects argument of type ‘int’, but argument 5 has type ‘size_t’ {aka ‘long unsigned int’} [-Wformat=]

As well as:

> warning: conversion lacks type at end of format [-Wformat=]

And:

> warning: no previous declaration for ‘reset_output_port_struct’ [-Wmissing-declarations]
2024-04-08 20:43:27 +02:00
Jehan
378e80408d meson: share a same environment for all usages of self-built GIMP
In particular GIMP used for unit-testing, or in other cases as a build tool,
from the non-installed binaries, can use a same meson `env` object.
2024-04-08 20:30:51 +02:00
bootchk
9a2de135ee ScriptFu: fix #10698 and other issues with script progress
Fix unreported issue that new-style dialog using GimpProcedureDialog
does not display progress.

Change progress reporting to use app's status bar, for all scripts,
old and new style.
As before, report progress whenever a script calls a PDB procedure,
by putting the procedure name in the status bar.

Eliminate progress bar widget from old-style script dialog.
Since it was failing on Wayland, and since it is inconsitent
with new style dialog using GimpProcedureDialog.
2024-04-08 11:27:13 -04:00
Alx Sa
23807a3aa3 plug-ins: Port sparkle to GeglColor
Also remove one instance of GimpRGB in
cml-explorer. The remainder requires a
different approach to optimize the filter.
2024-04-07 23:17:12 +00:00
Alx Sa
0ec02a4fa9 libgimpwidgets: Fix CRITICAL when no monitor profile is set
Resolves #11246

On Windows, a CRITICAL was being repeatedly thrown if you
didn't have a monitor profile set. This is because we were trying to
pass a NULL value to g_utf16_to_utf8 () whenever we needed to
convert a GeglColor.
This patch fixes it by checking if the monitor profile filename is NULL
before trying to convert it.
2024-04-07 12:52:24 +00:00
Alx Sa
841d926f4b themes: Prevent .text-button from overwriting radio button background
Resolves #11244

GtkRadioButtons can also have the .text-button CSS class set. This class was overwriting
the radiobutton background color, making it appear dark and box-like.
This adds a specific radiobutton.text-button definition to ensure the background color
is consistent (as we had to do with checkbutton.text-button)
2024-04-07 00:06:52 +00:00
bootchk
2df7874216 ScriptFu: hide "Refresh Scripts"
It is broken and throws critical, see #10596.

Expedient to hide it instead of fixing it, to not block 3.0rc1.

As discussed in #10652, a user can simply restart GIMP instead.
"Refresh Scripts" is a poor design, a bandaid.
There are plans for better alternatives to install/remove scripts.

The MR for #10652 shows the reason it throws critical,
and could fix it,
but completing the MR requires time we don't have.
Note the MR is not on these files, but on core plugin machinery.

The change is to extract functions to a separate file,
and still build them, but not call them or link them.
They also are not translated while not being called.

Eventually, the extracted files can be deleted (or restored when they work.)
There is other related cruft that needs deletion in scheme-wrapper.c.
2024-04-06 14:33:13 -04:00
bootchk
0b9ec0e8b9 ScriptFu: TinyScheme: add call-with-output-string etc to dialect
Add canonical/idiomatic functions call-with-output-string,
call-with-input-string, any->string to the library init.scm.
Since they are useful, especially in test scripts and frameworks.

Remove their definitions from test scripts and test frameworks.

Also comment out failing test in test script string-escape.scm.
2024-04-06 13:43:33 +00:00
bootchk
bf59bf026b ScriptFu: TinyScheme: revise tests of byte operations
Redefine call-with-output-string etc. in the test script: test9.scm
Other fixes to the test script.

Improve logging of no memory condition for string-ports

Fix bug freeing ports that have been closed.
When ports are closed, string-port code was treating them as string-ports.
2024-04-06 13:43:33 +00:00
bootchk
d8e5d694d3 ScriptFu: TinyScheme: major revision and fix bugs string-port
Fix #11040 and #9495 bugs with unicode in string-ports

Fix other unreported bugs with allocations and garbage collection of string-ports.

Obsolete open-input-output-string, a string port of kind input-ouput is no longer supported
and the function actually opens a string-port of kind input which cannot be written.

Comments and Gimp style in the original TinyScheme code, now in string-port.c

Revise tests of string-port.

Update TinyScheme README: Discuss more thoroughly the ancestry, and changes from upstream.
2024-04-06 13:43:33 +00:00
bootchk
b32be06502 ScriptFu: TinyScheme: refactor string-port
Extract pseudo class string-port methods to separate file.

No functional changes intended.

Style changes not complete: anticipate further bug fixes and styling.
2024-04-06 13:43:33 +00:00
bootchk
96da006e4a ScriptFu: TinyScheme: delete unused functions for string-ports 2024-04-06 13:43:33 +00:00
Bruno Lopes
06b18b9c58 themes: Fix title bar mode (following 879cec87)
After the referenced commit, the title bar became to tall. This was
due to lack of testing. Now, both title bar and header bar are 36px.
2024-04-06 09:26:10 -03:00
Luca Bacci
d7228727d7 QuitDialog: disconnect signal handler on dialog destroy
...rather than finalize.

Fixes #10785
2024-04-04 20:18:56 +00:00
Jehan
1c2472a092 libgimpbase: support multiarch folders for binary relocability on Linux.
This is not seen on all distributions (mostly on Debian-based ones in my
experience), but some distributions install libraries in a second-level
directory under prefix (e.g. lib/x86_64-linux-gnu/ instead of lib/ or lib64/)
whereas our prefix-guessing code for relocatable builds harcoded moving up from
1 level.

This new heuristic will assume that if the leaf directory is neither bin/ nor
starting with `lib`, then it's likely a multiarch folder and we must move up
once more to find the prefix folder.

This should also fix the problem encountered by Bruno for the current work on a
potential official AppImage.
2024-04-04 22:10:58 +02:00
Jehan
1387d4d081 NEWS: update. 2024-04-04 18:15:23 +02:00
Alx Sa
0e3f34206a libgimpwidgets: Prevent FileChooser widget from crashing
We dereference "file" twice in gimp_prop_file_chooser_button_callback(),
once in the GIMP_IS_PARAM_SPEC_CONFIG_PATH () condition and then
at the end of the function. This is likely due to a similar structure in 2.10,
which did not have a second condition.
As a result, any Gegl filter which had a file property would crash if set from
a GUI. The first g_object_unref() is removed so we only dereference "file"
once.
2024-04-04 15:23:27 +00:00
Anders Jonsson
134c354a9e app, pdb, plug-ins: lower Spread limit for Distort
Distort can call plug-in-spread with Spread of 1000 which causes an error.
This limits it to 512 which is the highest allowed by gegl:noise-spread
2024-04-04 12:04:12 +00:00
Alx Sa
d0d63efac9 themes: Define box-shadow for tooltips on System theme
Applying cc120f1b to the System theme as well, so that the issue
is resolved for both.
2024-04-03 20:37:59 +00:00
Alx Sa
cc120f1bd9 themes: Define box-shadow for tooltips
Resolves #9795

(Solution provided by Andreas G, @uriesk)
Some system themes provide errant values for tooltip
box-shadows which cause flickering effects.
This patch defines the tooltip box-shadow to 0px to
prevent the issue.
2024-04-03 13:38:01 +00:00
cheesequake
63a134a2b2 Issue #11021: cairo-ARGB32 uses "associated alpha", so changed the new formats accordingly. 2024-04-03 03:12:12 +05:30
Nathan Follens
e34b5d3267 Update Dutch translation 2024-04-02 18:28:51 +00:00
Alx Sa
c44941ae28 core: Resize filters with group layers
Resolves #11054

NDE Filters clip to the size of the layer when
applied. Group layers get their dimensions from
the largest layers under them, so an empty
layer has dimensions of 0 by 0. This means a
filter applied when the layer group is empty will
be clipped to 0 by 0 as well.
This patch adds code to refresh the filter's crop
whenever the group layer is resized by a
layer being added or removed.
2024-04-02 16:36:46 +00:00
Bruno Lopes
70886e554f Partially reverts 9d279a60 and 4f965557
These commits introduced sensible drawbacks in our CI file organization.
Some of them I already commented in the MR but was "ignored" back then
probably due to the complexity of the MR. So, the let's revert:
- Unecessary repetition of libomp installation (4 times, now 1)
- Unecessary repetition of submodule initialization (6 times, now 4)
- Creation of new variables in the hope of more clarity. But,
  they aren't consistent with the gimp-web-devel instructions
  nor with other systems variables. This is terrible to undestand.
  Please, let's not reinvent the wheel since this is a bad example to
  packagers, since they tends to isolation and overly-engineering.

Also, made some little adjustments that I should have done in previous MR.

---

This MR was splitted. Even more simplification will be done in the future.
2024-04-02 11:55:33 +00:00
Alx Sa
10eb615eff widgets: Port gimp_get_color_tag_color ()...
...to accept GeglColor paramaters instead
of GimpRGB. This function is used to draw
the layer/channel color tags.
Note that a temporary GimpRGB was left
to use with gimp_rgb_composite ().
It will be replaced once that function is
also converted to use GeglColor.
2024-04-02 04:00:50 +00:00
Bruno Lopes
2f2027b757 gitlab-ci, build: Unify variables following gimp-web-devel
We should avoid disparity with the build instructions since
contributors will look at the CI files. See:
Infrastructure/gimp-web-devel!54 and Infrastructure/gimp-web-devel!65
2024-04-01 19:01:52 -03:00
Juliano de Souza Camargo
45198023bb Update Brazilian Portuguese translation 2024-04-01 12:42:02 +00:00
Ekaterine Papava
4e43e0ab07 Update Georgian translation 2024-04-01 03:14:45 +00:00
Anders Jonsson
3daaad08d4 app, pdb: raise limit for wavelength argument to Waves plug-in 2024-03-31 17:36:24 +00:00
Alx Sa
c17548f01c xcf: Save/load NDE filter clipping setting
752f0fb4 did not fix saving/loading filters
in .xcf files. To do this, a new function to
retrieve the clip setting was added to
gimpdrawablefilters.c, and then used to
save the value in xcf-save.c. The existing
set_clip function was used in xcf-load.c,
just like in 752f0fb4.
2024-03-31 17:30:00 +00:00
Nathan Follens
3749b23a6c Update Dutch translation 2024-03-31 15:31:01 +00:00
Martin
7aff667ac0 Update Slovenian translation 2024-03-31 15:20:47 +00:00
Alx Sa
752f0fb43d core: Copy filter clipping setting
Resolves #10997
When filters are duplicated for export, the clip property was
not being copied over. This caused filters that go outside the
layer boundaries (like Drop Shadow and Long Shadow) to be
clipped incorrectly. 
The simple fix was to copy over the clip value when the new
filter was duplicated.
2024-03-31 15:15:39 +00:00
Alx Sa
99e0446dfd libgimpcolor: Port gimp_cairo_checkerboard_create ()...
to GeglColor.
2024-03-31 01:09:45 +00:00
Martin
796ff8233d Update Slovenian translation 2024-03-30 22:38:03 +00:00
Rodrigo Lledó
a17d5b3ee6 Update Spanish translation 2024-03-30 19:16:45 +00:00
Rodrigo Lledó
cf056e2e2d Update Spanish translation 2024-03-30 19:14:54 +00:00
Alx Sa
a4cfa25822 core: Put floating selections under layer effects
Resolves #11147

Applying the same reordering code
in cbb1e816 to adding a floating selection.
When anchored, floating selections were also
merging down all layer effects onto the original
image. This patch places the float selection
under the layer effect when added, both to prevent
this and because it seems to be the expected
behavior based on user feedback.
2024-03-30 15:44:39 +00:00
Juliano de Souza Camargo
781581379a Update Brazilian Portuguese translation 2024-03-30 13:28:42 +00:00
Yuri Chornoivan
c67c9f23dc Update Ukrainian translation 2024-03-30 09:24:02 +00:00
Asier Sarasua Garmendia
00c2c00818 Update Basque translation 2024-03-30 08:14:49 +00:00
Asier Sarasua Garmendia
22cf668a1b Update Basque translation 2024-03-30 08:12:39 +00:00
Asier Sarasua Garmendia
d2a9558d20 Update Basque translation 2024-03-30 08:07:58 +00:00
Asier Sarasua Garmendia
c7a0aa28b5 Update Basque translation 2024-03-30 08:07:49 +00:00
Alx Sa
2cfe12deab plug-ins: Port file-xmc to GimpSaveProcedureDialog 2024-03-30 02:01:20 +00:00
Jordi Mas
ef4086e027 Fixes to Catalan translation 2024-03-29 19:35:52 +01:00
bootchk
1e104769d7 ScriptFu: tests of TinyScheme string-ports and string escapes
Add document about string-like objects in TinyScheme.

Add tests of several outstanding issues in TinyScheme.
In preparation for fixing them.
2024-03-29 10:03:44 +00:00
Martin
5ac6cf6e6c Update Slovenian translation 2024-03-29 06:43:18 +00:00
Alx Sa
3cccc0d319 libgimpwidgets: Get full color data from ColorArea
Resolves #11146

As Idriss Fekir and I noted,  5ce128a9 added support for
receiving GeglColor data to GimpColorAreas, but
retrieving it still resulted in RGBA application/x-color
values being stored when dragged.
This patch updates gimp_color_area_drag_data_get () to
give the format and profile information along with the
pixel values.
2024-03-29 04:01:12 +00:00
Jacob Boerema
1094ba1382 plug-ins: fix #11131 Crash loading PSD with extra layer channels
When loading a PSD with multiple extra layer channels, the PSD loader
crashes. We increase the number of layer_channels with 2 for every
extra channel found, which we only should do for the first extra to
skip the alpha channel.

We fix this by adding a check to see if this is the first extra channel
and in that case skip the alpha channel slot. Any other extra channel
will be added in the next available slot.

We also add an extra check in case we have extra channels when we do
not have an alpha channel in the layer. Not sure howe likely this is.
In that case we move the last extra channel to the slot reserved for
the alpha channel. That way we won't try to free non-existent alpha
channel data.

Note that eventually we should probably try to add these extra layer
channels are extra image channels in GIMP, since GIMP doesn't have the
concept of extra channels per layer.
2024-03-28 15:54:48 -04:00
Yuri Chornoivan
e6e6e9853c Update Ukrainian translation 2024-03-28 19:45:32 +00:00
Alx Sa
82d4bf26ad plug-ins: Port qbist to GimpProcedureDialog
Connected anti-aliasing GUI to a property so that
script writers could also configure this when running
the plug-in.
2024-03-28 17:55:50 +00:00
Sabri Ünal
e1170f2cb9 Update Turkish translation 2024-03-28 14:39:07 +00:00
Sabri Ünal
574199e5a0 Update Turkish translation 2024-03-28 14:38:55 +00:00
Sabri Ünal
d2a667ba1d Update Turkish translation 2024-03-28 14:38:15 +00:00
Sabri Ünal
0a640bc630 Update Turkish translation 2024-03-28 14:38:08 +00:00
Alx Sa
6a981012be widgets, plug-ins: GeglColor port and fix
The border-drawing code for Layer icons
has been ported to GeglColor. Note that
GimpViewRenderer still uses GimpRGB for
gimp_cairo_checkerboard_create (), which
will be fixed in a larger commit.

In 9bee3bed, Border Average's return
value was set to NULL rather than a valid
GeglColor when the procedure was
created, which caused a warning on
launch. This has been fixed.
2024-03-28 13:51:55 +00:00
Anders Jonsson
202d358991 pdb: raise max blur radius of plug-in-gauss-rle
Perspective shadow could call plug-in-gauss-rle with higher blur
radius than allowed in the wrapper. Raise the max value to
allow for this.

Fixes #11140
2024-03-28 12:59:34 +00:00
Jehan
85783b05aa gitmodules, gimp-data: set the default remote branch.
Now that the MR gimp-data!1 has been merged, we can pull the main branch.

Also syncing to latest commit to fix "dev-docs" job.
2024-03-28 04:30:59 +01:00
Jehan
5c14d937f9 gitlab-ci: fix dist-installer-weekly job.
Since dist-installer-weekly doesn't depend on gimp-debian-x64 anymore, we need
to grab the config.h from one of the other dependencies. Let's use the one from
gimp-win-a64 (though it could have been any other Windows build job).

Fixes:

> Get-Content : Cannot bind argument to parameter 'Path' because it is an empty string.
> At C:\_r\_builds\vJWzEqDv\0\GNOME\gimp\build\windows\gitlab-ci\4_dist-gimp-inno.ps1:13 char:39
> +     $GIMP_VERSION = Get-Content -Path "$CONFIG_PATH"         | Select ...
> +                                       ~~~~~~~~~~~~~~
>     + CategoryInfo          : InvalidData: (:) [Get-Content], ParameterBindingValidationException
>     + FullyQualifiedErrorId : ParameterArgumentValidationErrorEmptyStringNotAllowed,Microsoft.PowerShell.Commands.GetC
>    ontentCommand
2024-03-28 00:19:10 +01:00
Jehan
8c6177dc1a gitlab-ci: fix cross-builds.
The dependency to libomp apparently came with the move to CLang.

Fixes:

> /builds/GNOME/gimp/_install-debian-x64/bin/gimp-console-2.99: error while loading shared libraries: libomp.so.5: cannot open shared object file: No such file or directory
2024-03-28 00:19:10 +01:00
Jehan
be0e6b84e9 libgimpbase: do not "fix" paths in build environment.
When running GIMP in the build environment (even before it's installed), we
don't want to "fix" paths. We had the case in particular on the macOS CI where
the install PREFIX was a parent directory of the build directory and therefore
we were "fixing" some perfectly good constructed directories (set by meson) into
non-existing folder paths.

Additionally this codepath should only run when ENABLE_RELOCATABLE_RESOURCES is
set (even though this alone would not have fixed our CI issue because the macOS
build is relocatable).

Finally I am updating the gimp-data repository so that libraries are properly
found from the (now correct thanks to this commit) paths set by meson when
running gimp-console from within the build directory.
2024-03-28 00:19:10 +01:00
Jehan
8e7fc1d920 app: do not show the welcome dialog with the --no-interface option.
Fixes:

> (gimp-2.99:3763): GLib-CRITICAL **: 19:31:02.392: g_hash_table_size: assertion 'hash_table != NULL' failed
> GIMP-CRITICAL: gimp_translation_store_constructed: assertion 'lang_list != NULL' failed
2024-03-28 00:19:10 +01:00
Jehan
bde350fc28 app: fix CRITICAL when GIMP3_DIRECTORY env variable is set.
When the config directory is set by an environment variable, the version is
likely not part of the directory path, and therefore strstr() would return NULL.

Fixes:

> (gimp-console-2.99:41446): GLib-CRITICAL **: 13:19:34.933: g_vsnprintf: assertion 'n == 0 || string != NULL' failed
2024-03-28 00:19:10 +01:00
Jehan
4e274be6f3 Update INSTALL file and gimp-data submodule. 2024-03-28 00:19:10 +01:00
Jehan
c3840c63e8 build: gimp.ico now generated from the new icon. 2024-03-28 00:19:10 +01:00
Jehan
de7d0b3663 plug-ins: fix color mixup in "file-svg-load". 2024-03-28 00:19:10 +01:00
Jehan
4e3792d3f1 desktop: application icons are now generated from the new logo source SVG. 2024-03-28 00:19:10 +01:00
Jehan
42171503d4 data, plug-ins: logo images moved to gimp-data repository.
Now the development and stable logos will be generated from gimp-data.

In other changes, the gi-docgen logo is installed as a symlink using
install_symlink() which exists since meson 0.61.0 so I bumped our meson
dependency (in practice we were already using this function anyway and Debian
bookworm has meson 1.0.1 so it's all good).

Finally I don't install a wilber.png anymore, which was only used by script-fu
testing, and which was the same as gimp-logo.png (except 256x256 instead of
128x128). Unless mistaken, all script-fu tests loading this image still work
with the change. The only one where I needed further change was buffer.scm
(which was checking the dimensions).

See gimp-data@9aa6e35.
2024-03-28 00:19:10 +01:00
Jehan
4f9655573f build, gitlab-ci: update dependencies.
- With last commit, the Windows installer pipeline doesn't depend on
  "gimp-debian-x64" job anymore since a native Windows build is now able to run
  GIMP (or gimp-console) as a build-time tool as well. It makes the Windows
  installer pipeline (and full custom native builds) self-sufficient.
- On the other hand, "gimp-win-x64-cross" and "gimp-win-x86-cross" now require
  "gimp-debian-x64" since cross-compiling GIMP now requires a native GIMP in
  order to generate some image data (such as the splash image, and probably soon
  logo or icons, etc.). See gimp-data@5a03c71.
- Getting rid of "image-win-x64-cross" and "image-win-x86-cross" in favor of
  "image-debian-x64" for all Debian as well as the cross-compilation jobs. They
  are all based on the same Debian image (it was debian:bookworm for native
  Linux jobs and debian:testing for cross-builds; now it will be debian:bookwork
  for all) and it's just a few more packages (cross-compilation C and C++
  toolchains) for the cross-builds. Moreover now the cross-builds also need the
  native GIMP binary around, therefore native dependencies are needed as well.
  It makes sense to factorize all 3 images into 1.
- Make sure we don't build bindings when cross-compiling since these won't work
  in this case.
2024-03-28 00:19:10 +01:00
Jehan
530d8c6f9f app: fix running gimp or gimp-console as tool during build time on Windows.
This commit is in conjunction of gimp-data@d273a18 and finally makes Windows
build able to run GIMP main binary itself (or gimp-console) in order to create
various images, before the installation step.

- Use the new GIMP_TESTING_INTERPRETER_DIRS environment variable for uninstalled
  binary to find the .interp files (in particular because our build scripts are
  usually Python scripts these days).
- Use the new GIMP_TESTING_ENVIRON_DIRS environment variable to find .env files
  (actually running uninstalled GIMP binaries did run without this one, but it's
  not a bad idea to add support anyway.
2024-03-28 00:19:10 +01:00
Jehan
c6a6449dd0 app: swap ':' path separator to ';' on Windows.
The python.env file sets a ':' separator for GI_TYPELIB_PATH environment
variable, which breaks finding the correct typelib files in the CI, when also
manually setting a previous value for this environment variable.

I'm not entirely sure the rule of swapping ':' for ';' is universally true on
Windows, whichever the variable. Let's hope that it is.
2024-03-28 00:19:10 +01:00
Jehan
f6d4ebb286 libgimpbase: fix annotation.
Fixes:

> libgimpbase/gimpchoice.c:240: Warning: Gimp: gimp_choice_list_nicks: unknown parameter 'nick' in documentation comment
2024-03-28 00:19:10 +01:00
Jehan
fade73664e app, pdb: gimp_image_set_file() should accept compressed XCF variants. 2024-03-28 00:19:10 +01:00
Jehan
5fd29d7f9a libgimpbase: check EOF first. 2024-03-28 00:19:10 +01:00
Jehan
0b5b4173ab build, data: moving splash image to gimp-data repository.
- Splash images will now be stored from gimp-data.
- The installer BMP image scripts also move in the same time.
- We don't need devel and non-devel variants of the BMP images in InnoSetup
  scripts since the images are generated from the actual splash.
2024-03-28 00:19:10 +01:00
Jehan
dbb2f67e66 build: exit in error when ninja fails.
Not sure why it doesn't already since `set -e` stops the script immediately and
crossroad is supposed to pass the return value through.
2024-03-28 00:19:10 +01:00
Jehan
9d279a60ce meson: moving away from meson subprojects in favor of git submodules.
Meson subprojects just have too many problems and limitations and I can foresee
the maintenance headache and the future incoming false-positive bug reports if
we start using meson subprojects.

Comparing to the simplicity of git submodule which also has much better
notifications to help people understand when the submodule is not in sync and
how to remedy to it.

See commit gimp-data@c364adb explaining the main reasons in detail.
2024-03-28 00:19:10 +01:00
Jehan
1854e65667 build: use the icon file from the gimp-data subproject. 2024-03-28 00:19:10 +01:00
Jehan
67f5dd0df8 meson: pass the executable name to gimp-data to build gimp.ico.
Note that the executables are not built yet at this point, but we just need to
pass the name for configuration. The gimp.ico generation step is run manually
anyway and requires a fully functional and installed GIMP.

See commit gimp-data@40d4822.
2024-03-28 00:19:10 +01:00
Jehan
cbdd45723a data: moving brushes and patterns to gimp-data.
Symmetric removal commit of add commit gimp-data@c09aa01.
2024-03-28 00:19:10 +01:00
Jehan
2bda55fa9a meson: cursors are now hosted and installed from gimp-data too. 2024-03-28 00:19:10 +01:00
Jehan
008f7b5093 cursors: move all cursors to gimp-data repository.
This is the symmetrical removal commit of the add commit gimp-data@299204f.
2024-03-28 00:19:10 +01:00
Jehan
686897e35d meson: icons are now installed by making gimp-data a meson subproject.
This commit is separate from the previous to make it immediately clear (by
comparing files) that the previous commit is a simple move with no modification
whatsoever of the icons/ directory, i.e. the symmetrical removal of add commit
gimp-data@8b54490.

We now clone gimp-data as a meson subproject. I am currently testing the
subproject feature though I am doubting a bit because of its limitations: the
git clone is not updated automatically, nor are errors clear. Therefore it would
be easy to end up with outdated data for developers not manually and regularly
running:

> meson subprojects update

Worse, it looks like even when updating the suproject, it fails to be properly
reconfigured. See: https://github.com/mesonbuild/meson/issues/12898
2024-03-28 00:19:10 +01:00
Jehan
d57442eeeb icons: moved to gimp-data repository. 2024-03-28 00:19:10 +01:00
Bruno Lopes
85ed2847a6 gitlab-ci, build: Move to Clang in Flatpak (mostly)
In our efforts to use Clang, now the nightly (in fact weekly) flatpak
is built with Clang too, not only GIMP but also the dependencies.

* However, not aalib. We welcome fixes regarding this cursed lib.

Additionally, updated some build options from some deps.
2024-03-27 11:01:20 -03:00
Alx Sa
e4a4063f40 pdb: Fix selection offset bug in Plasma
Resolves #7672

The Plasma wrapper gets the boundaries
of its filter area using gimp_item_mask_intersect().
If used on a selection, this gives the x and y
coordinates relative to the total canvas.
However, the GEGL operation will be drawn
relative to the selection - so this offsets
the effect within the selection rather than
filling the full space.
This patch fixes the problem by setting
the x and y position to 0 when there is an
active selection.
2024-03-27 10:54:39 +00:00
Jordi Mas
f9a4d686a5 Update Catalan translation 2024-03-27 08:21:52 +01:00
Luming Zh
6293da2509 Update Chinese (China) translation 2024-03-27 03:07:01 +00:00
Luming Zh
21d36d1051 Update Chinese (China) translation 2024-03-27 03:03:45 +00:00
Luming Zh
a23bc85e66 Update Chinese (China) translation 2024-03-27 02:42:02 +00:00
Martin
e709f22359 Update Slovenian translation 2024-03-26 19:57:53 +00:00
Yuri Chornoivan
cebbec9d77 Update Ukrainian translation 2024-03-26 19:22:46 +00:00
Alx Sa
5fcee54d49 widgets: Prevent reordering actively edited layer effects
Layer effects that have not yet been committed are not
attached to the drawable. Trying to reorder them causes a
crash since they're required to be attached for undo/redo
purposes. This patch checks if they're committed beforehand,
and informs the user with a warning if it's not possible.
2024-03-26 16:58:34 +00:00
Alx Sa
5ce128a9fa libgimpwidgets: Allow colors to be dropped on ColorAreas
Post color space invasion, this function needed to read in
GeglColors directly rather than converting from GimpRGB.
2024-03-26 13:57:52 +00:00
Anders Jonsson
aaba366f0c plug-ins: avoid blinds crash by allowing MAX_FANS segments
In GIMP 2.10 the number of segments was restricted to MAX_FANS.
That was later changed to 1024 without increasing MAX_FANS
which can crash the plug-in.

Also change the max displacement angle back to 90 degrees. The interval
0 to 90 degrees is enough to return all possible values.

Fixes #11108
2024-03-25 21:50:34 +01:00
Bruno Lopes
8c3cce1737 build/windows: Remove redundant build options
These options are already auto set by babl and GEGL.
2024-03-25 15:55:34 +00:00
Marco Ciampa
6f7537b1fb Update Italian translation 2024-03-25 14:22:07 +00:00
Alx Sa
9bee3bed2a plug-ins, libgimpbase, text: Port border-average...
...to fully use and return GeglColor.
Also, fix gimptext-parasite sending a
GimpRGB to create a GimpText instead of
the now required GeglColor, and update
documentation in gimp_checks_get_colors
to reference GeglColor instead of GimpRGB.
2024-03-25 02:21:54 +00:00
Alx Sa
32c9a9a6cc plug-ins: Fix preview for Blinds GUI
Resolves #11092

Same fix as in 2b3b2af2, since Blinds and Jigsaw
were the two plug-ins which used GimpAspectPreview
before the port to GimpProcedureDialog.
2024-03-24 18:39:50 +00:00
Alx Sa
2b3b2af26d plug-ins: Fix preview for Jigsaw GUI
After the port to gimp_procedure_dialog_get_drawable_preview (),
the preview widget was being sized to the original drawable's dimensions
while the drawable was being redrawn with only its thumbnail dimensions.
This created a scrollbar that showed unallocated/overwritten buffers.

To fix, we update the preview size and boundaries whenever the preview
is changed. This removes the scrollbar and returns to 2.10 behavior.
2024-03-24 18:25:11 +00:00
Bruno Lopes
879cec8786 Issue #9999: Fix arbitrary headerbar height
The merged menu + title bar (headerbar mode) wasn't matching the height of
the title bar mode. This is inconsistent and, worse, ugly even in 768p.
2024-03-24 17:07:14 +00:00
Martin
d6d3451898 Update Slovenian translation 2024-03-24 16:09:00 +00:00
Yuri Chornoivan
94916bd596 Update Ukrainian translation 2024-03-24 14:58:45 +00:00
Alx Sa
d5c2585773 Issue #11098: Fix crash on saving PDF
Resolves #11098.
In f12687e9, a new parameter was put in the wrong order
in a call to draw_layer(). This caused a crash in
single layer PDF saves.
2024-03-24 13:56:42 +00:00
Rodrigo Lledó
b21cbf505d Update Spanish translation 2024-03-24 13:52:26 +00:00
Alx Sa
f12687e9f5 plug-ins: Port file-pdf-save-multi to GimpProcedureDialog
In addition to the port, mnemonics were added to both file-pdf-save-multi
and file-pdf-save's GUI parameters.
Some runtime warnings were also fixed, such as trying to use a NULL string
parameters to make a file and trying to access properties from file-pdf-save
that don't exist in file-pdf-save-multi.
2024-03-24 02:20:05 +00:00
Bruno Lopes
5de967aae9 gitlab-ci: Drop Windows resource .patch since MSYS2 now have LLVM 18 2024-03-23 20:07:54 -03:00
Alx Sa
ed1e8a62aa xcf: Set NDE filter visibility on load
The filter visibility setting was being loaded but
not actually used to set a filter invisible.
2024-03-23 21:31:20 +00:00
Jordi Mas
027a52bcae Update Catalan translation 2024-03-23 16:53:52 +01:00
Alx Sa
2e0d31b17e modules, core, pdb, plug-ins: GeglColor ports
More minor ports from GimpRGB to
GeglColor.
Note that file-mng's GimpRGB code was
already dummied out.
2024-03-23 07:16:02 -04:00
Alx Sa
db88383abb themes: Define no box-shadow on unselected tabs
As shown in a video for issue 11087, some system themes
may add a white box-shadow on the side of unselected
tabs. This patch forces box-shadow to "none" to prevent
this.
2024-03-22 16:27:55 +00:00
Rodrigo Lledó
9e0e56be95 Update Spanish translation 2024-03-22 15:10:31 +00:00
Marco Ciampa
b4895b0ff5 Updated Italian translation 2024-03-22 11:28:47 +01:00
Marco Ciampa
e0ee27f66f Updated Italian translation 2024-03-22 11:00:42 +01:00
Marco Ciampa
71c7d36009 Updated Italian translation 2024-03-22 10:06:14 +01:00
Alx Sa
fef2120dd3 xcf: Fix filter color saving bug
Resolves #11057
Per Idriss Fekir's research, data from GBytes
should be written before the GByte is freed.
Perhaps due to luck, the data persisted on
Windows but was freed too early on Linux.
This patch should resolve the issue.
2024-03-22 02:01:57 +00:00
Marco Ciampa
ec88bc40cc Updated Italian translation 2024-03-22 01:50:28 +01:00
Marco Ciampa
515f353737 Updated Italian translation 2024-03-22 01:47:09 +01:00
Ekaterine Papava
6f03b6934f Update Georgian translation 2024-03-21 23:33:27 +00:00
Ekaterine Papava
ba0646bdf3 Update Georgian translation 2024-03-21 23:27:36 +00:00
Alx Sa
3233aed0dc plug-ins: Fix Palette and Gradient functions
Resolves #11083

Per bootchk, changes in function calls to
palette_entry_get_color () and 
gradient_segment_get_left_color () were
broken in Python scripts due to GelColor
being used post Color Space Invasion.
This patch fixes the calls and returns.
2024-03-21 13:06:39 +00:00
bootchk
59b6c8fc8f ScriptFu: fix 11077: call gimp_ui_init in every run_func
More descriptive name for script-fu-interface-dialog

Delete SF flag for gimp_ui_init already called: gimp_ui_init can be called often.

FUTURE: might be faster to call just gegl_init when mode is non-interactive.
2024-03-20 11:35:48 +00:00
bootchk
fc310e0bed libgimpui: annotation of gimp_ui_init say it can be called often. 2024-03-20 11:35:48 +00:00
lillolollo
c72f91d69a remove extraneous parentheses 2024-03-20 10:27:07 +00:00
Yuri Chornoivan
d207fcde4a Update Ukrainian translation 2024-03-20 10:11:35 +00:00
Alx Sa
ef548fff65 widgets,modules,plug-ins: GeglColor ports
After the color space invasion, the
Clip Warning filter no longer had color
areas for its shadow, highlights, and
bogus color properties. This patch ports
them to GeglColor so the widget can be
created correctly.
GimpRGB structs are also converted to
GeglColor in GimpPanedBox and two
plug-ins.
2024-03-20 02:53:41 +00:00
Anders Jonsson
0bc99a29e1 Update Swedish translation 2024-03-19 22:02:36 +00:00
Anders Jonsson
188d00193a Update Swedish translation 2024-03-19 22:01:07 +00:00
Jehan
1158fc2119 app: make sure we just seek past unknown effect properties.
Otherwise we are not in a valid position anymore and further loading the XCF
fails. This may happen when updating a GEGL operation (in particular removing
effect properties, or renaming them).
2024-03-19 18:03:25 +01:00
Alx Sa
2b62976260 propgui: Port Color-To-Alpha GUI to GeglColor
The two threshold color pick buttons needed to have
a GeglColor parameter for their GimpPickerCallback
rather than a const GimpRGB.
This also fixes a crash caused by trying to free the GeglColor
rather than unreferencing it.
2024-03-19 14:32:14 +00:00
bootchk
2c664fac72 API PDB: resource-get-by-name return NULL instead of error
Without this, there is no easy way to quietly check for existence of a resource by name.
Needed when plugin authors can name defaults for resource args by name.

Add tests to script-fu/test/tests
2024-03-19 12:05:28 +00:00
Alx Sa
05af8c91c1 widgets: Minor GimpRGB to GeglColor ports
Mainly fixing GimpRGB comments and
parameters that are unused (or in unused
functions).
GimpCircle and GimpGradientChooser
have color conversions ported to use
GeglColor exclusively.
2024-03-19 04:40:14 +00:00
Jehan
f46c536ebb app: fix GEGL buffer leaks.
Since commit 10b96b1025, we had buffer leaks as soon as we ran filters.
gimp_drawable_get_buffer_with_effects() was either creating a new buffer (when a
drawable had filters) or not. And calling code couldn't know which is which.

Code needs to be consistent. Either we return a new reference to take ownership
to, or not. So let's change to add a new reference to the drawable' buffers so
that it always returns a new reference to free.
2024-03-18 22:08:03 +01:00
Martin
6e1cc909ce Update Slovenian translation 2024-03-18 17:23:46 +00:00
Marco Ciampa
256c795a10 Updated Italian translation 2024-03-18 12:52:50 +01:00
Jacob Boerema
0faa8f5460 plug-ins: fix #8453 Wrong order of layers in certain PSD files
So far, we did not consider that group layers could also be part of
a set of layers that have clipping set. This means that clipping groups
can be nested.

To support this we have completely rewritten the layer parser to detect
all clipping groups and mark them in a first pass. We now go through
the layers from the last (top) layer to the first (bottom) in this
first pass, because that makes it easier to detect the start/end
pairs of a clipping group.

In the second pass we handle the clipping groups first before adding
layers, except when a regular group is also the start of a clipping
group. In that case we need to handle the clipping after creating the
regular group, or we get an incorrect order.
2024-03-17 17:59:17 -04:00
Jacob Boerema
8a958d1568 plug-ins: refactor psd clipping group conversion into a ...
separate function
2024-03-17 17:59:17 -04:00
Jacob Boerema
f8b8ffa10e plug-ins: do not drop unsupported psd layers
Unsupported psd layers were dropped when loading psd images. This
causes problems when handling psd clipping groups, see issue #8453.

PSP also does not drop unsupported layers, so let's keep the layers
and accept that they will usually show up empty. This will help in
fixing clipping groups in a next step.

While we are at it, also remove the warnings that are only shown when
define CONVERSION_WARNINGS is TRUE (defaults to FALSE). We already
have a better way to show unsupported features, so at least for the
unsupported layers it is not needed anymore.
There are still some CONVERSION_WARNINGS warnings left over in the
blend modes conversion, which do not have a similar warning in our
unsupported features dialog.
2024-03-17 17:59:17 -04:00
Andi Chandler
f7c42b3bbf Update British English translation
(cherry picked from commit 4733819167)
2024-03-17 20:35:33 +00:00
Alx Sa
28b236b578 libgimpbase: Replace GimpRGB in gimpchecks
Converted to gdouble[] and updated in all 
calls to the enums in gegl_color_set_pixel()
2024-03-17 16:19:25 +00:00
Bruno Lopes
c2d8d6c45c .gitlab: Improve Feature request template
* Makes the wording more concise and "first contributor-friendly"
+ Adds info about submitting patches
* Makes the explanation of use cases implicitly mandatory
+ Adds discuss info to facilitate the redation of use cases
2024-03-16 20:25:03 +00:00
Bruno Lopes
9691665d52 gitlab-ci: Update jobs order
Following 5542748779
2024-03-16 15:38:51 -03:00
Rodrigo Lledó
5581b0b8b8 Update Spanish translation 2024-03-16 16:25:43 +00:00
Rodrigo Lledó
c0e7aebc8d Update Spanish translation 2024-03-16 16:22:49 +00:00
Rodrigo Lledó
cf97007ba8 Update Spanish translation 2024-03-16 16:15:08 +00:00
Rodrigo Lledó
1abcc8100c Update Spanish translation 2024-03-16 16:05:27 +00:00
Rodrigo Lledó
24062b9e50 Update Spanish translation 2024-03-16 16:01:18 +00:00
Bruno Lopes
e61b7e05ed build/windows: Port Installer script to .ps1
This commit unites two scripts (.sh + .bat) in one .ps1. PS was choosed, since:
1) We don't need MSYS2 to distribute with Inno at first. Now, who wants to
   just distribute GIMP can do it easier natively without a separate environ.
2) PS is actually pretty solid and have a good number of cmdlets, unlike the
   ancient CMD, which barely supported more than 9 parameters in .bat files.
   Consequently, some redundant variable checks have been removed from the .ISS.

Also, changes the name of the job and script for better consistency with the
upcoming MS Store job.
2024-03-16 15:24:45 +00:00
Rodrigo Lledó
d92ed3e496 Update Spanish translation 2024-03-16 14:48:24 +00:00
Bruno Lopes
a4e94d86ea Issue #8209: Don't install unselected components 2024-03-16 00:13:44 +00:00
Jürgen Benvenuti
5af2607525 Update German translation 2024-03-15 23:28:43 +00:00
Andi Chandler
3acedc30cf Update British English translation 2024-03-15 18:28:24 +00:00
Bruno Lopes
e89bca35c7 gitlab-ci, build: Move to Clang in Windows (native)
This makes possible to use the Universal C library provided by Microsoft.
2024-03-15 17:08:31 +00:00
Bruno Lopes
5542748779 gitlab-ci: Move to Clang in Debian
This makes the GEGL code execution a bit faster in Linux.
2024-03-15 17:08:31 +00:00
Jehan
c4d5f67388 Issue #11048: simplify the previous fix.
Though commit a14caafa8c was not wrong per-se, it's a bit too much. ;-)

Functions like g_ascii_dtostr() already exists for this very purpose of
converting a double/float to string in a locale-independent format.
2024-03-15 15:33:21 +01:00
Sabri Ünal
b8a9a1e9e9 Update Turkish translation 2024-03-15 13:38:40 +00:00
Sabri Ünal
f51c340c97 Update Turkish translation 2024-03-15 13:13:16 +00:00
Sabri Ünal
4bf425e188 Update Turkish translation 2024-03-15 13:12:11 +00:00
Sabri Ünal
1ca303132d Update Turkish translation 2024-03-15 13:12:05 +00:00
Sabri Ünal
14fc21d192 Update Turkish translation 2024-03-15 13:11:05 +00:00
Alx Sa
a14caafa8c gui: Prevent localization issues with font-size
CSS breaks when given a number with a comma as the radix
instead of a decimal. Depending on the system localization,
printf () may return numbers in this format when resizing
the font. This causes the theme to break unless font size is
set to 100.
To prevent this issue, we create the font size string manually
using integer division and mod operations.
2024-03-15 12:40:01 +00:00
Martin
7e58a00a74 Update Slovenian translation 2024-03-15 08:44:22 +00:00
Martin
3f6e3021da Update Slovenian translation 2024-03-15 08:36:08 +00:00
Jehan
11539e6d74 NEWS: update. 2024-03-15 02:48:51 +01:00
Yuri Chornoivan
4718645a0a Update Ukrainian translation 2024-03-14 18:30:15 +00:00
Yuri Chornoivan
02649e3d65 Update Ukrainian translation 2024-03-14 18:26:51 +00:00
Alx Sa
3767e1032d libgimpwidgets: Port GimpCellRendererColor...
...to use GeglColor rather than GimpRGB.
Also update the ColorHexEntry,
DynamicsOutputEditor, and the
colormap-remap plug-in which uses this
widget.
2024-03-14 00:40:02 -04:00
Alx Sa
917506d16e libgimp, dialogs, plug-ins: Minor fixes
- Replaces GimpRGB in Channel Dialog
with gdouble array, as was done in
channel_options_color_changed ()
- Replace %ld with G_GSIZE_FORMAT
in libgimp checkboard color message to
fix warning in Windows build
- Set file-gih documentation text as
translatable.
2024-03-14 01:41:31 +00:00
Jehan
4f14e89ed9 app: move the "Show on Start" checkbox inside "Create" tab.
I think I may even have been the one who suggested to make this checkbox always
visible, but after more thought and usage, I just realize that this option is
not about showing the Welcome dialog, but about showing the Create tab of the
Welcome dialog. So I move it to the Create tab.

A very obvious case where the previous option location could have been
considered wrong is that we will always show the dialog (on the "Welcome" tab)
for updates, even if this checkbox had been unchecked. So if we left it as a
global option of the dialog, this could be considered a bug (the option is
disabled, but the dialog still opens on updates), whereas the new position and
shortened label make it clearer that this settings only apply to whether or not
we show specifically the Create dialog on start.
2024-03-14 00:39:14 +01:00
Jehan
3b261e3b31 app: render the splash in Welcome dialog with no window background showing on the sides.
I think it's much prettier with no part of the window showing up on the left and
right sides.
2024-03-14 00:39:14 +01:00
Jehan
e93f35a521 app: do not waste that much space in the welcome dialog.
The splash image had a lot of empty space around it. From what I understood,
this is because we want to avoid it to be too big because it makes the dialog
overgrow the display size on small screens. But I don't think that was a very
good idea. We should find better ways to save space.
2024-03-14 00:39:14 +01:00
Anders Jonsson
c6cbb100d9 Update Swedish translation 2024-03-13 20:34:58 +00:00
Yuri Chornoivan
8952bf0e1d Update Ukrainian translation 2024-03-13 19:56:19 +00:00
Yuri Chornoivan
8b707e7271 Update Ukrainian translation 2024-03-13 19:48:44 +00:00
Alx Sa
234fa0e820 xcf: Save color profile for NDE filters
In d055564d, a pointer to the color profile
for NDE filter color properties was being
saved rather than the actual ICC profile.
This patch fixes the issue.
It also allows colors to load even if the
color profile is corrupted, with a warning.
2024-03-13 01:44:23 +00:00
lillolollo
dde1e5a054 App/core; Fix Critical floating object 2024-03-12 21:02:33 +00:00
Ekaterine Papava
33eca64697 Update Georgian translation 2024-03-12 17:54:16 +00:00
Alx Sa
86f62e8330 plug-ins: Replace GimpHSV in colormap-remap
Per bbb30eac, the GimpHSV object is replaced with
gegl_color_get_pixel () in "HSV double" color format.
GimpCellRendererColor still needs to be updated to
accept GeglColor rather than GimpRGB.
2024-03-12 16:01:52 +00:00
Stanislav Grinkov
bbb30eacfb plug-ins: Rewrite colormap-remap plugin
This commit fixes several issues with the plugin.

* Move plug-in to GimpProcedureDialog framework (see #9250)
* Use GimpPalette instead of (soon to be deprecated) Colormap (see #9477)
* Make plugin UI height, make it resizeable, update font sizes,
  paddings, etc (see #10533)

Further improvements most likely are needed because plugin still uses
GimpRGB and GimpHSV (former is used by GimpCellRendererColor, latter for
H, S, and V values)

Resolves: https://gitlab.gnome.org/GNOME/gimp/-/issues/10533
Resolves: https://gitlab.gnome.org/GNOME/gimp/-/issues/10749
2024-03-12 20:13:09 +05:00
Alx Sa
f39af05a48 devel-docs: Replace Gimp.RGB with Gegl.Color
Updating Python plug-in developer
instructions to use Gegl.Color instead of
Gimp.RGB.
2024-03-12 14:51:20 +00:00
Alx Sa
85bb1790b7 plug-ins: Restore GIH parameters from file
During the GimpProcedureConfigDialog port,
the "gimp-brush-pipe-parameters" parasite loading
code was unintentionally removed. This parasite
was used to restore the GIH parameters if it was
loaded as an image.
This patch restores that code on initial export as
GIH, then removes the parasite since the parameters
will be saved as part of the GimpProcedureConfig
going forward.
2024-03-11 18:37:28 +00:00
Jehan
7f35729c1e Issue #5342: Export to 16-bit PNG incorrectly sets background color to 8-bit. 2024-03-11 18:31:06 +01:00
bootchk
7a48cdccb4 ScriptFu: translations: Skip translating test script test-v3.scm 2024-03-11 11:14:36 -04:00
Sabri Ünal
98ef0c7adb Update Turkish translation 2024-03-11 14:41:25 +00:00
Sabri Ünal
e8b963a14b Update Turkish translation 2024-03-11 14:41:15 +00:00
Sabri Ünal
a34cf018ab Update Turkish translation 2024-03-11 14:39:40 +00:00
Jehan
9816d9a0bd build: sync with beta flatpak.
Update various dependencies.
2024-03-11 03:45:02 +01:00
Anders Jonsson
d4db1aa42c Update POTFILES.in
Followup to 0d512085f3
2024-03-10 21:19:22 +01:00
Rūdolfs Mazurs
4401ddfc20 Update Latvian translation 2024-03-10 15:48:06 +00:00
Ekaterine Papava
9d515f24e7 Update Georgian translation 2024-03-10 14:53:12 +00:00
Ekaterine Papava
6e4d78f91f Update Georgian translation 2024-03-10 14:51:00 +00:00
Ekaterine Papava
9203ff336c Update Georgian translation 2024-03-10 14:49:31 +00:00
Andre Klapper
f59f8a3df2 Save gradient as CSS: Remove outdated vendor-prefixed CSS extensions 2024-03-09 22:10:30 +00:00
bootchk
98bf051e7a Fix #10044 more natural binding of PDB return values
Allow (script-fu-use-v3) in script, or in SF Console.

Definitive description is in script-fu/docs/using-v3-binding.md

Makes SF interpret v3 of SF dialect.
  - marshals single return value from PDB without wrapping in list
  - marshals boolean return value from PDB as #t #f instead of integers
  - marshals boolean to PDB from #t and #f or TRUE and FALSE
  - marshals void return from PDB as () instead of (#t), but that is moot.

The version of SF dialect is distinct from the version of the PDB API.

Dialect v3 is opt-in: the initial dialect of all SF tools remains v2.

Commit also allows #t,#f for defaults of SF-TOGGLE instead of TRUE, FALSE
but that is an independent enhancement (but closely related.)

Affects interpreter state of the current process.
Not an attribute per se of a plugin.
While in this state, a plugin should not call PDB procedures
which are themselves v2 script plugins,
or a few utility scripts in script-fu-util.scm,
but that is rarely needed.

Does not remove symbols TRUE and FALSE from dialect.

A script can also call (script-fu-use-v2) to revert.
That is also discouraged but useful e.g. for testing.
2024-03-09 07:21:50 -05:00
Alx Sa
d4af93b256 libgimpcolor: Fix CAIRO_FORMAT_RGB96F babl format
As noted by Idriss, this should most likely be R'G'B' instead.
2024-03-08 20:56:32 +00:00
Anders Jonsson
b0cec7c771 Update Swedish translation 2024-03-08 19:53:48 +00:00
Anders Jonsson
0d512085f3 menus: move menus to submenus of tab menu
Fixes #9883

    There were menus that put their entries
    directly in the tab menu rather than in a submenu.

    This moves them to submenus to bring back GIMP 2.10 behavior.

    Stray entries added by scripts are also moved to the right
    submenu.
2024-03-08 17:48:38 +00:00
Kamil Burda
08c1fdc719 plug-ins: Replace guchar PDB parameters with more appropriate types
For improved readability, int or boolean types are used in place of
guchar for PDB parameters where the parameter description better fits
one or the other type.

This change affects `plug-in-alienmap2` and `plug-in-maze`.

Also, the problem with `guchar` parameters is that they currently cannot
 be modified via `GimpProcedureConfig` due to the type not being
supported.
2024-03-08 14:08:05 +00:00
cheesequake
905e8777a7 Fixes #11000: Cut now clears out the selection properly 2024-03-08 14:01:07 +00:00
bootchk
b854db9666 ScriptFu: fix #11013 ts-hello-world.scm crashes at query time
Call gimp_ui_init during query phase as well as run phase.

Maybe gimp_main() should do this.

Since space invasion from GimpRGB to GeglColor,
plugins that declare defaults for formal args of type GeglColor
need babl and gegl at plugin registration time.
2024-03-08 08:16:20 -05:00
bootchk
a2f01ff5f1 Test: add color/pixel related tests
Add more tests of selection by shape

Add test! statement to the test framework.
2024-03-08 11:49:38 +00:00
Bruno Lopes
3c129a79d5 build: Drop 'docker' draft folder
The 'Docker' draft of GIMP was introduced in 09/04/2017 and then died ONE day
after, mostly because of "bad" timing (few years later we moved to GitLab CI).

Similar (in fact, even worse) than 'jhbuild' folder, update it to keep the
current development status is so hard that it is equal to do it from scratch.
So it is reasonable to delete it anyway.
2024-03-08 10:15:29 +00:00
Yuri Chornoivan
d3e37fa538 Update Ukrainian translation 2024-03-07 21:39:09 +00:00
Philipp Kiemle
5460687766 Update German translation 2024-03-07 21:24:22 +00:00
Martin
aef14ef721 Update Slovenian translation 2024-03-07 18:41:09 +00:00
Martin
7d46e0c6b4 Update Slovenian translation 2024-03-07 18:31:24 +00:00
Martin
52c5869cae Update Slovenian translation 2024-03-07 18:30:11 +00:00
Martin
9fd37c82b3 Update Slovenian translation 2024-03-07 18:27:52 +00:00
Martin
4065f3fba4 Update Slovenian translation 2024-03-07 18:25:10 +00:00
Jacob Boerema
4bf2c1e1ba plug-ins: fix #10903 Missing metadata in OpenEXR images from darktable
Due to changes in our metadata handling API for plug-ins, the exif and
xmp metadata read from exr images was being overwritten by empty
metadata.

Fix this by following the new API and also add messages when loading
metadata fails. That way it will be easier to catch in the future if
metadata loading gets broken again.
2024-03-07 13:12:08 -05:00
Jacob Boerema
0585bc11d4 plug-ins: fix incorrect size when comparing jpeg exif marker in EXR loader
When defining jpeg_exr a closing \0 is automatically added by the
compiler. So when we compare it using sizeof, we do not compare
6 bytes but 7. Since there won't be three 0's, this will fail.

Fix this by reducing the size by 1 and also update the comment to
make this clear and further to add that this was changed after
darktable 4.0.0.
2024-03-07 13:12:08 -05:00
Jacob Boerema
f00ad15b7b libgimpbase: fix loading exif data from buffer
gimp_metadata_set_from_exif has special code for handling old-style
GIMP exif parasite data, but didn't check for the more common case
of loading exif data from image formats that can't be handled by exiv2.

The exif data in these formats usually start with the TIFF endian
markers instead of "Exif", which caused a failure to read this
metadata for e.g. EXR images, see issue #10903.

We change this function to check for "Exif" at the start of the data,
in which case we assume it to be the old-style exif parasite and in
that case add extra metadata as was previously always done.

In all other cases, we do not add extra metadata.
2024-03-07 13:12:08 -05:00
Kolbjørn Stuestøl
0c6c3d5347 Update Norwegian Nynorsk translation 2024-03-07 15:51:52 +00:00
Kolbjørn Stuestøl
7a5fd3120f Update Norwegian Nynorsk translation 2024-03-07 15:30:50 +00:00
Yuri Chornoivan
06fa6bad89 Update Ukrainian translation 2024-03-07 14:20:26 +00:00
Bruno Lopes
b51e0bc464 build/windows: Update some Installer strings
- Remove obsolete GtkWimp and Compat strings
* Update 32-bit string
2024-03-07 10:42:34 +00:00
Bruno Lopes
a0512f5aae build/windows: Clean *gimp3264.iss regarding 2.0 series InstallDelete
These files are not deleted when the Unstable (GIMP 2.99) or Stable (GIMP 3)
version are installed because the root is different. So, they can be removed.
2024-03-07 10:08:34 +00:00
Sabri Ünal
bc6252dcdf Update Turkish translation 2024-03-07 09:24:32 +00:00
Sabri Ünal
e0853f9141 Update Turkish translation 2024-03-07 09:24:28 +00:00
Alx Sa
63ea1e2b5f plug-ins: Get monitor after screenshot dialogue
Resolves #11004

During the port to GimpProcedureDialog, the code
that assigned the current monitor object for
Windows and MacOS was accidentally removed.
This patch restores this code in the proper place.
2024-03-07 03:14:48 +00:00
Alx Sa
69314ba087 tools: Add NDE support for group layers
This patch allows NDE filters to be
applied to group layers as well.
The "merge down" function is disabled.
2024-03-06 22:04:28 +00:00
bootchk
71b41c68c2 ScriptFu: fix #11010 unhandled return type GimpColorArray
Add a case to the marshalling of return types from the PDB,
for the new type GimpColorArray.

test case is gimp-palette-get-colors in tests palette.scm
2024-03-06 14:48:41 -05:00
bootchk
4c16b20d69 2.99 Tests: add more tests
Add tests of Drawable.
2024-03-06 10:45:44 -05:00
bootchk
279341a237 ScriptFu: fix #11001
At script create time, create a GimpRGB i.e. pixel from the declared name of default color.

At plugin procedure registration time, convert that pixel to GeglColor,
and use that color to declare the color arg using GeglParamSpecColor(default=color)

Fixes a faulty fix a few commits back where we lost the declared color name.
The proper dataflow is  name->color->paramspec-with-default-color.
2024-03-06 09:55:38 -05:00
bootchk
f7c876dfd3 2.99 ScriptFu: refactor, extract methods of color and resource
Extract methods related to color into new file.
So method names document what is being done.
So related code is together.

Ditto for resource.

No functional change.

Preparing for changes to reset/default and changes to representation of pixels
in lists of differing lengths rgb vs rgba.
2024-03-06 08:07:11 -05:00
Idriss Fekir
0f32312e26 widgets: Fix error on text color selection
Resolves #11003

GeglColor defaults to NULL rather than black like
GimpRGB. When selecting text with two or more colors
in the total selection, this causes NULL to be passed
to gimp_color_button_set_color () which throws an error.
This patch resolves the issue by setting GeglColor to
black if it's NULL before the call.
2024-03-06 06:37:13 -05:00
Yuri Chornoivan
a905208873 Update Ukrainian translation 2024-03-05 20:09:50 +00:00
Alx Sa
0c26cd442a operations: Port semi-flatten to GeglColor
After the color space invasion, the
Semi-Flatten GUI was broken since it still
used GimpRGB as its color property.
This patch fixes this by porting to
GeglColor. The GimpRGB conversion was
also removed from the PDB interface
since the GeglColor comes directly from
GimpContext.
2024-03-05 18:30:53 +00:00
Rodrigo Lledó
29cac9eaef Update Spanish translation 2024-03-05 12:35:40 +00:00
Rodrigo Lledó
98894383dd Update Spanish translation 2024-03-05 12:06:13 +00:00
Luming Zh
c7b6444543 Update Chinese (China) translation 2024-03-05 08:52:42 +00:00
Alx Sa
625b74ea00 pdb: Update text-layer-set-color to GeglColor
Resolves #10992.

GimpTextLayer's color attribute was
updated from GimpRGB to GeglColor,
but gimp-text-layer-set-color still passed
in GimpRGB. This patch updates the PDB
call to match the property type.
2024-03-05 01:42:22 +00:00
cheesequake
1a76346ed5 Fixes:#10933 context swatch crash issue 2024-03-04 21:10:36 +00:00
Jacob Boerema
a22a2a5b15 plug-ins: fix overwriting a GError in PCX loader
In the previous commit I overlooked one other case where the GError
can be overwritten. Fix this by using g_prefix_error.
2024-03-04 15:53:06 -05:00
bootchk
b2af8b6c2c ScriptFu fix #10982 broken build, and spurious CRITICAL
Fixes errors introduced by my prior commit c0ca0b74

1. SF is storing colors in GimpRGB, not GeglColor.
Storing using wrong pointer type seemed to work, but would not build on newer compilers.

2. spurious error message "CRITICAL....Two different plugins tried to register..."
Due to calling gimp_ui_init too early, in the class instance init.
2024-03-04 17:21:17 +00:00
Jacob Boerema
4cb6ee45a1 plug-ins: fix double free when loading invalid PCX image
When testing on Debian with acertain invalid PCX imagea that return
"Invalid number of bytes per line in PCX header", we get an error:
free(): double free detected in tcache 2
On Windows this doesn't cause an error, most likely due to a different
implementation of fclose.

The problem is that in case of errors fclose was called twice. Since
the file is opened outside the load_image functions, let's handle
closing also only outside that function.

In addition to that, change all g_message error notices to use
g_set_error instead, that way we always return a GError in case of an
error.

Further we also fix a possible error case of overwriting an existing
error by using g_prefix_error when the error is already set.
2024-03-04 11:32:42 -05:00
Alx Sa
2f94edfe8c tools: Switch to GeglColorButton for mask-color
Resolves #10990.

Since the "mask-color" property is now a GeglColor,
we need to use gimp_prop_gegl_color_button_new ()
rather than gimp_prop_color_button_new () to
display it in the options panel.
2024-03-04 12:17:26 +00:00
Emin Tufan Çetin
fa5373d99a Update Turkish translation 2024-03-04 01:11:02 +00:00
Alx Sa
d055564d26 xcf: Save/Load color property for NDE filters 2024-03-03 21:07:37 +00:00
Yuri Chornoivan
387503507c Update Ukrainian translation 2024-03-03 19:10:28 +00:00
Martin
d9c33636a3 Update Slovenian translation 2024-03-03 16:25:45 +00:00
Anders Jonsson
97e19ff931 plug-ins: mark xmc tooltips as translatable 2024-03-03 11:25:19 +01:00
Luming Zh
e0dab4172f Update Chinese (China) translation 2024-03-03 08:48:31 +00:00
Alx Sa
3b37ab4fb2 plug-ins: Convert GIFs to 8 bit on export
During the sanity_check (), we verify an image is 8 bit
before exporting as a GIF. If it isn't, we try to convert
and notify the user.
2024-03-02 20:41:14 -05:00
Martin
b639c05a05 Update Slovenian translation 2024-03-02 21:29:23 +00:00
Martin
d7a783823c Update Slovenian translation 2024-03-02 21:25:06 +00:00
Martin
80a0d76933 Update Slovenian translation 2024-03-02 21:22:47 +00:00
Martin
51d1a4f1cc Update Slovenian translation 2024-03-02 21:15:25 +00:00
Martin
753c7ba2c5 Update Slovenian translation 2024-03-02 21:12:37 +00:00
Balázs Úr
967e352d7a Update Hungarian translation 2024-03-02 19:44:42 +00:00
Bruno Lopes
683c6a3063 Issue #10960: Make disabled checkboxes less confusing 2024-03-02 12:59:33 -03:00
Balázs Meskó
6d7a67fb45 Update Hungarian translation 2024-03-02 10:06:00 +00:00
Alx Sa
a16219bf4b dialogs: Fix buttons missing their style class
Per @brunolopesdsilv, the About and Quit
dialogues had custom buttons which did
not receive the text-button CSS style.
This patch adds those back so the buttons
match the styling of the others in the
dialogue.
2024-03-02 03:55:08 +00:00
Yuri Chornoivan
823ab560c6 Update Ukrainian translation 2024-03-01 21:42:23 +00:00
Jacob Boerema
9626ad6803 plug-ins: fix crash when loading pcx image where bytesperline is 0
Previous pcx commit da217088d0 fixed
loading pcx images that had an off by one value for bytesperline.
However, it did not take into account that a value of 0 would be
invalid, causing a crash.

We fix this by adding a check for 0 and also failing in that case.
2024-03-01 13:24:49 -05:00
bootchk
c0ca0b74a9 2.99 ScriptFu: #10958 Missing color widgets in v3 dialogs
Since PDB now traffics in GeglColor instead of GimpRGB.

Change GimpParamSpecRGB to GeglParamSpecColor when declaring args to procedure.
Declared default is temporarily "black".

Change conversion of gvalue to scheme representation, now from GeglColor.

Incidental change to interpreter to init gegl early,
since now needed during registration phase.
2024-03-01 09:54:06 -05:00
Luming Zh
b4110ec3b2 Update Chinese (China) translation 2024-03-01 10:46:48 +00:00
Jehan
0b87030928 Issue #10776: Hide "Edit > Manage Extensions" for the release.
The extension format's official release is pushed for after GIMP 3 release.
Let's not leave this dialog around as it would confuse people.
2024-03-01 00:51:22 +01:00
Jehan
978a16d2e5 Issue #573: rename "Truncate" repeat type to "None (truncate)" and reorder the enum.
This commit is based on a patch submitted by Kiyotaka NISHIBORI many years ago.
2024-03-01 00:33:28 +01:00
Jordi Mas
e7575f63e2 Update Catalan translation 2024-02-29 20:18:47 +01:00
Jehan
4e7cc4afea Issue #10795: "(null)" tooltip on some tab menu items. 2024-02-29 19:07:48 +01:00
Jehan
baae7287be libgimp: allow to run gimp_procedure_run_config() with no config object.
This is the equivalent to run the procedure with its defaults.
2024-02-29 16:33:32 +01:00
Jehan
01cdf777a6 libgimp: add C tests to the libgimp testing infrastructure.
Most of the C boiler-plate code is generated so that all you have to do is
implement the run() function with test code in it.

Also adding a README to make it all very clear and easy to add new tests.
2024-02-29 16:19:49 +01:00
Jehan
bf0b774261 libgimp: gimp_pdb_lookup_procedure() returns NULL if procedure doesn't exist.
Right now, it was always returning a GimpProcedure even if the PDB procedure
didn't exist (the GimpProcedure was therefore invalid).
2024-02-29 14:13:21 +01:00
Jehan
237015dc69 libgimpbase: workaround needed to write ampersand in g-ir-docs.
Fixes:

> [2636/2644] Generating devel-docs/g-ir-docs/g-ir-Gimp-python-cache with a custom command
> file:///builds/GNOME/gimp/_build-x64/meson-private/dist-build/devel-docs/g-ir-docs/pages/python/Gimp-3.0/Gimp.ColorArray.page:22: parser error : EntityRef: expecting ';'
> NULL);</p>  <p>GeglColors **colors;</p>  <p>g_object_get (obj, "colors", &colors
>                                                                                ^
2024-02-29 12:52:26 +01:00
Jehan
7b43a7492f libgimp: new unit testing framework for libgimp.
With Python binding, it gets very easy to test new functions. I've been
wondering if we need C counterparts, but really since it's a GObject
Introspection binding, if a function succeeds there, it should also succeed in C
code.

For now, I'm testing a few of GimpPalette API. Not all of it yet. Also I test
both the direct C binding and PDB procedure since in some cases, one or the
other may not properly working. See #10885.
2024-02-28 22:55:58 +01:00
Jehan
3f79f3589d Issue #10885: gimp-palette-get-colors warning and critical when…
… accessed from Python.

Creating a new function gimp_value_array_get_color_array(). This should normally
not be needed (it isn't in C), but because of GObject Introspection limitation
and the fact that pygobject will automatically try to convert GValue to the
embedded value, we get this weird situation where the result is unusable in
Python for certain types. One of these types is GimpColorArray.

I suggest an annotation request to GObject Introspection:
https://gitlab.gnome.org/GNOME/gobject-introspection/-/issues/492

I think that with such annotation, followed as a second step by pygobject
support, correctly handling NULL terminated C arrays generically should be
feasible by bindings.
2024-02-28 22:55:58 +01:00
Jehan
d6a134e6c1 plug-ins: import Babl and Gegl modules in python-eval plug-in.
This makes it easier to run babl and GEGL code directly through the command line
or script files.
2024-02-28 22:55:58 +01:00
Jordi Mas
84c0584aea Update Catalan translation 2024-02-28 22:15:11 +01:00
Alx Sa
10b96b1025 core: Show preview with NDE filters
Resolves #10762.

Updates gimpdrawable-preview.c to use
gimp_drawable_get_buffer_with_effects (),
which includes any NDE Filters applied to
the layer in the preview.
The preview is also set to update when a
filter is applied non-destructively.
2024-02-28 11:34:31 +00:00
Alfred Wingate
46a1580018 libgimpbase libgimpwidgets: install needed headers
* These headers weren't installed despite being included by other
  installed headers.

Bug: https://gitlab.gnome.org/GNOME/gimp/-/issues/10132
Bug: https://bugs.gentoo.org/920535
Signed-off-by: Alfred Wingate <parona@protonmail.com>
2024-02-28 05:53:54 +00:00
Ekaterine Papava
71329f106b Update Georgian translation 2024-02-28 04:56:58 +00:00
Ekaterine Papava
ba0dc0474b Update Georgian translation 2024-02-28 04:52:47 +00:00
Jehan
71d03d5828 Issue #10885: gimp-palette-get-colors warning and critical.
We were missing GimpColorArray support in one function. Note that the specific
example in Python in #10885 still doesn't work, but for a second reason:
gimp_value_array_index() returns a GValue which pygobject automatically tries to
transform to the contained data. And unfortunately it doesn't know about our
GimpColorArray type so we end with unusable boxed type generic data.
2024-02-27 22:46:48 +01:00
Jehan
d9c440614b Issue #10899: Image Recovery and Welcome dialog conflicting with each other.
Since the Image Recovery dialog is blocking the main process (and requires an
answer to be done first), let's simply move down the Welcome dialog to after
this answer was given. This way, we simply won't have both dialogs in the same
time.
2024-02-27 18:06:50 +01:00
Jordi Mas
920efa45b2 Update Catalan translation 2024-02-27 16:31:55 +01:00
Jehan
eacb3ebf82 app, libgimp, pdb: gimp_layer_new() allows a NULL name.
Our core code allows a NULL name, so there is no reason not to. We just have to
explain the rules (basically: you don't choose the name!).
2024-02-26 23:19:55 +01:00
Jehan
a1b7b4dedd plug-ins: "file-ico-save" procedure doesn't care about hot spots.
Hot spot coordinates are only for cursors.
2024-02-26 23:19:42 +01:00
Asier Sarasua Garmendia
ba686fcd17 Update Basque translation 2024-02-26 20:30:24 +00:00
Asier Sarasua Garmendia
34ce526b07 Update Basque translation 2024-02-26 20:30:19 +00:00
Asier Sarasua Garmendia
87109d19fa Update Basque translation 2024-02-26 20:29:38 +00:00
Asier Sarasua Garmendia
abe97ecf20 Update Basque translation 2024-02-26 20:29:27 +00:00
Jordi Mas
a866f27cf3 Update Catalan translation 2024-02-26 21:23:52 +01:00
Jehan
341ab7212b build: remove a LLVM patch.
It was only used for the gimp-win-a64 job and was coming from MSYS2 repository
which already dropped it:
a98352b2ba

The first patch is still needed as the upstream fix is meant to appear in clang
18 according to bug report, yet our CI still uses clang 17.0.6. See:
https://github.com/llvm/llvm-project/issues/51286
2024-02-26 19:56:53 +00:00
Christian Kirbach
4338f0026c Update German translation 2024-02-26 19:56:18 +00:00
Alx Sa
8686e3f542 themes: Remove deprecated GtkPaned style
Resolves #10934.

GtkPaned's handle-size attribute has been deprecated.
Since we have our own custom paned separator, it is not
needed anyway.
2024-02-26 18:08:46 +00:00
Luming Zh
ac0333d8ec Update Chinese (China) translation 2024-02-25 22:39:38 +00:00
Luming Zh
7f41cdc599 Update Chinese (China) translation 2024-02-25 22:38:20 +00:00
Luming Zh
aabb1a4031 Update Chinese (China) translation 2024-02-25 22:38:11 +00:00
Alx Sa
7e6dc23ac1 plug-ins: Fix Foggify color property
Since the color space invasion, GimpRGB
properties do not create widgets anymore.
For Python plug-ins, we need to add
GeglColor properties as GObjects with
GeglColor value types as a workaround.
This patch does this and updates the
Foggify plug-in with the new datatype.
2024-02-25 20:14:13 +00:00
Asier Sarasua Garmendia
705fbebc55 Update Basque translation 2024-02-25 20:10:32 +00:00
Asier Sarasua Garmendia
a97a047cbd Update Basque translation 2024-02-25 20:09:20 +00:00
Bruno Lopes
98d6542745 build/windows: Fix iso-codes correctly
This fix only applies to local builds. iso-codes warning was fixed again
with proper option indicated by Jehan.
2024-02-25 15:15:16 +00:00
Jehan
d1508cdebe data: remove various historical images.
It is quite obvious that these were all kept around for the fun historical
background. And even though we can always get these back anytime through git
archeology, if these images disappear from our sight, we will just eventually
forget they even existed.

We now have a `gimp-data` repository for all data used and installed by GIMP. I
am not going to add these over there since it would go against the whole purpose
of splitting the source repository (we have too much data so we will want to
clone `gimp-data` as shallow so that it will only contain the necessary data to
install GIMP).
Yet I have created a page to reference and display all these original images
(and more! I spent quite some time researching old splashes and logos in our dev
log) for the pleasure of keeping the history of GIMP alive. It also reference
commit links for easy retrieval and further researches.

The only left images now are:

- gimp-logo.png and gimp-devel-logo.png: these are used in the About dialog or
  API reference. Ideally they should be generated from the SVG source.
- gimp-splash.png: used as splash image, in the Welcome dialog and in the
  Windows installer.
- wilber.png: only used in some Script-fu test scripts as far as I can see. This
  should also be generated from the same source SVG as gimp-logo.png, or maybe
  simply gimp-logo.png should be used instead.

Logos: https://gitlab.gnome.org/GNOME/gimp-data/-/blob/main/images/logo-log.md
Splashes: https://gitlab.gnome.org/GNOME/gimp-data/-/blob/main/images/splash-log.md
2024-02-25 16:11:58 +01:00
Sabri Ünal
0d83d2008d Update Turkish translation 2024-02-25 13:10:20 +00:00
Sabri Ünal
f59fb2f8d3 Update Turkish translation 2024-02-25 13:10:06 +00:00
Sabri Ünal
0e2f016425 Update Turkish translation 2024-02-25 08:08:08 +00:00
Sabri Ünal
74ad9f2ff4 Update Turkish translation 2024-02-25 08:06:14 +00:00
Yuri Chornoivan
9750c77abc Update Ukrainian translation 2024-02-24 20:37:53 +00:00
Yuri Chornoivan
acab21a586 Update Ukrainian translation 2024-02-24 20:36:52 +00:00
Yuri Chornoivan
abff9fe036 Update Ukrainian translation 2024-02-24 20:31:18 +00:00
Øyvind Kolås
a93fbc682e app,libgimpcolor: drop babl if guards that no longer apply 2024-02-24 18:14:36 +01:00
Øyvind Kolås
da289b9c50 meson,app: depend on babl-0.1.108 2024-02-24 18:08:31 +01:00
Alx Sa
e927b6c42b dialogs: Open multiple recent images...
...with the Enter key. Combines the single image
and multi-image opening methods so that no matter
how you open recent images (single click, button, or
multi-select and pressing Enter), it opens all selected
images in the Welcome Dialog.
2024-02-24 15:42:53 +00:00
Anders Jonsson
f2cfda17fb plug-ins: fix wording in fractal-explorer string 2024-02-24 14:52:22 +00:00
Anders Jonsson
34eac1996e plug-ins: remove unneeded accelerator 2024-02-24 14:52:22 +00:00
Anders Jonsson
58f6d86b09 scripts: GIMP Online accelerator and link fixes
* 'Use selection' entry was missing due to wrong name
* Write Table of contents without brackets, fixes #9903
* Avoid accelerator clashes
2024-02-24 14:52:22 +00:00
Vasil Pupkin
861583a3d7 Update Belarusian translation 2024-02-24 01:12:49 +00:00
Vasil Pupkin
24cd97d761 Update Belarusian translation 2024-02-24 01:06:14 +00:00
Vasil Pupkin
a0f2b2d8fa Update Belarusian translation 2024-02-23 23:26:18 +00:00
Jehan
a3c0b515f9 data: the build system should not ever move system files.
AFAIU the issue which it tried to fix only happens on custom builds and it looks
to me that it's just about multi-prefixes developer builds which were not
configured with -Drelocatable-bundle=no as they should.

When you compile GIMP yourself and intend to run it in a multi-prefix
environment, without ever relocating the build, like on Unix-like systems, then
disable this feature.

In any case, we should never do this kind of system file moving hacks in our
build system. The MSYS2 project even had to patch this out:
https://gitlab.gnome.org/GNOME/gimp/-/merge_requests/1171#note_2022406
2024-02-22 18:41:04 +01:00
Luming Zh
ce08be14d3 Update Chinese (China) translation 2024-02-22 15:39:56 +00:00
Balázs Úr
748b2b5767 Update Hungarian translation 2024-02-22 00:50:15 +00:00
Øyvind Kolås
4463c1e0b1 app: make hue-saturation op use HSLA float as processing space
This should be quite a bit quicker than the per pixel overhead of
function call converting rgb<->hsl.
2024-02-21 19:41:11 +00:00
Joachim Priesner
2680057b96 .clang-format: Remove duplicate option
This is an error starting with LLVM commit 388d679c (LLVM 17).
2024-02-21 15:44:48 +00:00
Øyvind Kolås
992cd783ac app: do processing with non-linear RGB in threshold op 2024-02-21 15:54:20 +01:00
Joachim Priesner
6731761944 .clang-format: Enable PenaltyBreakOpenParenthesis option
The CI uses clang-format 14 at least since commit 01e56545,
since that is the version available in Debian bookworm.
2024-02-21 11:27:27 +00:00
Jehan
11892f1d83 Issue #10900: install missing gimpchoice.h.
Argh how this could pass without anyone noticing?!
2024-02-21 11:08:23 +01:00
Øyvind Kolås
bc7f0f5fc2 app: make posterize op operate with a perceptual gamma 2024-02-21 09:03:08 +01:00
Yuri Chornoivan
df0a445fbd Update Ukrainian translation 2024-02-21 06:26:11 +00:00
Alx Sa
903d697091 plug-ins: Port decompose to GimpProcedureDialog widgets
Also changed decompose-type argument from string to
GimpChoice.
2024-02-20 14:42:41 +00:00
Luming Zh
745a142b09 Update Chinese (China) translation 2024-02-20 14:12:53 +00:00
Yuri Chornoivan
a7cec65868 Update Ukrainian translation 2024-02-20 13:43:04 +00:00
Øyvind Kolås
7e39d2badd app: conversion to indexed, do error diffusion in linear RGB
Do error diffusion in linear RGB while keeping palette generation as
CIE Lab.
2024-02-20 12:26:38 +01:00
Øyvind Kolås
5311cbec84 app: increase color precision in indexed conversion
The indexed conversion code was originally written for very low-memory systems,
this makes the mapping it does quantized and noisy, for examples see issue
 #5159 this commit removes quality/memory use trade-offs, modern machines can
take a 2-300mb temporary table allocation.
2024-02-20 11:58:58 +01:00
Alx Sa
e97f8693d0 plug-ins: Port warp.c to GimpProcedureDialog widgets
Also make widgets translatable and added mnemonics.
Note that the UI could still be improved -
the GimpDrawableChoosers are larger than the old ones.
2024-02-19 20:51:06 +00:00
Balázs Úr
38fbf19b50 Update Hungarian translation 2024-02-19 19:43:50 +00:00
Balázs Úr
210c7d3850 Update Hungarian translation 2024-02-19 19:41:03 +00:00
Balázs Úr
76f71ba903 Update Hungarian translation 2024-02-19 19:36:37 +00:00
Jacob Boerema
2a52d91a52 libgimpbase: fix endless loop in gimpprotocol
Coverity warned here for endless loops. Looking at it, it's clear that
we should increase k and not j.
2024-02-19 11:49:54 -05:00
Marco Ciampa
cad8c6739c Updated Italian translation 2024-02-19 14:27:14 +01:00
Alexandre Prokoudine
67c92e12c0 Update Russian translation 2024-02-19 14:26:22 +01:00
Jehan
d63a94dedc gitlab-ci: use the last tagged releases of babl and GEGL for deps-debian-x64 too.
This is similar code to what I added for the Windows builds, except that here
it's because deps-debian-x64 will also end up feeding dev-docs job too.

Right now our tagged build of GIMP produces docs for unstable versions of babl
and GEGL.
2024-02-19 12:28:53 +01:00
Bruno Lopes
368bee2d64 build/windows: Rework scripts local compatibility layer
Since !1171 we can use the CI scripts locally, but the initial implementation,
after some commits, revealed to be troublesome. So, now reworked to be simple.
2024-02-18 19:28:47 +00:00
Bruno Lopes
43c0fdcbba build/windows: Follow meson defined versions
As noted by Jehan, the way of defining the (many) GIMP versions can change.
So, let's take the GIMP version directly from the generated config.h file.

Also, changes the declaration of some variables to conform with "best pratices".
2024-02-18 19:28:47 +00:00
Bruno Lopes
3db6639375 build/windows: Make unified deps list more conventional
This list is referenced in the gimp-web-devel site, and my initial
implementation, in terms of ease to use, was a throwback.

Also, make the CI code more simple without changing the list file.
2024-02-18 19:28:47 +00:00
Bruno Lopes
265fb09ce6 build/windows: Make deps install "modular"
Since almost the same code is used in the 3 stages, let's reuse it.
2024-02-18 19:28:47 +00:00
Bruno Lopes
09a26ddb72 build/windows: Conform scripts to Coding Style
Self-explanatory. Also, make the structure a little more cohesive.
2024-02-18 19:28:47 +00:00
Alx Sa
cf73a28145 python: Fix Spyro-Gimp Long Gradient option
Resolves #10873.

We needed to update a Gimp.RGB object to Gegl.Color
in order for the Long Gradient option to work properly.
2024-02-18 19:21:31 +00:00
Alx Sa
dfad2a3028 python: Fix Spyro-Gimp Selection option
As noted in a comment on issue 10873,
choosing Selection for Fixed Gear throws
a TypeError. This is because with the change
from GimpRGB to GeglColor, we can no longer
directly access the red component with an index.

Instead, we need to call Gegl.Color.get_rgba() to get
that value, which is what this patch does.
2024-02-18 18:41:04 +00:00
Alx Sa
8f18ea6e7d widgets: Fix critical in Dynamics Dockable
Resolves #10882.

Before the color space invasion, INPUT_COLOR () returned
either a GimpRGB or NULL (if alpha == 0) that was used
directly in functions.
Now it's used to set a GeglColor in gegl_color_set_pixel (),
and calling that with a NULL color resulted in a Gegl-Critical.

This patch checks if INPUT_COLOR () returned NULL before
trying gegl_color_set_pixel () to prevent the issue.
2024-02-18 14:00:23 +00:00
Jehan
4755f0e805 meson.build: post-release version bump to 2.99.19.
On the way to the RC1!
2024-02-18 11:11:24 +01:00
Sabri Ünal
d39137b9a0 Update Turkish translation 2024-02-18 09:41:02 +00:00
Sabri Ünal
e9140fff49 Update Turkish translation 2024-02-18 09:40:51 +00:00
Sabri Ünal
cfd50c4818 Update Turkish translation 2024-02-18 09:39:31 +00:00
Jehan
f94c4cb5db Release development version GIMP 2.99.18. 2024-02-17 18:01:20 +01:00
Jehan
cb81d5224b Issue #10872: welcome dialog does not behave like the usual "new image" action.
The alternative solution would be to call:

> image_new_dialog_set (dialog, NULL, NULL);

This would have reset to default template. But it's still not exactly like the
"new image" action which defaults to the active image's size if there is an
opened image.

In order to avoid complicating the code further, as well as code duplication,
hence code divergence, let's call the "image-new" action, making sure that this
button will always behave exactly like the "File > New" menu item.

Then since we need to process the return value of this dialog (either re-showing
the welcome dialog in case of new image creation cancelation, or destroying the
hidden welcome dialog otherwise), I check for the singleton pointer and connect
the handlers to it.

Moreover I made the "response" signal of ImageNewDialog be handled as
G_CONNECT_AFTER otherwise we nearly never had the possibility to handle its
responses properly (because the base handler was doing it first, then often
destroying the dialog).
2024-02-17 18:01:20 +01:00
Luming Zh
ff459a5f4b Update Chinese (China) translation 2024-02-17 14:42:53 +00:00
Luming Zh
e24cda1998 Update Chinese (China) translation 2024-02-17 14:41:06 +00:00
Luming Zh
d656bd42ce Update Chinese (China) translation 2024-02-17 14:39:17 +00:00
Jehan
70d681f6fb desktop: release GIMP 2.99.18 today. 2024-02-17 11:33:32 +01:00
Jehan
7f6e666afc libgimpwidgets: make sure we update everything when changing the format. 2024-02-17 11:27:29 +01:00
Jehan
18d68d9e7c Issue #10850: [Color Space Invasion] Possible profile mis-match between color selectors.
It was simply not implemented yet, but it's true that it's such a visible and
used feature that it's worth adding it in time for GIMP 2.99.18!
2024-02-17 11:24:00 +01:00
Øyvind Kolås
2d1a02298d app: gimpoperationhuesaturation, do processing in non-linear
Address a regression of hue-sector sizes. The HSL model math in gimp_rgb_to_hsl
and gimp_hsl_to_rgb uses R'G'B' values rather than RGB.

Fixes #10756.
2024-02-17 06:03:40 +00:00
Alx Sa
a0990e324d python: Fix spyro-gimp Preview tool
Gimp.context_get_foreground() no longer returns a Boolean
as a first output, so we need to remove it from the assignment
line.
2024-02-17 00:02:25 +00:00
Jehan
017b82b0d5 build: use tagged releases of babl/GEGL dependencies when building releases.
The rest of the time, we want to use HEAD of their main branches.

The last ctx update seem to have broken the CI build on Windows. While we'll
have to fix this, let's do this after we release GIMP.

Anyway we obviously don't want to use unstable code for actual point releases,
so it's a good thing that this made me think of adding such rules.
2024-02-16 22:31:33 +00:00
Øyvind Kolås
597c52b92e app: gimpoperationgradient keep achromatic colors under dither
Use the same amount of dithering on R,G and B if they initially were all equal.
This allows us to keep achromatic gradients achromatic, while providing the
same amount of dither as before for colored gradients. Discrepancy uncovered in
issue #10756.
2024-02-16 22:25:25 +00:00
Jehan
8e63ef91f5 Issue #10858: [Color Space Invasion] Alpha ColorScale has corrupted values.
While the buffer used by Cairo may have a rowstride bigger than 3 * width, our
internally stored buffer has the exact size required for drawing the scale.
2024-02-16 22:05:23 +01:00
Jehan
4915689948 app: gradient not properly updated when canceling the color dialog. 2024-02-16 20:47:15 +01:00
Jehan
067abee9b2 Issue #10851: [Color Space Invasion] Crash when editing Gradient.
We were not properly duplicating the left and right colors when duplicating the
existing segments in gradient_editor_save_selection(). Therefore we ended up
freeing original GeglColor on exiting the GimpColorDialog.

Additionally to the reported crash, I add a few GeglColor freeing which were
leaked and some safeguard in gimp_gradient_get_flat_color() to ensure it always
returns a color (or raise a CRITICAL to be investigated easily).

Finally a few signals in GimpColorDialog had to be ensured disconnected when the
dialog is destroyed.
2024-02-16 19:58:11 +01:00
Jehan
793d6e7dac app: properly initialize property colors.
Our code expects that these GeglColor properties are always non-NULL in various
places, which may lead to crashes.

The property defaults should take care of this, and I am actually unsure why we
need to set it in the init(). Maybe the set_default() method for the GParamSpec
kicks in a bit late, while we have code syncing objects already running. I'm not
sure. It might need to be investigated later. But for now, let's simply make
sure we initialize the objects manually so that it's never NULL.
2024-02-16 17:28:51 +01:00
Idriss Fekir
1437e3fa99 GimpFont: Crash loading XCF with text in an unavailable font 2024-02-16 12:09:58 +00:00
Ekaterine Papava
039a3671bc Update Georgian translation 2024-02-16 11:43:58 +00:00
Ekaterine Papava
0606b986f5 Update Georgian translation 2024-02-16 11:25:59 +00:00
Øyvind Kolås
5a0a3a1263 app: special-case achromatic pixels in hue-saturation
Issue #10756, without this grayscale pixels are affected by
the red part of the manipulation configuration, after this
change pixels with original saturation == 0.0 are only
changed by the master adjustment.
2024-02-16 00:16:08 +00:00
Bruno Lopes
96e7673348 build/windows: (Finally) Drop lua5.1 in ARM
This become unnoticed in !1171 and was breaking .lua plug-ins use in
ARM installs. See: https://gitlab.gnome.org/GNOME/gimp/-/issues/10554#note_2014768
2024-02-16 00:08:02 +00:00
Jehan
8bb79dc671 app: port Colorize to GeglColor property.
While doing this, I could find a lot of problems in the algorithm:

1. It looks like the original intent (from GUI and code) is that you set hue and
   saturation but not really the intended lightness, rather its increase or
   decrease, relatively to every pixel current lightness. I.e. that every pixel
   will be set to the selected hue and saturation, and only the lightness will
   change. The "lightness" field is therefore a relative value (pixel per
   pixel). The first problem is that instead of lightness, we compute the
   luminance, which is related but different and set this in the lightness
   field.
2. The second issue is that we were using gimp_hsl_to_rgb() which after testing
   (because its documentation doesn't give any TRC/space info at all) looks like
   it computes a color from HSL to non-linear RGB of the same space. Yet we were
   outputting to a linear RGB space. So we compute the wrong values. On the
   other hand, because of the first problem, I realize (after testing) that it
   makes our render closer to the intended render by chance (at least when the
   TRC is sRGB's). It's still wrong, but if we were to change the output to
   "R'G'B'A float" instead, the render would be much darker. In both cases, it's
   wrong anyway.
   I would not say that the 2 problems are canceling each others, but they are
   making the final result somewhat OK.
3. Ideally we should be using babl to convert colors, and this is the best way
   to actually implement the original filter intent. Unfortunately so far, doing
   this is much slower (though I save a lot of time by moving out of the samples
   loop and processing data in chunks, it's still slower than the current,
   nearly instant, implementation).
4. Because of all previous implementation irregularities, the render is
   different depending on the actual image space. I.e. that the exact same image
   filtered through Colorize with the exact same operation parameters will
   render differently. I would need to test further, and maybe it's normal since
   HSL is also space-dependant (and that's where we work on in this operation),
   but I'm wondering if the result should not be independant of the working
   space.
5. I implemented our own prepare() method because the one in
   GimpOperationPointFilter parent seems to allow other input or output models.
   Even though in all my tests, it was always linear RGB (which is what we want
   here), let's make sure by having a custom prepare() method explicitly setting
   these. It's also the opportunity to create some babl fishes.

In any case, I'm leaving the code as-is for now, because it's how this operation
has been since forever (at least for as long as I was around) and I don't think
it's the right idea to change it on a whim.

This raises even more the concern of versionning GEGL operation, which we have
been discussing with pippin on IRC lately, because if ever we want to change
this one, now that operations are not just applied, but possibly
non-destructively recreated at load, we need to make sure that we recreate the
render expected at the time of creation of a XCF while allowing us to have the
filters improving when needed.
2024-02-15 23:55:06 +01:00
Anders Jonsson
99f20a916d Update Swedish translation 2024-02-15 20:20:24 +00:00
Alx Sa
629c7eee9e widgets: Close NDE popover when merging filters
Resolves the main part of 10835. As nothing else can
be done in the GUI once all the filters are merged down
(and the GUI itself will be unavailable once closed until
a new filter is added), it makes sense to auto-close it.
gtk_widget_set_visible () was used rather than
gtk_popover_popdown () due to notes in the code about
buggy animations.

There is the possibility that users may want the GUI left
open to quickly undo the merge, so this should be
re-examined after feedback from the 2.99.18 release.
2024-02-15 18:30:12 +00:00
Yuri Chornoivan
1139df0167 Update Ukrainian translation 2024-02-15 16:40:57 +00:00
bootchk
df57b28469 2.99 ScriptFu: change wording of "Coffee Stain" filter
To reflect increased generality, its not just "coffee" but any gradient.

Delete "realistic looking": subjective and adds no content.

Better tooltips for the arguments.
2024-02-15 15:40:20 +00:00
bootchk
e6957e2b0d ScriptFu: port script "Coffee Stain" to new-style
Call new-style script-fu-register-filter so
choice of gradient is saved in settings.
2024-02-15 15:40:20 +00:00
bootchk
45f56ce44c Fix #10832 ScriptFu: script "Coffee Stain" expects int for gradient
Fix it by also enhancing, making the gradient an argument with a default
instead of a fixed choice of the gradient named "Coffee".
Instead of fixing by looking up the gradient ID in the body of the script.
2024-02-15 15:40:20 +00:00
Alx Sa
de8f7fd4b8 plug-ins: port lighting to GeglColor procedure arguments
Also fixed parameter formating.
Note that it still converts to GimpRGB
internally.
2024-02-15 13:47:04 +00:00
Alx Sa
e559c23c00 plug-ins: port map-object to GeglColor procedure arguments
Note that it still converts to GimpRGB
internally.
2024-02-15 13:10:23 +00:00
Jehan
9955c00076 Issue #10853: support GeglColor return type in script-fu.
Right now, I just transform any GeglColor return value into a RGB u8 triplet,
because that's also how we were supporting GimpRGB anyway, though it's seriously
limited.

Ideally we'd add some real concept of generic color abstraction in Script-fu
too, which could support any color model, space and precision.
2024-02-15 13:25:50 +01:00
Alx Sa
5ad18094db actions: Load opacity/mode/region properties in NDE
Resolves #10848.

In cc62f2b0, we moved the filter property loading code
earlier in the process. However, the opacity, mode, and
region options for GimpFilterTool were not included in
this move, so they reset back to defaults each time.
This fixes that problem so settings are retained when
editing.
2024-02-15 05:31:36 +00:00
Alx Sa
ad73df43fd plug-ins: port grid (legacy) to GeglColor procedure arguments 2024-02-15 03:39:52 +00:00
Alx Sa
ea14231921 scripts: Fix calls to gimp-drawable-edit-gradient-fill
Resolves #10830

The supersample-max-depth parameter
of gimp-drawable-edit-gradient-fill
required a value between 1 and 9.
Previously this wasn't enforced, so several
scripts called it with a value of 0.

Now that it's enforced, those scripts were
broken. This fixes the calls in weave,
gradient-example, test-sphere, burn-in,
and coffee (although it has other issues)
2024-02-14 23:52:18 +00:00
Jehan
fc08b78436 plug-ins: port film to GeglColor procedure arguments.
It was a bit sad that we'd release GIMP 2.99.18 with no plug-in using
GeglColor argument yet, so at least with this, we'll have one as a demo
of what needs to be done.
2024-02-14 23:58:32 +01:00
Jehan
700d0c7c91 libgimp: add macros for GeglColor arguments for GimpProcedure. 2024-02-14 23:46:03 +01:00
Jehan
19be79178d app: fix reading GeglColor arguments in pluginrc.
A GeglColor may be without profile (when the space doesn't require one
or if the default profile is used for the model).
2024-02-14 23:43:26 +01:00
Jehan
7db648195c libgimpwidgets: fix initializing a GimpLabelColor. 2024-02-14 23:36:39 +01:00
Jehan
40158b431d Issue #10838: fix dashboard crash.
- Make sure the led color is set at init().
- Unlike old GimpRGB code, values' colors must be set explicitly first.
- Make the Gimp object into a property (this one is not a problem right now, but
  it's better this way).
- Don't assume the Gimp object is non-NULL. In current code, it is set to NULL.
  The only consequence is that we don't use color management settings to draw
  with Cairo. For this widget anyway, it feels unnecessary.
2024-02-14 22:48:59 +01:00
Anders Jonsson
0f2e916b64 Update Swedish translation 2024-02-14 21:02:25 +00:00
Yuri Chornoivan
fda9df670c Update Ukrainian translation 2024-02-14 18:42:44 +00:00
Alx Sa
167e35b048 Issue #10843: Prevent raising/lower Warp NDE filter
Altering the Warp tool's GEGL filter while it's being actively edited
causing a crash. More work will be needed to make these effects
work non-destructively - for now, we'll prevent users from raising or
lowering them from the NDE UI.
2024-02-14 17:49:51 +00:00
Jehan
7e95211e35 Issue #10834: [Color Space Invasion] Filter Presets not loading deserialized GeglColors. 2024-02-14 18:00:25 +01:00
Jehan
30d6b88c95 Issue #10841: rename "Insane Options" to "Experimental". 2024-02-14 17:03:35 +01:00
Jehan
5c81f05804 app, desktop: add demo scenarios for 2 release note items. 2024-02-14 16:50:26 +01:00
Jehan
d52d57eb45 app: add ability to blink item tree view's header widget. 2024-02-14 16:49:39 +01:00
Jehan
fbb14c8c49 NEWS: update. 2024-02-14 16:48:51 +01:00
Jehan
df7cc3d377 app: simplify and fix the welcome dialog and update check algorithm.
To simplify the logic, I created an `is_update` variable. This makes the code
much more understandable (and also simplify the redundant or over-complicated
imbricated `if` blocks).

The fix part is that the update check would have never happened for anyone
leaving the "Show Welcome Dialog" option checked, whereas we only want to bypass
the update check for new installations or updates.
2024-02-14 15:20:10 +00:00
Alx Sa
9a745738b4 dialogs: Add configurations to Welcome Dialogue
Allows users to quickly configure themes and other
"controversial" options when first installed.
Also allows the welcome dialogue to appear on start,
depending on user preference.
2024-02-14 15:20:10 +00:00
Bruno Lopes
c435184735 build/windows: Update manifest to conform with 5c96851431 2024-02-14 11:20:31 +00:00
Yuri Chornoivan
862a785d8f Update Ukrainian translation 2024-02-14 11:06:49 +00:00
Ekaterine Papava
4d113f86b7 Update Georgian translation 2024-02-14 04:35:16 +00:00
Jehan
6d14ca0554 Issue #10815: [Color Space Invasion] GimpColorFrame crashes when RGB (%), RGB…
… (u8), or CMYK is selected.

We always need a final NUL indicator in a GStrv. In these 2 cases, we might fill
all 6 first indexes, so we must have an array of size 7.
2024-02-13 23:47:49 +01:00
Jehan
d945e12ccc Issue #10814: [Color Space Invasion] crash in channel_get_color_invoker. 2024-02-13 23:25:41 +01:00
Jehan
aaa75e3674 Issue #10385: fix CRITICAL when importing palettes via the Palette dockable.
Since resources must now either belong to an image, or be tied to a file, or be
marked as internal, we must immediately save imported palettes, so that they are
tied to their file.
2024-02-13 22:42:04 +01:00
Jehan
e2b2f1fb04 Issue #10811: script-fu can now create GeglColor params.
For the time being, only the same format as GimpRGB params is supported, which
means creating a color either as CSS strings or as RGBA list values, which means
that we can only input sRGB values right now in ScriptFu (even when calling
GeglColor-using API).

This is the second part to fix issue #10811.
2024-02-13 21:58:40 +01:00
Jehan
0b6b76a419 Issue #10811: implement GeglParamColor missing in some places.
Though I had already implemented passing GeglColor through the PDB, it was not
complete. In particular, the protocol was not able to pass GeglParamColor specs.

Fixes:

> LibGimp-WARNING **: 16:06:09.451: _gimp_gp_param_def_to_param_spec: GParamSpec type unsupported 'GeglParamColor'

This is part of the fix to issue #10811, though it's not complete yet.
2024-02-13 21:58:40 +01:00
Jehan
4f8793eaa7 app: the Quick Mask color must be duplicated with the image. 2024-02-13 21:58:40 +01:00
Rodrigo Lledó
43d3d24688 Update Spanish translation 2024-02-13 17:45:41 +00:00
Rodrigo Lledó
666d59b4ed Update Spanish translation 2024-02-13 17:44:07 +00:00
Rodrigo Lledó
f6c28fda22 Update Spanish translation 2024-02-13 17:39:51 +00:00
Kamil Burda
c7c1743dd0 plug-ins: Fix Save button in Python Console
Clicking on the Save button threw an exception as the wrong class was
used to invoke the `set_alternative_button_order_from_array()` method.

Since `Gtk.Dialog.set_alternative_button_order_from_array()` is
deprecated and the GIMP functions with the same name suppress
deprecation warnings in the C code, we suppress the warning here as
well. The `warnings.catch_warnings()` function is not thread-safe
according to the Python documentation, which should not pose a problem
here.

Also, the file chooser dialog now allows specifying a new file instead
of overwriting an existing file.
2024-02-12 21:49:28 +00:00
Jehan
57113323e2 Issue #10813: forgotten GimpRGB used on a GeglColor property. 2024-02-12 19:41:13 +01:00
Jehan
a7637bfb4a libgimpconfig: special-case GeglColor param comparison if one is NULL.
The current values_cmp() method will segfault if an object contains a NULL
GeglColor value. I fixed it in commit c0477bcb0 in GEGL, but since the GEGL
release is already done, I add this special-casing on GIMP side.

To be removed when we release and depend on GEGL 0.4.50.

The crash was happening when activating the text tool and raised in a comment of
another report: https://gitlab.gnome.org/GNOME/gimp/-/issues/10813#note_2009702
2024-02-12 19:33:29 +01:00
Yuri Chornoivan
458ccd9b2a Update Ukrainian translation 2024-02-12 18:28:39 +00:00
Yuri Chornoivan
5d6e8526fc Update Ukrainian translation 2024-02-12 18:23:41 +00:00
Ekaterine Papava
3a6d78871f Update Georgian translation 2024-02-12 17:55:48 +00:00
Ekaterine Papava
cbf406408e Update Georgian translation 2024-02-12 17:47:07 +00:00
Jehan
9e24ceda15 Issue #10809: Color Space Invasion: Curves Tool crashes on start. 2024-02-12 18:30:00 +01:00
Jehan
77420957d8 app: use GEGL/babl to convert to HSL in gimp_operation_hue_saturation_map(). 2024-02-12 18:30:00 +01:00
Alx Sa
fc0d21b91c Issue #10812: New layer colors tag buttons are only white
As in 6a905814, we need to use the gegl_color_set_pixel () function instead.
2024-02-12 16:28:45 +00:00
Jehan
6a90581423 Issue #10808: Hue-Saturation GUI not showing colors.
Small function mixup! We needed the set_pixel() function.
2024-02-12 16:21:28 +01:00
lillolollo
8934a50925 app, libgimpconfig: use G_GSIZE_FORMAT for printf-ing gsize values. 2024-02-12 12:03:03 +00:00
Anders Jonsson
e7e49abc99 Update Swedish translation 2024-02-12 09:22:35 +00:00
Jehan
1f85924e3c NEWS: update. 2024-02-12 00:19:40 +01:00
Jehan
dc66e99949 libgimpwidgets: fix XY rendering in GimpColorSelect for RGB color model. 2024-02-11 23:28:04 +01:00
Jehan
89b80b5b63 libgimpwidgets: don't unnecessarily redraw color previews.
When changing the selected color, we have no reason to redraw the Z preview.
This preview should only be redrawn if the allocation size changed, or if we
change the previewed model or the Z component.

As for the XY preview, it should only be redrawn if the Z value is changed (and
of course, similarly, if the allocation changed or if model or Z component
changed).
2024-02-11 23:28:04 +01:00
Jehan
3a787e8892 app: fix test-config.
Fixes broken unit test:

> stderr:
> ../babl/babl-internal.h:223 babl_fatal()
	babl_format("RGBA float"): you must call babl_init first
2024-02-11 23:28:04 +01:00
Jehan
e6e7fa8f8d libgimpcolor: work around babl_format_has_alpha() bug with some formats.
With "HSVA" and a few others, the function was not returning the right value (it
could not see it was encoding alpha channel.

I had fixed it on babl directly with commit a28309c yet I had forgotten to push
it! Let's just add some #ifdef and a comment.
2024-02-11 23:28:04 +01:00
Jehan
f8ddc94a8b build: fix splash2installer.py with updated API using GeglColor instead of GimpRGB.
Fixes:

> TypeError: argument background: Expected Gegl.Color, but got gi.repository.Gimp.RGB
2024-02-11 23:28:04 +01:00
Jehan
65f8afee68 app, libgimp, libgimpbase, pdb: GimpColorArray as a typedef to…
… NULL-terminated array of GeglColor is now a boxed type usable in PDB.
2024-02-11 23:28:04 +01:00
Jehan
cfd0389c37 app: no more GimpRGB in GimpDashboard and related. 2024-02-11 23:28:04 +01:00
Jehan
6a2aee1fce libgimpwidgets: render GimpColorSelect with babl conversion.
No custom conversion code anymore. This also fixes some bugs in HSV when
I was wrongfully multiplying the hue by 360 when mixing babl and custom
code paths.
2024-02-11 23:28:04 +01:00
Jehan
47c1cb8504 app: use GeglColor in GimpTextBuffer and GimpTextTag.
It's actually not enough to get proper colors for inner text tags. The
main color is correct, but color for subtext is currently not managed.
This must be fixed.
2024-02-11 23:28:04 +01:00
Jehan
cbd970a92d app: add memory size for GeglColor. 2024-02-11 23:28:04 +01:00
Jehan
bab9ed18c4 app: color drag'n drop is now space-invaded.
We can now drop any color model and encoding with any space. The exact
color information is passed with.
2024-02-11 23:28:04 +01:00
Jehan
ba26fc26e7 libgimpwidgets: direct binding between a GimpLabelColor and its color area. 2024-02-11 23:28:04 +01:00
Jehan
c13683a710 app: revert fg and bg colors stored as GeglColor-s. 2024-02-11 23:28:04 +01:00
Jehan
caaee9a174 app: test should have used GeglColor already. 2024-02-11 23:28:04 +01:00
Jehan
4960ed72c1 app: GimpFgBgEditor draw() method to use GeglColor directly too. 2024-02-11 23:28:04 +01:00
Jehan
02546da780 app: layer layer modes to use babl conversions directly. 2024-02-11 23:28:04 +01:00
Jehan
95ac889f6c app, pdb: this PDB function should have been using GeglColor already. 2024-02-11 23:28:04 +01:00
Jehan
57fda090df app: GimpFgBgView draw() methods uses GeglColor directly. 2024-02-11 23:28:04 +01:00
Jehan
6f408e9d48 app: GimpMenuModel uses GeglColor. 2024-02-11 23:28:04 +01:00
Jehan
924dbb44a8 app, libgimpconfig: GimpFilterTool color_picked() now uses GeglColor.
In particular, the Curves, Levels and Operation tools method implemented
are updated. Also GeglColor arguments in GEGL operations are not
transformed into GimpRGB arguments anymore in GIMP. GeglColor GParamSpec
stay GeglColor now.
2024-02-11 23:28:04 +01:00
Jehan
0239d05409 app: gimp_pickable_contiguous_region_by_line_art() now uses GeglColor. 2024-02-11 23:28:04 +01:00
Jehan
3ec13730c5 app: gimp_layer_mask_new() uses GeglColor. 2024-02-11 23:28:04 +01:00
Jehan
cf213d1051 app: some GimpAction color which was forgotten after the port. 2024-02-11 23:28:03 +01:00
Jehan
46121685b8 app: get rid of rgb_to_pixel() GimpPickable method and related functions.
We don't try anymore to convert early from a pickable color to another
format/space. Now we are able to get a GeglColor and move it around,
doing only last-second (when needed) conversions.
2024-02-11 23:28:03 +01:00
Jehan
d55325829f app: no more GimpRGB/GimpHSL/GimpHSV usage in paint code at all anymore.
I'm a bit unsure about the GimpMyBrushCore which doesn't have much
indication on which color space we are working in, but the new code
should not be worse than the old one (if wrong, color-wise, it should be
the same wrong as before).
2024-02-11 23:28:03 +01:00
Jehan
fcfb574715 app: get_paint_params() now uses GeglColor. 2024-02-11 23:28:03 +01:00
Jehan
c892de85df app: port some of the paint and fill code to GeglColor. 2024-02-11 23:28:03 +01:00
Jehan
ae31cf0b18 app: GimpCurveView using GeglColor. 2024-02-11 23:28:03 +01:00
Jehan
20b9f9bc06 app: GimpColorBar to use GeglColor.
It's still internally loading data as a sRGB buffer. More work will need
to be done.
2024-02-11 23:28:03 +01:00
Jehan
d1c3b104bf libgimpcolor: gimp_color_is_perceptually_identical() also checks transparency.
When I implemented CIEDE2000 distance for verifying perceptual identity,
I mistakenly lost checking the alpha channel.
2024-02-11 23:28:03 +01:00
Jehan
b53da69f3c app, libgimp, pdb, plug-ins: canvas grid now using GeglColor. 2024-02-11 23:28:03 +01:00
Jehan
f9c97aeb72 app: mask colors are GeglColor. 2024-02-11 23:28:03 +01:00
Jehan
636a33aed2 app: GimpColorDialog now fully uses GeglColor. 2024-02-11 23:28:03 +01:00
Jehan
4b3702bfc1 libgimpwidgets, libgimpcolor: RGB and HSV should also show out-of-gamut…
… in soft-proof space when soft-proofing is enabled.
2024-02-11 23:28:03 +01:00
Jehan
de83bca814 app, libgimpwidgets: make GimpColorSelector sync with soft-proofing.
Until now we only had the case of the CMYK color selector using the
soft-proofing profile. Yet this is also interesting for other color
selectors, in particular to show out-of-gamut colors. Indeed if we
enable soft-proofing on the active image, it is interesting to show the
intersection of the current RGB/Grayscale space gamut with the
soft-proofing gamut.

Right now, this is only used in GimpColorSelect when showing colors in
LCh color space.
2024-02-11 23:28:03 +01:00
Jehan
12b2abce7c libgimpcolor: implement CIEDE2000 distance algorithm to compare colors.
This is used for the gimp_color_is_perceptually_identical() function,
because the Euclidean distance in LCH is extremely limited, if not wrong
in many cases. Indeed LCH is not perfectly perceptually uniform, and for
this exact reason, the CIE defined the specific Delta E algorithms.
Later versions are also based on LCH values, so my intuition to use it
for distance was on a good start, yet these algorithms were refined a
few times to allow for corrections in perceptual uniformity
imperfections.

This was in particular needed to verify if a color is out of a CMYK
space gamut. The idea is to compare the distance of the RGB (or other)
and the CMYK version, since we cannot just check if the CMYK color is
out of the [0; 1] range (it never is). Instead if both colors are
perceptually identical, then we consider that the RGB color was inside
the CMYK space gamut.
The naive algorithm was giving any (or nearly) color as out-of-gamut.
Now using CIEDE2000, I get a much nicer results.
2024-02-11 23:28:03 +01:00
Jehan
4d2acac506 libgimpwidgets, modules: display the exact space/profile name for…
… relevant color selectors.
2024-02-11 23:28:03 +01:00
Jehan
3c3f3030f1 libgimpwidgets: GimpColorSelect is now also aware of active image space. 2024-02-11 23:28:03 +01:00
Jehan
ebb93a07a5 modules: the color wheel selector now displays and select in the active…
… image's space!
2024-02-11 23:28:03 +01:00
Jehan
1066229ba6 modules: Watercolor selector now shows the actual target gamut. 2024-02-11 23:28:03 +01:00
Jehan
69b7cbe111 libgimpcolor: add support for "CIE LCH(ab)" to gimp_babl_format_get_with_alpha().
It seems I had forgotten about this one!
2024-02-11 23:28:03 +01:00
Jehan
e104196cb7 app, libgimpwidgets: "Scales" color selection now space-aware.
This commit adds gimp_color_selector_set_format() which is meant to give
awareness of the target color format for which we are selecting colors.
Right now, I am only using this information on the Scales selection
method, which means that now colors you read and select are in the
target space. Even better, the out-of-gamut shown happens in the with
LCH scales is for the target space too. As tested, it already makes
quite a difference for an image in sRGB vs. say adobeRGB.

Note that right now, I only use the format information as a space, but
in fact, I made the API to be about a format because the actual format
can be used wisely too. First we may want to do different thing
depending on the color model itself (which the space may give away or
not, especially when using default spaces or when we'll have images
using models with no space in the future, such as CIE Lab). But also
whether the image is following the space TRC or is linear (or
perceptual) would change how we represent the data. If we were to show
non-linear values in the Colors dockable but when painting, the color
picker shows linear values for instance, it might be puzzling to people.
2024-02-11 23:28:03 +01:00
Jehan
881baba59b app: update the simulation profile in Colors dockable.
Only the color dialog was getting simulation updates when the active
image changed, or when the simulation profile changed (while the active
image stayed the same). Now the Colors dockable also get updates.
2024-02-11 23:28:03 +01:00
Jehan
b7610b1db7 app: re-run gtk_event_box_set_above_child() when showing the event box.
Somehow, in some cases, the event box is not getting button events. I
had the case when creating new images (though it was working fine when
loading images!). I could not yet understand the issue looking at both
GIMP and GTK code and could not even reproduce by creating simple code
sample reproducing a similar pattern (an inactive button inside an event
box placed above the button and meant to catch click events).
This works as a workaround for the time being.
2024-02-11 23:28:03 +01:00
Jehan
9833ebd0ee app, libgimpwidgets, modules: color selectors are now partly space-invaded.
What this commit does is keep the same code logic while moving to
GeglColor. Yet it's not **really** space-invaded yet. What we need to do
now:

1. Take into account the image space, and this is what we must navigate
   through, in particular for various representations of RGB or HSV.
   I.e. that if the active image is in anyRGB, the RGB values shown must
   be within anyRGB. Right now, everything is still shown/used as sRGB
   (even though it's properly retrieved and transformed to the target
   space thanks to GeglColor).
2. Show space info to make things clear and explicit, by adding some
   label somewhere.
3. Allow to switch between image and softproof spaces, regarding
   out-of-gamut display. I.e. that while RGB/HSV must be shown within
   the image space (assuming it's anyRGB), we may want to show
   out-of-gamut area (pink areas) within the softproof space. This may
   mean adding a checkbox. Or maybe simply taking into account whether
   we are in softproof mode or not?
4. We can likely move off gimp_widget_get_color_transform() into using
   gimp_widget_get_render_space() for display drawing. We don't need any
   soft-proofing or black point compensation for any of these widgets so
   pure babl is fine. Indeed we want to show any in-gamut color
   correctly (and not transformed according to specific intents or
   through soft-proofing). We will take care of the proofing case with
   out-of-gamut area showing only.
5. In the various drawing functions, we should move to
   CAIRO_FORMAT_RGBA128F. The color selection area might be wide enough
   that it makes sense to be more accurate, especially as we are
   essentially showing color gradients in 1 or 2 directions in these
   various widgets.
2024-02-11 23:28:03 +01:00
Jehan
4d798ecfed libgimpcolor: improve warning to help with debugging. 2024-02-11 23:28:03 +01:00
Jehan
ce887767e7 app, libgimpconfig: color history is now space-invaded.
I also changed a bit the new color serialization by adding a (color …)
symbol framing the contents, for cases where we don't have a specific
property name, e.g. for the color history list stored in colorrc, unlike
for GimpConfig GeglColor properties.

While doing this, I moved GeglColor property deserialization code into
gimp_scanner_parse_color() which is now able to recognize both older
(color-rgb|rgba|hsv|hsva with no color space) and newer serialization
formats ("color", color model agnostic and space aware).
2024-02-11 23:28:03 +01:00
Jehan
1a901e0bb9 libgimpcolor: get the proper alpha variant of a palette format. 2024-02-11 23:28:03 +01:00
Jehan
1be7892862 libgimpconfig: serialize indexed colors as RGB instead.
Serializing palette colors is not possible right now as far too much
additional data are required, and anyway we likely wouldn't be able to
associate back the color to the right palette on deserialization,
removing any interest of keeping the index data anyway.

With that context in mind, let's just serialize palette data as basic
RGB within the palette's space.
2024-02-11 23:28:03 +01:00
Jehan
91d3b51bf2 app: when creating a palette from an image, colors must be space-aware. 2024-02-11 23:28:03 +01:00
Jehan
b6c1b20737 app: colors generated when converting to indexed must be within the image space.
Colors must not be clamped to sRGB, which could lose colors on wide
gamut indexed images.
2024-02-11 23:28:03 +01:00
Jehan
093d00572a app, libgimpcolor: more move to GeglColor.
- New libgimpcolor functions: gimp_color_parse_hex() and gimp_color_parse_name().
- GimpColorHexEntry is now space-invaded. Though recognized color names
  and hexadecimal syntax are sRGB only (because CSS and SVG
  specifications explicitly say that this syntax is for sRGB values), it
  is possible to enter non-sRGB values with
  gimp_color_hex_entry_set_color().
- GimpColorSelection is now space-invaded.
2024-02-11 23:28:03 +01:00
Jehan
ee19ad54d6 app, libgimpcolor: 2 new libgimpcolor functions.
Adding gimp_color_is_out_of_gamut() and gimp_color_is_out_of_self_gamut() and
using them where relevant.
2024-02-11 23:28:03 +01:00
Jehan
4a30f431fd app: work with a GimpPalette rather than a colormap.
We historically have both the colormap and palette concept in core GIMP,
though they are actually kinda the same concept, except that with
"colormap" we work with an array of raw data and it's a lot less
color-aware. It is still much more efficient in some specific cases,
such as when converting the image (we can then convert the whole palette
as a single buffer, because the image palette is space-restricted
anyway), when storing undo data or when storing/loading in XCF.

But for all the rest, let's use gimp_image_get_colormap_palette() and
work with the GimpPalette API.
2024-02-11 23:28:03 +01:00
Jehan
5e8f4f5e00 app: add a concept of format restriction in GimpPalette.
By default a palette can contain any mix of color models and space. These new
internal API add a concept of format/space restriction. For now this will only
be used for indexed images whose palette should only contain colors for the
specific palette format and space (at least as currently implemented in GIMP).
2024-02-11 23:28:03 +01:00
Jehan
dc1f5ea227 app, libgimp, pdb, plug-ins: GimpPalette are now GeglColor based. 2024-02-11 23:28:03 +01:00
Jehan
b6856af9d8 app: GimpGradient now uses GeglColor.
I still see some limitations in GimpGradient, and in particular, they are still
always stored as RGB in GGR files. It would be nice if we could store the actual
color format. This way, if someone chooses a gradient stop as Lab or CMYK color,
that's what the gradient file would keep track of. But also even storing the
space of a color (instead of storing/loading always in sRGB, even though this
may still work fine as we store unbounded double values). This might warrant for
a v2 of GGR file format.

This commit also fixes loading of SVG gradient which was apparently broken
regarding hexadecimal color parsing.

Finally I improve gegl_color_set_alpha() by adding an alpha channel when the
initial format had none.
2024-02-11 23:28:03 +01:00
Jehan
916d032f67 app, libgimp*, plug-ins: GimpColorButton now space-invaded.
The invasion extended to some core widgets too, in particular GimpColorPanel (a
subclass of GimpColorButton). There was quite a lot of code depending on these
widgets.
2024-02-11 23:28:03 +01:00
Jehan
8eb56586aa app, libgimpwidgets, plug-ins: GimpColorArea is now space-invaded.
This includes improvements on the out-of-gamut colored corner being shown for
unbounded component types out of the [0; 1] range (with some small margin of
error to avoid e.g. a -0.0000001 value to show as out-of-gamut).

There are still improvements to be made on the color rendering. In particular,
it still draws as CAIRO_FORMAT_RGB24 cairo surface. We should probably move to
draw as CAIRO_FORMAT_RGBA128F eventually (more precision and even allowing to
draw unbounded colors with a possible option, instead of always clipping).

Also adding the libgimpwidgets API gimp_widget_get_render_space().
2024-02-11 23:28:03 +01:00
Jehan
5a0f88e053 app: fix signature of gimp_babl_is_bounded(). It returns a boolean. 2024-02-11 23:28:03 +01:00
Jehan
a5657e4d28 app: also display color profile in Pixel mode. 2024-02-11 23:28:03 +01:00
Jehan
86854ee66f app: GimpColorFrame is now much more space aware.
This one is kind of a huge deal, because the info returned by the color frame
was kind of messy (even though it improved lately, but space associated to color
data had to be kept in-sync by hand, which was bug-prone).

Now the color frame stores the data as a GeglColor, always aware of its space
and therefore able to do much nicer conversion. Also RGB and Grayscale options
now display the profile name of the color space (until now, we had only this for
the CMYK option using the proofing profile).

I still wish to get more options. Typically some people may want to get
RGB/Grayscale/CMYK values to other spaces (maybe sRGB, one of their favorite
profile as set in Preferences or just any random profile which they could load
from disk). Giving such ability to basically live-convert their pixel data to
various other color space would be very nice. We'll see if this will be
implemented for GIMP 3 or for after.
2024-02-11 23:28:03 +01:00
Jehan
559297a5cb app, libgimp*: more GeglColor's space invasion.
- New function gimp_cairo_set_source_color() which is meant to replace
  gimp_cairo_set_source_rgb(a?)() eventually. This new function sets the Cairo
  source color, using the target monitor's profile of the widget where the Cairo
  surface is meant to be drawn on. It also uses the color management settings
  (such as whether a custom profile was set, instead of using system profile, or
  also simply whether color management was disabled at all). It doesn't
  soft-proof the color yet.
- Padding and out-of-gamut colors drawing now use the new
  gimp_cairo_set_source_color(). These don't need any soft-proofing anyway.
- Out-of-gamut color property in GimpColorConfig is now a GeglColor property.
2024-02-11 23:28:02 +01:00
Jehan
b06fe36970 app, libgimp*, plug-ins, tools: settings custom check colors now space-invaded.
We pass 2 GeglColor through the wire now. Since it is passed very early
(when sharing the configuration), I had some issues with initialization
order of GEGL, and in particular when calling gegl_init() before
gegl_config() inside _gimp_config(), I had a bunch of such criticals:

> Plugin script-fu: GLib-GObject: CRITICAL: Two different plugins tried to register 'GeglOpPlugIn-transform-core'

Anyway in the end, I store the passed colors as raw bytes and strings in
the GPConfig object, and re-construct the GeglColor last minute in
_gimp_config().
2024-02-11 23:28:02 +01:00
Jehan
7d2d96a0da libgimpcolor: gimp_color_is_perceptually_identical() should also check transparency.
This fixes weird behavior when changing only the alpha value of a color, e.g. in
the channel color GUI. The before and after colors were considered the same. Now
they won't.
2024-02-11 23:28:02 +01:00
Jehan
4879ab7b7f app, libgimp, pdb, plug-ins: move more code to GeglColor.
In particular, I updated the channel and quick-mask colors, padding colors and
more.
2024-02-11 23:28:02 +01:00
Jehan
319150a3b1 app: get rid of gimp_pickable_pixel_to_rgb() and gimp_image_color_profile_pixel_to_rgb().
These are not used anywhere anymore.
2024-02-11 23:28:02 +01:00
Jehan
d4fd88a77c app: improve out-of-gamut tests in the GimpFgBgEditor.
In particular, let's accept small margin of errors to determine that a value is
out of the [0; 1] range of its color space.
The specific use case is about a component at -0.000001 (or at 1.000001) which
will even just show as 0 (respectively 1) in the GUI and will be marked as
out-of-gamut. We want to avoid such thing to happen.

I also took the opportunity to get rid of a bit more GimpRGB code.
2024-02-11 23:28:02 +01:00
Jehan
e992ca3e51 app, libgimp, pdb, plug-ins: GimpText* using GeglColor.
One of the big improvement in this commit is that text layers are now much
better at space accuracy. They were already space-aware, yet rendered as sRGB u8
only before being converted to the image's space. It means that text layers had
the following limitations:

* Any color out of sRGB gamut were trimmed.
* Precision was always 8-bit (even if the image was high-bit depth).

Now GimpTextLayout keeps track of its source space (for RGB and CMYK only, this
won't be as easy when we will support more backend, since Cairo has only RGB
support for image data) and the image TRC (in case it bypasses the color space's
TRB) and it draws within this gamut and space.
It means first that we are not limited to sRGB colors; we will draw text main
color in the full image gamut, with still 2 remaining limitations:

* Unbounded colors are impossible because Pango format (to color text) uses
  hexadecimal (so even with half/float images, you can't draw out-of-gamut text
  unfortunately).
* Main color precision is still 8-bit, yet a tiny bit better than before as we
  at least follow TRC (so we avoid some of the precision loss when converting,
  even though the bit-depth is still the biggest loss).

The outline color on the other hand is drawn through Cairo API entirely, in
float. This means that the outline color will now be without any precision loss.

Note that this depends on CAIRO_FORMAT_RGBA128F which is only available since
Cairo 1.17.2 which is not in Debian bookworm (our current baseline for GIMP
3.0). It means that the old precision will still happen with older Cairo
version, as determined by #if code at compilation.
2024-02-11 23:28:02 +01:00
Jehan
a60b16f497 app: grab HSV values directly from GeglColor.
Absolutely no need to use intermediate GimpRGB and GimpHSV now convert data
ourselves with gimp_rgb_to_hsv() and gimp_hsv_to_rgb().
2024-02-11 23:28:02 +01:00
Jehan
7de118051f app: the Device Status dockable now shows context-sensitive colors.
I moved the function to select a valid contextual RGBA format as a core API
gimp_context_get_rgba_format(). This same API is now used in context actions, as
well as in the GimpDeviceStatus widget.

The latter now shows per-device fg/bg colors relatively to the active image's
format. The tooltip will also display contextual information (i.e. either the
image's name whose space is used, or sRGB).
Of course, this all updates when switching images by connecting to the
image-changed signal.
2024-02-11 23:28:02 +01:00
Jehan
cd09634dc2 app: update fg/bg color action code modifying colors through RGB axes.
In space invasion world, we want color-related code to be contextual. When we
say "Increase/Decrease the red/green/blue channel by X%", it would actually mean
something different if you are working on a sRGB space or a wider gamut space.
Furthermore, it means also something different if you work on linear/perceptual,
overriding the space's actual TRC.

This is why this new code takes the active image into account and uses this as a
base for the space and TRC you are working on. In case you have no active image,
it defaults to the current GeglColor space (though really this case should not
matter too much). In case your image is not RGB to begin with, it uses sRGB
space.
2024-02-11 23:28:02 +01:00
Jehan
b1178c51a3 libgimpconfig: support the GimpRGB format for GeglColor.
Some old config files will contain (color-rgb) contents. Also some data, such as
historical tool presets (.gtp files) will have such values in their
(tool-options).
2024-02-11 23:28:02 +01:00
Jehan
cd32b3bffa libgimpconfig: add support for GeglColor config properties.
GeglColor properties are serialized this way:
(propname "encoding" bpp pixel-data profile-size profile-data)
2024-02-11 23:28:02 +01:00
Jehan
4d0df90e26 libgimpconfig: fix some memory leaks when deserializing raw data. 2024-02-11 23:28:02 +01:00
Jehan
dbbcfb16d5 app, libgimp*, pdb, plug-ins: GimpContext is now using only GeglColor.
- app: gimp_context_get_(foreground|background)() are now returning a GeglColor.
- libgimp: PDB functions named similarly in libgimp are returning a newly
  allocated GeglColor too.
- A few other PDB functions (the ones using these functions) were updated and
  their signature changed to use GeglColor too, when relevant. Plug-ins which
  use any of the changed libgimp functions were fixed.
- GimpContext: signals "(foreground|background)-changed" are now passing a
  GeglColor.
- libgimpconfig: new macro GIMP_CONFIG_PROP_COLOR using gegl_param_spec_color().
- GimpContext: properties "foreground" and "background" are now GeglParamColor
  properties.
- app: All code interacting with GimpContext objects were updated to receive a
  GeglColor (that they may still convert, or no, to GimpRGB for now).
- app: gimp_prop_gegl_color_button_new() was added as an alternative to
  gimp_prop_color_button_new() when the property is a GeglParamColor. Eventually
  the former should replace completely the latter.
- libgimpwidgets: gimp_prop_color_area_new() now works on GeglParamColor
  properties only.
- libgimp: gimp_procedure_dialog_get_widget() will generate a GimpColorArea for
  GeglTypeParamColor arguments.
2024-02-11 23:28:02 +01:00
Jehan
229994957c libgimpwidgets: improve a tiny bit the error message to help debugging. 2024-02-11 23:28:02 +01:00
Jehan
f18266cb04 app, libgimp, pdb, plug-ins: gimp_context_[gs]et_foreground() now using GeglColor.
Also the color is internally stored as GeglColor, though there are still get
APIs and signals using GimpRGB.

The equivalent PDB functions are also changed to use GeglColor, same as app/
functions.
2024-02-11 23:28:02 +01:00
Jehan
9602926012 libgimpcolor: new functions gimp_color_set_alpha() and…
… gimp_color_is_perceptually_identical().

gimp_color_is_perceptually_identical() is meant to replace gimp_rgb_distance()
which is anyway always used to decide whether 2 colors can be considered equal.
So rather than having a distance algorithm which we won't be able to change
later on (if people start relying on specific values), let's just give the
answer directly on what's a same color (perceptually) or not.

Also now the distance is computed through the intermediate color space LCh which
seems to be one of the most perceptually uniform space, therefore a good choice
for such an algorithm (comparing distances on a non-perceptual uniform space
doesn't make very much sense, since a same distance may be perceived differently
in different subspaces).
2024-02-11 23:28:02 +01:00
Jehan
39544f96b4 app: some more GimpRGB to GeglColor port.
The picked() signal of GimpColorTool now emit a GeglColor.
2024-02-11 23:28:02 +01:00
Jehan
ecf4cfb3c5 app, libgimp, pdb, plug-ins: getting rid of some GimpRGB usage.
This is a first commit to really getting rid of GimpRGB within core and
PDB/plug-in code. This will make color conversion reliability a lot better as
GeglColor will handle conversions for us. The goal is that we should keep origin
color space (for instance when picking colors in a GimpPickable, or when storing
in the FG/BG colors or in paletters) until the last second and convert at use
only.
It's still very much work-in-progress.
2024-02-11 23:28:02 +01:00
Jehan
75efbf77d3 Issue #9790: reimplement gimp_drawable_[gs]et_pixel().
These 2 functions were removed in commit 89c359ce. They were in fact used and
clearly this historical API seems interesting (though we can likely do the same
thing using the drawable GeglBuffer, but this way is much easier).

This is now reimplemented using GeglColor instead of raw data.
2024-02-11 23:28:02 +01:00
Jehan
7814f011d0 libgimp*, pdb: support of GeglColor in the PDB.
Eventually this is meant to fully replace GimpRGB (as well as GimpHSV, GimpHSL
and GimpCMYK), both in libgimp and in core code, as part of both the space
invasion and the API rework. For this first commit, I keep this new object side
by side to GimpRGB.
2024-02-11 23:28:02 +01:00
Alx Sa
f6ff73210d core: Ignore selection when merging NDE
gimp_drawable_filter_apply () is affected
by the active selection. This causes display
glitches when merging all filters or
undoing a merge while an active selection
is on the image.

This patch saves the current selection,
clears it, merges/unmerges the filters,
then reapplies the selection to avoid the
problem. In the future, this should be
re-examined (when filter masks can be
edited).
2024-02-11 22:14:15 +00:00
Øyvind Kolås
9e6f90d664 meson,app: depend on GEGL-0.4.48 2024-02-11 22:42:16 +01:00
programmer_ceds
3a6e2913ed Correct upper limit shown in console browser for SF-OPTION controls (fixes #10796) 2024-02-11 19:25:56 +00:00
Alx Sa
8285795367 plug-ins: Restore screenshot delay on Windows
Resolves #10802.
Since the GimpProcedureDialog port, the Windows version
of the Screenshot plug-in has been missing the
"Screenshot Delay" option. This is because Windows did not
have the SCREENSHOT_CAN_DELAY_WINDOW_SHOT enum
set. Adding that back in restores the option.
2024-02-11 17:11:45 +00:00
Ferry Jérémie
1a041b65d1 correction : keep <rec> node and put opacity to 0 2024-02-10 19:56:15 +00:00
Ferry Jérémie
06064a6e5a Issue #9282 : deleting a rect node => black squares instead of symbolic icons 2024-02-10 19:56:15 +00:00
Ferry Jérémie
e397fb512a Issue 9268 : a <rect> node cover the picture 2024-02-10 19:56:15 +00:00
Sabri Ünal
032d930e23 Update Turkish translation 2024-02-10 11:20:41 +00:00
Sabri Ünal
69bf2f1897 Update Turkish translation 2024-02-10 11:06:40 +00:00
Sabri Ünal
6ea9b2d40d Update Turkish translation 2024-02-10 11:04:07 +00:00
Sabri Ünal
ee5fc1d484 Update Turkish translation 2024-02-10 11:03:58 +00:00
Jordi Mas
abe25cd0c0 Update Catalan translation 2024-02-10 08:03:20 +01:00
Jordi Mas
a1a38cb933 Update Catalan translation 2024-02-10 07:59:28 +01:00
Alx Sa
a2b683e53c tools: Move tool effects under NDE effects
Applying the same reordering code
in cbb1e816 to the Gradient and Cage
tools.
2024-02-09 23:23:47 +00:00
Yuri Chornoivan
bca419f9da Update Ukrainian translation 2024-02-09 20:41:58 +00:00
Bruno Lopes
e977b1b03b build/flatpak: Move Build instructions to gimp-web-devel
Here, the instructions was hard to find in the middle of maintainer stuff.

Also, be able to build GIMP without dev-oriented distros is something very
desirable, and the gimp-web-devel is the suited place fot it.
2024-02-09 15:29:45 -03:00
Jehan
6e6239c882 NEWS: update. 2024-02-09 19:10:46 +01:00
Ekaterine Papava
9043eeb837 Update Georgian translation 2024-02-09 17:55:10 +00:00
Ekaterine Papava
94ed0c0fe5 Update Georgian translation 2024-02-09 17:52:31 +00:00
Alx Sa
cbb1e81686 tools: Apply Warp below NDE filters
Resolves #10736.

By default, any filter added with a drawable with
gimp_drawable_filter_new () will be added on top
of the filter stack. Now that we have NDE effects,
there can be multiple live filters when drawing.

The Warp tool applies a GEGL operation as well,
and now it draws on top of any existing effect.
This patch adds code to move the Warp's filter
below any other NDE effects so it operates on
the raw pixels only.

Note that a longer term solution might be to have
a separate stack for tool-based GEGL operations,
but that would be a post 3.0 discussion.
2024-02-09 17:48:53 +00:00
Jehan
25145b9684 Issue #10745: move the "item set" icon above layer list.
- The icon itself was changed to a "search" icon. Though it kinda made sense to
  keep the "link" reference when I first implemented this, as a reference to how
  we used to link items (whereas now we select them together), in the grand
  scheme of things, it's not such a good idea and many won't likely understand.
  But everyone will understand a "search" button. :-)
- It's now next to the label displaying the number of selected items, in the
  item tree view header. This makes much more sense there. Also it makes the
  long list of bottom buttons slighly shorter.
- Finally I make this feature accessible to the channels and paths, by actually
  moving it out of GimpLayerTreeView and into GimpItemTreeView.
2024-02-09 18:22:43 +01:00
Alx Sa
d6edd71c4f xcf: Save/load GEGL seed parameter
Certain filters like Supernova have a
random seed property. According to the
specifications it's an unsigned int, so we
can save and load it with existing
functions.
2024-02-09 11:20:42 +00:00
Jehan
979900fcdf gitlab-ci, build: BUILD_TYPE not set for packaging-win-a64 job.
Aaaargh! I think this was the main issue which would explain why the problem was
mostly happening on the packaging job. In this job, we were still consistently
calling `pacman --noconfirm -Suy` (i.e.g "Synchronizing package databases")
which we had stopped to do for the CI builds as that was highly increasing
chances of locking pacman's process.
2024-02-08 21:00:07 +00:00
Jehan
a3d8f65946 gitlab-ci: terminate all msys2 related processes before Windows/Aarch64 jobs.
This is the command suggest by MSYS2 developers here:
https://github.com/msys2/MSYS2-packages/issues/4340#issuecomment-1887695290

They also say to run it outside the MSYS2 environment, which is why it's in the
CI rules, not in the shell script.

Honestly at this point, it feels like we are just stacking weird workaround to
get it to fail not too often. ;-(
2024-02-08 21:00:07 +00:00
Jehan
effe39d688 build: add gettext-tools dependency from MSYS2 repo.
gettext was recently split into 2 packages. While we didn't have the issue on
hmartinez82's runner, because old packages are not wiped out (as they should),
this issue first appeared on our new Arm runners.

This fixes the following error in our Windows build:

> /usr/bin/msgfmt: cannot locate ITS rules for ../data/tips/gimp-tips.xml.in

See:
* https://gitlab.gnome.org/Infrastructure/gimp-web-devel/-/merge_requests/52
* https://github.com/msys2/MINGW-packages/pull/19913
2024-02-08 21:00:07 +00:00
Jehan
5040eb88fb build: break ninja && ninja install into 2 calls.
Fixing a case where the script continued after a failed `ninja`. After further
testing on how `set -e` works, it looks like a toplevel `false && true` command
will fail the script (which is what we want), but it won't when inside an `if`
block!

Breaking it down into 2 separate calls fail the script correctly though. So
let's do this.
2024-02-08 21:00:07 +00:00
Jehan
ea3ec94bfb build: work around repetitive pacman failures by retrying.
MSYS2 pacman gets randomly stuck on Windows/Aarch64. The actual issue is still
being investigated by upstream projects, though anyway it's bad for us right
now, to the point that there are discussions to remove Aarch64 support from the
Windows installer (whereas it just got added recently!) in #10729.

This is an attempt to a workaround. Instead of getting stuck forever and waiting
until the whole job times out (per Gitlab CI settings), I time-out (after 3
minutes) the pacman command within our script and try again, up to 2 more times.
Hopefully one of the calls would succeed.

I also send a SIGKILL through the timeout (though I have no idea how signals
translate to Windows processes) and run again taskkill after this, which may
seem overkill. Interestingly I get output for both, which seems to indicate that
the kill succeeds in both cases (because of several processes?).

Anyway clearly it's a bit of random code not completely understood, but the
inability to test this all locally clearly doesn't help so it's good enough for
the time being.

See: https://github.com/msys2/MSYS2-packages/issues/4340
2024-02-08 21:00:07 +00:00
Alx Sa
d8b1dd8a37 Core: Explicitly merge down NDE filters on flatten
Resolves #10769.

Flattening an image or merging down layers caused
us to lose NDE filters on undo, as we flattened with
gimp_gegl_create_flatten_node () which didn't create
an Undo/Redo object.
To fix this, we merge the filters down beforehand with
our API so that they will be restored when undoing.
2024-02-08 17:04:25 +00:00
Alx Sa
92aad54cca widgets: Fix crash and formatting from NDE
Resolves #10768.
During NDE development, the Show/Hide All
function name was changed. This was not fixed
in one location where we blocked it during popup
creation, so the signal was running on dead objects.
This patch fixes this. It also fixes a few formatting
errors made during NDE development.
2024-02-08 14:03:55 +00:00
Jehan
1bf506abc6 gitlab-ci: clarify multi-command shell block.
Two shell commands got merged as one line. This seems to work fine on
hmartinez82's runner, unlike on our new runners. Anyway it is likely good
practice to clearly separate the commands.

Fixing:

$ if ($stuck -eq "True") { Remove-Item -Force -Path "C:\msys64\var\lib\pacman\db.lck" Write-Output "Cleaned previous stuck pacman" }
Remove-Item : A positional parameter cannot be found that accepts argument 'Write-Output'.
At line:279 char:26
+ ... q "True") { Remove-Item -Force -Path "C:\msys64\var\lib\pacman\db.lck ...
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidArgument: (:) [Remove-Item], ParameterBindingException
    + FullyQualifiedErrorId : PositionalParameterNotFound,Microsoft.PowerShell.Commands.RemoveItemCommand
2024-02-07 22:48:37 +01:00
Sabri Ünal
48b3b7f2bd Update Turkish translation 2024-02-07 12:49:05 +00:00
Alx Sa
9860377871 widgets: Prevents NDE edits on pixel locked layers
Resolves #10766.
Currently, GIMP does not support applying or editing
filters when the layer is pixel locked. This patch
prevents users from attempting to edit filters via the
NDE popover UI, and notifies them of why.
2024-02-07 04:47:49 +00:00
Vasil Pupkin
be7f2964de Update Belarusian translation 2024-02-06 23:38:39 +00:00
Alx Sa
3e200c81d7 widgets: Don't merge filters on pixel locked layers
Resolves #10767
Since you can't merge other layers onto a pixel
locked layer, it makes sense to prevent that with
NDE filters as well.
2024-02-06 18:20:36 +00:00
Alx Sa
ba05730f78 core: Fix invisible filter merge bug
If any NDE filter is hidden when merged, the entire layer
is hidden. This patch changes the behavior so that the
invisible filter is removed instead of committed when
merged down.
2024-02-06 15:34:39 +00:00
Jehan
768b01fbf5 desktop: small grammar fix.
Just noticed this while reviewing the Welcome dialog. Since it's user-facing
text, let's avoid too many grammar errors.
2024-02-06 15:49:41 +01:00
Jehan
0e10dacc87 libgimpwidgets: properly set the icon theme even at initialization.
Without this, when creating the new config folder for the first time
(update from 2.10 to 2.99/3.0), if say "Legacy" icon theme was set, it
would not show on the first run, though it would show on the second run.

Now it shows directly on the first run.
2024-02-06 15:10:32 +01:00
Jehan
a5cc3759b3 Issue #10731: icons are broken at first run. 2024-02-06 15:04:52 +01:00
Vasil Pupkin
f2681ac49c Update Belarusian translation 2024-02-06 03:54:12 +00:00
Daniel Novomeský
d326e1350e plug-ins: clean-up HEIF plug-in
Plug-in now requires libheif >= 1.15.1, so many preprocessor
directives like LIBHEIF_HAVE_VERSION(1,13,0) are no longer needed.
2024-02-05 13:28:13 +01:00
Daniel Novomeský
63aa33f808 meson: require libheif >= 1.15.1 2024-02-05 13:28:13 +01:00
programmer_ceds
6d10bbf856 Guides scripts enabled when multiple drawables selected (fixes issue #7535) Take 2 2024-02-04 18:26:45 +00:00
Anders Jonsson
f13d007a95 Update Swedish translation 2024-02-04 18:21:22 +00:00
Anders Jonsson
0aa74267c6 Update Swedish translation 2024-02-04 14:07:29 +00:00
Yuri Chornoivan
fa0ab5ee1a Update Ukrainian translation 2024-02-03 20:32:29 +00:00
Alx Sa
0bca939daf scripts: Port scripts with SF-OPTION
After ab626e79, Script-Fu v3 now has the
SF-OPTION parameter again. This patch
ports a few scripts that use it or were
not otherwise covered by other merge
requests.
Note that further improvements are
necessary to allow these to work on
multiple layers simultaneously.
2024-02-03 18:39:10 +00:00
Sabri Ünal
3c264411ad Update Turkish translation 2024-02-03 18:05:15 +00:00
bootchk
ab626e79ec 2.99 ScriptFu: add custom widgets to GimpProcedureDialog
For version 3 scripts, using script-fu-register-filter

Widgets for SF-OPTION and SF-DIRNAME

Fixes #9992

Test case is Sphere v3.

Note that SF-VECTORS is still not supported,
until there is a VectorsChooser widget in libgimp.

A step towards deprecating old-style scripts using script-fu-register,
and deleting script-fu-interface, the duplicate dialog for SF.
But we still need to change or replace script-fu-register (for non-filter plugins)
to use GimpProcedureDialog.
2024-02-03 15:27:16 +00:00
Stanislav Grinkov
978a795eb7 plug-ins: replace manual creation of GimpDrawablePreview's...
... with the call to gimp_procedure_dialog_get_drawable_preview(...) function.
2024-02-03 21:02:40 +06:00
Stanislav Grinkov
31b4e8122b libgimp: new gimp_procedure_dialog_get_preview_from_drawable() function.
This allows plug-in developers to create GimpPreviewDrawable widgets
with the procedure dialog API.
2024-02-03 21:02:40 +06:00
bootchk
e9f24beb6b ScriptFu: no compiler warning converting float to int MIN_RESOLUTION 2024-02-03 09:34:58 -05:00
Alx Sa
cc62f2b037 actions: Load Gegl properties when editing filters
Some GIMP-custom GEGL operations do not use GimpConfig to
store their properties (for instance, Threshold). 
Previously, we weren't copying over their values when editing an
NDE filter.
This patch adds code to copy over the Gegl properties if there is
not a GimpConfig object attached to the filter.
2024-02-02 22:42:02 +00:00
Alexandre Prokoudine
26d8c971a1 Update Russian translation 2024-02-02 13:05:48 +01:00
Jordi Mas
21170ad2b7 Update Catalan translation 2024-02-01 18:29:51 +01:00
bootchk
68cc92f939 libgimp: fix #10730 gimp_procedure_dialog_get_file_chooser precondition wrong 2024-02-01 11:39:00 -05:00
Jehan
e7b85e3d67 Issue #10725: do not test for lua-lgi when lua can't be run.
In particular in a cross-compilation environment where you don't have an exe
wrapper or cross-host run ability, you still want to be able to configure GIMP.

It is also possible to install lua scripts anyway with -Dlua=enabled, bypassing
ability to test lua-lgi presence (a warning will be outputted at configuration
time, but no error).
2024-02-01 15:46:55 +00:00
Jehan
0902e45901 build: jobs must return in failure when a dependency build fails.
While this is the job of `set -e`, putting parts of the script in shell
functions hid error returns in the build-deps-msys2 script.
Cf. #10729.

For the build-gimp-crossroad script, let's just add `set -e`.
Cf. #10725.
2024-02-01 15:46:55 +00:00
Anders Jonsson
a07b3c803b NEWS: typo and grammar fixes 2024-02-01 16:17:32 +01:00
Ekaterine Papava
f2ffdfefa3 Update Georgian translation 2024-02-01 02:24:08 +00:00
Ekaterine Papava
4ba8721f12 Update Georgian translation 2024-02-01 02:19:29 +00:00
Jehan
b89d90de42 NEWS: update. 2024-01-31 15:37:02 +01:00
Jehan
495523db39 themes: removing "Darker" theme.
I believe there is a real use case for darker or lighter themes, but this
particular theme is not particularly maintained and has no light variant (or to
be accurate: the light variant is just a link to the "Default" one). If someone
is interested in such themes, we'll welcome contributions to revive a new theme
which should have at the very least both a light and dark version, and we could
name it "Contrast" (rather than "Darker" which focuses on a dark variant only).

I think it's better to do it this way rather than releasing with a half-done
job.
2024-01-31 15:27:50 +01:00
Jehan
87a3073b04 app, themes: get rid of Compact theme and move its logic into code.
The Compact theme code is nearly the same as the Default one, apart from setting
palette icon size to small (which is already something done by the "Override
icon sizes" setting in Preferences), setting font-size to small (which can be
independently set by our "Font Scaling" setting) and setting 3 paddings.

Rather than having this separate theme, it feels like just moving the padding
changes as part of the icon size makes sense. In particular since, when setting
icons to "Small" right now, the default padding really feels a bit huge and out
of place. So all-in-one seems a better choice.

At first, I wanted to set a padding proportional to the icon size, but it didn't
work well. For now, I'll just choose padding sizes manually.
2024-01-31 15:27:50 +01:00
Marco Ciampa
f9a75fbe80 Updated Italian translation 2024-01-31 13:46:14 +01:00
Alx Sa
5f561bfbca tools: Don't make nop effects non-destructive
If you run the GEGL Operation tool without choosing
a filter, it leaves a "gegl:nop" layer effect behind.
This is not useful, so we check and set such filters as
destructive to get rid of when applying an effect.
2024-01-31 11:38:40 +00:00
Anders Jonsson
3d721935eb Update Swedish translation 2024-01-30 21:19:28 +00:00
Yuri Chornoivan
e667cc48d3 Update Ukrainian translation 2024-01-30 20:40:24 +00:00
Jehan
961248528b Issue #9712: image finalization should be propagated through GimpContext.
This was provoking a CRITICAL in #9712, in the GimpFgBgEditor which was tracking
the active image, but even before this, I experienced a crash in
GimpLayerTreeView code with the same steps.

The problem is that in some cases, the image switch happens once the currently
active image is already disposed. In particular we had the case in multi-window
mode where closing a window would free a GimpImage yet without necessarily
setting another image as active, since it depends on window focus in MWM (and
the other image windows may not gain focus immediately; this depends on the
window management logic).

Therefore we had various handlers in Gimp*TreeView (or GimpFgBgEditor and
possibly other places) code which tried to disconnect or work on now freed
pointers. To handle such case, let's connect to image finalization and set the
context to NULL image.
2024-01-30 21:31:04 +01:00
Jehan
2294ad12fc app: fix crash when setting an action insensitive without setting reason.
When working on #9712, I encountered this crash first before the main issue
(with the same reproduction steps as listed by Wormnest): reason may not be set
by the method. It's better to always explicitly set this variable to NULL first.
2024-01-30 21:31:04 +01:00
Alx Sa
e5592f2adf actions, dialogs, widgets: Windows Dark Mode title bar fixes
Making more dialogues use the title bar
theme code from ad8b47bf on Windows.
2024-01-30 15:58:07 +00:00
Alx Sa
34d613f364 Fix regression caused by 2c9668cb
2c9668cb did not contain the updates to gimpicons.h
introduced in c4f5bae1, accidentally reverting back
two function signatures to before that commit.
2024-01-30 15:55:10 +00:00
Alx Sa
2c9668cbb4 widgets: Add Effects icon to layer dockable header
Also creates a GIMP_ICON_EFFECT
constant so that a new permanent
layer effects icon can be assigned to it
2024-01-30 04:06:39 +00:00
Jehan
d28a577a12 Issue #9410: override prefer-symbolic-icons for mono-style icon themes.
The current GTK algorithm for finding an icon seems to be:

  main icon theme in choosen style > fallback icon theme in choosen style >
  main icon theme in another style > fallback icon theme in another style

Where "style" is either color or symbolic variant of a given icon. The problem
is therefore if say your prefered style is "Symbolic" and you choose a
Color-only icon theme. In such a configuration, all icons which are also
available in the system theme with a symbolic variant will be used from the
system theme (even when they are actually available in the chosen icon theme
too, yet in a color variant) and you get a weird mix of part of the icons as
symbolic from system theme and another part as color from the chosen theme.

In order to avoid this weird situation, we only set -gtk-icon-style CSS value to
the prefer-symbolic-icons property if the chosen icon theme has both style
variants. Otherwise we force the only variant of the chosen icon theme.

The icon "gimp-wilber" is used to determine whether an icon theme has both
variants, which should be documented in the developer website for icon theme
makers.
2024-01-29 21:48:17 +01:00
Kolbjørn Stuestøl
6a06985064 Update Norwegian Nynorsk translation 2024-01-29 18:57:04 +00:00
Jehan
2102e58884 Issue #9752: actually check for lua-lgi at configuration.
The -Dlua option has 3 cases:

1. disabled: lua plug-ins aren't installed at all.
2. auto: lua plug-ins are only installed if we find a lua installation
   with access to the 'lgi' module. We now do the actual test at configuration
   (not only lua existence test, but also lua-lgi).
3. enabled: lua plug-ins are always installed but if no lua installation with
   'lgi' module is found, a warning is displayed at end of configuration step.
2024-01-29 18:42:45 +01:00
Jehan
224879db91 icons: delete unused meson.build ad fixup for commit c4f5bae14a.
These should have been deleted. This is an oversight.
2024-01-29 17:48:54 +01:00
bootchk
888adc5b96 2.99 Test: add more tests
Add tests of context stack ops.

Add test of paint methods.

Test convert to all precisions.

Test paint dynamics.

Test PDB as database.

Test PDBProcedure methods.

Test display methods.

Test drawable operations.
2024-01-29 09:24:07 -05:00
Alx Sa
cc1f1b5900 scripts: Port add-bevel to new API
While the script is made aware of multiple selected layers,
it still only works on the top selected layer.
Mnemonics were also added to the GUI fields,
and an unused "type" parameter was removed.
2024-01-29 13:36:37 +00:00
Bruno Lopes
95deb1dae3 Issue #10580: Package and Distribute 'gegl' on Windows
This helps more advanced users to using GEGL in different contexts.
2024-01-27 20:12:05 -03:00
Bruno Lopes
5f164ef913 build/windows: Extend unified list to Deps scripts
The list contains, in addition to the GIMP deps, all babl and GEGL deps.
So, let's use it.
Also, nothing new under the sun. We already use a unique list on the
Windows build instruction page (for stable branch) and do the same to
Debian image job.
2024-01-27 20:30:13 +00:00
Jehan
c4f5bae14a app, icons, libgimpwidgets: merge Color and Symbolic icon themes into one.
The merged icon theme is simply named "Default" and contains a color and
symbolic variant for all icons. While in 2.10, it made sense to have both icon
themes because a theme had no concept of a "symbolic" variant back then, icon
themes in 3.0 have this concept and we support this in GIMP through the "Use
symbolic icons if available" option in Preferences.

Until now, it was confusing to have both themes + this option, even more as you
could use the Color icons with the "Use symbolic icons" option, which meant that
if some icons were missing, you could end up with a mix of color and symbolic
icons (and oppositely using the Symbolic theme with the option unchecked).

The new state is much simpler and less confusing. Just 1 icon theme with both
color and symbolic variants (the latter being used by default).

Note that the identical meson.build in each size subfolder is still mandatory
because of the inability of meson (still!) to generate files with
custom_target() in a subfolder as output.
2024-01-27 16:02:37 +01:00
Jordi Mas
e0373fba91 Update Catalan translation 2024-01-27 09:35:32 +01:00
Jacob Boerema
2bb0e2a636 tests: fix typo in function name 2024-01-26 13:49:48 -05:00
Jacob Boerema
e1c9ec5a06 tests: mark tests skipped due to no display as skipped
We were skipping tests when there is no display, which is always the
case on Windows. However, these tests always showed as succeeded.
Unless you looked at the test log, you wouldn't noticed that most of
the tests weren't actually performed.

Exit these tests with the value GIMP_EXIT_TEST_SKIPPED instead of
EXIT_SUCCESS.
2024-01-26 13:47:20 -05:00
Jacob Boerema
064fd69f18 tests: fix #10694 test suite fails due to use of g_assert
You are not supposed to use g_assert in tests because g_assert can be
disabled using -DG_DISABLE_ASSERT, which makes tests fail.

Instead let's use the recommended replacement g_assert_true. At this
time we are not bothering using more specific g_assert_* functions,
since there are plans to change our test suite.
2024-01-26 13:44:30 -05:00
Daniel Novomeský
1148213825 build: Install QOI header manually 2024-01-26 14:47:00 +01:00
Yuri Chornoivan
7ff284c56f Update Ukrainian translation 2024-01-26 13:18:11 +00:00
Alx Sa
4a10b11e3e libgimpconfig: Fix cross-platform gsize warning
gimp_config_writer_printf () is used to print out a gsize variable, data_length.
gsize's actual size varies depending on platform, so using the format "%lu" throws
a warning on some platforms and switching to "%llu" throws a warning on others.
@Wormnest suggested ("%" G_GSIZE_FORMAT) as a universal format to resolve
this warning.
2024-01-26 12:08:18 +00:00
Jehan
c32e803679 app, themes: merge the Gray and Default themes and add theme color scheme concept.
Until now, we were following a similar concept of color schemes as what most OS
are doing. For instance, Freedesktop recently introduced a tri-state color
scheme of "Prefer Light", "Prefer Dark" and "Default", the latter being either
whatever the software prefers (e.g. we prefer either Dark or Gray for graphics
software usually) or what the system prefers. See #8675.

Until now, with GTK, we only had a boolean "prefer dark" setting through the
"gtk-application-prefer-dark-theme" settings. There is not even a "prefer
light".

Nevertheless for graphics application, there is clearly a third case (fourth if
we added a "follow system color preferences" which we don't implement for now):
gray mode and in particular middle gray. Having a middle gray UI is often
considered a necessity when working on colors in order to protect our perception
of color from being influenced by surrounding UI.
To fill this need, we were proposing a Default vs. a Gray theme in GIMP, but
this was a bit confusing and felt illogical, as discussed on IRC some time ago.
Also depending on whether you chose "prefer dark" or not for the gray theme,
this one was itself 2 themes, which made things odd and harder to work on.

Instead this commit:

- adds a color scheme concept in GIMP with 3 variants so far: light, gray and
  dark. A possible fourth (future) variant might be to follow the system
  preference (do all OS provide such a queriable option?).
- Our Gray theme is merged into Default (as the gray color scheme variant).
- Custom themes can add the following CSS files: gimp-light.css, gimp-gray.css,
  gimp-dark.css which are the base file for their respective scheme. gimp.css is
  still used as a fallback though it is not necessary (our own Default theme
  does not provide a gimp.css anymore). Custom themes don't have to provide all
  3 variants. A theme can just provide one or 2 variants if it only wants to
  support 1 or 2 use cases.
2024-01-25 18:56:13 +01:00
Sabri Ünal
e741920d8e Update Turkish translation 2024-01-25 14:42:40 +00:00
bootchk
69fedf6995 Fix #10475 double popup context menu on RMB in dockable chooser
Chooser return GDK_EVENT_STOP so parent manager does not also popup second menu.
Specifically, return the result of the call to gimp_editor_popup_menu_at_pointer.
When a menu does pop up (for a dockable), that result is GDK_EVENT_STOP
and the event does not propagate to the parent widget.

Added a comment about why we ignore the result of a call
to gimp_editor_popup_menu_at_pointer in another place,
since it is not obvious why that call is different.

All other current behavior retained.
Other current behavior might be separate issue:
LMB or RMB outside any item, or in the current selected item,
in the chooser that popups from the toolbox,
should probably close the popup chooser, or give an audible alert,
because it does nothing.
Note that a chooser is also used in a remote dialog for a plugin,
and it closes a different way, choosing an OK button.
2024-01-25 14:13:00 +00:00
Jehan
0ea48926aa NEWS: update. 2024-01-25 15:08:13 +01:00
Yuri Chornoivan
743230fbe6 Update Ukrainian translation 2024-01-25 13:56:14 +00:00
Marco Ciampa
ecfc90d202 Updated Italian translation (WIP) 2024-01-25 11:17:03 +01:00
bootchk
6aa9f97819 Fix #10690 build broken on GLib < 2.74
Use 0 instead of new symbol G_CONNECT_DEFAULT first defined in glib2.74
2024-01-24 13:30:10 -05:00
Jacob Boerema
f78186e03b Get rid of old Windows specific defines
MINGW64
- uses 0x601 as value for _WIN32_WINNT. No need for us to define
it to that value or even lower values in some places.
This also gets rid of:  warning: "_WIN32_WINNT" redefined
- has 0x0502 for WINVER, so get rid of us setting it to 0x0500 in
gimp-app-test-utils.h. It also seems that the need to use G_OS_WIN32
has disappeared here.
- DIRECTINPUT_VERSION is 0x0800, no need for us to set it to that value.
- AI_ADDRCONFIG was apparently missing from the MINGW headers in the
past, but not anymore.
2024-01-24 12:10:00 -05:00
Anders Jonsson
be1259de2b Update POTFILES.in 2024-01-24 09:18:47 +01:00
Ekaterine Papava
6c21b03631 Update Georgian translation 2024-01-23 21:30:33 +00:00
Ekaterine Papava
1c0c8ac38f Update Georgian translation 2024-01-23 21:24:51 +00:00
Jehan
d1ea2f35c3 desktop: update the <release> info in AppStream metadata. 2024-01-23 22:09:03 +01:00
Anders Jonsson
e3896352b9 app: fix test-ui typo 2024-01-23 20:46:01 +00:00
Yuri Chornoivan
65f99b66fa Update Ukrainian translation 2024-01-23 20:44:10 +00:00
Yuri Chornoivan
cdde3f220f Update Ukrainian translation 2024-01-23 19:36:48 +00:00
bootchk
25280ffdb1 test: add tests of paint ops. 2024-01-23 18:30:32 +00:00
Jehan
3f54d83bac app: do not maintain manually the list of core ops with custom config object.
The list of objects where the config object is a dedicated custom class (instead
of a runtime-registered class) is well known. These are the operations
registered inside gimp_operations_init().

The list inside gimp_gegl_procedure_execute_async() which the previous commit
was updating was not right: it was still missing "gimp:hue-saturation" and
"gimp:threshold" should not have been on the list (this was generating a
CRITICAL when trying to get the "config" property on this object).

Instead let's add some init/exit() functions in gimp-operation-config API to
distinguish the operations with custom config (registered during init) with all
the others. Then we add gimp_operation_config_is_custom() which can be used
everywhere where we want to verify if an operation is using a custom-made config
object or a generated class just mirroring the operation properties.

This way, we should not get out-of-sync anymore.
2024-01-23 15:39:09 +00:00
Alx Sa
7a05a8956f tools: Fix Color Balance editing crash
Adds gimp:color-balance to the list of
GIMP-specific GEGL operations we
retrieve the GimpConfig settings from.
Also prevents trying to set a GEGL
property when editing if it couldn't be
converted properly (e.g. GimpConfig)
2024-01-23 15:39:09 +00:00
Jehan
956f16e173 Issue #10566: support GimpConfig and enum arguments and a few more fixes.
Now that we save GEGL operation arguments ourselves (instead of relying on
GEGL-generated XML), we can serialize and deserialize GimpConfig arguments which
are used in various operations implemented within GIMP core code.

Additionally:

- Also support saving and loading all enum types.
- PROP_EFFECT_ARGUMENT renamed to PROP_FILTER_ARGUMENT for consistent naming.
- A bit more accurate handling on save and load errors with dedicated messages
  to various issues.
- Use PROP_FLOAT_OPACITY instead of the obsolete 8-bit PROP_OPACITY (actually
  32-bit but stored as 0-255 int).
- Fix a leaking string.
2024-01-23 15:39:09 +00:00
Alx Sa
8b2975e0e8 Additional minor fixes
*It's possible to have one layer selected but edit the filter of another layer.
The FilterTool code was updated to use the filter's drawable if editing.
*Prevents editing if multiple layers are selected.
This is a current limitation of the filter tool itself, but it was causing issues with NDE.
*If an XCF with a filter from a third-party plug-in is loaded, the filter won't be
created if the user doesn't have it installed.
Note that GEGL still throws a lot of warnings about missing properties - not sure how to resolve that.
*Refresh drawable when finished editing a filter to fix issue with lingering preview splits
*Fix issue with loading more than one filter after XCF format changes
2024-01-23 15:39:09 +00:00
Jehan
a489345e77 app: a few fixups to MR !958 (initial non-destructive editing).
- Do not leak allocated return value of gegl_node_to_xml_full().
- When merging layer effects, use gimp_drawable_filter_commit(), making
  sure we use the exact same code path as when applying layer effects
  destructively from the start. This also ensures that filters are
  properly removed from the filter stack (unlike
  gimp_drawable_merge_filter()), which was the reason why the rendering
  was wrong (hence getting the buffer without effects first, then
  reapplying it after was only a workaround to an actual bug).
- When removing a filter, verify the object still exists before doing
  anything with it. If this was the last reference, we don't want to
  call functions on this object. In gimp_drawable_filter_commit(), we
  set up a weak pointer. In gimp_drawable_filter_remove_filter() itself,
  we save the pointer to the filter's drawable before actual removal (as
  we don't want to dereference a freed object later on).
- export_merge_layer_effects() should merge filters recursively through
  layer groups.
- clean up the XCF code:
  * No need to wrap the effect pointers list into 2 zero offset. Only
    have one zero offset to indicate the list end.
  * Add the layer effect mask in the effect structure (not in the layer
    structure), similar as for layer masks.
  * Effect name and icon made as main data in the structure, not as
    properties.
2024-01-23 15:39:09 +00:00
Alx Sa
e678a20951 core: Initial non-destructive editing implementation
This patch implements an initial form of
non-destructive editing. Filters now stay active
instead of being immediately merged down.
A new column is added to the layer tree view, which
can be clicked to show a pop-over menu.
Filters can currently be hidden/shown, edited, reordered,
deleted, and merged down from this pop-over menu.

Currently, this works on layers and layer selections only.
Plenty of room for improvement!
2024-01-23 15:39:09 +00:00
bootchk
ec90cd1d9a Add more tests of PDB API in ScriptFu. 2024-01-23 07:19:09 -05:00
Jordi Mas
aab48a7c89 Fixes to Catalan translation 2024-01-22 21:36:30 +01:00
bootchk
784cde7f14 Fix #10496 crash on RMB in chooser item not the current selection
Use g_signal_connect_object to ensure object passed to handler
is not destroyed in the middle of the handler by knock-on signal handling.

Note there are comments about this in gimpcontainertreeview.c line 1592.
And similar code i.e. calls to gimp_container_view_get_container
that seem to be intended to solve but might actually also be susceptible.
Those calls in icon view throw CRITICALs during this issue.
But testing of the tree view (a list instead of a grid)
doesn't seem to crash, so leave well enough alone.
2024-01-22 18:29:20 +00:00
Vasil Pupkin
7d8495fdd2 Update Belarusian translation 2024-01-22 18:27:38 +00:00
Sabri Ünal
84c2b63212 Update Turkish translation 2024-01-22 12:40:07 +00:00
Sabri Ünal
dff4486ab9 Update Turkish translation 2024-01-22 12:28:47 +00:00
Jordi Mas
a90f731d11 Update Catalan translation 2024-01-21 20:34:21 +01:00
Bruno Lopes
c60604a535 Partially revert "build/flatpak: Drop 'gimp_app_version' hardcoding"
As suggested by Jehan, the manifest will be configured by meson.
Of course, for CI compliance, this pushes the job to a further stage:
'packaging', which is what Flatpak is about, after all.

The distribution job name has also been changed, because when Store job
is merged, this will be the new nomenclature of the distribution jobs,
which was not changed since !1171 by lack of time.
2024-01-21 14:04:35 +00:00
dimspingos
0445f0b9ed Updated Greek Translation 2024-01-21 15:14:30 +02:00
Alx Sa
1b5c6630c3 widgets: Add MacOS-compatible menu separator
Per @lukaso, the "rightwards triangle arrowhead" character
doesn't render on MacOS. This patch uses a different character
for MacOS only until a standard character can be decided on.
2024-01-20 18:48:45 +00:00
Jürgen Benvenuti
462b874ae8 Update German translation 2024-01-20 18:45:20 +00:00
Kolbjørn Stuestøl
9a586890cf Update Norwegian Nynorsk translation 2024-01-20 15:26:58 +00:00
Bruno Lopes
ddf6d6e513 build/windows: Remove GTK patches
There is no point in keeping .patches in our source since we aren't applying
them and there are "backup" MRs in GTK: GNOME/gtk!3275 and GNOME/gtk!4432.
2024-01-20 09:47:48 -03:00
Boyuan Yang
182d3cece6 Update Chinese (China) translation 2024-01-20 01:55:17 +00:00
Boyuan Yang
1bccd22595 Update Chinese (China) translation 2024-01-20 01:53:35 +00:00
Boyuan Yang
f81be6d5b3 Update Chinese (China) translation 2024-01-20 01:53:20 +00:00
Alx Sa
bfcc812623 core: Fix warning when pasting to a mask
Resolves #10657.
d120e592 fixed a crash when pasting into an empty image.
However, it created a new issue when pasting into a layer mask.
It caused a later call to gimp_drawable_convert_type () to fail, as
the pasted image would not need to be converted if the image's
settings were used rather than the drawable.
This patch fixes both issues by checking if the selection/image is empty,
and assigned the base type and precision values from either the selection
or the image accordingly.
2024-01-19 22:44:51 +00:00
Bruno Lopes
161d6e6932 Add .vscode/settings.json compliant with Coding Style
As recommended in the Coding Style "Code editor" section:
https://developer.gimp.org/core/coding_style/#code-editor--integrated-development-environment-ide
2024-01-19 16:06:06 -03:00
Bruno Lopes
e653535ed2 .gitignore: Delete unused exceptions
The '_build' and '.vscode' folders (this in particular makes impossible
to commit settings.json) are not welcome in this general file, according
to Jehan comment:
https://gitlab.gnome.org/GNOME/gimp/-/merge_requests/1021#note_1801018
2024-01-19 15:43:46 -03:00
Jordi Mas
5a4a58a728 Update Catalan translation 2024-01-19 16:07:11 +01:00
Alx Sa
21d24467ad scripts: Fix "Remove all Guides" script bug
Resolves #10651
The "Remove All Guides" script calls
gimp-image-find-next-guide, which per
its description can take in 0. However,
the parameter sets 1 as the minimum
value.
This patch fixes the range so that it can
accept 0, which enables the Remove All
Guides script to work again.
It also updates the script to the new
multi-layer aware API.
2024-01-19 11:17:36 +00:00
Jehan
14abb71c34 NEWS: update. 2024-01-19 11:26:08 +01:00
Anders Jonsson
7a66111b19 Update Swedish translation 2024-01-18 21:01:16 +00:00
Bruno Lopes
ca5b2cd7c7 devel-docs: Update content according to 'gimp-web-devel'
- Drops HACKING file (it is outdated and we have the "same thing",
  updated, in the devel site), but moved PDB content to the README
* Update various links now to the devel site
+ Added 'TODOs' to avoid confusion from titles with empty content
  and removed some that are already implemented
2024-01-18 19:05:04 +00:00
Yuri Chornoivan
71ceff9125 Update Ukrainian translation 2024-01-18 17:51:16 +00:00
Yuri Chornoivan
088a4d42be Update Ukrainian translation 2024-01-18 17:49:22 +00:00
programmer-ceds
0514a07616 scripts: Update Guides from Selection API
Updates script to v3 code, which allows for it to work
when multiple layers are selected.
2024-01-18 11:14:31 -05:00
Bruno Lopes
107887f929 build/flatpak: Drop 'gimp_app_version' hardcoding
Now, the script reads the major.minor version automatically from the main
meson.build file, reducing maintenance work, which is already especially
high regarding flatpak because of the natural hashes updates etc.

Also, a small organization made to make the code more humanly readable.
2024-01-18 15:59:45 +00:00
Anders Jonsson
ab9f8146da app: mark missing tool option as translatable 2024-01-18 13:20:21 +00:00
Anders Jonsson
e2843e40cf libgimpwidgets: mark tooltips as translatable 2024-01-18 13:20:21 +00:00
Martin
f07ad4b2d6 Update Slovenian translation 2024-01-18 07:23:15 +00:00
Martin
cf133337c2 Update Slovenian translation 2024-01-18 07:21:36 +00:00
Bruno Lopes
b887211934 Issue #9106: Create desktop shortcut by default with Inno installer
As consensus on Windows contributors, it is more useful for most users
the generation of the desktop shortcut by default.
Now, users who don't want it should uncheck the option in custom install
or manually delete the shortcut after a full install.
2024-01-17 17:30:35 +00:00
Jacob Boerema
e58afad043 app: fix #10641 API for adding to the local Layers menu is broken
It was not possible anymore for a plug-in to add a menu item to the
local Layers, Classes and Paths dialogs using <Layers>, <Classes> and
<Vectors> at the start of the menu path.
For the first two this was due to an extra length parameter and the
drawables now being inside a GimpObjectArray. To fix that we check
inside the object array for the correct type names.
I'm not sure if Vectors ever worked, but testing shows it only adds
runmode and image parameters. To fix that we do the same as for
ColorMap.
2024-01-17 12:20:00 -05:00
Sabri Ünal
174d9c5631 Update Turkish translation 2024-01-17 08:04:53 +00:00
Sabri Ünal
007484517f Update Turkish translation 2024-01-17 07:48:30 +00:00
Sabri Ünal
78d768037e Update Turkish translation 2024-01-17 07:46:50 +00:00
Ekaterine Papava
f3887e362c Update Georgian translation 2024-01-16 20:07:22 +00:00
Bruno Lopes
38f5fec491 build/windows: Drop 'jhbuild'
The 'jhbuild' build of GIMP (Windows only) was added in 2013 and then maintained
by only one contributor (it even offered unnoficial nightly builds) until 2017,
when it never received a new jhbuild-specific commit again.

After so long, update it to keep up with current development status is quite hard,
so it is reasonable to remove this already dead version of GIMP.
2024-01-16 20:06:10 +00:00
Ekaterine Papava
ea54f99ec0 Update Georgian translation 2024-01-16 20:05:05 +00:00
Ekaterine Papava
30bab1919e Update Georgian translation 2024-01-16 20:02:57 +00:00
Alx Sa
0286210539 widgets: Add checks if GdkDevice doesn't exist
Resolves #10643.

Prevent gimp_modifiers_editor_show_settings () from being called
when the user clicks the Modifier Reset button in Preferences if
there is no device connected to GIMP.
2024-01-16 14:17:53 +00:00
Bruno Lopes
c239d522c8 gitlab-ci: Tweak CI to avoid stuck win-a64 jobs
'clangarm64' pacman is getting stuck and killing it is the only "solution"
before any patch by the MSYS2 folks.
2024-01-16 13:11:56 +00:00
Marco Ciampa
cb63e4505e Updated Italian translation (WIP) 2024-01-16 13:59:58 +01:00
Anders Jonsson
cea5397a59 Update Swedish translation 2024-01-16 10:25:39 +00:00
dimspingos
d5771b21e2 Updated Greek Translation 2024-01-16 10:54:56 +02:00
Alx Sa
15929e83fd core: Fix crash when pattern can't be loaded
For certain small selections, the pattern preview can't be loaded.
Since e1e30c6f assumes the pattern loads, this could cause a
crash if a dialogue with the preview is visible.
This patch checks if the scaled pattern was loaded before using
it, and otherwise uses the default pattern.
2024-01-15 22:55:57 +00:00
Anders Jonsson
31d8ac70a1 Update Swedish translation 2024-01-15 21:39:26 +00:00
Aurimas Černius
4424bafd47 Update Lithuanian translation 2024-01-15 20:55:55 +00:00
Aurimas Černius
656bf8d1fb Update Lithuanian translation 2024-01-15 20:46:13 +00:00
Aurimas Černius
a0c111a53c Update Lithuanian translation 2024-01-15 20:41:15 +00:00
Aurimas Černius
ee3e49299b Update Lithuanian translation 2024-01-15 20:36:12 +00:00
Yuri Chornoivan
92f7903331 Update Ukrainian translation 2024-01-15 20:24:04 +00:00
Bruno Lopes
663b6636ab build/windows: Enable Norwegian translation for the Windows installer
Following ce3b6430d5
2024-01-15 16:37:08 -03:00
Bruno Lopes
6850232cdb build/windows: Organize Installer script
The order of the commands was very confusing and some useful comments
was lacking. Let's fix it.
2024-01-15 16:36:32 -03:00
Bruno Lopes
2c1c7aae03 gitlab-ci, build/windows: Fix .patch and improve a little pacman upgrade
* Fixes an ARM .patch that stop to working after !1171, causing job fail
* Changes the logic of system upgrade (pacman -Syyuu) to be less redundant
  This also improves consistency with the Debian jobs
2024-01-15 15:04:30 -03:00
Bruno Lopes
3a561d1c68 build/windows: Fix and update some Inno Installer files
These files (specially the script) were not properly updated in the
previous MR, which would make the Inno Installer Job fail.
2024-01-15 15:04:30 -03:00
Bruno Lopes
9c0cc6ab98 plug-ins: Don't build ScriptFu interpreter and server in crossbuilds
Since !1171, ScriptFu .scm and .interp files aren't available to prevent
errors caused by no instrospection support, but this binaries escaped.
2024-01-15 15:04:30 -03:00
Kolbjørn Stuestøl
96a0cf98ca Update Norwegian Nynorsk translation 2024-01-15 17:58:51 +00:00
Kolbjørn Stuestøl
a380886c03 Update Norwegian Nynorsk translation 2024-01-15 17:47:58 +00:00
Kolbjørn Stuestøl
8f9dd1fe6b Update Norwegian Nynorsk translation 2024-01-15 17:35:59 +00:00
Kolbjørn Stuestøl
ce3b6430d5 Add Norwegian Nynorsk translation 2024-01-15 17:08:37 +00:00
Kolbjørn Stuestøl
46a4fbaa45 Update Norwegian Nynorsk translation 2024-01-15 17:05:05 +00:00
Bruno Lopes
5dc8c267da build: remove obsolete 'patches'
They have already been released in Cairo and were not even being applied
by us anymore.
2024-01-15 11:53:42 -03:00
Bruno Lopes
f24432e632 build: drop 'buildbot'
This folder has become totally obsolete because we currently use Gitlab CI
and its content was not being maintained for over a decade.
2024-01-15 11:53:42 -03:00
Anders Jonsson
9838c9f65f plug-ins: fix crash on export to xmc
Fixes #10605.

Export to xmc when image width or height is 256 pixels
causes a crash. Add equality check to an assert to stop
the plug-in from crashing.
2024-01-15 14:50:58 +01:00
Alx Sa
bb588155fd plug-ins: Fix ImageMap resize bug in GTK3
Resolves #10530.

In GTK2, setting a window's scrollbar policy to GTK_POLICY_NEVER
hid the scrollbars. In GTK3, this also makes the window automatically
resize to fit the contents. Since ImageMap displays the full drawable
with no scaling, this caused the plug-in window to be very large for large
layers.
GTK_POLICY_EXTERNAL in GTK3 works the same as the GTK2 version of
GTK_POLICY_NEVER, so using it instead fixes the problem.
The default width and height magic numbers were also replaced with
constants.
2024-01-14 19:43:32 +00:00
Martin
428f08b785 Update Slovenian translation 2024-01-14 17:19:51 +00:00
sonia
9f762f5e4b plug-ins: Fix JPEG2000 warning
Removes duplicate parenthesis in the CMYK color space check.
2024-01-14 11:17:29 -05:00
Alx Sa
c01ffee74f plug-ins, libgimpconfig: Fix minor warnings
- file-psd, sig[4] and block_len variables are initialized to stop uninitialized warnings
- file-xpm, g_file_peek_path () is cast to (char *) to stop "discarded const" warnings
- gimpconfig-serialized.c, %llu is used instead of %lu to stop overflow warning
2024-01-14 14:30:32 +00:00
Bruno Lopes
28fc941c53 build, devel-docs, po-*, tools: remove Autotools remnants
- Remove files not used by meson
- Remove autotools references in texts
2024-01-14 10:38:12 -03:00
Bruno Lopes
874b199e61 build, docs, etc: drop hardcoding of GIMP version
In preparation for GIMP 3.0 and future releases.
2024-01-13 18:15:10 -03:00
Luming Zh
056e545215 Update Chinese (China) translation 2024-01-12 23:57:34 +00:00
dimspingos
9d0ad0061d Updated Greek Translation 2024-01-12 20:22:40 +02:00
Alx Sa
2aa0a9d42b themes: Prevent system theme leak on stacks and viewports
If a system theme sets the background-image property for stacks,
it recolors the main canvas when empty. It also adds a border to
the toolbox Wilber area.
Additionally, the Credits page of the GtkAboutDialog has odd colors
due to general viewport grid styles overriding the GTK default.
This patch fixes these problems, and adds a custom CSS class to
the GimpAboutDialog for current and future work.
2024-01-11 20:03:48 +00:00
Yuri Chornoivan
9eb7928b91 Update Ukrainian translation 2024-01-11 19:01:04 +00:00
Yuri Chornoivan
6fa6c4fc05 Update Ukrainian translation 2024-01-11 18:54:16 +00:00
Yuri Chornoivan
edd4085608 Update Ukrainian translation 2024-01-11 18:49:58 +00:00
Anders Jonsson
ad123bbbc4 plug-ins: mark svg, wmf dialogs as translatable 2024-01-11 18:45:40 +01:00
Alx Sa
2db73f82ac display: Fix titlebar regression after 7e7828e4
The previous commit did not fully convert the title/status bar
format string to be UTF8-clean, due to a misunderstanding
of the logic behind the symbol used to indicate an image
was dirty.

Rather than always grabbing the 2nd character in the format
string, this patch now grabs the next character in the format
string after the %D, %N, %C, and %E commands.
2024-01-11 04:06:40 +00:00
Alx Sa
1666f82b20 scripts: Partially fix spinning-globe.scm
During the API port, the Map Object
plugin had some parameters added and
others changed to GimpChoice strings.
This broke the Spinning Globe filter which
called on the map-object plugin.
This patch updates the procedure call and
fixes ranges in the map-object plugin so
spinning-globe works again,
but larger scope warnings persist.
2024-01-11 03:20:04 +00:00
dimspingos
9dfe17f150 Updated Greek Translation 2024-01-10 10:08:50 +02:00
bootchk
96afe1532d libgimp: Refactor fractal-explorer-dialogs.c: extract methods
No functional change.

I did this while chasing #10590 and #10591
The refactoring moves replicated code into functions.
So readers can understand better without having to compare sections
of replicated code.
The comments also highlight issue #10590.
2024-01-09 19:21:27 +00:00
bootchk
d26433036c Fix #10536 Plugins: Fractal Explorer fails
Use g_connect_signal_swapped for "resource-set" signal from Resource Choosers,
to match the signal handler expecting "callback data" in the first arg.
Otherwise the first arg is the object emitting the signal.
2024-01-09 19:21:27 +00:00
bootchk
0edf079d4e Fix wire contention for gradient data 2024-01-09 19:21:27 +00:00
Alx Sa
ca1b21c008 widgets: Add Windows titlebar theme to search popup
Extends the theme-matching code from ad8b47bf to the
GimpSearchpop on Windows
2024-01-09 15:08:10 +00:00
Alx Sa
bbbf6df52d plug-ins: Fix image-map grid type change
Resolves #10611.

In GTK3, GtkRadioButtons are set using the "active" property
rather than selected, so the callback needed to check the
GTK_STATE_FLAG_ACTIVE flag instead of GTK_STATE_FLAG_SELECTED
when changing grid types.
The code was also reformatted to match current coding style.
2024-01-09 02:54:09 +00:00
Jacob Boerema
45ea994e89 plug-ins: improve default color handling of foggify
- To set color values in the 0-255 range we now have to use set_uchar.
- Because setting a default color is not working, the color in config
  could be None, which if the color wasn't changed caused a CRITICAL.

Let's check for None and if that is the case then manually set our
default color.
2024-01-08 18:11:46 -05:00
Jacob Boerema
c44819f58b plug-ins: fix foggify AttributeError on Cancel
When cancelling foggify we get the following error:
AttributeError: 'GimpProcedureConfig-python-fu-foggify' object has no
attribute 'end_run'

The end_run function was removed a while ago, so just remove this line.
2024-01-08 18:11:46 -05:00
Aurimas Černius
bdac126fb1 Update Lithuanian translation 2024-01-08 21:21:17 +00:00
Jacob Boerema
129667423f plug-ins: fix #10587 image map crash in grid menu
The grid state was not correctly updated when changed from within the
grid settings dialog.

Instead of using g_simple_action_set_enabled we need to use
g_simple_action_set_state, since we don't want to change whether the
action is enabled or disabled, but the checked/unchecked state.
2024-01-07 17:52:44 -05:00
Alx Sa
7e7828e452 display: Make title format UTF8-clean
The current code assumes that one letter is one byte long.
This caused issues when using non-ASCII UTF8 characters in
the title and statusbar format strings.

This patch replaces the loop logic with g_utf8_next_char () and g_utf8_get_char ()
to get the next letter no matter how many bytes it takes up.
2024-01-07 18:22:37 +00:00
Alx Sa
b9fe1c64f0 Tools: Add Pickable check to Align Tool
As reported in issue 10604, if the Align Tool is set to align relative
to a reference object and 'use extents of layer contents' is enabled,
clicking on a path causes a CRITICAL.

This is due to gimp_pickable_auto_shrink () being called, when GimpVectors
are not GimpPickables. A datatype check is added before calling the function
to prevent the issue.
2024-01-07 14:13:49 +00:00
bootchk
1553f8b88c Fix #10589 CRTICAL on empty label on resource chooser widget 2024-01-07 10:47:54 +00:00
Marco Ciampa
9bc59ba543 Updated Italian translation (WIP) 2024-01-07 03:49:30 +01:00
Jacob Boerema
73d7b0dc96 Issue #10450 crash or critical using file open options dialog
When opening images like DDS or EPS that have an options dialog,
we either get a crash, or criticals.

The critical made clear that there is a problem dereferencing:
(gimp-2.99.exe:9900): GLib-CRITICAL **: 14:52:58.831:
g_atomic_ref_count_dec: assertion 'old_value > 0' failed

Looking at gimp_file_dialog_progress_get_window_id we see that the
handle doesn't get an extra reference, while in other similar places
the handle is duplicated.

Using g_bytes_ref on the handle fixes the criticals for me.
2024-01-06 14:53:53 -05:00
Anders Jonsson
078dafa847 Update Swedish translation 2024-01-06 12:11:00 +00:00
Jacob Boerema
7a8f465b2d Issue #10588: enumerations for RotationType can't be used in Python
Due to GObject Introspection we can't have the last part of an
identifier start with a digit, since that part will be used in Python
as the identifier, and Python doesn't allow that to start with a digit.
e.g. GIMP_ROTATE_90 would be used in Python as
image.rotate(Gimp.RotationType.90)

To fix this we add DEGREES in front of the number, without a '_',
even though that looks ugly.
2024-01-05 13:28:49 -05:00
Sveinn í Felli
7e2a34bab8 Update Icelandic translation 2024-01-05 12:04:29 +00:00
Marco Ciampa
f9203e19bf Updated Italian translation (WIP) 2024-01-05 00:40:31 +01:00
Jacob Boerema
aeb1c726b9 libgimpbase: fix #10557 missing XMP namespace "Item"
With the sample image that contains the XMP namespace Item with the
correct url included, it is not returning the url when we ask for it.
This seems to be an exiv2 issue, but needs more research.

What GIMP doesn't do, is report that the namespace url we were looking
for wasn't found, and make sure that this doesn't block us from
handling all XMP tags.

To improve this on our end, we check if there was an error getting the
url, and if yes:
- We generate a warning message
- We create a dummy namespace url, with a special check for the missing
Item namespace to give it the correct known namespace url.
2024-01-04 15:24:30 -05:00
Martin
c4cf0af1da Update Slovenian translation 2024-01-04 19:58:03 +00:00
Martin
89ec688ad2 Update Slovenian translation 2024-01-04 19:56:36 +00:00
Martin
6b58329f86 Update Slovenian translation 2024-01-04 19:54:21 +00:00
Luming Zh
09f9af9a05 Update Chinese (China) translation 2024-01-04 18:11:22 +00:00
Alx Sa
f66c6e9681 python: Use theme colors for console font color
Previously, the console's font color was hardcoded to #006000.
This did not stand out well on darker theme.
This patch pulls the widget's foreground color from GtkStyleContext
to ensure it contrasts sufficiently with the console background color.
2024-01-04 17:51:02 +00:00
Sveinn í Felli
605acaa5f7 Update Icelandic translation 2024-01-04 17:42:59 +00:00
Sveinn í Felli
fbde793231 Update Icelandic translation 2024-01-03 17:58:37 +00:00
Alexandre Prokoudine
91c216d4ed Update Russian translation, part 4 of N 2024-01-03 01:27:11 +01:00
Alexandre Prokoudine
767f310e8a Update Russian translation, part 3 of N 2024-01-03 00:57:20 +01:00
Anders Jonsson
426f30cd84 Update Swedish translation 2024-01-02 21:08:23 +00:00
Luming Zh
a66f0769ca Update Chinese (China) translation 2024-01-02 20:32:07 +00:00
Sveinn í Felli
9e066feaa9 Update Icelandic translation 2024-01-02 18:22:44 +00:00
Sveinn í Felli
8bd67a2165 Update Icelandic translation 2024-01-02 18:17:28 +00:00
Alexandre Prokoudine
42971b5ffc Update Russian translation, part 2 of N 2024-01-02 15:39:21 +01:00
Bruno Lopes
d5f41b296b build/windows, data, extensions, plug-ins: Fix Build omissions
- Fix "no icons" errors generating loaders.cache with .cmd (CI-Cross).
  ! This is a sub-optimal fix, but it's better than a useless build.

- Fix "no interpreter" errors generating .interp with Meson (CI-Native)
  and generating .interp and copying .typelib with .cmd (Local-Native).
  ! This is a sub-optimal fix to Local-Native, but plug-ins will work.

- Fix "no iso" error copying iso_639.xml with Meson (Local-Native).
2024-01-02 10:49:31 +00:00
Bruno Lopes
9af3579f63 build/windows, devel-docs: Make Installer stuff human readable and less hardcoded
The Inno installer scripts contents (only 3 files: files, gimp3264 and
32on64) and filenames have been organized, making them much easier to
read, and slightly less hardcoded so less prone to being misunderstood
and pervasively receiving packaging stuff.
Just to be clear, one more time: the Inno installer (or future MSIX)
scripts never should be the center of attention. This "installcentrism"
caused a domino effect of partially "abandoning" the packaging, build.sh
and the meson scripts, which explains the existence of this MR...

(Some things still hardcoded since wildcards in Inno are very limited.
Also, the rational ordering principles of this MR were not applied since
these scripts are heavily based on the x86 .zip package and changing the
order of things here, according to my tests, breaks things quite easily)
2024-01-02 10:49:31 +00:00
Bruno Lopes
af79bbe028 gitlab-ci, build/windows: Make Packaging scripts compatible with CI-Cross job
The CI crossbuild job now use the same main script (and the same
sub-scripts of linking and debug generation) of the native CI for
packaging. These unified scripts greatly facilitates maintenance.

The crossbuild deps script is now more consistent in relation to the
native one. As this is polished, the cross one is now polished too.

A crossroad gimp build script was created with a more clear code.

Also, finally make the script for packaging only, removing build step
stuff that shoudn't be here (glib-schemas generation) since this causes
disparity with the Local native build; and adding some packaging
decisions that shoudn't be in the installer scripts (eg. specific
folders of ghostscript, glib; no share/themes), which also facillitates
INNO (and future MSIX) maintenance.
2024-01-02 10:49:31 +00:00
Bruno Lopes
8b9aa1e7ca gitlab-ci, build/windows: Make Build script compatible with Local-Native build
The local builds now can use the same script of CI for sake of time.
The compatibility layer is very simple and makes the script more
used/tested, therefore more reliable.
2024-01-02 10:49:31 +00:00
Bruno Lopes
5ecf228019 gitlab-ci, build/windows: Make Deps script compatible with Local-Native build
The local builds now can use the same script of CI for sake of time.
The compatibility layer is very simple and makes the script more
used/tested, therefore more reliable.

Also, remove some redundacy on the code for better maintenance.
2024-01-02 10:49:31 +00:00
Bruno Lopes
637c49b30f build/windows: Add Dependencies list compatible with all jobs
Now, we have only ONE list applicable for build-deps-crossroad.sh,
build-gimp-msys2.sh and package-gimp-msys2.sh, instead of hardcoding
3 times. This unified list greatly facilitates maintenance.
2024-01-02 10:49:31 +00:00
Bruno Lopes
271ba85770 gitlab-ci, build/windows: Unify CI jobs wording
Debian changes:
- Since autotools has gone, we don't need to specify 'meson' in the
debian job and others.
- The "INSTALL_PREFIX" was renamed for the more usual "GIMP_PREFIX" and
the meson sintax of Debian jobs was also updated.

Windows changes:
- Then, clarify that the win64-nightly and win32-nightly jobs are, in
fact, in the 'packaging' step, since we don't really "distribute" GIMP
in .zip and the commands are almost the same of the packaging .SH
script, without scripted optimizations for Inno Installer (or future
.MSIX), crucial for distribution.
- We don't need to specify "native" sufix in any build since they are
the rule and cross builds are the exception.

General changes:
- The job names was changed to be more consistent and in accordance
with the folders present in the artifacts.
- The 'nightly' sufix was removed from the Inno Windows Installer job
and others, since this doesn't reflect the real build frequency.
- The scripts filenames are altered to stay "in order". This is not
essential but ultra convenient since it is easy to view and search.
(The -uni suffix is explained in a further commit)
- All artifacts names now have the commit to avoid apparently duplicate
files when downloading same step artifacts from different projects.
- Finally, rearrange the order of jobs rationally: first the OSes and
archs (from the most free and modern to the most closed and legacy),
then the stages (from 'prepare' to 'analysis'), ending with the
frequency of jobs (from the most frequent, called at each push, to
the least/weekly).

Overall, this changes, although difficult to review at the first
sight, will avoid in the future quite "dumb" issues like:
GNOME/gimp#10195
2024-01-02 10:49:31 +00:00
Yuri Chornoivan
5903426e81 Update Ukrainian translation 2024-01-02 07:30:23 +00:00
Yuri Chornoivan
8f11b02ac2 Update Ukrainian translation 2024-01-02 07:28:46 +00:00
Anders Jonsson
a4d309c7f7 plug-ins: more consistent ellipsis usage 2024-01-02 03:43:34 +00:00
Alexandre Prokoudine
829fa62163 Update Russian translation, part 1 oof N 2024-01-01 23:16:17 +01:00
Luca Bacci
0532e1b0ea GimpPopup: Ignore grabs from windows / menus shown by internal widgets
Fixes https://gitlab.gnome.org/GNOME/gimp/-/issues/6989
2023-12-31 18:07:25 +01:00
Anders Jonsson
e4e3dcca6b plug-ins: readd translation context for tag values
Originally added in 55aa462faa
2023-12-31 13:14:00 +00:00
Jehan
6fc468e7a4 desktop: prepare GIMP 2.99.18 AppStream release notes. 2023-12-31 17:08:31 +09:00
Anders Jonsson
06b638bdca Update Swedish translation 2023-12-30 14:17:17 +00:00
Jordi Mas
06df0fca10 Update Catalan translation 2023-12-30 14:12:01 +01:00
Anders Jonsson
e3b353f952 Update Swedish translation 2023-12-29 23:48:27 +00:00
Luming Zh
6838b05ac1 Update Chinese (China) translation 2023-12-29 21:07:39 +00:00
Alx Sa
d120e592d8 core: Fix crash when cutting/pasting single layer
When cutting and pasting a single layer,
drawables->data might be empty. This results in a
crash on Windows and a failure to paste on Linux.
Since this function is inside an IF statement that already
confirms it has a valid image, the base type and
precision are retrieved from there instead.
2023-12-29 10:27:27 -05:00
Alx Sa
a331e91309 plug-ins: Fix Fractal Explorer blue inversion
Resolves #10537.

During the port, the "green_invert" variable
was repeated twice rather than using the
"blue_invert" variable. This prevented the
fractal from updating when blue was changed.
2023-12-28 22:59:46 +00:00
Alx Sa
0351f48dfe themes: Defining menu, tab, and tooltip styles
This is intended to prevent system theme background-images
and borders from overriding those set by GIMP.
The minimum size of tabs is also explicitly defined.
2023-12-28 16:47:10 +00:00
Rodrigo Lledó
1f0b74d85f Update Spanish translation 2023-12-27 19:49:00 +00:00
Rodrigo Lledó
9c1e423c3f Update Spanish translation 2023-12-27 19:46:49 +00:00
Rodrigo Lledó
9d9371eede Update Spanish translation 2023-12-27 19:05:59 +00:00
Anders Jonsson
965b27fd81 Update Swedish translation 2023-12-27 16:17:46 +00:00
Anders Jonsson
9f842cbe99 Update Swedish translation 2023-12-27 16:15:08 +00:00
Yuri Chornoivan
6f84b6babc Update Ukrainian translation 2023-12-27 07:45:20 +00:00
Asier Sarasua Garmendia
7fa9d2de9b Update Basque translation 2023-12-27 07:34:57 +00:00
Alan Mortensen
6abdc0bbab Update Danish translation 2023-12-27 07:18:50 +00:00
Anders Jonsson
e762b49523 app: make colorbutton tooltips translatable 2023-12-26 22:07:37 +00:00
Martin
43cc6fc4c9 Update Slovenian translation 2023-12-26 17:13:04 +00:00
Jacob Boerema
ec2ee8fe91 plug-ins: fix #10498 Incorrect layer order when loading certain PSD's
Our handling of Photoshop's Blend Clipped Layers as Group is flawed
causing the order of layers to be messed up which may cause certain
parts of the image to become invisible or having the wrong colors.

This only fixes the incorrect layer ordering. Correct handling of
group layers with clipping needs a more extensive rewrite.
2023-12-26 11:39:49 -05:00
Jacob Boerema
2945fa6db2 plug-ins: more detailed PSD export compatibility notice
Follow up to the previous commit, we clarify the compatibility issue
between using legacy layer modes and Clip to Backdrop.
2023-12-26 11:39:48 -05:00
Jacob Boerema
f8bdca24aa Revert plug-ins: fix bad parsing of PSD blending modes
This is a manual revert of eac1df4b61
since other changes were made to the same lines.

Although using legacy layer modes for several blend modes improves
compatibility with Photoshop, we found out during testing of the
image from issue #10498, that it negatively impacts loading of PSD's
that use Blend Clipped Layers as Group.
We convert this specific PSD setting by adding a layer group and
setting Composite Mode to Blend to Background.
However, our legacy layer modes do not support Composite Mode, meaning
that PSD's using this can show up using smeared colors.

Since this hasn't been in a release yet, let's revert this and rethink
how we want to handle the combination of these PSD settings.
2023-12-26 11:39:48 -05:00
Asier Sarasua Garmendia
051f443f1f Update Basque translation 2023-12-24 09:22:22 +00:00
Ngọc Quân Trần
6dfc12ea36 Update Vietnamese translation 2023-12-24 08:29:30 +00:00
Ngọc Quân Trần
af6a1dd1db Update Vietnamese translation 2023-12-24 08:28:49 +00:00
Ngọc Quân Trần
ab33412f3e Update Vietnamese translation 2023-12-24 08:27:41 +00:00
Ngọc Quân Trần
f5f8dace6e Update Vietnamese translation 2023-12-24 08:25:21 +00:00
Alx Sa
dd10433c37 plug-ins: Fix indexed transparent PNG export
Resolves #9933.

We used png_get_valid (pp, info, PNG_INFO_tRNS) to check if
an indexed PNG had transparency when exporting.
However, this function does not return TRUE/FALSE but instead
the contents of that PNG chunk. Since we use index 0 for transparency,
this function always returns 0. The non-transparent indexed export code
ran regardless, creating incorrect PNGs.
We set pngg.has_trns earlier if the image has transparency, so it's safer
to use this variable instead.
2023-12-23 21:40:14 +00:00
bootchk
11b7e4cded Fix #10511 ScriptFu CRITICAL on scripts with no dialog, e.g. Reverse Layers
Magic number 1 changed to 2 in one place. Missed in earlier fix for #10127.

Changed magic number to a defined macro constant so it might not happen again,
should GimpConfig change again.
2023-12-22 09:43:01 -05:00
Jürgen Benvenuti
60f8e47176 Update German translation 2023-12-22 13:31:39 +00:00
Martin
73b571165f Update Slovenian translation 2023-12-21 22:33:02 +00:00
Martin
d16cdddbdd Update Slovenian translation 2023-12-21 22:14:46 +00:00
Yuri Chornoivan
fa631e76fb Update Ukrainian translation 2023-12-21 16:23:43 +00:00
Yuri Chornoivan
1236c10e4a Update Ukrainian translation 2023-12-21 15:54:51 +00:00
Luming Zh
c100b5313c Update Chinese (China) translation 2023-12-20 20:46:00 +00:00
Kolbjørn Stuestøl
e7b84bdc70 Update Norwegian Nynorsk translation
(cherry picked from commit 1be85b7fc9)
2023-12-20 20:25:09 +00:00
Kolbjørn Stuestøl
f57219b2d1 Update Norwegian Nynorsk translation 2023-12-20 20:23:34 +00:00
bootchk
507cbdc44a Fix #10508 ScriptFu CRITICAL on invalid resource ID
Add test case test/PDB/resource.scm
2023-12-20 12:50:02 +00:00
Alexander Shopov
990b0a2757 Update Bulgarian translation 2023-12-20 11:38:56 +00:00
Alexander Shopov
c40bedd1dd Update Bulgarian translation 2023-12-20 11:20:54 +00:00
Ekaterine Papava
3c46a0bb5e Update Georgian translation 2023-12-20 03:45:25 +00:00
Ekaterine Papava
f571eca749 Update Georgian translation 2023-12-20 03:41:53 +00:00
Ekaterine Papava
05d8ddfbb4 Update Georgian translation 2023-12-20 03:39:33 +00:00
bootchk
b1f2f71113 Fix #10465 ScriptFu marshal color strings correctly
Fix test case.
2023-12-19 18:40:48 +00:00
Anders Jonsson
37c971c08e app, plug-ins: make missing tooltips translatable 2023-12-19 17:56:30 +00:00
Anders Jonsson
02b970d6a9 app: make config labels translatable 2023-12-19 17:56:30 +00:00
Martin
0ae1b3dfc9 Update Slovenian translation 2023-12-19 17:10:43 +00:00
bootchk
555afe2058 Fix #10188 SF marshall array of super Item instead of subclass Drawable
Substantive change is call gimp_item_get_by_id instead of gimp_drawable...
And a few type changes from GimpDrawable* to GObject*.

Lots of renaming of functions, substituting "item" for "drawable."

Update comments.

Made one function static that was already private.

Fix the test case gimp_vectors_set_selected
2023-12-19 09:55:21 -05:00
bootchk
5486e4094a Enhance tests of PDB in ScriptFu
Add more tests

Enhance testing framework, add function assert-PDB-true

Enhance some tests: make test files order independent

Fix tests broken by recent changes to GIMP
2023-12-19 06:47:36 -05:00
Luming Zh
88b5269773 Update Chinese (China) translation 2023-12-18 17:34:07 +00:00
Luming Zh
b10b5a370d Update Chinese (China) translation 2023-12-18 17:31:35 +00:00
Luming Zh
f906f8274f Update Chinese (China) translation 2023-12-18 17:31:31 +00:00
Yuri Chornoivan
84a4d7eb13 Update Ukrainian translation 2023-12-17 10:21:32 +00:00
Yuri Chornoivan
5fb4b8496c Update Ukrainian translation 2023-12-17 10:10:46 +00:00
Ekaterine Papava
8dc3b774e6 Update Georgian translation 2023-12-17 08:51:17 +00:00
Anders Jonsson
88c7520451 ScriptFu: make default names translatable 2023-12-17 03:02:25 +00:00
Anders Jonsson
c64d59b80c plug-ins: make pdf export strings translatable 2023-12-17 03:02:25 +00:00
Yuri Chornoivan
9ee99db6a2 Update Ukrainian translation 2023-12-16 21:24:30 +00:00
Jehan
eb3b9aafec NEWS: update. 2023-12-16 20:59:51 +09:00
Jehan
7100851b5b Issue #10283: renaming generated "(Hardedge)" gradients as "(Hard Edge)".
There was the question on whether it needed an hyphen or not. The hyphen
naming was often used to describe the "Hard-edge painting" style, though
even for this, it was not an absolute case. Depending on English writing
style, we could also find "hard edge painting". Also Liam was noting
that when the term appears by itself, as a noun (rather than a
qualificative), it was likely best without hyphen. So we went for the
no-hyphen wording.

Then there was the capitalization question: should capitalization rules
of data labels apply to parts between parentheses? I went with the
answer that *yes*, since it's part of the title anyway. And without the
part between parentheses, we'd have several data named the same. So it's
just as important.

As a consequence, I also re-capitalized "FG to BG (HSV
Counter-Clockwise)" and "FG to BG (HSV Clockwise Hue)" gradients,
following this updated rule.
2023-12-16 20:40:46 +09:00
Jehan
d4f8f553b2 data: consistent capitalization in gradients' names.
See comment by Jacob about the lack of consistency in some of the names
of default data.
2023-12-16 20:20:39 +09:00
Ekaterine Papava
c2984e9005 Update Georgian translation 2023-12-15 04:30:40 +00:00
Ekaterine Papava
48b2f1bfa2 Update Georgian translation 2023-12-15 04:22:59 +00:00
Alx Sa
820e96c67b Themes: Fix button shadow on dark theme hover
Resolves #10477.

The dark theme box-shadow for buttons does not blend well
when hovering over it, compared to the light & gray themes.
This patch adds an additional CSS rule to make the box-shadow
no longer clash in dark theme.
2023-12-14 19:39:54 +00:00
Jordi Mas
d9a2b7c272 Update Catalan translation 2023-12-14 15:57:05 +01:00
Alan Mortensen
610bd7b7a2 Update Danish translation 2023-12-14 12:05:43 +00:00
Alan Mortensen
87a3618acd Update Danish translation 2023-12-14 12:04:14 +00:00
Alan Mortensen
8e5bbd3456 Update Danish translation 2023-12-14 12:01:53 +00:00
Alan Mortensen
3dd88b385c Update Danish translation 2023-12-14 08:27:39 +00:00
Alan Mortensen
d594fcf4cd Update Danish translation 2023-12-14 08:09:12 +00:00
Martin
2992a7ffed Update Slovenian translation 2023-12-13 22:11:19 +00:00
Martin
e1a2fbdb94 Update Slovenian translation 2023-12-13 22:04:20 +00:00
Luming Zh
076229e53a Update Chinese (China) translation 2023-12-13 19:30:25 +00:00
Yuri Chornoivan
dc2f7bf64c Update Ukrainian translation 2023-12-13 18:56:06 +00:00
programmer_ceds
ff219fb0e2 Resize Canvas Problems (fixes issue #10225) 2023-12-13 18:31:38 +00:00
Yuri Chornoivan
9a6a26e70f Update Ukrainian translation 2023-12-13 18:02:50 +00:00
Bruno Lopes
276754e9fe plug-ins: update Compatibility Notice wording
Since we now have documented certainty which modes are compatible, the
Compatibility Notice should convey more reassurance.
2023-12-13 17:58:37 +00:00
Bruno Lopes
e494c2ea71 plug-ins: update the PSD table of inaccurate/non-exact modes
Some 2.10 modes, even in perceptual space, don't produce the same
result as PS. Now, the mapping table takes this into account, which
avoids surprises for the user.
2023-12-13 17:58:37 +00:00
Bruno Lopes
eac1df4b61 plug-ins: fix bad parsing of PSD blending modes
The mapping table was generically indicating 2.10 modes as first choice,
which was resulting in terrible PSD compatibility in some cases. This
commit fixes this using legacy modes verified with latest PS version
(see attached files in MR).
2023-12-13 17:58:37 +00:00
Anders Jonsson
bdf0d88456 app, plug-ins: mark missing strings as translatable 2023-12-13 17:44:35 +00:00
Yuri Chornoivan
9fa31f467b Update Ukrainian translation 2023-12-13 17:44:06 +00:00
Alan Mortensen
c05b67c9aa Update Danish translation 2023-12-13 09:30:16 +00:00
Sabri Ünal
f43398c090 DOAP: Replace defunct mailing list
Corresponding URL seems to be redirected to a new URL.
2023-12-13 10:16:27 +03:00
Stayd
594afaf900 plug-ins: DDS import rewrite
Comprehensive rewrite of the DDS import routine, in the interest of
easier maintainability and readability. Adds formats.c/h, containing
tables and functions related to reading and parsing uncompressed files.
Importer now supports nearly all non-video uncompressed formats.

Includes a variety of minor-to-moderate fixes made along the way
which could not be pulled out into separate commits due to dependence
on other aspects of the rewrite.
2023-12-13 03:30:48 +00:00
Stayd
829a92d62e plug-ins: Update dds.h and add known format codes
Minor cleanup and updating of types to GIMP types.
Addition of more known DXGI format codes, and one flag used by NVTT.
2023-12-13 03:30:48 +00:00
Rodrigo Lledó
b2551d7ccf Update Spanish translation 2023-12-12 13:41:43 +00:00
Yuri Chornoivan
65893eb150 Update Ukrainian translation 2023-12-11 22:01:44 +00:00
Martin
6e6c81572a Update Slovenian translation 2023-12-11 19:16:57 +00:00
bootchk
77c12a205b Add tests of PDB procedures gimp-image-set-selected-layer etc. 2023-12-11 18:42:59 +00:00
bootchk
1ccceccb01 Fix #10460 2023-12-11 15:09:07 +00:00
Alexander Shopov
59e1f6dc4c Update Bulgarian translation 2023-12-11 09:53:40 +00:00
Anders Jonsson
dbfd506df4 plug-ins: string fixes for lighting plug-in 2023-12-10 21:39:13 +01:00
Alx Sa
e317166c98 plug-ins: Fix defaults of secondary light points
Resolves #10454.
When porting to GimpProcedureConfig, all
light types were set to "Point" when 2 - 6
should have been "None" by default.
This patch fixes the defaults.
2023-12-10 14:57:56 +00:00
bootchk
dd2d0c96bf Fix a test plugin.
1. Recent changes to arg validation reveal bug in call to gimp-drawable-edit-gradient-fill,
supersampling arg must be >0

2. Make easier for testers to invoke by reducing the declared drawable capability
to SF-ONE-OR-MORE-DRAWABLE
2023-12-10 06:03:15 -05:00
Alexander Shopov
80908bfd4f Update Bulgarian translation 2023-12-10 09:55:23 +00:00
Alexander Shopov
a3ff7e7f92 Update Bulgarian translation 2023-12-10 09:31:36 +00:00
Anders Jonsson
30db768764 Update Swedish translation 2023-12-10 00:40:14 +00:00
Martin
8234069f1a Update Slovenian translation 2023-12-09 21:16:20 +00:00
Ekaterine Papava
936dbbf947 Update Georgian translation 2023-12-09 20:06:35 +00:00
bootchk
4d4639b8f3 Fix scripts calling obsolete gimp-brush-delete
Now use gimp-resource-delete

Drive-by fix of bad call to gimp-context-set-pattern.

Fixes other calls to gimp-font-delete, etc. in a test script.

Partly fixes 9867.
2023-12-09 11:23:58 -05:00
Jacob Boerema
1add942fa6 app: fix #10349 Stroke Path on 2.99.16+ doesn't work reliably
Due to a bug in commit de5c805cbb, which
changed the choice widget between line and paint tool to a
GtkStackSwitcher, changing that choice did not work anymore.

The reason being that the stroke method wasn't being updated on clicking
stroke. We fix this by setting the stroke method when OK is clicked.

When creating the dialog we also set the stroke method, to reflect the
last used choice, since that was also missing.
2023-12-08 16:03:28 -05:00
Yuri Chornoivan
c649295f5b Update Ukrainian translation 2023-12-08 18:11:04 +00:00
Rodrigo Lledó
ecdda05905 Update Spanish translation 2023-12-08 17:55:06 +00:00
Jehan
6d2863eaf3 app: make the Pad Actions frame insensitive with tooltip on X11.
See discussion in !946: https://gitlab.gnome.org/GNOME/gimp/-/merge_requests/946#note_1768869

On Windows/macOS, the pad device is probably not even showing at all
right now, though I can't test. Also it could be eventually implemented
with pad actions support (see Luca Bacci comment in the same MR) using
WM_POINTER API on Windows.

On X11 though, the pad device is shown, except it is kind of pointless.
So I am disabling the frame (making it insensitive) and add a tooltip.
2023-12-08 22:46:32 +09:00
Carlos Garnacho
058c19e5ac widgets: Make GimpDoubleAction friendlier to GtkPadController
Handle some statefulness in actions taking a double parameter, in order
to make them friendly to GtkPadController and its pad ring/strip
integration.

The GtkPadController emits those actions with a double parameter
expressing the absolute value (e.g. 0-360 for rings, 0-1 for strips),
take care of converting these absolute values to relative changes
that increase/decrease the current GimpDoubleAction value.

Going for relative increments/decrements increases the genericity
of rings when mapped to actions, as going with the given absolute
values would mean means rings could be mainly mapped to angle-like
actions, reducing its usefulness.
2023-12-08 12:35:34 +00:00
Carlos Garnacho
0c3713b467 display: Hook pad controllers into GimpImageWindow
We have everything in place to create GtkPadControllers converting
events into actions as configured in settings, and the signaling
to trigger the (re)generation of those as device, window or configuration
changes appear.

Only the last bit attaching those controllers to actually handle
input was missing, now done in this commit.

Since there may be multiple configured tablets and pads, we need to
keep track of per-device controllers to handle the configuration for
those. This mapping is kept in GimpImageWindow as the "main" toplevel
(i.e. the one(s) typically considered "keyboard focus" and receiving pad
events) and ensured to be kept up-to-date through the ::configure-pad
signal.
2023-12-08 12:35:34 +00:00
Carlos Garnacho
02eea132c2 widgets: Add GimpDeviceInfo API to generate a GtkPadController
This API call will snapshot the current configuration of a device
into a GtkPadController, that is created and attached to a toplevel
(this event controller only acts on toplevels).

This controller will handle pad events, trigger actions, and update
compositor feedback (e.g. GNOME Shell pad OSD) as per the actions
mapped in the configuration dialog.
2023-12-08 12:35:34 +00:00
Carlos Garnacho
6ca6f87c16 widgets: Hook ::configure-pad signal emission to configuration changes
If a pad device configuration gets changed, or reset, we should trigger
the creation of new pad controllers for the existing toplevels.

Add the plumbing so that saving/resetting a device configuration will
result in the same ::configure-pad signal, and trigger it from the
relevant places.
2023-12-08 12:35:34 +00:00
Carlos Garnacho
46d38827dd widgets: Add GimpDeviceManager signal to reconfigure pad devices
In order to apply the pad configuration so it does something, we
need to create GtkPadController objects on each toplevel for each
configured pad device.

This signal will work as a hint that a new GtkPadController should
be generated for the given device and current configuration. At
the moment, emit it when pad devices are added or removed.
2023-12-08 12:35:34 +00:00
Carlos Garnacho
f66977beb5 widgets: Monitor all devices (not just pointing) in device manager
Since pads are not pointing devices, this is necessary to let pads
known to the configuration dialog.
2023-12-08 12:35:34 +00:00
Carlos Garnacho
224566bb84 widgets: Detect disconnected pads as pads in GimpDeviceInfo
Return a suitable GdkInputSource for those configured pads, so that
they show up as pads in configuration even if disconnected.
2023-12-08 12:35:34 +00:00
Carlos Garnacho
573d2f5380 widgets: Add UI for pad configuration
The UI is heavily inspired in the existing one for midi devices
and the such, as the restrictions are somewhat similar. Since there
is not enough information to introspect the device without the help
of libwacom (and the UI should work with tablets unsupported by
it, regardless) the list starts empty, and there exists a "grab
event" button to press pad buttons (or use rings/strips) and
create/focus a list item for the button/mode.

Double clicking on an action (or pressing the "edit" button) spawns
a different dialog with a GimpActionEditor to select an action.
And lastly, actions can be deleted with the "delete" button.

Pads may have different modes (e.g. leds in the tablet) that apply
to all pad features, the list will allow different actions to be
set on the same button in different modes. This basically multiplies
the amount of mappable actions by the number of available modes.
2023-12-08 12:35:34 +00:00
Carlos Garnacho
8182f7d683 widgets: Add pad configuration to GimpDeviceInfo
Add property/getters for the pad configuration, and hook it
up to the serialization mechanism, so pad configuration is part
of device configuration.
2023-12-08 12:35:34 +00:00
Carlos Garnacho
2cfca9e90e core: Add GimpPadActions object
This object holds the mapping of pad device features (buttons/rings/strips)
to actions, given the current mode (e.g. leds in the device), and can be
serialized/deserialized from configuration files.
2023-12-08 12:35:34 +00:00
Jehan
d42508534d NEWS: update. 2023-12-08 21:34:27 +09:00
Jehan
10f86c69d1 libgimp: fixing annotations. 2023-12-08 21:18:03 +09:00
Jehan
78108cc3c8 pdb: getting rid of some warnings in a perl script.
Fixing:

> Scalar value @inargs[...] better written as $inargs[...] at pdb/lib.pl line 247.
> Scalar value @outargs[...] better written as $outargs[...] at pdb/lib.pl line 386.
2023-12-08 20:58:59 +09:00
Idriss Fekir
e8ad8af0f7 Fix fonts when exporting to pdf 2023-12-08 11:09:22 +00:00
Martin
588c98eb3f Update Slovenian translation 2023-12-07 22:17:21 +00:00
Anders Jonsson
f388258c41 Update Swedish translation 2023-12-07 20:43:55 +00:00
Rodrigo Lledó
545ef24aa4 Update Spanish translation 2023-12-07 20:43:47 +00:00
Alan Mortensen
5df595ef33 Update Danish translation 2023-12-06 07:29:16 +00:00
Rodrigo Lledó
a5232405f0 Update Spanish translation 2023-12-05 15:30:48 +00:00
Víttor Paulo Vieira da Costa
9700d51c25 Update Brazilian Portuguese translation 2023-12-05 12:49:07 +00:00
Jacob Boerema
adb8f9dcbf plug-ins: fix #10429 Online help not opening
We were using an incorrect parameter name for calling the online help.
Instead of domain-names it is url.
2023-12-03 10:12:55 -05:00
Alan Mortensen
d04e4a0b74 Update Danish translation 2023-12-03 14:28:19 +00:00
Alx Sa
3c261a2334 themes: Define button and header edges
This continues the theme definition work from bd398d5c.
A new edge-border-color tag was created
to allow for defined widget edges in both
light and dark themes.
The box-shadow highlights for buttons
and header/menubars was defined to
reduce system theme leaks. Some CSS
attributes were rearranges as well.
2023-12-02 18:57:20 +00:00
Luming Zh
bd0dc645a5 Update Chinese (China) translation 2023-12-02 16:16:30 +00:00
Yuri Chornoivan
245e46f1cf Update Ukrainian translation 2023-12-02 15:31:51 +00:00
Martin
58001b93c8 Update Slovenian translation 2023-12-02 07:59:22 +00:00
Ekaterine Papava
4031b854c0 Update Georgian translation 2023-12-01 22:45:22 +00:00
bootchk
86921b45f4 Fix #9317
Also revise annotation 0=>%NULL and other wording changes.
2023-12-01 21:55:36 +00:00
bootchk
c2bdf418f6 libgimp API: vectors.pdb remove trailing whitespace
Since most editors do that on save anyway.

No functional change.
2023-12-01 21:55:36 +00:00
bootchk
5a2c725bbb app/vectors : fix annotations on gimp_vectors_export_foo
Better describe what the functions do.

Also rename a variable vectors->path_list,
since the variable is type list of path.

No functional changes!!!
2023-12-01 21:55:36 +00:00
Stayd
b8834a9596 Always interpret BC1 cutout pixels as black
Per the official format specification and hardware implementation,
BC1 cutout pixels are always black with 0 alpha, whereas previous
versions of the plugin interpreted them as white. Commit f97e718e
partially fixed this, but made the behavior an import option that
also ignored the alpha component. This commit reverts the addition
of this option in favor of consistently following the spec.
2023-12-01 20:42:16 +00:00
Stayd
eb5a9576c6 Updated save-type and mipmaps props to GimpChoice
The export properties "save-type" and "mipmaps" were left as ints
in Commit 427130be due to uncertainty on whether options could be
conditionally disabled on GimpChoice properties. From testing it
this functionality appears to work fine and is used in other plugins.
Now all combo props are GimpChoices and fully configurable from dds.c
2023-12-01 20:42:16 +00:00
Stayd
a5d1d96a38 Consolidate YCoCg/AlphaExp code, always decode
Moves most of the code relating to YCoCg and Alpha Exponent into
misc.c/h, in the interest of making the rest of the codebase cleaner.
Removes the decode option from the import menu, as encoded files are
always decoded now (there used to be a menu button for doing this
after import, but with it gone there's no reason ever to not decode).
Finally, the remaining functions in color.c were only ever called once,
so these were extracted and inlined, and the empty file deleted.
2023-12-01 20:42:16 +00:00
Stayd
30922cc266 Better handling of DX10+ files in ddsread
Partial refactor of parts of ddsread to better handle DX10+ files.
Though not included here, this is necessary to import formats that
have no DX9 equivalent, namely BC6H and BC7, as the current handling
simply downgrades DX10 files and imports them like DX9 ones.
2023-12-01 20:42:16 +00:00
Stayd
e9c301cb37 ddsread and ddswrite cleanup and commenting
Extensive formatting and cleanup in the read-write files, and addition
of some comments where they seemed appropriate. Renamed a couple of
single-letter variables to be more descriptive.
Also removed an unnecessary global variable in ddswrite.c, and made
the "config" variable in ddsread a GimpProcedureConfig type, as was
previously done for ddswrite.
2023-12-01 20:42:16 +00:00
Stayd
4eea8ab42e Mipmap generation fixes and cleanup
Fixes two major issues with mipmap generation, namely sRGB transforms
being applied both backwards and in 8-bit precision, causing severe
color degradation. sRGB transforms are now handled correctly and all
mipmap generation is done at 32-bit floating-point precision.
A new cubic filter has also been added (Catmull-Rom) which rounds-out
the existing lineup of cubic filters.

Also includes extensive code cleanup (sorry I couldn't separate this)
to mipmap.c/h and color.c/h
2023-12-01 20:42:16 +00:00
Jacob Boerema
c2ecf37923 script-fu: fix #10279 gimp-image-set-selected-layers is failing
Recently some extra input validation was added, which caused the
gimp-image-set-selected-layers command in script-fu to fail with an
invalid value for argument 2.

This is caused by the object array contents always being set as
GIMP_TYPE_DRAWABLE, while the actual type may be a layer, etc.

So, let's set the actual type of drawable being used here by using
G_OBJECT_TYPE on the first data element.
2023-12-01 15:28:57 -05:00
Alx Sa
bd398d5cff themes: Define some widget's border colors
Adds specific definitions for some widget borders that
are currently only defined by the system. This avoids
clashing colors depending on the system theme.
2023-12-01 17:09:35 +00:00
Víttor Paulo Vieira da Costa
3229ba3c3e Update Brazilian Portuguese translation 2023-12-01 14:52:03 +00:00
Andre Klapper
2eab9b31e5 Fix invalid markup in Belarusian translation 2023-12-01 13:56:55 +01:00
Vasil Pupkin
71a9f3f157 Update Belarusian translation 2023-11-30 00:41:24 +00:00
Alx Sa
75c78bf19c themes: Define border-radius for radio buttons
Resolves #10033

Not all system themes set a GtkRadioButton border-radius, so it
can default to 0. This creates a "box" around the radio button.
This patch defines the border-radius at 100% to make it universal.
2023-11-29 12:03:39 +00:00
Jacob Boerema
6cca73516a libgimpconfig: fix #10278 Script-Fu API display commands are failing
on input arguments

This is the same issue as #10194 but for GimpDisplay. We fix it in
the same manner.
2023-11-28 15:38:47 -05:00
Jacob Boerema
ec999ee193 plug-ins: make metadata-editor/viewer use gimp_image_procedure_new
These were using gimp_procedure_new, which was causing warnings like
LibGimpConfig-WARNING **: 13:56:33.270: couldn't serialize property
 GimpProcedureConfig-plug-in-metadata-editor::image of type GimpImage,
and
gimp_plug_in_destroy_proxies: ERROR: GimpImage proxy with ID 1 was
refed by plug-in, it MUST NOT do that!

This also saves us from having to define image and run-mode parameters
ourselves.
2023-11-27 14:08:26 -05:00
Jacob Boerema
cc3f4c45c5 plug-ins, libscriptfu: silence warnings
We remove two warnings:
1. warning: format '%ld' expects argument of type 'long int', but
   argument 5 has type 'GType' {aka 'long long unsigned int'}
Since GType is gsize, and this is not used in translations, use format
specifier G_GSIZE_FORMAT.

2. warning: enumeration value 'SF_IMAGE' not handled in switch (and more
   similar ones).
Add a default block to let the compiler know we handle all values.
2023-11-27 13:10:22 -05:00
Luming Zh
3ab6451ff3 Update Chinese (China) translation 2023-11-27 15:48:45 +00:00
Rodrigo Lledó
e4b2ab7ff9 Update Spanish translation 2023-11-26 23:10:30 +00:00
Rodrigo Lledó
3dc44d8e21 Update Spanish translation 2023-11-26 22:57:05 +00:00
Yuri Chornoivan
49d1160e78 Update Ukrainian translation 2023-11-26 19:50:36 +00:00
Martin
87bd568696 Update Slovenian translation 2023-11-26 09:53:48 +00:00
Ekaterine Papava
b243fdc10a Update Georgian translation 2023-11-26 08:32:08 +00:00
Jehan
ef8ddd7e30 app: rename the new gimp_drawable_*_undo() functions.
These are not generic undo function, but specific to the resize case (and even
more particularly when calling the GimpItem's resize() class method).

Also the variable was wrongly named no_undo when it actually was meant for the
opposite meaning, i.e. when we want to push an undo for a resize() call. This
made the call harder to understand. Furthermore the usage of double negation did
not help with understanding the code.
2023-11-25 21:43:08 +01:00
Jehan
aa7d7badc8 app: do not leave out-layer artefacts when canceling painting with layer expansion.
This is a fixup commit to MR !961, fixing a particular commit 5c2373a125 saying
that when canceling painting with layer expansion, strokes outside of the layer
remain visible.
2023-11-25 21:43:04 +01:00
Jehan
e495fe7ede app: fix 2 GeglBuffer leaks and a profile leak. 2023-11-25 21:38:10 +01:00
Shubham
2c00152ce2 app: Add pattern to context props for tools supporting auto-expand
When auto expanding layers, there is an option that allows user to fill
the newly expanded part with the pattern. But without this change, it
was not possible to change the active pattern without switching to some
other tool like bucket fill tool. This commit allows that.
2023-11-25 16:19:43 +00:00
Shubham
41e0151478 app: Make the layer auto expand options shared between tools
Also added option in Edit->Preferences->"Tool Options"->"Paint Options
Shared Between Tools" that decides weather the options should be shared
between different tools.
2023-11-25 16:19:43 +00:00
Shubham
5c2373a125 app: Cancel functionality works with dynamic layers
Canceling a paint stroke restores the layer and mask (if present) to the
original size if they were expanded during the stroke. The part of
stroke that is outside the layer remains visible though.
2023-11-25 16:19:43 +00:00
Shubham
d49fcf9495 app: Always separate blobs_to_render and last_blobs in ink tool
In ink tool, if last_blobs is empty, the copy of blobs present in
last_blobs and blobs_to_render was same. Due to this, when layer
boundary is expanded, we move same blobs twice. Due to this a straight
line was drawn when starting painting from outside layer boundary. Fixed
the issue by storing a duplicate version in blobs_to_render. Updated
free part accordingly.
2023-11-25 16:19:43 +00:00
Shubham
2a41fc7ee4 app: Blink lock when layer expansion is prevented by lock
In layer expansion if user is trying to draw outside the layer boundary
with expand option turned on but the "Lock position and size" enabled,
the lock square will be blinked. If user is painting on layer mask, the
corresponding layer's lock will be blinked. It will be blinked only
once per stroke.
2023-11-25 16:19:43 +00:00
Shubham
df9d1f54f8 app: Fix inefficient method of preventing pushing undo
When resizing drawable for dynamic layers, the resize drawable function
would push Modified Layer/Channel item to undo stack. Initially, I was
checking if the drawable is being painted upon and used it to disable
the undo, but this when using resizing layers with layer mask, even if
mask is being painted upon, we still want to resize the main layer and
vice versa. But the main layer is not being painted upon so it would
push the undo to stack. To prevent this, I was using
gimp_drawable_paint_start before resizing, but this method is very
inefficient, as this function duplicates buffers. So added a new member
to drawable->private that will store weather to push undo or not.
2023-11-25 16:19:43 +00:00
Shubham
6bfed5008f app: Add options to choose fill type of layer and mask when expanding
Added option to tool settings that will decide how newly created parts
of layer and layer mask should be filled. For layer, same options are
provided as present in "Set Layer Boundary Size" dialog. For layer mask,
first two options from "Add a Mask to the Layer" i.e. "White" and
"Black" are added.

This commit changes gimp_channel_resize function to actually use the
passed fill type instead of using hardcoded GIMP_FILL_TRANSPARENT.
Hardcoding this value if required should be done in function calling
this function (which is already the case with all the instances already
present afaik).
2023-11-25 16:19:43 +00:00
Shubham
8bfa22b663 app: gimp_gegl_buffer_resize function can accept pattern to fill buffer
Modified gimp_gegl_buffer_resize function to add three new parameters,
pattern, pattern_offset_x and pattern_offset_y. If pattern is not NULL,
then we set the pattern of buffet to this value. Like in
gimp_gegl_buffer_resize function, this logic is mostly copied from
gimp_drawable_fill_buffer function with minor changes.
2023-11-25 16:19:43 +00:00
Shubham
841a195bb5 app: Fix broken strokes with the ink tool 2023-11-25 16:19:43 +00:00
Shubham
9ccb027aaa app: Create gimp_gegl_buffer_resize function
This function returns resized version of the input buffer. It also takes
in a color argument. The layer background will be filled with this
color. Fill background logic is similar to gimp_drawable_fill_buffer.
2023-11-25 16:19:43 +00:00
Shubham
5ed04055f1 app: check for lock_position of layer when editing its mask
The lock in the layers tab only sets lock for the actual layer and not
for its mask, so also check the lock on the actual layer and not just on
the mask when editing layer mask.
2023-11-25 16:19:43 +00:00
Shubham
5b8f410342 app: Fix layer expansion using MyPaint Brush tool with symmetry enabled 2023-11-25 16:19:43 +00:00
Shubham
960eaf0bc9 app: Ensure undo everytime layer expands while painting
Everytime the layer expands, if the undo extents are empty, then make
them non zero. If the undo extents are zero, then user will not be able
to undo the expansion of the layer. This is perticularly required by
MyPaintBrush as just clicking the image without any motion does not draw
anything, but expands layer if required.
2023-11-25 16:19:43 +00:00
Shubham
b291a32a24 app: Layer expansion with MyPaintBrush now works.
Added tool option like other tools.
2023-11-25 16:19:43 +00:00
Shubham
5fdee7c5e7 app: gimp_paint_core_expand_drawable will return boolean
This function returns TRUE if the drawable is expanded. Otherwise, it
will return FALSE. This removes the need to check width and height of
the drawable to infer the same.
2023-11-25 16:19:43 +00:00
Shubham
95f795008f app: Make image flush related functions idle
Made `gimp_image_editor_image_flush` and
`gimp_image_editor_image_flush_idle` functions idle. For expanding
layers dynamically, we need to use gimp_image_flush funtion from the
paint therad. The gimp_image_flush eventually calls these functions.
2023-11-25 16:19:43 +00:00
Shubham
3ccec0b128 app: Layer expansion while painting now works with layers with mask
When painting the layers with a layer mask, if the layer need to be
expanded, the layer mask is also expanded with it. The same is done even
if layer mask is being painted upon.

Undo works with these layers by adding resizing of both the layer and
mask to the undo group if the layer is resized during painting.
2023-11-25 16:19:43 +00:00
Shubham
5191c17fb7 app: Fix layer expansion while painting with symmetry enabled 2023-11-25 16:19:43 +00:00
Shubham
e33618a650 app: Layer expansion while using ink tool
Now layers will expand when trying to draw beyond layer borders with ink tool.
Tool options similar to paint tools have been added (expand_use and
expand_amount).
2023-11-25 16:19:43 +00:00
Shubham
97a2627867 app: Do not expand beyond image borders while painting
When painting with "Expand Layers" option turned on but "show all"
turned off, layer will not expand beyond image borders.

Layer will not expand if "Lock size and postion" is turned on.
2023-11-25 16:19:43 +00:00
Shubham
4a953e5b59 app: Separate function for layer expansion while painting
Created a separate function gimp_paint_core_expand_drawable that handles
layer expansion while painting. The gimp_brush_core_get_buffer function
now uses this function to expand drawable. It has been separated so that
it can be reused for ink tool.
2023-11-25 16:19:43 +00:00
Shubham
9707a87488 app: Add options for tools which make layers expand
Added a checkbox that decides weather tool should expand layer when
crossing layer border and a scale that decides by what amount should
layer expand.
2023-11-25 16:19:43 +00:00
Shubham
becb23c926 app: Make undo work when layers are expanded during painting
Undo now restores layer to original size if it was expanded while
painting.
2023-11-25 16:19:43 +00:00
Shubham
ae7d37ebbd app: Make layers expand when painting with paintbrush tool
When painting with paintbrush tool, the borders of active layer will
automatically expand to accomodate the stroke. The undo does not work
with expanding layers.
2023-11-25 16:19:43 +00:00
Rodrigo Lledó
7201858d65 Update Spanish translation 2023-11-24 12:06:17 +00:00
Rodrigo Lledó
0fbab7f784 Update Spanish translation 2023-11-24 10:25:47 +00:00
Rodrigo Lledó
4510a830b0 Update Spanish translation 2023-11-24 09:19:11 +00:00
Alx Sa
62da36cd43 core: Better handle group endings in ASE palette import
This patch adds better handling for group begin and end markers
within ASE palettes. As a result, this fixes an issue where the last
color was not imported in some ASE files without groups.
Additionally, this guarantees that colors are imported using 4 bytes
per https://gitlab.gnome.org/GNOME/gimp/-/issues/10359#note_1921462
2023-11-24 06:08:09 +00:00
Vasil Pupkin
95d062d774 Update Belarusian translation 2023-11-23 23:46:28 +00:00
Sabri Ünal
333f1e1e5b Update Turkish translation 2023-11-23 17:08:40 +00:00
Anders Jonsson
7291a3553c Update Swedish translation 2023-11-23 14:52:23 +00:00
Martin
a8d589ec62 Update Slovenian translation 2023-11-23 08:07:19 +00:00
Ekaterine Papava
5794919aeb Update Georgian translation 2023-11-23 05:05:43 +00:00
Luming Zh
a5bace3513 Update Chinese (China) translation 2023-11-21 21:15:22 +00:00
Jehan
217fd3699f NEWS: update. 2023-11-21 14:28:57 +01:00
Yuri Chornoivan
f273cc93d4 Update Ukrainian translation 2023-11-21 07:11:17 +00:00
Daniel Novomeský
291208f4f9 build: associate hej2 extension in Windows installer 2023-11-20 20:18:37 +01:00
Daniel Novomeský
8bb34ac596 plug-ins: HEJ2 format loading
This image format is also called as JPEG-2000 in HEIF,
it is supported in recent versions of libheif.
Specification: https://www.itu.int/rec/T-REC-T.815-202106-I/en
2023-11-20 20:16:01 +01:00
Alx Sa
2c68021b54 core: Fix strict-aliasing error on ASE load
Resolves #10359

When compiled with -Werror=strict-aliasing, the build fails
on this line due to converting pointer datatypes.
This patch switches to using memcpy () instead.
2023-11-19 13:53:18 +00:00
Jordi Mas
ef65db052f Update Catalan translation 2023-11-19 09:53:17 +01:00
Alx Sa
b907e5efbe plug-ins: Import/export safe-to-copy PNG chunks
Currently we only use and retain "critical" PNG chunks,
discarding any safe-to-copy but non-image chunks.
This adds code to store them as parasites and then
include them on export, thus preventing loss of data.
2023-11-19 04:13:39 +00:00
Alx Sa
5e076c2803 plug-ins: Add loop count to GIF parasite
In ccd12318, the parasite to remember if the GIF was an animation
did not actually store the number of loops. This patch fixes that.
2023-11-17 21:07:05 +00:00
Martin
27e13924ea Update Slovenian translation 2023-11-17 09:29:14 +00:00
Jacob Boerema
10492830a8 plug-ins: fix GError set over the top of a previous GError ...
when loading a BMP image with an invalid compression value.

The invalid compression check was missing a goto out (error exit)
causing the GError to be overwritten, which caused a GLib warning.
We add the missing goto statement here.
2023-11-16 19:12:48 -05:00
Bruno Lopes
fd6d404698 Issue #8877: Package 'gdbus' on Windows to fix warnings 2023-11-14 08:19:49 -03:00
Martin
3bdeeb9739 Update Slovenian translation 2023-11-13 14:39:32 +00:00
Martin
bf381d7ad5 Update Slovenian translation 2023-11-13 14:27:35 +00:00
Luming Zh
104f4e272d Update Chinese (China) translation 2023-11-12 14:44:18 +00:00
Alx Sa
ccd1231869 plug-ins: Save GIF animation when overwriting
Overwriting a GIF animation results in loss of frames if a previous export turned off
animations.
This sets a parasite on import which we check for on overwrite. If it was an
animation originally, we overwrite as an animation as well.
2023-11-12 12:10:34 +00:00
Luming Zh
7efd6421ba Update Chinese (China) translation 2023-11-12 00:57:22 +00:00
Ekaterine Papava
89df8aab1d Update Georgian translation 2023-11-11 20:07:23 +00:00
Jehan
24b36379f0 app: migrate shortcut from select-float to select-cut-float.
See my previous commit.
2023-11-11 20:03:26 +01:00
Yuri Chornoivan
5f4b25c857 Update Ukrainian translation 2023-11-11 16:55:49 +00:00
Yuri Chornoivan
d6d66c03df Update Ukrainian translation 2023-11-11 16:47:22 +00:00
Jehan
05b2f93876 Issue #10153: introducing new floating data actions.
Though we mostly removed floating layers/masks (formerly floating
selections) in many interactions, at least for default behaviors for
basic pastes, there are still advanced usage attached to this concept
and some advanced users are willing to have easier access to such items.

For this reason, this commit:

- adds edit-paste-float and edit-paste-float-in-place for pasting the
  contents of the clipboard as floating data with default positionning
  algorithm or in-place respectively;
- renames select-float to select-cut-float which does a cut and paste as
  float in one action;
- adds select-copy-float which does a copy and paste as float in one
  action;
- reorganize a bit the `Edit > Paste as` submenu with sections for the
  floating data variants;
- add a "Float" submenu in "Select" root menu, containing the 2 variant
  actions select-cut-float and select-copy-float.
2023-11-11 16:40:44 +01:00
Jacob Boerema
f97e718e7a plug-ins: issue #5556 Interpret transparency as black on DDS DXT1 textures
This adds an import option for DDS DXT1/BC1 images to always use
transparency. This is the default behavior, since this was what always
happened until now and it seems that DDPF_ALPHAPIXELS is very rarely
set for these type of images.

However, as the mentioned issues explains, advanced compression
algorithms can use this transparency data instead to mean a black
pixel. There is however, no certain way to determine this.

For that reason, we add an option here, that, if disabled, will
interpret fully transparent values as a black pixel.
2023-11-10 18:30:42 -05:00
Jacob Boerema
dd45e3b462 plug-ins: add option to vertically flip dds image on import
Some games apparently need dds images to be vertically flipped.
We already have an option to flip dds images on export, so it makes
sense to also allow flipping on import.
2023-11-10 18:30:41 -05:00
Alx Sa
efa1267f13 actions: Fix layer buttons relative to floating selections
The anchor and merge down buttons are visible at the same time, which should not be the case.
Their visibility is now dependent on the existance of a floating selection.
The New Group and Search/Link buttons are also disabled when there's a floating section.
2023-11-10 20:33:26 +00:00
Jehan
f12a88bd65 build: sync nightly flatpak manifest with beta one. 2023-11-10 20:33:10 +01:00
Jehan
5f03859abf desktop: syncing the AppData with gimp-2-10 one. 2023-11-10 16:02:33 +01:00
Jehan
59116d37f8 Issue #10023: don't use the selected text styling to display the selected items label.
The idea initially came from some styling in Thunderbird. It's not that useful anyway.
2023-11-10 15:28:16 +01:00
Jacob Boerema
f516ed6935 plug-ins: fix #8942 add DDS support for reading R8G8, R16 and R16G16 formats
In addition to the requested DXGI variants we also load the older
D3DF versions, including handling of the signed versions.

We also set signed when the pixelformat flag DDPF_BUMPDUDV (added in
the previous commit) is set.
2023-11-09 18:40:50 -05:00
Jacob Boerema
4e6e3202c8 plug-ins: add more complete list of DDS flags and pixelformat flags 2023-11-09 18:40:50 -05:00
Jehan
7f15251d2e Issue #10281: layer locks popup is not appearing. 2023-11-09 15:39:21 +01:00
Alx Sa
a8369f57c1 themes: Define more GimpSpinButton styling
As shown in issue 10287, the system theme can create a
large white border around GimpSpinButton.
This patch fixes this, and also improves the border appearance
by assigning it to the background color rather than system default.
2023-11-09 13:26:55 +00:00
Jordi Mas
68b79dea0d Fixes to Catalan translation 2023-11-08 07:33:19 +01:00
Luming Zh
7f0b24b46e Update Chinese (China) translation 2023-11-07 18:24:38 +00:00
Yuri Chornoivan
71925dc0aa Update Ukrainian translation 2023-11-06 21:47:25 +00:00
Jacob Boerema
ef3f464ad7 plug-ins: add support for loading DDS 16- and 32-bit per channel RGBA
This adds support for loading RGBA DDS images with 16- and 32-bit per
channel. Loading is supported for 16-bit half float, 32-bit float,
16 and 32-bit unsigned and signed int.

This supports both the DX10 formats and the D3D FOURCC versions.

16- and 32-bit per channel images with less than 4 channels are not
yet supported.
2023-11-06 16:29:22 -05:00
Alx Sa
ea7a29af45 Issue #10250: Enable "Layers as Pages" for single layer group in PDF export
When saving a PDF, you have the option to export layers as pages.
This works for a single layer group that contains multiple layers.
However, the option is disabled because the plug-in only checks
"top level" layers.
This patch adds code to check if the single layer is a layer group,
then enables the option if there are more than one layer in that group.
2023-11-06 20:56:33 +00:00
Daniel Novomeský
183cb49b1e plug-ins: load metadata via libheif and disable rotation dialog 2023-11-06 16:03:28 +01:00
Jehan
6b86bb72f0 README: some updates.
A link to the online documentation website is definitely needed in
there.

Also get rid of mentions of mailing lists as still active discussion
media.
2023-11-05 22:25:09 +01:00
Jehan
abf66dd66a plug-ins: prevent explicit http scheme to be automatically changed to https.
This completes commit 685c8bde99 where the http:// scheme was automatically
transformed into https:// in some cases, in particular while typing (when
pasting for instance, it was still possible to add an http URL). So let's block
"toggled" signal handlers when the URL is explicitely edited to prevent this
annoying issue.

(cherry picked from commit b991f8b361)
2023-11-05 21:58:18 +01:00
Jehan
eb7337d5e4 Issue #3247: make consistent generated brush preview.
This is only a temporary solution meant to be backported to gimp-2-10 branch,
so that at least the preview now matches how angles always worked in at least
the 2.10 series: angles are measured clockwise.

Now there is the question that in the documentation of the Brush Editor, it is
written that angles are supposed to be counter-clockwise. A solution was
proposed to make them so, but only for generated brushes (whereas angles stayed
clockwise for other types of brush) which is a very bad inconsistency.
Furthermore I find the whole tool options vs. brush editor settings mess quite
confusing. Some decision should be made for GIMP 3.

For GIMP 2.10 though, this should be an OK fix: no behavior change on-canvas,
only making the preview actually match what happens on-canvas (even though it
goes against what the docs say but it's probably better than breaking workflows
relying on actual on-canvas behavior).

Note: this commit is based on an initial proposition by Alx Sa in MR !1119,
except that the patch was only working when the preview needed to be scaled.
Instead we must go through this brush transformation code path for generated
brushes, whatever the scale.
2023-11-05 19:13:11 +01:00
Daniel Novomeský
d3d13c71f5 plug-ins: force metadata loading via libjxl
While exiv2/gexiv2 could be able to load metadata from JXL files
directly, success is not guaranteed (depends on version and
configuration, for example support could be disabled or compressed
metadata could not work).
Loading metadata via libjxl should work all the time.
It is also important not to display dialog to rotate the image
according the orientation from EXIF, because in case of JXL,
the orientation is stored in codestream and it has priority.
2023-11-04 20:34:01 +01:00
Jehan
ee9be210eb libgimpwidgets: get rid of build warning.
This fixes this warning (as appeared with commit ad8b47bff7):

[1/235] Compiling C object libgimpwidgets/libgimpwidgets-3.0.so.0.9900.17.p/gimpdialog.c.o
../../../../../../../dev/src/gimp/libgimpwidgets/gimpdialog.c:774:1: warning: ‘gimp_dialog_set_title_bar_theme’ defined but not used [-Wunused-function]
  774 | gimp_dialog_set_title_bar_theme (GtkWidget *dialog)

We could either put the whole `gimp_dialog_set_title_bar_theme()` declaration,
definition and usage into #ifdef, or only the implementation (making the
function a no-op on non-Windows platforms). I chose the former. There was some
discussion that maybe some implementation may happen later for other platforms,
but until then, no need to call it needlessly (even more as we don't know when
any theoretical other implementation would happen).
2023-11-03 15:31:51 +01:00
Jacob Boerema
1b258729c9 ci: Korean translation for the Windows installer was moved to Official
Also remove special handling of Hungarian since it is now part of an
official release.
2023-11-02 21:40:04 -04:00
Jacob Boerema
8cd97b90dd plug-ins, dds: always compute pitch_or_linsize ourselves
Certain dds images can have non-zero unexpected pitch_or_linsize values.
Until now we were only computing this ourselves in case it was zero.
Let's just always compute it and print an error to the terminal if it
differs from the value in the file.

A sample can be found in Galactic Civilizations 3: Bokeh_Hex.dds.
This change also allows us to safely load the poc in security issue
ZDI-CAN-22093 as that issue was apparently only caused by an invalid
value of pitch_or_linsize.
2023-11-02 15:21:23 -04:00
Jacob Boerema
c8a8d06cd8 plug-ins: move unchanging code out of the loop in dds load_layer
Optimize dds loading a bit by moving code that doesn't change outside
the loop:
1. The number of bits to be shifted when the source isn't exactly 8 or
16 bits depends on bytes per sample and isn't changing inside the loop.
2. Use rowstride variable to compute width * d->bpp once.
3. The check for rowstride > hdr->pitch_or_linsize doesn't change
inside the loop so move it out.

Inside the loop we only check the DDSD_PITCH flag once and move both
the size check and the fread check inside it.
2023-11-02 15:21:23 -04:00
Jehan
cc5636388f NEWS: update.
Remove several features which have been backported, hence will be first
available in GIMP 2.10.36 (soon to be released).
2023-11-02 20:15:57 +01:00
Alx Sa
b68a86e486 paint: Don't paint with gradient if dynamics not enabled
Resolves #10262.

The gradient color was being used if Confetti or Color from Gradient
dynamics had been set, even if dynamics had been disabled.
This adds an additional check to make sure dynamics are enabled
first - otherwise, the brush's existing stamp or color is used to paint.
2023-11-02 11:19:16 +00:00
Alx Sa
41872a5426 plug-ins: Fix broken macro for van-gogh-lic 2023-11-01 23:31:06 +00:00
Jacob Boerema
74adec7656 plug-ins: fix #10240 DDS saved as RGB10A2 loads incorrectly
There were 2 issues here:
1. When more than 8 bits per sample are used, a previous commit changed
it so that we would be using 16-bit integer mode instead of 8-bit.
However, the actual code for this specific format was not updated to
reflect that.
We fix this by computing 16-bits per channel values and upshifting the
10 and 2-bit samples to 16 bit per channel.

2. The computation of masks was incorrect. It computed each channel
mask separately, based on whether it was <= 8 or not.
However, if any channel needs more than 8 bits, all masks should be
computed 16 bits since we will then 16-bit integer mode.
We fix this by checking all channel bits together, and if any is higher
than 8, but not more than 16,  we use 16-bit masks.
I also took this opportunity to add support for 32-bit masks if we
ever need those.
2023-11-01 15:24:34 -04:00
Luming Zh
e3b2f40ac2 Update Chinese (China) translation 2023-11-01 13:11:30 +00:00
Alx Sa
035510d1ad plug-ins: Set pixel aspect ratio for IFF images
Based off code for GIFs in 22963405.
Code was also rearranged to check if the image
is valid before trying to use some of its features.
2023-11-01 10:36:06 +00:00
Yuri Chornoivan
e62b4a3a7c Update Ukrainian translation 2023-10-31 19:20:57 +00:00
Jacob Boerema
905527ade1 plug-ins: fix typo in file-png 2023-10-31 11:37:28 -04:00
Alan Mortensen
dae82069f3 Update Danish translation 2023-10-31 13:18:40 +00:00
Alan Mortensen
9c49f73468 Update Danish translation 2023-10-31 13:14:25 +00:00
Anders Jonsson
611b3e7b1d Update Swedish translation 2023-10-30 08:17:13 +00:00
Rodrigo Lledó
79259f45cf Update Spanish translation 2023-10-28 22:54:26 +00:00
Rodrigo Lledó
267257532d Update Spanish translation 2023-10-28 22:46:03 +00:00
Rodrigo Lledó
ad537dc63f Update Spanish translation 2023-10-28 22:29:54 +00:00
Alx Sa
83d13c6004 plug-ins: Additional fixes for DDS Import
@Wormnest noted remaining regressions after 8faad92e.
The second fread() only runs if the DDSD_PITCH flag is set,
so the error handling check should also be conditional.
Additionally, the ZDI-CAN-22093 exploit no longer runs but
still could cause a plug-in crash. This patch adds an additional
check to ensure the buffer size was within bounds.
2023-10-28 19:54:58 +00:00
Martin
5ddad59921 Update Slovenian translation 2023-10-28 19:49:00 +00:00
Alx Sa
8faad92ee9 plug-ins: Fix DDS import regression from 6ad54ca3
@Wormnest pointed out that compressed files are likely smaller than
width * height * bps, so our check to prevent ZDI-CAN-22093
also caught valid files.
The size check is removed from load_image () and moved to load_layer ()
before the two fread() functions, as we know exactly how much we'll
try to read at that point.
2023-10-27 19:24:18 +00:00
Yuri Chornoivan
a5f077fb83 Update Ukrainian translation 2023-10-27 18:18:16 +00:00
Idriss Fekir
b503a3dc1d Fix bug when font is from a .ttc file
When loading an xcf file, if a a font has already
been used, its file's hash is compared against the hashes
from the xcf file (to speedup loading), but if the font is from a .ttc file (a font
collection), then all fonts from that file will have the same file
hash, so the wrong font might be selected. a simple solution is to not
use the hash except as a last resort if every other field is identical.
2023-10-27 15:48:58 +00:00
Jehan
28e94a6d8f NEWS: update. 2023-10-27 14:49:59 +02:00
Jehan
2dcc8eea93 app, libgimp, pdb: remove the internal PDB function _gimp_pdb_get_data_size().
We exchange GBytes structs which know their own data size already and is much
safer.
2023-10-27 10:16:45 +00:00
Jehan
7a03b3ea09 libgimp: gimp_pdb_get_data() and gimp_pdb_set_data() are made internal.
These are not usable by plug-ins anymore which should store their data between
runs as arguments or aux arguments (in case of values which should be stored
from one run to another but are not really usable for non-interactive scripts).
These are per-plug-in (not polluting the whole process space with just random
strings as identifiers which could be used by other plug-ins) and even survive
restarts of GIMP.

I still keep these functions, but only internally, as they are used to store
settings of GimpAspectPreview, GimpDrawablePreview and GimpZoomPreview across
plug-in runs. Still I changed their API to set and return a GBytes directly
(mimicking the private PDB functions' API).
Also I remove gimp_pdb_get_data_size() which is useless when exchanging GBytes
directly.

Note that the 2 functions are still exported in the library, and only not
advertized through headers (so they are not really internal, just hidden), on
purpose, because we need to call them in libgimpui. So it is still relatively
easy for a plug-in to use them. Nevertheless I made clear in the function
documentation that these must not be considered public and could end up deleted
at any time. Any plug-in still trying to call these takes the risk of having
their code relying on unreliable API.
2023-10-27 10:16:45 +00:00
Ekaterine Papava
0b0adfc627 Update Georgian translation 2023-10-27 04:38:09 +00:00
Alx Sa
0b83950ec4 plug-ins: Make van-gogh-lic scriptable...
...by adding parameters and porting to
GimpProcedureConfig/GimpProcedureDialog.
Code was also rearranged to match the ordering
of other plug-ins.
As a note, the help message is "Special effects that nobody understands".
It would be nice if someone with more familiarity with this plug-in could
update the help messages to explain the parameters.
2023-10-27 01:17:37 +00:00
Anders Jonsson
8055833d47 plug-ins: dds string fixes 2023-10-26 21:52:32 +00:00
Jehan
83a5998547 app: do not assume that a procedure is still registered after running.
I had the case when "Sphere" script crashed, bringing down the whole script-fu
plug-in (while trying to reproduce #10214). Then after being run, we get a
dangling pointer to a finalized action object.

Even in successful use cases, we will want to give the ability to unregister
normal plug-ins/procedures wrapped as GIMP extensions, and there is also the use
case of temporary procedures, so I'm sure this bug could be reproducible even in
normal non-problematic runs.
2023-10-26 22:44:07 +02:00
Yuri Chornoivan
fe8811c119 Update Ukrainian translation 2023-10-26 20:00:21 +00:00
Jehan
78aec68624 plug-ins: replace gimp_[gs]et_data() by AUX args in file-tiff. 2023-10-26 21:46:39 +02:00
Martin
374bc7f24b Update Slovenian translation 2023-10-26 19:19:31 +00:00
Martin
61793061db Update Slovenian translation 2023-10-26 19:10:58 +00:00
Jehan
4e9a077219 app: data tree views are in single selection mode.
I am pretty sure that this should be in single selection mode because we don't
even really have code to handle cases with multiple brushes or font selected.
Right now, we assume in many places that there is only one font or brush (or
other data) active at a given time.
Yet this code (or older versions of it) is old apparently and I realize that
even in 2.10, I can ctrl/shift click to select several data objects. This is the
weird part.

Anyway let's put this in single selection mode and see how it goes. If there
were actually use cases which I didn't know about, I'm sure we'll soon have
reports.
2023-10-26 20:59:48 +02:00
Jehan
40811be562 app: further improves the cursor choice heuristic with multi-selection.
I could still see annoying scrolling up/down happening when we are deselecting
an item (typically with ctrl-click). In such a case, the cursor is on a
deselected item. Just make it bump to a closest item, preferably a visible one.
2023-10-26 20:50:37 +02:00
Alx Sa
427130be25 plug-ins: port dds-write to GimpProcedureDialog.
Note that "save-type" and "mipmaps" were left as ints rather than GimpChoice,
as some options are conditionally disabled and I don't know if that 
is available in GimpChoice just yet.

A DDS loading bug related to 6ad54ca3 was also resolved. 
The correct header value to check for the pixel size was not "depth" but "bpp".
2023-10-26 17:16:49 +00:00
Jehan
195ac684a7 app: avoid scrolling up to top item of multi-selected items.
My first versions were commits 98f0c448 then 1d8782915e but the more I go, the
better I understand the implications of the selection vs. the cursor. In
particular, when setting a cursor, which also initializes the selection to this
item only, the tree view would also scroll to this item. The current
implementation, which sets the top item as cursor, is therefore particularly bad
for multi-selection which doesn't fit fully in the view, because we also end up
scrolling up. Say you have a long list of layers, you first select the top
layer, then scroll down to the bottom layer and ctrl-click it: the selection
(now 2 items) works but you end up scrolled back all the way up.

This alternate version is much better, by ensuring that your cursor is at least
within the selection (hence avoiding the discrepancy between keyboard navigation
and pointer navigation, and which was fixed with commit 98f0c448), so that we
don't try to change the cursor when possible.
2023-10-26 18:32:59 +02:00
Jehan
636b38be4f app: fix broken multi-selection.
This was broken in commit 3e101922. Setting a cursor basically resets to a
single selection, invalidating pointer-made multi-selection.

But then we got back the bug it fixes, which is that we must grab focus after
the selection is actually made. So we now grab at the end.

This also had a bad consequence for multi-selection (again): if the focus was
not already on the tree view, gimp_container_tree_view_selection_changed() was
not called. This function was where the actual selection-changing is meant to
happen. So we had to shift-click (or ctrl-click) twice. The first time, nothing
would happen (but focus was given to the tree view). The second time, we could
finally update the selection.

This is why we add 2 different cases of focus grab, which should hopefully
handle all cases correctly, though this code is really extra-complex. This
replaces MR !1128.
2023-10-26 17:19:08 +02:00
Alan Mortensen
05a1a9bbbc Update Danish translation 2023-10-26 14:22:00 +00:00
Ekaterine Papava
e8012ddcd2 Update Georgian translation 2023-10-25 21:23:55 +00:00
Jehan
f2734cec13 plug-ins: replace gimp_[sg]et_data() with an aux bytes argument in curve-bend.
I also remove (without replacement) 2 usages of gimp_get_data() without
associated gimp_set_data(). According to the comment, it looks like the
associated data was likely set by the GAP plug-in instead. Let's drop this.

Finally I see a lot of arguments, several of them being float arrays, so I
wondered if they were related to the curve and point arrays we are storing as
aux arg now. Apparently these arguments are not even used in the plug-in, right
now, which is explained in commit e318651c99. Maybe if these were actually
used/set and if we implement float array (de)serialization, would this aux
argument become useless?

Lastly, I deleted some code paths which were never used. For instance, stored
bval.total_steps was never set to anything else than 0 anywhere (so I removed
both the variable and the other code-path, which actually ended up being the
GAP-related data get). Additionally in p_bender_calculate_iter_curve(), there
was a big else block which was only happening when the GAP-related variables
were set. It got deleted too (as is a function only used in this block of code).
2023-10-25 22:47:45 +02:00
Jehan
8d6f281a72 plug-ins: replace gimp_[sg]et_data() with an aux str argument in ifs-compose.
The argument is the serialized description of the generated fractal. Actually it
may even be useful as a non-aux argument. A GFile argument could eventually be
interesting too, though one arg per setting would be better of course (it allows
more easily to generate animated frames for instance). In such a case, the GFile
would be used in priority, otherwise the other args.

Notes:

* I didn't port to GimpProcedureDialog though it looks like it would not be too
  hard (most of the GUI would still be custom GTK code, yet we could have the
  generic "reset to initial|factory values" buttons and load/save).
* The custom "Reset" button (identical to what "reset to factory values" would
  do) works fine anyway.
* The "run with last vals" works fine where there were indeed previous runs
  (which may be in previous sessions), but crashes when it's actually the first
  run ever. Some of the base structure data were not initialized. It should not
  be too hard yet would require a bit of code reorganization to fix this.
2023-10-25 19:01:02 +02:00
Jehan
0a0d66bda7 plug-ins: replace gimp_[sg]et_data() with an aux bytes argument in animation-play. 2023-10-25 19:01:02 +02:00
Alx Sa
f2bf2b7fe3 app: Fix initialization warnings
Initialized values in gimpruler.c and
gimptoolrectangle.c to remove warnings
about uninitialized variables.
2023-10-25 16:15:04 +00:00
Sabri Ünal
1ed8b20f02 Update Turkish translation 2023-10-25 13:44:23 +00:00
Sabri Ünal
b972bfdae9 Update Turkish translation 2023-10-25 13:44:15 +00:00
Sabri Ünal
179a084017 Update Turkish translation 2023-10-25 13:41:53 +00:00
Luming Zh
05703868bc Update Chinese (China) translation 2023-10-25 13:05:58 +00:00
Yuri Chornoivan
a3355a635d Update Ukrainian translation 2023-10-25 09:40:41 +00:00
Jehan
edc6232ae1 plug-ins: replace gimp_[sg]et_data() with an aux bytes argument. 2023-10-24 23:46:53 +02:00
Jacob Boerema
c2d76f38ff plug-ins: handle fill layers with negative height
As mentioned on Discourse here
https://discourse.gnome.org/t/error-opening-psd-image-height-no-support-or-invalid-1/17743
When opening a certain psd
(https://github.com/Squirtleiscool/Coalition-Technologies-Skill-Test/blob/master/CT_SkillTest_v1.psd)
We get a warning when creating a layer with a height of -1.
Apparently certain fill layers can have a negative height. Data on how
to handle this height is probably inside the 'SoCo' layer resource
that we don't handle yet.
For now, we will set the layer to empty and the height to 1.

To be on the safe side, let's also check the layer width to be non
negative.
2023-10-24 17:32:05 -04:00
Jehan
1caf6a8de4 plug-ins: remove useless gimp_[gs]et_data() calls.
This already uses GimpProcedureDialog and copy_from_config() is taking care at
filling the mapvals struct when an update is done.
2023-10-24 22:42:14 +02:00
Jehan
afef78b62c plug-ins: g_object_[gs]et_data() in help-browser replaced with aux bytes arg. 2023-10-24 22:28:37 +02:00
Jehan
56e5ed4559 plug-ins: various improvements to cml-explorer.
- Argument "parameter-uri" becomes "parameter-file" (GFile instead of URI
  string).
- Adding a "settings-data" auxiliary bytes argument to handle all settings for
  the time being, instead of using gimp_get_data() and gimp_set_data().
- "last_file_name" was also removed from the ValueType struct, using the
  "settings-data" arg instead.
- Fixing the non-interactive usage which was missing a gegl_init() call.
- Use GIO for various reading and writing to a CML parameter file.
- Better bubbling up of error messages.
- Fix the loading of the last section of CML parameters file.
- Also fixing deactived file dialog when clicking the open button a second time.
2023-10-24 22:28:37 +02:00
Jehan
04bcade9d7 plug-ins: current usage of gimp_[sg]et_data() in twain is bogus.
I don't even replace this one with an auxiliary bytes arg because this is
absolutely unused to start with.
2023-10-24 22:28:37 +02:00
Jehan
39409218a2 plug-ins: get rid of gimp_[sg]et_data() in gimpressionist.
We use a GBytes auxiliary argument (i.e. not visible in the public API) which
perfectly replace gimp_[gs]et_data() API, in even better (since it also works
across sessions).

The "Reset to initial values|factory defaults" still don't work. We could make
these work even with the AUX args, but I feel like this would be far too much
work for a non-optimal solution anyway. The real solution can be when we get
more public arguments to this PDB procedure to handle every setting
individually. This can happen after GIMP 3 release (especially now that
arguments number and order don't break the PDB API anymore).
2023-10-24 22:28:37 +02:00
Boyuan Yang
de10c0c309 Update Chinese (China) translation 2023-10-24 17:30:22 +00:00
Vasil Pupkin
65175d590e Update Belarusian translation 2023-10-24 16:20:56 +00:00
Yuri Chornoivan
032b786cb8 Update Ukrainian translation 2023-10-23 16:27:23 +00:00
Jehan
19b732a1da plug-ins: get rid of useless gimp_set_data() and gimp_get_data(). 2023-10-23 18:19:10 +02:00
Jehan
3352fb8639 plug-ins: port flame to GimpProcedureDialog.
I added a bunch of arguments, in particular nearly all the settings in the main
dialog, except for "Colormap" as I'm unsure yet how to handle it. It looks like
a mix of GimpChoice and GimpDrawable. I guess it could just be both (2 args,
using values from the GimpChoice if GimpDrawable arg is NULL).

And I didn't make the settings in the "Edit Flame" dialog into arguments as I'm
not sure if the "Speed" and "Variation" in particular should be args, or are
just temporary args only meant to construct a flame (in particular, it looks
like it builds data defining the flame?). These data should be their own args
probably?

Maybe we could also have the "file" as alternative way to init the flame data
(the "Open" button)?

For now, I'm just storing the whole settings struct as an aux argument, so that
"Load/Save Settings" work, as well as the initial values from previous run.

Also the whole code is still a bit of a mess. I feel like we could really
simplify a lot of the code, all these values stored globally or duplicated now
in both the GimpProcedureConfig and the control_point structure.
2023-10-23 17:07:09 +02:00
Alx Sa
0faaf7c379 themes: Define behavior for clicking already selected button
Resolves #9989

In 2.10/GTK2, clicking an already selected toolbutton caused the
background color to change to indicate this action.
This patch restores that behavior through CSS updates.
It also slightly rearranges the CSS to group related button styles.
2023-10-22 16:59:29 +00:00
Jordi Mas
6681fe7267 Update Catalan translation 2023-10-22 07:21:24 +02:00
Alan Mortensen
f5f1e05157 Update Danish translation 2023-10-21 09:09:55 +00:00
Alan Mortensen
c1b6756ee7 Update Danish translation 2023-10-21 09:09:49 +00:00
Alan Mortensen
488d154c44 Update Danish translation 2023-10-21 09:08:34 +00:00
Asier Sarasua Garmendia
0c5cb17d8a Update Basque translation 2023-10-21 07:00:51 +00:00
Jehan
0383ad350e Issue #9800: GimpAlignOptions' finalize() not properly chaining up.
Since we were not chaining up with parent's finalize(), we were not
removing the instance from the gimp-debug infrastructure which assumed
the object was leaked and would try to read its reference count for
debugging purpose, when GIMP_DEBUG=all was set.

In fact, the object was not leaked, therefore we got into a segfault
when dereferencing already freed memory.
2023-10-21 03:44:32 +02:00
Jehan
4fc9daedad Issue #10208: validate arguments for PDB calls run by script-fu.
I added a few specific validations for range types (int, double…), and a
generic validation at the end, meant to catch all yet uncaught invalid
argument cases (yet with less details on the what and why).
2023-10-21 02:46:58 +02:00
Massimo Valentini
3e101922d8 widgets: Prevent Toolbox autoscroll bug
In Preferences > Toolbox, clicking on an item below the
initial scroll window view causes it to jump to the top
automatically. This patch prevents this by setting the
clicked index in the GtkTreeView before grabbing focus.
2023-10-20 19:19:39 +00:00
Yuri Chornoivan
57a6386a3f Update Ukrainian translation 2023-10-20 18:41:56 +00:00
Jehan
a4b68c5244 app: don't call gimp_align_options_image_changed() on finalized options object.
I had this one crash upon exit, inside gimp_align_options_update_area() as a
consequence of gimp_align_options_image_changed() being called on an image
change. I could not reproduce after this one time and it's very likely a race
condition when everything is getting finalized, and the tool options object is
getting finalized earlier than the user context.

Anyway this should fix the potential crash.
2023-10-20 19:54:30 +02:00
Jehan
410ff342bc libgimp: fix double free crash.
gimp_procedure_new_return_values() takes ownership of the passed GError (it
allows, among other things, to call it directly as return value). So we must not
try and free it afterwards.
2023-10-20 19:01:38 +02:00
Jehan
3a0a400ad1 plug-ins: port forgotten uses of gimp_pdb_run_procedure*() removed API.
As often, we forgot to look in bindings. Thanks to Alx Sa for reminding me of
these.
2023-10-20 19:01:38 +02:00
Jehan
c3e59b071f libgimp: allowing NULL passed as value to a GimpObjectArray PDB argument.
A NULL will be transformed into an array of size 0.
2023-10-20 19:01:38 +02:00
Jehan
8ca6f1ac5b libgimp: gimp_procedure_new_arguments() can now be made static. 2023-10-20 19:01:38 +02:00
James Golden
22b28df391 app: save dialog now adjusts size up to monitor height
Fixes: #9373
2023-10-20 14:28:30 +00:00
bootchk
3646b86ce0 2.99 libgimpconfig: #10194 broken API GimpItem
And GimpTextLayer, GimpLayerMask
2023-10-20 09:04:42 -04:00
Ekaterine Papava
d8140cc2a1 Update Georgian translation 2023-10-20 04:03:45 +00:00
Alx Sa
208e22da3a themes: Define file dialog path buttons hover colors
Resolves #10039.

This keeps the highlight style consistent for the file
dialogues, no matter the underlying system theme.
2023-10-20 02:30:14 +00:00
Alx Sa
2c83d84d02 plug-ins: Load guides and grid info for PSP files
These are stored in the Extended Block. This block also holds metadata
in Exif, IPTC, and XMP formats, but those are not yet implemented in this
patch. A comment stating Exif was implemented in PSP 10 was corrected
to PSP 8 as well.
2023-10-19 19:36:52 +00:00
Rodrigo Lledó
f3d54b76b6 Update Spanish translation 2023-10-19 17:52:42 +00:00
bootchk
355f665403 Fix 10170
Changes only to ScriptFu.

The third term (the default) of a SF-FONT etc. spec is now ignored.

Test case is SF>Test>Sphere.  There are still crashing issues
related but separate.
2023-10-19 16:37:05 +00:00
Alx Sa
414f9f9abf build: Replace overlooked gimp_pdb_run_procedure_config () call
from 57ca3f48.
2023-10-19 14:55:59 +00:00
Alx Sa
85d8322c00 widgets: Restore layer/mask highlight on select
Changes were made to the click code for layers & masks
due to the introduction of multi-select, and this seems to
have caused the view highlight to be inconsistent.
This patch adds the gimp_layer_tree_view_update_borders ()
call after a click or selection to fix this.
2023-10-19 10:53:07 +00:00
Alx Sa
ad8b47bff7 gui: Change Windows title bar based on theme
On Windows, the title bar can be set to light or dark mode via DwmSetWindowAttribute ().
This adds code to update the main title bar and dialogue title bars based on the current theme.
The main title bar uses "prefer-dark-theme", while the dialogue title bars
uses the color of the widget background to assume the correct color.
2023-10-18 16:48:25 +00:00
Jehan
bf8ee69570 plug-ins: fix some broken macros with a massive search-and-replace.
If we leave a space between the macro name and opening parenthese for argument
lists, the args are not considered macro args (which will be discovered when
using it). I experienced this issue while testing code on some plug-in
yesterday, so thought I might as well fix all these broken macros for casting to
the specific GimpPlugIn subclass, so that we won't have a next time.
2023-10-18 18:29:37 +02:00
Jehan
57ca3f4807 libgimp, plug-ins: move gimp_pdb_run_procedure*() to gimp_procedure_run*().
The gimp_procedure_run() already existed, though it was with an ordered
GimpValueArray array of arguments. Its usage feels redundant to the series of
gimp_pdb_run_procedure*() functions (which is confusing), but
gimp_procedure_run() was actually a bit more generic, because it does not
necessarily calls GimpProcedure-s through the PDB! For instance, it can runs a
local GimpProcedure, such as the case of one procedure which would want to call
another procedure in the same plug-in, but without having to go through PDB. Of
course, for local code, you may as well run relevant functions directly, yet it
makes sense that if one of the redundant-looking function is removed, it should
be the more specific one. Also gimp_procedure_run() feels a lot simpler and
logical, API wise.

A main difference in usage is that now, plug-in developers have to first
explicitly look up the GimpPdbProcedure with gimp_pdb_lookup_procedure() when
they wish to call PDB procedures on the wire. This was done anyway in the
gimp_pdb_run_procedure*() code, now it's explicit (rather than calling by name
directly).

Concretely:

* gimp_pdb_run_procedure(), gimp_pdb_run_procedure_config() and
  gimp_pdb_run_procedure_valist() are removed.
* gimp_procedure_run() API is modified to use a variable args list instead of a
  GimpValueArray.
* gimp_procedure_run_config() and gimp_procedure_run_valist() are added.
* gimp_procedure_run_config() in particular will be the one used in bindings
  which don't have variable args support through a (rename-to
  gimp_procedure_run) annotation.
2023-10-18 17:11:20 +02:00
Jehan
701357c02f libgimp, plug-ins: no need for GType of argument in gimp_pdb_run_procedure().
Passing (name, type, value) triplets is actually useless because we can get the
type information from the procedure/config anyway. That only adds one more
verification to do. Let's just change the function so that we pass (name, value)
couples instead, pretty much like in `g_object_set()`.
2023-10-17 15:49:32 +02:00
Jehan
4693f1d824 Issue #10183: --iso-8601 is not a supported option by date CLI tool on macOS. 2023-10-17 15:23:30 +02:00
Luming Zh
aa8ab50a27 Update Chinese (China) translation 2023-10-16 20:38:01 +00:00
Jehan
475dafcee4 libgimp, pdb: make gimp_pdb_run_procedure_array() internal.
Apart from all regenerated PDB files, this commit fixes the few manual usages in
libgimp too.
2023-10-16 22:12:08 +02:00
Jehan
70438028aa libgimp: PDB procedure arguments are not order-based anymore (API-wise).
As far as plug-in API is concerned, at least the calling API, order of arguments
when calling PDB procedures doesn't matter anymore.

Order still matters for creating procedures with standard arguments (for
instance, "run-mode" is first, then image, or file, drawables or whatnot,
depending on the subtype of procedure), but not for calling with libgimp.

Concretely in this commit:

- gimp_pdb_run_procedure_argv() was removed as it's intrinsically order-based.
- gimp_pdb_run_procedure() and gimp_pdb_run_procedure_valist() stay but their
  semantic changes. Instead of an ordered list of (type, value) couple, it's now
  an unordered list of (name, type, value) triplets. This way, you can also
  ignore as many args as you want if you intend to keep them default. For
  instance, say you have a procedure with 20 args and you only want to change
  the last one and keep the 19 first with default values: while you used to have
  to write down all 20 args annoyingly, now you can just list the only arg you
  care about.

There are 2 important consequences here:

1. Calling PDB procedures becomes much more semantic, which means scripts with
   PDB calls are simpler (smaller list of arguments) and easier to read (when
   you had 5 int arguments in a row, you couldn't know what they refer to,
   except by always checking the PDB source; now you'll have associated names,
   such as "width", "height" and so on) hence maintain.
2. We will have the ability to add arguments and even order the new arguments in
   middle of existing arguments without breaking compatibility. The only thing
   which will matter will be that default values of new arguments will have to
   behave like when the arg didn't exist. This way, existing scripts will not be
   broken. This will avoid us having to always create variants of PDB procedure
   (like original "file-bla-save", then variant "file-bla-save-2" and so on)
   each time we add arguments.

Note: gimp_pdb_run_procedure_array() was not removed yet because it's currently
used by the PDB. To be followed.
2023-10-16 21:56:37 +02:00
Jehan
61e2faed1b app, plug-ins: port "file-gbr-save-internal" to multi-drawable API.
Similar to commit 6905b0bbef for "file-pat-save-internal". For interactive
usage, nothing is changed, but for non-interactive ones, we can now choose a
list of drawables to export.

Pending more changes, relative to the discussion in #7370.
2023-10-16 16:21:42 +02:00
Jehan
2728294063 app: rename "dummy-param" to "run-mode".
Since now the name of arguments will become more important, over order, let's
name the first parameter "run-mode" even in cases when this is a dummy argument
(most often the case when a procedure always acts the same, whether interactive
or not). I keep the mention of the parameter being useless in the nick and blurb
strings, as it's useful information. But let's keep using our "standard" arg
name "run-mode" for this first argument.
2023-10-16 14:49:17 +02:00
Jehan
8e66e5ae58 app: use "num-drawables" consistently for the array size argument of "drawables".
This is the naming we use everywhere else.
2023-10-16 14:45:04 +02:00
Jehan
a2c6a5ee72 NEWS: update. 2023-10-16 13:58:03 +02:00
Jehan
a101fd60eb libgimp: export again gimp_procedure_config_*_default() functions.
This partially revert some of the changes in commit 652a1b4388 because the
Windows CI suddenly failed because of this (my local build on Linux didn't have
any problem though) with:

> /usr/bin/x86_64-w64-mingw32-ld: libgimp/libgimpui-3.0-0.dll.p/gimpproceduredialog.c.obj: in function `gimp_procedure_dialog_save_defaults':
> /builds/GNOME/gimp/_build/../libgimp/gimpproceduredialog.c:2570:(.text+0x633): undefined reference to `_gimp_procedure_config_save_default'
> /usr/bin/x86_64-w64-mingw32-ld: /builds/GNOME/gimp/_build/../libgimp/gimpproceduredialog.c:2576:(.text+0x644): undefined reference to `_gimp_procedure_config_has_default'
> /usr/bin/x86_64-w64-mingw32-ld: libgimp/libgimpui-3.0-0.dll.p/gimpproceduredialog.c.obj: in function `gimp_procedure_dialog_load_defaults':
> /builds/GNOME/gimp/_build/../libgimp/gimpproceduredialog.c:2549:(.text+0xa2f): undefined reference to `_gimp_procedure_config_load_default'
> /usr/bin/x86_64-w64-mingw32-ld: libgimp/libgimpui-3.0-0.dll.p/gimpproceduredialog.c.obj: in function `gimp_procedure_dialog_constructed':
> /builds/GNOME/gimp/_build/../libgimp/gimpproceduredialog.c:368:(.text+0x11b1): undefined reference to `_gimp_procedure_config_has_default'

This is because these functions are used not only inside libgimp but also
across inside libgimpui. As a consequence, the build fails when linking
libgimpui.
2023-10-15 23:20:44 +02:00
Jehan
f25e0448b2 libgimp, plug-ins: gimp_procedure_config_[gs]et_values() not public anymore.
This goes with our planned change of not making GimpProcedure arguments order
relevant anymore regarding the PDB API. In particular, it means we don't want to
use GimpValueArray for various procedure arguments API, but directly
GimpProcedureConfig objects.

This change will allow to add or reorder arguments in the future, so that we
won't have to create new PDB procedures when adding new arguments, while still
keeping PDB API stability.
2023-10-15 22:10:38 +02:00
Asier Sarasua Garmendia
8881079d9d Update Basque translation 2023-10-15 18:51:34 +00:00
Alx Sa
65dd773163 plug-ins: Fix issue with RGBA 32BPP import
Resolves #10174.
The precision assignments for floating point versus integer options
were flipped by accident.
2023-10-15 15:37:13 +00:00
Jehan
652a1b4388 libgimp: do not export private GimpProcedureConfig functions in the lib.
Some of these should not even be visible by libgimp and were just fine as static
as well! For the rest, I make them really private (not only with a private
header).
2023-10-15 17:32:04 +02:00
Jehan
b2f633a26c libgimp: all _gimp_procedure_config_begin|end_*() functions made private.
Since now all GimpProcedure and subclasses run these before and after the
relevant run() functions, there is no need to keep these public.
2023-10-15 17:19:30 +02:00
Jehan
317be5f4ce Issue #3912: Object proxy management not happy with bindings.
We cannot be 100% sure generically (i.e. for all possible bindings available
with GObject Introspection) if bindings add their own reference to objects or
not. Clearly we have cases when they always do (Lua, Javascript), cases when
they do only in certain conditions (global Python variables) and cases when they
don't (Vala). What we know for sure is that in these script languages,
developers don't manually manage memory anyway. So the additional reference is
not their fact.

So let's just maintain a list of automatic memory managed binding languages,
among the few we officially support (i.e. the ones for which we have working
test plug-ins) and verify by executable extension if the plug-in is written in
one of these.
Both keeping a manually-updated list and verifying by extension are not so
pretty solution, but for now it will do.
2023-10-15 16:45:15 +02:00
Alx Sa
bd7423915c gui: Use "minimize" window hint on Windows
Resolves the second half of #300.

This adds conditional code to the gtk_window_present () call in gui.c
to prevent it from running if the user requested it stay minimized in the shortcut
or commandline call on Windows.
It also keeps the splashscreen minimized in that case.
2023-10-15 14:14:06 +00:00
Jehan
d1297b8c2b libgimp: do not unref the additional object reference hold by a plug-in.
As explained in the comment above, the reference might actually be owned by the
binding code (not by the plug-in code) and therefore can still be released
afterwards. Freeing it now while we don't own the reference exposes us to
double-free crashes.
2023-10-15 11:53:27 +00:00
Jehan
c9c372e77c build: missing dependencies at Windows build packaging stage.
This is unrelated to the Aarch64 changes. It was just already broken.
2023-10-15 11:53:27 +00:00
Jehan
fe465120be build: install lua5.1 instead of luajit on Windows/Aarch64. 2023-10-15 11:53:27 +00:00
Jehan
7f2b301d68 meson: search lua alternatively to luajit.
This will be needed in particular for GIMP on Windows/Aarch64. Also even on
other OSes, it is useful to support lua plug-ins not only with luajit but also
upstream lua.
2023-10-15 11:53:27 +00:00
Jehan
7a34282fa5 gitlab-ci, build: add Aarch64 build in our universal installer.
This is in part a port of commit 6f921b27bb from gimp-2-10 branch, except that I
could not easily cherry-pick because too much had changed already in the master
branch.
There are also a bunch of additional changes in some other glue scripts.

Also some rules which were in the 2.10 branch don't apply to the main one, such
as Python being copied from the x86 binaries, since clang-aarch64 has Python3
(unlike Python2).
2023-10-15 11:53:27 +00:00
Jehan
de126b0c32 build: split-debug-msys2.sh fails silently on Windows/Aarch64.
Fixes:

> $ C:\msys64\usr\bin\bash -lc "bash -x ../build/windows/gitlab-ci/split-debug-msys2.sh"
> + '[' -z '' ']'
> + find . '(' -iname '*.dll' -or -iname '*.exe' -or -iname '*.pyd' ')' -type f -exec objcopy -v --only-keep-debug '{}' '{}.debug' ';'
> C:/msys64/clangarm64/bin/objcopy.exe: error: unknown argument '-v'
2023-10-15 11:53:27 +00:00
U-YGGDRASIL\ender
050c56851b Installer: remove setup.ini (not used any more)
(cherry picked from commit 0793b2a796)
2023-10-15 11:53:27 +00:00
U-YGGDRASIL\ender
092be766e5 Installer: include file extension in association name
(cherry picked from commit 597e68a364)
2023-10-15 11:53:27 +00:00
Jehan
4426eef73a build: fix per-architecture directories and Vala plug-in build.
Thanks to Hernan Martinez for noticing this issue which should fix Vala building
both for i686 and Aarch64 builds.
2023-10-15 11:53:27 +00:00
Jehan
17688ffa3a build, gitlab-ci: taking one more patch from MSYS2 project.
This should hopefully fix this error in the CI:

> llvm-rc: Error in ICON statement (ID 1):

See: https://github.com/llvm/llvm-project/issues/51286
2023-10-15 11:53:27 +00:00
Jehan
823f24c401 build, gitlab-ci: temporary patch for the Windows/Aarch64 build.
See discussion in #9170 and !1091. It looks like this soon won't be a problem
with a recent llvm-windres (which is now patched). But until then, let's patch
upstream GIMP but only for this build.
2023-10-15 11:53:27 +00:00
Jehan
bb6ac317b8 build: luajit is currently not available in clangarm64 MSYS2 repository. 2023-10-15 11:53:27 +00:00
Jehan
b4a06737c0 build: testing a Windows/Aarch64 build.
Note: the additional `rm` call was done for this error:

> + mv _install-arm64 /home/SYSTEM
> mv: cannot move '_install-arm64' to '/home/SYSTEM/_install-arm64': Directory not empty

I guess the home directory is not properly wiped-out between runs, which is not
a huge problem as long as the runner is private to our project. Let's clean
things ourselves.
2023-10-15 11:53:27 +00:00
Anders Jonsson
5c28355d5e plug-ins: remove i18n for widget ID 2023-10-15 10:18:08 +00:00
Jehan
6d36e38018 app: fix a quite-random crash on exit with a race condition.
In some very hard-to-reproduce conditions, I experienced
tool_manager_selected_layers_changed() running on an invalid GimpToolManager
pointer (because tool_manager_exit() had already run) and therefore segfaulting
on quit. Let's make sure we disconnect the signal handler.
2023-10-15 11:45:16 +02:00
Martin
68928ac5ab Update Slovenian translation 2023-10-15 09:44:24 +00:00
Asier Sarasua Garmendia
d61b96cef1 Update Basque translation 2023-10-15 07:10:26 +00:00
Jehan
24a4b6bf65 plug-ins: mistakenly internationalized signal names and widget IDs.
Thanks to Anders Jonsson for noticing these.
2023-10-14 19:05:52 +02:00
Jehan
ccb8a7be2e meson: fix inserting generation date and time in authors.md. 2023-10-14 17:12:49 +02:00
Martin
8fcf4c44f9 Update Slovenian translation 2023-10-14 15:01:14 +00:00
Martin
56d415f10f Update Slovenian translation 2023-10-14 14:40:57 +00:00
Sabri Ünal
811ec0b908 Update Turkish translation 2023-10-14 12:53:51 +00:00
Sabri Ünal
6d9ab84781 Update Turkish translation 2023-10-14 12:52:46 +00:00
Sabri Ünal
1d17e114de Update Turkish translation 2023-10-14 12:52:18 +00:00
Sabri Ünal
202979b7d7 Update Turkish translation 2023-10-14 12:52:10 +00:00
Sabri Ünal
8b8a3ebd23 Update Turkish translation 2023-10-14 12:51:57 +00:00
Asier Sarasua Garmendia
220362bf05 Update Basque translation 2023-10-14 09:22:53 +00:00
Asier Sarasua Garmendia
02b5ed0a5c Update Basque translation 2023-10-14 09:22:12 +00:00
Asier Sarasua Garmendia
171a61e2ad Update Basque translation 2023-10-14 09:22:08 +00:00
Asier Sarasua Garmendia
d8791b28de Update Basque translation 2023-10-14 09:20:34 +00:00
Michael Schumacher
f8004c8167 Add a 'Allow resizing' toggle to Decor > Add Border
Add Border enlarges an image by twice the specified border size and creates the border in this
additional space. If an image already has the intended final size, this behaviour is not desired.
This change adds a toggle to (dis)allow resizing, similar to the drop shadow script.

This came up in a reddit thread by /u/rapidexchange
https://www.reddit.com/r/GIMP/comments/6csofx/im_new_to_gimp_so_sorry_if_this_is_a_stupid/
2023-10-13 13:17:11 -04:00
bootchk
24d3e94e2a Fix scripts after changes to text PDB API
Some scripts still broken until fixes re default font in ScriptFu.

Test scripts restored to working.
2023-10-13 09:38:21 -04:00
Ekaterine Papava
f76f6dc88e Update Georgian translation 2023-10-12 14:04:58 +00:00
Ekaterine Papava
7cf7393928 Update Georgian translation 2023-10-12 13:42:16 +00:00
Martin
08e77c8fbd Update Slovenian translation 2023-10-12 09:22:45 +00:00
Yuri Chornoivan
7bc554f42a Update Ukrainian translation 2023-10-12 06:46:38 +00:00
Martin
c7f46d9ec1 Update Slovenian translation 2023-10-11 15:52:00 +00:00
bootchk
b3cd0f2539 Fix #10162 critical on null brush to prop chooser widget 2023-10-11 08:59:27 -04:00
bootchk
039b25eb6e Fix clang build error void function should not return value 2023-10-11 08:09:54 -04:00
Alx Sa
968cf06a1c plug-ins: Load PSP selection block
Adds code to read in PSP_SELECTION_BLOCK.
If there was an active selection in the PSP file when it was
saved, that selection will now be active in GIMP as well on load.
2023-10-10 20:56:23 +00:00
Yuri Chornoivan
2de5d5d3e0 Update Ukrainian translation 2023-10-10 19:34:55 +00:00
Luming Zh
e8d879ba16 Update Chinese (China) translation 2023-10-10 18:52:38 +00:00
Martin
88505ac57c Update Slovenian translation 2023-10-10 07:12:06 +00:00
Martin
599963d3bb Update Slovenian translation 2023-10-10 07:05:31 +00:00
Martin
71763f0a48 Update Slovenian translation 2023-10-10 07:03:21 +00:00
Anders Jonsson
0389e50569 plug-ins: string fixes 2023-10-09 21:18:39 +00:00
Ekaterine Papava
322f17c7a0 Update Georgian translation 2023-10-09 20:48:30 +00:00
Yuri Chornoivan
744c173e7a Update Ukrainian translation 2023-10-09 18:31:42 +00:00
Yuri Chornoivan
4ad7e9fe83 Update Ukrainian translation 2023-10-09 18:28:31 +00:00
Jehan
1d8782915e Issue #10143: shift selecting is failing to highlight selected layers.
This is a consequence of commit 98f0c448. Apparently setting the tree view
cursor also reset visually the selection. So I make sure I only set the cursor
on the first path in the list of selected items.
2023-10-09 15:59:13 +02:00
Jehan
8f06421781 app: fix gimp-gegl-loops algorithm from commit dbaa8b6a1c.
Using gegl_parallel_distribute_area() for gimp_gegl_is_index_used() is just far
too slow by 2 order of magnitudes compared to a threaded implementation where I
process each buffer at once (but each in their own thread from a pool).
I guess the basic value check is too basic to warrant being done in threads
(note: even growing the distributed area by bumping the thread cost a lot was
not enough).

I didn't fixup commit dbaa8b6a1c directly so that we keep a trace of the
gegl_parallel_distribute_area() implementation in case we can do better later.

Additionally I fixed gimp_gegl_shift_index() to use the full drawable format,
including the possible alpha channel. Otherwise shifting indexes may result in
dropping the alpha value.
2023-10-09 15:44:31 +02:00
Jehan
c8de818349 app, menus: Colormap dockable now shows a delete button.
This comes with a "colormap-delete-color" into the "colormap" action group. The
action/button will be insensitive when the selected color is used in the image,
since it is only possible to delete unused colors.
2023-10-09 15:28:20 +02:00
Jehan
dbaa8b6a1c app, pdb: make it possible to delete a color from a colormap if unused.
Until now, it was not really possible to delete a colormap color, but since we
now use GimpPalette, people would definitely try to do so. It just makes sense
to allow doing this, but only if the color is unused.

Additionally when we do this, all the pixels refering to bigger indexes will be
edited so that they continue to refer to the same color (bigger indexes are
shifted by -1). Therefore removing an unused color does not change the image
render.

I wondered if we might want more options, e.g. the ability to delete a color
without fixing indexes (i.e. that colors over the deleted color index would
shift to the next color). This would even allow to delete used colors (though
now the last index would have to be unused one, unless we cycle colors).
Yet I don't think this should belong to this basic API. The most expected
behavior when deleting a color from an image colormap is to fix all indexes
stored in pixels so that the image still shows the same. So that's what this
function will do in this generic usage.
2023-10-09 15:28:20 +02:00
Jehan
c3c0a70dd5 app: reset the selected index when active palette changes.
This fixes some CRITICAL when switching active image while an item is selected.
2023-10-09 15:28:20 +02:00
Yuri Chornoivan
2a0f3b6340 Update Ukrainian translation 2023-10-09 06:30:10 +00:00
Jehan
4d03f7b04b app: also generate filename and save file of duplicate data immediately.
This fixes a CRITICAL when duplicating a resource data.
2023-10-08 23:22:58 +02:00
Martin
ab11569bfc Update Slovenian translation 2023-10-08 14:40:20 +00:00
Luming Zh
1864cbf3e2 Update Chinese (China) translation 2023-10-07 18:09:21 +00:00
Ekaterine Papava
e7b703bbaa Update Georgian translation 2023-10-07 17:51:06 +00:00
Jehan
378c3c525a po: missing new source file from POTFILES.in. 2023-10-07 18:32:26 +02:00
Alx Sa
33b88d2d3b po-plug-ins: Remove reference to selection-to-path-dialog.c
This file was removed in the port to GimpProcedureConfig.
Thanks to @piotrdrag for pointing that out!
2023-10-07 14:49:36 +00:00
Alx Sa
b641cec7d1 plug-ins: Remove reference to gimp_procedure_config_end_run
Missed an non-interactive call to gimp_procedure_config_end_run()
during the GimpProcedureConfig port.
2023-10-07 13:53:20 +00:00
bootchk
e029a96d50 Fix #10127
Improper counting of args declared by scripts versus pspecs in a ProcedureConfig.
Scripts don't declare run_mode, while pspecs have run_mode and an extra internal pspec
that is not an argument.
2023-10-07 06:04:00 -04:00
Sabri Ünal
e54ab26426 Update Turkish translation 2023-10-07 06:45:19 +00:00
Sabri Ünal
e99ac4dc8c Update Turkish translation 2023-10-07 06:42:59 +00:00
Ekaterine Papava
06be26938c Update Georgian translation 2023-10-06 20:41:53 +00:00
Jehan
d931098d36 app, libgimp, pdb: new gimp_image_get_palette().
This is meant to replace gimp_image_get_colormap() (see also #9477).

We likely won't need a gimp_image_set_palette() because we can simply edit the
image's colormap/palette with GimpPalette API now and it is directly updated.

For instance, the following code changes the first entry in the image palette to
red, immediately:

```python
i = Gimp.list_images()[0]
p = i.get_palette()
c = Gimp.RGB()
c.r = 1.0
p.entry_set_color(0, c)
```

For this to work fine, I added a new concept to GimpData, which is that they can
be tied to a GimpImage (instead of a GFile). Image palettes are not considered
internals, they are just tied to their image, therefore they can be edited by
scripts/plug-ins.

Additionally with this commit, editing an image's colormap from libgimp API also
generates undo steps now.
2023-10-06 22:04:34 +02:00
Alx Sa
c54a33f0ff config: Clarify color profile policy (@ellestone)
Original patch by @ellestone.
The current tooltip is somewhat confusing for two reasons: It doesn't 
mention the word "ICC", leaving room for doubt as to what a "color 
profile" might be. And as @TheTooleMan suggested, it's easier to read
and understand if the action (opening a file . . .) is in front of the 
modifier (. . . with an embedded ICC profile) instead of vice versa.
2023-10-06 19:08:40 +00:00
Jehan
dfe803e882 Issue #9478: gimp_image_get_thumbnail_data() is not introspectable. 2023-10-05 22:58:29 +02:00
Jehan
bdcd9cd38a libgimp, plug-ins: let's just call gegl_init() in gimp_ui_init().
bootchk had the case in commit 6781a35668. I again had it with gfig. I think it
just makes sense to init GEGL, especially as the errors are not that explicit
and that the plug-in code may not even call GEGL code directly (so it makes it
harder to guess).
2023-10-05 22:36:40 +02:00
Jehan
192c043d7b Issue #10120: CRITICAL in gimp_progress_bar_init().
This hightlighted a slightly more complicated use case when setting the handle
on a widget without its own GdkWindow.
2023-10-05 16:40:16 +02:00
Rodrigo Lledó
3d827148c9 Update Spanish translation 2023-10-05 13:25:21 +00:00
bootchk
6781a35668 Fix 10115 SF interface call gegl_init
Resource chooser widgets recently changed to use gegl.
2023-10-05 07:37:15 -04:00
Alx Sa
cbf14a7e2d plug-ins: Various warnings/code style fixes for plugins...
After the recent port.
* contrast-retinex: Initialize format & src_buffer to NULL
* curve-bend and map-object: Remove no longer needed functions
* file-load-gif: Fix C++ style comment
2023-10-04 20:27:17 +00:00
Jehan
98f0c44881 app: set keyboard focus to selected item in GimpContainerTreeView.
When the selection changes, the focus must be on one of the selected items. Not
doing this was creating a very annoying behavior where you would select an item
in the tree view with the pointer first, but then when moving up/down with the
keyboard arrow, the move originated from the previously set item. This was
because the arrow move used the "cursor path", i.e. the keyboard focus, and not
the item selection as origin.

In our case, let's make sure these match (i.e. the cursor path is the path of at
least one of the selected items, which is the most expected behavior for mixed
pointer/keyboard interactions).

See code in gtk_tree_view_move_cursor_up_down() from GTK code.
2023-10-04 15:17:43 +02:00
Idriss Fekir
68aadf4a27 Issue #9979:bold and italic broken 2023-10-04 12:01:06 +00:00
Alx Sa
f46160f29c plug-ins: Prevent infinite loop in film
Resolves #10119.

If the user sets the "Image Spacing" and "Hole Width" values
to 0, the hole creation code gets stuck in an infinite loop.
This patch adds a check to the allocation code for the hole
to make sure both its dimensions are greater than 0. If not,
then the hole is not created in the first place.
2023-10-04 11:12:42 +00:00
Jehan
04dcd11fd6 app: complete !1073 for case when transformed <shift>num action clashes…
… with another default shortcut.

This won't happen with the standard US layout, but among all the layouts which
exist (or will exist), there is no say that the characters behing <shift>2-5
keys are not another one of our default shortcuts for other actions. We don't
want to print this case, because it is special enough that it's really not a
bug. In this case, we just ignore the transformed shortcut on the zoom action
and be done with it.
2023-10-04 00:11:35 +02:00
programmer_ceds
13ec70bb16 Make Numeric Shift Shortcuts Work (Fixes issue #9798) 2023-10-03 21:44:59 +00:00
Jehan
ef65087c2b app: save new data to file immediately.
Calling gimp_resource_delete() on a data with a file which was not stored yet
would fail on missing file as reported by Lloyd in a comment in #9976. We could
just special-case the code to make the already-inexisting case acceptable on
deletion, but there are a few more issues.

In particular gimp_data_create_filename() relies on actually checking file
existence on the file system. Therefore generating the file path too early
(before any possible rename, i.e. for uniqueness or other formatting need) would
easily generate duplicate paths (which means one of the data object would be
overwritten on exit). It's better to kinda *reserve* the set file path
immediately by saving the data file.

The only drawback I could see on saving early is possible I/O slowdown if a
script were to create many data, but I actually don't think it's a valid use
case (no script should likely create enough data files that we would notice a
slowdown, i.e. likely creating hundreds of data objects at once) anyway. So
let's go with it, at least for now.
2023-10-03 14:40:33 +02:00
Jehan
03a6fec6b3 plug-ins: GimpUi should be loaded by default in the Python console. 2023-10-03 13:46:24 +02:00
Alx Sa
22963405ac plug-ins: Set Pixel Aspect Ratio for GIFs
If the GIF has a value other than 0 or 49 in its PixelAspectRatio 
header, then we now use it to set the non-square pixel resolution.
For reference, GIFs calculate this value like so:
PAR = (Value + 15) / (float) 64.
2023-10-03 02:14:59 +00:00
Jehan
fc6c0974ea Issue #9976: gimp-brush-new throws critical. 2023-10-03 00:02:33 +02:00
Jehan
eab9d8da28 app, libgimp, pdb: new PDB function gimp_fonts_get_by_name().
It returns all the fonts (possibly more than 1) with a given name. I left the
function gimp_font_get_by_name() as a utility when one don't want to choose (or
is not able anyway, e.g. a script with minimal information), though I wondered
if we should not simplify with a single function (the new one, which is the
correct one now that it is possible to have several fonts with a given name).

It is easy to test with fonts named the same. For instance I could find 2
different fonts, both named 'Holiday'. This call in the Python console returns
both:

> Gimp.fonts_get_by_name('Holiday')

As part of this commit, I also implemented resource arrays (or subtype arrays)
as PDB arguments and return types.
2023-10-02 23:22:49 +02:00
Jehan
66488ed958 plug-in: changed sign of descent in gimp_text_get_extents_font().
The film plug-in is the sole usage of gimp_text_get_extents_font().
2023-10-02 21:42:23 +02:00
Jehan
adce3179d4 app, libgimp, pdb: further fix gimp_text_get_extents_font() and improve…
… description.

- The returned value as width/height/etc. of the glyph extents (or bounding
  box), not "of the font" (which doesn't mean much).
- Adding some definition for ascent and descent. This text is straight out
  copied from Pango documentation comments in pango/pango-types.h.
- I don't see why we were negating the descent value. Let's keep the value sign
  as defined in Pango.
2023-10-02 21:30:20 +02:00
Jehan
a898641cd1 app: fix return type.
Fixes:

> warning: returning ‘void *’ from a function with return type ‘gboolean’
2023-10-02 20:56:19 +02:00
Jehan
24a85eebd6 Issue #9987: text related functions crash using string for font name.
- Fonctions were renamed: s/gimp_text_fontname/gimp_text_font/ and
  s/gimp_text_get_extents_fontname/gimp_text_get_extents_font/
- The size_type arguments were removed. Even in 2.10, this argument was marked
  as "dead" and ignored. It was only kept for API compatibility.
- The font name (string) was replaced by a GimpFont argument.

gimp_text_font() is easily tested in the Python console with:

> Gimp.text_font(Gimp.list_images()[0], None, 10, 40, "Hello World!", 1.0, True, 100, Gimp.context_get_font())

And gimp_text_get_extents_font() with:

> Gimp.text_get_extents_font("Hello World!", 100, Gimp.context_get_font())
2023-10-02 20:49:53 +02:00
Martin
0a77a8492f Update Slovenian translation 2023-10-02 14:52:08 +00:00
Martin
d40137a79d Update Slovenian translation 2023-10-02 14:50:35 +00:00
Martin
fa9d394569 Update Slovenian translation 2023-10-02 14:48:21 +00:00
Martin
5a4d5e7d2d Update Slovenian translation 2023-10-02 14:47:00 +00:00
Luming Zh
d3584d2d50 Update Chinese (China) translation 2023-10-02 13:45:37 +00:00
Luming Zh
a3c39531db Update Chinese (China) translation 2023-10-02 13:43:59 +00:00
Luming Zh
0b01c76808 Update Chinese (China) translation 2023-10-02 13:43:48 +00:00
Luming Zh
4f07172fac Update Chinese (China) translation 2023-10-02 13:42:45 +00:00
Ekaterine Papava
21d9ce5f31 Update Georgian translation 2023-10-02 12:30:21 +00:00
Ekaterine Papava
f67cc26a4b Update Georgian translation 2023-10-02 12:28:44 +00:00
Ekaterine Papava
5109772d28 Update Georgian translation 2023-10-02 12:28:07 +00:00
Ekaterine Papava
0709eebffe Update Georgian translation 2023-10-02 12:24:48 +00:00
Yuri Chornoivan
edddfa2052 Update Ukrainian translation 2023-10-02 06:58:32 +00:00
Yuri Chornoivan
53c70e47b6 Update Ukrainian translation 2023-10-02 06:57:30 +00:00
Yuri Chornoivan
d1d73541c1 Update Ukrainian translation 2023-10-02 06:56:11 +00:00
Yuri Chornoivan
11ef35f7de Update Ukrainian translation 2023-10-02 06:54:52 +00:00
Jehan
a186220e58 app: be more forgiving in reading shortcutsrc.
- First do not write the protocol-version (and therefore don't read it either
  nor compare it to the current one). This file does not depend on the protocol
  version.
- Secondly when reading an unknown identifier, simply print a message on stderr
  for debugging/reference, but ignore it up to the next closing parenthese.
- Finally do not use the file-version as a terminal error as well. When we read
  a shortcutsrc with the wrong version, we still try to read it as best as we
  can. There might be issues, but it's better than fully dropping the whole list
  of shortcuts as it's a pretty important file (people might have spent a lot of
  time tweaking their shortcuts!).
2023-10-02 01:30:02 +02:00
Jehan
278f78fee6 libgimp: fix various GIR build warnings breaking HTML reference generation.
- a few inconsistent parameter naming;
- broken links to other symbols.
2023-10-02 00:25:12 +02:00
Jehan
8694f67918 libgimp: fixing duplicate gimppropwidgets section for introspection docs.
Fixing:

> [809/2421] Generating libgimp/GimpUi-3.0.gir with a custom command (wrapped by meson to set env)
> libgimpwidgets/gimppropwidgets.c:37: Warning: GimpUi: multiple comment blocks documenting 'SECTION:gimppropwidgets:' identifier (already seen at gimppropwidgets.c:23).
2023-10-02 00:05:10 +02:00
Jehan
3acac137ae NEWS: update with all changes from MR !1065.
Only the DDS vulnerability item is not from this MR but from the rebase.
2023-10-01 23:02:12 +02:00
Jehan
5a5a94d9b7 plug-ins: port other Python plug-ins to new gimp_image_procedure_new().
SpyroGIMP will have to be ported to GimpProcedureDialog, or at least, it should
store its arguments. Currently they are resetted at each run.
2023-10-01 21:02:34 +02:00
Jehan
accf3b1e64 plug-ins: port histogram-export to new gimp_image_procedure_new() and…
… to GimpProcedureDialog.
2023-10-01 21:02:34 +02:00
Jehan
1d50c81130 libgimp, plug-ins, extensions: gimp_image_procedure_new2() renamed gimp_image_procedure_new(). 2023-10-01 21:02:34 +02:00
Alx Sa
5c8aa1f242 plug-ins: port lighting to gimp_image_procedure_new2()
...and to GimpProcedureDialog.
As with the last few, improvements could be made to the GUI, mneumonics,
and global variables used.
2023-10-01 21:02:34 +02:00
Alx Sa
5765240f6b plug-ins: port fractal-explorer to gimp_image_procedure_new2()
...and to GimpProcedureDialog.
Note that there are still some unnecessary global variables that could be refactored out.
2023-10-01 21:02:34 +02:00
Jehan
9a2d9991e5 plug-ins: get rid of hardcoded colors for built-in units.
Hardcoded colors don't work well with theme customization (on a dark theme in
particular, it was bad).

Anyway built-in units are already grayed-out and non-editable. I don't think
further styling is needed.
2023-10-01 21:02:34 +02:00
Jehan
0273c1031c app, libgimp, pdb: gimp_text_layer_new() now uses GimpFont.
This function is not perfect and in particular doesn't seem usable with binding
because of GimpUnit being some weird mix between an enum and some kind of class.

So this will have to be fixed too. See #8900.
2023-10-01 21:02:34 +02:00
Jehan
ea55b7a11a app, devel-docs, libgimp: updating gimp_text_layer_[gs]et_font() and new…
… function gimp_font_get_pango_font_description().

Also updating file-pdf-save which is the only plug-in using these right now.

Note that I am not fully happy with the new function
gimp_font_get_pango_font_description() because I experienced some weird behavior
in file-pdf-save which is that some fonts were wrong if this is called after
pango_cairo_font_map_set_resolution().
But let's say this is a first step looking for improvements.
2023-10-01 21:02:34 +02:00
Alx Sa
faae47a9a8 plug-ins: port map-object to gimp_image_procedure_new2()
...and to GimpProcedureDialog.
Also resolves #25 by adding the missing PDB parameters to the GUI.
Note that there are a few remaining tasks:
* The config values are being copied to mapvals. 
Eventually the rest of the code needs to be updated
to directly use the config.
* The material tab uses icons from the Lighting plug-in. They didn't show up before the port; this needs to be fixed.
* The drawable buttons are huge compared to the original plug-in. The styling needs to be looked at.
2023-10-01 21:02:34 +02:00
Alx Sa
640b0cffe0 plug-ins: port sample-colorize to gimp_image_procedure_new2()
..and to GimpProcedureDialog.
Note that the UI could be improved - happy to make changes based on
feedback!
2023-10-01 21:02:34 +02:00
Jehan
2f4d625059 app, libgimp, pdb: generate widgets for GIMP_PROC_ARG_LAYER|CHANNEL arguments.
I am using the same GimpDrawableChooser with an additional drawable_type
argument to only show the appropriate tab if we want to limit what can be
chosen.

None of our plug-ins actually use a GimpLayer or GimpChannel only arg so far,
but if we have some day, or if some third-party plug-ins want to have such arg,
now they quite easily can!
2023-10-01 21:02:34 +02:00
Jehan
4be1166982 app, libgimp: disable again cross-process transient setting.
After testing, setting a window as transient to another from another process is
still broken on Windows and it's hard to diagnose without using Windows
directly. Since it's not just broken, but it even hangs the whole process, which
is quite a blocker issue, let's disable again the whole code on Windows.
2023-10-01 21:02:34 +02:00
Alx Sa
7b29ac247a plug-ins: port compose to gimp_image_procedure_new2()
Converted to GimpProcedureDialog as well, and changed the
string argument for the combobox to GimpChoice.
Some widgets are still standalone and could be further improved
to work with GimpProcedureDialog.
2023-10-01 21:02:33 +02:00
Jehan
b7bff4ee9a libgimpconfig: a NULL GBytes is also a proper argument value.
Do not fail serialization when a GBytes argument is set to NULL by adding a
special case for this.
2023-10-01 21:02:33 +02:00
Alx Sa
e318651c99 plug-ins: port curve-bend to gimp_image_procedure_new2() and GimpProcedureDialog.
A new aux parameter for upper/lower border area was added so this could be generated
as part of the GUI.
I received warnings about serializing the FloatArray and GBytes parameters, so I did not integrate
the existing variables with GimpProcedureConfig in this current version.
2023-10-01 21:02:33 +02:00
Jehan
88c9d54709 plug-ins: port depth-merge to gimp_image_procedure_new2() and GimpProcedureDialog.
The only missing feature is that we don't constrain the various argument
drawables to RGB/grayscale or to the same dimension as the input drawable. This
could actually be quite easily implemented, either through a set of constraint
flags, or a more flexible callback function (similar to the API of
gimp_drawable_combo_box_new()). It could either be implemented on the argument
level (which has the advantage of letting libgimp handle argument sanity of
plug-in developers, even in non-interactive calls, with generic error messages)
or within the new GimpDrawableChooser API.

I was actually implementing this when I realized that this plug-in works fine
even with images of different dimensions. As for the format, GEGL handles format
conversion automatically. There is absolutely no reason to limit ourselves.

So let's drop this feature for now, because we should not over-engineer. If it
turns out useful and we get requests, we can always create later either a
specialized arg macro GIMP_PROC_ARG_CONSTRAINED_DRAWABLE() or a method to
specialize the widget with gimp_drawable_chooser_new_constrained() for
instance).
2023-10-01 21:02:33 +02:00
Jehan
1d16c1584f libgimp, pdb: (meson) fix building of libgimp/gimpenums.h inside the source tree.
This was not working properly and needed some external build script as well as
the stamp/bogus header trick like for other similar in-source generated code.

In the same time, I get rid of old meson code which was meant for when using
meson < 0.57.0 (since our requirement is now meson >= 0.59.0).
2023-10-01 21:02:33 +02:00
Jehan
a40357a165 libgimp: take into account case when gtk_settings_get_default() returns NULL.
I believe it should not happen in normal GUI case (which is when you create a
GimpProcedureDialog). I had the issue while moving around some plug-in code and
moved dialog creation before gimp_ui_init() by mistake. The issue was not
obvious until I followed the trace inside libgimp. This would be even more
frustrating for plug-in developers so let's have a clear warning message giving
the possible plug-in crash reason.
2023-10-01 21:02:33 +02:00
Jehan
36576c7276 libgimp: new GimpDrawableChooser widget, associated propwidget function and…
… generation of such a widget for drawable arguments in PDB procedures.
2023-10-01 21:02:33 +02:00
Jehan
236fd01a1c libgimpwidgets: new gimp_preview_area_reset() function.
The various drawing APIs are cumulative which is not right when we want to
change a preview (especially if the preview changes dimensions! Then we end up
with pieces of the previous drawing behind the new one).

This new function will allow to reset the whole drawing. Note that we may end up
with some black background if the preview are doesn't have the right dimensions.
This should be improved later too.
2023-10-01 21:02:33 +02:00
Jehan
63a97d3be6 app, libgimp, pdb: new PDB group gimpdrawableselect.
Similarly to the various GimpResource select PDB calls, this allows to call a
core dialog in order to choose a drawable which will be returned back to the
calling plug-in.

This new GimpPickableSelect dialog is a subclass of GimpPdbDialog and uses the
same GimpPickableChooser widget as GimpPickablePopup, except that since it's
inter-process window management, it is harder to make a popup positioned
accurately relatively to a parent (especially on Wayland). This is why it's a
separate widget as a simpler dialog (which we will still try to make transient
as much as possible across platforms).
2023-10-01 21:02:33 +02:00
Jehan
901f056878 app: improve GimpPickableButton and split GimpPickablePopup.
Improvements of GimpPickableButton:

- Update the selected pickable live as you choose it in the popup. This allows
  for instance to get live preview of GEGL operations while staying within the
  pickable popup.
- Store the initially selected pickable (before popping up) so that when one
  cancels (either with Esc key or by clicking outside the popup, but not on the
  parent button), the button comes back to the previous pickable.
- Properly destroy the popup when the parent widget is finalized to avoid
  annoying cases where the popup might still be alive.

Additionally I split the GimpPickablePopup with a GimpPickableChooser containing
most of the GUI, which will make it usable as plug-in pickable chooser as well!
2023-10-01 21:02:33 +02:00
Jehan
8059de502a app: clicking on the GimpPopup parent emits a "confirm" signal.
Clicking on the parent (typically a button, as in the GimpPickableButton case
used in GEGL operations' generated GUI) used to emit "cancel". Let's have it
emit "confirm" instead.
Also it makes for a "confirm" interaction through pointer action as there were
none until now (only key "confirm", e.g. Enter or Space keys), unless
implemented in a child class (e.g. GimpPickablePopup would emit "confirm" on
activate-item of the tree view widgets, e.g. when double-clicking an item; that
was not ideally discoverable).
2023-10-01 21:02:33 +02:00
Alx Sa
8be4592e38 plug-ins: Port gimpressionist to gimp_image_procedure_new2 ().
A few minor code style issues were also fixed.
Note that there's only one procedure parameter (Preset name), 
but it's not retained between runs.
I want to ask about this before making a full conversion to
GimpProcedureDialog widgets.
2023-10-01 21:02:33 +02:00
Alx Sa
7e25a6a1e4 plug-ins: port colormap-remap to gimp_image_procedure_new2()
Also fixing some formatting mistakes left in from the GAction port.
2023-10-01 21:02:33 +02:00
Jehan
62a3889617 libgimp: rename Gimp*SelectButton widgets to Gimp*Chooser.
This name was really irking me because it's not a button (anymore? Maybe it used
to be just a button). Depending on the specific widget, it will have several
sub-widgets, including a label. And it can theoretically even be something else
than a button.

So let's just rename these widgets with the more generic "chooser" name.
2023-10-01 21:02:33 +02:00
Jehan
55d6f6c26e libgimp: move GimpFont, GimpGradient and GimpPalette to their own file.
Even though we don't have specific additional functions right now, it's just
much more cleaner this way.
2023-10-01 21:02:33 +02:00
Jehan
457f52a6d1 app, libgimp, pdb: new gimp_pattern_get_buffer() and improved GimpPatternSelectButton.
Similar to the latest commits for GimpBrush:

- gimp_pattern_get_buffer() returns a GeglBuffer and allow getting a scaled
  version of the pattern.
- Old gimp_pattern_get_pixels() is made private.
- Moved GimpPattern into its own file and store the buffer to avoid re-querying
  it through PDB continuously.

No as for the widget to select a pattern:

- Preview frame ensured to be square.
- Default size increased.
- Drawing code using the new gimp_pattern_get_buffer().
- Cleaned up code.
2023-10-01 21:02:33 +02:00
Jehan
330d05e2fc libgimp: gimp_brush_get_buffer() returns a buffer with alpha.
So what I realized was that the core was sending contents without transparency.
Actually the mask was our transparency channel here. Since in most use cases,
what you want to do when you request a brush buffer is to be able to draw it
somewhere, having a buffer already with alpha is much better, even more because
by default, it looks like background color is black which is possibly not what
you expect usually from a brush preview.

If someone wants absolutely no-alpha, it's easy to get rid of the channel. It's
simply better that the default behavior is the most expected use case.
2023-10-01 21:02:33 +02:00
Jehan
0e6c06044c libgimp, plug-ins: massively improve GimpBrushSelectButton.
- Increase the default size to 40x40 and multiply it by the current window scale
  factor to have decent preview size.
- Make the brush preview always square with a GtkAspectFrame: even though
  brushes are not necessarily square, this is a much more obvious size rather
  than letting GTK choose a random allocation size which ends up very weird
  looking.
- Scale down the brush to the biggest possible dimensions which fit the square
  preview area (if the brush native size is already smaller, I don't scale up
  though) while keeping aspect ratio: previous implementation was really weird,
  as we were only seeing a tiny corner of much brushes as we weren't scaling
  them down. Obviously I use new gimp_brush_get_buffer|mask() functions for
  this as it supports scaling.
- Implement drawing color brushes too: the previous implementation was only
  drawing the brush mask, which was absolutely not what would be expected for
  such brushes.
- Add a white background behind color brushes with transparency.
- Simplify and clean up the code.

One of the consequences of this new implementation is obviously that it's
mandatory to call gegl_init() when using this widget.
2023-10-01 21:02:33 +02:00
Jehan
1ff9c12b1e libgimp, pdb: replacing gimp_brush_get_pixels() by gimp_brush_get_buffer()…
… and gimp_brush_get_mask().

gimp_brush_get_pixels() was a bit crappy, returning raw data with only
dimensions and bpp to go with (no color model/space, no bit depth…). So the
assumption is that we work with 8-bit per channel data, possibly with alpha
depending of number of channels as deduced from bpp, and very likely in sRGB
color space. It might be globally ok with many of the brush formats (and
historical brushes) but won't fare well as we improve brush capabilities.

- gimp_brush_get_pixels() is in fact made private.
- The 2 new functions are using this old PDB call _gimp_brush_get_pixels() to
  construct buffers. This has some limitations, in particular that it returns
  only 8-bit per channel sRGB data, but at least the signature won't change when
  we will improve things in the future (so if some day, we pass fancy brushes in
  high-bit depth, the method will stay the same).
- This new implementation also allows scaling down the brush (keeping aspect
  ratio) which is useful when you need to fit a brush preview into a drawing
  widget.
- Current implementation stores the buffers at native size in the libgimp's
  GimpBrush object, hence save re-querying the core every time you need an
  update. This can be improved as current implementation also means that you
  don't get updates if the brush changed. This should handle most common use
  cases for now, though.
- Also with this change, I move GimpBrush class implementation into its own
  dedicated file.
2023-10-01 21:02:33 +02:00
Jehan
ead5d01d27 libgimp*, plug-ins: reorganize the resource property choosers.
- Move the property widget functions for GimpResource properties into a new
  libgimp/gimppropwidgets.[ch] file. This mirrors the files
  libgimpwidgets/gimppropwidgets.[ch] which are for more generic property types.
- Rename the functions gimp_prop_chooser_*_new() to gimp_prop_*_chooser_new().
- gimp_prop_chooser_factory() doesn't need to be public.
- Add a label to GimpResourceSelectButton, make so that the
  gimp_prop_chooser_*_new() functions set the property nick to this label and
  add this label to the size group in GimpProcedureDialog.
2023-10-01 21:02:33 +02:00
Jehan
538cdea996 libgimp: make GimpResourceSelectButton abstract.
Rather than *saying* it is abstract, make it really so with
G_DEFINE_ABSTRACT_TYPE_WITH_PRIVATE().
2023-10-01 21:02:33 +02:00
Jehan
66a05c885a app: fix a complicated race condition when callback from GimpPdbDialog and…
… from the plug-in normal runtime crossed streams!

I also add a huge comment in-code, because this was annoying enough to
understand and debug that I don't want someone to remove the idle without proper
consideration and testing in the future, thinking it's useless.
2023-10-01 21:02:33 +02:00
Jehan
d84c4d763b app, libgimp, pdb: all gimp_*_popup() PDB calls now take a resource object as…
… argument (not a resource name).
2023-10-01 21:02:33 +02:00
Jehan
b578fd8cf1 app, libgimp, plug-ins: a lot of cleanup in GimpResourceSelect* code.
- Removing useless or redundant code.
- Simplifying various logics.
- Using GimpResource directly in temporary PDB procedures, not resource names.
- Better cleanup of the core resource chooser when the plug-in dialog quits (we
  need it to ask core to close also any visible resource chooser dialog).
- Replace the "Close" button by more common OK/Cancel. In particular, the
  GimpPdbDialog now properly keeps track of the initial object and when hitting
  "Cancel" (or Escape key), this initial object is set back.
- Clean up some of the comments, especially when the code is self explanatory.

There is still much more to clean and improve, but it's a first welcome step.
2023-10-01 21:02:33 +02:00
Jehan
19a005ad0f libgimp: properly free resources from the config.
Found by the definitely useful libgimp warnings:

> gimp_plug_in_destroy_proxies: ERROR: GimpPattern proxy with ID 13 was refed by plug-in, it MUST NOT do that!
2023-10-01 21:02:33 +02:00
Jehan
6601e861c4 libgimp*: support having procedure arguments of generic type GimpResource. 2023-10-01 21:02:33 +02:00
Jehan
f759c1e3d9 app, libgimp, pdb: use objects in various gimp_*_set_popup() functions. 2023-10-01 21:02:33 +02:00
Jehan
c5bfe07deb app: default to the system defaults for header bar in GimpPdbDialog creation. 2023-10-01 21:02:33 +02:00
Alx Sa
192bd42510 plug-ins: Removing "args" reference from file-jp2-load
One instance of `(GIMP_VALUES_GET_INT (args, 0)` was missed during the initial conversion.
This caused a compiler error. The value is now retrieved from the GimpProcedureConfig 
object.
2023-10-01 21:02:33 +02:00
Jehan
6aeb456e17 app, libgimp, pdb: add a parent_window parameter to gimp_*_popup() PDB calls.
Brush, font, gradient, palette and pattern choices are currently chosen through
a dialog created by the core, which then returns the user choice to the calling
plug-in. This has the unfortunate consequence of having a pile of likely at
least 3 windows (main GIMP window by core process, plug-in window by plug-in
process, then the choice popup by the core process) shared in 2 processes, which
often end up under each other and that's messy. Even more as the choice popup is
kinda expected to be like a sub-part of the plug-in dialog.

So anyway, now the plug-in can send its window handle to the core so that the
resource choice dialog ends up always above the plug-in dialog.

Of course, it will always work only on platforms where we have working
inter-process transient support.
2023-10-01 21:02:33 +02:00
Jehan
d6a2deb305 libgimpwidgets: new function gimp_dialog_get_native_handle(). 2023-10-01 21:02:33 +02:00
Jehan
9a57ab54e9 app, libgimp*: window handle on Windows have the type HANDLE.
Instead of passing a guint32, pass the proper type, since our the HANDLE type
can be 64-bit on Windows (according to links I found).
I was hoping it might be the reason for the breakage under Windows, though I
also found Microsoft documentation saying that the 64-bit handle can be safely
truncated: https://learn.microsoft.com/en-us/windows/win32/winprog64/interprocess-communication?redirectedfrom=MSDN

Nevertheless I'd appreciate testing again from NikcDC or anyone else, as I
reactivated setting transient between processes on Windows.

Note that I also pass the proper types on X11 now (Window), even though guint32
worked fine. Better be thorough.
2023-10-01 21:02:33 +02:00
Jehan
73e6d4b76c plug-ins: make parent window identifier for Wayland in Freedesktop portal.
The format for this "common convention" argument is explained here:
https://flatpak.github.io/xdg-desktop-portal/#parent_window
2023-10-01 21:02:33 +02:00
Jehan
58b3b14082 app, libgimp*, pdb, plug-ins: reimplement generic inter-process transient window.
Having windows ID as guint32 is a mistake. Different systems have
different protocols. In Wayland in particular, Windows handles are
exchanged as strings. What this commit does is the following:

In core:

- get_window_id() virtual function in core GimpProgress is changed to
  return a GBytes, as a generic "data" to represent a window differently
  on different systems.
- All implementations of get_window_id() in various classes implementing
  this interface are updated accordingly:
  * GimpSubProgress
  * GimpDisplay returns the handle of its shell.
  * GimpDisplayShell now creates its window handle at construction with
    libgimpwidget's gimp_widget_set_native_handle() and simply return
    this handle every time it's requested.
  * GimpFileDialog also creates its window handle at construction with
    gimp_widget_set_native_handle().
- gimp_window_set_transient_for() in core is changed to take a
  GimpProgress as argument (instead of a guint32 ID), requests and
  process the ID itself, according to the running platform. In
  particular, the following were improved:
  * Unlike old code, it will work even if the window is not visible yet.
    In such a case, the function simply adds a signal handler to set
    transient at mapping. It makes it easier to use it at construction
    in a reliable way.
  * It now works for Wayland too, additionally to X11.
- GimpPdbProgress now exchanges a GBytes too with the command
  GIMP_PROGRESS_COMMAND_GET_WINDOW.
- display_get_window_id() in gimp-gui.h also returns a GBytes now.

PDB/libgimp:

- gimp_display_get_window_handle() and gimp_progress_get_window_handle()
  now return a GBytes to represent a window handle in an opaque way
  (depending on the running platform).

In libgimp:

- GimpProgress's get_window() virtual function changed to return a
  GBytes and renamed get_window_handle().
- In particular GimpProgressBar is the only implementation of
  get_window_handle(). It creates its handle at object construction with
  libgimpwidget's gimp_widget_set_native_handle() and the virtual
  method's implementation simply returns the GBytes.

In libgimpUi:

- gimp_ui_get_display_window() and gimp_ui_get_progress_window() were
  removed. We should not assume anymore that it is possible to create a
  GdkWindow to be used. For instance this is not possible with Wayland
  which has its own way to set a window transient with a string handle.
- gimp_window_set_transient_for_display() and
  gimp_window_set_transient() now use an internal implementation similar
  to core gimp_window_set_transient_for(), with the same improvements
  (works even at construction when the window is not visible yet + works
  for Wayland too).

In libgimpwidgets:

- New gimp_widget_set_native_handle() is a helper function used both in
  core and libgimp* libraries for widgets which we want to be usable as
  possible parents. It takes care of getting the relevant window handle
  (depending on the running platform) and stores it in a given pointer,
  either immediately or after a callback once the widget is mapped. So
  it can be used at construction. Also it sets a handle for X11 or
  Wayland.

In plug-ins:

- Screenshot uses the new gimp_progress_get_window_handle() directly now
  in its X11 code path and creates out of it a GdkWindows itself with
  gdk_x11_window_foreign_new_for_display().

Our inter-process transient implementation only worked for X11, and with
this commit, it works for Wayland too.

There is code for Windows but it is currently disabled as it apparently
hangs (there is a comment in-code which links to this old report:
https://bugzilla.gnome.org/show_bug.cgi?id=359538). NikcDC tested
yesterday with re-enabling the code and said they experienced a freeze.
;-(

Finally there is no infrastructure yet to make this work on macOS and
apparently there is no implementation of window handle in GDK for macOS
that I could find. I'm not sure if macOS doesn't have this concept of
setting transient on another processus's window or GDK is simply lacking
the implementation.
2023-10-01 21:02:33 +02:00
Alx Sa
bf210243f2 plug-ins: Port selection-to-path.c to gimp_image_procedure_new2()...
...and to GimpProcedureDialog.
selection-to-path-dialog.c was also removed as the code can now be contained
within selection-to-path.c thanks to the new API.
2023-10-01 21:02:33 +02:00
Jehan
dd1c12a0e1 plug-ins: port script-fu-script.c to gimp_image_procedure_new2(). 2023-10-01 21:02:33 +02:00
Jehan
7f34fb14f7 plug-ins: port pagecurl to gimp_image_procedure_new2() and GimpProcedureDialog.
I'm also changing various arguments to GimpChoice and making "opacity" into an
argument.
2023-10-01 21:02:33 +02:00
Jehan
77a30bfd28 app, libgimp: core loads thumbnail from metadata if no GimpThumbnailProcedure…
… is set.

The order for thumbnail creation in gimp_imagefile_create_thumbnail() is now:

1. If there is a GimpThumbnailProcedure, it is run first.
2. Otherwise we check if a thumbnail is in the metadata.
3. As last resort, we just load the full image.

Part of the fix was to copy gimp_image_metadata_load_thumbnail() into the core
code. I have been wondering if we could not drop the same function from libgimp
and remove the GimpThumbnailProcedure frome file-jpeg, since it just uses the
metadata thumbnail and it is the only plug-in using this code.
Also it is much faster to run this in core and it's generic function which makes
thumbnail loading from Exif data working for every format supported by Exiv2.

On the other hand, the file-jpeg thumbnail procedure also gathers a few more
useful information, such as the color model (in a reliably manner, since based
on JPEG header, unlike from metadata which may be wrong).
2023-10-01 21:02:33 +02:00
Jehan
742bdb4ebe app: fix handling of GimpThumbnailProcedure return values.
There were a bug in some array size check and the image type is an enum, not
simply an int.
2023-10-01 21:02:33 +02:00
Jehan
fa67a6ce0e libgimp, plug-ins: properly document the return values of GimpThumbnailProcedure.
The various information (width, height, image type and number of layers) are
those of the full image, not of the thumbnail. Make it clear in the docs of
GimpRunThumbnailFunc.

Additionally:

- file-xmc was returning the proper information but variables were wrongly
  named, which was confusing.
- Fix file-ico thumbnail proc which was returning the thumbnail width/height.
- In file-darktable, initialize width/height to 0 so that we just don't show any
  size when we don't get the information. It's better not to show anything than
  completely wrong information (the thumbnail target size).
2023-10-01 21:02:33 +02:00
Jehan
9124f9c627 plug-ins: fix algorithm for choosing the best thumbnail of ICNS image.
We were choosing the bigger icon in the ICNS list. Instead let's choose the
bigger icon within the target size bounding box. In case there is no smaller (or
equal size) icon, we falls back to the smallest bigger icon.

Also make sure we set width and height to the full image size, as this is used
as information on the full image (not the thumbnail).
2023-10-01 21:02:32 +02:00
Jehan
93ad26e6bc plug-ins: load SVG image at proper size.
SVG is a vector format which is easy to render exactly within the size×size
bounding box. Let's make sure we do so.
This makes for much sharper SVG thumbnails (and also possibly faster thumbnail
render).
2023-10-01 21:02:32 +02:00
Jehan
ed98b990c5 plug-ins, libgimp: GimpRunThumbnailFunc now uses a GimpProcedureConfig rather…
… than a GimpValueArray.

Similar to other GimpProcedure, move to using a config object. A difference is
that thumbnail procedures are always run non-interactively.

Also fixing WMF load thumbnail procedure: the dimension computation was wrong
when the image was wider than tall.
2023-10-01 21:02:32 +02:00
Jehan
601437addd plug-ins: file-openraster also moved to new gimp_load_procedure_new().
Additionally getting rid of a call to gimp_image_set_file() since we clarified
its docs as not being used for non-XCF files.
2023-10-01 21:02:32 +02:00
Jehan
9e2a7e8759 libgimp, plug-ins: rename gimp_load_procedure_new2() as gimp_load_procedure_new().
All C load procedures are now moved to the new API.
2023-10-01 21:02:32 +02:00
Jehan
136aca3c34 plug-ins: port all remaining C load procedures to gimp_load_procedure_new2(). 2023-10-01 21:02:29 +02:00
Jehan
d5607454b3 plug-ins: port file-cel to gimp_load_procedure_new2() and GimpProcedureDialog.
Also the palette argument is now a proper GFile argument (not a string).

There is also a palette argument for the export procedure, but it's currently
unused. A palette storing function will need to be implemented.

Some bit of additional logic cleanup was done.
2023-10-01 20:52:02 +02:00
Jehan
c256f63d63 plug-ins: port file-png to gimp_load_procedure_new2(). 2023-10-01 20:52:02 +02:00
Jehan
885bae59ba plug-ins: port file-pdf-load to gimp_load_procedure_new2().
I also did a bit of code cleanup in the main run() load code.
2023-10-01 20:52:02 +02:00
Jehan
2416b40c26 plug-ins: port file-svg to gimp_load_procedure_new2 and GimpProcedureDialog.
Again, I am losing a tiny bit of UI, in particular the ratio fields, but also
the update of the size label (this was kinda broken anyway, as it updated only
when updating some fields, not others).

Also moving the default resolution to 300 PPI.

Last but not least, I transformed the "paths" int argument to a GimpChoice
argument.
2023-10-01 20:52:02 +02:00
Jehan
7a0fd77b95 plug-ins: port file-wmf to gimp_load_procedure_new2 and GimpProcedureDialog.
The new dialog is not fully on-par with the old one. We lost the X and Y ratio
fields as well as the ability to constrain dimensions to each other. This should
be improved when we'll get proper automatically generated widgets for dimension
arguments.
2023-10-01 20:52:02 +02:00
Jehan
4a3fd7423a plug-ins: port various plug-ins to gimp_load_procedure_new2(). 2023-10-01 20:52:02 +02:00
Jehan
af644b1950 libgimp, libgimpbase: new gimp_load_procedure_new2() for run() function using…
… a GimpProcedureConfig for arguments.

This also factorizes the code to load metadata. By default, a GimpLoadProcedure
will try and load metadata from a file (if Exiv2 knows the format). The run()
function will be allowed to edit the GimpMetadata object but also the load flags
before it is actually attached to the image, allowing plug-ins to have custom
metadata handling code when needed.
2023-10-01 20:52:02 +02:00
Jehan
2d33f1fb39 plug-ins: "compression" arg of file-tiff-save now becomes a GimpParamChoice. 2023-10-01 20:52:02 +02:00
Jehan
d670ff9f82 libgimpbase, libgimpwidgets: add a concept of insensitive choices in GimpChoice.
This is used in the generated GUIs for GimpChoice arguments, but also for
validation of property setting.

New functions:

* gimp_choice_set_sensitive()
* gimp_string_combo_box_set_sensitivity()
2023-10-01 20:52:02 +02:00
Jehan
cedc45d8f3 plug-ins: change "format" aux argument to a GimpChoice. 2023-10-01 20:52:02 +02:00
Jehan
555c428b70 libgimp: new utility method gimp_procedure_config_get_choice_id().
This is just a method to simplify transforming a GimpChoice argument into an
enum value, which is easier to deal with, in C. It also allows to benefit from
switch() warnings or the like to make sure no cases are missing.
2023-10-01 20:52:02 +02:00
Jehan
9a0cfa67bf libgimp: generate a list of possible choices for a GimpChoice argument.
Developers won't have to maintain manually a list of the possible values in the
help string. It can now be generated from the GimpChoice and will be therefore
ensured to always be up-to-date, and nicely formatted.

I also add some pango markup to the type helper texts to differentiate it from
the main argument docs.
2023-10-01 20:52:02 +02:00
Jehan
4163a29af3 app, libgimp: new GimpChoice procedure argument.
These will replace the int arguments used in place of enums. The problem of int
arguments used as list of choices is that it makes calling PDB functions very
opaque. This is especially bad when a list is long, so you constantly have to
refer to the documentation to understand what a series of numbers mean in
argument lists.

And the second issue is that plug-in developers have to manually maintain a list
of values both in the GUI and in the documentation string. This help text may
get out-of-sync, may end up with missing values or whatnot. Also if it is used
as tooltips, it makes for very weird tooltips in the graphical interface, with
an overlong technical list of int-values mapping which should ideally only be
made visible in the PDB procedure browser listing.
2023-10-01 20:52:02 +02:00
Jehan
20923260cf libgimpwidgets: new GimpLabelStringWidget and update GimpStringComboBox.
- GimpLabelStringWidget widget makes any widget with a "value" string property
  into a GimpLabeled.
- Add a "value" string property to GimpStringComboBox (which makes it usable by
  GimpLabelStringWidget).
2023-10-01 20:52:02 +02:00
Jehan
7e6b01a4e5 libgimpbase: new GimpChoice class meant to represent a list of allowed values.
This will be used for creating limited lists of strings as argument types for
procedures.
Ideally enums are the best type for this, but it can only be used for generic
libgimp* enum types, not custom enums created only for a given plug-in. For
this, we currently just demote the args to ints which lose any semantic. A
limited list of string will give back some semantic and some better validation,
even though it's a tiny bit more annoying to work with strings than int types
(at least in C).
2023-10-01 20:52:02 +02:00
Jehan
29ce8f234f libgimp*: removing now useless Makefile.gi files.
These were include files for the autotools build and are now unused.
2023-10-01 20:52:02 +02:00
Jehan
1dc5635d32 libgimp: support all subtypes of GFile.
In particular if a GFile is created with g_file_new_for_path(), it will be a
GLocalFile. We need this to be supported too.
2023-10-01 20:52:02 +02:00
Alx Sa
3c53d5f38e plug-ins: port cml-explorer to gimp_image_procedure_new2()
Also fixes some spelling issues and removes a warning about an
uninitialized variable.
Currently the only argument is for non-interactive mode, so
the dialogue isn't ported to GimpProcedureDialog yet.
2023-10-01 20:52:02 +02:00
Alx Sa
22cb6b3bb6 plug-ins: port goat-exercise to gimp_image_procedure_new2()
Not yet porting to GimpProcedureDialog because there's no settings to import/export,
so it would add several unnecessary buttons.
2023-10-01 20:52:02 +02:00
Alx Sa
6dc21425c0 plug-ins: port smooth-palette to gimp_image_procedure_new2()
The dialog itself is ported to GimpProcedureDialog. However, the
width and height require another API that allows for size entries with
multiple fields before it can be considered finished.
2023-10-01 20:52:02 +02:00
Jehan
37a867d85a plug-ins: port file-farbfeld to new gimp_save_procedure_new().
This was not forgotten, simply this is a new plug-in which got into the tree
after a rebase. ;-)
2023-10-01 20:52:02 +02:00
Jehan
cd5d221cfa libgimpconfig: add (de)serialization support of GBytes arguments.
Basically the same as GimpParasite, except that we don't same a parasite name
and flags.
2023-10-01 20:52:02 +02:00
Jehan
69edf13e2c plug-ins: fix the GimpSaveProcedure plug-ins in Python.
As usual, these got forgotten!

Also colorxhtml is actually deeply broken by commit 89c359ce47 which removed
gimp_drawable_get_pixel() (Niels thought it was not used, whereas it was simply
harder to spot with bindings!).
This will have to be fixed eventually.
2023-10-01 20:52:02 +02:00
Jehan
fcc810d7d3 libgimp, plug-ins: rename to gimp_save_procedure_new().
Also the mimetype is already set by gimp_file_procedure_set_mime_types() so
transform the mimetype argument into an export_metadata argument.
2023-10-01 20:52:02 +02:00
Jehan
06bd1f1289 plug-ins: port file-gih to GimpSaveProcedureDialog.
I was hoping to redesign further but the whole logic of animated brush creation
is made so complicated that I think it would require a whole more complex GUI
with visual hints. So anyway I stopped at basic redesign and port to the new
dialog generation code.
It still makes the code much simpler and a bit more powerful (also less bugs
hopefully). I have also reviewed the procedure arguments, removing redundant
ones (display-cols and display-rows are just computed from cell-width and
cell-height) and adding some aux arguments instead to simplify dynamic GUI code.
2023-10-01 20:52:02 +02:00
Jehan
272bc69540 libgimpwidgets: improve gimp_label_spin_set_increments().
The assert tests were not taking well into account the case where upper == lower
or where it's an integer spin which is just separated by 1 (both cases seem
silly, but it makes sense in the case of generic — or even dynamic! — spin
widgets where we want to adjust the min and max, e.g. depending on the property
of the image, or on other settings.
2023-10-01 20:52:02 +02:00
Jehan
92e77a4541 libgimp: add ability to sync a label to a string property of a procedure.
Now gimp_procedure_dialog_get_label() can work both with an existing property ID
or a new property ID. In the former case, it will simply sync the label with the
procedure argument, which will make it easy to update the label contents. In the
latter case, it just initialize with the provided text.
2023-10-01 20:52:02 +02:00
Jehan
689e3da5b9 plug-ins: port the last GimpSaveProcedure to gimp_save_procedure_new2().
It's the basic stupid port, though this dialog is so bad that I think I'm going
for a second stage with a basic redesign of this GUI while also moving to
GimpSaveProcedureDialog. To be continued.
2023-10-01 20:52:02 +02:00
Jehan
9ed8f00e5b plug-ins: port most plug-ins to gimp_save_procedure_new2(). 2023-10-01 20:52:02 +02:00
Jehan
51b14a7978 libgimp: fix object memory management in GimpPlugIn.
The expectation of 2 references per object in gimp_plug_in_destroy_proxies() was
wrong. It is true during most of the plug-in life, because both the
GimpProcedure and the GimpPlugIn have a hash-table keeping their own reference
to it, except that in gimp_plug_in_pop_procedure(), we release the reference
owned by the procedure with _gimp_procedure_destroy_proxies() first. So at this
point of the object life, its reference count is supposed to be 1.

The source of the bug was in fact in _gimp_plug_in_get_*() (where * can be
display, image, item or resource) which was behaving differently the first time
it is called for an object with the successive calls. In the first call only, it
was creating then refing into the table (so the object started directly with 2
references) whereas on successive calls, it just returned the hashtable-looked
up reference. In other words, it behaved as a (transfer full) on the first call
and (transfer none) on successive calls. And so did all public API which were
making use of this infrastructure (in particular gimp_*_get_by_id() functions).
2023-10-01 20:52:01 +02:00
Jehan
44e2bab9ad plug-ins: remove "num-images" argument and improve error feedback.
The arg "num-images" is clearly redundant as the "images" array already has this
information. Moreover it is bug-prone, for instance running 'Repeat "Filmstrip"'
would crash the plug-in which was defaulting to NULL "images" and 1 "num-images"
(without any GimpItem serialization ability yet).
Of course, we could just fix this, but better remove the redundant arg and all
possibilities of future similar bugs.

Also I now display a proper error message when running without input images
which says: "\"Filmstrip\" cannot be run without any input images"
2023-10-01 20:52:01 +02:00
Jehan
df6ccf390f plug-ins: fix possibly unreffing a NULL pointer. 2023-10-01 20:52:01 +02:00
Jehan
48f0ac3ad5 libgimp: release leaked reference to resource object.
The widget_creator_func() given to gimp_prop_chooser_factory() will create an
object which will take its own reference. We must release the one we got with
g_object_get().
2023-10-01 20:52:01 +02:00
Jehan
dac29b17a8 libgimp: some memory leak fixed. 2023-10-01 20:52:01 +02:00
Jehan
14bcaa717b plug-ins: a bunch of more plug-ins ported to gimp_save_procedure_new2(). 2023-10-01 20:52:01 +02:00
Jehan
b23519a401 plug-ins: port to gimp_save_procedure_new2() all export procedures…
… which were using gimp_procedure_config_begin_export().
2023-10-01 20:52:01 +02:00
Jehan
da7e8f3388 libgimp: new gimp_save_procedure_new2() meant to replace gimp_save_procedure_new().
Metadata handling is also integrated in this API:

* while giving a possibility to disable metadata saving if you want to do it
  yourself (e.g. in file-heif), by setting a NULL MimeType;
* and the GimpMetadata object is added as run() argument, allowing one to edit
  the metadata during the run, while still letting the infrastucture handle the
  save (e.g. in file-jpeg);
* or to save intermediate metadata with gimp_procedure_config_save_metadata()
  (e.g. in file-tiff).
2023-10-01 20:52:01 +02:00
Jehan
602345143f libgimp: more removal of over-refing. 2023-10-01 20:52:01 +02:00
Jehan
f37c3c42c7 libgimp: simplify GimpFileProcedure public API with G_DECLARE_DERIVABLE_TYPE().
While we definitely should not use this inside app/, because having the private
structure easily accessible as a member is very convenient, it is clear that it
makes for a much nicer public signature. Also the priv member is of no help to
third-party developers using this API to make plug-ins and is better hidden in
such a case.
2023-10-01 20:52:01 +02:00
Alx Sa
e79de5db86 plug-ins: port small-tile to gimp_image_procedure_new2()
The dialog itself is ported to GimpProcedureDialog, but the original 
plug-in only had one config parameter (Number of Tiles).
Some of the other options might make sense as config parameters 
such as the horizontal/vertical toggles and opacity.
2023-10-01 20:52:01 +02:00
Jehan
3c1ecd53ff plug-ins: port film to GimpProcedureDialog.
I needed a few more GimpProcedureDialog widgets, which I now have. The only part
still not generated in this plug-in is the image selection. This is hundreds of
lines less!

It now has arguments for every usable setting (except "keep-height" which is an
aux arg because it is simulated with a 0 "film-height" in non-interactive mode).

Also the film-height/keep-height default in interactive mode is now much better.
I override the film-height default and set it to be the image's height. This
makes for a much better default at all time.

The "Reset" button in Advanced section is not useful anymore since we now have
the generic "Reset" (to Initial/Factory) of GimpProcedureDialog, though it
actually doesn't work right for the time being, as it fails serializing
GimpFont.
2023-10-01 20:52:01 +02:00
Jehan
5cc1c898d7 libgimp, plug-ins: enhance gimp_procedure_dialog_get_label() with markup and…
… mnemonic abilities.
2023-10-01 20:52:01 +02:00
Jehan
2f1c569249 libgimp: new gimp_procedure_dialog_fill_paned() function. 2023-10-01 20:52:01 +02:00
Jehan
334febdebb libgimp: new gimp_procedure_dialog_fill_notebook*() functions. 2023-10-01 20:52:01 +02:00
Jehan
fc9a720b31 libgimp: some debug printing for plug-in developers.
This will be useful for plug-in developers but also for us. Seeing we leak the
config object is often a good indication that something is wrong in our handling
of internal references (since everything relies on the config object in plug-ins
now, in particular all the GUI).
2023-10-01 20:52:01 +02:00
Jehan
e6e3545959 libgimp: all the over-reffing was wrong.
I was clearly confused when I wrote this. The sinking part matters to take
ownership of a reference in the widgets table, but we don't need to ref widgets
again before inserting them in containers. We were leaking widgets and as a
consequence the config object (and as a second consequence, some objects such as
resources for resource-selection widgets).
2023-10-01 20:52:01 +02:00
Jehan
99d4c504d0 plug-ins: port film to gimp_image_procedure_new2().
The dialog is not ported to GimpProcedureDialog yet. It will be worth doing it
as a second step.
2023-10-01 20:52:01 +02:00
Jehan
f5183cbd7b plug-ins: port warp to gimp_image_procedure_new2().
It would be worth porting when GimpDrawableComboBox widgets can be used as
GimpProcedureDialog generated widgets. Or even better, if the GimpPickableButton
were ported to libgimp to be used by plug-ins (since it's actually a lot more
usable).
2023-10-01 20:52:01 +02:00
Jehan
2f91e45b4f plug-ins: port easy plug-ins to gimp_image_procedure_new2().
These were the plug-ins already using gimp_procedure_config_*() API.
2023-10-01 20:52:01 +02:00
Jehan
2a21d45ada plug-ins: port grid to gimp_image_procedure_new2().
I didn't port to GimpProcedureDialog because we'd need first a GimpSizeEntry
generatable widget, which can map to several properties (here for instance 3
width properties).
2023-10-01 20:52:01 +02:00
Jehan
3c658789a6 plug-ins: now port to gimp_image_procedure_new2() all plug-ins without args. 2023-10-01 20:52:01 +02:00
Jehan
4f14f620c4 plug-ins: port to gimp_image_procedure_new2() all plug-ins which were already…
… working with a GimpProcedureConfig.

These are the easiest ones to port as most of the work was already done (mostly
just some now useless calls to remove).
2023-10-01 20:52:01 +02:00
Jehan
96b3302e65 plug-ins: port gradient-flare to gimp_image_procedure_new2() and GimpProcedureDialog.
The port to GimpProcedureDialog is partial as there are still quite a few pieces
which can be improved. But it's a good start.
2023-10-01 20:52:01 +02:00
Jehan
7da0db9e88 plug-ins: port tile to gimp_image_procedure_new2() and GimpProcedureDialog. 2023-10-01 20:52:01 +02:00
Jehan
8c8c64a9ee libgimp: temporary gimp_image_procedure_new2() until port is over.
Same as with gimp_procedure_new2(), I will end up renaming the function to
gimp_image_procedure_new() once all usage of this function will have been ported
to the new function using GimpProcedureConfig instead of GimpValueArray
arguments.
2023-10-01 20:52:01 +02:00
Jehan
3806b46fc5 plug-ins: forgotten Python plug-ins had to be ported to new Gimp.Procedure.new().
There was also one case of port to updated GimpResource API to get the name of a
palette.
2023-10-01 20:52:01 +02:00
Jehan
2b38a2df86 libgimp, plug-ins: rename gimp_procedure_new2() as gimp_procedure_new() and…
… remove the latter.

Now all GimpProcedure use this new implementation with use a config object.
2023-10-01 20:52:01 +02:00
Jehan
f6f622b93d libgimp: port 2 usages of gimp_procedure_new() to gimp_procedure_new2().
The one in GimpResourceSelect is a very nice example of why using config objects
is much nicer, getting arguments by their name instead of an index (which in
this case had to be tracked down by a private function to handle different
cases).
2023-10-01 20:52:01 +02:00
Jehan
a2acf24ecb libgimp, plug-ins: Script-fu scripts now use gimp_procedure_new2() too.
Also in gimp_procedure_config_begin_run(), make sure we sync the arguments with
the config object first thing, even in interactive and with-last-vals case
(where the args may be further overridden). This was especially important for
Script-fu scripts as the image and drawable were not provided separately, so we
need to make sure that the config file has the right values.
2023-10-01 20:52:01 +02:00
Jehan
5d3112a2f1 plug-ins, libgimp: move GimpBatchProcedure's run function to use config objects.
Also port more script-fu procedures to gimp_procedure_new2(), which were sharing
some code with the script-fu batch procedure.
2023-10-01 20:52:01 +02:00
Jehan
af00b66914 plug-ins: port the easy script-fu procedures to gimp_procedure_new2(). 2023-10-01 20:52:01 +02:00
Jehan
38ecbfc762 plug-ins: more plug-ins ported to gimp_procedure_new2(). 2023-10-01 20:52:01 +02:00
Jehan
c09711beaa libgimp: the default run (if no run-mode parameter) should be non-interactive.
Otherwise we will always try to reuse previous values or use the default,
bypassing the actual passed values.

I encountered this issue while porting file-glob and realizing that the
"pattern" argument was always passed to NULL, ignoring the explicitly set
pattern.

When a procedure has no run-mode argument, we should simply not assume anything
and use the passed arguments (which is what the non-interactive mode does).
2023-10-01 20:52:01 +02:00
Jehan
9b2240f51e plug-ins: port web-page to GimpProcedureDialog and gimp_procedure_new2().
Again a lot less lines for more functionalities (e.g. now it should work fine in
WITH_LAST_VALS mode).
2023-10-01 20:52:01 +02:00
Jehan
e92ef9d45a plug-ins: port several of the easy plug-ins to gimp_procedure_new2(). 2023-10-01 20:52:01 +02:00
Jehan
f6da799c11 plug-ins: port screenshot to GimpProcedureDialog and gimp_procedure_new2().
A lot less lines for the same functionalities!
This includes improvements too:

* "include-pointer" as new PDB argument;
* settings storage thanks to GimpProcedureDialog;
* it should hopefully work better in non-interactive (though it's untested).

The macOS and Windows screenshots are untested after this change, though they
should still work the same. Please report if there is any problem!
2023-10-01 20:52:01 +02:00
Jehan
60aeff5623 libgimp: new gimp_procedure_dialog_set_ok_label() function.
This allows to set a custom label for the OK button.
2023-10-01 20:52:01 +02:00
Jehan
59edcde06f libgimp: new function gimp_procedure_dialog_set_sensitive_if_in().
This function allows to change the sensitivity of a widget depending on the
value of another property.
We already had gimp_procedure_dialog_set_sensitive() except it was only syncing
with a boolean property, whereas the new function can compare with any property
type.
2023-10-01 20:52:01 +02:00
Jehan
edab39a868 libgimp: fix the sometimes wrong run-mode value in the config object. 2023-10-01 20:52:01 +02:00
Jehan
982764421f app: fixes the call to "plug-in-busy-dialog".
Fixes the following CRITICAL:

> g_value_set_int: assertion 'G_VALUE_HOLDS_INT (value)' failed
2023-10-01 20:52:01 +02:00
Jehan
7ab87d2b15 Issue #50: new gimp_procedure_new2() which automatically stores procedure config.
This new function is meant to replace gimp_procedure_new() when all plug-in
usage will have been switched.

This function creates the GimpProcedureConfig object on behalf of the plug-in
and calls gimp_procedure_config_begin_run() and gimp_procedure_config_end_run().
This way we ensure that all plug-in calls with successful result are properly
stored without asking the developer not to forget to call these (if a "good
practice" is in fact something we request to do every time, especially for good
user experience, we might as well make it rather a core process).

Advantages:

* Better interactive experience: using any plug-in will result in saved
  previously used settings.
* for developers, working on config objects is also much more comfortable than
  working on GValueArray;
* step forward for the future macro infrastructure: if we can ensure that all
  plug-in calls are properly logged, then we can replay plug-in actions, in
  NON_INTERACTIVE with the same settings.
2023-10-01 20:52:00 +02:00
Sabri Ünal
2003d26105 Update Turkish translation 2023-10-01 18:26:09 +00:00
Sabri Ünal
59fb6e0da5 Update Turkish translation 2023-10-01 18:26:01 +00:00
Alx Sa
6ad54ca3a3 plug-ins: Fix DDS vulnerability (ZDI-CAN-22093)
Resolves #10069

Currently, the DDS header information for the width, height, and bytes per scan line
are read in and assumed to be correct. As these values are used for memory allocation
and reading, it would be good to verify they do not exceed the file size.

This patch adds a condition after the header is read in to verify those values. If they exceed
the file size (mins an offset), the file is not read in and an error message is shown.
2023-10-01 17:06:25 +00:00
Jehan
0b307a3a1a NEWS: update. 2023-10-01 18:01:26 +02:00
Alx Sa
a87afa7255 themes: Set default background-color for buttons
Resolves #9996.
While GIMP has background-colors set for specific buttons,
it did not have a default button background-color. This resulted
in "random" buttons showing system theme colors like the
[Reload Current Theme] button.
This patch defines a default background-color while leaving the
specific button themes intact.
2023-09-30 01:38:37 +00:00
Anders Jonsson
56256e2721 Update Swedish translation 2023-09-29 21:02:45 +00:00
Alx Sa
865cc56894 plug-ins: Fix vulnerability in file-psd
Resolves #10101.
This patch adds a missing break statement after an error condition
is detected to prevent the code from continuing afterwards.
2023-09-29 20:38:51 +00:00
Alx Sa
e4c362a9c3 themes: Highlight when hovering over grid view icons
This adds a border when hovering over icons in various
grid views (brushes, gradients, etc). This makes it more
visually apparent which option you can click to select.
2023-09-28 19:01:05 +00:00
Vasil Pupkin
f22935d3de Update Belarusian translation 2023-09-28 17:59:51 +00:00
bootchk
89901c8466 Fix for 2.99 only #6157
Also refactoring: extract two functions

Add test case scripts/test/register-fail

Catches more registration errors.
Any errors not caught at least will not crash.

Remains to be ported to 2.10, but only a few lines,  without the refactoring.
2023-09-28 13:26:23 +00:00
Jehan
196f1d6e95 Issue #6165: crash when the system icon theme does not contain image-missing icon.
The bug is in fact in GTK. "image-missing" is supposed to never missing since
GTK embeds an icon as GResource. But it turns out that the code is buggy. So if
an icon is missing from GIMP theme, then system theme, then "icon-missing" icon
as well, GIMP crashes.

See: https://gitlab.gnome.org/GNOME/gtk/-/issues/3526

As a workaround for now, let's at least add our own "image-missing", at least in
our main themes (Color and Symbolic, not Legacy). This will make GIMP not
crashing at least by default when another icon is missing.
Of course a crash could still happen if one use Legacy or a third-party theme
and if their system theme doesn't contain "image-missing" as well, until GTK is
fixed.
2023-09-27 21:34:18 +02:00
Anders Jonsson
5b78437328 Update Swedish translation 2023-09-27 19:28:40 +00:00
Jehan
47133b48ef build: add new Belarusian translation in the installer.
This localization was added recently but it was not in the installer scripts.
Discovered with unit testing: meson test gimp:build / windows-installer-langs
2023-09-27 21:01:09 +02:00
Jehan
3dcc4196fb plug-ins: plugin-defs.pl also is a remnant from autotools! 2023-09-27 15:57:58 +02:00
Jehan
d88f6f9733 app, devel-socs, icons, plug-ins, tools: remove various autotools artifacts.
* generate-icon-makefiles.py was a tool to generate the icon-list.mk files.
* mkgen.pl was used to generate plug-ins/common/Makefile.am
2023-09-27 15:39:39 +02:00
Yuri Chornoivan
c8e4f399d0 Update Ukrainian translation 2023-09-26 16:44:30 +00:00
Vasil Pupkin
73f7e6ba44 Add Belarusian translation 2023-09-26 14:54:40 +00:00
Luming Zh
5724696105 Update Chinese (China) translation 2023-09-26 14:31:59 +00:00
Martin
b620927ee7 Update Slovenian translation 2023-09-26 13:07:06 +00:00
Mark
2e9823f8ea coffee fix 2023-09-26 10:32:55 +00:00
Jehan
f38449115f Issue #2902: Preference option to set "Interface/Theme" font size.
Though GTK+3 is supposed to take care of scaling fonts with high density
displays, it turns out it is not enough for many, for various reasons (taste,
eyesight, distance to the display…). So we add this additional settings to tweak
further the font size.

With Aryeom, we experimented/discussed both a percentage UI vs. an absolute font
size field (e.g. as they provide in GNOME Tweaks). In the end, we went for a
percentage UI because we realize that we don't necessarily know what is the
current size at all. Mostly you just want bigger or smaller, and don't
necessarily care so much at which value is the font size.

This settings only has a single limitation (that we could find), which is when
used on a theme with widget rules using absolute font-size rules (px, or
keywords such as small/medium/large). As long as the CSS rules are relative
though (either to the parent widget, or to the root size), then it works fine.
Basically a theme hard-coding font sizes won't fare well with this settings, but
since we can consider this bad practice, it's an acceptable limitation.
2023-09-25 23:05:38 +02:00
Luming Zh
f6310c3db7 Update Chinese (China) translation 2023-09-25 15:16:36 +00:00
Jehan
0a905649c2 themes: make the switch neutral in our Default theme.
Actually just use the foreground color as background when it is checked.
2023-09-25 15:19:56 +02:00
Jehan
823adbe9f9 Issue #9880: Crash on startup (invalid accelerator string '<Primary>VoidSymbol').
GTK docs is pretty clear:

> It is a programmer error to pass an invalid accelerator string. If you are
> unsure, check it with gtk_accelerator_parse() first.

So now we verify validity of accelerator strings before using shortcuts from
config files (which can be consider "human input" as the file can be modified).
2023-09-25 11:53:15 +02:00
Yuri Chornoivan
847afa116f Update Ukrainian translation 2023-09-25 06:54:33 +00:00
Ekaterine Papava
ddb8c7abad Update Georgian translation 2023-09-25 03:51:07 +00:00
Ekaterine Papava
3ba0faf87a Update Georgian translation 2023-09-25 03:49:11 +00:00
Jehan
d71cd9d277 Issue #9604: "view-zoom-*" actions should not be radio actions.
A first attempt at fixing this was going through the idea of changing the
concept of radio actions, such as allowing an active action in an action group
to be called again. Or having some action in the radio group which can be called
but never set active.

But in fact, I just realized that these zoom actions are simply not meant to be
radio actions. They are not stateful actions, nor are they exhaustive.

I also updated the `other_scale` storage logic. Instead of updating it each time
the zoom changed (which was even broken in some cases, like when changing zoom
through another action), I simply save the last custom zoom value. This is the
one which is reused across calls. I don't think always resetting to the current
zoom value is very useful (if you call this dialog, it's not to zoom to the
current zoom!). Also there was some concept of flagging this stored zoom value
as "dirty" by making it negative, but this was never actually used, which makes
me believe that current logic was not the original intent anyway.
Saving the previous custom zoom explicitly set seems to be a good enough
behavior, so let's go with it.
2023-09-24 23:51:14 +02:00
Luming Zh
589a278791 Update Chinese (China) translation 2023-09-24 17:41:44 +00:00
Yuri Chornoivan
abe67517b7 Update Ukrainian translation 2023-09-24 15:53:16 +00:00
Balázs Úr
82f8360b6c Update Hungarian translation 2023-09-24 13:33:39 +00:00
Piotr Drąg
7b018e45c7 Update Polish translation 2023-09-24 13:41:54 +02:00
Martin
9625cc2ef4 Update Slovenian translation 2023-09-24 06:14:02 +00:00
Alx Sa
cb352ab5b2 plug-ins: Add Esm Software PIX format import support 2023-09-23 21:26:47 +00:00
Martin
cf5d92aaf8 Update Slovenian translation 2023-09-23 21:13:55 +00:00
Alx Sa
96f536a335 plug-ins: Fix PSP vulnerability (ZDI-CAN-22096)
Resolves #10072.

The current PSP palette loading code does not check if
the file's palette entry count value is below the limit
(G_MAXUNIT32 / 4 due to each color being 4 bytes long).
This patch adds this check and stops loading if the count
is larger than GIMP currently supports.
2023-09-23 15:46:13 -04:00
Alx Sa
e1bfd87195 plug-ins: Fix PSP vulnerability (ZDI-CAN-22097)
Resolves #10071.

When reading RLE compressed data, a buffer was allocated to 127 bytes.
However, it can potentially be used to read 128 bytes, leading to a
off-by-one vulnerability. This patch allocates 128 bytes to the buffer
to prevent this from occurring.
2023-09-23 02:16:24 +00:00
Alx Sa
5211a2c3e8 themes: Define background color for spinbutton buttons
Resolves #9997.

Another system theme leak, this time for the +/- buttons on
GimpSpinButton. This patch specifically defines them to
bg-color.
2023-09-22 18:51:10 +00:00
Jehan
12d8401d65 app: better handling of failure of gimp_scanner_parse_string().
This fixes 2 issues:

1. gimp_scanner_parse_string() may fail, which here would indicate broken input.
   If it does, the string variable would not be set, so we need to initialize it
   to NULL, otherwise freeing it could crash GIMP.
2. The variables set by gimp_scanner_parse_string() must be freed.
2023-09-22 15:27:59 +02:00
Jehan
ae38b433f8 app: improve robustness of font detection algorithm, allowing for future fields.
While I was testing some fonts I had on my system which were named exactly the
same, I also realized that all their fields were identical (among the ones we
store at least), except for the hash obviously. While the hash is great to
differentiate fonts when we use exactly the same files, there are various
reasons where one could have the right font installed with a different hash
(e.g. a simple reason could be if it was stored in different font formats).

So I'm thinking that maybe we'll want to add more fields in the future (if there
are any more fields allowing to better discriminate among some fonts named
similarly). This commit will allow this version of GIMP to still work when
loading the future serialized fonts with new and unknown fields. The unknown
fields will be ignored but at least it will still do its best to find fonts with
the known fields. Therefore we won't have to bump the XCF format version if we
only add new fields.

Similarly this allows to add the fields in-between, reorder existing fields or
even remove some in the future if we realize something is really unneeded. It's
less a big deal than the ability to add new fields without bumping XCF version
though.
2023-09-22 15:16:52 +02:00
Jehan
6c40f10377 app: improve the double loops to deserialize GimpFont.
Rather than looping fully over the full list of fonts once more, and
re-computing a second time the same font similarity score (with the risk of
messing up the copy-paste), let's just store the indexes of "most similar" fonts
in the first loop, then only query and check the hash for these.
2023-09-22 14:09:00 +02:00
Alx Sa
59ce1a7255 themes: Define treeview checkbox colors
Resolves #8756 (along with !1065)

The system theme leaked due to the checkbox styling not being
defined for GtkTreeView checkboxes.
The background-image in particular overpowers other settings.
The normal checkbox styling is now specifically applied to
these checkboxes as well.
2023-09-21 22:36:31 +00:00
Jehan
8c4ee50867 NEWS: update. 2023-09-21 23:27:49 +02:00
Jehan
db4710de1c Issue #9154: incorrect corner is selected in text tool.
After reframing a rectangle item, make sure we restore its previous state.
2023-09-21 16:16:07 +02:00
Rodrigo Lledó
2ee2a4a2c0 Update Spanish translation 2023-09-21 11:53:29 +00:00
Kristjan SCHMIDT
08b9e899df Update Esperanto translation 2023-09-20 20:38:23 +00:00
Sabri Ünal
c29399314c Update Turkish translation 2023-09-20 19:08:00 +00:00
Jehan
231ca0c505 Issue #9994: do not call g_file_info_get_is_hidden() (and others) directly.
This is not the main reason for the specific output in #9994. These ones are
more probably because of similar usage in GTK (which updated its own calls to
g_file_info_get_is_hidden|backup() in version 3.24.38). But we should likely
also update the various calls we have to use the generic
g_file_info_get_attribute_*() variants.

To be fair, it is unclear to me when we can be sure that an attribute is set.
For instance, when we call g_file_enumerate_children() or g_file_query_info()
with specific attributes, docs say that it is still possible for these
attributes to not be set. So I assume it means we should never use direct
accessor functions.

The only exception is that I didn't remove usage of g_file_info_get_name(),
since its docs says:

> * Gets a display name for a file. This is guaranteed to always be set.

Even though it also says just after:

> * It is an error to call this if the #GFileInfo does not contain
> * %G_FILE_ATTRIBUTE_STANDARD_DISPLAY_NAME.

Which is very contradictory. But assuming that this error warning was
over-zealous documentation, I kept the direct accessors since they are supposed
to be slightly more optimized (still according to in-code documentation) so
let's priorize them when we know they are set for sure.
2023-09-19 15:34:48 +02:00
Alx Sa
d928bd2c93 themes: Define menu checkbox border color
Resolves #10015.

The border color of the menu checkboxes was not
specifically defined by the CSS stylesheet, causing
the boxes to appear invisible when unchecked in
certain system themes. This defines the border color
to the same as the menu text to ensure visibility.
2023-09-19 10:59:28 +00:00
Alx Sa
aa1cce620c themes: Define menu separator color
Resolves #10007.

The menu separator color was not defined in the stylesheet,
so it could vary based on the system stylesheet.
It is now set to @stronger-border-color.
2023-09-19 02:26:27 +00:00
Alx Sa
8653957b96 themes: Define Save Image actionbar border
Resolves #10040.

A System Theme leak could cause a large border to be drawn around
the export options at the bottom of the Save Image dialogue.
This patch defines them specifically as 1px border with the
@strong-border-color CSS styling.
2023-09-18 20:39:16 +00:00
Alx Sa
cb8384e213 themes: Define notebook header border color
Resolves #10000.

The border around notebook headers was not specifically defined in
GIMP's CSS stylesheet, so if the system theme used a different color this
would also change. It has now been defined as @strong-border-color.
The existing CSS was also moved to the same area as the other notebook
header definitions.
2023-09-18 19:32:13 +00:00
Alx Sa
eb1a623728 themes: Fix black border bug in scrolled window viewports
Resolves #10020
For some reason, not having the border-radius CSS style set
in widgets inside scrollwindow viewports causes them to have
a giant black order if they're not a full height. This was previously
fixed for GtkGrids. This patch fixes it for GtkBoxes as well, such as
the Procedure Browser description area.
2023-09-16 18:24:45 +00:00
Martin
04ae1e2d55 Update Slovenian translation 2023-09-15 20:38:25 +00:00
Luming Zh
9fb605db65 Update Chinese (China) translation 2023-09-15 18:26:14 +00:00
Yuri Chornoivan
6a2d782c73 Update Ukrainian translation 2023-09-15 17:28:31 +00:00
bootchk
bfaebccf4e ScriptFu: change binding of resource from string to int
Fix #9991

And change test cases

And fix string-prefix? function in testing framework
2023-09-15 11:02:46 +00:00
Ekaterine Papava
623becd72d Update Georgian translation 2023-09-15 03:46:28 +00:00
Alx Sa
9a15f65a64 core: Improve security of ASE palette loading
Per @Wormnest comment on ACB palette loading,
g_utf16_to_utf8 () now uses the string length rather than -1 to prevent malicious non-NULL terminated strings.
2023-09-14 23:00:07 +00:00
Alx Sa
ab29c4478e core: Add support for Adobe Color Book (ACB) Palettes 2023-09-14 23:00:07 +00:00
Anders Jonsson
6e6f81d23a Update Swedish translation 2023-09-14 22:23:21 +00:00
Luming Zh
030b74ad33 Update Chinese (China) translation 2023-09-14 01:15:19 +00:00
Yuri Chornoivan
32f6c59eca Update Ukrainian translation 2023-09-13 19:02:15 +00:00
Víttor Paulo Vieira da Costa
3c66f4a9fe Update Brazilian Portuguese translation 2023-09-12 17:15:50 +00:00
bootchk
ad78b6d7e6 Remove huge cruft file mistakenly added two commits earlier. 2023-09-12 16:54:59 +00:00
Martin
7fd02806c0 Update Slovenian translation 2023-09-12 16:14:17 +00:00
bootchk
fe0fe3e0bb ScriptFu: extract function marshall_pdb_return
This commit and the ones prior are simple refactoring,
with no intended functional changes.

In anticipation of enhancements 9608 and 8404
which make returned values more scheme like.

Also makes code more readable.
2023-09-12 15:02:15 +00:00
bootchk
d3706a62e3 ScriptFu: add function marshal_PDB_return_by_arity 2023-09-12 15:02:15 +00:00
bootchk
1a8bdf1acc ScriptFu: extract function marshal_pdb_return_values (plural) 2023-09-12 15:02:15 +00:00
bootchk
3e0f37d00a ScriptFu: Extract function marshal_returned_PDB_value 2023-09-12 15:02:15 +00:00
Jehan
e832b73e55 app: fix a few bug in text markup (de)serialization.
- g_str_equal() doesn't have the proper signature for g_slist_find_custom() so
  current code was never processing multiple subfonts in a markup layer text.
- Escape the font name parsed from the XCF. For old XCF format, it could contain
  forbidden characters. And even for new XCF files (with fonts names generated
  such as 'font123' so there should be no escapable characters), we should not
  trust that the XCF/parasite contents is correct. It can be wrong for various
  reasons.
- Search for ' font="%s"', otherwise the search-and-replace might catch other
  XML attributes. For instance we don't want the font "ultrabold" to match
  weight="ultrabold".
- The backward compatibility code didn't have code to stop 2 font name
  replacements to chain up, i.e. if a real world font was named "gimpfont123"
  and another "gimpfont321" and if our replacement code were to change
  "gimpfont123" to "gimpfont321" then "gimpfont321" to something else. In the
  end, we'd have only a single font. I am fixing it by replacing " font=" to
  " gimpfont=" then only correcting the attribute name at the end. This
  intermediate attribute name acts as a "done" flag.
2023-09-12 14:23:40 +00:00
Jehan
ed4c50ce2e app, libgimpconfig: make the code more robust to random text.
There are 3 fixes here:

1. First, searching for "\"GimpFont\"" to determine whether or not this is a new
   format text parasite is not enough, because this string can be found in a
   text layer with "GimpFont" only as contents. It will serialize as:

   > (text "GimpFont")

   Instead search for "(font \"GimpFont\"" which cannot be created as part of
   the text contents because of the unprotected double quotes).

2. We must verify that strstr() did not return NULL when searching for markup
   delimiters. It may happen if the parasite contents is invalid (we must always
   assume it can be, since it's user data).

3. When deserialization of a text from parasite fails (e.g. because parasite
   doesn't actually exist or its format is wrong), still make sure the GimpText
   has a font (setting the standard one before deserializing). Otherwise GIMP
   crashes down the line.

   For this, I also had to fix gimp_config_deserialize_object(): the object type
   name must be parsed even if an object was already set in a GObject property.
2023-09-12 14:23:40 +00:00
Jehan
6d5aaa995f app: new storage format for the text layer parasite implies XCF version bump.
The new parasite format cannot be loaded by old versions of GIMP. This means we
must bump the XCF version (even though technically we didn't really touch the
XCF format itself because text layers are stored in a hackish way, yet text
layers are just too important nowadays to not care).

Nevertheless if an old XCF with text layers was loaded and the text layers left
untouched, the old parasite will be saved back as-is. Therefore no need to bump
the XCF version in this specific case. Only when we created new text layers or
edited existing ones.
2023-09-12 14:23:40 +00:00
Jehan
bd9eb1d8ff meson: requires Pango >= 1.50.
New code uses pango_attribute_as_font_desc() which appeared with Pango 1.50.
Since it's currently present in Debian stable, I don't bother too much and bump
this dependency.

Also let's use the same version for pango, pangocairo and pangoft2. They all
come from the same project/repository, so we must likely expect them to be equal
(if they are not, there is likely a problem).
2023-09-12 14:23:40 +00:00
Jehan
68167ae01b app: fix counting of similar fonts with largest similarity value and a crash.
Previous code was incrementing the similar_fonts count each time we found a
better candidate. So we ended up computing the hash even when we had only 1
candidate with maximum similarity.

Moreover this commit fixes a crash happening with the "standard font". The
lookup name must always be allocated, even when it's an empty string (otherwise
it crashes at free).

Additionally this commit factorizes the code so that gimp_font_get_hash() takes
care of hash computation instead of duplicating code.

Finally I do some code organization.
2023-09-12 14:23:40 +00:00
Idriss Fekir
899dee5926 (De)Serialize fonts in pango markup 2023-09-12 14:23:40 +00:00
Idriss Fekir
7be3f56f5c Serialize GimpFont and fix loading older xcf files
MR #1011 breaks that because now we have a display name
and a lookup name, so font info is saved in the xcf file,
and when loading, the font which matches these info is used.

This doesn't fix pango markup having the wrong fonts names.
2023-09-12 14:23:40 +00:00
Idriss Fekir
a966297498 Port GimpText to GimpFont
In GimpText, The font used to be stored as a string containing its name,
Now, it is stored as a GimpFont object, which makes more sense and makes
operations on fonts easier (such as serialization).
2023-09-12 14:23:40 +00:00
Rafael Fontenelle
b5895aca9a Update Brazilian Portuguese translation 2023-09-12 13:44:20 +00:00
Alx Sa
f5ae105f49 themes: Add border for canvas size in Resize Dialog
Adds a class "gimp-offset-area-frame" to the frame containing a GimpOffsetArea in resize dialogues.
This allows the styling from 2.10 to be applied to indicate canvas size when resizing layers.
Since GimpOffsetArea is a GtkDrawingArea object, it can't have CSS directly
applied to it - that's why the class is added to the frame instead.
2023-09-11 20:07:17 +00:00
Vasil Pupkin
f0f7c0cd2c Update Belarusian translation 2023-09-09 23:05:49 +00:00
Vasil Pupkin
d0d4239e36 Update Belarusian translation 2023-09-09 09:54:48 +00:00
Sabri Ünal
b76947361e Update Turkish translation 2023-09-07 15:33:14 +00:00
Luming Zh
5e399ebd2b Update Chinese (China) translation 2023-09-07 13:48:06 +00:00
dimspingos
cf1dca4347 Updated Greek translation 2023-09-07 16:42:13 +03:00
Sabri Ünal
703be5a103 Update Turkish translation 2023-09-07 10:41:21 +00:00
Sabri Ünal
06e6aa14a3 Update Turkish translation 2023-09-07 10:34:42 +00:00
Martin
d2ea6617da Update Slovenian translation 2023-09-07 07:33:04 +00:00
Alx Sa
a69c7736c2 core: Handle ASE palettes with header padding
This removes any padding the color space label might have originally,
which interfered with g_str_has_prefix ().
2023-09-06 20:15:59 +00:00
Yuri Chornoivan
7372521802 Update Ukrainian translation 2023-09-06 17:43:04 +00:00
lillolollo
ade8cad5d1 gitlab-ci: Windows update python 3.11 2023-09-06 15:08:03 +02:00
bootchk
61c1acbead tinyscheme: enhance: rearrange error msg so error kind is stable prefix
Error kind should be first to read, is most important.

Makes testing error message easier when prefix is stable.
2023-09-06 06:37:29 -04:00
bootchk
14c30f6514 ScriptFu tests: Add some tests and remove hardcoded ID's
Buffer, palette, parasite, unit, context

Also test only a prefix of error message.
2023-09-06 09:53:31 +00:00
dimspingos
6b2cdb3154 Updated Greek translation 2023-09-06 10:24:09 +03:00
Jordi Mas
75033ab6b7 Update Catalan translation 2023-09-06 06:37:42 +02:00
Alx Sa
19050ce7c0 dialog: Use column value from imported palettes
GIMP's .gpl palette format and Swatchbooker's .sbz format can contain
metadata on the number of columns. This value was ignored before;
now the import dialogue checks for this value and uses it.
2023-09-06 01:12:48 +00:00
Alx Sa
6597dabeb3 core: Add support for SwatchBooker palettes 2023-09-06 01:12:48 +00:00
programmer_ceds
9e06e2aa53 Fix Zoom Shortcuts (fixes issue #9797) 2023-09-05 22:35:06 +00:00
Balázs Úr
9c965efd81 Update Hungarian translation 2023-09-05 19:02:16 +00:00
Heiko Becker
8b2574e917 meson: Add explicit options for cfitsio and openmp
...instead of automagically enabling them if the dependency happens
to be installed.
2023-09-03 22:41:04 +02:00
Luming Zh
6f77a661c9 Update Chinese (China) translation 2023-09-03 14:21:47 +00:00
Luming Zh
1d496c8c81 Update Chinese (China) translation 2023-09-03 14:17:02 +00:00
Idriss Fekir
e93e7a124c Improve text quality of UI on Windows
When using the default pangocairo backend (win32),
AA is not enabled.

Switching to the FontConfig backend fixes the problem.
2023-09-02 21:09:06 +00:00
Martin
73ea5464ef Update Slovenian translation 2023-09-02 20:39:08 +00:00
Yuri Chornoivan
e11e21b55d Update Ukrainian translation 2023-09-02 16:26:53 +00:00
Víttor Paulo Vieira da Costa
d812b0d9a6 Update Brazilian Portuguese translation 2023-09-02 13:11:23 +00:00
Víttor Paulo Vieira da Costa
d5805cba34 Update Brazilian Portuguese translation 2023-09-02 13:11:20 +00:00
Víttor Paulo Vieira da Costa
acc4fe982f Update Brazilian Portuguese translation 2023-09-02 13:11:14 +00:00
Alx Sa
531da1560d Issue #30: Add onClick, accesskey, and tabindex tags to Image Map plug-in 2023-09-02 03:30:35 +00:00
Jacob Boerema
b53f7c10e4 libgimp: fix #9902 Critical when calling gimp_text_layer_new ...
from plug-in

I get a critical error when calling gimp_text_layer_new and the function
doesn't return a GimpTextLayer:

(file-psd:47120): LibGimp-CRITICAL **: 16:00:59.035:
gimp_gp_param_to_value: type name GimpTextLayer is not registered

Adding the above line to libgimp/gimp.c fixes the problem.
2023-08-31 21:42:13 +00:00
Sabri Ünal
e425678bcf Update Turkish translation 2023-08-31 18:50:46 +00:00
Sabri Ünal
e22ddb7806 Update Turkish translation 2023-08-31 18:48:39 +00:00
Sabri Ünal
5657feded8 Update Turkish translation 2023-08-31 18:44:03 +00:00
Jehan
459836ee09 Issue #9710: layers borders not properly refreshed.
This was a regression appeared with commit 1b3af8a89b. We still don't want to
flush the whole image, but if the selected layers change, we want to flush the
display shell.
2023-08-31 20:33:31 +02:00
Jehan
79fe90646f NEWS: update. 2023-08-30 17:25:01 +02:00
Alx Sa
caff8dbb7b core: Fix crash when filling with Middle Gray color
Filling with Middle Gray requires getting the image format
for conversion from CIE Lab. This works when filling a layer,
but new images are not yet available in the context.
This adds the image to the context before gimp_drawable_fill ()
is called so it has access to the image format.
2023-08-28 22:42:31 +00:00
Martin
27f18ff872 Update Slovenian translation 2023-08-28 21:55:08 +00:00
Martin
9157211fa4 Update Slovenian translation 2023-08-28 21:53:03 +00:00
Yuri Chornoivan
4d1d8803c4 Update Ukrainian translation 2023-08-28 17:23:30 +00:00
Ekaterine Papava
a04c3cd614 Update Georgian translation 2023-08-28 04:36:54 +00:00
Tim Sabsch
bdf55cd9d4 Update German translation 2023-08-27 20:19:38 +00:00
Alx Sa
38495c7b2d Issue #9901: Add Adobe Swatch Exchange palette import 2023-08-27 16:51:02 +00:00
Piotr Drąg
081b8e65a4 Update Polish translation 2023-08-27 16:23:24 +02:00
Ekaterine Papava
21061bfa31 Update Georgian translation 2023-08-27 14:07:27 +00:00
Martin
63282d00b7 Update Slovenian translation 2023-08-27 05:41:45 +00:00
Martin
793ba32b5b Update Slovenian translation 2023-08-27 05:24:51 +00:00
bootchk
ddbb34f357 Fix #9660 ScriptFu flaws for atoms of type character, UTF-8 encoded
For characters outside ASCII:

1. repr is wrong in REPL

2. sharp constant #\<codepoint> fails to evaluate

3. sharp constant hex #\x<hexdigits> accepts invalid UTF-8 codepoints

4. a call to error with such a character eats the output string

Also, changed the repr of ASCII control characters (was #\x7)
to their unicode repr (now a box glyph with hex)
2023-08-26 18:46:56 +00:00
Yuri Chornoivan
1fddc3b1c4 Update Ukrainian translation 2023-08-26 18:43:35 +00:00
Yuri Chornoivan
2be4b6bf3d Update Ukrainian translation 2023-08-26 18:24:35 +00:00
Boyuan Yang
e28f6fa617 Update Chinese (China) translation 2023-08-26 18:17:49 +00:00
Sabri Ünal
f869a79812 data: add gimpsaveprocedure.c to the POTFILES.in
A leftover from my previous commit: b7ab467cde
2023-08-26 16:26:30 +03:00
Ekaterine Papava
8897574758 Update Georgian translation 2023-08-26 03:47:03 +00:00
Ekaterine Papava
d2ea72e371 Update Georgian translation 2023-08-26 03:41:35 +00:00
Danial Behzadi
e83f150fa3 Update Persian translation 2023-08-25 23:02:32 +00:00
MohammadSaleh Kamyab
50ccf34f8c Update Persian translation 2023-08-25 22:49:46 +00:00
bootchk
2f360ddb34 ScriptFu: #9755 Add test framework and tests for TS and PDB
Test framework and tests in Scheme, and portable.

Work in progress.  Expect commits for more tests.

Testing framework is stable, more or less.

Add more tests

Add tests layer and layerMask.

test Item methods

More tests, selection

Test memory, vector in TS.

More tests char functions

sharp expr tests
2023-08-25 21:39:29 +00:00
Alx Sa
dc50bf0601 menus: Rearrange Help menu
Moves "About Gimp" to end of menu to match common UX.
User Manual is also moved right after the Context Help option as
they are related items.
2023-08-25 21:13:03 +00:00
Sabri Ünal
05b808b095 plug-ins: Mark RAW export dialog related strings translatable
These strings are related to RAW export dialog which
some strings seem not marked as translatable.
2023-08-25 19:41:42 +00:00
Sabri Ünal
5725a3593e plug-ins: Mark PDF/PostScript export dialogs related strings translatable
These strings are related to PDF/PostScript export dialogs which
some strings seem not marked as translatable.
2023-08-25 19:41:42 +00:00
Sabri Ünal
d4146aba5c plug-ins: Mark TIFF export dialog related strings translatable
These strings are related to TIFF export dialog which
some strings seem not marked as translatable.
2023-08-25 19:41:42 +00:00
Sabri Ünal
b7ab467cde plug-ins: Mark JPEG export dialog related strings translatable
These strings are related to JPEG export dialog which
some strings seem not marked as translatable.
2023-08-25 19:41:42 +00:00
Yuri Chornoivan
69abfdbdcc Update Ukrainian translation 2023-08-25 11:52:13 +00:00
Alx Sa
0778b95847 plug-ins: Add support to load PSP ICC Profile data 2023-08-25 02:29:51 +00:00
Timo Jyrinki
05f54698f2 Update Finnish translation 2023-08-24 07:48:18 +00:00
Sabri Ünal
b2979e0534 Update Turkish translation 2023-08-22 20:20:27 +00:00
Sabri Ünal
c0ec541799 Update Turkish translation 2023-08-22 16:35:37 +00:00
Yuri Chornoivan
30c5e40461 Update Ukrainian translation 2023-08-21 19:59:29 +00:00
Jacob Boerema
c9d73e4da7 devel-docs: fix failure to build gir docs
Generating the devel docs fails on Windows because it can't find
Babl-0.1.gir, which is only available for me in GIMP's prefix.

Adding that path with -add-include-path fixes the issue for me.
2023-08-21 16:14:53 +00:00
Idriss Fekir
92f133558a gimptextlayout.c: Fix behaviour of RTL text 2023-08-21 13:21:19 +00:00
Martin
cd0524b383 Update Slovenian translation 2023-08-21 11:39:53 +00:00
Alx Sa
7a971ede15 scripts: Add Table of Contents to User Manual submenu
Resolves #1040.
Adds a [Table of Contents] link that directs users to
ID "gimp-main", the table of contents page.
2023-08-21 02:10:45 +00:00
bootchk
161644fdbc Delete obsolete scripts from 2.99
Moved to gimp-data-extras repo

    erase-rows fix #9885
    grid-system fix #8464
    select-to-brush fix #9878
    select-to-image
    select-to-pattern

Just deleted:

    script-fu-copy-visible fix #9868
2023-08-20 20:44:04 +00:00
bootchk
109f43750c Fix #9874 SF plugin script-fu-set-cmap.scm
New API for GByte to gimp-image-set-colormap
2023-08-20 20:44:04 +00:00
bootchk
7f3595285d Fix #9873 fix SF plugin ripply-anim.scm
Fix new multilayer API in call to to plug-in-tile
2023-08-20 20:44:04 +00:00
bootchk
d934d6d497 Fix #9866 burn-in-anim.scm SF plugin
Fix API change to gimp-image-set-file.
2023-08-20 20:44:04 +00:00
bootchk
8c3d3a5247 Enhance #9532 elide "Script-Fu" from SF plugin dialog title 2023-08-20 20:44:04 +00:00
Daniel Novomeský
8f0e2fd5aa flatpak: remove libjxl
We will use libjxl provided via org.gnome.Sdk//master instead.
2023-08-18 19:39:29 +00:00
Alx Sa
f67ba0d829 libgimpcolor: Remove warnings about uninitialized variables
While `length` is always assigned a value by gimp_color_profile_get_icc_profile (),
some compilers don't recognize this and warn about it being uninitialized.
This assigns six instance of `length` to 0 when declared to remove the warnings.
2023-08-18 10:54:06 +00:00
Alx Sa
0cfdd0a5df plug-ins: Fix crash in Map Palette
Per https://gitlab.gnome.org/GNOME/gimp/-/issues/9875#note_1817995,
the returned value of gimp_context_get_palette () shouldn't be freed in the
calling function.
2023-08-17 11:23:10 +00:00
Timo Jyrinki
491fc3120f Update Finnish translation 2023-08-17 07:58:21 +00:00
Jordi Mas
26454809a7 Update Catalan translation 2023-08-16 19:37:27 +02:00
Alx Sa
64eaed2ad7 modules: Add translation note for Clip warning
Resolves #8207. Adds a note to clarify the purpose of the
Clip Warning color display filter.
2023-08-15 17:09:14 +00:00
Jacob Boerema
40b2412fa4 plug-ins: add synchronization with certain Exif tags.
Exif tags Exif.Image.Artist, Exif.Image.ImageDescription, and
Exif.Image.Copyright were not being synchronized with their Xmp and
Iptc.IIM equivalents in the metadata-editor.

This commit adds synchronization of reading and writing of the metadata.

We adjust the struct for equivalent_metadata_tags by removing unused
fields and adding a field that points to the equivalent Exif tag in
a new struct called exif_tag_info.

On loading of the metadata tags we now also check a limited set of
Exif tags. If no value was set yet, we use the Exif value, or else
we check to make sure both had the same value. If not, print a
warning in the terminal.

On saving of metadata, we now also save to the marked Exif tags, or
if the value is NULL, we remove the tag.

In passing, we also fix two memory leaks by freeing with g_strfreev
temporary string lists.
2023-08-14 17:29:44 -04:00
Jacob Boerema
8495dd6eed plug-ins: improve creation date handling in metadata-editor
Dates in Xmp include a time and timezone, so add a default time when
selecting a date since we can't edit time and timezone yet.

So far, we didn't take into account that IPTC-IIM has separate date
and time+timezone values instead of the combined value in XMP for
DateCreated.

When loading DateCreated check if it has the same value as IPTC
values DateCreated and TimeCreated combined. If not, we show a
terminal error and ignore the IPTC values.
If neither Xmp nor Iptc has a DateCreated, then use Exif.Photo.
DateTimeOriginal combined with OffsetTimeOriginal to set an initial
value.

When saving, synchronize with IPTC-IIM by splitting the DateCreated
value in date and time+timezone and save each to the appropriate tag.
Also make sure that for IPTC-IIM the date separator is a '-'.
2023-08-14 16:50:15 -04:00
Jacob Boerema
83294ba4c7 plug-ins: improve spacing in metadata-editor
Adds a bottom margin to the grids because the horizontal scrollbar
was overlapping the bottom-most row of the grid.
Adds wordwrap and left/right margins to multiline text widgets,
mainly to make the text not start right at the edge of the widget.
2023-08-13 15:15:04 -04:00
Jacob Boerema
b97f96249a plug-ins: Xmp.plus.ImageSupplierName can only have one value
as used in metadata-editor:
Change from MODE_MULTI to MODE_SINGLE.
2023-08-13 15:15:04 -04:00
Jacob Boerema
c633091d54 plug-ins: in metadata-editor use array size constants...
instead of hard-coded numbers.
Also:
- remove unneeded set_tag_string for n_creatorContactInfoTags
- remove now unneeded structs
2023-08-13 15:15:04 -04:00
Jacob Boerema
4e40a3edd2 plug-ins: make mode in metadata-editor an enum
We were using a string for the metadata mode, meaning we had to compare
string values in a lot of places.

We simplify and probably speed-up comparisons here by replacing the
mode string by an enum value.

The only place still needing the string values sometimes is
metadata-impexp.[ch] where we added a conversion table to convert
the mode to a string.
2023-08-13 15:15:03 -04:00
Lukas Oberhuber
5ccac0dd9b macos: Remove DYLD_LIBRARY_PATH
Revert: https://gitlab.gnome.org/GNOME/gimp/-/merge_requests/561
2023-08-13 12:09:14 +00:00
lillolollo
b08602a6f4 libgimpwidgets: hintbox gtk_widget_show update with gtk_widget_set_visible 2023-08-13 12:05:58 +00:00
Stanislav Grinkov
9ab7547607 widgets: initialize TextTag's alpha channel when deserializing markup
Code location and fix found by Massimo Valentini.

Fixes: #6927 (GNOME/Gimp tracker)
2023-08-13 13:40:17 +06:00
Stanislav Grinkov
6947e80b0b icons: add white border to Color theme Dodge icon
Fixes: #9681 (GNOME/Gimp tracker)
2023-08-13 12:18:10 +06:00
Stanislav Grinkov
3f82a57f2d icons: add white border to Legacy Airbrush and Dodge tool icons
Fixes: #9681 (GNOME/Gimp tracker)
2023-08-13 12:18:10 +06:00
Stanislav Grinkov
83f6eec57b app: set the blank font name for the standard font instead of 'Standard'
to fix the issue when 'Standard' can be actual font from the list
or a font which starts with. (ie. Standard Symbols PS)

Fixes: #3104 (GNOME/Gimp tracker)
2023-08-13 12:15:27 +06:00
Luming Zh
e489dc6e53 Update Chinese (China) translation 2023-08-12 19:54:48 +00:00
Luming Zh
eb0c9b04ac Update Chinese (China) translation 2023-08-12 19:53:55 +00:00
Luming Zh
6bccd77e87 Update Chinese (China) translation 2023-08-12 19:52:52 +00:00
Jehan
63076ba342 devel-docs: add URLs to babl and GEGL gi-docgen documentation.
Note that these links are not valid yet. For now, documentations are only in
testing:
* babl: https://testing.developer.gimp.org/api/babl/
* GEGL: https://testing.developer.gimp.org/api/gegl/

The main links will appear next time we merge testing into the main developer
website, or at the next release of GIMP.
2023-08-12 21:09:30 +02:00
Jehan
661009d950 gitlab-ci: generating tarballs for babl and GEGL API reference documentation. 2023-08-12 17:33:54 +02:00
Anders Jonsson
369a7782a1 app, libgimp, libgimpbase: fix gi-docgen rendering 2023-08-12 14:52:52 +00:00
Martin
38b226a558 Update Slovenian translation 2023-08-11 23:22:00 +00:00
Martin
26cb91ddcf Update Slovenian translation 2023-08-11 23:16:41 +00:00
Martin
664de8f311 Update Slovenian translation 2023-08-11 23:13:50 +00:00
Yuri Chornoivan
83130f889b Update Ukrainian translation 2023-08-11 18:47:40 +00:00
Yuri Chornoivan
c9e8b2a120 Update Ukrainian translation 2023-08-11 18:45:12 +00:00
Sabri Ünal
67cd2a60d3 Update Turkish translation 2023-08-11 11:21:30 +00:00
Sabri Ünal
1f24773e0e Update Turkish translation 2023-08-11 11:17:32 +00:00
Sabri Ünal
a460650f75 Update Turkish translation 2023-08-11 11:17:26 +00:00
Sabri Ünal
8a6c385edf Update Turkish translation 2023-08-11 11:17:20 +00:00
Sabri Ünal
af7b3d7e53 Update Turkish translation 2023-08-11 11:15:42 +00:00
Ekaterine Papava
e24974ffc7 Update Georgian translation 2023-08-11 07:35:54 +00:00
Ekaterine Papava
494418f996 Update Georgian translation 2023-08-11 07:30:16 +00:00
Stanislav Grinkov
cbcb477182 core: add FG to Transparent (Hardedge) gradient
Fixes: #9849 (GNOME/Gimp tracker)
2023-08-11 13:01:20 +06:00
Luming Zh
955a890bbc Update Chinese (China) translation 2023-08-11 02:28:35 +00:00
Alx Sa
b459ce95bb plug-ins: Handle single-channel OpenEXR with unknown channel names
OpenEXR allows for arbitrary channel names. Instead of failing once the common ones are checked, this patch 
checks the number of channels in the file.
If there is only one channel, it is treated as 
grayscale (similar to OpenImageIO's behavior).
A debug warning with the channel name is also printed.
2023-08-10 19:37:25 +00:00
Stanislav Grinkov
4465db5223 tools: change text tool behavior when replacing a text
When replacing a selection, take and apply markup (if any)
from the first character of the selection for the entered
text.

This fixes the case when you no longer can change the
global layer text properties after replacing the text.

Also, this changes the behavior introduced in #1220.

Fixes: #7948 (GNOME/Gimp tracker)
2023-08-10 22:23:45 +06:00
lillolollo
4d7c2ab2b9 libgimp: missed break 2023-08-10 15:20:54 +00:00
Jehan
133acb2c99 NEWS: update. 2023-08-10 17:11:36 +02:00
Zander Brown
e00f2b3bf9 play: use GMenu directly 2023-08-10 12:11:01 +00:00
Zander Brown
ddd1a48825 remap: use GMenu directly 2023-08-10 12:11:01 +00:00
Zander Brown
adc7e5331c colourbutton: use GMenu directly 2023-08-10 12:11:01 +00:00
Zander Brown
efabebd0bb help-browser: move menu to XML 2023-08-10 12:11:01 +00:00
Zander Brown
7d1eac18ca ifs: move menu to XML
See: https://gitlab.gnome.org/GNOME/gimp/-/issues/9776
2023-08-10 12:11:01 +00:00
Martin
37220c5dab Update Slovenian translation 2023-08-10 10:55:09 +00:00
Yuri Chornoivan
24694e59c5 Update Ukrainian translation 2023-08-09 18:02:15 +00:00
Alx Sa
8709e91999 plug-ins: Make GFig menus translatable
Based on the IMAP port in !1031, this moves the menu code to a separate file
so that gettext can access it for translation.
2023-08-09 16:17:00 +00:00
Ekaterine Papava
2501807401 Update Georgian translation 2023-08-09 16:13:52 +00:00
Jehan
8a8451750d build: Imath is a dependency of OpenEXR.
Organizing sub-dependencies into modules helps. Later if for instance we need to
remove or change OpenEXR, we know that they are related and that Imath can be
removed if we remove OpenEXR.
2023-08-09 17:21:24 +02:00
lillolollo
8432c555a6 app: silencing warnings in switch statement
See MR !1007.
2023-08-09 15:20:52 +00:00
Zander Brown
3b6ea6f02e imap: generate sources
The targets were just being left floating, and the pre-generated in-tree
source were always used instead

When bison/flex are found, ensure we actually dep on their output - thus
actually running the targets - and only use the in-tree copies as a
fallback
2023-08-09 13:46:56 +00:00
Zander Brown
637385c7d1 imap: move menu to XML
Having it as an inline string doesn't make much sense, and makes it
untranslatable
2023-08-09 13:46:56 +00:00
Jehan
99bb342037 gitlab-ci: further fix the Windows nightly installer.
Continuation of commit 94344bdb46 which was not enough. I just need the full
pipeline from image to Debian GIMP, with dep job too.
2023-08-09 15:25:34 +02:00
mr.fantastic
75d758881d don't allow snapping hidden layers in bbox/equidistance snapping 2023-08-08 15:13:52 +00:00
lillolollo
93b4dbbbcd Update openexr to version 3 2023-08-07 22:45:40 +00:00
Jehan
5c96851431 devel-docs: for the 3.0 series, Win 10 becomes our minimal support.
After discussions on IRC with ender/Jernej and frogonia:

* exchndl.dll (drmingw) requires dbgcore.dll and dbghelp.dll which seem to ship
  with win10+, but not win7 (we don't know for Win8). So for Win7, Jernej had to
  manually add it back (otherwise, building then running on Win10, it looks
  fine, but GIMP fails to start on Win7).
* MSYS2 dropped Win7 support anyway and supports now Win 8.1+.
  See: https://www.msys2.org/docs/windows_support/
  So even though it looks like GIMP works fine on Win7 (after special-casing the
  2 DLLs above by adding them manually in the installed files), there might be
  unforeseen issues in the long run.
* Win7 official support by Microsoft now ended. And Win8 support is soon to be
  (it actually already has, "except for Server 2012 [based on Win8], which's
  supported for another 2 months"). Win8 never had much adoption anyway.
* frogonia confirms they didn't see many Win 7 reports, if at all, in the last
  year.

So based on all these, and in order not to make our life over-complicated, we
drop Win 7/8 support for the next 2.99 versions and for the upcoming stable 3.0
series.

Though we keep support to these versions in the 2.10 series, in order not to
disrupt current usage too much.
2023-08-07 23:52:17 +02:00
Jehan
00dd121ba0 build: sync nightly flatpak manifest with the beta branch on Flathub. 2023-08-07 20:28:46 +02:00
Jehan
342e9b10f6 gitlab-ci: crossroad repository was moved.
Crossroad repo was finally moved to Freedesktop.
See: https://gitlab.freedesktop.org/freedesktop/freedesktop/-/issues/477

This should avoid the too many failures we have lately on TuxFamily
infrastructure (and also gives a proper bug tracker for Crossroad). I am very
thankful to TuxFamily for all these years! :-)
Let's not be said that I moved the repo because I don't like this friendly FLOSS
host anymore. I just needed something different for Crossroad project now.
2023-08-07 15:14:27 +02:00
Jehan
94344bdb46 gitlab-ci: fix the schedule pipeline for our nightly Windows installer.
This should fix:

> 'win-installer-nightly' job needs 'gimp-meson-debian' job, but 'gimp-meson-debian' is not in any previous stage
2023-08-07 14:32:00 +02:00
lillolollo
90cd3de741 Set the bug template as default 2023-08-06 20:45:25 +00:00
Idriss Fekir
89ad3a0ab5 Rename every font in fontconfig, not only the broken ones
Some fonts which pango identifies correctly, became broken
after renaming them in fontconfig, so the strategy was to
rename only fonts which pango can't see.

To check if pango got the correct font, the PangoFont
has to be loaded from PangoContext, which is costly.

It Turns out that querying FontConfig with more attributes
fixes this. Hence renaming every font doesn't affect
the fonts pango already sees.
2023-08-05 23:02:59 +00:00
Idriss Fekir
2b73a5996d Remove code path of not using fontconfig
We use fontconfig directly to rename fonts to fix some issues
with Pango (see MR !1011), and fontconfig is present on all
platforms supported by gimp (even on windows, pango is build with
fontconfig as a dependency), so it makes little sense to keep this
code path which is now never used.
2023-08-05 08:58:44 +01:00
Luming Zh
5c2353660f Update Chinese (China) translation 2023-08-04 20:32:37 +00:00
Luming Zh
9ff6c5c07c Update Chinese (China) translation 2023-08-04 19:49:09 +00:00
Luming Zh
eb6d1b485a Update Chinese (China) translation 2023-08-04 19:47:06 +00:00
Luming Zh
a265c9669a Update Chinese (China) translation 2023-08-02 18:48:19 +00:00
Boyuan Yang
45d644e4b8 Update Chinese (China) translation 2023-08-02 18:16:45 +00:00
Jacob Boerema
72ee6ff469 app: incorrect order of parameters in gimp_channel_select_round_rect
in gimpchannel-select.h
Looking at the version in gimpchannel-select.c, the calls made to it,
and also what is usual, the corner_radius_x should be before
corner_radius_y.

Found looking at the cppcheck logs.
2023-08-02 11:24:43 -04:00
Jacob Boerema
eee763b1c1 plug-ins: fix #9816 file-raw-data.exe Crash
When changing the width we got a division by zero crash because we
did not consider the case of bpp * bitspp being less than 8.

To fix this we check if bitspp is less than 8 and in that case multiply
the amount of bytes by 8 and then divide by the number of bits per
pixel.
2023-07-31 13:58:26 -04:00
Jacob Boerema
df8a349243 app: fix error on Windows with clang
When building using MSYS2 CLANG64 profile using clang 16, we get the
following error (besides other required patches):

../../gimp/app/widgets/gimpwidgets-utils.c:931:12: error: incompatible
pointer to integer conversion returning 'HGDIOBJ' (aka 'void *') from a
function with result type 'guint32' (aka 'unsigned int')
[-Wint-conversion]

For now, let's use the same GPOINTER_TO_INT macro we use in
gimpprogressbar.c. In the end, we need a 64-bit type available to
plug-ins, but that needs more work.
2023-07-31 13:58:26 -04:00
Jacob Boerema
b5be3376a9 ci: remove aalib artifact path
We don't build aalib ourselves anymore since it's now provided by MSYS2,
so this build artifact is obsolete. Let's remove it.
2023-07-31 13:58:26 -04:00
lillolollo
87ed4842b4 Update link to the performance log instructions 2023-07-31 03:46:35 +00:00
Alx Sa
4b54ceb023 plug-ins: Fix lava filter for non-square selections
Resolves issue #9809, fix by @mareroqpoland.
When "Separate Layer" is selected, the entire drawable is always
filled rather than using the selection. This patch uses the selection
instead (which will be "all" if there is no active selection)
2023-07-30 22:24:49 +00:00
Stanislav Grinkov
261eb28eb4 icons: add thin border around color/legacy tool-text icon...
... to make it visible on the dark themes.

Resolves: #9681 (Gitlab GNOME tracker)
2023-07-29 20:47:13 +06:00
Balázs Úr
30afce1cd0 Update Hungarian translation 2023-07-29 06:31:35 +00:00
Balázs Úr
a764bdcc7f Update Hungarian translation 2023-07-29 06:25:55 +00:00
Danial Behzadi
d4d2a09d8a Update Persian translation 2023-07-29 00:41:49 +00:00
Danial Behzadi
248cadcfd8 Update Persian translation 2023-07-29 00:36:28 +00:00
Danial Behzadi
9e72ad0cbb Update Persian translation 2023-07-29 00:33:06 +00:00
Yuri Chornoivan
2c9896506d Update Ukrainian translation 2023-07-28 13:39:26 +00:00
Yuri Chornoivan
37295576b5 Update Ukrainian translation 2023-07-28 13:35:49 +00:00
Martin
c64d7a71e3 Update Slovenian translation 2023-07-28 09:59:19 +00:00
Ekaterine Papava
c42e205efb Update Georgian translation 2023-07-28 03:53:10 +00:00
Jehan
22f120333f Issue #9655: both @blurb and @help arguments should be localized.
Looking further, the @help is only used in gimp_proc_view_new() so far (for the
Procedure Browser) where the blurb and argument descriptions are already
localized. It makes no sense to only keep this in English. So let's ask to have
both arguments translated.

Now clearly we should not ask for @help to be mandatory. Very often, it makes no
sense to have a longer help string (the small blurb and the few arguments may be
very self-explanatory). So I make this argument nullable.

There is only the @help_id which I wonder if we could not have a simpler
function gimp_procedure_set_documentation_uri(). Indeed while having a unified
infrastructure with a XML summary and help IDs and whatelse makes sense for GIMP
as a whole, I think that many third-party plug-ins would work much better with a
very simple direct URL. Or it could even be a GFile to a local file (for
plug-ins which want to embed their documentation in the plug-in folder for
instance). To be continued…
2023-07-27 22:59:51 +02:00
Jehan
ce0a84003c libgimp, libgimpconfig: GimpResource can now be (de)serialized.
I add a new class method deserialize_create() to GimpConfigInterface which
returns the GimpConfig object per deserialization, instead of modifying an
existing bare object.

This matters for cases like our GimpResource (and later our GimpItem) classes
which are fully managed by libgimp and should be unique objects per actual
resource. It should even be possible to compare the pointer itself for identity.
That's why we need to let GimpResource create the object (in reality request it
to the infra and only ref it) through this new class method.

With this commit and the previous ones, all GimpResource are now properly stored
as plug-in settings (e.g. the "film" plug-in has a font setting which is now
properly remembered).

These identifiers are not portable (across various installations and therefore
not for XCF either), but at least they are reasonably identifying data on a same
installation (unlike GimpResource's int ID which is only valid within a single
session) which makes them very fine for plug-in settings storage.

When a data file disappears, we fallback to the context default data instead.
2023-07-27 15:34:45 +02:00
Jehan
38c717b149 app, libgimp, pdb: private _gimp_resource_get_by_identifiers() PDB function.
This finds the core resource knowing its type, name, collection and internal
state (in other words, the values returned by _gimp_resource_get_identifiers()).
2023-07-27 15:32:16 +02:00
Jehan
fe58de7f81 app, libgimp, pdb: new private PDB call _gimp_resource_get_identifiers(). 2023-07-27 15:30:14 +02:00
Jehan
1a9c470b82 app: fix gimp_data_get_identifier() and add a concept of data collection.
The way we were creating a GimpData identifier was simply wrong, because it was
based on the assumption that the source file uniquely identifies a GimpData (cf.
gimp_tagged_get_identifier() which clearly says that the returned string must
uniquely identify this data). The very simple counter-examples for why this is
a mistake to consider a data file to be a good unique identifier are collection
files. For instance, TTC files (TrueType Collection) contain multiple fonts.

Instead I am adding the concept of "collection" with the assumption that
**within a given collection**, data names are unique (I do hope this to be and
stay true). So I add gimp_data_get_identifiers() and gimp_data_identify() to get
identifiers and check for identity.

The collection will use the old implementation of gimp_data_get_identifier()
because it is quite nice to have paths relative to data and config directories
(it allows some cases of data relocation without losing data identification).

The new implementation to compute a GimpTagged identifier on the other hand will
construct a string from the quality of being internal or not, the data name and
its collection.
2023-07-27 15:29:58 +02:00
Jehan
41ed091879 app, libgimp, pdb: add an internal gimp_context_get_resource().
This will be useful in an incoming code to serialize GimpResource PDB arguments.
2023-07-27 15:27:53 +02:00
Jehan
86cbb5232b pdb: fix a typo.
I guess we never use that type nowadays.
2023-07-27 15:27:29 +02:00
Jehan
d439e9ff5c app, libgimp, pdb: factorize a bunch of similar code into gimp_pdb_get_resource().
Rather than reimplementing the same checks for every possible resource data
type, just do it once and redirect to the correct factory container.

For the libgimp API, we leave per-type functions `gimp_*_get_by_name()` (where *
can be brush|gradient|font|palette|pattern so far), but internally they all use
gimp_pdb_get_resource().

Note that eventually we want these functions to return a list of resources as it
should be possible to have several resources of a given type with the same name
(since they are made by third-party who might have had the same idea of a name).
2023-07-27 15:25:32 +02:00
Jehan
ccde23ebaa libgimpconfig: don't break serializing properties if one property serialization…
… fails.

This happens for plug-in settings storage. Serialization stops at first failed
property serialization, whereas we could store more. This feels like the last
settings feature is broken.
2023-07-27 15:24:56 +02:00
Balázs Úr
13dcc85daa Update Hungarian translation 2023-07-26 23:40:40 +00:00
Alx Sa
f947109f92 build: Enable IFF format on Windows
Now that libiff and libilbm have been added to the MSYS2 repositories,
the plug-in can be built automatically on Windows.
2023-07-26 17:12:35 -04:00
Jacob Boerema
43a5b92c65 build: MSYS2 package python3-gobject was replaced by python-gobject 2023-07-26 16:29:22 -04:00
Jehan
b64543caff libgimpwidgets: create proper links in function documentation. 2023-07-26 15:25:39 +02:00
Martin
7b737ecff7 Update Slovenian translation 2023-07-26 08:57:13 +00:00
Martin
18081d1745 Update Slovenian translation 2023-07-26 08:55:42 +00:00
Ekaterine Papava
acc2baa7a6 Update Georgian translation 2023-07-26 03:57:22 +00:00
Ekaterine Papava
3d1325f52a Update Georgian translation 2023-07-26 03:49:57 +00:00
Jehan
269502cfe4 NEWS: update. 2023-07-26 00:53:00 +02:00
programmer-ceds
b84095d7c6 Fix Tools Shortcuts 2023-07-25 21:33:28 +00:00
Anders Jonsson
8b84c5551b plug-ins: add and correct gettext macros in Python 2023-07-25 21:26:57 +00:00
Jehan
21a329dae6 app: nearly all GimpFont object now have an associated file.
(except from the aliases "Sans-serif", "Serif" and "Monospace")

The code to get the file path was inspired by code in MR !1011 by Idriss Fekir.

My initial idea was to use FcFreeTypeQueryAll() when adding each font
individually through FcConfigAppFontAddFile() but we were only doing this for
our additional directories (not the system ones) and also before we actually
loaded all the fonts through FontConfig. So this would have required more work
to get right. Though it also means that now the ! USE_FONTCONFIG_DIRECTLY code
path is more broken than ever (as we consider this path information quite
important for plug-ins now).

Additionally to make this work, I got rid of the code making all GimpFont
objects internal data by default, which is nonsense to begin with. Fonts are not
writable by GIMP, sure, yet they are external to GIMP and loaded from a file!

This will be important for an upcoming commit (which is currently in a branch
related to issues #50 and #9250), where we want to implement GimpResource
storage as plug-in settings, because fonts were the only GimpData without a file
and we are using this information to generate a collection identifier.
2023-07-25 23:10:29 +02:00
Jehan
9f9c0b4ea6 app: GimpFontFactory doesn't force anymore unique font names.
Note that there is a `container_obsolete` too in GimpDataFactory and I don't
apply the "unique-name" property to it because I'm unsure what it is.

Furthermore, eventually we'll want all types of data to allow duplicate names
(brushes, patterns or whatnot may come from all sources and may be named the
same by different people). But for now, let's focus on fonts before breaking
other parts of the codebase which we might not look into right now.
2023-07-25 23:10:26 +02:00
Jehan
0226b3ff5e app: only display the number of ignored fonts (and full listing if…
… the GIMP_DEBUG_FONTS environment variable is set.

Turns out nearly a thousand font files get ignored on my installation (and I
don't install much; a lot of them seem to be bitmap fonts (PCF) in a X11
directory). I still want output so that this topic doesn't get forgotten and
hopefully some day, we can do better. But a single line on stderr (and an
environment variable for details) is enough for now.
2023-07-25 21:16:04 +02:00
Idriss Fekir
5972d8d97f Implement support for custom fonts
Remap font names to unique generated names
so that pango sees them.

keep the font name for display and the internal
name for everything else.

* Fonts are still broken When exporting to pdf

* Not sure if xcf files would be usable on other systems
maybe use hash of psname internally instead

* Not sure if plug-ins using text layer work correctly
(do they use internal font name or the actual name?)
2023-07-25 21:16:04 +02:00
Yuri Chornoivan
d337d2d196 Update Ukrainian translation 2023-07-25 19:04:17 +00:00
Jehan
490cb4ca3a app: rename snap data type to GimpImageSnapData and remove it from core-types.
This is definitely not core type material. Also it's much better in the proper
header gimpimage-snap.h and the type name should reflect the file namespace,
especially as we make it public.
2023-07-25 16:07:06 +02:00
mr.fantastic
a6cf90b208 Support showing distance by view unit in realtime alignment 2023-07-25 15:31:16 +02:00
mr.fantastic
9e793cfe87 Adding on canvas text for equidistance snapping visualization 2023-07-25 15:31:16 +02:00
mr.fantastic
58d85efe75 Adding visuals to snapping by bounding boxes and equidistance
- Avoid conflict between snapping to active point and bbox/alignment snapping
- rearrange bbox snapping calls to give layer center more priority
2023-07-25 15:31:16 +02:00
mr.fantastic
c47f4954ef Adding snapping by equidistance functionality 2023-07-25 15:31:16 +02:00
mr.fantastic
0aa8ac4660 Adding initial support for snapping layers/path_points by layers bounding boxes 2023-07-25 15:31:16 +02:00
Jordi Mas
54728e0fe1 Update Catalan translation 2023-07-25 10:53:09 +02:00
Shubham
a7379664e9 app: Fix extra drawing with airbrush tool on layers with offset
When using airbrush tool, if the layer has a offset, then the offset was
applied to the the coords multiple times creating a series of dots when
holding the airbrush still (from the gimp_airbrush_stamp function).
Fixed this problem by storing the original value of coords before it
gets updated.
2023-07-24 15:55:30 +00:00
Shubham
8463544502 app: fix broken symmetry on offset layers
Painting with symmetry enabled on layers with offset was broken. Fixed
it.
2023-07-24 15:55:30 +00:00
Martin
8f09092ed3 Update Slovenian translation 2023-07-24 10:33:25 +00:00
Idriss Fekir
959426d4ee Fix Font Inline completion not working in some cases
Inline completion is case sensitive, this makes it
broken, because fonts desplayed in the pop should be
quried in a case-insensitive manner.

This fixes #2832.

See gtk issue #275.
2023-07-23 22:29:02 +00:00
psykose
300ce655c3 create_test_env.sh: use sh instead of bash
this is actually a regular sh-portable script, and this prevents needing
bash at build time or for tests (for packaging from tarballs)
2023-07-23 21:06:49 +00:00
Yuri Chornoivan
0485e36cce Update Ukrainian translation 2023-07-23 18:04:04 +00:00
Yuri Chornoivan
690f8ae35e Update Ukrainian translation 2023-07-23 18:02:21 +00:00
Jehan
a7836feed3 NEWS: update. 2023-07-23 18:20:04 +02:00
Ekaterine Papava
c0915480d7 Update Georgian translation 2023-07-23 03:31:45 +00:00
Anders Jonsson
095af5629c extensions: more i18n for goat-exercises 2023-07-22 15:16:42 +00:00
Jehan
ba5b4794e1 libgimp: remove outdated recommendation about sending non-localized strings.
gimp_plug_in_set_translation_domain() was removed in GIMP 2.99.12. Plug-ins are
now fully responsible for their own localization.
2023-07-22 16:17:24 +02:00
Ekaterine Papava
56812b55ce Update Georgian translation 2023-07-22 03:57:00 +00:00
Martin
1c35aa797c Update Slovenian translation 2023-07-21 22:15:08 +00:00
Jacob Boerema
0fb801f7f5 pdb: forgot one case of behavior in previous commit 2023-07-21 17:03:32 -04:00
Jacob Boerema
18408ce966 app, libgimp, libgimpwidgets, plug-ins, etc: rename behaviour to behavior
We use US English which uses behavior. So we replace all occurrences of
behaviour.

Most notable is File Open behavior in preferences. Besides that several
mentions in function documentation and a few in comments.
2023-07-21 15:35:23 -04:00
programmer-ceds
4fa1472e9c Add terminating NULLs to the tools accelerator arrays 2023-07-20 22:59:51 +01:00
Yuri Chornoivan
53239a3ffa Update Ukrainian translation 2023-07-20 16:22:59 +00:00
Yuri Chornoivan
25f14743de Update Ukrainian translation 2023-07-20 15:59:46 +00:00
Martin
6efa8499e1 Update Slovenian translation 2023-07-19 06:33:11 +00:00
Ekaterine Papava
b242365908 Update Georgian translation 2023-07-19 04:17:18 +00:00
Ekaterine Papava
d8ea19fa0e Update Georgian translation 2023-07-19 04:15:28 +00:00
Alx Sa
d1864866ee plug-ins: Support Farbfeld image import/export 2023-07-19 00:37:54 +00:00
Martin
f7c3dee88d Update Slovenian translation 2023-07-18 22:15:58 +00:00
Sabri Ünal
66a5e30d5d menus: Use Header Capitalization in image-menu.ui
Follow Header Capitalization for The "Padding Color" string.

More information: https://developer.gnome.org/hig/guidelines/writing-style.html
2023-07-18 19:08:28 +03:00
Sabri Ünal
84124a9f40 app: Mark two strings as translatable
- Welcome
- Release Notes
2023-07-18 19:07:42 +03:00
Anders Jonsson
21152340c2 Update Esperanto translation 2023-07-18 15:15:02 +00:00
Lukas Oberhuber
c1b4770c40 debug: print stack trace without crashing 2023-07-18 10:24:17 +00:00
Ekaterine Papava
856fa41621 Update Georgian translation 2023-07-18 03:32:58 +00:00
Yuri Chornoivan
8754878dd6 Update Ukrainian translation 2023-07-17 21:08:04 +00:00
Yuri Chornoivan
b7ca157cf4 Update Ukrainian translation 2023-07-17 21:04:26 +00:00
Yuri Chornoivan
8e75c39164 Update Ukrainian translation 2023-07-17 20:57:06 +00:00
Martin
dfe086e88a Update Slovenian translation 2023-07-17 14:49:43 +00:00
Martin
619cb6fe6d Update Slovenian translation 2023-07-17 14:48:12 +00:00
Anders Jonsson
091893ddf5 menus, plug-ins: more tab menu translatability 2023-07-17 10:27:30 +00:00
Alx Sa
48845bdd6f themes: Prevent image tab close button from overflowing...
...the tab itself. Noted by @user062. This adds a right margin to the
close button on the image tabs so that the tab size is pushed out
to fit the button.
2023-07-17 06:43:23 +00:00
Boyuan Yang
9e6946f55e Update Chinese (China) translation 2023-07-16 23:45:39 +00:00
Jehan
b7da9e9cd7 app: fix removing items in GimpMenuModel.
Use the dedicated function rather than comparing strings.

Because of this, menu items for the "windows-display-*" actions were not
destroyed, neither were the relevant images because the proxy menu item was
keeping a reference to the image (for the small in-menu preview in Windows
menu).
2023-07-16 23:55:17 +02:00
Ekaterine Papava
a4afaecf6e Update Georgian translation 2023-07-16 04:53:00 +00:00
Anders Jonsson
87260fb8ac Update Swedish translation 2023-07-15 18:42:02 +00:00
Anders Jonsson
c1a8580215 Update Swedish translation 2023-07-15 18:41:17 +00:00
Anders Jonsson
f8fd1d9175 Update Swedish translation 2023-07-15 18:30:28 +00:00
Anders Jonsson
b9f2e157cb Update Swedish translation 2023-07-15 18:28:52 +00:00
Martin
fc43fe371c Update Slovenian translation 2023-07-15 16:50:35 +00:00
Martin
4396300a0c Update Slovenian translation 2023-07-15 16:49:31 +00:00
Martin
7ec86cd448 Update Slovenian translation 2023-07-15 16:47:57 +00:00
Jehan
42fc27763e menus: forward port 2.10 placeholder names into 3.0 section names.
It's nearly the same list of placeholders which will make it easier to
third-party developers (though format still changed, devs will have to add
square brackets for section names).

Now some section names are missing because we would need to break some list into
smaller sections yet want to avoid having separators everywhere. This makes me
wonder if removing my first placeholder implementation was the right idea.
Anyway this new implementation is cleaner and we should find a way to add
sub-sections without creating separators in menus.

Also I didn't try to add new section names (though I did once or twice, e.g. a
"Close" section around quit/close actions which didn't exist) but eventually we
should. Being able to name logically parts of the menus will make them even more
organized (if we can't name a group of actions, it may mean we didn't think
properly the organization and order).
2023-07-15 16:44:17 +02:00
Anders Jonsson
caff1e61e4 libgimpwidgets, plug-ins: translate dialog buttons
GTK no longer contains stock labels, so the button
labels needed to be marked as translatable.
2023-07-15 14:29:14 +00:00
Alx Sa
9c87aaeebd scripts: Fix warning in Java map tooltip text
Per @ajonsson, gettext does not like < or > used as symbols
and throws a warning. They are replaced with HTML entities
&lt; and &gt; to prevent the problem.
2023-07-15 14:23:01 +00:00
Jehan
dc8ba756e4 app: debug menu and playground should be visible on non-releases stable branch.
These should be hidden on stable releases and shown on unstable branch. But
we'll also want to show these in the stable branch, outside of release
(typically when we'll be at 3.0.1).
2023-07-15 15:06:51 +02:00
Jordi Mas
8d0393bd4d Update Catalan translation 2023-07-15 12:38:36 +02:00
Alx Sa
019c1ba5d9 themes: Remove "corners" around combo-boxes
The combo box button is contained within a box element.
The box was also having its background-color set,
so there were small square "corners" around each dropdown menu.
This patch separates the box color from the button color to prevent
this.
2023-07-15 02:51:41 +00:00
Jehan
e0c8358132 Issue #9322: pass the "hidden-when" attribute in gimp_menu_model_get_item_attributes().
This should hopefully hide (really this time?) the items we don't want to be
seen on macOS menu bar.
2023-07-15 01:37:37 +02:00
Jehan
502944fc02 Issue #9704: radio actions not showing as radio menu items on macOS.
This issue was also happening on other platforms when run with the
GIMP_GTK_MENUBAR codepath.
2023-07-15 01:15:45 +02:00
Jehan
dfdb698ce0 libgimp: update function's documentation. 2023-07-14 17:02:19 +02:00
Jehan
3b05315754 plug-ins: fix the Python test dialog.
With recent changes, a GimpResource's ID is not its name anymore.
2023-07-14 16:59:46 +02:00
Jehan
a964b80ad7 plug-ins: the Python test plug-in should be installed for unstable branch and…
… non-release builds.
2023-07-14 16:45:39 +02:00
Jehan
1b2f229bf6 app: top-level custom menus must be added before the "Windows" menu.
"Windows" and "Help" should always be last. New top-level menus (created by
plug-ins, scripts or GEGL ops) will be appended in the order of creation between
"Filters" and "Windows" menus.
2023-07-14 16:41:55 +02:00
Jehan
0bd3a45757 app: fix hiccups in creation of submenus by plug-ins/filters.
There were some mixups between a few representations of menus:

* "_Some Menu" and "Some Menu" should both map to an existing submenu "Some
  Menu" (in the GimpMenuModel, the stored path doesn't contain mnemonic).
* The menu item on the other hand should contain the mnemonic and not lose it.
* Not only this, but "Some _Menu" should still map to the same menu, even if it
  was already created with a different mnemonic. It means that the first
  registered menmonic "wins", as we don't want duplicate submenus with same
  title (even if they have different mnemonics).

So this new code is better handling the canonical menu path (no mnemonic, no
section name, no double slashes, no trailing slashes, etc.) vs. the
canonical-with-mnemonic menu path to avoid weird duplicates.

Some additional bugs are fixed where we were creating weird empty submenus
containing the same items as the parent menu as well, or when a submenu title
was a perfect prefix of another submenu title at the same level.
2023-07-14 16:21:57 +02:00
Martin
de7c74323f Update Slovenian translation 2023-07-14 09:05:55 +00:00
Martin
6040505563 Update Slovenian translation 2023-07-14 09:04:06 +00:00
Ekaterine Papava
d4e7b25a68 Update Georgian translation 2023-07-14 05:07:26 +00:00
Jehan
982d32e79e menus: hide some menu items on macOS.
File/Quit, Edit/Preferences|Input Devices|Keyboard Shortcuts should not be in
the main menu bar on macOS because they are already in the "app menu".

See #9322.
2023-07-13 23:41:18 +02:00
Jehan
4c1ae49fc9 plug-ins: update the Help/GIMP Online links.
- Remove the wiki which is now dead.
- Update the roadmap link and title it in plural.
- Move the "Bug Reports and Feature Requests" inside "GIMP Online/" submenu.
2023-07-13 23:13:19 +02:00
Anders Jonsson
d99b933243 menus: add missing submenus to image-menu.ui.in.in
This allows for translation and use of accelerators.
2023-07-13 21:30:14 +02:00
Martin
71e217617b Update Slovenian translation 2023-07-13 15:54:21 +00:00
Jehan
c369a5ed70 menus: make all section names non-translatable.
I'm not sure what's the default for random string attribute, but better be
explicit anyway. I think this way, we make sure that gettext won't try and
translate these.
2023-07-13 16:57:23 +02:00
Jehan
b9b1f4c53d app, menus: remove all placeholder code.
This is now fully replaced by the new section name code.
2023-07-13 16:53:11 +02:00
Jehan
9ad5049dec menus, plug-ins: now place various plug-ins in the right menu sections.
This removes a bunch of inconsistencies we had from the before-2.99.16 version
because new items from plug-ins were all added at the bottom of their respective
submenu.
2023-07-13 15:49:05 +02:00
Jehan
d9aa7a6ba1 app: allow a new attribute "section-name" to <section> of menus.
This will replace the "placeholder" concept where I was using an invisible item
with a label and no action, making it invisible. Instead let's just name
(internally) our sections. This has the following advantages:

* Conceptually more correct: basically we just want to place items among the
  same category of actions.
* Easier to search for plug-in developers who'll want to place their plug-in
  procedures in menus, because it uses an actually searchable attribute
  ("section-name").

This is used by the core by allowing a special syntax in menu paths: if finished
by "/[Section]" then the item will be place in the specific section named
"Section". In case one actually wanted to create a submenu called "[Section]",
they can use a double bracket: "[[Section]" and "[[Section]]" will both map to a
normal submenu (not a section name) titled "[Section]".
All other usage of square brackets will not be processed in a particular way.
E.g. "Hello [World]" will end a submenu titled "Hello [World]" or "Bye]" will be
a submenu and so on.

Finally this system is currently limited to the position of the item itself,
i.e. must be placed as last element in the path. In particular, you currently
cannot use it to position a new submenu inside a section. E.g. say that I want
to create a submenu "From Platforms" under the "Open" section of the File/ menu.
This is currently impossible. With this syntax, we can create new items directly
in the "Open" section, or create a "From Platforms" submenu in the end of the
File/ menu, containing our new procedures.
This could be a good improvement to come.
2023-07-13 15:39:50 +02:00
Ekaterine Papava
9efd5fd4f2 Update Georgian translation 2023-07-13 05:04:13 +00:00
Ekaterine Papava
04a39c2ca1 Update Georgian translation 2023-07-13 05:00:50 +00:00
Ekaterine Papava
26683e574a Update Georgian translation 2023-07-13 04:55:50 +00:00
Luming Zh
2e67a21bd7 Update Chinese (China) translation 2023-07-13 00:13:22 +00:00
Alx Sa
ab93a1484a meson: Add option to compile Amiga IFF
Code provided by @lillolollo
Since libilbm and libiff are not in all repositories yet, this adds an option so
it is not required when building GIMP.
2023-07-12 22:55:20 +00:00
Jacob Boerema
b82419305b plug-ins: fix formatting in animation-optimize
A lot of the function calls did not have a space between function name
and opening parenthesis.
2023-07-12 16:45:26 -04:00
Jacob Boerema
5cdfa6e891 plug-ins: fix resource leak in animation-optimize 2023-07-12 16:45:26 -04:00
Jacob Boerema
5f1b0aab87 plug-ins: reduce chance of buffer overflow when copying strings
Sphere-designer: Since some of the strings are translated versions, we
can't know in advance how long they are going to be.
Let's use string copy/cat functions that explicitly check the size and
are guaranteed to add a NULL.
2023-07-12 16:45:26 -04:00
Yuri Chornoivan
35fba13d96 Update Ukrainian translation 2023-07-12 15:07:27 +00:00
Martin
469f1a145c Update Slovenian translation 2023-07-12 14:15:14 +00:00
Anders Jonsson
4239d1af44 plug-ins: uncomment animation-play in POTFILES.in
The animation-play plug-in was readded in
6bb03dc21a

Also remove it from POTFILES.skip together with
curve-bend that already had been reactivated.
2023-07-12 13:22:26 +02:00
Jacob Boerema
6c8625e5fc plugins: fix #8082 XWD file renders incorrectly 2023-07-11 18:26:05 -04:00
Jacob Boerema
ea68d87b66 plug-ins: clean up file-xwd
- Add modern error handling using GError.
- Check return values of fseek and fgetc for errors.
- Remove most occurrences of g(u)long.
- Fixed overflow issue with maxred/green/blue found with coverity.
2023-07-11 18:17:42 -04:00
Jacob Boerema
6484193d8f script-fu: fix out-of-bounds array access
I noticed this in coverity. I couldn't find any actual script using
SF_DISPLAY, so the impact probably isn't very big.
Because the enums start at 0, the size of the array should be at least
one more than the value of the last enum, which was not the case here.

Increase the size of the array by 1, so that accessing SF_DISPLAY,
which is the enum with the highest value, is valid.
2023-07-11 12:04:24 -04:00
Alx Sa
624ae512fc plug-ins: Fix typo in gfig-arc
Resolves #5742.
The check is for a horizontal line (where the Y coordinate
would be the same for all three points), but the X axis was
checked instead due to a copy/paste error.
2023-07-11 15:25:39 +00:00
Jehan
ae29736ee0 app, libgimp, pdb: fix annotations for resources as return values.
Resources are stored by the plug-in infrastructure and their memory should not
be managed by plug-in code.

My commit 4f69995b46 was crappy and modified a generated function. I was just
too tired with all the heat in here, I guess!
2023-07-11 16:16:21 +02:00
Anders Jonsson
30319739ed .gitlab: update link in merge request template 2023-07-11 12:47:12 +00:00
Jehan
4be2dfdee2 devel-docs: our macOS package minimum requirement is now 10.13 (High Sierra). 2023-07-11 14:20:28 +02:00
Jehan
4f69995b46 libgimp: fix annotations for gimp_brush_get_by_name().
Similarly to how we handled image items, all resources are handled and stored by
the plug-in infrastructure and should not be destroyed. This wrong annotation
was triggering bindings to unref resources when going out of scope, hence
crashing plug-ins.
2023-07-11 12:00:22 +02:00
Jehan
d54c511968 plug-ins: use proper gimp_brush_get_by_name().
Note that in the future, we expect this to be possible to create other brushes
with a same name. Maybe we should have a special function allowing to request
core resources (the ones installed by GIMP itself).
2023-07-11 12:00:22 +02:00
Jacob Boerema
d43075dca0 plug-ins: incorrect order of parameters in load_image_resource
Even though these parameters are currently not used here, better use
the correct order.
2023-07-10 17:50:08 -04:00
Jacob Boerema
63bb893c06 plug-ins: fix resource leak in psd-load
Adding unsupported messages was overwriting the old message without
first freeing it. In addition, the first message was initialized
as a string constant.
We now start with duplicating the (empty) string, so that it can be
freed. We then add a define to reduce boilerplate to add the string
for each unsupported feature. The code in this define takes care of
adding the new message and freeing the old message.
2023-07-10 17:50:08 -04:00
Martin
a9f642322d Update Slovenian translation 2023-07-10 20:44:12 +00:00
Yuri Chornoivan
c7d32f37c6 Update Ukrainian translation 2023-07-10 19:44:56 +00:00
Jacob Boerema
bbbd149ba3 plug-ins: fix possible integer overflow on large images in jigsaw
Make sure we use gsize for intermediate results to not get integer
overflow on large image sizes.
This still is not ideal, but better than a crash, since we may (try to)
allocate a very large block of memory, which we should eventually fix
by looping over smaller size buffers.
2023-07-10 14:19:07 -04:00
Jacob Boerema
97a71cfd41 libgimp: fix resource leak in gimpimagemetadata-save 2023-07-10 14:19:07 -04:00
Ekaterine Papava
8febbf9da8 Update Georgian translation 2023-07-10 17:08:06 +00:00
Jacob Boerema
03e32e6fd3 app, pdb: silence coverity warning about integer overflow
Brushes can't be large enough to actually cause overflow here, but
since the result is gsize, it can't hurt to have the intermediate
results to gsize too.
2023-07-10 12:30:24 -04:00
Jacob Boerema
5645abc051 plug-ins: fix meson deprecated warning for file-icns 2023-07-10 12:30:24 -04:00
Anders Jonsson
44108eb9c3 app: make debug menu translatable 2023-07-10 14:58:49 +00:00
Jehan
e6ccea7c39 app: verify that the GimpUIManager exists.
Though I didn't encounter this bug in my commit 54b22c717a, 2 unit tests are now
failing with:

> Bail out! Gimp-Widgets-FATAL-CRITICAL: gimp_ui_manager_update: assertion 'GIMP_IS_UI_MANAGER (manager)' failed

I am assuming this is a consequence of this code I just changed.
2023-07-10 16:58:15 +02:00
Martin
82b1fd6c2e Update Slovenian translation 2023-07-10 13:56:48 +00:00
Jehan
4ddf6ae8f6 Issue #9725: top menus and sub menu not translated.
Adding 2 missing .ui files.
2023-07-10 12:11:34 +02:00
Jehan
54b22c717a app: make sure gimp_ui_manager_update() is run from the main thread.
This GTK widget code could be reach from a thread calling gimp_image_flush().
Yet all GUI-related code must happen in the main thread (also even though
actions are not GTK code anymore, they can trigger GUI updates).

No issue happened from this so far (that we know of), but a trace by SBDaule for
their growing layer project showed that we'd reach this code if calling
gimp_image_flush() from the paint thread.
2023-07-09 23:24:07 +02:00
Jehan
e465e867c1 NEWS: typo fix. 2023-07-09 22:21:00 +02:00
Jehan
760e912d20 INSTALL: add some packages in the optional packages list. 2023-07-09 13:32:51 +02:00
Niels De Graef
ed1ad72255 pdb: Fix size in gimp_image_get_colormap
It looks like we left out the multiplication by 3 when passing the
colormap size to get to the number of bytes in commit 89c359ce

This fixes a crash when saving an XPM file

Fixes: https://gitlab.gnome.org/GNOME/gimp/-/issues/9711
2023-07-08 23:08:54 +02:00
Alx Sa
b9e49a3fd9 tools: Fix hiding on-canvas text editor
After 59cb3e36, the GimpOverlayFrame that contains
the on-canvas text editor is still partially visible as a dot.
This patch now hides and shows that as well based on
the "Show On-Canvas Editor" option.
2023-07-07 23:11:22 +00:00
Alx Sa
69ddbeba29 themes: Hide 1/0 labels on GtkSwitch sliders
Resolves #9676.
Per @pixelmixer and @programmer_ceds's research,
setting the color attribute on the switch's image children
removes the 1/0 labels on non-System themes.
2023-07-07 18:56:34 +00:00
Jehan
2c608168a2 plug-ins: don't use Tabs indentation, only space.
This was introduced in commit 95fa902827. Unfortunately Gitlab web UI is really
not good at showing indentation issues (or any other space coding style issues,
for that matter).
2023-07-07 17:38:23 +02:00
Luming Zh
13dd829335 Update Chinese (China) translation 2023-07-07 12:13:43 +00:00
Luming Zh
b18894ccfd Update Chinese (China) translation 2023-07-07 12:09:41 +00:00
Jehan
1319523de7 app: no need to show the "Merge menu and title bar" option on macOS.
This doesn't do anything in this case, so better hide the settings.
2023-07-07 13:51:29 +02:00
Jehan
6d2580a421 meson.build: post-release version bump to 2.99.17. 2023-07-05 18:09:54 +02:00
Jehan
d3c5536ac8 Release development version GIMP 2.99.16. 2023-07-05 16:00:47 +02:00
Jehan
74fee1a957 desktop: update release date (to today) in AppStream file. 2023-07-05 15:57:24 +02:00
Jehan
18e47a29e0 NEWS: last update (this time really!) before GIMP 2.99.16 release. 2023-07-05 15:49:33 +02:00
Jordi Mas
daa19fc2db Update Catalan translation 2023-07-05 14:00:59 +02:00
Jehan
1b3af8a89b Issue #9648: don't flush the image when selecting items.
This results in an infinite loop and there is no change done, so no reason to
flush anything. Mitch had a fix for this (probably the same, per the IRC
discussion), but I really wanted to just release GIMP 2.99.16. So Mitch, if you
read this, sorry for not waiting for you to push this one!
2023-07-04 22:10:40 +02:00
Jehan
c95b8518fe app, icons: use the Python executable found by pythonmod.find_installation().
We already search for a compatible Python version in the root meson file, no
need to look up Python 3 again in the PATH, each time we run an external Python
script in the build.

This should hopefully fix #9687.
2023-07-04 19:00:55 +02:00
Jordi Mas
95fa902827 Specify no format to prevent the % to be interpreted as formatter by the gettext toolchain 2023-07-04 14:39:11 +02:00
Jordi Mas
ca404795e3 Update Catalan translation 2023-07-04 12:42:58 +02:00
Lukas Oberhuber
df4ed9c1ec app: Fix key presses not working on mac
Part fixes #9322. This was making GIMP on MacOS unusable.
2023-07-02 15:57:44 +01:00
Jordi Mas
780cda6f72 Update Catalan translation 2023-07-02 07:40:17 +02:00
Alexandre Prokoudine
df9a7f9ca1 Update Russian translation 2023-07-02 02:19:29 +02:00
Jehan
274b734e61 libgimp: fix double free crash in gimp_drawable_get_thumbnail(). 2023-07-01 23:24:33 +02:00
Jehan
8e4850dafe build: fix (hopefully) lua in the Windows installer.
See: https://gitlab.gnome.org/GNOME/gimp/-/issues/9653#note_1780587

Looking at MSYS2 logs, it looks like they very recently "fixed" the search paths
for lua files, which in turn broke our workaround (searching in subdirectories
of bin/ instead of share/ and lib/).

This should work better (though untested) with the workaround removed now.

Commit on luajit package at MSYS2:
703c7bae2f
2023-07-01 22:12:13 +02:00
Yuri Chornoivan
e32a67d948 Update Ukrainian translation 2023-07-01 20:06:36 +00:00
Yuri Chornoivan
1a23fc5e9a Update Ukrainian translation 2023-07-01 20:04:25 +00:00
Martin
1186a5dbcc Update Slovenian translation 2023-07-01 18:56:32 +00:00
Marco Ciampa
53f929dc9c Updated Italian translation 2023-07-01 12:00:38 +02:00
Marco Ciampa
95c141007c Updated Italian translation 2023-07-01 11:50:57 +02:00
Asier Sarasua Garmendia
7219245bfb Update Basque translation 2023-07-01 09:23:11 +00:00
Anders Jonsson
f8aa50204f Update Swedish translation 2023-07-01 09:13:23 +00:00
Ekaterine Papava
16a921da37 Update Georgian translation 2023-07-01 06:09:22 +00:00
Jacob Boerema
9038fd2c13 libgimpwidgets: issue #9673 screenshot plug-in crashes
In commit 48c27770 some unicode related changes were made. As a result of
that on Windows display_device, which was previously a duplicated string,
is now referenced directly.
However, the g_free was not removed, causing a crash.

We resolve this by removing the obsolete g_free.
2023-06-30 17:43:39 -04:00
Alx Sa
d68c7f612f plug-ins: Clarify JPEG subsampling option labels
Resolves #5525.
"4:4:0" is the more well-known term rather than "4:2:2 vertical" for this subsampling option.
2023-06-30 17:28:52 +00:00
Jehan
c21dbc8a20 tools: better support of using --runtime with --beta or --nightly. 2023-06-30 18:35:06 +02:00
Anders Jonsson
ba2b7550f7 Update Swedish translation 2023-06-30 16:26:03 +00:00
Alx Sa
3cf5a587ce plug-ins: Match RGB FITS orientation to SiriL
Switching to the cfitsio library's fits_read_img () function in 03ea666f 
caused RGB FITS images to be read in upside down per SiriL developers and
NASA standards (odd, since cfitsio is maintained by NASA). This flips them back.
2023-06-30 16:01:39 +00:00
Martin
71fa32424c Update Slovenian translation 2023-06-30 15:59:48 +00:00
Jacob Boerema
14cce79d16 app: use hyphen for the precision settings in Encoding submenu
The Microsoft style guide and other places online suggest that using a
hyphen is recommended between a number and the related word, when modifying
a noun, so let's do that in our Image -> Encoding submenu too.
2023-06-30 11:37:19 -04:00
Martin
3d7fa18c6d Update Slovenian translation 2023-06-30 15:29:06 +00:00
Martin
7f08ad4d76 Update Slovenian translation 2023-06-30 15:27:44 +00:00
Martin
7521c3dd70 Update Slovenian translation 2023-06-30 15:26:24 +00:00
Anders Jonsson
fee62e2b05 NEWS: Typo fixes 2023-06-30 12:21:09 +02:00
Asier Sarasua Garmendia
27acf41699 Update Basque translation 2023-06-30 08:01:45 +00:00
Alx Sa
03ea666fc8 plug-ins: Fix regression on importing RGB FITS
The developers of SiriL sent me some RGB FITS images that rendered incorrectly
after d4f42076. These must be read in as 
planes rather than individual rows.
2023-06-29 15:31:50 +00:00
Jehan
84fb879973 NEWS: possibly finale update before 2.99.16 release. 2023-06-29 12:13:33 +02:00
Jehan
e1203e9f76 gitlab-ci, build: create Windows installer files with the Linux build.
The creation of the BMP welcome images for the Windows installer (part of
-Dwindows-installer=true build option) fails in the Windows job. After much
debugging, I could run GIMP, yet it was not enough. One of my hypothesis so far
is that the environment variables for DLLs won't work, since all the DLLs must
be in the same directory as the main binary (though with the WSL thing, I am
unsure, maybe it is still supposed to work), which only happens once GIMP is
installed. So GIMP runs successfully but not plug-ins.

Anyway I wasted too much time working on this and without a local Windows, it
just takes too long (mostly testing thanks to the CI) and is frustrating. Let's
just move to building both the localization files and the images on the main
Debian job (gimp-meson-debian), then use these as dependencies of the
win-installer-nightly job, i.e. when building the installer.
2023-06-29 00:21:44 +02:00
Jehan
8db25f2246 build: prepend in case the environment variable already exists.
The common order logic for list of directories in environment variables is that
left paths have precedence. This is at least the case for LD_LIBRARY_PATH (and
probably GI_TYPELIB_PATH too).
Make sure that our local libraries and introspected binaries (in the build
directory) are used and not any version installed on the system or by previous
`ninja install` calls.
2023-06-29 00:21:29 +02:00
Jehan
757adf94bb app: do not load images interactively when we have no interface.
This includes both cases when running gimp-console or running GUI gimp with
--no-interface option.
2023-06-29 00:09:28 +02:00
Jehan
2825fa67e0 build: build images with gimp-console if available.
This was a first attempt at fixing this error on the CI:

> Cannot open display:

Though it was not enough (see next commit calling plug-ins as non-interactive
when called without interface), it is still a useful change overall.
2023-06-29 00:09:28 +02:00
Jehan
9d03cdd9ae build: remove test on now-removed Makefile.am for lang list consistency. 2023-06-29 00:09:28 +02:00
Jehan
f5001a4c8c plug-ins: we must output the dummy file in the same directory. 2023-06-29 00:09:28 +02:00
Alexandre Prokoudine
05b06b1c8d Update Russian translation 2023-06-28 02:00:26 +02:00
Jacob Boerema
f65d8e8730 app: silence warning in gimpimage-convert-indexed
We had the following warning:
In function 'make_remap_table',
    inlined from 'gimp_image_convert_indexed' at
  ../../gimp/app/core/gimpimage-convert-indexed.c:1057:7:
D:/msys64/mingw64/include/glib-2.0/glib/gmem.h:261:19: warning: argument 1
 range [18446744071562067968, 18446744073709551615] exceeds maximum object
 size 9223372036854775807 [-Walloc-size-larger-than=]

This is apparently caused by inlining in combination with using a signed
int.
See also: https://gcc.gnu.org/bugzilla//show_bug.cgi?id=85783

Casting to (guint) silences the warning here.
2023-06-27 14:15:34 -04:00
Alexandre Prokoudine
0c453edc78 Update Russian translation 2023-06-27 19:21:14 +02:00
Jehan
9e9fe1435a build, plug-ins, gitlab: make GIMP runnable from build directory without…
… being installed.

There is already most of the main code logic for this, though now plug-ins need
to be in their own subdirectories, which breaks for plug-ins/common/ and
plug-ins/python/, while I needed plug-ins in both these categories to generate
the Windows installer welcome images (file-png, and python-fu-eval in
particular).

Once again, meson was not very helpful, since all its functions still refuse to
output generated files in subdirectories, so I end up duplicating plug-in files
with a custom Python script.

This should fix the CI. It was working on my machine as GIMP was installed, but
such a build rule should work even without GIMP installed.
This will also be useful in the future when we'll want to run unit tests of
plug-ins through the finale GIMP binary itself.
2023-06-27 17:46:46 +02:00
Jehan
9ccdd56a36 build: run build/windows/meson.build before app/ plug-ins/ and extensions/.
Fixes:

> ../extensions/goat-exercises/meson.build:12:4: ERROR: Unknown variable "gimp_plugins_rc".
2023-06-27 01:01:50 +02:00
Jehan
2fd25fe6bd build: generate the Windows installer welcome images from the splash screen.
After discussion with Jernej, InnoSetup should now work better with rescaling
a big image properly to the window size, yet the ratio should still matter.
Apparently the welcome image is a hack and this is why it requires specific
ratio images. We don't use the big size yet, but since Jernej told me which
dimensions are expected, I already added the code for it to make it easier
later.

So anyway this code would allow us not to have to commit welcome images each
time, which are basically resized copy in BMP of the splash screen, slowly yet
surely filling up our repository with image duplicates.
After all, we develop a scriptable image editor! We should use it to edit images
and export in expected formats!

I only use this script for the devel installer for now, for testing and see how
it goes.
2023-06-27 00:39:17 +02:00
Yuri Chornoivan
8676907c6d Update Ukrainian translation 2023-06-26 18:58:17 +00:00
Yuri Chornoivan
3dadf8899a Update Ukrainian translation 2023-06-26 18:56:47 +00:00
Jehan
2696372680 build: add missing dependencies in packaging script.
While some packages may be needed only when building (and others only when
packaging), we should probably have a shared list of packages needed for both
steps so that we avoid discrepancies which lead to missing libraries in our
installer.

See: https://gitlab.gnome.org/GNOME/gimp/-/issues/9653#note_1777596
2023-06-26 19:27:59 +02:00
Anders Jonsson
0c464718b4 Update Swedish translation 2023-06-26 17:26:01 +00:00
Daniel Novomeský
a4f0239818 plug-ins: support libjxl v0.9 decoding API 2023-06-26 16:41:05 +02:00
Alx Sa
8a53b7c219 widgets: Fix compiler warning in gimpcontainerview
Initialize "border" to 0 to remove a warning that
"'border' may be used uninitialized"
2023-06-26 14:12:42 +00:00
Alexandre Franke
7f74ff976e Update French translation 2023-06-26 08:56:03 +00:00
Jehan
71e25a1ac1 NEWS: update. 2023-06-26 02:41:01 +02:00
Jehan
3cb43bef93 app: localize GEGL filter's action default short label template.
Even though it's just for 3 dots, this may actually be formatted differently in
different languages. Let's not assume we all share this punctuation mark.
2023-06-26 02:19:26 +02:00
Øyvind Kolås
7277baea54 meson,app: depend on GEGL-0.4.46 2023-06-26 00:56:58 +02:00
Niels De Graef
26f967e998 app: update relevant comments about Wayland hotspot 2023-06-25 22:21:37 +00:00
依云
edfded372d app: don't scale hotspot in Wayland
The hotspot coords are in the cairo surface's coords space, and the
cairo surface has half the size as the x2 pixbuf because of scale=2,
which makes the hotspot coords remain the same.

With regard to the referred code snippet in the comment[1], the coords
have been scaled in gdk_cursor_new_from_surface.

This fixes https://gitlab.gnome.org/GNOME/gimp/-/issues/9047.

[1]: https://gitlab.gnome.org/GNOME/gimp/-/merge_requests/545#note_1388777
2023-06-25 22:21:37 +00:00
Jehan
6a9838c804 plug-ins: fix build warnings.
Fixes several missing declaration warnings because in fact of missing include,
such as:

> warning: no previous declaration for ‘console_editor_new’ [-Wmissing-declarations]

Fixes 2 old-style definitions:

> warning: old-style function definition [-Wold-style-definition]
2023-06-25 23:43:40 +02:00
Alexander Shopov
f0ab126563 Update Bulgarian translation 2023-06-25 19:45:54 +00:00
Anders Jonsson
eb25374670 Update Swedish translation 2023-06-25 19:38:34 +00:00
bootchk
7b9b5db69e SF Console history persist as GStrv setting.
Other driveby format and wording changes to dialog title, welcome text.

Part of issue 9579 SF roadmap
2023-06-25 18:28:03 +00:00
lillolollo
691ec70c0e Eliminate warning: ‘gimp_unique_dbus_open’ defined but not used [-Wunused-function] 2023-06-25 18:01:45 +00:00
Jehan
23a87ce4e3 Issue #9350: fix GimpMenu separator lines being randomly thick (other case).
The previous commit did fix one such reason (multiple separators next to each
other), but I realized there is one other case where single separators are just
too big: when the menu is embedded in a GtkHeaderBar, each separator would have
a weird margin of several pixels (at least in my case, probably taken from the
underlying system theme). And worse, this margin was using another background
color.

So anyway this CSS rules takes care of not adding weird margins to menu
separators.
2023-06-25 19:28:54 +02:00
Anders Jonsson
c6240a2002 Update Swedish translation 2023-06-25 17:25:43 +00:00
Jehan
ff91a0ac3d Issue #9350: fix GimpMenu separator lines being randomly thick. 2023-06-25 19:04:37 +02:00
Yuri Chornoivan
5eaec7edf1 Update Ukrainian translation 2023-06-25 13:43:57 +00:00
Yuri Chornoivan
aae7d2f16a Update Ukrainian translation 2023-06-25 13:40:56 +00:00
Anders Jonsson
f6b0f7a50b Update Swedish translation 2023-06-25 13:00:01 +00:00
Anders Jonsson
fa04370cd1 Update Swedish translation 2023-06-25 10:33:35 +00:00
Jordi Mas
fb186a9846 Update Catalan translation 2023-06-25 09:40:32 +02:00
Ekaterine Papava
f3aaf876df Update Georgian translation 2023-06-25 07:22:33 +00:00
Martin
83c8cdaee9 Update Slovenian translation 2023-06-24 22:25:54 +00:00
Alx Sa
ca3c709d56 core: Add color/pattern only fill options
Resolves issue with #8461.
This provides a conditional value for the fill options to only show
a color and pattern, rather than fore/background colors.
Currently only used for the text editor.
2023-06-24 19:42:58 +00:00
Martin
fad2ab33fa Update Slovenian translation 2023-06-24 19:20:37 +00:00
Jehan
5bf0ece215 app: fix build warning.
Though not a bug, this change will get rid of the following warning:

> app/dialogs/module-dialog.c:291:28: warning: ‘location’ may be used uninitialized in this function [-Wmaybe-uninitialized]
>   291 |       text[INFO_LOCATION]  = gimp_module_is_on_disk (module) ?
2023-06-24 18:42:44 +02:00
Alexander Shopov
6b6928192c Update Bulgarian translation 2023-06-24 09:04:22 +00:00
Martin
b43a7f5635 Update Slovenian translation 2023-06-23 21:18:56 +00:00
Alx Sa
280cde75f4 plug-ins: Port checkerboard to...
...GimpProcedureDialog
2023-06-23 14:13:29 +00:00
Alexander Shopov
d910d733e4 Update Bulgarian translation 2023-06-23 08:10:05 +00:00
Ekaterine Papava
6d346701cd Update Georgian translation 2023-06-23 03:28:15 +00:00
Jehan
aecf22defb libgimpwidgets: fix the non-resizing combo-box popup when switching from short…
… to long format of unit names.

We can clearly see that the main part of the widget is correctly resized but not
the popup. Unfortunately we don't have access to the popup widget which is
private data, so the best workaround I found so far was to pop the menu down and
up, which basically provokes a redraw to the correct size after contents change.

This fixes MR !385.
2023-06-23 00:46:20 +02:00
Venkatesh
dc3eb3b340 MR !385: resolve "GimpUnitComboBox doesn't show full unit names in 2.99" 2023-06-22 22:38:25 +00:00
Jehan
8ef8ac58aa app: fix crash when loading a XCF containing a text layer with pattern outline.
There was a bug in commit ca6b58e970 which went under the radar. The gimp
variable was not set at creation, so this line was crashing:

> container = gimp_data_factory_get_container (text->gimp->pattern_factory);
2023-06-22 22:23:05 +02:00
Jehan
cdc9fa9907 app: migrated (style solid) in gimprc.
Since MR !706, (style solid) doesn't exist anymore which makes gimprc parsing
fails (hence losing configuration).

This fixes:

> Gimp-Config-Message: 21:20:21.018: Error while parsing '/home/jehan/.config/GIMP/2.99/gimprc' in line 18: invalid value 'solid' for token style
> Gimp-Config-Message: 21:20:21.018: There was an error parsing your 'gimprc' file. Default values will be used. A backup of your configuration has been created at '/home/jehan/.config/GIMP/2.99/gimprc~'.
2023-06-22 21:30:13 +02:00
Alx Sa
ce6f7179ab core: Replace "Solid Colors" with "FG/BG Colors"
Replaces "Solid Colors" option in Fill Path with Foreground/Background
Colors options. This allows users to fill with either, rather than
having to switch the foreground color each time.
GIMP_CONTEXT_PROP_MASK_BACKGROUND was added to the fill and stroke
contexts to allow the background color to be recognized.
In places where Solid Color was used as a default, Foreground Color is
now used instead.
2023-06-22 18:46:14 +00:00
Ekaterine Papava
809713512d Update Georgian translation 2023-06-22 06:37:40 +00:00
Ekaterine Papava
2480de96fa Update Georgian translation 2023-06-22 06:31:29 +00:00
bootchk
ef662fa02a libgimp: fix #9304 API TextLayer
Adds needed change missing in commit that added class GimpTextLayer
2023-06-21 21:54:04 +00:00
Andras Timar
da0ea189fc Make transform matrix selectable
In our use case it is necessary to save the transform matrix, and the
easiest solution is to make the label selectable. If we print the
whole matrix into a single label, formatted with tabs and linefeeds,
then the whole matrix can be copied with a single operation.
2023-06-21 21:02:23 +00:00
Alx Sa
59cb3e36e1 app: Toggle on-canvas text editor visibility
This adds a new boolean to text options, "Show on-canvas editor".
When toggled, it immediately hides (or re-shows) the current
text layer's on-canvas text editor.
It uses the same signal and function as the "use-editor" property.
2023-06-21 20:17:27 +00:00
Jehan
b48ce94e6a app: replace g_action_map_lookup_action() by gimp_ui_manager_find_action().
With more recent logic, not all actions are inside the application's action map.
We need to look up actions in our GimpUIManager.
This fixes failing to find the actions with the "text-editor." prefix (in the
text tool editor's toolbar).
2023-06-21 22:17:09 +02:00
Alx Sa
01d7e7a992 actions: Fix "Raise or Open" to actually raise
Resolves #9636.
gimp_object_get_name (gimp_display_get_image (display)) returns NULL 
instead of the filename. documents_raise_display was changed to call 
gimp_image_get_imported_file () or gimp_image_get_file() instead to 
get the actual filename.
2023-06-21 20:10:12 +00:00
Jehan
a580f47e22 plug-ins: fix previous commit (!901).
Config string properties are allocated. We can't use static strings.

Also fixing an unused variable (mesg_body) warning.
2023-06-21 21:38:36 +02:00
Alx Sa
51cf74c036 plug-ins: Port mail to GimpProcedureDialog 2023-06-21 19:36:28 +00:00
Alx Sa
e152591e80 plug-ins: Don't run Depth-Merge when cancelled.
When porting depth-merge to GimpPlugin in 5154b271 the return statements
were not fully replicated. As a result, the depth-merge function was 
called even if the dialogue had been cancelled.
This patch adds the missing return statements to prevent this.
2023-06-21 19:01:32 +00:00
Jehan
2541389b0c plug-ins: don't use a hardcoded 256 as max border.
Half of the smaller dimension seem a better value, since once we reach any half,
it means we will compute using all pixels anyway. Any width higher than this is
useless.
2023-06-21 17:33:04 +02:00
Alx Sa
2baa518a30 libgimpwidgets: Don't call scaled digits on pixels
Adds a check to cast resolution to an int if units are pixels,
rather than calling gimp_unit_get_scaled_digits().
This prevents a LibGimp-CRITICAL about "_gimp_unit_cache_get_digits: 
assertion 'unit >= GIMP_UNIT_INCH' failed"
2023-06-21 14:05:19 +00:00
Alx Sa
519b627f5d plug-ins: Port border-average to...
...GimpProcedureDialog.
Also provides an example of the new 
gimp_procedure_dialog_get_size_entry () API.
2023-06-21 14:05:19 +00:00
Alx Sa
6be4549e46 libgimp: new gimp_procedure_get_size_entry ()
This allows plug-in developers to create GimpSizeEntry
widgets with the procedure dialog API.
2023-06-21 14:05:19 +00:00
Jehan
4136166d12 libgimp: fix gimp_drawable_get_sub_thumbnail_data().
Since commit 89c359ce47, it's supposed to return a GBytes, yet it was returning
raw data (probably intermediate hacking state which was not properly cleaned
up).

It was crashing for instance GimpDrawablePreview widgets at drawing time.
2023-06-21 00:12:20 +02:00
Alx Sa
4b8f2113f3 pdb: Fix datatype mismatch created by 2a946712 2023-06-20 17:03:21 +00:00
Alx Sa
2a94671269 pdb: Allow ripple to take floating point inputs
Partially resolves #7211.
plug-in-ripple is a wrapper for the GEGL ripple effect. GEGL allows for
double values for period and amplitude, while the GIMP PDB only allows 
integers. This patch aligns the datatypes.
Note that Angle and Phi are still limited to the current design.
2023-06-20 15:27:10 +00:00
bootchk
57909356ff Implement #9628 enhanced err msg for mismatched parens 2023-06-20 07:39:26 -04:00
bootchk
1bc2ed77a3 Fix #9554 (quit 1) must yield err msg
So that scripts have a way to declare an error.
2023-06-20 11:14:13 +00:00
Alexander Shopov
12a84988ed Update Bulgarian translation 2023-06-20 11:01:33 +00:00
Jordi Mas
a09609bb76 Removes spaces at the end of string and Compuserve company name which is not relevant in 2023 2023-06-19 20:47:51 +00:00
Jordi Mas
bb468d1f90 Update Catalan translation 2023-06-19 22:25:44 +02:00
Stephan Lenor
f5cc64ddd6 Speed up matrix operations (unit-wise, no interface is touched) 2023-06-19 15:45:32 +00:00
Jordi Mas
82d5743e77 Update Catalan translation 2023-06-18 21:09:40 +02:00
Alx Sa
762088f9de plug-ins: Show dimensions, BPP in ICO layer names 2023-06-18 05:11:44 +00:00
Øyvind Kolås
5b129f891a app: better synthesized short_label for gegl menu actions
For all the test-ops thus far in gegl, gimp:menu-label has been
the same as title + "..", to keep the number of duplicate strings
that need to be translated and the number of needed boiler-plate
lines of meta-data in GEGL down, this is the default behavior when
a title key exists.
2023-06-17 22:38:53 +02:00
Alx Sa
addc37880e themes: Fix "box" on highlighted checkbox label
The checkbox label wasn't included the :hover CSS, so its background
color didn't change. This created a "box" around the label without the
highlight color when the mouse was over it.
2023-06-17 19:01:39 +00:00
Mark
45e91bd550 fixes menu bar being todark for gray theme 2023-06-17 17:48:57 +00:00
Alx Sa
2065db7fe7 plug-ins: Don't load image for ICO thumbnail
Due to a small typo, GIMP always loaded the entire image as a thumbnail
even if a suitable one was found.
This patch fixes that typo.
2023-06-17 04:42:34 +00:00
Alx Sa
e5a4336604 plug-ins: Add width/height label to ICO export
Similar to the ICNS export, file-ico now shows the icon dimensions for 
all types in the export dialogue.
2023-06-16 23:44:36 +00:00
Jehan
07ee2fe776 Issue #9446: better logic to prevent multiple successive inhibition requests.
My previous commit was improving the case where we just get many "dirty" signals
and successful inhibition. But if the inhibition request was failing, we would
just retry again and again.

This new version will hold off on on requesting the inhibition for the next 10
minutes. Then it will try again, in case the failure reason might have been
temporary.
2023-06-16 22:53:59 +02:00
Jehan
863fb62581 Issue #9446: do not uninhibit/inhibit at every image change unless…
… the reason message changes (i.e. when number of dirty image changes).

Some actions in particular would trigger several "dirty" signals, there is no
reason to uninhibit then re-inhibit repeatedly. And as a more general rule,
there is no reason to do so even for different actions while we are not planning
to update the inhibition reason.

It may not be the main reason for #9446 (because if it hangs for several
minutes, there is likely something going on, deeper at the dbus call level), yet
it would definitely alleviate the issue (dividing the wait by as many times as
the dirty signal was emitted!).
2023-06-16 22:04:28 +02:00
Daniel Novomeský
69c81f1059 flatpak: upgrade libjxl 2023-06-16 13:15:14 +00:00
Alx Sa
d4260449fb app: fix some glib related deprecations
As in d16734a4, this checks the GLib version and conditionally uses 
G_APPLICATION_DEFAULT_FLAGS or G_APPLICATION_FLAGS_NONE for GimpApp.
2023-06-16 00:13:02 -04:00
Alx Sa
bf1e125138 widgets: Fix RGB histogram pixel/count values
The RGB histogram shows three histograms overlaid on each other.
This multiples the pixel and count attributes by 3. To correct this,
the result of gimp_histogram_get_count () is divided by 3 for the
pixel and count displays.
2023-06-15 19:24:49 -04:00
Ville Pätsi
c9cd4cea2a themes: less thick menu separators and thick dark borders in menu tooltips. 2023-06-16 01:15:39 +02:00
Alx Sa
9efc552069 plug-ins: Keep GIF's full palette on import
Resolves #414.
Currently GIMP only loads the palette colors used in a GIF, discarding 
the rest. This can cause issues when a consistent palette is required
(e.g. a video game sprite or background).
This patch uses either the global or local GIF max palette value to set 
the colormap size, thus retaining the full palette on import.
2023-06-15 21:07:22 +00:00
Lloyd Konneker
3cf3097d62 libgimpconfig: support GStrv aka string array 2023-06-15 17:12:44 +00:00
bootchk
5eac31f07f Refactor ScriptFu Console
Rename fields of ConsoleInterface more desciptive

Add c,h files for object editor and history

Extract object ConsoleEditor

Extract object ConsoleHistory

Extract TotalHistory methods
2023-06-15 13:26:00 +00:00
Jordi Mas
d7287e0f3b Update Catalan translation 2023-06-15 08:13:57 +02:00
Jordi Mas
e8a35c23e6 Fixes to Catalan translation 2023-06-14 00:11:25 +02:00
Øyvind Kolås
21411047ee app,pdb,plug-ins: %s/gegl_node_connect_to/gegl_node_connect/ 2023-06-13 19:58:42 +02:00
Øyvind Kolås
c4734a27b5 meson,app: depend on GEGL 0.4.45 2023-06-13 17:14:03 +02:00
Øyvind Kolås
6919d07b6c plugins/file-gegl: use gegl_node_link instad of gegl_node_connect_to 2023-06-13 17:14:03 +02:00
Øyvind Kolås
e7dcfb2927 app: use gegl_node_link and gegl_node_link_many
Instead of gegl_node_connect_to which is rather verbose, and slated for
deprecation in GEGL.
2023-06-13 17:14:03 +02:00
Martin
fe985c3961 Update Slovenian translation 2023-06-13 14:20:53 +00:00
Alx Sa
f92ecddd53 pdb: Fix NULL check in gimp-file-load-layers
As @bootchk noted, gimp-file-load-layers does not check the result of 
file_open_layers () but the final return variable
which is always NULL at this point in the function.
This patch corrects the problem so it checks the proper variable.
2023-06-13 04:55:13 +00:00
Ekaterine Papava
61ca8f211f Update Georgian translation 2023-06-13 03:58:11 +00:00
Ekaterine Papava
f9e3f28afd Update Georgian translation 2023-06-13 03:53:49 +00:00
Alx Sa
a04f287a4b script-fu: Fixed SF_ONE_OR_MORE_DRAWABLE option
The order of GIMP_PROCEDURE_SENSITIVE_DRAWABLE | 
GIMP_PROCEDURE_SENSITIVE_DRAWABLES was reversed in 
gimp_procedure_set_sensitivity_mask (), which caused scripts using 
SF_ONE_OR_MORE_DRAWABLE to crash.
2023-06-13 02:51:58 +00:00
Yuri Chornoivan
d6ba644575 Update Ukrainian translation 2023-06-12 20:24:10 +00:00
Jehan
90f155365b desktop: new AppStream metadata for upcoming 2.99.16 release. 2023-06-12 16:39:46 +02:00
Jehan
6c49cd65dd NEWS: remove mention of now removed ugly workaround. 2023-06-12 16:39:46 +02:00
Michael Natterer
563aabbf6d po: add resource-cmds.c to POTFILES.in 2023-06-12 16:21:40 +02:00
Jehan
4f600669a9 NEWS: update. 2023-06-12 01:49:42 +02:00
Jehan
7c1fb5bc67 app: return EXIT_FAILURE when failing to pass the batch commands to…
… the main instance.

Note that it doesn't say if the batch command succeded, only if they were
successfuly communicated to the main process for processing.
2023-06-12 01:20:11 +02:00
Jehan
eb0ee5f33a Issue #9598: do not rely on GApplication uniqueness feature.
When passing an application ID (which is necessary for application inhibition to
work, i.e. logoff/reboot/shutdown inhibition), GApplication will try to ensure
process uniqueness, which will trigger a new activation to an already running
process. Since our current code assumes that the application can be activated a
single time only, this was what was triggering a whole lot of errors (on the
first running process) in #9598 because there was all the initialization code
which ran again, whereas it was not supposed to.

This doubly-running initialization code was also what completely messed up the
session files, hence broke the GUI after a restart (#9599).

Therefore passing G_APPLICATION_NON_UNIQUE advertizes we don't want GIO to
handle process uniqueness for us.

Note that this is actually a very interesting feature which we have had in GIMP
codebase forever. It would be interesting to kill all our own uniqueness code in
favor of GIO code (and let them handle/maintain passing command line arguments
from one process to another, for all possible platforms). So I added a TODO for
this (for now, we just ignore this feature as it doesn't work well with current
codebase).
2023-06-12 01:10:59 +02:00
Jehan
7f83b27c3c Issue #5601: help icon in the action search.
Additionally to the F1 shortcut, a secondary icon is now shown in the
action search entry. It works exactly the same as F1, i.e. that by
default, it shows the action search manual page (when nothing is
selected), or the manual page for the specific action currently selected
otherwise.
2023-06-11 23:56:55 +02:00
Jehan
a13289672a Issue #5601: F1 in action search to load the action help page.
The default F1 result (if no action is selected) is to show the generic
help page for the action search. If an action is selected, it will show
the specific help for this action.
2023-06-11 23:02:15 +02:00
Yuri Chornoivan
f58900298b Update Ukrainian translation 2023-06-11 15:58:02 +00:00
Jehan
27f8448fa2 Issue #8204: link gimp-2.99 executable with the static libapp library.
Since we are already building a static (build-only) libapp, to be used with
tests or tools, let's also use it for the main (GUI) executable.

For the CLI executable though (gimp-console-2.99), we must re-compile
libapp_sources from scratch anyway, because we define the additional macro
'GIMP_CONSOLE_COMPILATION'.
2023-06-11 17:52:40 +02:00
Jehan
01e56545bc devel-docs, gitlab-ci: freeze our requirement updates to Debian 12 bookworm.
While Debian testing is the sensible choice for dependency requirements while we
are in full-dev mode, now we are getting closer to 3.0 release, and Debian 12
"bookworm" barely got out.
If we continue to develop at current pace, GIMP 3.0 should be released before
the next stable Debian, so we should not use dependencies unavailable on the
latest stable (otherwise GIMP 3.0 won't be distributable soon enough on Debian,
nor on Debian derivatives such as Ubuntu, Mint, etc.).

This is why we are now basing GIMP dependency requirement on Debian bookworm.
We'll likely get back to the next "testing" after GIMP 3.0 release.
2023-06-11 00:52:13 +02:00
Jehan
7f879d1d31 menus: move back the "GEGL Graph" action in Filters > Generic menu.
Now that we don't blindly generate a messy list of all non-special cased actions
in Filters > GEGL Operations, "GEGL Graph" is all alone in this submenu. It just
makes sense to bring it back to the Generic submenus where it used to be.
2023-06-10 23:13:02 +02:00
Jehan
6dc5f6792e app: use the new GEGL metadata "gimp:menu-path" and "gimp:menu-label".
Instead of unconditionally add all the non-special-cased GEGL operations into
the menu, only insert the ones which explicitly use the new "gimp:menu-path"
GEGL key.
See new operation "gegl:adaptive-threshold" added in commit 7c2a70eee for such
an example.

Note that the other operations will still get their own generated action (which
means for instance that you can still search them through the action search and
that you can create custom shortcuts for your favorite actions). But now you
won't get an overlong generic list of non-organized actions in a single submenu.
Some people were finding this messy when they had a lot of custom GEGL ops.

Also it means that GIMP doesn't assume that any custom GEGL op is usable in
GIMP. Indeed some ops are really not meant to be used as filters, which is why
we have the gimp_gegl_op_blacklisted() internal function; but this cannot apply
to custom operations. Therefore from now on, instead of GIMP guessing, operation
developers will have the say on whether their op should show in menus and in
which menu path exactly!

Moreover the "gimp:menu-label" key will be used as short label, i.e. the label
which is used in menus in particular, where the menu path is a helpful context
(hence allowing to use shorter menu labels).
The main "title" will still be used as long label, for places where there is no
such context, for instance the action search.
2023-06-10 23:09:00 +02:00
Jehan
b437552580 app: make sure that custom GEGL-operation generated actions have unique names.
When reverting commit d51c64ec06 and reimplementing as fa2e9adc29, the code to
make sure the generated per-op action name is unique disappeared. This code
ensures that the action name is indeed unique, otherwise the action will
override a previously registed action, which could be made from a plug-in, or
even by another GEGL operation. Indeed, while GEGL operation names are supposed
to be unique, they are post-processed to be valid GIO action names. So it is
totally possible to have 2 GEGL ops with different GEGL names, yet the same
GAction name.
2023-06-10 23:09:00 +02:00
Martin
1044c05cd5 Update Slovenian translation 2023-06-10 18:23:01 +00:00
Jordi Mas
828a8a7fe7 Update Catalan translation 2023-06-10 13:13:16 +02:00
Asier Sarasua Garmendia
0fa1f02459 Update Basque translation 2023-06-10 07:15:38 +00:00
Alx Sa
73d5dcecae plug-ins: Fix defaults for 1/4/8 bpp ICO export
8bpp and below ICO formats use a 1 bit mask for transparency.
When imported the mask is treated as an additional transparent color.
If the icon used the max palette (e.g. 2 colors for a 1bit icon),
the default export format will become larger than necessary.
This checks if the layer still has 1 bit alpha, and subtracts the
mask color from the count.
2023-06-09 22:12:43 +00:00
Jehan
317aa803d2 Issue #7172: option to apply Client-Side decoration on image windows.
This patch does the following things:

- An option "Merge menu and title bar" (this is hopefully more understandable
  than calling it "Client-side decoration" or again "header bar") is added in
  Preferences > Image Windows. This option triggers the restart warning.
  Moreover when checked a small warning message will tell that in some cases, it
  may not work (there are feedbacks of people having 2 title bars when using GTK
  applications using CSD).
- For the reason evoked above (sometimes 2 title bars) and also because the CSD
  concept seem really to divide people a lot (some love this as much as others
  hate this), this new option "custom-title-bar" on GimpGuiConfig is FALSE by
  default.
- When the option is checked, the image windows will use a GTK header bar
  containing the menu, the window title (image name and information) as well as
  the usual minimize/maximize/close buttons per your OS conventions.
- Since the header bar is set to be hidden when maximizing, if you checked "Show
  menubar" for the "Default Appearance in Fullscreen Mode" in Preferences >
  Image Windows > Appearance, the menu will be moved to its "old style"
  position, i.e. above the canvas. This makes the menu possibly visible (if
  relevant option is checked) even in fullscreen mode.
- I tweaked the Default theme to show the header bar with minimal height,
  because I find GTK default theme's headerbar height unreasonably high
  (especially if the point of the header bar is to save screen space). I am
  unsure if this was the right move though, because maybe the default theme
  should not do such choices (maybe this should go in the Compact theme?).
2023-06-09 20:19:01 +02:00
Jehan
10742367c5 app: create a dedicated UI manager for the quick mask popup.
I don't see a reason why the quick mask menu was sharing the same
manager as the image menu (the main top menu and on-canvas). This was
why it was receiving all notifications to create menu items on <Image>,
as registered by plug-ins.

Giving it its dedicated manager makes sure this doesn't happen.
2023-06-09 17:20:11 +02:00
Jehan
30c5e20ce7 Revert "app: fix bailout condition in gimp_menu_model_handles_subpath()"
This reverts commit 3a35974e3a.
This is not the right fix for the issue (which was happening on the
Quick Mask menu specifically) because root menu models are set with a
NULL path. So forbidding root menu models to handle new subpath means
preventing plug-ins to register new top-level menus.

The correct fix for the issue on the quick mask menu will happen in a
coming commit.
See issue #9586.
2023-06-09 17:15:38 +02:00
Jehan
c9b114e6e9 plug-ins: we still depends on librsvg 2.40.x.
In commits a6756b515b and 23da44e3c8, newer API of librsvg were used, over our
current minimum requirement. The reason why we don't bump this requirement is
that librsvg 2.40.x are the latest versions which are full-C. While we have
nothing against Rust, it is not available on all existing platforms, and we
really want to have GIMP buildable everywhere, while also have SVG support
always present (even though it's a vector format, it's an important one in
graphics work nowadays).
See issue #6821.

So in the end, let's keep the old minimum requirement, but test against librsvg
version to compiler either with old API or new one. The changes are limited
enough that it's not too much a bother.
2023-06-08 17:43:16 +02:00
MohammadSaleh Kamyab
ba66797abe Update Persian translation 2023-06-08 11:32:20 +00:00
Aryeom Han
7eea3c8622 data: new "Wilber Week 2023 edition" splash screen for GIMP 2.99.16. 2023-06-08 00:21:48 +02:00
Alexander Shopov
19a45577b6 Update Bulgarian translation 2023-06-07 21:20:57 +00:00
Jordi Mas
2815f7af94 Update Catalan translation 2023-06-07 19:44:03 +02:00
Alx Sa
e9fdd321cd widgets: Check if editor color is set before...
...trying to get the index. Resolve #9568.
The color picker tool calls this twice if you're in Add to Palette mode,
and the editor's color may not be set the first time it's run.
This adds a check to ensure the color is set before trying to retrieve
it from the palette to prevent a CRITICAL.
2023-06-07 12:19:56 +00:00
Jehan
d0ac96b8b3 build: fix nightly flatpak.
Don't set both a branch and a commit, otherwise flatpak-builder will
compare the HEAD of this branch (which may evolve with the commit).

Fixes:

> Failed to download sources: module qoi: Git commit for branch master is dfc056e813c98d307238d35f7f041a725d699dfc, but expected f6dffaf1e8170cdd79945a4fb60f6403e447e020
2023-06-07 12:24:11 +02:00
Jacob Boerema
0bcce39637 app: update help-ids for layer crop/resize commands
The layer resize to selection and crop to content menu commands were
using the same help ids. This made it difficult to have them both listed
separately in the index of the manual.

Since we use separate help ids everywhere else for menu commands, let's
give each its own help id here too.
2023-06-07 11:24:28 +02:00
Jehan
7f70aa0c61 gitlab-ci: one more missing artifact to fix dev-docs job. 2023-06-07 10:24:22 +02:00
Jehan
bf96451569 gitlab-ci: add more artifacts to gimp-meson-debian job.
This should hopefully fix the CI jobs "dev-docs" and "source-meson".
2023-06-07 00:43:26 +02:00
Jehan
3972122280 meson: remove a reference to autotools files in the meson dist script. 2023-06-06 23:49:39 +02:00
Jehan
0233531020 app: make sure the private variable is a valid object if set.
Though this doesn't make a problem in normal use (AFAICS), we have crash
in a unit test in CI because the action_factory object was apparently
invalid when calling gimp_action_factory_delete_group().
2023-06-06 22:30:03 +02:00
Jehan
36fe8a979d build: remnants of the autotools builds in installer creation script.
Because of this, the script was failing to get the version string, which
in turn was breaking InnoSetup.

This fixes the following InnoSetup bug:

> Error on line 116 in C:\_r\_builds\k3_3muaB\0\GNOME\gimp\build\windows\installer\gimp3264.iss: Value of [Setup] section directive "VersionInfoVersion" is invalid.
2023-06-06 20:45:09 +02:00
Jehan
12f349ef34 build: gobject-introspection was not pulling gobject-introspection-runtime.
This is an issue I'll have to fix in crossroad. Let's have the CI build
fixed for now.
2023-06-06 20:45:09 +02:00
Jehan
503324d348 gitlab-ci: switch to meson logs for CI artifacts.
config.log is an autotools artifact.
2023-06-06 20:45:09 +02:00
Michael Natterer
a858474fe8 pdb: GimpResource: add is_editable(), rename(), duplicate(). delete()
and remove the API from its subclasses.
2023-06-06 16:33:36 +02:00
Michael Natterer
018d9fb615 app: remove draw() from GimpComboTagEntry
We don't need to maanually draw the arrow. Fixes #9498
2023-06-06 16:32:15 +02:00
Martin
06c0a8ca81 Update Slovenian translation 2023-06-06 14:08:44 +00:00
Jehan
f746bfbaf2 gitlab-ci: one-line per installed package for dependency maintenance.
This commit makes no real changes but style.
As discussed, this makes it much easier to compare commit diffs, rather
than an overlong line where you have to search which package may have
been added/removed/changed.
2023-06-06 11:27:05 +02:00
lillolollo
ff0a4d012f Add aalib on crossroad 2023-06-05 23:16:59 +00:00
Alx Sa
aa2a565d60 widgets: Load simulation intent/bpc in preferences
Resolves #9560.
The Simulation Intent and BPC widgets in the Preference Dialogue needed
to be connected to their properties with `gimp_prop_*` when created to
show the saved default image values.
2023-06-05 19:12:18 +00:00
Alx Sa
6041d01655 dialogs: Set default response to "OK"
This allows users to just press Enter/Return to run it with defaults as
you could do in 2.10.
2023-06-05 13:25:45 +00:00
Michael Natterer
2adb283077 libgimp: add API docs for gimp_resource_get_by_name() 2023-06-05 14:41:57 +02:00
Michael Natterer
bb7ed43eac app: make the GimpResource dummy class the parent of GimpData
It does absolutely nothing except sitting there, providing an is-a
relation (both ways because GimpData is its only subclass). This will
simplify having more libgimp API on GimpResource, without having to
add different PDB code for app and libgimp.
2023-06-05 14:33:23 +02:00
Michael Natterer
a4920611d1 libgimp: remove gimpparamspecs-resource.h
and merge it into libgimp/gimpparamspecs.h
2023-06-05 13:06:01 +02:00
Asier Sarasua Garmendia
e3bf2c1f00 Update Basque translation 2023-06-04 07:35:44 +00:00
Rodrigo Lledó
a17a2529ae Update Spanish translation 2023-06-02 11:53:19 +00:00
Rodrigo Lledó
e579bb974e Update Spanish translation 2023-06-02 11:48:22 +00:00
Alx Sa
9058a460b0 core: Import .aco palettes with Babl
This replaces the various GimpHSV/GimpCMYK .aco palette conversions with
Babl.
As a result, it now possible to support importing CIE Lab palettes
(colorspace 7)
2023-06-01 10:56:10 -04:00
Alx Sa
5070e0e9ec plug-ins: Add additional DigitalSourceType...
types for the metadata editor.
2023-05-31 18:06:39 +00:00
Michael Natterer
5acdaac8e0 libgimp: remove getters and setters from GimpResourceSelectButton subclasses 2023-05-31 17:18:19 +02:00
Michael Natterer
8fba6da5db libgimp: remove gimp_resource_select_button_embed_interior()
and a whole bunch of useless code from all its subclasses.
2023-05-31 17:01:46 +02:00
Michael Natterer
9638102418 Introduce a global ID space for GimpData/GimpResource objects
Much like for images and items. Change the PDB to transmit IDs
instead of names for brush, pattern etc. and refactor a whole
lot of libgimp code to deal with it.

	modified:   libgimp/gimpplugin-private.h
2023-05-31 16:12:04 +02:00
Alx Sa
493156cc7a dialogs: Fix header bar assumption
The Extensions dialogue assumed that it had a header bar. Since this is 
not always the case, conditional checks were added to prevent
GtkHeaderBar code from running. This also fixes a crash when you
double-click to expand the extension description.
2023-05-31 03:19:24 +00:00
Jordi Mas
01785632cc Update Catalan translation 2023-05-30 06:47:37 +02:00
Jordi Mas
94572ba6eb Update Catalan translation 2023-05-29 14:26:05 +02:00
Ekaterine Papava
9a8262c991 Update Georgian translation 2023-05-29 05:09:02 +00:00
Jacob Boerema
7908ecfbcd plug-ins: synchronize name of nl-filter with manual
The name of the nl-filter plug-in in the manual was recently changed to be
more in line with its description.
Since that is already the name of the plug-in file here, let's also update
the name of PLUG_IN_PROC to be in line with this.
2023-05-27 23:12:11 -04:00
Michael Natterer
f1bbd8d2c6 app: make GimpNavigationEditor zooming much more responsive
Use g_idle_add() instead of g_timeout_add(300ms), which makes
it respond instantly, while still keeping the actual zoom
call out of the slider callback.

Fixes #9500
2023-05-27 13:32:24 +02:00
Michael Natterer
e12798be0d app: change GimpGeglProcedure to take (n-drawables, drawables)
because we treat it the same as a plug-in procedure.
2023-05-27 12:35:52 +02:00
Niels De Graef
413cf9ad85 app: Don't grab the pointer when doing scrolling
By doing `gimp_display_shell_pointer_grab()`, we actually prevent events
from a tablet coming through. There doesn't seem to be a reason to use
it and it's not regressing in functionality either, so let's just remove
it.

Fixes: https://gitlab.gnome.org/GNOME/gimp/-/issues/8016
2023-05-26 23:34:12 +00:00
Jehan
ebe63c215f INSTALL, meson: remove references to autotools and warning. 2023-05-27 00:33:17 +02:00
Jehan
3da0cdc03d desktop: removing autotools-only test files.
These are implemented directly in the meson build files.
2023-05-27 00:16:47 +02:00
Michael Natterer
26dce72d2c Remove autotools 2023-05-27 00:03:52 +02:00
Jacob Boerema
52fb1e93f9 libgimpbase: issue #1561 update Exif.Photo.PixelX/YDimension
Some images have Exif.Photo.PixelXDimension and Exif.Photo.PixelYDimension
metadata tags in addition to Exif.Image.ImageWidth and
Exif.Image.ImageHeight (mainly tiff images). So far, we were not updating
these optional tags, meaning they could get out-of-sync with the actual
dimensions when resizing and then exporting the image.

Since these tags are non essential, we will only update them if they are
already present.
2023-05-26 12:40:58 -04:00
Michael Natterer
0532cf31b9 app: move action/widget sensitivity logic from GimpMenu to GimpAction
This way we handle all kinds of proxies (particularly buttons).

Also add a small hack that prevents extended multiline tooltips of
GimpButton from being overwritten by gimp_action_update_proxy_tooltip().
2023-05-26 15:31:54 +02:00
Michael Natterer
c4f71f553c app: fix action_data_get_image() to return NULL more often
If "data" is a GimpItemTreeView or a GimpImageEditor, we REALLY want
only the image from these dialogs, even if NULL, and NOT some other
image from a display or context that randomly is around anyway. Fixes
the sensitivity states of lots of buttons in these dialogs.
2023-05-26 15:25:15 +02:00
Simon Budig
c9122fed2f gimp-atomic: drop the use of the volatile qualifier.
The underlying functions don't actually use thaat, so it gets dropped
anyway, causing a compiler warning.
2023-05-26 14:29:42 +02:00
Niels De Graef
85a77f8a64 plug-ins/grid: Make sure dest_buffer is initialized
Initialize to NULL at the very least
2023-05-26 12:45:50 +02:00
Carlos Garnacho
467fa6c5e7 app: Avoid double gtk_drag_finish() call on GimpToolbox
According to the ::drag-drop GTK documentation: "The call to gtk_drag_finish()
can be done either directly or in a “drag-data-received” handler which gets
triggered by calling gtk_drag_get_data()"

The GimpToolbox's vbox handling DnD chooses however to do both, the drag-drop
handler is calling gtk_drag_get_data() and invariably calling gtk_drag_finish()
to hint that the DnD operation is ending. While this worked in practice in X11,
This is a harder either/or in Wayland resulting in the transfer being cancelled.

In order to behave better wrt the documentation, and make DnD into the toolbox
work on both X11 and Wayland, avoid the first gtk_drag_finish() if the data is
being requested, and only bail out if no offered target matches what the widget
can handle. The handling done indirectly through gimp_toolbox_dnd_init() and
gimp_dnd_*_dest_add() will take care of finalizing the DnD data transfers
successfully.

Closes: https://gitlab.gnome.org/GNOME/gimp/-/issues/7373
2023-05-26 10:24:05 +00:00
Martin
310ab1f708 Update Slovenian translation 2023-05-26 07:34:20 +00:00
Martin
a9ac8a5a40 Update Slovenian translation 2023-05-26 07:26:14 +00:00
Yuri Chornoivan
9d684d4ddb Update Ukrainian translation 2023-05-26 06:53:45 +00:00
Alx Sa
fa22ee23c0 dialogs: Fix typo in "Lock Visibility" label 2023-05-26 03:27:55 +00:00
Michael Natterer
58c40a1871 app: add "lock visibility" to the layer,channel,path property dialogs
and make the lock toggles use the same icons as in in the popover in
the dockable dialogs.

Fixes #9306
2023-05-26 02:46:53 +02:00
Michael Natterer
b48846c752 app: remove the "Tab" accelerator from the "windows-hide-docks" action
Apparently this has never worked until we refactored our menus, now it
suddenly does but not as originally intended. Simply remove the
accelerator and let only the canvas event handler deal with the Tab
key. Restores 2.10 behavior which was quite ok.

Fixes #9352
2023-05-26 00:45:30 +02:00
Jehan
c5dd6e0e89 libgimp: fix a GBytes leak. 2023-05-26 00:32:28 +02:00
Jacob Boerema
671996e897 plug-ins: fix #8441 distress-selection.scm script failure
distress-selection.scm uses gimp-image-set-active-channel which has been
removed causing script failure when a channel is selected instead of a
layer.

Use the new multi-layer aware gimp-image-set-selected-channels and also
use the gimp-item-id-is-* functions instead of the deprecated
gimp-item-is-* functions.
2023-05-25 18:31:56 -04:00
Michael Natterer
2e219bccf2 app: one more fix like in the last commit in GimpLayerTreeView 2023-05-26 00:09:01 +02:00
Michael Natterer
6fcf25b3de app: can't rely on a context being set on a GimpItemTreeView
In GimpLayerTreeView, set the action states using GimpActionGroup
instead of using gimp->app directly to look up the actions ( after
trying to get the Gimp from a NULL GimpContext).

Fixes #9433
2023-05-25 23:52:40 +02:00
Niels De Graef
a411026b4c libgimpbase: Don't cast between guint32/gsize
I don't like C and I don't like crashes
2023-05-25 23:47:42 +02:00
Niels De Graef
275f7d5f4c libgimp: Fix checks when writing GdkPixbuf over the wire
* We need to check if `icon_bytes` is NULL, not `icon_data`
* We should not set `icon_bytes` if `gdk_pixbuf_save_to_buffer` fails
2023-05-25 23:19:58 +02:00
Michael Natterer
c9700680fe app: Issue #9490: limit the width of the palette preview
to GIMP_VIEWABLE_MAX_PREVIEW_SIZE in gimppaletteeditor.c
2023-05-25 19:37:41 +02:00
Jehan
821711badb themes: "System" theme should not use smaller font size.
What we call "System" theme should have very minimal edits over the
actual system theme. So let's drop all the "font-size" properties (one
"larger" one, but especially the many "smaller" ones).
This means that the "Default" theme also will keep system font size.

This is as discussed with Ville and Liam, the later saying he can barely
read dockable texts because of this.

On the other hand, we use "small" font size as a general rule in the
"Compact" theme, which is especially meant for people who want a compact
theme.
2023-05-25 18:10:56 +02:00
Michael Natterer
afa2a5ca96 app: fix typo in gimphelp-ids.h, spotted by Wormnest 2023-05-25 17:30:50 +02:00
Michael Natterer
41894be71a app: make the rotation import dialog more similar to profile import
and some general cleanup in both dialogs.
2023-05-25 16:56:07 +02:00
Michael Natterer
652fbe47fa app: use the prefs color management icon in the profile import dialog 2023-05-25 10:26:43 +02:00
Michael Natterer
ea0056ca46 app: set the file on all images immediately after loading
We removed gimp_image_set_file() from all plug-ins but forgot to do it
generically in the core...
2023-05-25 10:22:53 +02:00
Yuri Chornoivan
ce69a0ee2f Update Ukrainian translation 2023-05-25 06:52:07 +00:00
Jehan
097e683b07 NEWS: update. 2023-05-25 03:26:36 +02:00
Michael Natterer
fa2e9adc29 app: reimplement the stuff reverted below
but stay completely in filter-actions.c and filters-menus.c
2023-05-25 02:31:28 +02:00
Michael Natterer
4209a584fc app: clean up forgotten conflict removals from the reverts below 2023-05-25 02:31:28 +02:00
Michael Natterer
dc25c2bc97 Revert "app: add a "Filters > Generic > GEGL Operations" submenu with generated actions."
This reverts commit 747cbf70db.
2023-05-25 02:31:28 +02:00
Michael Natterer
39942c1260 Revert "Issue #9228: make GEGL Operation tool's operations their own actions too."
This reverts commit d51c64ec06.
2023-05-25 02:31:28 +02:00
Jehan
806f88b9a0 app: no longer name variant for "Preferences".
It doesn't feel to me like appending "Dialog" is needed for this
specific dialog.
2023-05-25 02:27:21 +02:00
Jehan
a660a378ac themes: updated Default theme by Ville Pätsi.
The Default theme may have been a bit too dark. Instead let's have it a
tiny bit lighter (and also foreground color a bit less white).

For now, the old "Default" dark theme doesn't disappear totally and is
moved to a "Darker" theme as we have been discussing and wondering on
whether this is prefered by some people (it is). Aryeom also thought a
darker theme may be a good idea.

Moreover Liam actually thought that losing some of the contrast
(especially with the text a tiny bit less white now) is not desired in
his case where eyes may not be as sharp as they used to. Therefore a
"High Contrast" theme may be needed.

Aryeom also suggested that sliders to choose colors could be a much more
generic solution, which might be possible yet would require more ugly
hacks generating on-the-fly theme changes (we do something similar for
dark theme choice already).

This is all work-in-progress and a result from Wilber Week 2023 work.
2023-05-25 02:23:24 +02:00
Michael Natterer
ea83d54cb1 app: move gimp_get_geglopclasses() to gegl/gimp-gegl-utils.[ch]
and rename it to gimp_gegl_get_op_classes(). This looks much cleaner,
just don't look at the internal op blacklisting code...
2023-05-25 01:04:54 +02:00
Michael Natterer
e9e09ceec4 app: vertically center the top-left icon in GimpViewableDialog 2023-05-24 23:37:43 +02:00
Jehan
88e82d57af build: install gobject-introspection with MSYS2 when cross-building…
… for Windows.

Though it's useless for actually building the GIR files, we still need
this package now, for building script-fu with introspection abilities,
to generate GIMP and GEGL enums.
See the 2 previous commits for more information.
2023-05-24 23:19:20 +02:00
Niels De Graef
305b27884d ci: Add gobject-introspection to win64 image 2023-05-24 23:19:20 +02:00
Niels De Graef
01e960e98e plug-ins/scheme-wrapper: Use GIR for enum values
This allows our script-fu plugins to use the GIMP enum values, just like
all our other plug-ins know them.

In other words:

* Names are consistent with those of other plug-ins
* Introspectable enums are automatically added as they are added to the
  introspection file, without even needing a recompile
* No need to keep track of our enum types anymore, as that is just a
  redundant implementation of introspection in practice. This in turn
  will let us simplify some of the pdb code
2023-05-24 23:19:20 +02:00
Niels De Graef
00415bed6a libgimp: Always pass size to g_bytes_unref_to_data
Unlike `g_bytes_get_data()`, the out argument for the size is not
optional, so if we try to pass `NULL` there, we actually get a segfault.
2023-05-24 23:16:36 +02:00
Alx Sa
e1e30c6f72 app: Scale pattern preview to show full image
Currently, patterns are loaded as-is - if the full pattern is larger
than the preview, its cut off and you only see the left corner.
In those cases, the pattern is scaled using gegl_buffer_get ()'s scale
parameter.
2023-05-24 19:44:11 +00:00
Michael Natterer
a8d30578cd script-fu: fix double free in script-fu-dialog.c
Spotted by Lloyd Konneker.
2023-05-24 21:35:48 +02:00
Alx Sa
7a1e6bedd5 plug-ins: Increase Script-fu Console size...
and Plug-in/Procedure Browser size.
gtk_widget_set_size_request () is applied to the dialog, as it does not
seem to bubble up from being applied to individual elements.
The existing 2.10 width/height values are used.
2023-05-24 18:56:23 +00:00
Michael Natterer
15d81b6b10 app: plug leaks in GimpExtensionManager 2023-05-24 18:27:00 +02:00
Michael Natterer
8d9eef875c libgimpwidgets: use gdk_seat_grab,ungrab() in gimphelpui.c,
getting rid of using the the deprecated pointer grab API.

Since there is something fishy and gtk_get_event_widget(event) always
returns the GtkInvisible we grab on (not the actual event widget), we
just steal the "find widget at pointer" code from gtkinspector and
find the help widget that way.
2023-05-24 17:18:38 +02:00
Michael Natterer
7e7a20530d libgimpwidgets: improve parameter names of gimp_grid_attach_aligned() 2023-05-24 15:59:34 +02:00
Michael Natterer
a12339c890 app: increase preview size in gimpviewablebox.c
The height of the boxes was never determined by the preview but by the
label+entry, causing vertical padding around the preview. Now the
preview fills the area in more cases, at the cost of a few less
horizontal pixels for the entry.
2023-05-24 15:20:03 +02:00
Michael Natterer
9c9d3aaa35 themes: minimize spinbutton height in docks too
but add 2px top and bottom padding so all of those entries don't look
like the just escaped the garbage compactor.
2023-05-24 15:17:27 +02:00
Michael Natterer
ee6108aa04 themes: minimize the height of all entries in docks 2023-05-24 14:47:42 +02:00
Michael Natterer
4fb27afd9e plug-ins: don't leak the comment string in file-psp.c 2023-05-24 14:32:00 +02:00
Michael Natterer
82e4bf5792 app: fix "active" state management in GimpToggleAction
gimp_toggle_action_real_toggle(): set "active" before emitting
"change-state" so we don't infinitely try to set the state in case of
a recursion.

gimp_toggle_action_toggle(): add notify("active") because it wasn't
done anywhere.

Fixes #9392
2023-05-24 14:09:50 +02:00
Michael Natterer
3a35974e3a app: fix bailout condition in gimp_menu_model_handles_subpath()
Fixes plug-in menus being added to all a GimpUIManager's menus,
even if they didn't match the menu_path
2023-05-24 13:43:35 +02:00
Michael Natterer
1d393fb926 app: don't try to break up a NULL menu_path in gimp_action_set_menu_path() 2023-05-24 13:41:37 +02:00
Simon Budig
f540e79172 screenshot: there actually is no need to preprocess the PNG data... 2023-05-24 11:32:05 +02:00
Niels De Graef
2b4bf29553 gitlab-ci: Use JUnit reports from Meson
Meson has been generating Junit XML files of its test results since
0.55, so we can use that to show the test results in the GitLab UI.
2023-05-24 00:38:00 +02:00
Niels De Graef
89c359ce47 Remove GimpUint8Array in favor of GBytes
GLib has a specific type for byte arrays: `GBytes` (and it's underlying
GType `G_TYPE_BYTES`).

By using this type, we can avoid having a `GimpUint8Array` which is a
bit cumbersome to use for both the C API, as well as bindings. By using
`GBytes`, we allow other languages to pass on byte arrays as they are
used to, while the bindings will make sure to do the right thing.

In the end, it makes the API a little bit simpler for everyone, and
reduces confusion for people who are used to working with byte arrays
in other C/GLib based code (and not having 2 different types to denote
the same thing).

Related: https://gitlab.gnome.org/GNOME/gimp/-/issues/5919
2023-05-23 23:37:50 +02:00
Michael Natterer
9e79bb78a1 app: update the dialog and dockbook ui managers in gimp_dockbook_show_menu() 2023-05-23 16:31:57 +02:00
Michael Natterer
37dfa24def meson: default to create default binary symlinks only in stable versions 2023-05-23 10:34:47 +02:00
Michael Natterer
514042d57d app: don't leak the GSList connecting GimpRadioActions 2023-05-23 01:42:40 +02:00
Michael Natterer
4879589be6 app: use g_list_delete_link() not _remove_link() in GimpUIManager
so the list element actually gets freed.
2023-05-23 01:42:40 +02:00
Simon Budig
23da44e3c8 file-svg: remove deprecated librsvg api, added some pixbuf/cairo fuckery. 2023-05-23 00:45:50 +02:00
Michael Natterer
e4f0bb0dfe app: valgrind found a bunch of memory leaks 2023-05-23 00:11:23 +02:00
Simon Budig
3b925cd78e animation-play: remove deprecated gtk-alignmnents 2023-05-22 22:35:30 +02:00
Yuri Chornoivan
339c858a65 Update Ukrainian translation 2023-05-22 17:13:13 +00:00
Ekaterine Papava
e97ab651dd Update Georgian translation 2023-05-22 16:32:48 +00:00
Michael Natterer
7ada432690 app: big porting of weak pointers to g_set,clear_weak_pointer()
This started as review of weak pointers, but using
g_set_weak_pointer() and g_clear_weak_pointer() is almost always
better, and shorter.
2023-05-22 18:16:09 +02:00
Jacob Boerema
4789a31a15 plug-ins: issue #7658 add support for unregistered xmp namespaces
Our metadata library exiv2 only registers the most commonly used xmp
namespaces. Other namespaces need to be explicitly registered. We did not
read or try to store these namespaces, which caused a lot of warnings about
"No namespace info available for XMP prefix '...' and then we could not
process that metadata or save/export those tags.

We had to wait for gexiv2 support for registering/reading namespaces, but
that was added in gexiv2 version 0.12.2 (and the "try" version in 0.14.0).

When reading xmp metadata we process all namespaces and add them to our
metadata xml when we haven't seen them before in the same image.
A GHashTable is used to keep track of the prefixes we have seen before.
The new namespace xml tag is skipped in older GIMP versions, but will be
used now to add the namespaces when exporting images with xmp metadata.
2023-05-22 11:57:08 -04:00
Alx Sa
3cd896c983 plug-ins: Import IBM PC Formatted TIFF layers
TIFFs with PSD layers can be saved in either Macintosh or IBM PC format.
IBM PC section labels are reversed and the integers are Little Endian.
We now check for 'MIB8' sections and reverse the necessary values so
that the PSD plug-in functions can handle them.
2023-05-22 14:45:34 +00:00
Martin
daa8ed3567 Update Slovenian translation 2023-05-22 13:50:56 +00:00
Michael Natterer
9886062dca app: don't leave around a dangling weak pointer to some memory on the
stack in gimp_create_image_from_buffer()
2023-05-22 14:30:37 +02:00
Michael Natterer
3d5ea2eeb2 app: remove weak ref to action_factory in GimpMenuFactory 2023-05-22 14:11:48 +02:00
Michael Natterer
91fceebb1d app: improve readability in GimpMenuFactory 2023-05-22 14:11:06 +02:00
Alexander Shopov
db3a88f1f5 Update Bulgarian translation 2023-05-22 08:44:18 +00:00
Simon Budig
a6756b515b file-svg: fix deprecated use of rsvg_handle_get_dimensions() 2023-05-22 09:30:25 +02:00
Alx Sa
6f8f481ee2 plug-ins: Remove screenshot-icon.h in Makefile.am
Since the file itself was removed in 5d7d11a8.
2023-05-22 04:29:56 +00:00
Alx Sa
026e99c441 actions: Restore pasting image in empty workspace
In !769, I accidentally removed the ability to paste into an empty
workspace with Ctrl+V since I added a "does image exist?" check before
the `edit_paste_as_new_image_cmd_callback ()` call.
This patch resolves the issue by moving the check after the
"paste as image" function call.
2023-05-22 03:56:36 +00:00
Michael Natterer
9b388f873b modules: remove "static" from all modules' get_type() functions
Their implementations are defined by G_DEFINE_DYNAMIC_TYPE(), so
the compiler complained about the unused static prototype.
2023-05-22 03:51:36 +02:00
Michael Natterer
f615cbc5af Revert "app: quick/dirty-exit on all releases (not just stable ones) while…"
This reverts commit d22f1c3332.

The memory corruption is fixed, we can restore the original quit code.
2023-05-22 03:39:52 +02:00
Michael Natterer
8f42731074 app: don't leave dangling GimpUIManager weak pointers around
in gimpmenumodel.c and gimpmenushell.c
2023-05-22 03:39:52 +02:00
Michael Natterer
bf15c9d128 app: also remove (not only add) the weak pointer in
gimp_action_impl_activate(), it's only there to guard one function
call
2023-05-22 03:39:52 +02:00
Michael Natterer
1d069d05b4 app: fix dangling weak pointers to GimpEditor->priv->ui_manager 2023-05-22 03:39:52 +02:00
Michael Natterer
ef0eb29e55 app: readability improvement in GimpActionFactory 2023-05-22 03:39:52 +02:00
Michael Natterer
4d38ae333a app: remove the weak pointer GimpPaintOptions->brush in dispose() 2023-05-22 03:39:52 +02:00
Michael Natterer
2de78e45b6 app: some formatting in gimppaintbrush.c 2023-05-22 03:39:52 +02:00
Niels De Graef
da585065d6 Revert "app: Port GimpParasiteList to GListModel"
This reverts commit 3054901af0.

GimpParazite is not a GObject, so using a GListModel is not an option
for now
2023-05-22 01:26:18 +02:00
Niels De Graef
dd3fd682f6 libgimp, pdb: Fix enums_get_type_names annotations
Annotate the array length
2023-05-22 01:19:17 +02:00
Michael Natterer
bbad91d85d quit-dialog: remove write after free in quit_close_all_dialog_response()
This reverts 83397cbb15 except for the
unrelated typo fix.
2023-05-21 18:56:32 +02:00
Michael Natterer
ea61efe679 app: remove gtk_container_set_focus_chain(), it's deprecated and
our use cases were overengineering anyway.
2023-05-21 18:56:32 +02:00
Michael Natterer
0c41856393 meson.build, sanity.c, gui.c: update and sync some dependency versions 2023-05-21 18:56:32 +02:00
Michael Natterer
7de9c347b6 script-fu: use gimp_value_array_copy(), and free the copy 2023-05-21 18:56:32 +02:00
Michael Natterer
0c73d7df12 libgimbase: add gimp_value_array_copy() 2023-05-21 18:56:32 +02:00
Alx Sa
e020a6b3ca plug-ins: Add support ILBM HAM mode images
"Hold and Modify" ILBM images use control bits to increase the palette
beyond what's stored in the CMAP chunk. This patch checks if
HAM mode is set and then interprets the plane bits accordingly.
2023-05-21 15:31:42 +00:00
Simon Budig
5d7d11a81f screenshot: move deprecated pixdata into png resource 2023-05-21 13:22:57 +02:00
Simon Budig
bf0cac7e1c meson: bump minimum required versino to avoid a warning 2023-05-21 12:01:52 +02:00
Yuri Chornoivan
efbdd8e1c4 Update Ukrainian translation 2023-05-21 06:15:31 +00:00
Simon Budig
71b46d5a0b gimpimagemetadata: ...so that we can remove that ugly hack here. 2023-05-21 01:58:16 +02:00
Simon Budig
9e8f5a97d2 meson: add a minimum dependency on exiv2 0.27.4... 2023-05-21 01:58:16 +02:00
Niels De Graef
41e3d10a18 libgimpwidgets: Fix some gir annotations
Add a missing nullable, remove some references to `GtkHScale` as that no
longer exists.
2023-05-21 01:37:18 +02:00
Niels De Graef
3054901af0 app: Port GimpParasiteList to GListModel
GListModels are fun. They will also prove to be useful in the future.
2023-05-21 01:30:53 +02:00
Simon Budig
997e4b5f6c test-ui: re-enable one of the tests, our gtk-dependency is big enough now. 2023-05-21 01:22:00 +02:00
Simon Budig
41b47d1dde colorsvg2png: fix deprecation, slightly changing the behaviour 2023-05-21 01:10:51 +02:00
Niels De Graef
a4c3eacc02 libgimpmodule: Convert ModuleDB to GListModel
This commit converts `GimpModuleDB` into a `GListModel`. This allows us
to drop quite a bit of custom code to have an adaptive list of modules
by just becoming a `GListModel` implementation.

Next to that, this commit also rewrites `GimpModule` to use the `notify`
signal for its 2 new properties: "auto-load" and "on-disk", rather than
trying to define a custom signal for that. This in turn allows us to use
basic methods like `g_object_bind_property()`.

Finally, the module manager dialog now uses `GtkListBox`, which can
easily bind to that new `GListModel` infrastructure.
2023-05-20 22:15:13 +00:00
Niels De Graef
e5820261ec app: Use a GtkListBox for the themes list
Use a `GtkListBox` to show the list of GIMP themes rather than a
treeview. The idea is that we can expand this a bit more to give a
preview of the theme later on.
2023-05-20 22:15:13 +00:00
Simon Budig
8cf388c17f gimpcellrendererdashes: fix type of a variable 2023-05-20 23:59:29 +02:00
Simon Budig
83d6f46ee7 app: fix deprecation of g_spawn_check_exit_status() 2023-05-20 23:56:29 +02:00
Simon Budig
7f10328777 script-fu-dialog: fix memleak 2023-05-20 23:41:18 +02:00
Simon Budig
a100bb7fcf gimptagpopup: port to GtkStateFlags 2023-05-20 23:32:18 +02:00
Simon Budig
289999ad52 core: remove the workaround, neither gcc nor clang generate a warning here. 2023-05-20 23:32:18 +02:00
Simon Budig
51311f913d metadata: shut up a weird warning 2023-05-20 23:32:18 +02:00
Niels De Graef
0f05de3dc0 libgimpwidgets: Try harder to set parent window
In case someone passes a `GtkWidget` rather than a `GtkWindow` as a
parent to a `GimpDialog`, we still have another way of trying to get its
parent window, using `gtk_window_get_toplevel()`. If we still get a
window from that, it allows us to still specify a reasonable
"transient-for" value for our newly-made `GimpDialog`.
2023-05-20 20:24:28 +00:00
Simon Budig
6e1747953a libgimp: fix a warning by using an enum of the correct type. 2023-05-20 22:16:06 +02:00
Jordi Mas
d7f5cd0e43 Fix typo in Catalan translation 2023-05-20 22:05:56 +02:00
Simon Budig
d16734a4e4 plug-ins: fix some glib related deprecations 2023-05-20 21:46:17 +02:00
Simon Budig
690c9ae21a gimpguidetool: fix somewhat pointless warning about uninitalized variable 2023-05-20 18:47:14 +02:00
Simon Budig
a2458f1528 file-tiff-load: fix mismatching variable type 2023-05-20 18:47:14 +02:00
Jacob Boerema
c8739aa494 libgimp: fix failure to write XMP metadata
Certain XMP metadata tags currently can't be saved by us until we get
support in gexiv2 for adding new structs not present in exiv2.
We remove these tags from the exported metadata because the XMPSDK in
exiv2 would otherwise fail to write all XMP metadata.

Examples are the newer (2019, 2021, 2022) sample images from the
IPTC Photo Metadata Standard.

We also add all the static functions present in gimpimagemetadata-save
at the top, which had been forgotten in the past.
2023-05-20 12:39:29 -04:00
Jacob Boerema
b37f0a3182 libgimp, plug-ins: remove obsolete XmpStructs 2023-05-20 12:39:29 -04:00
Simon Budig
36eda4ae9c fix some warning related warnings 2023-05-20 18:25:10 +02:00
Alx Sa
a4541d8a7a gui: Fix upper text scaling for small images
Resolves #5742.
From fa0a0212, the splash's upper text was scaled to PANGO_SCALE_MEDIUM
both when the image width was 2x or less than 2x. This was likely a
copy/paste issue, as the lower text code scaling does not duplicate.
This patch fixes it by changing the else condition to scale to
PANGO_SCALE_SMALL.
Note that this change is unlikely to be seen as it requires a very small
splash screen image to reach the else condition.
2023-05-20 16:20:00 +00:00
Jordi Mas
8b6be32c51 Update Catalan translation 2023-05-20 18:14:49 +02:00
Simon Budig
27af306a8a libgimp: un-deprecate and fix gexiv2 usage. 2023-05-20 18:06:21 +02:00
Alx Sa
604045fc0f plug-ins: Replace deprecated GdkColor with GdkRGBA
As GdkRGBA stores colors as doubles rather than guint16, the assignment
code had to be moved into the ifdef block as well.
Note that this code is only used if X11 is not available on build.
2023-05-20 15:17:14 +00:00
Alx Sa
24a1d34bba plug-ins: Porting to GimpSaveProcedureDialog
These five plug-ins already used GimpProcedureDialog when I originally
worked on them for !9250. However, their export GUI needs to
use GimpSaveProcedureDialog instead.
2023-05-20 14:30:41 +00:00
Simon Budig
b5f6c2e855 Revert "script-fu: resolve some duplicate menu path entries"
I had a bogus installation. Sorry for that.

This reverts commit c0691ea85c.
2023-05-20 01:31:47 +02:00
Simon Budig
c0691ea85c script-fu: resolve some duplicate menu path entries 2023-05-20 01:17:39 +02:00
Jacob Boerema
9accaad0b6 libgimp: replace deprecated functions ...
1. gexiv2_metadata_has_tag with gexiv2_metadata_try_has_tag;
2. gexiv2_metadata_set_exif_thumbnail_from_buffer with the "try" version.

For a while now the minimum gexiv2 version for the master branch is 0.14.0,
which means we can replace these deprecated functions, since the new
versions were added in 0.14.0.
2023-05-18 15:23:59 -04:00
Jacob Boerema
00901276f2 libgimpbase: replace strcpy/strcat with g_strconcat in gimpmetadata
We were using fixed size buffer with strcpy/strcat, which gave warnings in
coverity.

Even though in our case there was no chance of buffer overflow, let's
replace this by using g_strconcat, which allocates memory for the
string which we free after use.

Also get rid of a few unneeded memset's for strdata.
2023-05-18 14:51:12 -04:00
Jordi Mas
8ab345d1e4 Update Catalan translation 2023-05-18 07:19:40 +02:00
Jordi Mas
5bea1c4135 Update Catalan translation 2023-05-15 22:18:02 +02:00
Alx Sa
48e976725c build: Update Windows installer associations
Adds the following formats that GIMP now supports: .ani, .cur, .dcx,
.icns, .pam, .wbmp, .iff/acbm/ilbm/lbm
2023-05-15 19:26:48 +00:00
Yuri Chornoivan
40d9026f9e Update Ukrainian translation 2023-05-15 17:51:40 +00:00
Jehan
3862fad8c1 plug-ins: file-fits becomes an optional plug-in.
Let's make cfitsio an optional dependency, showing up in the final configure
output. The file-fits plug-in will just not be built when the dep is missing.
2023-05-15 12:20:53 +02:00
Alexander Shopov
8f9b8b3d58 Update Bulgarian translation 2023-05-15 09:32:36 +00:00
Martin
3bc5793dbf Update Slovenian translation 2023-05-15 07:54:40 +00:00
Martin
30a8943356 Update Slovenian translation 2023-05-15 07:51:19 +00:00
Ekaterine Papava
1a35e01620 Update Georgian translation 2023-05-15 03:35:55 +00:00
Ekaterine Papava
c12f953d57 Update Georgian translation 2023-05-15 03:31:34 +00:00
Alx Sa
b2874464f5 icons: Revert most of !909
Per @Jehan, this solution would prevent default icons from being loaded
in custom themes if they did not include their own version.
The only thing kept from !909 is the replacement of hardcoded strings
in a few files with constants defined in gimpicons.h.
2023-05-14 21:54:41 -04:00
Alx Sa
d4f420769c plug-ins: Port FITS plug-in to cfitsio library
Switch to NASA-maintained cfitsio library for loading/exporting FITS images.
This allows us to import compressed FITS files (GZIP, HCOMP, PLIO, RICE) in
8/16/32 bit and float/double precision. It also simplifies export code using
the built-in cfitsio APIs.
2023-05-14 15:05:50 +00:00
Jordi Mas
4a67ee4035 Update Catalan translation 2023-05-14 16:13:34 +02:00
Yuri Chornoivan
c8d44578aa Update Ukrainian translation 2023-05-14 11:21:31 +00:00
Alx Sa
0790d6c9d5 widgets: Add Grayscale color picking mode 2023-05-14 10:19:54 +00:00
Jehan
a75015a821 build: add appstream-glib
It is actually available in the SDK but was removed from the runtime (relatively
recently, it would seem). As a more general rule, it seems that GNOME is phasing
it out slowly in favor of libappstream. So probably we should do the same
eventually.
Yet for now, to at least have a working nightly flatpak, let's add it to our
package.
2023-05-13 22:44:00 +02:00
Jehan
fa85eb6565 gitlab-ci: fix the CI.
The flatpak_ci_initiative.yml template we include got changed 2 days ago,
replacing the "only" by a "rules", which broke our CI file.

Cf. commit 193f63c20f87d38868c05beee6446b387b73e140 in repository citemplates.

The present commit should (hopefully) fix this error:

> Unable to create pipeline
>   jobs:flatpak-nightly config key may not be used with `rules`: only

(even though the error is a bit cryptic, the problem is apparently that both
rules: and only: keys cannot be used together)
2023-05-13 22:15:20 +02:00
Jehan
9ebc2cf3f7 NEWS: update. 2023-05-12 18:19:24 +02:00
Jehan
d22f1c3332 app: quick/dirty-exit on all releases (not just stable ones) while…
… clean-exiting on all dev code (whether stable or unstable branches).

This is because the dirty exit prevents the on-exit crashes which seem to happen
somewhere in the memory cleanup (which apparently corrupts memory but all crash
traces don't show the proper area where the issue actually hapened). So let's
have release exit the process without issue (at least all important user-facing
data is saved properly by then), while not hiding the issue to developers.

Also on dev code, the GIMP_DIRTY_EXIT will allow to go anyway for the quick
exit() path, so that for instance one can work on other pieces of code without
feeling bothered by the constant crashes on exit.

For the record, the crashes we are talking about appear when you update to a
recent GLib, after the removal of GSlice implementation (which is basically now
just a malloc/free alias). There may be issues in our usage of GSlice though we
also experience crashes even just with commit 69e9ba80e on GLib which hints at
issues in our GObject/GType code.
2023-05-12 14:37:16 +02:00
Jehan
39bcdc9e40 app: gimp_console_app_class_init() is the class init function, not interface. 2023-05-12 14:37:16 +02:00
Alexander Shopov
8eeeb13a31 Update Bulgarian translation 2023-05-11 13:45:42 +00:00
Alexander Shopov
eff5230370 Update Bulgarian translation 2023-05-11 13:37:09 +00:00
Jehan
6c6cd2df24 app: make sure va_start() is matched by va_end().
xcf_save_prop() starts with va_start(), hence must end with va_end(). Yet any of
the xcf_write*_check_error() macros could end this function abruptly. Therefore
I'm adding a "cleanup" argument to the macros, allowing to add any code
necessary to clean the current function before returning.
2023-05-11 15:18:33 +02:00
Jehan
d1118a5e15 app: missing break statement. 2023-05-11 14:19:37 +02:00
Jehan
b64f79fed9 devel-docs: don't build reference docs when GIR aren't generated.
This can happens in cross-compilation cases for instance.
2023-05-11 12:46:57 +02:00
Jehan
e22c027bbf app: keep the GtkStyleProvider alive.
While GTK keeps a reference to it, we should simply not release our own
reference at init(). This was a case where we freed this twice.
2023-05-11 12:46:57 +02:00
Jehan
f9993b85b6 app: use G_DECLARE_INTERFACE() to declare GimpAction interface.
Less boiler plate code so less reasons to mess up.
For this to be feasible, I also had to define a cleanup function for
GimpObject.
2023-05-11 12:46:57 +02:00
Jehan
bb4438789a app: fix some s/G_TYPE_FROM_CLASS/G_TYPE_FROM_INTERFACE/ calls. 2023-05-11 12:46:57 +02:00
Martin
b37fc57096 Update Slovenian translation 2023-05-11 07:55:40 +00:00
Ekaterine Papava
9bfc69c9d3 Update Georgian translation 2023-05-11 03:32:47 +00:00
Yuri Chornoivan
a375c5f0a9 Update Ukrainian translation 2023-05-10 19:28:09 +00:00
Jacob Boerema
1fa8e8617b plug-ins: fix previous metadata-editor commit
- Missed a necessary autotools change: forgot to remove ui/Makefile
from configure.ac
- Not all compilers allow declaring variables in a case statement without
putting them in a block, so we add a block now.
2023-05-10 14:28:42 -04:00
Jacob Boerema
8969bbcee8 plug-ins: Remove dependency on GtkBuilder from metadata-editor
Instead of loading the GtkBuilder .ui file we now create all widgets in
code.
Added several support functions to reduce code copy/pasting and making
additional widgets and supporting more metadata easier.
The overall layout should still look the same, with a few exceptions:
- Each notebook page only uses one grid. This makes it possible to align
all data entry widgets.
- Featured Organization and it's code were two treeviews next to each
other. These are now organized below each other to make automatic code
generation easier.
- Since we needed to touch this code anyway, I also fixed Xmp.dc.creator
and Xmp.iptcExt.ModelAge to be multiline. This closes #7286.
- The old icons used for the date button, add, and remove row buttons
were replaced by gimp-grid, list-add and list-remove.

Since this was the last .ui file used in GIMP plug-ins, we remove all
files from the .ui subdirectory and references to that.

Note that there are several more places where GtkBuilder is used, but
those cases uses strings defined in code instead of .ui files.
2023-05-10 13:25:12 -04:00
Jacob Boerema
415b32e763 plug-ins: refactor set_tag_string usage in metadata-editor
We had a lot of duplicate code using gexiv2_metadata_try_set_tag_string
and then checking for errors.

Simplify this by re-using the existing set_tag_string function by
introducing an extra parameter that tells us whether or not to clear
the tag first.
2023-05-10 12:48:01 -04:00
Rodrigo Lledó
09f4261e3f Update Spanish translation 2023-05-08 12:55:44 +00:00
Tomasz Golinski
5337070bf2 plug-ins: remove obsolete check for Babl fish in file-psd.c
It was a temporary code added before relevant code landed in babl. The necessary merge request landed in Babl some time ago, and Gimp now requires Babl version 0.1.98, which includes the needed commit.

Related to merge_requests/509
2023-05-07 14:21:17 +02:00
Sabri Ünal
3c6c5c277c Update Turkish translation 2023-05-05 12:27:52 +00:00
Alx Sa
c085d94777 plug-ins: Swap deprecated gexiv2 functions in...
...file-tiff-save. As in a57a62ce, this updates
`gexiv2_metadata_clear_tag ()' to `gexiv2_metadata_try_clear_tag ()`.
2023-05-04 16:38:23 +00:00
Luming Zh
df394a35eb Update Chinese (China) translation 2023-05-03 19:33:37 +00:00
Anders Jonsson
5ca592a337 Update Swedish translation 2023-05-03 09:08:58 +00:00
Martin
bb49e9df34 Update Slovenian translation 2023-05-02 09:17:56 +00:00
Yuri Chornoivan
bc940d0e5d Update Ukrainian translation 2023-05-02 06:54:02 +00:00
Ekaterine Papava
eb1ab8d6a7 Update Georgian translation 2023-05-02 04:57:23 +00:00
Jacob Boerema
a57a62ce1a plug-ins: replace deprecated gexiv2 functions in metadata-editor
In the master branch we depend on gexiv2 0.14, so we can remove the
deprecated functions and replace them with the "try_" versions.

We can't backport this, since our stable branch has a lower dependency
for gexiv2.
2023-05-01 19:01:13 -04:00
Jacob Boerema
58e02b4f4e plug-ins: Reimplement date picker in metadata-editor without GtkBuilder
Also changes the dialog title to not have a ':' and make the title
express what the expected action is.
2023-05-01 19:01:13 -04:00
Yuri Chornoivan
c48ce3675b Update Ukrainian translation 2023-05-01 17:03:25 +00:00
Alx Sa
78a72c89ac plug-ins: Port file-ps to use GimpProcedureConfig
This ports the Import and export dialogs to use GimpProcedureConfig.
It covers all properties except GUI-only options
(which were still ported to libgimpui rather than direct GTK calls)

Additionally, a warning was fixed and mnemonics were added to the
property titles.
2023-05-01 07:15:42 -04:00
Sabri Ünal
9ff4072117 Update Turkish translation 2023-05-01 10:54:31 +00:00
Sabri Ünal
9e60755bfe Update Turkish translation 2023-05-01 10:37:28 +00:00
Jacob Boerema
7b6ceabeba po-plug-ins: remove plug-in-metadata-viewer.ui from POTFILES.in
I missed this one in the previous commit.
2023-04-30 16:33:21 -04:00
Jacob Boerema
9c11b40393 plug-ins: create metadata-viewer gui from code
The metadata-viewer uses a GtkBuilder .ui file to create the interface.
In GIMP we prefer our interfaces to be created in code and these builder
files are also not available anymore in GTK4.

This commit removes the .ui file and support code, and creates the
interface from code in our plug-in.
2023-04-30 16:01:40 -04:00
Alx Sa
bca4535c40 icons: Restore GIMP icons replaced by GTK defaults
Five icons in the Layer dockable were being replaced by GTK defaults at
runtime. A "gimp-" prefix was added so that GIMP's version would always
be used. A few dialogues were fixed to use constants rather than
hardcoding the filename, to make it easier to update the icon in the
future.
2023-04-30 13:58:39 +00:00
Alx Sa
5526bebf3c plug-ins: image_id used rather than image in print
In 2.10, print_temp_proc_name () took in the image id. When it was 
updated to take in GimpImage, it still assumed the g_strdup_printf
parameter was an integer.
This is fixed by calling `gimp_image_get_id ()` on the image parameter.
2023-04-30 13:53:16 +00:00
Martin
1f1533b230 Update Slovenian translation 2023-04-28 20:44:31 +00:00
Andre Klapper
6fcac63fbb DOAP: Add support-forum (GNOME Discourse) 2023-04-28 04:41:52 +02:00
Ekaterine Papava
f4d32a7332 Update Georgian translation 2023-04-27 03:44:59 +00:00
Jacob Boerema
d73bae0c66 plug-ins: add support for 8bpp with 4 planes in PCX/DC import
While testing the DCX import MR I saw that one image (abaddon.dcx) was not
recognized. This image uses 4 planes with 8 bpp while we only support
3 planes. The 4 planes type includes an alpha channel.

A few small changes allow us to also load 4 planes by allowing 3 or 4
planes instead of only 3.
2023-04-26 17:27:14 -04:00
Jacob Boerema
f681c50414 libgimpbase: do not save Photoshop specific EXIF metadata
Photoshop can save metadata when exporting to tiff or jpeg, including
a thumbnail that we can't update. This can contain sensitive data, so we
should not export it. See issue #8383.

To do this, we add the two Photoshop specific tags that we know of to the
list of tags that should not be exported, so they won't be saved.
2023-04-26 17:27:14 -04:00
Yuri Chornoivan
876117f4ad Update Ukrainian translation 2023-04-26 18:16:17 +00:00
Alx Sa
6af7b2f5cb plug-ins: Display warning for unsupported metadata
This allows file-psd-load-metadata to show a warning message like the
PSD plug-in does when unsupported features are loaded.
As PSD metadata does not store rasterized versions of fill layers,
a new option is added to show these layers are dropped entirely unlike
with PSDs.
The dialog title changes based on which plug-in called it.
2023-04-26 12:26:31 +00:00
Alx Sa
b5f80f7a14 plug-ins: Load PSD metadata in JPEG plug-in
This adds the PSD metadata plug-in procedure call to the JPEG
plug-in, as part of implementing issue #7549.
Also implements the import half of issue #1842.
JPEGs only store image-level metadata like paths.
2023-04-26 12:26:31 +00:00
Alx Sa
7b6d229be8 plug-ins: Load PSD metadata in TIFF plug-in
This adds the PSD metadata plug-in procedure call to the TIFF
plug-ins, as part of implementing issue #7549.
Also implements the import part of issue #2921.
TIFFs can have both image and layer-level metadata.
The load_paths() function was removed, as the PSD plug-in should
handle this now.
2023-04-26 12:26:31 +00:00
Alx Sa
b788513bcc plug-ins: Add method to load external PSD metadata
Creates a new public procedure that can be used by JPEG/TIFF files to
load any PSD-formatted metadata they have. This consolidates code
to the PSD plug-in, and lets JPEG/TIFF get immediate updates as the
PSD plug-in improves its own metadata support.
Note that only Macintosh formatted metadata is currently supported
by the PSD plug-in; IBM PC formatted metadata is reversed and not
yet interpreted.
2023-04-26 12:26:31 +00:00
Martin
8bd07e468b Update Slovenian translation 2023-04-26 11:19:48 +00:00
Shubham
de5c805cbb app: Modify stroke selection dialog
Changed stroke selection dialog to use GtkStackSwitcher instead of radio
buttons. Make options hidden under "Advanced options" visible by
default.
2023-04-25 12:59:35 +00:00
Ekaterine Papava
15e2adde0c Update Georgian translation 2023-04-25 04:33:45 +00:00
Martin
82e201f93b Update Slovenian translation 2023-04-24 20:17:37 +00:00
Martin
b333b54842 Update Slovenian translation 2023-04-24 20:14:40 +00:00
Yuri Chornoivan
229221c289 Update Ukrainian translation 2023-04-24 17:10:21 +00:00
Yuri Chornoivan
02d2026419 Update Ukrainian translation 2023-04-24 15:31:30 +00:00
Yuri Chornoivan
cd792f831f Update Ukrainian translation 2023-04-24 15:30:23 +00:00
Rodrigo Lledó
b557a8e581 Update Spanish translation 2023-04-24 14:51:02 +00:00
Rodrigo Lledó
08cdf546fc Update Spanish translation 2023-04-24 14:26:56 +00:00
Rodrigo Lledó
0161775738 Update Spanish translation 2023-04-24 14:23:53 +00:00
Alx Sa
7e371c7884 libgimpbase: Add Middle Gray fill option
Uses CIELAB's 50% lightness (18.42% luminance) for the Middle Gray
color.
2023-04-24 10:25:58 +00:00
Ekaterine Papava
e31a2d3d64 Update Georgian translation 2023-04-24 03:34:10 +00:00
Alx Sa
769e36d7cf core: color pick in image's RGB space
Replaces GimpPickableInterface's pixel_to_srgb () functions with
pixel_to_rgb(). Now GimpRGB's values should be in the correct
image color space from the beginning of the process.
2023-04-23 22:03:29 +00:00
Alexander Shopov
5a9df9e77c Update Bulgarian translation 2023-04-23 21:32:53 +00:00
Sabri Ünal
5b7f9fb8eb Update Turkish translation 2023-04-23 21:10:17 +00:00
Sabri Ünal
aa8a4e4504 Update Turkish translation 2023-04-23 20:44:11 +00:00
Alexander Shopov
c46c4f64db Update Bulgarian translation 2023-04-23 20:00:59 +00:00
Alx Sa
da217088d0 plug-ins: Fix rounding error in PCX load
Some valid PCX/DCX files wouldn't load because the bytes per line
header check can be off by one due to integer division rounding.
This adds 1 to the equation to account for this.
2023-04-23 17:37:45 +00:00
Alx Sa
7bc7273d04 plug-ins: Add support for importing DCX files
DCX files are containers that store up to 1023 PCX files.
The PCX plug-in is rearranged to allow reading multiple PCX images per
file, rather than assuming there's only one image.
2023-04-23 17:37:45 +00:00
Alx Sa
73242fe96a plug-ins: Port file-gif-save to...
...GimpSaveProcedureDialog
2023-04-23 17:35:52 +00:00
Yuri Chornoivan
d6b09d4fed Update Ukrainian translation 2023-04-23 13:52:55 +00:00
Alx Sa
222bef78c7 plug-ins: Initial support for Amiga IFF/ILBM
Imports indexed ILBM, Amiga PBM, and ACBM images.
2023-04-22 21:33:27 -04:00
Yuri Chornoivan
8da4e30cdb Update Ukrainian translation 2023-04-22 18:24:51 +00:00
Alexandre Prokoudine
dc49ff9d54 Update Russian translation 2023-04-22 14:53:43 +02:00
Martin
521a8613d6 Update Slovenian translation 2023-04-22 09:07:17 +00:00
Ekaterine Papava
6c9ec76878 Update Georgian translation 2023-04-22 05:29:12 +00:00
Alx Sa
a05213f82a libgimpwidget: Fix GimpFrame line-spacing property
GimpFrame has a property 'line-spacing'. gimp_frame_get_label_spacing ()
tried to access it as 'line_spacing', so it always returned 0.
Fixing the typo should now return the true spacing value.
2023-04-22 03:01:16 +00:00
Jehan
d8c0ddf95f NEWS: update. 2023-04-22 01:57:19 +02:00
Jehan
1584a9ba50 plug-ins: fix the thread rendering the thumbnails all the time.
After testing a bit more, I realized that the thread was constantly re-rendering
the thumbnails, even though I didn't touch the "white-background"
button/argument.
This was not just a completely invisible problem, it actually affected the page
selection (it was very hard to select pages by clicking on them, it was randomly
working, and more often not selecting anything). This is how I realized there
was a problem.

The reason was simply that I was never actually calling g_cond_wait() because of
a first_loop flag I forgot to set.

Note that docs of g_cond_wait() explains that it is possible that "spurious
wakeup" happen. At first I thought I had this issue, which is why this commit
also adds a boolean flag to check after a wakeup, to make sure that I was in the
"condition met" case and not the "spurious wakeup" one.
Even though I realized afterwards the real reason was much more stupid, I still
left this additional check.

Fortunately this issue doesn't seem to affect the 2.10 code. Or to be more
accurate: the continuous render very likely happens there too, yet it doesn't
break page selection interaction with GTK+2 as far as I can see.
2023-04-22 01:29:42 +02:00
Jehan
179ff7ff4d plug-ins: option to choose whether loading a PDF with white background.
Port commit 41f40f530a from gimp-2-10 branch to the main branch:

    While at first, the idea of always loading PDF with transparency seemed good
    (commit 7aff7e9c70), I realized that a lot of administrative PDF (generated with
    text and vector graphics, rather than scans or alike containing raster) actually
    have transparency. So now all these documents load with transparent background.
    Clearly all the office software are assuming that PDF readers will fill the
    background with white.

    So add a checkbox to decide whether or not to fill the image with white. I don't
    update the PDB procedure. I'll just do this on the main dev branch (while also
    updating a bit the code to newer API).

    Fortunately I regularly open such PDF documents with GIMP and could witness this
    no-transparency expectation before we released GIMP 2.10.34! 😅

As side changes, I also:

* ported file-pdf-load to work with GimpProcedureConfig arguments instead of
  GimpValueArray;
* ported the dialog to GimpProcedureDialog and generating as much of it as
  possible (except for the page selector/preview, and resolution entries);
* renamed the "pdf-password" argument to "password";
* added the "target", "antialias" and "white-background" procedure arguments.

A few issues which would deserve to be looked at more closely in the future:

* adding "width" and "height" arguments and decide how to handle "resolution";
  this will likely be better handled with a new GimpVectorLoadProcedure subclass
  to support vector formats in particular;
* shouldn't page selection be handled in a better way? Probably this could be
  handled by adding a generic logic in GimpLoadProcedure (as multi-page support
  is a common feature across image formats);
* GimpInt32Array arguments ("pages") can't be stored anyway right now.
* the "target" arg should be an enum.
2023-04-22 00:24:24 +02:00
Aurimas Černius
41bd71efb9 Update Lithuanian translation 2023-04-21 19:14:37 +00:00
Jehan
0d95b960c5 app: replace deprecated GLib function.
This fixes:

> app/core/gimpitemlist.c:632:7: warning: ‘g_pattern_match_string’ is deprecated: Use 'g_pattern_spec_match_string' instead [-Wdeprecated-declarations]

The new function appeared in GLib 2.70 which is our current minimum GLib
requirement, so the replacement is fine.
2023-04-21 01:09:35 +02:00
Idriss Fekir
99644ff5c9 Issue 7826: "select all" should not be reapplied
To check if "all" is selected call a function added to to channel interface
"is_full".
2023-04-20 21:49:03 +00:00
Jehan
466349762d app: fix broken preset menus in tool options (tool-options-menu.ui).
Generated actions are not necessarily application-wide actions ("app." prefix of
detailed action name). As is the case here, they can be actions specific to a
group only.
2023-04-20 16:56:49 +02:00
Jehan
4b36bff01a app: get rid of unused variable warning.
Warning was:

> gimpsourcetool.c:232:22: warning: unused variable ‘paint_tool’
2023-04-20 15:38:17 +02:00
Jehan
c6906e77da app: get rid of dummy "*-menu" and "*-popup" actions.
With our old code, we needed dummy actions for every submenu. This is not needed
anymore. Actions are only for end menu items (items which actually do something,
not just open a submenu).
Get rid of them all, as well as the code to ignore any action ending with such
suffixes in action-listing pieces of code.
2023-04-20 15:36:11 +02:00
Jehan
8a8914bc21 app: a bit of code cleanup.
Especially some remnants of when Gimp(Toggle|Radio)Action were not descendants
of GimpActionImpl and had to reimplement GimpAction interface.

Also fixing a few details here and there.
2023-04-20 15:36:11 +02:00
Jehan
e3bb3bf57f app: fix address sanitizer error.
The error is:

> app/widgets/gimpdeviceinfo.c:387:13: runtime error: null pointer passed as argument 1, which is declared to never be nul
2023-04-20 15:36:11 +02:00
Jehan
86693d1839 app: free GimpActionGroup's action list in dispose().
This helps make sure we break circular references as soon as possible when
destroying an action group. I also steal the pointer before freeing objects to
make sure the list is empty immediately and any further signal from the actions
won't affect this group.
2023-04-20 15:36:11 +02:00
Jehan
d5aa4f73ac app: add a "color" property to GimpMenuModel.
Note that it will only work for a model attached to a GimpMenu. In particular,
it won't work for the menu bar set to a GtkApplication with gtk_application_set_menubar().

In other words, it won't work on macOS where we let the OS handle the menu.
2023-04-20 15:36:11 +02:00
Martin
ec4ac18178 Update Slovenian translation 2023-04-20 10:59:10 +00:00
Martin
8bcc7545fc Update Slovenian translation 2023-04-20 10:29:00 +00:00
Ekaterine Papava
cd1490dba3 Update Georgian translation 2023-04-20 05:28:28 +00:00
Ekaterine Papava
636a8758da Update Georgian translation 2023-04-20 05:26:20 +00:00
Yuri Chornoivan
2161c31e54 Update Ukrainian translation 2023-04-19 16:36:07 +00:00
Yuri Chornoivan
3a11d3ff30 Update Ukrainian translation 2023-04-19 15:37:35 +00:00
Jehan
564103fdc1 app: allow changing submenu's labels with gimp_menu_model_set_title().
Use this for the "View > Zoom" and "View > Flip & Rotate" submenus which used to
display the zoom level and rotation angle. This regression is now fixed.
2023-04-19 15:21:48 +02:00
Alx Sa
66716e4d04 plug-ins: Port file-xbm to GimpSaveProcedureDialog 2023-04-19 12:32:06 +00:00
Jehan
b0916fe701 Issue #9362: ordered argument format in printf requires no argument "holes".
Though it actually worked in some cases, and failed in others (I have not
figured out which build option exactly makes the format with hole work anyway),
printf manual actually explicitly says:

> There may be no gaps in the numbers of arguments specified using '$'; for
> example, if arguments 1 and 3 are specified, argument 2 must also be specified
> somewhere in the format string.

This explained while it was crashing GIMP (again, only with some build options,
or lack of build options):

> *** invalid %N$ use detected ***

There were 2 possible solutions for this: either ensure that the order number is
always used, but that defeats the purpose of plural localization. Instead I
reorder the argument so that the file name (which must always be shown for sure)
is first in arguments. This way, even if the order number is sometimes omitted
(be it in English or in any language), we avoid the crash.
2023-04-19 14:30:11 +02:00
Alx Sa
e3074df900 tools: Correct Fixed Size toggle behavior
gimp_rectangle_options_fixed_rule_changed is called when either the
checkbox or the dropdown for Fixed Size is changed.
However, the "fixed-size-active" property was not updated until after
it ran, so the toggle behavior is inverted.
This checks to see if the toggle was changed and updates the boolean 
before setting the size field as (in)sensitive.
2023-04-18 01:37:25 +00:00
Sabri Ünal
940fe5e2a9 Update Turkish translation 2023-04-17 15:38:00 +00:00
Sabri Ünal
b766d6654c Update Turkish translation 2023-04-17 15:35:52 +00:00
Sabri Ünal
2c8e4dead5 Update Turkish translation 2023-04-17 15:33:20 +00:00
Sabri Ünal
b39f784ecb Update Turkish translation 2023-04-17 15:08:26 +00:00
Martin
5b94387f72 Update Slovenian translation 2023-04-17 14:06:57 +00:00
Ekaterine Papava
ccaf05728e Update Georgian translation 2023-04-17 04:01:58 +00:00
Yuri Chornoivan
2fde2ed31f Update Ukrainian translation 2023-04-16 17:22:55 +00:00
Alx Sa
88a674c80a plug-ins: Port file-html-table to...
...GimpSaveProcedureDialog
2023-04-16 16:38:17 +00:00
Alexander Shopov
71b695ca83 Update Bulgarian translation 2023-04-16 14:22:35 +00:00
Alexander Shopov
a1ff2902e1 Update Bulgarian translation 2023-04-16 14:20:46 +00:00
Alexander Shopov
b14189defa Update Bulgarian translation 2023-04-16 14:19:08 +00:00
Martin
d29a66fc66 Update Slovenian translation 2023-04-16 12:07:32 +00:00
Martin
3f1ad97f72 Update Slovenian translation 2023-04-16 12:01:04 +00:00
Yuri Chornoivan
f5c77d7d26 Update Ukrainian translation 2023-04-16 08:39:17 +00:00
Ekaterine Papava
4e85d39d8d Update Georgian translation 2023-04-16 01:42:49 +00:00
Alx Sa
70578378dd plug-ins: Port file-mng to GimpSaveProcedureDialog 2023-04-15 23:13:04 +00:00
Alx Sa
7c72202416 libgimp: Fix critical for int SpinScale API
The GimpProcedureDialog API allows int and double  SpinScales. However,
it calls gimp_prop_widget_set_factor () which requires doubles.
A conditional check for a double property was added to this call.
A check was also added to ensure int properties have a factor of 1.0.
2023-04-15 13:40:46 +00:00
Jehan
f785f18892 po*: add menus folder to the POTFILES.skip of various gettext modules. 2023-04-15 14:56:01 +02:00
Yuri Chornoivan
7c91522a83 Update Ukrainian translation 2023-04-14 20:01:36 +00:00
Yuri Chornoivan
f775a097cc Update Ukrainian translation 2023-04-14 19:52:33 +00:00
Ekaterine Papava
1e21af782a Update Georgian translation 2023-04-14 18:08:46 +00:00
Ekaterine Papava
290c617558 Update Georgian translation 2023-04-14 17:45:58 +00:00
Jehan
24048ef862 app: add some longer label variant for dialog actions.
Just "Layers" or "Patterns" was always very confusing. It was even worse when
both tools and dialogs had nearly6 the same name (for instance "Gradient" was
the tool action, but "Gradients" was the dialog).

Now these dialog actions will be labelled more obviously in the action search,
such as "Layers Dialog" or "Gradients Dialog".

Of course, the short name will stay in contextualized menus, such as in the
"Windows > Dockable Dialogs" top submenu, or in the Dockbooks' "Add Tab"
submenu.
2023-04-14 19:27:24 +02:00
Jehan
2511c70e8d Issue #9349: long label variant for tool actions.
While the short label can be "Gradient" for instance, because it is in the
submenu "Tools > Paint Tools", this is a confusing label say in the action
search.

Now the longer label will be used in there and will say:

> Activate tool "Gradient"
2023-04-14 19:15:16 +02:00
Jehan
ea1205f094 Issue #9349: removing 2 duplicate "*-short" actions.
"edit-paste-as-new-image-short" and "vectors-selection-to-vectors-short" were
just duplicate of the action named the same, except for the "-short" suffix, and
the only point was to have different labels.

Not though that this time, it was not enough to conclude that the action in a
menu shoud have the short variant. These were both used differently depending on
the menu.
Instead I added the concept of "label-variant" attribute in .ui menu files. When
the "long" variant is set, then we simply use the longer label.

There is still one more "-short" action: "tools-by-color-select-short", but I am
a still unsure how to handle this one.
2023-04-14 18:54:16 +02:00
Jehan
89772351c9 Issue #9349: Add concept of "short" (contextual) vs "long" label for actions.
All Gimp*ActionEntry (except GimpProcedureActionEntry) now have a short_label
member.
This commit doesn't add any new short label yet. It just fixes the struct usage,
and fixes a few localization contexts here and there when I saw such broken
strings.

I also fixed a few gradient editor action strings which were not proper labels
(like "splitmidpoint" or "splituniform", or missing uppercase, etc.).
2023-04-14 17:48:57 +02:00
Jehan
4aa141603b app: remove unused finalize().
Get rid of an unused variable warning, though the whole function was useless
anyway.
2023-04-14 16:50:18 +02:00
Jehan
6e980dbe36 app: fix weird broken indentation.
Apparently my vim indentation rules got confused by a comment.
2023-04-14 16:35:50 +02:00
Jehan
1b932d10d3 Issue #9349: short and long labels for "windows-display-*" actions.
The short labels are just the file names as we have all the context in the menu
to understand what these actions do (in Windows menu, ordered by view position
and with a `Ctrl+n` shortcut next to each, increasing by position).

In the action search for instance, we keep a 'Show "<image name>"' label.

Also I'm adding a relevant tooltip to further explain what each of these actions
do, using the view position.
2023-04-14 16:33:35 +02:00
Anders Jonsson
9d175f681a plug-ins: fix typos in sparkle 2023-04-14 10:54:05 +00:00
Martin
70bb6fe939 Update Slovenian translation 2023-04-14 10:50:06 +00:00
Martin
998039ffa6 Update Slovenian translation 2023-04-14 10:42:24 +00:00
Alx Sa
82a4f568d4 plug-ins: Port sparkle to GimpProcedureDialog 2023-04-14 04:23:11 +00:00
Ekaterine Papava
71ecdd30ea Update Georgian translation 2023-04-14 04:17:40 +00:00
Alx Sa
fe9b13f43c plug-ins: Update GimpPreview format in despeckle 2023-04-14 02:25:36 +00:00
Anders Jonsson
e0eb79b5c1 Update POTFILES.in 2023-04-13 23:21:49 +00:00
Jehan
341fd90958 Issue #9349: add concept of "short" (contextual) vs "long" label for actions.
Basically actions in menus should show the short label (we assume the menu
position brings contextuality) when available, whereas it will use the longer
label in GUI lacking contextuality.

As a first such usage, the `file-open-recent-*` actions have the file name which
will be opened as short label. This is used in menus since the submenu `File >
Open Recent` ensures that the action which will run is perfectly understandable.
On the other hand, in the action search, the action is named 'Open "<file
name>"' since an action named only with a file name would not be understandable.
2023-04-14 00:17:15 +02:00
Jehan
747cbf70db app: add a "Filters > Generic > GEGL Operations" submenu with generated actions.
Since we now generate actions for GEGL ops, we might as well generate menu items
for these too.

What I did:

- Move the "GEGL Operation…" tool (generic dialog with a drop-down list of all
  non-ignored GEGL ops) to Tools menu.
- Create a "GEGL Operations" submenu in Filters > Generic.
- Move "GEGL Graph" to the top of this new submenu.
- Generate a new menu item for each generated action tied to a GEGL plug-in,
  alphabetically sorted.
2023-04-13 23:06:54 +02:00
Alexander Shopov
0568866871 Update Bulgarian translation 2023-04-13 20:30:34 +00:00
Alexander Shopov
a8ed8a7e0c Update Bulgarian translation 2023-04-13 19:32:03 +00:00
Jehan
d51c64ec06 Issue #9228: make GEGL Operation tool's operations their own actions too.
Though the GEGL Operation tool is still useful as a generic dialog, let's
generate also per-operation (the ones not ignored and not already special-cased
in the rest of the GUI) tools and actions.

These "tools" are mostly hidden (e.g. not selectable in toolbox where it would
be a bit useless as they would show with the generic GEGL icon or none), but
they can be searched with the action search, shortcuts can be assigned and they
can be added to menus.
2023-04-13 21:28:52 +02:00
Alexander Shopov
60354a0e59 Update Bulgarian translation 2023-04-13 19:22:04 +00:00
Yuri Chornoivan
171d9b8f0c Update Ukrainian translation 2023-04-13 16:19:28 +00:00
Jehan
6776439c6f NEWS: update. 2023-04-13 12:18:54 +02:00
Martin
73b73153d3 Update Slovenian translation 2023-04-13 10:04:12 +00:00
Alexander Shopov
5919f44d9d Update Bulgarian translation 2023-04-13 10:03:30 +00:00
Martin
045bc02e15 Update Slovenian translation 2023-04-13 10:01:14 +00:00
Alexander Shopov
4a4ef92120 Update Bulgarian translation 2023-04-13 08:26:23 +00:00
Ekaterine Papava
c3732bfd02 Update Georgian translation 2023-04-13 04:31:32 +00:00
Jehan
0ee620f4e6 menus: fix autotools distclean.
Fixes the following build error on CI:

> ERROR: files left in build directory after distclean:
2023-04-12 22:36:21 +02:00
Jehan
5790adcfd3 menus: do not validate the DTD for GtkBuilder UI format. 2023-04-12 22:07:09 +02:00
Jehan
c7c5f126b1 app: disable some unit tests temporarily.
Since the recent changes, these 3 tests are not working:
- tools
- session-2-8-compatibility-multi-window
- session-2-8-compatibility-single-window

(the 2 latters were only working with xvfb anyway)

I could just dig further as I did a bit these last few days, and tweak more and
more the testing code. But I think our current unit-testing framework is just
non-reliable and for all these years, we have spent more time fixing the tests
than actually relying on them to tell us there is a bug in GIMP.
Furthermore creating new tests is so cumbersome that basically none do it.

I have a plan laid out in #9339 for a much better and more reliable unit testing
infrastructure, based on the GIMP executable itself and a very simple syntax to
create new test scenari (so that even non-developers should be able to create
them eventually). So until then, let's disable these tests and stop wasting
time.
2023-04-12 22:07:09 +02:00
Jehan
aa8ccf3ba8 Issue #6612: support numpad's divide ('/') as secondary action search shortcut. 2023-04-12 22:07:09 +02:00
Jehan
af5612eda2 Issue #3834: keys Copy, Cut and Paste now supported as secondary shortcuts. 2023-04-12 22:07:09 +02:00
Jehan
ab33d032ad app: support Forward and Back keys.
Same as ZoomIn/Out keys, these are implemented as secondary shortcuts to actions
"windows-show-display-next" and "windows-show-display-previous" respectively.

See issue #637.
2023-04-12 22:07:09 +02:00
Jehan
9e8304aeb9 Issue #637: support ZoomIn and ZoomOut special keys.
These will simply be recorded as secondary shortcuts for view-zoom-in and
view-zoom-out.
2023-04-12 22:07:09 +02:00
Jehan
71c8ff1f21 app: change all action entry structs to allow several shortcuts.
- The `accelerator` variable is a NULL-terminated array, allowing up to 3
  accelerators per action (so far, none has more than 2).
- Only the struct GimpProcedureActionEntry still has a single accelerator as I
  don't think it makes sense that we change the plug-in API to allow a plug-in
  to register more than 1 shortcut for a procedure (e.g. we don't want a plug-in
  to just register all possible keys for their procedure!).
  Of course, users will still be allowed to register more shortcuts for plug-in
  actions through the shortcut dialog. It's only the initialization which
  1-shortcut max for procedure actions.
- Remove all actions ending up in "-accel" as these were only a trick to
  register more shortcut for a same action. Now we just have the real
  possibility (rather than creating bogus duplicate actions). As a consequence,
  these actions accelerators have been moved as secondary accelerator to their
  main action.
  The deleted actions are: "view-zoom-out-accel", "view-zoom-in-accel",
  "view-zoom-16-1-accel", "view-zoom-4-1-accel", "view-zoom-2-1-accel" and
  "view-zoom-1-1-accel".
2023-04-12 22:07:09 +02:00
Jehan
d6a86b1ab7 app: fix "Remove all Keyboard Shortcuts" and "Reset Keyboard Shortcuts to…
… Default Values" buttons in Preferences.

I considered just deleting the "Remove all shortcuts" action, because really I
am wondering how useful (and often used) it is, and if we are not over-featuring
the shortcut code.
I could find the origin commit 6da388be93, from 2006. Basically the use case is
for people who want such a different mapping overall that it's much better to
start from a blank slate (e.g. DVORAK users, like in the original report).
See: https://bugzilla.gnome.org/show_bug.cgi?id=331839

So in the end, I just reimplemented this with newer code.

Also this commit fixes the "Reset Keyboard Shortcuts to Default Values" code.
2023-04-12 22:07:09 +02:00
Jehan
beb093f549 app: remove the "Save" button from the "Configure Keyboard Shortcuts" dialog.
This was always confusing to people that they had to click "Save" then "Close".
With new code anyway, any change is instantly put into effect, and the only
point of "Save" is to actually store immediately in the shortcutsrc file. But
this is clearly not very clear to people (and it can be done in the Preferences
dialog too).

Instead let's just have a "OK" button. The file will be actually updated on exit
only (if "Save keyboard shortcuts on exit" is checked). And that's it.

The only missing feature would be the ability to cancel the latest changes
before hitting OK, i.e. having a "Cancel" button too. Let's see to do this
later.
2023-04-12 22:07:09 +02:00
Jehan
817ee1c660 app, docs, etc.: transform menurc in shortcutsrc after an update.
Also get rid of various old references to menurc and don't install it anymore to
etc/ (neither the new shortcutsrc as it doesn't look like it brings much value
to do so).
2023-04-12 22:07:09 +02:00
Jehan
42bc6ba1c0 app: fix ignoring paths with parentheses.
I had the case of a path with parentheses in the folder name. Just don't assume
any character should not be in a path.
2023-04-12 22:07:09 +02:00
Jehan
73f607fd73 app: the menu "paths" must be based on the English original whereas…
… the actual labels can be localized.

This fixes menu creation when GIMP is localized.
2023-04-12 22:07:09 +02:00
Jehan
df0bd8c183 app: cleanly delete the UI manager and action groups associated to finalized…
… dock windows.

This fixes crashes which happen when switching from multi-window mode to single
window mode.
2023-04-12 22:07:09 +02:00
Jehan
2967020d16 app: verify shortcutsrc exists before parsing it. 2023-04-12 22:07:09 +02:00
Jehan
7d1155af4a Issue #5601: Command Search (/) Results to show Menu Path. 2023-04-12 22:07:09 +02:00
Jehan
32f93c49de app: handle duplicate accelerators in shortcutsrc parsing. 2023-04-12 22:07:09 +02:00
Jehan
8383928790 app: comment-out actions using default shortcuts in shortcutsrc.
This uses a new concept of "default shortcuts" which must be called only once at
most per action. Any subsequent shortcuts setting are custom settings.

Commenting these lines out is mostly informational as it allows to see in a
quick glimpse in shortcutsrc file which are custom shortcuts or not.
2023-04-12 22:07:09 +02:00
Jehan
94ebb4f821 app: serialize and deserialize the actions' accelerators.
gtk_accel_map_load()/gtk_accel_map_save() are not working with the new
GAction-based code. GtkApplication does not seem to have helper functions to
simply load and save accelerators in a file, so we just implement it ourselves.

A few things are missing right now, namely:

- On parsing, it doesn't handle any kind of duplicate accelerators (possible
  especially if someone edited the new shortcutsrc manually).
- On reading, maybe we should only write down the changed (from defaults)
  actions, while keeping the old ones commented-out, as menurc used to be. This
  is actually useful info both for debugging or even for users who want to look
  at this file and see what they changed.
- We should add import code to transform the menurc into shortcutsrc when
  updating GIMP, otherwise all custom shortcuts would get lost.

There is still the question on whether we should add the group name too. I think
we should, expecially for plug-in's procedure actions, though right now these
are just added in the GtkApplication's main action group anyway. I'll see later
to refine this.
2023-04-12 22:07:09 +02:00
Jehan
0278480f87 app: new gimp_action_set_group() and gimp_action_get_group().
Now that we don't have any action duplicated in groups based on names (i.e. that
there could just be 2 actions with the same name in different groups), let's
have the GimpAction also store its group.

Use this to fix some code which was now crashing when confirming erasing an
existing shortcut.
2023-04-12 22:07:09 +02:00
Jehan
d4fb4362c9 app: fix unit tests with GUI.
Run them with the new GApplication logic, otherwise the various new
parts (such as actions) are not properly loaded.
2023-04-12 22:07:09 +02:00
Jehan
6324357051 app: add a weak pointer to GimpEditor's UI Manager.
I only came into a problem during unit-testing while trying to access an
already destroyed ui_manager.
2023-04-12 22:07:09 +02:00
Jehan
a752ad5e07 app, menus: add an application menu for systems which wants this.
In particular on macOS, we want to show some default common actions (see
comments in !837) but gtk_application_prefers_app_menu() docs says that it will
always return FALSE on this OS. So we ignore this call on macOS.
2023-04-12 22:07:09 +02:00
Jehan
634bb0836e menus: fix dialogs_dockable_actions being in 2 groups.
Depending on where it's used, this list of action can be either in the
"dockable" or the "dialogs" action group.

The meson rule is a bit more complicated than I wished it were because of the
ever-so-blocking lack of simple dependency in meson.
Cf. my latest comment: https://github.com/mesonbuild/meson/issues/8123#issuecomment-1496168759
2023-04-12 22:07:09 +02:00
Jehan
3e6735872a menus: make sure the generated menus are rebuilt when inserted submenu is…
… modified.
2023-04-12 22:07:09 +02:00
Jehan
9753755249 app: fix action's proxy button clicks.
Using gimp_action_activate() ensures we call the action with the expected
GVariant for the specific class of action (and not a NULL GVariant).
2023-04-12 22:07:09 +02:00
Jehan
f3eb6e1677 app: GimpUIManager and GimpActionGroup are for a given (id, user_data) couple.
This deals in particular with the dockable issue. Each dockbook needs its own
GimpUiManager and the action groups inside, which are identified by a string
identifier but also by a different user data (allowing to identify the specific
dockbook an action was call from, so that for instance you close the right
dockable).

It also makes the name requirement of plug-in procedure more flexible as a
procedure name clash can only happen between plug-in procedures now (not with
core actions).
2023-04-12 22:07:09 +02:00
Jehan
caf4c68c71 app: move special-casing of radio action submenus from GimpMenu to GimpMenuModel.
This is a continuation of previous work where we are slowly moving to most logic
being in GimpMenuModel so that it works both when we create menus ourselves or
when we let GTK do it for us (e.g. the main menu bar in macOS).
2023-04-12 22:07:09 +02:00
Jehan
ce776c947d app, menus: progressively move to action group logics. 2023-04-12 22:07:09 +02:00
Jehan
d9b9fa0acd app: only <Image> GimpUIManager's actions should be application actions. 2023-04-12 22:07:09 +02:00
Jehan
e8294660cc app: make GimpActionGroup a subclass of GActionGroup.
It should make it possible to attach an action group to a widget, instead of
making it global to the application. This will be useful/used for context
actions, such as actions which are only relevant to a dock and which will
therefore be duplicated to each dock (with the specific dock as user action so
that we work on the right part of the GUI).

I have not implemented all virtual methods. Not sure if they are all necessary.
2023-04-12 22:07:09 +02:00
Jehan
9b0c1b6f62 app, menus: fix the "Recently Closed Docks" auto-filling menu.
It was actually working fine except that I wrongly named the submenu somehow,
but even more particularly I thought it was about single dockables (tabs)
whereas it was about full detached docks (a window containing several
dockables/tabs).
2023-04-12 22:07:09 +02:00
Jehan
bd4e17dd1e menus: the .xml files are now unneeded (replaced by .ui files). 2023-04-12 22:07:09 +02:00
Jehan
b76d46d75b app: fix Makefile for the new objects created for the GAction port. 2023-04-12 22:07:09 +02:00
Jehan
228af9c3c1 app: only update the menu items which changed.
As a further optimization (even though the big slowness situation is
mostly resolved anyway by a previous commit), let's not rebuild whole
submenus when only a few items were added or removed.

1. First make so that the action "visible" property is only notified
   when the visibility actually changes. This way, we can trust that the
   visibility of the item and of the related action are properly synced.
2. Now when an action which is part of a model changes its visibility,
   we trigger the proper "items-changed" only for the added or removed
   item. This replaces the old procedure of removing then adding
   everything (i.e. a full reset).
3. Add some utilities in gimpwidgets-utils (out of gimpmenushell.c).
   This cleans up some code and also fixes some bugs which were
   reimplementing (badly) some code I already implemented (right) in a
   static function.
4. Fix adding new actions in sub-sub… menus. Previous code was only
   showing the direct parent, not up to the root menu (this could happen
   for plug-in procedure items in particular).
2023-04-12 22:07:09 +02:00
Jehan
ff684fbeb4 plug-ins: remove "Animators" placeholder from script-fu scripts. 2023-04-12 22:07:09 +02:00
Jehan
6bed6e1ef8 app: properly remove action from the application when no longer used.
When an action is removed from a group, we verify if it's not in any group
anymore. If so, we remove it from the GimpApp action map.

This fixes some CRITICALs happening when some actions were dynamically deleted
and re-created, in particular the "windows-display-XXXX" actions.
2023-04-12 22:07:09 +02:00
Jehan
50a3bb57ee app: don't notify "enabled" when the sensitivity didn't change.
This was the main reason for the slowness of the new GUI as it was triggering
far too much useless code far too often.
2023-04-12 22:07:09 +02:00
Jehan
16656e7076 app, libgimpwidgets: last GtkUIManager and GtkAction usage in libgimpwidgets.
These were the last use of the old GtkAction API and it was particularly
annoying here as this widget is used both in core GIMP and in plug-ins, yet core
GIMP actions were not GtkAction anymore (so the "activate" signal handler's
signature was different, which would crash the core code).

Now the clash is resolved as this widget just uses GAction (which both
GimpAction, for core code, or GSimpleAction, for plug-ins, are).

This is also the absolute last use of GtkAction (and other related API) in all
our code (core, libgimp* and plug-ins). \o/
2023-04-12 22:07:09 +02:00
Jehan
2196c7585c app: no GtkAction or GtkActivatable API call anymore in core code! 2023-04-12 22:07:09 +02:00
Jehan
e724a9bff3 app: GimpActionGroup is not a GtkGroup anymore, but a GimpObject descendant!
I've hesitated if we should make it a GActionGroup, whose API handles actions
fully through name strings. I didn't see what it brings us short-term compared
to the additional work, so for now it's just a class of its own, not
implementing GActionGroup interface. Maybe later.
2023-04-12 22:07:09 +02:00
Jehan
60e80b28da app: fix creating submenus for plug-ins.
This got broken since the new GimpMenuModel implementation.
2023-04-12 22:07:09 +02:00
Jehan
38d0abc026 app: prevent multiple registrations of a same action.
Pre-GIMP-3.0 code logics would re-allocate several GimpMenuFactory or
GimpUIManager for no good reason. While it was still working with old GtkAction
code, with our new GAction-based code, we were ending up overriding an action
with a new version of the same action, while keeping reference to old actions.
This made for discrepancies of the enabled or visible state of actions.

The new code keeps singleton of some objects and references to already
registered GimpUIManager or GimpActionGroups objects and make sure no actions
with the same name are created twice.
2023-04-12 22:07:09 +02:00
Jehan
fd05b75cf7 app: GimpUIManager not a subclass of GtkUIManager anymore! 2023-04-12 22:07:09 +02:00
Jehan
45b2e8c783 app: remove some gtkosxapplication code.
Unless mistaken, this is not needed anymore. New GtkApplication code should take
care of creating the native macOS application menu for us.

Cf. also contents of MR !558.
2023-04-12 22:07:09 +02:00
Jehan
55cd88bd8d app: using GtkApplication menubar with GIMP_GTK_MENUBAR environment variable.
Testing the 2 code paths is otherwise extremely annoying. Let's just add an
environment variable allowing us to run one or the other implementation if the
variable is set.
2023-04-12 22:07:09 +02:00
Jehan
1637dd1cd4 app: new GimpMenuModel object, which is our own implementation of GMenuModel.
Since GAction don't have labels or visibility, it is up to every application to
fill the GMenuModel with such infos. In my previous implementation, I was simply
handling these in GimpMenuShell subclasses (GimpMenu, GimpToolbar and
GimpMenuBar) since we need them for tooltip support (unavailable from GMenu).

Nevertheless there are cases where we want to use GTK API directly with a
GMenuModel, in particular with gtk_application_set_menubar(). This is necessary
to handle the macOS specific code path, where we don't want our usual menu bar.
This OS has its own display of a software menu bar, directly in the desktop GUI.
See !558 for some screenshots of this.

So this commit moves around some code away from GimpMenuShell subclasses into
the new GimpMenuModel class. Now we use this new class instead of simpler GMenu
objects. It handles syncing with GimpAction-s, auto-updating labels, visibility
and sensitivity, as well as adding custom items (plug-in actions, recently
opened files, opened images, etc.).
2023-04-12 22:07:09 +02:00
Jehan
475bd45d32 app: GimpActionGroups listed in GimpUIManager directly.
Getting rid of more GtkUIManager code.
2023-04-12 22:07:09 +02:00
Jehan
4251c931c7 app, menus: big cleanup of most of GtkUIManager API.
Only remaining API are action group-related.

While doing this, I also remove 2 debug actions which don't look like they were
outputting any information anyway (at least on the main dev branch):
"debug-dump-items" and "debug-dump-managers".
2023-04-12 22:07:09 +02:00
Jehan
aff946b051 libgimpwidgets: fix menu item with tooltip without help ID.
In such a case, we may not want to connect to "query-tooltip", yet we still want
the normal tooltip to show up. This was a case for instance for the recently
opened file actions ("file-open-recent-*") or opened image actions which were
not showing their tooltips.
2023-04-12 22:07:09 +02:00
Jehan
3cbdb93358 app: do not destroy GimpUIManager immediately on "hide".
When we do this, their actions are not properly run, because this happens after
the "hide" signal. So we need to detach the popup in an iddle function (so that
it runs after all in-progress signal handling happen), which will in turn
removes the last reference to the object.
2023-04-12 22:07:09 +02:00
Jehan
57a0fd4dbf app, menus: fix tool options menus.
My last commit message was slightly wrong. I had one last special case to
handle: the ability to only create sub-GimpMenuShell (i.e. at a specific path
other than the root).
We are using this ability in particular for tool options submenus.
2023-04-12 22:07:08 +02:00
Jehan
033aa8e71b menus: add all the missing menus in the new GtkBuilder format!
I was handling all the problematic cases first. These remaining menus are
working fine otherwise by just implementing them, as far as my tests go.
2023-04-12 22:07:08 +02:00
Jehan
55dc688759 app, menus: use the new GimpToolbar in the GimpTextEditor. 2023-04-12 22:07:08 +02:00
Jehan
da32f539d8 app: new GimpToolbar widget.
It's still pretty simple now and allows to add toolbar buttons and separators
(at start or end). There is no possibility of runtime-customization yet, but in
the future, it would be great to allow such ability and use this widget for a
main window toolbar which people can customize to add quick access to their
favorite actions.
2023-04-12 22:07:08 +02:00
Jehan
f492871e88 app: better use GimpMenuShell and shift around some code as virtual…
… function implementations.

I am also preparing to create a new class GimpToolbar which will make good use
of the interface too.
2023-04-12 22:07:08 +02:00
Jehan
8a2d895ae8 app: fix non-reactive display shell after popping up tool menus.
The canvas was not reactive to any pointer or keyboard event until we hit
Escape. This was because we needed to reset the `mod_action` variable.
2023-04-12 22:07:08 +02:00
Jehan
bd4cb8f67a app: improve GimpMenuShell handling of GimpRadioAction and GimpToggleAction.
Somehow the toggle actions were not working correctly on GimpMenu popped up e.g.
as dockbook menus (but it was fine in the GimpMenuBar). I straightened up the
code to be a bit clearer. I also rely on the "toggled" signal rather than
"change-state" (the latter is supposed to happen before state change actually
happen). It now works much better.
2023-04-12 22:07:08 +02:00
Jehan
e800159847 menus: add dashboard-menu with proper placeholder support. 2023-04-12 22:07:08 +02:00
Jehan
987f86a218 app: make sure widgets exist when an action change state.
Otherwise it may end up in crashes while exiting GIMP. The widget must be alive
or the signal handler removed.
2023-04-12 22:07:08 +02:00
Jehan
9c7469fb22 app, menus: handle the case where a menu is used both as popup and submenu.
Several menus can be triggered either as popups on their own when right-clicking
the dockable or on items, or as a submenu in the docks main menu.
In the former case, we want the menu items to be at the root level, whereas in
the latter case, we want them inside a properly named submenu.

To handle this, I wrap these in a properly labelled <submenu> in the .ui files,
and I add a boolean flag to gimp_menu_shell_fill() which will drop the top
submenu if and only if this is the only top item. I use this flag only when
using these menus as popup menu on their own.

Also fixing a few memory leaks around these pieces of code.
2023-04-12 22:07:08 +02:00
Jehan
87a22a37ae app: run action group's update functions when changing gradient editor's…
… selection.

Since we change some actions' group name depending on the selected editor's
segment, we need to update actions accordingly.
2023-04-12 22:07:08 +02:00
Jehan
2335e14d59 app: add the gradient editor submenu and a new concept of GimpRadioAction's…
… group name.

The gradient editor submenu add 2 submenus with changing names. It was using
again bogus actions: "gradient-editor-blending-func" and
"gradient-editor-coloring-type" do nothing except for being used as name
holders.

Instead I add the concept of group name for GimpRadioAction-s and when I use a
radio action attribute as <submenu>, this submenu will use the group name (and
sync with it, if it changes).
2023-04-12 22:07:08 +02:00
Jehan
b1f022f144 app, menus: now support the child menu of the GimpDockbook menu.
I only translated the undo menu into GtkBuilder's .ui format for now.
The only missing part is that the icon is now shown.

Note that in various parts, I don't rely anymore on a bogus menu action (i.e.
"undo-popup" action in this case) which does nothing but has an associated label
and icon. I simply add the label and icon as submenu attribute directly in the
.ui file, which is translatable and whose strings should be parsed by gettext.

Eventually I'll just get rid of all the various "*-popup" or "*-menu" bogus
actions.
2023-04-12 22:07:08 +02:00
Jehan
1b48792089 app: do not register shortcuts with deprecated GtkActionGroup code anymore. 2023-04-12 22:07:08 +02:00
Jehan
83c466bdec app: don't implement GtkAction activate() anymore.
All action types work fine with GAction activate() now.
2023-04-12 22:07:08 +02:00
Jehan
4776b092bd app: action names set in GimpToolControl don't need the group name appended.
Not with the new GAction-based actions.
2023-04-12 22:07:08 +02:00
Jehan
082bec3721 app: GimpEnumAction don't implement anything from GtkAction anymore. 2023-04-12 22:07:08 +02:00
Jehan
9f1fd64a41 app: GimpRadioAction is now a subclass of GimpRadioAction.
We now completely got rid of all GtkToggleAction and GtkRadioAction code in the
whole of GIMP!
2023-04-12 22:07:08 +02:00
Jehan
a813f82252 app: GimpToggleAction is now a GimpActionImpl subclass. 2023-04-12 22:07:08 +02:00
Jehan
dcd911ba60 menus: implement a bunch of menus in GtkBuilder format.
It's not all of them yet, just the ones which work out of the box with current
code and which I could easily trigger.
2023-04-12 22:07:08 +02:00
Jehan
9c5812ffbb app: use the new GimpMenu so that we instantly get much nicer looking menus! 2023-04-12 22:07:08 +02:00
Jehan
7af01cbb16 app: new GimpMenu widget and GimpMenuShell interface.
The new GimpMenu is derived from GtkMenu. Both GimpMenu and GimpMenuBar are now
implementing GimpMenuShell which allows to share a lot of the logic for filling
the menus, adding items, etc.
2023-04-12 22:07:08 +02:00
Jehan
06b7242cc0 app: rename GimpMenu to GimpMenuBar.
This is better in sync with GTK naming (GtkMenuBar), but especially, it will
allow me to make a GimpMenu subclass of GtkMenu.
2023-04-12 22:07:08 +02:00
Jehan
4e038a66a6 app: remove more of GtkAction API.
This is less and less a GtkAction. Note that I don't implement
gimp_action_get_name() because once we will drop completely GtkAction and make
GimpObject the parent, we can just use gimp_object_get_name().
2023-04-12 22:07:08 +02:00
Jehan
c20039b25e app: move "visible" property to GimpAction, rather than GtkAction. 2023-04-12 22:07:08 +02:00
Jehan
47ff65aa86 menus: add a dockable-menu with the new GtkBuilder format.
The dialogs-menuitems is shared between dockable-menu and image-menu, just as it
was with the old format. For this, we use XSL transformation with XInclude, then
drop the namespace (because GTK doesn't like the unknown namespace being defined
and crash immediately otherwise).
2023-04-12 22:07:08 +02:00
Jehan
f9fec03751 app: display shell popup menu now uses GMenuModel.
The menu is still very incomplete, but it's a start.
2023-04-12 22:07:08 +02:00
Jehan
8ec589915a app: only show the new menubar now. 2023-04-12 22:07:08 +02:00
Jehan
6ecfc4a77b plug-ins: more placeholders removed from menu paths. 2023-04-12 22:07:08 +02:00
Jehan
c8a2f77c98 plug-ins: don't use "Send" placeholder either. 2023-04-12 22:07:08 +02:00
Jehan
5b009690f4 app: correctly show the pixbuf set with gimp_procedure_set_icon_pixbuf()…
… next to item labels for GtkMenuItem proxy widgets (e.g. in main menu).
2023-04-12 22:07:08 +02:00
Jehan
9eea95255a plug-ins: remove the "Acquire" of the menu path.
This is a placeholder which is not meant to appear in the menu. Our new system
uses placeholders internally, but plug-ins cannot make use of these.

Not sure anyway if this is so useful in the cases of plug-ins. At least, I don't
feel it is for these particular use cases.
2023-04-12 22:07:08 +02:00
Jehan
c1fc3cf8eb app: display the optional (main) shortcut next to menu items.
Also getting rid of gimp_action_get_proxies() API which is now unneeded, I
think. Furthermore GimpMenu does not have to connect to label changes. Making
the items proxies of a GimpAction is enough to have them updated.
2023-04-12 22:07:08 +02:00
Jehan
9485b4ef5b app: implement F1 help binding on GimpMenu. 2023-04-12 22:07:08 +02:00
Jehan
01a4feb784 app, libgimpwidgets: GimpAction proxy widgets will display the proper tooltip.
The tooltip contains the reason for action inactivity, if relevant. And in case
of a GtkMenuItem in particular, it will also contain the "Press F1 for more
help" text at the bottom.
2023-04-12 22:07:08 +02:00
Jehan
63e48171a4 app: fix activating GimpEnumAction in the GimpMenu.
Not sure why gtk_actionable_set_action_name() works fine to activate base
GimpActionImpl, but not subclasses like GimpProcedureAction or GimpEnumAction
(and maybe others subclasses?), such as the "file-open-recent-*" actions. This
will have to be investigated further IMO.
2023-04-12 22:07:08 +02:00
Jehan
d73337680d app: rename the dynamic label for the "file-open-recent-*" actions.
While in the menu, under a contextual "Open Recent" submenu, it is well
understandable, the action is much less understandable without context, e.g. in
the action search. So I prepend an "Open" prefix.

Maybe a future alternative could be to have GimpAction have both contextual and
non-contextual labels (a.k.a. short vs long label)?
2023-04-12 22:07:08 +02:00
Jehan
69a780babb app: add proxy support to GimpAction/GimpMenu.
The proxy properly shows a color area or viewable (depending on context), and
this is properly updated when the associated properties are changed.

The label change is also properly updated in the label part of the proxy.

Very relevant actions to test the proxy items are dynamically updated are
generated actions such as the "file-open-recent-*" actions (with both label and
viewable updates), or again the Edit > "Fill with (FG|BG Color)|Pattern" (with
color/pattern updates).
2023-04-12 22:07:08 +02:00
Jehan
2f70d1a154 app, menus: add the generated actions in the main menu.
These are the menu items such as the recently opened images, or recently used
filters, etc.

Some notes:

- I added back a "placeholder" concept in the GimpMenu logic. This will allow to
  place items at specific positions in the menu (either under the placeholder,
  which will make the last item be on top or above the placeholder to have the
  last item be in the bottom, depending on needs). Technically placeholders are
  just menu items with a label (used as placeholder key) and no associated
  action, which I will leave invisible.
- I add a logic for submenus so that they are invisible by default and are only
  made visible when we add a menu item with an action in there.
- I removed filling the "/Filters/Recently Used/Plug-ins" placeholder. As far as
  I could see, it was never filled (neither with old or new code) and the
  "/Filters/Recently Used/Filters" actually already takes care of filling the
  "Recently Used" submenu with both GEGL operations and plug-in calls.
- The old gimp_ui_manager_add_ui() API is for all types of menus, e.g. including
  the ones created by dockables or elsewhere whereas my new API is (for now)
  still specific to the top menu. This will have to be further implemented
  later. I left a bunch of "TODO GMenu"-s for the time being.
- I see 2 dock-related generated items which seem to never be added, for
  recently added and closed docks. It doesn't seem to work in the old API as
  well. I'll want to have a closer look too.
2023-04-12 22:07:08 +02:00
Jehan
37c11f0134 app: support adding new items and submenus to GimpMenu.
In particular, we use this to add the actions created by GimpPlugInProcedure
(i.e. by plug-ins) to the main menu.
2023-04-12 22:07:08 +02:00
Jehan
f66e893bb3 app: GimpMenu also monitors the "label" and "tooltip" properties of GimpAction.
Some actions in particular can change their label. E.g. "file-export" and
"file-overwrite" will have customized labels containing the imported or exported
file name. The menu will now reflect such changes, live.
2023-04-12 22:07:08 +02:00
Jehan
66eeb4fe6c app, menus: make GimpMenu item visibility sync on action visibility. 2023-04-12 22:07:08 +02:00
Jehan
19b03fcc43 app: make "sensitive" a GimpAction property.
I'm starting to override GtkAction properties, starting with "sensitive" in
order to finally move away from GtkAction. Obviously, this breaks the
sensitivity check of the original menu.
2023-04-12 22:07:08 +02:00
Jehan
ed8a4f7410 app: fix a segfault which may happen randomly.
I could reproduce this while closing GIMP immediately after starting it.
Sometimes the idle source would be running and working on now finalized objects.
2023-04-12 22:07:08 +02:00
Jehan
3119ad4c34 app: toggle and radio item are now correctly synced with their action state.
In particular, when running actions from somewhere else (i.e. the action
search), the menu render is updated.
2023-04-12 22:07:08 +02:00
Jehan
febb9dccd6 app: fix default values of 2 actions.
"windows-show-tabs" and "windows-use-single-window-mode" were set to FALSE by
default, while it is now supposed to be TRUE, same as the config properties. The
discrepancy was only showing with my new GimpMenu which better follows the
action's state.
2023-04-12 22:07:08 +02:00
Jehan
342ad2c37f app, menus: very early prototype for a GimpMenu.
This demonstrates a first version of our replacing menu, using GAction and
GMenuModel. I had to make our own subclass of GtkMenu to process the model (from
a .ui XML file) for the following reasons:

* gtk_menu_new_from_model() doesn't support tooltips, which is a feature we use
  quite extensively in GIMP: with all our filters, being able to give a longer
  description is often useful; moreover we use tooltips to give hints about why
  a menu item is deactivated as well.
  Unfortunately it looks like GTK doesn't consider this lack as a problem and
  don't plan on adding tooltip support.
  See: https://gitlab.gnome.org/GNOME/gtk/-/issues/785
* I won't to avoid copying action's label and icons in the .ui file. This only
  duplicates strings and would be a source of issues each time we change
  action's strings (we'd have to do it in 2 places, which someone will
  inevitably forget).

Now it still has various issues:

* The syncing between actions and menu items need to be cleaned up. It's still
  in early demo code.
* It uses directly some Gtk*Action code because GimpRadioAction and
  GimpToggleAction are not directly related right now (only through their
  parents).
* gtk_application_set_menubar() might still be necessary on macOS as I think
  it's what enables the native menu system on this OS. It means that we'll have
  to edit the menu model to add back the labels (as this function does not
  extract these from the linked action since GAction has no label or icon
  concept).
* Icons are not taken into account right now.
* I'll have to verify if GimpAction with proxy work (but my guess is that right
  now, it won't).
* Action's active state is not synced with menu item active state right now.
* Various actions are inserted live, such as opened images, opened views,
  recently opened images, and so on. This needs to be implemented back.
* Plug-ins need to be able to create their own menu item into this new menu.
* For all these various reasons, I'm keeping the old menu around, for the sake
  of comparison, until the time the new one becomes feature-full.

Part of this commit is inspired by !558 and obsoletes this MR.
2023-04-12 22:07:08 +02:00
Jehan
b6a99077dc app: gimp_action_activate() uses GAction API.
Since GimpAction-s are currently both a GtkAction and a GAction, let's use the
GAction API for activating actions.
2023-04-12 22:07:08 +02:00
Jehan
1b54616492 app: don't make "context" mandatory on a GimpAction.
Simply with a NULL context, we can't set or get accels from a GimpAction. Having
a mandatory context was a problem for GimpColorButton which could create a
GimpAction even though libgimpwidget has no knowledge of GimpContext.
2023-04-12 22:07:08 +02:00
Jehan
a98a903976 app: get rid of gimp_action_(g|s)et_accel_path(). 2023-04-12 22:07:08 +02:00
Jehan
ef645695c2 app: unique accelerator check now happens on the GAction/GtkApplication. 2023-04-12 22:07:08 +02:00
Jehan
3f85fee2e7 app: GimpActionEditor now keeps a Gimp object instead of GimpUIManager. 2023-04-12 22:07:08 +02:00
Jehan
68d862b3c2 app: fully get rid of gimp_action_get_accel_closure().
All the remaining pieces of code where the deprecated concept of accelerator
closure was still used have now been replaced by proper GimpAction API using the
newer GAction API.
2023-04-12 22:07:08 +02:00
Jehan
39315fe6a2 app: GimpActionView uses newer GAction-based API.
It's still not perfect, especially as we might want to get back GimpActionGroup
for this specific dialog (it may be nicer than an overlong list of actions). And
overall, I am not fond of this interface so maybe I'll want to review how we
display and change actions too. Moreover we now have the ability to set several
shortcuts per action, which was a really wanted feature and this dialog doesn't
allow this yet.

I'll get back later at this widget, but for now, it is a step forward for
deprecation.
2023-04-12 22:07:08 +02:00
Jehan
05968c35e5 app: GimpAccelLabel now closure-free.
- New gimp_action_get_display_accels() added to GimpAction API to get directly
  the human-visible strings for actions.
- Also adding an "accels-changed" signal to GimpAction. As far as I can see,
  even though accelerators are now to be set on the GtkApplication, there seems
  to be no signals or properties to connect to at all on this class. So instead,
  let's do it on our GimpAction (which means we must absolutely not use
  gtk_application_set_accels_for_action()).
- GimpAccelLabel now uses the proper GimpAction API instead of accelerator
  closure which is a disappearing concept.
2023-04-12 22:07:08 +02:00
Jehan
9ff9d16367 app: use the GAction shortcut for the toolbox's color area.
In particular, there is no concept of accel closure for actions anymore in
GAction, which means that eventually gimp_action_get_accel_closure() will have
to disappear too.
2023-04-12 22:07:08 +02:00
Jehan
e04d85e0f9 app: get rid of one more deprecated usage of gdk_screen_make_display_name(). 2023-04-12 22:07:08 +02:00
Jehan
fd7ec4df6a app: make sure the "%s-move-to-screen-%s" have valid action names.
Depending on the OS, the display name may contain characters which are not valid
for action names. In particular, on X11, the display name could be ":0.0" and
therefore we get actions named "app.dock-move-to-screen-:0.0" or
"app.view-move-to-screen-:0.0". The ':' is invalid, which will make calling
gtk_application_get_accels_for_action() (or more simply our new function
gimp_action_get_accels()) fail.
See docs of g_action_parse_detailed_name().
The new utils function gimp_make_valid_action_name() will help us get rid of
invalid characters for actions whose name was generated from strings we don't
totally control.

Furthermore gdk_screen_make_display_name() is now deprecated API, and more
generally gdk_display_get_n_screens() is deprecated too and now always returns 1
since GTK+ 3.10 (i.e. now each display only contains a single screen). Instead
we just use gdk_display_get_default_screen() for every GdkDisplay. So this
commit doubles as GTK/GDK deprecation cleanup.
2023-04-12 22:07:08 +02:00
Jehan
9f62bd5822 app: remove useless gimp_core_app_finalize().
If we want to reuse this in subclasses, we'd need to overwrite finalize() in the
subclasses, call gimp_core_app_finalize() and chain up with the parent class.
Not doing this until now was leading us not to call GApplication or
GtkApplication finalize() function, which in turn, in the later case, was
leaking all the GAction-s which were added to the GActionMap. I realized this as
a leaking GimpContext-s warning was printing when ending GIMP.
2023-04-12 22:07:08 +02:00
Jehan
ae7ddfd5f5 app: better label the "windows-display-[0-9]*" actions.
Adding a 'Show" before the image identifier, which is now between quotes, and
making this string localizable.
This makes the action more understandable, especially when listed in
less-contextual UI such as the action search.
2023-04-12 22:07:08 +02:00
Jehan
835d8c3455 app: add gimp_action_set_accels().
It's just a lot nicer to set and get accelerators directly through the
GimpAction. It also makes more sense within GIMP context.
2023-04-12 22:07:08 +02:00
Jehan
726e690d38 app: make the GimpContext a mandatory property for a Gimp*Action.
Making the action be context-awareness will be useful, in particular as we'll
have access to the GtkApplication.
2023-04-12 22:07:08 +02:00
Jehan
c8845c95ec app: move more of GimpActionImpl code into GimpAction. 2023-04-12 22:07:08 +02:00
Jehan
453f5670b3 app: move get|set_disable_reason() implementation from GimpActionImpl to GimpAction.
The obvious reason why it was not implemeted in GimpAction is because as
interface, it cannot have a private struct.
Yet actually we can, by setting the struct as qdata on the object, as we do in
several other interface. This allows to move implementation of functions or
properties for things which make no sense to reimplement each time we implement
a subclass.
2023-04-12 22:07:08 +02:00
Jehan
a4e7bfdf23 app: rename "layers-mask-add-last-values" action as …
… "Add La_yer Masks with Last Values".

Add the "with Last Values", otherwise the shown label is the same as
"layers-mask-add" action, which is confusing (until we read the longer
description/tooltip).
2023-04-12 22:07:08 +02:00
Jehan
147e8c7d91 app: "layers-mask-add-button" should be GUI-blacklisted.
It's basically a conveniency action for internal usage, which is similar to
"layers-mask-add" (except for sensitivity rules). In particular, I don't want to
see 2 seemingly identical actions in the action search.
2023-04-12 22:07:08 +02:00
Jehan
0d2c30d2df app: use GAction API directly in GimpLayerTreeView. 2023-04-12 22:07:07 +02:00
Jehan
3383d160d4 app: GimpToolButton now uses GAction API.
There were 2 pieces of code where I was unsure of the use. I left them
surrounded by `#if 0` macros and a comment for the time being, to easily find
them later if we encounter issues.
2023-04-12 22:07:07 +02:00
Jehan
9b568f960c app: Quit dialog now uses GAction directly.
Note that I could edit the GimpUiManager directly to use the GAction API, but I
feel like it is adding a level of complexity to existing GIO/GTK API. So right
now, I am planning to either get rid of it or really simplifying it a lot.
2023-04-12 22:07:07 +02:00
Jehan
764cbe53f3 app: actions in GimpStatusBar directly calls GAction. 2023-04-12 22:07:07 +02:00
Jehan
385b697a60 app: "gtk-can-change-accels" feature is ignored since GTK+ 3.10.
We had this feature "can-change-accels" where people could change their shortcut
directly by browsing the menu. It was on the property "gtk-can-change-accels" in
GtkSettings. Unfortunately this got deprecated in GTK+ 3.10 (more accurately in
dev version 3.9.8, according to GTK's NEWS file), and is therefore ignored since
then. In other words, whether we check the box or not in our Preferences, it
doesn't do a difference.

If we want to get the feature back some day, we'll have to reimplement it with
custom code. In the meantime, there is no need to leave this visible in
Preferences.
2023-04-12 22:07:07 +02:00
Jehan
4f8357d7f6 app: Action Search does not use GimpUiManager anymore.
It directly uses the action added to the GtkApplication/GActionMap.
2023-04-12 22:07:07 +02:00
Jehan
35b5729bcc app: add all our actions in the GApplication.
Right now, our actions are added both in the GActionMap (a.k.a. as
GApplication|GtkApplication) and with the old GtkActionGroup API. The later code
is meant to be removed soon.

A major difference with the old implementation is that we don't add the actions
in separate action groups. Even though GLib has a GActionGroup concept, these
don't seem to be used at all when adding actions on the GtkApplication level.
It might mean that eventually we will even remove the GimpActionGroup code and
move everything up one level.

Of course, I am still evaluating if we really want an action group concept, in
which case, we could simply recreate it, but I'm actually unsure how useful it
is. The only place where I see a use to this is in the shortcut settings (to
organize actions by groups), but even there, it was rarely useful to me. I
usually rather search for actions by text search anyway.
2023-04-12 22:07:07 +02:00
Jehan
dfcc339e15 app: fix non-properly matching gimp_image_undo_group_start/end() calls. 2023-04-12 22:07:07 +02:00
Jehan
d735ba10ea app: GimpRadioAction and GimpToggleAction are now GAction-s.
Since these were not children of GimpActionImpl, I had to reimplement basically
the same code, which is kinda ugly. When we'll have finally gotten rid of any
dependency to Gtk*Action, these 2 classes should be re-parented under
GimpActionImpl, hence simplifying their code.
2023-04-12 22:07:07 +02:00
Jehan
c65a4e8a5c app: override GAction's activate() virtual method for GimpDoubleAction, …
… GimpStringAction, GimpEnumAction and GimpProcedureAction.

All these are child classes of GimpActionImpl.
2023-04-12 22:07:07 +02:00
Jehan
72b6f9246c app: GimpActionImpl is now also a GAction.
A good chunk of the code is taken from GSimpleAction implementation in GLib.

Thanks to Lukas Oberhuber for his early attempt to implement something similar.
2023-04-12 22:07:07 +02:00
Martin
4b622770a1 Update Slovenian translation 2023-04-12 19:54:53 +00:00
dimspingos
30558d7489 Updated Greek translation 2023-04-12 21:19:10 +03:00
Alx Sa
5112394636 Issue #9340: Make To/From property less ambiguous
Translators noted these might be confused with To/From fields in email.
Revising labels to match load dialogue UIs.
2023-04-11 16:59:45 +00:00
Daniel Novomeský
bcac1107b5 build: update meson options in MSYS2 build 2023-04-11 10:44:18 +02:00
Jacob Boerema
ef7f955e1e pdb, libgimp: improve function documentation for sample points
- gimp_image_add_sample_point: guide is a left-over from copy-pasting and
add apostrophe
- gimp_image_get_sample_point_position: it was not clear that the
parameter was the y-offset and the return value the x-offset
2023-04-09 21:32:00 -04:00
Ekaterine Papava
c3c991c527 Update Georgian translation 2023-04-09 17:55:27 +00:00
Yuri Chornoivan
9ab7d07476 Update Ukrainian translation 2023-04-09 17:20:16 +00:00
Andre Klapper
e71b39df3f Update GIMP Help ID for Drop Shadow filter
109f14cf39
2023-04-09 18:12:32 +02:00
Alx Sa
4828970fa8 plug-ins: Restore original preview when disabled
I noticed after porting the last few plug-ins that GimpPreview went
to black when you unchecked the auto-preview option.
These widgets must be added directly to the dialogue rather than via the
new API in order for the unfiltered image drawable to be loaded
properly. They will eventually be removed in favor of on-canvas preview,
but let's get them working correctly for now.
2023-04-09 12:19:24 +00:00
Alx Sa
37e114612c plug-ins: Port destripe to GimpProcedureDialog. 2023-04-09 11:49:13 +00:00
Martin
f1ef708d63 Update Slovenian translation 2023-04-09 07:35:07 +00:00
Yuri Chornoivan
9bc52d72db Update Ukrainian translation 2023-04-09 06:24:15 +00:00
Ekaterine Papava
32b5afb6c7 Update Georgian translation 2023-04-09 02:27:07 +00:00
Alx Sa
d171355703 plug-ins: Port nl-filter to GimpProcedureDialog 2023-04-09 02:13:46 +00:00
Ekaterine Papava
43b4ec765a Update Georgian translation 2023-04-08 20:01:14 +00:00
Alx Sa
cefb9c92ea plug-ins: Port jigsaw to GimpProcedureDialog 2023-04-08 15:34:29 +00:00
Ekaterine Papava
138aae527a Update Georgian translation 2023-04-08 04:01:27 +00:00
Martin
45e7b3790e Update Slovenian translation 2023-04-07 21:21:43 +00:00
Alx Sa
651bda7728 plug-ins: Port contrast-retinex to...
...GimpProcedureDialog
2023-04-07 16:30:38 +00:00
Hugo Carvalho
c051f70378 Update Portuguese translation 2023-04-07 10:07:31 +00:00
Hugo Carvalho
60700b763c Update Portuguese translation 2023-04-07 10:04:46 +00:00
Alx Sa
c2b1ce5030 plug-ins: Port blinds to GimpProcedureDialog.
Also, update despeckle to close config when cancelled.
2023-04-07 04:06:59 +00:00
Ekaterine Papava
cc437dafec Update Georgian translation 2023-04-07 02:25:02 +00:00
Alx Sa
2368add7e7 plug-ins: Port despeckle widgets to use...
...GimpProcedureDialog APIs.
Adaptive and Recursive checkboxes were converted to a combobox since
they affect one property.
2023-04-07 00:18:51 +00:00
Yuri Chornoivan
e9a5e1eda0 Update Ukrainian translation 2023-04-06 17:34:17 +00:00
Jehan
ddb572bcae libgimp: fix GIR creation warning.
The warning was:

> Warning: GimpUi: gimp_procedure_dialog_fill_scrolled_window: unknown parameter 'contents_id' in documentation comment, should be 'property'
2023-04-06 17:55:23 +02:00
Ekaterine Papava
024aac2ae1 Update Georgian translation 2023-04-06 03:34:49 +00:00
Alx Sa
e6a679f233 plug-ins: Port bmp-save widgets to use...
...GimpDialogProcedure functions rather than gimp_prop_* directly.
Minor typos in the original descriptions were also fixed.
2023-04-05 17:43:23 +00:00
Yuri Chornoivan
7d827d6ec1 Update Ukrainian translation 2023-04-05 17:12:58 +00:00
Jehan
3d70cbd5a8 app: use GIMP_TESTING_ABS_TOP_SRCDIR rather than UI_TEST.
I realize that UI_TEST is only used in our meson scripts and is therefore not a
reliable environment variable to check for whether we are running a unit test or
not. GIMP_TESTING_ABS_TOP_SRCDIR should be present for all unit testing, on both
build systems.
2023-04-05 17:21:52 +02:00
Jehan
1993f7461a meson: API binding options transformed to features.
- Lua, Javascript and Python were boolean defaulting to true, which was
  installing them even when not available (and if not installed then, it
  would show warnings at each run). Instead I make them features with
  'auto' as default. In this default, we don't install when the
  interpreters are absent.
- These 3 options can still be forced by setting them to 'enabled' (the
  interpreters are not actually necessary during build).
- Vala behavior stay the same (and unlike other binding, you cannot
  force it since it has a build step); it's only renamed to just "vala"
  for consistency of option naming.
2023-04-05 16:46:10 +02:00
Jehan
cc6cc6f09a app: do not call inhibit code while unit-testing.
The real problem was not actuall logout-inhibition, but availability of the
GtkApplication. Anyway this feature is not really to block the system while
unit-testing but for saving people's actual work. Let's just disable running it
in test case.

This will fix the CI.
2023-04-05 13:16:43 +02:00
Martin
501be51817 Update Slovenian translation 2023-04-05 09:31:14 +00:00
Martin
3c7e347a0b Update Slovenian translation 2023-04-05 09:29:15 +00:00
Ekaterine Papava
6137751107 Update Georgian translation 2023-04-05 04:34:52 +00:00
Ekaterine Papava
11225f5029 Update Georgian translation 2023-04-05 04:25:49 +00:00
Alx Sa
a148b56779 plug-ins: Port file-aa to GimpSaveProcedureDialog 2023-04-05 02:05:33 +00:00
Jehan
942b78f857 NEWS: update. 2023-04-05 00:03:08 +02:00
Jehan
bce051d2a4 Issue #431: handle logoff, reboot and shutdown events.
GIMP will now inhibit the LOGOUT event on OSes which support it.
2023-04-04 23:29:14 +02:00
Yuri Chornoivan
c71c93bb0f Update Ukrainian translation 2023-04-04 18:42:29 +00:00
Alx Sa
faf2be6dff actions: Standardize usage of "Soft-proofing"
Per #9269, every UI in GIMP but the Softproof Profile wrote it as
"Soft-proof". Now all menu options are consistent.
2023-04-04 17:46:21 +00:00
Martin
d71c18cb4f Update Slovenian translation 2023-04-04 06:25:21 +00:00
Ekaterine Papava
c46d6f7dc4 Update Georgian translation 2023-04-04 00:15:11 +00:00
Jehan
508a6351c9 app: fix a call to gimp_edit_paste() (fixing buffers-paste* action). 2023-04-04 01:56:20 +02:00
Daniel Novomeský
1f4ce4c51f flatpak: install QOI header 2023-04-03 17:38:31 +02:00
Daniel Novomeský
04b97dc97c build: enable QOI format on Windows
and associate in the installer.
2023-04-03 09:45:10 +02:00
Ekaterine Papava
77d3aa1a5b Update Georgian translation 2023-04-03 04:48:09 +00:00
Yuri Chornoivan
784cc1c54b Update Ukrainian translation 2023-04-02 17:44:45 +00:00
Jacob Boerema
2894b2191d plug-ins: fix criticals in scripts with page size == step size
Two of our scripts have a spinbutton step size the same as the page size.
Since page size should be larger than the step size, this causes a
CRITICAL in LibGimpWidgets:
gimp_label_spin_set_increments: assertion 'step < page' failed

We fix this by setting a page size larger than step size in
coffee.scm and tileblur.scm.
2023-04-02 13:09:57 -04:00
Alx Sa
ac9f620c2d plug-ins: Port file-gbr, file-psp to new API.
Ports both to use GimpSaveProcedureDialog.
(Note that file-psp's export function is currently unused)
2023-04-02 12:43:50 +00:00
Martin
7e1ba7a527 Update Slovenian translation 2023-04-02 09:12:34 +00:00
Asier Sarasua Garmendia
91d2d416f1 Update Basque translation 2023-04-02 07:48:01 +00:00
Yuri Chornoivan
514c665dea Update Ukrainian translation 2023-04-02 06:11:28 +00:00
Ekaterine Papava
e77e0c42a0 Update Georgian translation 2023-04-02 03:09:32 +00:00
Alx Sa
4e8c7b8e89 plug-ins: Port file-pnm to GimpSaveProcedureDialog 2023-04-02 02:55:17 +00:00
Alx Sa
01e0941dbc plug-ins: Port file-fli to GimpProcedureDialog API
Also, port the save dialog to use GimpSaveProcedureDialog API.
2023-04-02 01:20:09 +00:00
Yuri Chornoivan
cc9167f76f Update Ukrainian translation 2023-04-01 17:50:59 +00:00
Yuri Chornoivan
56ca88111f Update Ukrainian translation 2023-04-01 17:48:28 +00:00
Alx Sa
06ee7a999a plug-ins: Port sgi.c to GimpSaveProcedureDialog 2023-04-01 17:41:51 +00:00
Alx Sa
66e6d5a727 po-plugins: Add plug-ins/common/file-qoi.c to...
POTFILES.in.
2023-04-01 13:51:42 +00:00
Martin
33559135f2 Update Slovenian translation 2023-04-01 06:57:14 +00:00
Ekaterine Papava
e596b14967 Update Georgian translation 2023-04-01 04:37:35 +00:00
Alx Sa
6ce835b9d7 plug-ins: Port DDS load dialog widgets to use...
GimpProcedureDialog APIs. Also add mnemonics.
2023-04-01 02:03:55 +00:00
Alx Sa
f15b144a81 libgimp: new gimp_procedure_dialog_fill_scrolled_window()
This allows plug-in developers to create GTKScrolledWindow with the
procedure dialog API.
2023-03-31 20:26:53 +00:00
Alx Sa
f9eec671a9 plug-ins: Port JPEG2000 to GimpProcedureConfig
This ports the optional load dialogue to use GimpProcedureConfig.
2023-03-31 14:09:48 +00:00
Martin
da92021df6 Update Slovenian translation 2023-03-31 13:50:38 +00:00
Daniel Novomeský
318148abca plug-ins: fix QOI meson script 2023-03-31 14:15:57 +02:00
Alx Sa
6892ab0530 plug-ins: Add import/export support for QOI file
Allows users to import and export 8 bit, RGB/RGBA Quite Ok Images.
Inspired by Piotr Fusik's work on a plug-in for 2.10.
2023-03-30 18:41:56 +00:00
Asier Sarasua Garmendia
a3053edd42 Update Basque translation 2023-03-30 18:22:00 +00:00
Asier Sarasua Garmendia
62b71c4789 Update Basque translation 2023-03-30 18:07:03 +00:00
Yuri Chornoivan
41d44a1b63 Update Ukrainian translation 2023-03-30 14:16:28 +00:00
Ekaterine Papava
a2b74ef670 Update Georgian translation 2023-03-30 04:23:40 +00:00
Alx Sa
958af23775 plug-ins: Restore mnemonics to file-csource 2023-03-30 04:07:33 +00:00
Yuri Chornoivan
05a3854f8f Update Ukrainian translation 2023-03-30 03:48:59 +00:00
Alx Sa
7f74820b8d plug-ins: Port file-csource to use...
...GimpDialogProcedure functions rather than gimp_prop_* directly.
2023-03-30 02:04:00 +00:00
Tim Sabsch
fa4538683a Update German translation 2023-03-29 09:58:24 +00:00
Martin
b77a64980b Update Slovenian translation 2023-03-28 08:06:38 +00:00
Ekaterine Papava
4e7c6bc922 Update Georgian translation 2023-03-28 05:19:04 +00:00
Hugo Carvalho
4e86f4020f Update Portuguese translation 2023-03-27 22:45:50 +00:00
Yuri Chornoivan
c0f004c356 Update Ukrainian translation 2023-03-27 19:00:20 +00:00
Asier Sarasua Garmendia
23e3621e3a Update Basque translation 2023-03-27 18:12:11 +00:00
Asier Sarasua Garmendia
951312d4b6 Update Basque translation 2023-03-27 18:10:42 +00:00
Asier Sarasua Garmendia
ecf25a6a7d Update Basque translation 2023-03-27 18:07:08 +00:00
Asier Sarasua Garmendia
08b7629ecc Update Basque translation 2023-03-27 18:07:01 +00:00
Asier Sarasua Garmendia
a70e31ffd0 Update Basque translation 2023-03-27 18:05:39 +00:00
Alx Sa
e599a9be59 plug-ins: Add option to override PCX 1 bit palette
If a 1 bit PCX image is opened interactively, a dialogue will let
users choose to either use the built-in palette, or force the colors to
be black/white only. Otherwise, the user can choose this via a script
parameter.
2023-03-27 15:53:05 +00:00
Hugo Carvalho
ce75607dd2 Update Portuguese translation 2023-03-27 15:49:13 +00:00
Ekaterine Papava
8d5636aed2 Update Georgian translation 2023-03-27 04:24:01 +00:00
Anders Jonsson
7c4ad8aed7 plug-ins: typo and spacing fixes 2023-03-26 19:20:48 +00:00
Jacob Boerema
f9217862cf app, tests: fix not running tools tests under meson
The meson build had the tools tests disabled unlike the autotools build.
Since enabling them doesn't cause any problems, let's enable them for
meson too.
2023-03-26 13:26:57 -04:00
Jacob Boerema
a62cad35be app, meson: fix single window test failure
Our CI meson tests for single window failed even though the sessionrc
looked the same as the one created by the autotools tests.

Looking at the Makefile.am it explicitly states that the tests shouldn't
be run in parallel or in a different order than specified, which was not
the case in our meson build.

We change this by setting is_parallel to false for each build, and
setting a different priority for each test. Since higher priority values
execute first we count down.
2023-03-26 13:26:57 -04:00
Jacob Boerema
078cccf4f5 build, meson: fix headless tests not being run with meson
I noticed that in our CI meson job certain tests were skipped, which didn't
happen with autotools.
On examination I noticed these tests check for HAVE_XVFB_RUN. Even though
meson checks for xvfb-run etc, it doesn't set HAVE_XVFB_RUN.

Adding HAVE_XVFB_RUN allows the tests to run without skipping certain parts.
2023-03-26 13:26:57 -04:00
Jehan
1d43b65144 plug-ins: fix authorship.
It looks like my commit 3d55452933 broke authorship of the "file-jp2-load"
procedure. This was very likely a copy-paste error.
2023-03-26 19:19:07 +02:00
Danial Behzadi
4d56ad943c Revert "Update Persian translation"
This reverts commit d3057f2e38
2023-03-26 11:10:26 +00:00
حجت‌اله مداحی
d3057f2e38 Update Persian translation 2023-03-26 11:00:30 +00:00
Martin
fb5a33b538 Update Slovenian translation 2023-03-26 08:53:16 +00:00
Yuri Chornoivan
e826637f5e Update Ukrainian translation 2023-03-26 06:54:31 +00:00
Ekaterine Papava
c0b0c82162 Update Georgian translation 2023-03-26 05:11:47 +00:00
Alx Sa
054934565f plug-ins: Port file-xpm widget to use...
...GimpDialogProcedure functions rather than gimp_prop_* directly.
2023-03-26 02:19:07 +00:00
Alx Sa
dd12d06631 plug-ins: Port file-pat dialog to use...
...GimpDialogProcedure functions rather than gimp_prop_* directly.
2023-03-26 01:56:38 +00:00
Alx Sa
7b5f241591 plug-ins: Add compatibility notice to PSD export
Users have noted that legacy layer modes have better compatibility
when exporting PSDs and reopening them in Photoshop.
This patch adds a notice with that information to the PSD export GUI.
2023-03-25 18:04:42 +00:00
Jacob Boerema
6871a0cfc4 plug-ins: more improvements in file-gif-load
- Use a pre-defined MAXDATABLOCKSIZE for all the buffers filled with
GetDataBlock that is known to be large enough.
- When reading comments ensure that it always ends with a NULL.
- Ensure that the right/bottom frame dimensions are also within range.
2023-03-25 13:37:54 -04:00
Jacob Boerema
d86f6a2d6f plug-ins: improve error messages in file-gif-load
Inspired by issue #9195 I went over how we handled error messages when
loading GIF images.
- I replaced some cases with g_set_error and added an error parameter to
ReadImage.
- Introduced function read_error that uses g_set_error when image == NULL,
or else g_message.
- Enabled translations for the messages.
- Synchronized the error messages used to reduce the amount of work for
translators.
- Changed the error code returned internally in a few places, to be better
able to distinguish between encountering and end_code (-2) and possible
corruption errors (-1).
- Moved allocating dest down to not need freeing it in case of error.
- Allow to show partial results in case of errors.
2023-03-25 13:37:54 -04:00
Yuri Chornoivan
45455428dd Update Ukrainian translation 2023-03-25 16:56:07 +00:00
Ekaterine Papava
0323b798e0 Update Georgian translation 2023-03-25 01:24:07 +00:00
Hugo Carvalho
3607decda7 Update Portuguese translation 2023-03-24 22:58:54 +00:00
Alx Sa
0dc98936a0 plug-ins: Prevent buffer overflow in ANI metadata
The IART and INAM metadata fields were stored in gchar arrays,
which have a limit of G_MAXSHORT indexes.
However, you can have strings larger than that in the format.
To prevent overflows, they were changed to gchar*. f_read ()'s result
is also checked, and an error is set if it returns 0.
The frame count variable is also now reset per icon block to prevent
overflow as well.
2023-03-24 18:43:13 +00:00
Ekaterine Papava
b78b8a80ec Update Georgian translation 2023-03-24 05:21:25 +00:00
Martin
a5865aa61d Update Slovenian translation 2023-03-23 17:37:31 +00:00
Jehan
371925e16b build: sync beta and nightly flatpak manifests.
I'm actually syncing with a branch which I can't test right now because flathub
seem to have some breakage. For the nightly, let's just directly push as anyway
we can't test in Gitlab MRs either because of the non-master jobs timeout.
See: https://github.com/flathub/org.gimp.GIMP/pull/202

We should always keep the diff between these files to a minimum.
2023-03-23 15:44:27 +01:00
Jehan
23a0f22614 build: improve further the flatpak README.
- Fix the markdown styling.
- Add commands on how to build GIMP from the local repository instead of a brand
  new clone (otherwise I don't see how one could develop with flatpak). I knew
  it were possible, but until today, I never tried to do this so I had to test
  first.
2023-03-23 15:12:12 +01:00
Jehan
5e1a7b15da build: remove outdated cron file and update our flatpak howto.
- The cron file was from the very early flatpak experiments before Flathub came
  into the picture, as well as the GNOME Nightly repository. Back then, we
  wanted to set up our own nightlies or release repository through a cron.
- It is still interesting to keep some instructions for local builds of the
  flatpak as some people want to use this for development (but all the part
  about exporting to a repository, signing, etc. is now unneeded for such use
  case). So I'm updating the howto to more current recommendations.
- `flatpak-howto.txt` renamed to `README.md`.
2023-03-23 14:38:08 +01:00
Yuri Chornoivan
747e015381 Update Ukrainian translation 2023-03-23 13:09:29 +00:00
Yuri Chornoivan
5617f9ebd2 Update Ukrainian translation 2023-03-23 13:08:08 +00:00
Alx Sa
e7695c2b57 plug-ins: Port file-tga widgets to use...
...GimpDialogProcedure functions rather than gimp_prop_* directly.
2023-03-23 02:45:55 +00:00
Martin
9573997f45 Update Slovenian translation 2023-03-22 22:07:09 +00:00
Anders Jonsson
d4d9c2bcf5 Update Swedish translation 2023-03-22 21:48:44 +00:00
Daniel Novomeský
2e6e5f0321 plug-ins: Port file-heif to GimpProcedureDialog 2023-03-22 20:05:27 +00:00
Michael Schumacher
61943ca11b gitlab-ci: Use tee to get flatpak job output on stdout and into a log file. 2023-03-22 18:58:44 +00:00
Martin
405d8b765f Update Slovenian translation 2023-03-22 15:14:44 +00:00
Ekaterine Papava
be026d4cba Update Georgian translation 2023-03-22 02:25:06 +00:00
Yuri Chornoivan
d5c523580a Update Ukrainian translation 2023-03-21 19:24:28 +00:00
Alx Sa
cc04035a54 plug-ins: Port file-sunras widgets to use...
...GimpDialogProcedure functions rather than gimp_prop_* directly.
2023-03-21 18:54:15 +00:00
Martin
51a5112793 Update Slovenian translation 2023-03-21 07:25:45 +00:00
Ekaterine Papava
d3560e1eb8 Update Georgian translation 2023-03-21 06:03:15 +00:00
Yuri Chornoivan
ad2aca633f Update Ukrainian translation 2023-03-21 05:26:18 +00:00
Alx Sa
0bc38d9df2 plug-ins: Make WebP preset names translatable
Resolves #9252
2023-03-21 00:48:25 +00:00
Ekaterine Papava
4990ed4f34 Update Georgian translation 2023-03-20 23:54:06 +00:00
Martin
c42038fae8 Update Slovenian translation 2023-03-20 22:00:32 +00:00
Yuri Chornoivan
b3b8f0f840 Update Ukrainian translation 2023-03-20 16:54:17 +00:00
Alx Sa
c034c383c3 plug-ins: Port wavelet decompose in to...
...GimpProcedureConfig.
This ports the main dialogue to use GimpProcedureConfig.
2023-03-20 11:50:25 +00:00
Yuri Chornoivan
728973a9ef Update Ukrainian translation 2023-03-19 06:53:06 +00:00
Martin
91d869c4b7 Update Slovenian translation 2023-03-18 22:49:22 +00:00
Alx Sa
bcce4607c5 plug-ins: Port hot-plug-in to GimpProcedureConfig
This ports the main dialogue to use GimpProcedureConfig.
2023-03-18 19:27:00 +00:00
Hugo Carvalho
50a028ac33 Update Portuguese translation 2023-03-18 09:45:01 +00:00
Martin
ad7a2e53eb Update Slovenian translation 2023-03-17 09:11:57 +00:00
Jehan
6ffdea6a17 LICENSE: add a note about data/ licensing for future added data.
I am adding this note as a consequence of this discussion on Pixls.us:
https://discuss.pixls.us/t/gimp-patterns-and-the-gpl-license/35969

Now we were always very clear that GIMP can be used for whatever use you want
and that the project doesn't intent to claim any rights on produced artworks.

There is even a FAQ entry about the fact we don't intend to put any restriction
on people's work (though this FAQ entry was added in 2015 AFAICS):
https://www.gimp.org/docs/userfaq.html#can-i-use-gimp-commercially

Yet it's better to be as clear as possible. Therefore this new note in the
LICENSE file will serve to make sure any new data is properly licensed CC0 by
the simple fact of contributing it.
This is similar to the fact that people contributing patches to core GIMP (app/)
are implicitly licensing it as GPL. Now people contributing data to data/ are
implicitly licensing it as CC0 as per our LICENSE file.
2023-03-16 23:20:44 +01:00
Ekaterine Papava
ac85f19752 Update Georgian translation 2023-03-16 20:39:56 +00:00
Yuri Chornoivan
4766f2c81a Update Ukrainian translation 2023-03-16 17:47:21 +00:00
Alx Sa
bbccf2656a plug-ins: Port align-layers to GimpProcedureConfig
This ports the main dialogue to use GimpProcedureConfig.
It also adds the GUI-only options to the procedure itself, so that you
can call them via scripts.

Additionally, the layer warning was fixed and 
mnemonics were added to the
property titles.
2023-03-16 00:15:14 -04:00
Alx Sa
0ce773da76 plug-ins: Fix potential crash in PSD CMYK export
@Wormnest notified me of issues with CMYK profiles overwriting existing
ones, and potentially access a dereferenced profile.
This patch adds an additional condition check, and clears out the
profile in addition to dereferencing it.
2023-03-15 00:30:11 +00:00
Balázs Úr
e7f5263b9c Update Hungarian translation 2023-03-15 00:22:49 +00:00
Balázs Úr
ea2b0a3818 Update Hungarian translation 2023-03-15 00:03:40 +00:00
Balázs Meskó
26e917e93b Update Hungarian translation 2023-03-14 23:43:38 +00:00
dimspingos
418e747853 Update Greek translation 2023-03-14 22:54:06 +02:00
Jacob Boerema
ecbcc4c4a4 build: fix ci failure due to partial missing bg in windows installer
Bulgarian was added to the installer po files and LINGUAS, but the other
files needing updates were forgotten. Let's fix that.
2023-03-14 14:17:19 -04:00
Alx Sa
6d02eb4505 plug-ins: Recognize https:// in ImageMap plug-in
This adds "https://" as a valid website prefix in the ImageMap URL edit
field, in addition to http://.
It also restores the prefix change that 2.10 had when you switched URL
types. It also fixes code formatting in affected areas.
2023-03-11 21:53:12 +00:00
Michael Schumacher
d7216f5e49 gitlab-ci: Add xvfb to win32 and win64 image, because we now attempt to run wine there. 2023-03-11 19:48:47 +01:00
Balázs Úr
e3f150b241 Update Hungarian translation 2023-03-10 23:45:51 +00:00
Alx Sa
66271e1e56 actions: Disable Arbitrary Rotation menus if...
...no image is active.
There are Arbitrary Rotation options under both the Image and Layer
menus. All of those rotation options are disabled without an image open.
To keep consistency, this disables those menu options as well.
The Tools menu Rotation option is left as-is.
2023-03-07 20:45:48 +00:00
Hugo Carvalho
9d73413c3d Update Portuguese translation 2023-03-07 19:15:52 +00:00
Piotr Drąg
9e9367c412 Update Polish translation 2023-03-05 13:51:17 +01:00
Martin
e8a9f1cc45 Update Slovenian translation 2023-03-05 10:43:28 +00:00
Yuri Chornoivan
787a3d3dff Update Ukrainian translation 2023-03-05 07:48:42 +00:00
Anders Jonsson
949c6d43c3 plugins: Remove extra word, spacing 2023-03-04 07:13:52 +01:00
Yuri Chornoivan
3b77af9264 Update Ukrainian translation 2023-03-03 14:50:15 +00:00
Martin
9448842b79 Update Slovenian translation 2023-03-03 08:32:26 +00:00
Ekaterine Papava
97f5e74215 Update Georgian translation 2023-03-03 05:33:28 +00:00
lapaz
9908a06896 app: Increase width of position/size boxes ...
... in rectangle select tool. This allows boxes to display larger
values up to 7 characters.

Resolves: #9034 (GNOME/GIMP tracker)
2023-03-03 09:57:14 +06:00
Alx Sa
1d45fc0808 plug-ins: Show unsupported PSD features in GUI
Adds a new PSDSupport struct to keep track of what unsupported features
a PSD contains.
It is then used to conditionally display a compatibility notice
via a GUI.
2023-03-03 02:34:32 +00:00
Sveinn í Felli
2c533abe9f Update Icelandic translation 2023-03-01 11:35:14 +00:00
Sveinn í Felli
4804d69fdb Update Icelandic translation 2023-03-01 10:17:54 +00:00
Jordi Mas
32a92f76fd Update Catalan translation 2023-02-28 22:19:20 +01:00
Sveinn í Felli
ad073dedda Update Icelandic translation 2023-02-28 18:43:44 +00:00
Sveinn í Felli
82826f2a30 Update Icelandic translation 2023-02-28 18:33:04 +00:00
Alx Sa
dbaea2ac50 core: Fix CSS palette import regex
GIMP expects CSS palettes to end with a ";" when importing. However,
GIMP exports CSS lines without ";". This means GIMP can't reopen its
own exported CSS palettes.
The ";" was removed from the regex since CSS2 does not require
the last line to end with a ";". However, CSS3 and above
require ending all lines with a ";", so it is added to the
export script.
2023-02-28 16:00:03 +00:00
Sveinn í Felli
340edf4f1e Update Icelandic translation 2023-02-28 14:08:56 +00:00
Sveinn í Felli
f852b8e572 Update Icelandic translation 2023-02-28 13:18:35 +00:00
Alexander Shopov
1f46063e52 Add Bulgarian translation 2023-02-27 21:49:42 +00:00
Alexander Shopov
c25bcf4ca4 Add Bulgarian translation 2023-02-27 21:47:27 +00:00
Daniel Novomeský
359ce849bc Fix flatpak release info about JPEG XL
(cherry picked from commit d8566241a0)
2023-02-27 01:47:17 +01:00
Tim Sabsch
1fd4b270e2 Update German translation 2023-02-25 21:16:30 +00:00
Michael Schumacher
c689c41841 gitlab-ci: Install dependencies for ASCII art and PostScript plug-ins. 2023-02-25 11:09:22 +01:00
Michael Schumacher
39f4029bfc gitlab-ci: python3-zstandard is a Debian package. pip3 requires a venv to install packages now. 2023-02-25 10:47:50 +01:00
Michael Schumacher
1f3a2475fc gitlab-ci: gi-docgen is a Debian package, installing it through pip3 seems to fail on some runners 2023-02-25 10:37:55 +01:00
Tim Sabsch
24ecaf3f34 Update German translation 2023-02-24 21:37:39 +00:00
Alx Sa
3df39dee91 plug-ins: Re-add toggle behavior from GAction port
When porting IFS-Compose and GFig to GAction, I originally created
all icons as GtkToolButtons. However, the toggle buttons no longer 
appeared "pressed in" when selected.

This is fixed by creating those as GtkToggleToolButtons instead.
A lingering UIManager object was removed from IFS Compose as well.
2023-02-24 03:25:08 +00:00
Jehan
2167ff98fb desktop: update AppStream metadata release date.
(cherry picked from commit c4efe45cab)
2023-02-22 14:04:15 +01:00
Jehan
9c15a2055f desktop: new <release> tag for GIMP 2.10.34.
See #9136.

(cherry picked from commit 0cd38a87e1)

Note: when cherry-picking, the tags were fixed as the main dev branch does not
need the underlined tags for localization anymore.
2023-02-22 14:04:08 +01:00
Jehan
220f0948f7 libgimp: (meson) disable GIR building when a sanitizer is set.
Similar to the change in autotools, a few commits before.
2023-02-22 13:42:59 +01:00
Jehan
87bda8879b libgimp: fix leak.
Discovered by running with sanitize=address.
2023-02-22 13:28:07 +01:00
Jehan
ee92210dde app: fix an unused variable warning. 2023-02-22 12:46:56 +01:00
Jehan
36cc6c6e8a configure, libgimp: disable introspection when building libgimp with sanitizer.
The initial issue was that 3 leaks were detected when running the "DumpCompiler"
during g-ir-scanner phase. The failing command was apparently about running some
temp binary, which looks like would be called the DumpCompiler in g-ir-scanner
code:

> libgimp/tmp-introspectn8jg64to/Gimp-3.0 --introspect-dump=libgimp/tmp-introspectn8jg64to/functions.txt,libgimp/tmp-introspectn8jg64to/dump.xml

My first fix attempt was to try and play with build/link FLAGS so that this temp
binary is built without sanitizer. But the problem when I did this was that
libgimp itself is sanitized, so we are mixing a sanitized lib with a
non-sanitized binary:

> ASan runtime does not come first in initial library list; you should either link runtime to your application or manually preload it with LD_PRELOAD.

So it looks like I could still solve this with tweaking LD_PRELOAD, cf. this
sanitizer FAQ: https://github.com/google/sanitizers/wiki/AddressSanitizer#faq

Nevertheless it proved complex to do it right while not interfering with other
parts of the build and I found out that I risk encountering more issues down the
road with GIR + sanitizer:
https://gitlab.gnome.org/GNOME/gobject-introspection/-/issues/375

So I've decided that I didn't want to waste too much time on this and simply
disable introspection when sanitizing, as I guess what we care the most to
diagnose when sanitizing is core code anyway.
2023-02-22 12:23:26 +01:00
Jehan
0b75fbd91c tools: do not sanitize build tools. It's OK if they leak a bit.
Especially as our code does not actually leak as far as we can see. It looks
like librsvg might not play well with -fsanitize=address (possibly having real
leaks or false positives).
2023-02-22 10:57:36 +01:00
dimspingos
e0f070a649 Update Greek translation 2023-02-22 10:01:06 +02:00
Alexander Shopov
2616df0921 Update Bulgarian translation 2023-02-21 10:27:03 +00:00
dimspingos
07516e2c4d Update Greek translation 2023-02-21 12:21:53 +02:00
dimspingos
0d14b0bca7 Update Greek translation 2023-02-20 13:06:35 +02:00
Jehan
577d803bd4 app: don't draw the drop zone, just nothing when converting.
(cherry picked from commit 6adf574513)
2023-02-19 18:54:46 +01:00
Jehan
aab73ae3a4 app: fix a crash when converting to higher precision.
gimp_display_shell_render() writes to a GeglBuffer backed by allocated memory
(shell->profile_data). Unfortunately while converting prevision in
gimp_image_convert_precision(), we change the "precision" property (hence the
source format) first, hence end up trying to write data in a too small buffer.
This crash was hard to find as it was not showing up on my machine (though it
did produce rendering artifacts!), unless I built both GIMP and babl with
`b_sanitize=address`.

Note that an alternate fix was to make sure that the profile_data buffer is big
enough (by calling gimp_display_shell_profile_update() before rendering), but
anyway the image is in an inconsistent state while conversion is in progress:
whereas the `src_format` is the new one, the `src_profile` is still the old one
(and cannot be changed before we finish converting).

Moreover the render happen regularly on progress signals, once after each
converted drawable. So each of these rendering step happens in an inconsistent
state, with the wrong profile set, some of the drawables converted and others
not yet.
We could still render properly if each drawable's buffer used space-aware format
(thus allowing different drawables to use different profiles/spaces), but it
feels over-engineering the problem. It might be much better to ignore rendering
steps while converting the image precision. Moreover it would obviously make a
faster conversion.

See discussions in #9136 for this crash, which didn't have dedicated report
AFAIK.

(cherry picked from commit de25be9210)

Note: on the `master` branch, even with sanitized code, I don't get the crash.
Yet this change seems relevant enough that I'm adding it.
2023-02-19 18:46:31 +01:00
Jacob Boerema
ba9ceae7d7 Revert "Upload New File"
This reverts commit 2023e4c6ca.
2023-02-18 18:40:42 -05:00
dimspingos
9f2942fec9 Updated Greek translation 2023-02-18 21:12:47 +02:00
Dimitris Spingos
2023e4c6ca Upload New File 2023-02-18 13:14:10 +00:00
Piotr Drąg
34f8a20e5f Update Polish translation 2023-02-18 11:50:27 +01:00
Alexander Shopov
adde450fb7 Update Bulgarian translation 2023-02-18 07:47:21 +00:00
Martin
641679cd31 Update Slovenian translation 2023-02-17 20:13:50 +00:00
Ekaterine Papava
4acaca633a Update Georgian translation 2023-02-17 05:02:37 +00:00
Jehan
d5f845e35a Issue #9147: freeze when switching from multi-window to single window mode.
Don't keep bindings to still existing objects. We were ending up in some ugly
infinite looping.

(cherry picked from commit bddcd5c268)
2023-02-16 22:26:17 +01:00
Jehan
18c21abf0c libgimp: fix a memory leak.
Discovered while playing with b_sanitize=address flag.
2023-02-16 20:59:33 +01:00
Jehan
7f29543895 app: fix global-buffer-overflow in "gimp:dissolve" implementation.
In case of negative y in the region to process, we were accessing invalid memory
(negative array index).

I hesitated between make so that a given ordinate always use the same index or
if we just want the start ordinate (whatever it is) to use index 0. The later
could have just been `(y - result->y) % RANDOM_TABLE_SIZE`.

I just decided to keep the existing logic (former case) though to be fair, not
sure it matters much.

(cherry picked from commit a86560bb57)
2023-02-16 20:31:41 +01:00
Jehan
31672ee340 tools: avoid build-only tool with memory issues. to break the whole build.
Cf. the previous commit: colorsvg2png has a memory leak in librsvg (so we can't
fix it easily). In any case, it's just a one-time-use tool, we don't really need
to focus on its memory bugs as long as it does its job to make icons.
2023-02-16 20:07:41 +01:00
Jehan
8e32da9889 tools: better memory handling in colorsvg2png.
Actually even with this, b_sanitize=address still detects a memory leak. After
some testing, it seems that just creating a RsvgHandle, then freeing it
immediately is enough to leak some data, which means the leak is in librsvg.
2023-02-16 20:07:41 +01:00
Hugo Carvalho
1d5a6a4829 Update Portuguese translation 2023-02-16 18:36:54 +00:00
Yuri Chornoivan
4a2a000924 Update Ukrainian translation 2023-02-16 14:06:56 +00:00
Alx Sa
5102355ac9 plug-ins: Port ImageMap to GAction/GMenuModel
Additionally, the ImageMap-specific icons weren't showing up due to the
filenames not matching the references strings ("imap-polygon" but
the filename was "imagemap-polygon.png"). This patch fixes that by
renaming the strings to match file name.
Partial code style fixes were made as well; a lot more are needed.
2023-02-16 04:16:11 +00:00
Martin
8b204d50ff Update Slovenian translation 2023-02-15 22:09:18 +00:00
Jehan
6a2908ed0b Issue #9151: link to the "Building GIMP" page of dev website in INSTALL. 2023-02-15 12:13:24 +01:00
Sabri Ünal
e9270d3d1f Update Turkish translation 2023-02-14 21:25:50 +00:00
Sabri Ünal
2f9d431271 Update Turkish translation 2023-02-14 21:22:04 +00:00
Sabri Ünal
5306c475d3 Update Turkish translation 2023-02-14 21:19:40 +00:00
Jacob Boerema
5ef77e6e8e plug-ins: disable magics detection for Windows CUR and ICO files
The magics used for detection for CUR and ICO are not very unique and
interfere with the detection of certain types of TGA images.
Since these TGA images are regularly used, it seems better to only base
CUR and ICO detection on the extension, just as we do with TGA version 1
files.

See also issue #7912
2023-02-14 15:16:15 -05:00
Jacob Boerema
5f9415a641 plug-ins: fix #9067 TGA files saved by Krita can't be opened
Krita had a bug where it incorrectly saved 4 for the alpha bits instead of
8. We will allow 4 and convert that to 8 to be able to read the incorrect
TGA images.

The likelyhood of real TGA images with 4 alphabits seems pretty low, so it
should not interfere with real images that have this set. We were not
supporting that anyway.
2023-02-14 15:16:15 -05:00
Alan Mortensen
375e91cb9d Update Danish translation 2023-02-14 20:02:01 +00:00
Yuri Chornoivan
6a8db1dd21 Update Ukrainian translation 2023-02-14 18:08:34 +00:00
Hugo Carvalho
7321061588 Update Portuguese translation 2023-02-14 16:56:22 +00:00
Ekaterine Papava
7afb2b15e4 Update Georgian translation 2023-02-14 16:47:42 +00:00
Jehan
1b780cd8e0 app, libgimp, pdb: minor fixes.
- fix a typo s/Commponent/Component/.
- Add &std_pdb_compat() to the new PDB procedures (I realize that's probably
  what the contributor was asking about, back in !446). Not sure if it's right
  as there were none in this file, but these are clearly just wrappers around
  GEGL ops, so it seems fitting.
- Some alignment fixes.
- More accurate "$since" variables.

(cherry picked from commit 66ef1ef1ef)
2023-02-14 17:18:38 +01:00
Jehan
c6972eabde pdb: meson-pdbgen.sh should return the return value of pdbgen.pl.
Otherwise even when the main script fails, hence generation of source files does
not end up correctly, the build continues (and likely fails later).
2023-02-14 15:36:19 +01:00
Ian Martins
acdf5a3776 pdb: add a PDB procedure for extract-component
(cherry picked from commit dbf9f277a2)

Committer's (Jehan) updates:

- Component type is now int32 (int8 is not a PDB type available anymore).
- PDB files re-generated to handle changes in API and types.
2023-02-14 15:36:19 +01:00
Stanislav Grinkov
d1eb30d863 themes: Set smaller Compact theme separator width...
for better consistency with the overall theme.
2023-02-14 16:50:38 +06:00
Stanislav Grinkov
bbbbc671eb themes: Increase dockable panel separator width...
to make panel resizing action more accessible.
2023-02-14 16:50:38 +06:00
Stanislav Grinkov
49cbe651a6 themes: Add three-dot handle to paned separators ...
to improve their accessibility to Default, Gray,
and Compact themes.

Resolves: #9144
2023-02-14 16:50:32 +06:00
Hugo Carvalho
25d6c51bf5 Update Portuguese translation 2023-02-14 10:49:38 +00:00
Martin
e19143cffb Update Slovenian translation 2023-02-14 00:16:07 +00:00
Jehan
473f0b49ef app: better handle bogus file names.
When a plug-in enters a bogus file name such as "Untitled.xcd" as URI,
g_file_is_native() returns FALSE. So when saving such file, core code tries to
mount a remote volume and fails (of course), without even opening the file
dialog.

This change is an attempt to detect such cases beforehand and not even try to
save it (just open the file dialog directly; the file name is still useful as
default proposed file name, as this part is actually valid).
Actually remote files will have a valid URI anyway (something with a valid
scheme, such as https:// or whatever other scheme).

As side fix, I am adding a missing space to the error which I got.
2023-02-13 22:57:09 +01:00
Jehan
4f1d0fb53b plug-ins: get rid of various gimp_image_set_file() calls.
- This is unneeded in all import procedures. See previous commit. Note though
  that this is not because of a change in previous commit. This was already
  useless previously. The file set with this PDB function was overridden by the
  core anyway (i.e. even before the previous commits).
  In app/file/file-import.c:file_import_image(), the imported file is correctly
  set (so there is no need to set it from plug-in, which anyway libgimp's
  gimp_image_set_file() was not doing) and the XCF file is reset to NULL
  (rendering the call to gimp_image_set_file() in a GimpLoadProcedure useless).
- Similarly, this is a useless call in export procedures because
  app/file/file-save.c:file_save() overrides such call too. I could only see one
  such case for JPEG export, which was quite useless.
- Finally in other types of plug-ins, setting a non-XCF file extension was
  interfering with the save feature (similarly to commit e6e73e14c7). I only
  fixed the screenshot implementations doing such a thing.
- I left a few usages which will have to be looked at more in details later.
2023-02-13 22:54:16 +01:00
Jehan
fc2925def0 app, libgimp, pdb: gimp_image_set_file() only works for XCF files.
This is not made to set the imported or exported file, but only the XCF file.
See previous commit to see what happens when this API is used to set non-XCF
file extensions (saving fails unless one edits the filename).
2023-02-13 22:54:01 +01:00
Jehan
e6e73e14c7 Issue #8581: forward-porting file-name fix from gimp-2-10 branch.
This is a port of commit 57ee6e13ab to the main dev branch.
2023-02-13 22:54:01 +01:00
Daniel Novomeský
dc8121729d flatpak: upgrade libjxl, highway, libde265 2023-02-13 17:59:14 +00:00
Ekaterine Papava
3381ad0a7f Update Georgian translation 2023-02-13 17:22:57 +00:00
Yuri Chornoivan
4929b505f7 Update Ukrainian translation 2023-02-13 15:33:22 +00:00
Jehan
b9a6799082 app, libgimp, pdb: fixing generated code and wrong GEGL op arguments.
This commit is a fixup commit for MR !790 which had a few issues:

- The args for shadows and highlights adjustments are "shadows-ccorrect" and
  "highlights-ccorrect" respectively.
- Also fixing generated code.

(cherry picked from commit e456ab019b)
2023-02-13 14:28:00 +01:00
Ian Martins
e238ea07ca pdb: add a PDB procedure for shadows-highlights
(cherry picked from commit 0b96363e10)

Reviewer's (Jehan) note: the generated source files were re-generated and
amended in this commit.
2023-02-13 14:26:04 +01:00
Jehan
851ddad2ee plug-ins: add back the prompt when "clearing" the Python console.
This code is taken from Massimo's comment in #1786 and MR !834. It doesn't fix
a crash as this was already handled in !404, yet the missing prompt after
hitting "clear" was clearly not consistent with how one expect a clear feature
to work.

At least now, we've got a prompt back immediately after clearing.
2023-02-13 13:17:30 +01:00
Piotr Drąg
d19a397cf8 Update Polish translation 2023-02-12 13:17:44 +01:00
Martin
f76c3fd630 Update Slovenian translation 2023-02-12 10:09:20 +00:00
Martin
f65fa3e4e7 Update Slovenian translation 2023-02-12 10:04:13 +00:00
Hugo Carvalho
30cc8fe5be Update Portuguese translation 2023-02-11 22:18:55 +00:00
Hugo Carvalho
40949d5368 Update Portuguese translation 2023-02-11 22:15:45 +00:00
Yuri Chornoivan
3b3f4df1fe Update Ukrainian translation 2023-02-11 16:24:35 +00:00
Ekaterine Papava
3da1f5969a Update Georgian translation 2023-02-11 04:46:55 +00:00
Jehan
c369827725 plug-ins: load PDF without filling the background to white.
Some PDF have transparency on purpose. Filling with white, without any question,
is counter-productive and prevents from working on such PDF files.

Note that we could add an option with a checkbox, leaving one to decide whether
to fill the background or not. But it feels over-engineering the issue. The PDF
is transparent, so that's what we load, and that's it. If one wants to add a
background, it's easy to add a layer at the bottom of the stack (and they can
make it any color they want, not just white), after loading the file.
2023-02-10 19:51:45 +01:00
Alx Sa
8b2262530b plug-ins: Make PDF background color fill optional
This adds a checkbox to single and multi-page PDF export to not fill
transparency with the background color 
(which currently happens automatically)
2023-02-10 18:35:14 +00:00
Jehan
fb1f16d4b8 plug-ins: fix a crash in tiff_io_error().
I had a TIFF file which would crash while triggering an error, inside g_logv()
code (and according to the stacktrace, even probably inside some lower level
printf implementation code).

The reason was that I already processed the variable list with
g_strdup_vprintf() and printf didn't like this va_list being reused, then
segfaulted with some "Cannot access memory at address" error.

The alternate fix was to first copy the va_list in the first use with
va_copy()/G_VA_COPY, yet since we already processed the format data, I thought
it was useless to do this. Let's just directly use the formatted string.
2023-02-10 19:28:19 +01:00
Ekaterine Papava
2dfe70e16f Update Georgian translation 2023-02-10 10:07:41 +00:00
Jehan
f77f772f56 Issue #8359: GIMP crashes from "open the font selection dialog" button.
Apparently GDK/Win32 sends the "grab-broken-event" signal before the "clicked"
signal. This has only been changed since GTK4 so far.

Anyway the bottom line is that GimpContainerPopup would process a handled on
"clicked", using the object destroyed when "grab-broken-event" happened as
callback data. The solution is to make sure that the object stays alive long
enough. So I'm changing gimp_editor_add_button() to connect to signals with
g_signal_connect_object() (since all usage of this function was used with
GObject callback data, it was not a problem).

See discussion in !815.

As a side change, gimp_container_popup_dialog_clicked() should emit the
"cancel", not "confirm". This part was taken from MR !815 by Lloyd Konneker.
2023-02-09 22:22:56 +00:00
Yuri Chornoivan
9328c9c03c Update Ukrainian translation 2023-02-09 21:14:11 +00:00
Stanislav Grinkov
9b517fbf7d [app] Ensure calculated histogram spike height ...
is positive or zero. Sometimes the calculated `y` or `bg_y`
values are negative because the histogram value was divided
by zero (when max == 0.0).

Resolves: #9132 (Gnome/GIMP bug tracker)
2023-02-10 00:45:47 +06:00
Jehan
8bd3d5e0bb Issue %8365: Ambiguous naming of "Lock path strokes". 2023-02-09 15:11:49 +01:00
Jehan
b71abffe51 NEWS: update.
Some items are removed because they were backported in upcoming 2.10.34 before
we released GIMP 2.99.16.
2023-02-09 14:44:36 +01:00
Hugo Carvalho
297f0679a3 Update Portuguese translation 2023-02-08 11:28:43 +00:00
Martin
fd0c906ef4 Update Slovenian translation 2023-02-07 16:39:14 +00:00
kotvkvante
708af26890 fix typo 2023-02-06 15:24:27 +00:00
Ekaterine Papava
8259e166b2 Update Georgian translation 2023-02-06 15:18:44 +00:00
Yuri Chornoivan
ead5512d6b Update Ukrainian translation 2023-02-06 09:39:54 +00:00
Alx Sa
38c031e01d plug-ins: Port GFig to GAction/GMenuModel
Because of how many actions can change the sensitivity of "undo" options
most of the plug-in files had to be edited to pass GimpGfig to them.
2023-02-04 23:16:24 -05:00
Rodrigo Lledó
e6382e9262 Update Spanish translation 2023-02-04 03:36:05 +00:00
Rodrigo Lledó
a4b6f00a77 Update Spanish translation 2023-02-04 03:21:29 +00:00
Martin
0a8c8c2649 Update Slovenian translation 2023-02-02 22:20:02 +00:00
Alx Sa
0628db1506 plug-ins: Fix possible crash on ifs-compose load
The build variable in GimpIfs struct is now initialized to NULL to
prevent build issues when finalized.
2023-02-02 14:27:34 -05:00
Sabri Ünal
e9f8d00c82 Update Turkish translation 2023-02-02 12:49:40 +00:00
Sabri Ünal
76c817f2fb Update Turkish translation 2023-02-02 12:31:42 +00:00
Sabri Ünal
c72c2e5716 Update Turkish translation 2023-02-02 12:29:35 +00:00
Sabri Ünal
1497d4d5d8 Update Turkish translation 2023-02-02 12:28:22 +00:00
Yuri Chornoivan
c2cd943021 Update Ukrainian translation 2023-02-02 09:04:08 +00:00
Ekaterine Papava
b13eff27da Update Georgian translation 2023-02-02 05:36:39 +00:00
Alx Sa
78d2e8819b plug-ins: Port IFS Fractal GUI to GAction
Converts the pop-up menu and toolbar. Also replaces deprecated
gtk_arrow_new () with similar GtkImage of an arrow.
2023-02-01 20:26:53 +00:00
Martin
4312240eb9 Update Slovenian translation 2023-02-01 20:17:56 +00:00
Yuri Chornoivan
a04dcc49ea Update Ukrainian translation 2023-02-01 18:46:37 +00:00
Hugo Carvalho
30e9cb9f7c Update Portuguese translation 2023-02-01 16:45:58 +00:00
Ekaterine Papava
28401c2bef Update Georgian translation 2023-02-01 16:12:15 +00:00
Alexander Shopov
857dad6301 Update Bulgarian translation 2023-02-01 14:42:51 +00:00
Alx Sa
c7bef41a1e plug-ins: Add export support for PAM files
Exports the following PAM formats: 
GRAYSCALE, GRAYSCALE_ALPHA, RGB, RGB_ALPHA.
As with import, the main difference is the header and transparency.
Raw PPM export code is reused for the actual data.
2023-01-29 22:09:05 -05:00
Alx Sa
af904ec55d plug-ins: Add import support for PAM files
PAM files are essentially PPM files with a different header format and
alpha/16 bit support.
Jörg Walter's 2.2 code was updated and implemented to read the revised
header format. The existing PPM loading code works with PAM files.
2023-01-29 18:01:48 +00:00
Jehan
3e53b28f7a libgimp: include the header from the implementation file.
It was failing with the autotools build.
Why did this even compile with our meson build?
2023-01-29 18:01:53 +01:00
Jehan
a0e95f6f35 plug-ins: G_APPLICATION_DEFAULT_FLAGS exists since GLib 2.74.
Our current minimum requirement is 2.70.0.
2023-01-29 15:02:11 +01:00
Alx Sa
a4f2b06547 plug-ins: Remove GIMP_PROC_ARG_UCHAR parameters
Replaces them with GIMP_PROC_ARG_INT, which will be necessary for a
future INDEXED mode with greater than 256 colors.
2023-01-28 16:19:50 +00:00
Alx Sa
5ac2027285 plug-ins: Port colormap-remap to GAction
Modeled after the animation-play port in 691e0c02
2023-01-28 10:17:33 -05:00
Yuri Chornoivan
5ca0541ce7 Update Ukrainian translation 2023-01-27 15:12:23 +00:00
Yuri Chornoivan
83cdcffa11 Update Ukrainian translation 2023-01-27 14:45:57 +00:00
Yuri Chornoivan
41ab0fe2ab Update Ukrainian translation 2023-01-27 14:42:51 +00:00
Yuri Chornoivan
e3ee010be1 Update Ukrainian translation 2023-01-27 14:40:18 +00:00
Jehan
c1aa1b7b3d plug-ins: fix freeing NULL object.
When the plug-in is queried initially for plug-in setup, then freed, the builder
object is not created.
2023-01-27 14:18:20 +01:00
Alx Sa
f6b4adafa3 build: Port fileicon.ico from gimp-2-10
This .ico contains additional 24x24, 64x64, 128x128, and 256x256 sizes
for clearer icons on different resolutions and displays.
2023-01-27 04:41:10 +00:00
Jehan
bd94175c9a plug-ins: coding-style fixes.
While studying this code as base for the previous commit, I noticed various
coding style issues.
2023-01-27 01:48:33 +01:00
Jehan
691e0c0272 plug-in: port animation-play to GAction.
Largely inspired by commit dddb23c6. This also gave me a good overview of the
various missing features in GAction (compared to GtkAction) and how we'll have
to implement this in GIMP core. I now have a very clear path of what remains to
be done.
2023-01-27 01:48:33 +01:00
Martin
2a20f32cf5 Update Slovenian translation 2023-01-26 17:59:13 +00:00
Martin
eba0e36182 Update Slovenian translation 2023-01-26 17:57:13 +00:00
Jehan
114d0f35df devel-docs: move debug-plug-ins.txt to gimp-web-devel.
Now in the "Resource development" section of the developer website under
resource/debug-plug-ins/.
2023-01-26 17:08:56 +01:00
Jehan
9716768bb1 devel-docs: debugging-tips.md also moved to gimp-web-devel repo. 2023-01-26 16:43:34 +01:00
Jehan
0036b190e1 devel-docs: performance-logs documentation now moved to gimp-web-devel. 2023-01-26 16:37:22 +01:00
Jehan
4f45ddc17e libgimp: rename gimppropchooser.* to gimppropchooser-private.* and…
… don't include it from public gimpui.h.

As reviewed during !786, if this file is private, the name should show it
clearly. And of course, we must not include it from another public header, since
it won't be installed.

This also fixes building plug-ins with gimptool as reported by tmanni:
e00f2d7f50 (note_1650791)
2023-01-26 15:46:12 +01:00
Hugo Carvalho
27dac96f83 Update Portuguese translation 2023-01-25 12:14:53 +00:00
Hugo Carvalho
cb45d4d5cc Update Portuguese translation 2023-01-25 12:10:24 +00:00
Hugo Carvalho
427e6d9947 Update Portuguese translation 2023-01-25 12:03:47 +00:00
Hugo Carvalho
35098c9dec Update Portuguese translation 2023-01-25 12:02:18 +00:00
Ekaterine Papava
f614e47cad Update Georgian translation 2023-01-25 06:49:07 +00:00
Jehan
95a87cb6ac po-script-fu: remove predator.scm from POTFILES.in. 2023-01-24 22:29:51 +01:00
Jehan
f7579eabbb libgimp: set_i18n() method of GimpPlugIn expects UTF-8 catalog directory.
Nothing was really clearly specified until now, which was kinda equivalent to
the string being in the OS encoding as used by GLib. Since this string will
usually be statically hardcoded in code (and not extracted from system), it's
just much easier to request UTF-8 for this specific case.
2023-01-24 20:06:38 +01:00
Jehan
f5d2c5369c libgimpbase: fix annotations.
As per the changes in commit 005b3a05b8 and discussions in !800,
gimp_locale_directory() returns a string in the OS encoding for all but Windows
(UTF-8), i.e. the "filename" type in GIR annotations.
2023-01-24 19:59:40 +01:00
Jehan
9642034a02 NEWS: update. 2023-01-24 19:53:13 +01:00
Jehan
6fb882ac5a Issue #5440: removed broken "Predator" script.
It relied on the now non-existing max-rgb plug-in, which was removed in commit
dd89f4a3d5. After some thoughts and discussions, the Predator script is fun, but
clearly not a mandatorily "needed" one here, which is why — instead of
re-integrating max-rgb —, I have decided to also remove Predator.

Both these script/plug-in are not totally dead. They were moved to the
gimp-data-extras repository and even ported to GIMP 3.0 API. They can be an
interesting use case for a fun extension to be installable through our future
extension platform. To be continued.
2023-01-24 19:22:26 +01:00
Jehan
19cb236955 Issue #8073: Crop can also be an extend.
Rename "Crop to Selection" to "Resize Layers to Selection" since it's not
necessarily a crop. The layer dimension can also grow now.

Also specifying "Layers" because action titles can also be displayed
off-context, such as in the action search, so we must be more detailed with our
action titles. Similarly adding a "Layers" to "Crop to Content".
2023-01-24 18:54:29 +01:00
Jehan
9c641050e0 app: cut with a selection works similarly as a copy followed by a clear. 2023-01-24 18:46:41 +01:00
Jehan
29dff58a2f build: more meson setup syntax update. 2023-01-24 17:48:29 +01:00
Luca Bacci
e360cef004 screenshot-win32-magnification-api.h: Fix coding style 2023-01-24 14:48:44 +00:00
Luca Bacci
005b3a05b8 Make use of the gimp_bind_text_domain () util function 2023-01-24 14:48:44 +00:00
Luca Bacci
cbcb9181d0 Add gimp_bind_text_domain () utility function
On UNIX it's just a stub calling bindtextdomain () directly;
on Windows it converts the path to UTF-16 and calls wbindtextdomain ().
2023-01-24 14:48:44 +00:00
Luca Bacci
48c27770b6 Use unicode-aware color management API
* GetMonitorInfoW
* EnumDisplayDevicesW
* GetStandardColorSpaceProfileW
* GetColorDirectoryW
2023-01-24 14:48:44 +00:00
Luca Bacci
cfaaec6347 Use ExcHndlSetLogFileNameW ()
This is a Dr.MinGW function
2023-01-24 14:48:44 +00:00
Luca Bacci
11801cf402 Use SetWindowsHookExW () 2023-01-24 14:48:44 +00:00
Luca Bacci
08142062a7 Use GetModuleFileNameExW () 2023-01-24 14:48:44 +00:00
Luca Bacci
54b3e3956e Use SHGetKnownFolderPath instead of the deprecated SHGetSpecialFolderLocation 2023-01-24 14:48:44 +00:00
Luca Bacci
689201e827 Use OpenFileMappingW () 2023-01-24 14:48:44 +00:00
Luca Bacci
2db0bf1909 Use MessageBoxW () 2023-01-24 14:48:44 +00:00
Luca Bacci
7b9e9ef7b6 Use CreateFileMappingW () 2023-01-24 14:48:44 +00:00
Luca Bacci
3f0ddcb885 Use GetBinaryTypeW () 2023-01-24 14:48:44 +00:00
Luca Bacci
1e24240f5d Use GetLocaleInfoW () 2023-01-24 14:48:44 +00:00
Luca Bacci
abe7c53cf5 Use GetStartupInfoW () 2023-01-24 14:48:44 +00:00
Luca Bacci
db570de3b2 Use SetDllDirectoryW ()
No need to use GetProcAddress (), SetDllDirectory () is available
since XP SP1
2023-01-24 14:48:44 +00:00
Luca Bacci
ed1e4236ba Use GetModuleHandleW ()
Also fix an unwanted ref-count increment on a module HANDLE
2023-01-24 14:48:44 +00:00
Luca Bacci
f7be0cf68e Use LoadLibraryW () 2023-01-24 14:48:44 +00:00
Luca Bacci
c98ffb7e0e Replace uses of plain fopen () with GLib's g_fopen ()
On Windows fopen () is limited to the current codepage,
GLib's g_fopen () instead accepts full UTF-8 by calling
_wfopen () internally (or a similar wide-char CRT routine).
2023-01-24 14:48:44 +00:00
Luca Bacci
afe9625bdb Simpler way to get the module HANDLE 2023-01-24 14:48:44 +00:00
Luca Bacci
0657b85202 Use GLib to convert between UTF-8 and UTF-16 2023-01-24 14:48:44 +00:00
Jehan
48c1d07600 meson: fix cross-building GIMP.
We don't want to fail the build configuration just because we can't test for
runtime dependencies. In such a case, just assume it's good as we at least have
libheif and we can compile.
Fixes:

> ../meson.build:756:2: ERROR: Can not run test applications in this cross environment.
2023-01-24 15:44:50 +01:00
Jehan
4699d9e2ac build, gitlab-ci: using non-ambiguous meson setup syntax.
Fixes:

> WARNING: Running the setup command as `meson [options]` instead of `meson setup [options]` is ambiguous and deprecated.
2023-01-24 15:35:30 +01:00
Jehan
ba5c423331 Issue #8924: Paste as new image uses the full canvas instead of just…
… the copied selection.
2023-01-24 12:51:30 +01:00
Jehan
2e30a92c0a Issue #8524: add or change some missing or duplicate mnemonics. 2023-01-23 23:38:51 +01:00
Jehan
2aa325a55e libgimpwidgets: new gimp_spin_scale_get_mnemonic_keyval() function.
This solves part of #8524, for properties displaying as spin scale, which have a
mnemonic, yet our code was not able to tell so.
2023-01-23 23:28:15 +01:00
Jehan
e4ace369c1 meson: list both AVIF and HEIC mimetype support if the plug-in is built.
Even though, some format support might be missing, since codecs can be added at
runtime, it can always change later without having to touch GIMP. Yet we won't
be able to edit the desktop file when this happens.

See new comments in #9080.
2023-01-23 19:38:19 +01:00
Jehan
706cff2037 meson: VALA language is only needed for the build target.
Without this change, meson outputs this warning:

> meson.build:868: WARNING: add_languages is missing native:, assuming languages are wanted for both host and build
2023-01-23 19:19:10 +01:00
Rodrigo Lledó
e4dae320bc Update Spanish translation 2023-01-23 18:14:12 +00:00
Rodrigo Lledó
3229a68e8a Update Spanish translation 2023-01-23 18:08:56 +00:00
Jehan
7b0064107e Issue #9080: Checking for available libheif codecs at compile-time.
From libheif >= 1.14.0, the pkg-config variable will become bogus and always
return 'yes' so we now need to check for codec avaibility at compile time the
same way we look for these at runtime.

It may seem irrelevant to do these checks since these codecs can be added
anytime later, but it's still very good information for packagers to immediately
see that we have runtime package missing.
2023-01-23 19:01:38 +01:00
Jehan
704c868ca1 meson: add a 'name' arg to the IPC_RMID compile/run test.
It makes for easier to read logs and build files. Also fixing a typo in the
original text from autotools.
2023-01-23 18:33:12 +01:00
Jehan
decdb2ba3f meson: Improve C99 compatibility of IPC_RMID check.
See previous commit and !810. Porting the autotools fix we made there to the
meson build too.
2023-01-23 18:13:18 +01:00
Florian Weimer
99531e73e9 configure.ac: Improve C99 compatibility of IPC_RMID check
Do not call the undeclared exit function.  Implicit function
declarations are likely not going to be supported by future compilers
by default, changing the outcome of this configure probe with
such compilers.
2023-01-23 16:07:59 +00:00
Martin
e7c9b9d073 Update Slovenian translation 2023-01-22 17:30:49 +00:00
Martin
41f838db8b Update Slovenian translation 2023-01-22 17:27:50 +00:00
Ekaterine Papava
4b6ff68094 Update Georgian translation 2023-01-21 15:56:08 +00:00
Ekaterine Papava
6df84c25f1 Update Georgian translation 2023-01-21 15:53:46 +00:00
Jordi Mas
8b2edc0ff8 Update Catalan translation 2023-01-21 09:05:02 +01:00
Rodrigo Lledó
c2318f6664 Update Spanish translation 2023-01-20 18:06:46 +00:00
Rodrigo Lledó
37fc28c9f3 Update Spanish translation 2023-01-20 18:01:20 +00:00
Rodrigo Lledó
4a5aefe5bf Update Spanish translation 2023-01-20 17:53:10 +00:00
Rodrigo Lledó
4a846d11e5 Update Spanish translation 2023-01-20 17:47:22 +00:00
Daniel Novomeský
3533606a13 gitlab-ci: fix win64-nightly
ca-certificates are no longer present in gimp-prefix/ssl
but in gimp-prefix/etc/ssl
2023-01-20 14:39:13 +01:00
Daniel Novomeský
12b1890980 flatpak: upgrade exiv2, libheif, libjxl 2023-01-20 12:49:16 +01:00
Alexander Shopov
f9281dd8f9 Update Bulgarian translation 2023-01-15 14:40:27 +00:00
Alx Sa
d087c1a84e plug-ins: Port Save as CSS GUI from 2.10
This plug-in has a partial GUI (a FileChooser dialog is launched).
However, you could only save the active gradient rather than choosing
any of them like the 2.10 version of this plug-in.
This patch ports the original UI so you can choose both the gradient
and file in interactive mode.
2023-01-14 21:14:45 +00:00
Alx Sa
506b324112 plug-ins: Show GUI for Palette to Gradient
Also shows GUI for Palette to Repeating Gradient function
2023-01-14 21:14:45 +00:00
Jacob Boerema
9ac2178e6e app: update gimphelp-ids.h
Removed several help ids that are not in use anymore.
Fixed spelling of one help id, the spelling has also been fixed in
gimp-help.
2023-01-14 16:02:03 -05:00
Jehan
c9b1ce8fa9 plug-ins: make test-dialog runnable even with no image.
It's a test plug-in which doesn't actually need an image to work, so it's
annoying that it currently requires one (making testing more cumbersome).

Also cleaning up a bit the coding style.
2023-01-14 20:17:57 +01:00
Jehan
f99bdcd008 plug-ins: use generated widget for GimpPalette arg.
Also make the start checks a bit more robust to broken core code by
double-checking that the palette is valid from the start, even though getting an
invalid palette should normally not happen anymore (at least I fixed one such
case with a palette with a NULL id in my previous commit; but it looks like our
core code is not perfectly robust and we should push the code to extensive
testing).

Note that the generated widget is currently ugly (no label and terrible UX), but
this is meant to improve soon.
2023-01-14 19:27:08 +01:00
Jehan
e8365e81e2 libgimp: fix getting invalid resource the first call with a NULL arg.
When the core sends a NULL resource, which would be the default for object args,
hence is also what you get for the first call of a plug-in with a resource
parameter, libgimp was creating a GimpResource with NULL id, which is invalid.
It is much better to return NULL (since we made it so that NULL is a valid
value) and let the plug-in handle the NULL value as it sees fit for a given
parameter (they could just set the contextual resource for this type, or keep
NULL to mean "no resource selected").

This fixes failing to run plug-ins the first time (before any "last" values are
set). E.g. I had the issue when testing palette-sort.

Also I'm improving the error message when trying to use a non-installed resource
(it will now also print the resource ID and the error message). And the GError
was leaking in this case, so I properly free it now.
2023-01-14 19:10:42 +01:00
Jehan
24b955bf17 app, libgimp, pdb: various coding-style fixing and struct for final types…
… moved to the implementation file.

When declaring with G_DECLARE_FINAL_TYPE(), the whole concept is that the struct
is made private (which also allows the type to evolve without breaking ABI if we
some day decide to make the class derivable). For this to make sense, the struct
goes in the implementation file, not the header.

For the rest, it's mostly alignment bugs and the like.
2023-01-14 18:44:31 +01:00
Jehan
eae386fbff devel-docs: write dependency name with the namespace casing.
It is apparently how dependency names are supposed to be spelled to be taken
into account. The previous commits fixed some, but missed 2. I'm not sure they
will actually end up in the right-side list of the docs (it looks like when a
dependency is not actually found in the API, it isn't listed there), though it's
at least always listed in the left side, as I can see it.
And while I would prefer the upstream "display" name (i.e. GEGL and babl instead
of Gegl and Babl), better be consistent in how we list these dependencies in the
libgimp and libgimpui docs.

See discussion in !811.
2023-01-14 17:56:32 +01:00
Corey Berla
a0e94250eb docs: Fix dependency names
Dependency names need to match the namespace name exactly (including
capitalization) otherwise they won't be shown as dependencies.
2023-01-14 16:50:18 +00:00
lloyd konneker
e00f2d7f50 Fix plugins to use new GimpResource. 2023-01-14 17:43:26 +01:00
Jehan
54db045f45 libimp: declaration must be at start of a block.
Fixes:

> libgimp/gimpresourceselectbutton.c:510:9: error: a label can only be part of a statement and a declaration is not a statement
> 510 |         GimpResource *specific_value;

As well as some coding style bug (space after '*').
2023-01-14 16:38:40 +00:00
Jehan
d5f4cabfcc libgimp: do not define a class struct when G_DECLARE_FINAL_TYPE is used.
This fixes the VAPI build. I am actually astonished the lib build seem to have
passed and that we didn't get double definition clashes.

The build error was:

[750/2424] Generating libgimp/gimp-ui-3.0.vapi with a custom command
FAILED: libgimp/gimp-ui-3.0.vapi
/usr/bin/vapigen --quiet --library=gimp-ui-3.0 --directory=/builds/GNOME/gimp/_build/libgimp --pkg=babl-0.1 --pkg=cairo-1.0 --pkg=gdk-pixbuf-2.0 --pkg=gegl-0.4 --pkg=gio-2.0 --pkg=glib-2.0 --pkg=gobject-2.0 --pkg=gtk+-3.0 --vapidir=/builds/GNOME/gimp/_build/libgimp --girdir=/builds/GNOME/gimp/_build/libgimp --pkg=gimp-3.0 --metadatadir=/builds/GNOME/gimp/libgimp /builds/GNOME/gimp/_build/libgimp/GimpUi-3.0.gir
GimpUi-3.0.gir:22111.7-22111.33: warning: Virtual method `GimpUi.ResourceSelectButton.draw_interior' conflicts with method of the same name
GimpUi-3.0.gir:26688.73-26688.73: error: The type name `ResourceSelectButtonClass' could not be found
GimpUi-3.0.gir:26695.73-26695.73: error: The type name `ResourceSelectButtonClass' could not be found
GimpUi-3.0.gir:26704.73-26704.73: error: The type name `ResourceSelectButtonClass' could not be found
GimpUi-3.0.gir:26712.73-26712.73: error: The type name `ResourceSelectButtonClass' could not be found
GimpUi-3.0.gir:26720.73-26720.73: error: The type name `ResourceSelectButtonClass' could not be found
2023-01-14 16:38:40 +00:00
lloyd konneker
d59a7af38c libgimp: API refactor GUI for GimpResource
Simplifies chooser widgets (e.g. GimpBrushSelect) by eliminating attributes (e.g. opacity) of chosen resource.
See #8745, but this commit fixes that by first refactoring the code.

Refactors GUI widgets (e.g. GimpBrushSelectButton and GimpBrushSelect etc.)

Refactor by "Extract class" GimpResourceSelectButton from GimpBrushSelectButton etc.
This moves common code into an inherited class (formerly called GimpSelectButton)
but the subclasses still exist.
The subclasses mainly just do drawing now.

Refactor by "Extract module" GimpResourceSelect from GimpBrushSelect etc.
Moves common code into one file, generic at runtime on type of GimpResource,
that is, the new code dispatches on type i.e. switch statements.
In the future, when core is changed some of that can be deleted.
The files gimpbrushselect.[c,h] etc. are deleted.
The module adapts the API from core to the API of callbacks to libgimp.

Note that core is running the resource chooser (select) widgets remotely.
Core is still calling back over the wire via PDB with more attributes
than necessary.
The new design gets the attributes from the resource themselves,
instead of receiving them from core callback.
The libgimp side adapts by discarding unneeded attributes.
In the future, core (running choosers for plugins) can be simplified also.

Fix gimp_prop_chooser_brush_new same as other resources.

Finish changes, and clean style.

Annotations
2023-01-14 16:38:40 +00:00
Ekaterine Papava
8d5f470507 Add Georgian translation 2023-01-14 14:38:58 +00:00
Ekaterine Papava
2c1a168790 Update Georgian translation 2023-01-14 14:35:34 +00:00
Ekaterine Papava
446db3b382 Update Georgian translation 2023-01-14 14:33:01 +00:00
lloyd konneker
d720375e97 2.99 libgimp: add GimpResource, GimpBrush, GimpPropWidgetBrush
So procedures can declare args and GimpProcedureDialog show chooser
widgets

Fix so is no error dialog on id_is_valid for resources

Palette.pdb changes and testing

Memory mgt changes

Gradient pdb

Font and Pattern tests

Test  brush, palette

Cleanup, remove generator

Rebase, edit docs, install test-dialog.py

Whitespace, and fix failed distcheck

Fix some clang-format, fix fail distcheck

Fix distcheck

Cleanup from review Jehan
2023-01-14 12:58:05 +00:00
Martin
60fa18137d Update Slovenian translation 2023-01-13 23:01:37 +00:00
Martin
5b39bca3cd Update Slovenian translation 2023-01-13 22:56:00 +00:00
Martin
8fe4c103b7 Update Slovenian translation 2023-01-13 22:54:35 +00:00
Martin
d30667f5fe Update Slovenian translation 2023-01-13 22:53:25 +00:00
Yuri Chornoivan
ee2846ffd8 Update Ukrainian translation 2023-01-13 15:06:26 +00:00
Yuri Chornoivan
6360634435 Update Ukrainian translation 2023-01-13 15:04:45 +00:00
Yuri Chornoivan
3256cf16cb Update Ukrainian translation 2023-01-13 14:57:42 +00:00
Yuri Chornoivan
a73b9f235e Update Ukrainian translation 2023-01-13 14:56:21 +00:00
Jehan
68cd873481 app: add a comment to complete !808.
It is better to add a comment rather than simply disabling these 2 calls without
explanation on macOS. This way, developers who'll look at this code in the
future will immediately know what's the reason and status for the "unicity"
concept of GIMP process on macOS. Basically there are 3 features:

- Opening files from another software (such as "open with" in file browsers)
  which is handled differently in macOS and apparently works fine. It looks like
  it works by handling system signals, connected from gui_unique_quartz_init().
- Opening files by running a new GIMP process which would pipe the filenames
  into an existing GIMP process before immediately exiting.
- Running batch process in an existing GIMP process, also by running a short-run
  GIMP process.

The last 2 features are simply now officially disabled in macOS because dbus is
not installed by default and seem like it may cause issues when it is.

See discussions in !808 and #8997.
2023-01-12 18:55:22 +01:00
Lukas Oberhuber
9102e47637 macos: do not call dbus for uniqueness
DBus can cause instability on the MacOS platform, and regardless
MacOS handles application uniqueness already.

The batch version has also been modified as it only applies if
compiled as an application, since it returns FALSE if it is complied
as a console app.
2023-01-12 17:15:48 +00:00
Hugo Carvalho
a9ee41eff0 Update Portuguese translation 2023-01-12 14:31:13 +00:00
Hugo Carvalho
5242cd46db Update Portuguese translation 2023-01-12 14:19:53 +00:00
Hugo Carvalho
2b85fdd439 Update Portuguese translation 2023-01-12 14:16:16 +00:00
Hugo Carvalho
0a0fc105c0 Update Portuguese translation 2023-01-12 14:11:43 +00:00
programmer_ceds
62e2716b21 Expand from Centre Issue (Fixes issue #7954) 2023-01-11 21:29:19 +00:00
Alx Sa
8dcc397498 plug-ins: Show Palette Sort GUI
Recreates GUI so this plug-in matches the
2.10 version.
2023-01-11 16:13:17 +00:00
Alan Mortensen
9117740c13 Update Danish translation 2023-01-11 14:57:24 +00:00
Jehan
71605b092c app: remove definitions of gimp_image_[gs]et_active_(layer|channel|vectors).
These are not used anymore anywhere in our codebase! I'm sure some issues still
exist in various places, yet we can now consider that the multi-item awareness
project is finally over! Wouhou! 🥳

One big question which remains is whether I want to get back to the old naming
of "active" items, rather than "selected" items. The main reason to change the
wording globally was to be able to easily find remnants of non-multi-item aware
code. Now that it's all gone, I could very simply revert to the old naming.

This is in particular a big question for the public API for plug-ins, as the
"active" wording has been used for decades litterally. The only difference now
with how it used to be is that we could have several active items at once.
2023-01-11 02:18:32 +01:00
Jehan
06413174ee app: fix forgotten fill_dialog_new() and stroke_dialog_new() usage.
They need to take a list of items now.
2023-01-11 02:13:41 +01:00
Jehan
9ec7c155a6 app: make Stroke Paths actions multi-paths aware.
These were also the last usages of the macro return_if_no_vectors.
2023-01-11 01:56:29 +01:00
Jehan
a1fc57b325 app: vectors-fill-last-values now also multi-paths aware. 2023-01-11 01:39:29 +01:00
Jehan
d96c13de2b app: "Fill Paths" action, multi-paths aware. 2023-01-11 01:31:10 +01:00
Jehan
bc8590b40a app: several paths action made multi-items aware.
- Duplicate and Delete Paths are now both callable on several paths at once.
- Path Edit and Edit Attributes can only be run with exactly one path selected.
- Merge Visible Paths obviously always worked with more than one path.
2023-01-11 00:33:51 +01:00
Jehan
ca8f4ef0d3 app: remove last usages of return_if_no_layer macro.
- "Discard Text Information" work on all selected text layers.
- "Text to Path" creates as many paths as there are selected text layers.
- "Text along Path" still only works with exactly 1 text layer and 1 path
  selected.
2023-01-10 23:13:49 +01:00
Jehan
563744934a app: layers edit actions are only meant to work on single layers. 2023-01-10 20:12:15 +01:00
Jehan
35ef93be03 app: remove last usage of return_if_no_channel macro.
The channel attribute edit action only works with a single channel at once.
2023-01-10 20:07:44 +01:00
Jehan
897d7ef168 app: channels and path to selection actions multi-item aware. 2023-01-10 20:07:44 +01:00
Jehan
545b794b72 app: setting color tags actions now multi-item aware. 2023-01-10 20:07:44 +01:00
Jehan
036ba77415 app: actions for lock position of items multi-item aware. 2023-01-10 20:07:44 +01:00
Jehan
a602ea7662 app: lock contents of items multi-item aware. 2023-01-10 20:07:44 +01:00
Jehan
7c7c62a1df app: Toggle Layers/Channels/Vectors visibility action multi-item aware. 2023-01-10 20:07:44 +01:00
Jehan
955dd922a7 libgimpwidgets: new gimp_int_store_new_array().
Because the variable argument list variants of the function won't work in
binding. This makes creating GimpIntStore easy.
2023-01-10 17:48:05 +01:00
Jehan
f76f3dfe76 Issue #8982: Select all -> Copy -> paste inserts an empty layer.
This is because gimp_drawable_edit_clear() would also clear the full drawable in
the special case when there is no selection at all. So as we were inverting the
"all" selection, we were ending up in this special-case.
2023-01-10 03:13:51 +01:00
Jehan
c3869fc0e1 NEWS: update. 2023-01-10 01:58:09 +01:00
Alx Sa
3d54665a94 libgimpconfig: Retain color scale preferences
RGB 0..255/0..100 and LCh/HSV settings are now remembered when closing
and reopening GIMP.
A few enums were explicitly cast to GimpColorSelectorChannel to clear
some compiler warnings.
2023-01-10 00:20:22 +00:00
programmer-ceds
0c89be5f06 Smudge problem on offset layers (fixes #8999) 2023-01-09 22:37:37 +00:00
programmer-ceds
8a066f0430 Strokes on offset layers are offset - fixes issue #8767 2023-01-09 20:57:26 +00:00
Jehan
064ec53964 app: fix bug added in commit 036510d191.
This second GIMP_IS_ITEM() test was obviously for the iter2->data item. This
fixes handling cases when aligning/distributing a mix of GimpItem-s and guides.
2023-01-09 19:14:44 +01:00
Alan Mortensen
e0913586fd Update Danish translation 2023-01-09 18:07:02 +00:00
Jehan
b35e11da0b app: also apply "use extents of layer contents" to alignment reference.
I'm not sure if there are a lot of cases where we might want to use the layer
extents for items to align while using the contents extents for the reference
(or the other way around). It looks to me you either want one of the other for
all the items in the most common case.

So for now, let's apply this option to both the items to align and the reference
item. We'll see if anyone wants a separate option some day and has a good use
case to submit for this.
2023-01-09 18:22:08 +01:00
Jehan
036510d191 app: when arranging an item and an ancestor item, drop the descendant.
Trying to arranging both doesn't make sense and only end up in weird result. If
both the parent (layer group) and one or several child items are selected, just
arrange the parent.
2023-01-09 18:22:08 +01:00
Alx Sa
74b32f7c86 build: Add support for OpenMP dependency
Enables general support for OpenMP.
Currently, only the DDS plug-in utilizes it.
2023-01-09 16:41:06 +00:00
Alx Sa
11495ea4fd tools: Don't auto-activate when image changes
This changes the auto-activate behavior for transform and
GEGL tools so it does not apply when the image is changed.
2023-01-09 15:28:37 +00:00
Alx Sa
a41ba956e6 tools: Auto-activate GEGL operation tool on click
This extends the work done in !778 to open the GEGL operation dialogue
automatically when selected from the menu, rather than requiring the
user to click on the canvas first.
2023-01-09 15:28:37 +00:00
Stanislav Grinkov
fa9f4e6825 app, build: depend on GLib 2.70
Commit 52d17439 introduced use of g_thread_pool_new_full which is
available only since GLib 2.70
2023-01-09 14:20:21 +00:00
Lukas Oberhuber
15c34716cf gimphelplocale: MacOS can get http and https
(cherry picked from commit cad9feed71)
2023-01-08 23:55:22 +00:00
Rodrigo Lledó
b54ca06579 Update Spanish translation 2023-01-08 23:36:57 +00:00
Rodrigo Lledó
09aa6e1440 Update Spanish translation 2023-01-08 23:00:49 +00:00
Rodrigo Lledó
d1d2506d3f Update Spanish translation 2023-01-07 23:44:12 +00:00
Hugo Carvalho
48ee6db7bd Update Portuguese translation 2023-01-06 21:42:36 +00:00
Hugo Carvalho
a5f2987e78 Update Portuguese translation 2023-01-06 21:37:16 +00:00
Jehan
6378f3af8d gitlab-ci: using the 'posix_local' installation scheme for Python.
Python 3.10 introduced sysconfig.get_default_scheme() and somehow Debian decided
it was a good idea to move from the 'posix_prefix' to the 'posix_local' scheme.
See: https://lists.debian.org/debian-python/2022/03/msg00039.html

The main issue with this scheme is that it adds a local/ subdirectory to the set
--prefix. As a consequence, with --prefix=~/.local/, scripts are installed in
~/.local/local/bin/ (instead of proper ~/.local/bin/), data are now in
~/.local/local/share/ and so on.
As expected, this broke a lot of CIs for a lot of projects, as well as a lot of
custom scripts, usage of Python in virtualenv (this later case seems like it is
fixed by special-casing it in Python 3.11), flatpak, etc.

Setting DEB_PYTHON_INSTALL_LAYOUT environment variable to "deb" solves this by
changing the default scheme.

This URL is also useful to understand the issue:
https://askubuntu.com/questions/1406304/virtualenv-installs-envs-into-local-bin-instead-of-bin

As a side note, Debian is not the only one which made the mistake. Fedora also
did the same thing (and they have also their own different environment variable
to handle this): https://bugzilla.redhat.com/show_bug.cgi?id=2026979
2023-01-06 18:47:52 +01:00
Martin
106ef0affd Update Slovenian translation 2023-01-06 07:46:02 +00:00
Alexander Shopov
fe8fe422c5 Update Bulgarian translation 2023-01-04 21:18:43 +00:00
Martin
f4778804ac Update Slovenian translation 2023-01-04 16:44:29 +00:00
Martin
52d85621bb Update Slovenian translation 2023-01-04 16:38:45 +00:00
Alan Mortensen
0549185c10 Update Danish translation 2023-01-03 15:13:40 +00:00
Alan Mortensen
f75592140e Update Danish translation 2023-01-03 15:12:48 +00:00
Alan Mortensen
db8416398a Update Danish translation 2023-01-03 15:11:40 +00:00
Alan Mortensen
874d239bc1 Update Danish translation 2023-01-03 15:11:05 +00:00
Alan Mortensen
52ffdf4e4d Update Danish translation 2023-01-03 15:10:39 +00:00
valadaptive
ea28ac0bbd app: Fix "Handle Transform" handle snap location
(cherry picked from commit d6d2e56c00)
2023-01-03 15:59:55 +01:00
Zurab Kargareteli
7f46c04e66 Update Georgian translation 2023-01-03 00:47:46 +00:00
Yuri Chornoivan
307afe349d Update Ukrainian translation 2023-01-02 18:56:23 +00:00
Yuri Chornoivan
7ad5635946 Update Ukrainian translation 2023-01-02 18:50:52 +00:00
Luming Zh
99f6566534 Update Chinese (China) translation 2023-01-01 20:39:00 +00:00
Chao-Hsiung Liao
dc20b1d123 Update Chinese (Taiwan) translation
(cherry picked from commit ec5c48005e)
2022-12-31 00:01:10 +00:00
Chao-Hsiung Liao
16275b5a36 Update Chinese (Taiwan) translation
(cherry picked from commit a1f24a414a)
2022-12-30 23:59:35 +00:00
Chao-Hsiung Liao
a4cbb0f407 Update Chinese (Taiwan) translation 2022-12-30 23:57:47 +00:00
Chao-Hsiung Liao
602e6110b9 Update Chinese (Taiwan) translation 2022-12-30 23:51:57 +00:00
Alx Sa
fc202818dd plug-ins: Add support for PSD clipping paths
Adds import and export support for clipping paths in PSD files.
On import, path name and flatness value are saved in parasites.
Prior settings are loaded in the GUI on export.
2022-12-30 16:33:37 +00:00
Alx Sa
ec60d376a5 plug-ins: Create struct for PSD save options
Allows more save options to be added without changing
the method signatures.
2022-12-30 16:33:37 +00:00
Sabri Ünal
5d9f214cb8 app: Make a comment reachable
gettext cannot reach otherwise.
2022-12-30 12:43:41 +00:00
Richard Szibele
f470691e06 ScriptFu: Add byte support.
Add a new type 'byte' to be able to handle binary data while still
retaining the utf8 char and string behavior.

Internally the file and string port and character handling have
been reworked to use the new byte-centric functions.

Also adds a new test script (test9) that tests byte, char and
utf8 string handling.
2022-12-27 16:48:13 +00:00
Jehan
b62ae798d1 libgimp: libgimp does not depend on GTK+.
Only libgimpui depends on GTK+, display servers and other GUI-related
dependencies. There was a problematic include added in commit 0b56aa0d13 for
macOS, but the needed code (testing the macro GDK_WINDOWING_QUARTZ to use some
[NSApp activateIgnoringOtherApps:YES] API) doesn't seem to be present anymore in
there, so I think that removing this include (replace by including GLib for
other calls) should work fine. Of course, we'll know it when the separate CI
will test a macOS build as we still don't have in-Gitlab macOS jobs. :-/
2022-12-26 22:29:52 +01:00
Jehan
c6bc4fbe38 tools: add a --runtime option to flatpak-releases script.
This will allow to also check the list of runtime builds. We could see an
example in a report (#8993) where someone had the latest flatpak build of GIMP
but an older build of the runtime flatpak. So they had a bug because of a
dependency which got updated since then.
2022-12-26 18:53:51 +01:00
Jehan
9347c9d5fd tools: add the flatpak commit info to flatpak-releases script output.
This is useful when wanting to check someone is using the last flatpak build in
a bug report.
2022-12-26 18:18:54 +01:00
Ekaterine Papava
26ff19a89d Update Georgian translation 2022-12-23 22:59:05 +00:00
Jacob Boerema
8372220345 app: use pre-defined help id GIMP_HELP_COLORSELECTOR_PALETTE
Instead of using the string directly. This ensures that possible updates
in the string don't go unnoticed in gimp-help.
2022-12-23 13:01:11 -05:00
Jacob Boerema
469dfdcf11 app: update available help ids for gimp-help
Add several missing help ids, remove those that are not used anymore,
and update "gimp-colorselector-water" to "gimp-colorselector-watercolor".

Also add a comment why some help ids are not used directly.
2022-12-23 12:56:47 -05:00
Jehan
5d30089d71 gitlab-ci: fix the CI build.
In the last few days, our deps-win64 job started to fail with:
> $ update-alternatives --set x86_64-w64-mingw32-g++ /usr/bin/x86_64-w64-mingw32-g++-posix
> update-alternatives: error: no alternatives for x86_64-w64-mingw32-g++

The reason lies in this change in Debian testing 10 days ago:

----
gcc-mingw-w64 (25) unstable; urgency=medium

  * Upgrade to GCC 12. Closes: #1023679. It is no longer possible to tweak
    the installation directory for different thread models, so the -posix
    and -win32 packages are no longer co-installable.
  * Drop “Built-Using” from “Architecture: all” packages.
  * Since the POSIX and Win32 packages are no longer co-installable,
    drop support for alternatives and use symlinks to provide the full
    set of command names.
  * Standards-Version 4.6.1, no change required.

 -- Stephen Kitt <skitt@debian.org>  Mon, 12 Dec 2022 09:00:34 +0100
----

So from now on, we'll only install the posix variant of the cross-compiler.
Hopefully it will work for all packages we build.
2022-12-23 18:28:36 +01:00
Jordi Mas
d08a63d610 Update Catalan translation 2022-12-21 17:28:33 +01:00
Jordi Mas
cea954b42c Update Catalan translation 2022-12-18 20:31:41 +01:00
Kristjan SCHMIDT
798ef480de Update Esperanto translation 2022-12-18 11:14:07 +00:00
Kristjan SCHMIDT
641379886a Update Esperanto translation
(cherry picked from commit 8ef0a8701d)
2022-12-18 11:05:23 +00:00
Jordi Mas
fb98b3198c Update Catalan translation 2022-12-17 14:28:42 +01:00
Alx Sa
d1746e464c plug-in: Initial support for CMYK/A JPEGXL export
Adds option to export JPEG XL images in CMYK/A format.
Key and Alpha data is saved in extra channels, and the
simulation profile is saved as well.
Per the specification developers, the format does not
support 'naive' CMYK conversion, so a profile is required
for export. The option will be disabled if not set.
2022-12-14 21:43:38 +00:00
Alx Sa
b04f45f354 plug-in: Initial support for CMYK/A JPEGXL import
Checks if file has an extra key channel for CMYK. If so, it is combined
with the image's CMY image to create a CMYK buffer for import.
Color profile is stored as image simulation profile.
If alpha channel is present, it is now loaded as well for CMKYA images.
2022-12-14 21:43:38 +00:00
Jehan
5c4dac0d67 devel-docs: release-howto was now moved into the developer website.
The URI will be: https://developer.gimp.org/core/maintainer/release/ (once we
merge the testing website to the main)

The new procedure also contains a wrapper step where we paste the checklist,
markdown-formatted, into a Gitlab report for better progress follow-up and also
onboarding testers into the release procedure.
2022-12-13 23:53:08 +01:00
Emin Tufan Çetin
1d9d3b8f11 Update Turkish translation 2022-12-13 01:00:58 +00:00
Sabri Ünal
64302025dd Update Turkish translation 2022-12-13 00:51:52 +00:00
Jehan
0e8a52a9f5 devel-docs: removing files and contents moved to developer.gimp.org.
The milestone and libtool instructions were moved over, as well as "Maintainer"
section text from the devel README.
2022-12-12 23:15:48 +01:00
Jehan
8ab38eb883 meson: fix the shared object version.
The current code was wrong, hence was producing wrongly versioned shared
library files. This commit do it the same way as we do it on autotools build,
and additionally compute the library version (since "current:revision:age" gets
transformed into "(current - age).age.revision" by libtool, but meson doesn't
use libtool so we have to do this ourselves).

Now meson and autotools builds produce the same result at least. There are still
some points I'm wondering and which we should handle before GIMP 3.0 release:

* Since meson doesn't use libtool (and no .la files are created), should we
  actually stick to libtool version scheme? It seems like some projects would
  use semver instead. On the other hand libtool version gives a bit more info.
* Also it raises the question on whether we want the API version to be semver at
  all or simply follow GIMP version? It used not to be much of a problem as we
  wouldn't add features (hence new API) on micro version, yet now we can. So
  GIMP program's version could not pass as semantic versioning. On the other
  hand, having a diverging API version (whose minor version would increment
  faster in particular, with regular micro version resets) would be confusing
  too.
* If we keep libtool versioning, I'm thinking we should do it manually. It's
  actually pretty easy with a good docs (or even just following GNU docs:
  https://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html),
  and simple to understand whereas the current code logic is very weird and we
  end up with huge current and age values with complicated computation.

Note also that I raise the "Libtool versioning" section near meson.build top and
updated gimp_interface_age to be the same as on autotools currently.
2022-12-12 19:58:17 +01:00
Jehan
d5d0808fee NEWS: update. 2022-12-12 14:38:54 +01:00
Jehan
d76d5bdb4b devel-docs: update release-howto.
- The <_p> or <_li> syntax for localizing AppData is the old code logics from
  intltool.
- Mailing lists don't exist anymore. Move all usage on discourse.
- Microsoft Store is only for stable builds.
- Let's always merge `origin/testing` into `master` on gimp-web module (no
  cherry-picking) as it's clearly the procedure we've been doing for quite some
  time now.
2022-12-12 14:33:47 +01:00
Sabri Ünal
d60b14e2e0 Update Turkish translation 2022-12-11 19:46:46 +00:00
Alexander Shopov
4390e4522e Update Bulgarian translation 2022-12-11 17:24:56 +00:00
Alexander Shopov
d2442edd56 Update Bulgarian translation 2022-12-11 14:05:21 +00:00
Sabri Ünal
d4d5f1eb47 Update Turkish translation 2022-12-11 09:14:17 +00:00
Jehan
09ece8f6f9 Issue #8948: Autotools build does not support the new babl-0.1 naming. 2022-12-09 16:34:11 +01:00
Cristian Secară
aea3b9132a Update Romanian translation 2022-12-08 22:21:52 +00:00
Cristian Secară
9eddb55076 Update Romanian translation 2022-12-08 22:17:54 +00:00
Cristian Secară
cf91b0af76 Update Romanian translation 2022-12-08 22:16:54 +00:00
Cristian Secară
b8e732cfd8 Update Romanian translation 2022-12-08 22:16:01 +00:00
Cristian Secară
d35b82c066 Update Romanian translation 2022-12-08 22:15:25 +00:00
Cristian Secară
3698d0975f Update Romanian translation 2022-12-08 22:13:58 +00:00
Cristian Secară
7b96d67a95 Update Romanian translation 2022-12-08 22:12:59 +00:00
Jordi Mas
d3ea4d7fa4 Update Catalan translation 2022-12-05 22:36:59 +01:00
Jehan
04a78154e1 meson: take into account babl's pkg-config name change.
See babl!52 (babl commit b8da847) and gimp#8912.
2022-12-05 14:34:48 +01:00
Jehan
83545ee94d devel-docs: adding libgimp as dependency to libgimpui.
Also use proper naming of dependencies, regarding of casing (e.g. GIMP
and GEGL, but babl).
2022-11-29 04:37:09 +01:00
Jehan
4acd18309a app: use our custom layer search entry with Ctrl-F in the Layers dockable.
GtkTreeView has an "interactive search" feature built-in, which basically kicks
in with the Ctrl-F shortcut by default. Let's hijack this feature and trigger
our own new search popover which is much more powerful (multi-item selection,
ability to use regexp or glob search by enabling these in Preferences, etc.).

This was an idea by Aryeom who wanted to be able to hit Ctrl-F to search for
layers.
2022-11-28 21:48:53 +01:00
Jehan
3795afefa5 app: GIMP_TIMER_START|END are no-op on release builds.
These are typically debug outputs and we don't want them to appear on stderr of
release builds. They confuse people (some tester would report these on IRC when
we last release GIMP 2.99.14).
So let's not show these debug text on release versions.
2022-11-28 20:59:30 +01:00
Jehan
2912552263 app: make the "Anchor" tooltip depending on whether we are floating over…
… a layer or a layer mask.
2022-11-28 20:43:56 +01:00
Christian Kirbach
dd3ed440a7 Update German translation 2022-11-24 21:58:25 +00:00
Balázs Úr
7ab7997a63 Update Hungarian translation 2022-11-22 23:55:34 +00:00
Jordi Mas
a1792a56cb Update Catalan translation 2022-11-22 21:32:54 +01:00
Lukas Oberhuber
e62f00ad4e macos: support MacPorts
This provides MacPorts support which is now the official way that
the MacOS port is built and packaged.
2022-11-22 14:36:22 +00:00
Jordi Mallach
1aec2281f5 Increase the timeout of tests from default 30s to 60s.
Some slower architectures hit the timeouts and fail their build.

See
https://buildd.debian.org/status/fetch.php?pkg=gimp&arch=armel&ver=2.99.14-1&stamp=1669046159&raw=0
for an example of a failed build.
2022-11-22 10:01:44 +01:00
Jordi Mas
46f2ea4142 Update Catalan translation 2022-11-20 23:59:10 +01:00
Jehan
c5f34477e6 build: sync flathub's beta and nightly branches of the flatpak.
Only the libwmf patches are still different. Apparently we may have fixed the
same bugs in different way on both branches. We should look later in details to
see if some patches are better than the other.
2022-11-18 23:48:46 +01:00
Jehan
ac94f06216 README: add a "Contributing" section in README. 2022-11-18 23:47:46 +01:00
Hugo Carvalho
976cbc7d45 Update Portuguese translation 2022-11-18 14:07:51 +00:00
Hugo Carvalho
27b3cb0d00 Update Portuguese translation 2022-11-18 14:06:26 +00:00
Alx Sa
01afc271ce plug-ins: Don't show invalid icons twice on export
This adds a check to make sure icon is valid when displaying
the icons in order, to prevent duplicates showing there and in the
invalid list at the bottom
2022-11-16 14:54:11 -05:00
Martin
6865c6f620 Update Slovenian translation 2022-11-16 14:28:53 +00:00
Martin
f6f576d97d Update Slovenian translation 2022-11-16 14:20:23 +00:00
Jehan
f7f92b61e1 devel-docs: GIMP format specs files moved to gimp-web-devel repository. 2022-11-14 23:06:37 +01:00
Jehan
fde0315cb3 devel-docs: some document updates.
For the release-howto (release process update) and the gitlab-mr document
(updating the git endpoint).
2022-11-14 21:33:54 +01:00
Jehan
8c5e3887f9 configure.ac, meson.build: post-release version bump to 2.99.15. 2022-11-14 01:20:27 +01:00
Jehan
a0811ff614 Release development version GIMP 2.99.14. 2022-11-13 23:04:38 +00:00
Jehan
cab8748c6c build: delete now outdated files.
It's probably unneeded as the 2.99 installers are transient and anything
installed by GIMP 2.99 won't be in stable 3.0 anymore. Still, it's nice not to
have any weird warnings even in dev releases.
2022-11-13 23:04:38 +00:00
Yuri Chornoivan
de2f3c3647 Update Ukrainian translation 2022-11-13 23:01:15 +00:00
Yuri Chornoivan
d5263bf3f8 Update Ukrainian translation 2022-11-13 22:59:43 +00:00
Jehan
a5e56f2ff8 NEWS: update.
Add macOS changes from the dedicated repo as they are pretty important too.
2022-11-13 22:22:57 +01:00
Jehan
3852f164d2 modules: fix typo in meson build.
This explains such WARNING over a previous installation on Windows:

> (gimp-2.99.exe:11524): GLib-GObject-WARNING **: 21:36:36.664: Two different plugins tried to register 'ControllerDXDInput'.

The previous install was autotools-built, so it didn't have the typo.
2022-11-13 22:21:14 +01:00
Jehan
75e56986a0 NEWS: update. 2022-11-13 19:52:02 +01:00
Alexandre Prokoudine
4caa543dee Update Russian translation 2022-11-13 21:29:47 +03:00
Alx Sa
cc3f7afb04 tools: auto-activate transform tools on canvas
This removes the need to click the canvas after selecting a transform
tool before you can start working on the transform.
2022-11-13 17:52:25 +00:00
Øyvind Kolås
06b481a3ec meson, configure, app: depend on babl 0.1.98 2022-11-13 17:31:32 +01:00
Øyvind Kolås
b85032d8b6 meson, configure, app: depend on GEGL 0.4.40 2022-11-13 17:16:49 +01:00
Zurab Kargareteli
7eb07347fe Update Georgian translation 2022-11-13 06:48:54 +00:00
Anders Jonsson
d3cea66c39 Update Swedish translation 2022-11-12 23:17:45 +00:00
Anders Jonsson
389da6447d Update Swedish translation 2022-11-12 23:15:18 +00:00
Jehan
143496af22 app, menus, pdb: new "Paste as Single Layer( in Place)?" actions.
When the clipboard contains raw image data or single layers, it's the same as
the normal "Paste" (and "Paste In Place" respectively). These actions are useful
if you want to copy a bunch of layers and paste them "merged" into a single
layers (since now the copy-paste of multiple layers will create multiple
layers).
It is somehow similar to the "Copy Visible" action except that it works on
selected layers only and work at paste time, making the action more versatile.
2022-11-12 22:34:51 +01:00
Jehan
fc050914ab app, menus, plug-ins: move some advanced paste actions into submenu.
There are so many paste options and I feel that the "Paste into Selection*"
actions are advanved enough that they can go into submenus. So I move them into
"Paste as". The other reason is that I'm going to add 2 more options!

I hesitated to rename the "Paste as" submenu but we couldn't find a good naming
(except just "Paste" but it's redundant with the default action and "Paste…" but
this usually implies a dialog, not a submenu).

Last but not least, I renamed the various paste actions to contain the word
"Paste" in it. E.g. s/New Image/Paste as New Image/. The old naming made sense
when action labels were only displayed in menus. But nowadays they can be shown
in other more independant context, such as the action search (and just
displaying "New Image" in there is very misleading).
2022-11-12 22:34:36 +01:00
Jehan
92cc33d52a app: fix a use of gimp_edit_paste().
When dropping a buffer, we just consider it like common data pasting, hence we
leave the GIMP_PASTE_TYPE_NEW_LAYER_OR_FLOATING algorithm decide what type of
paste it will be.
2022-11-12 19:07:47 +01:00
Jehan
9a2f5b0709 app: rework and fix the logic for copy-pasting multiple drawables.
There were a lot of incertainty of what should happen when we copy layers being
descendant of each other (i.e. when you select a group layer and some of its
children), then when you paste such data. So we sat down with Aryeom and tried
to come up with some consistent behavior which is somewhat expectable, but also
which would allow the most use-case.

Otherwise it was making very weird result when pasting the data, duplicating
some layers and whatnot, which was obviously a buggy behavior and never the
expected result.

We decided that if you select one leaf item, then even if you also selected a
parent item, it would be as though the parent was not selected. This is very
often what you expect anyway when you select a whole bunch of layers and would
work well if, say, you shift-click over many layers in sub-groups. Then you
wouldn't have to manually ctrl-click to unselect every group.

Then what if you were instead expecting to copy many groups? Then you could
shift-click the group arrow, closing all same-level groups. Once they are all
closed, you can shift-click the groups to only select group layers, not their
contents.

This way, both use cases are still quite doable easily with this default choice.
2022-11-12 18:28:58 +01:00
Jordi Mas
6e92077a1f Update Catalan translation 2022-11-12 15:20:59 +01:00
Anders Jonsson
a27089385e Update Swedish translation 2022-11-11 23:32:26 +00:00
Hugo Carvalho
418a45b165 Update Portuguese translation 2022-11-11 11:53:15 +00:00
Jehan
18c5b39cf5 app: copying from selection creates layers the size of the selection.
After further discussions with Aryeom, we had to make decisions about a few
problems. The main problem was: what happens when we copy a selection of a layer
whose bounds don't intersect with the selection?

The silent treatment of discarding the layer was not acceptable, because e.g. it
could happen on huge set of selected layers (like say you copy 100 layers with a
selection: you expect 100 created layers and if you realize you don't have them
all — e.g. you have 99! — after hours of work, trying to find the missing one
can be a huge time loss).
The status bar notification (or even error) did not feel right either because
this can typically be missed easily. Also it doesn't give a lot of feedback
(e.g. you might want hint to find the non-intersecting layers, in case it was
not supposed to happen).
An error box was even considered, possibly proposing to ignore the problematic
layers, or even giving easy ways to find them.
Finally what if we let the selection happen regardless the non-intersecting
layers? What should the dimension and offset of said layers be?

In the end, we went with the more consistent behavior of always creating new
layers of the exact same size as the selection. It can be considered as a rule
which would make the behavior predictable. For the non-intersecting layers, we'd
just have new layers with the dimension/offset of the selection bounding box,
and no contents. For other layers, they'd be also this same dimension, possibly
increasing the dimension of the source layers (though any new pixel is fully
transparent obviously). Aryeom wondered if some people might absolutely need for
their workflow that the new layers stick to the origin bounding box. But we felt
it was enough of a stretch that we'd try this way for now.

Note: of course if some day we get infinite canvas/layers, this whole discussion
could be less of a problem anyway! This was Aryeom's conclusion! Ahahah!
2022-11-11 00:04:38 +01:00
Jehan
363facef5e app: fix one case in gimp_edit_paste_get_top_item().
I was forgetting to store the path for the first item, which in particular was
making a problem when the top item was the first one in the list.
2022-11-10 23:29:23 +01:00
Jehan
1b64fdf52d app: pasting selection from multiple layers should still create multiple layers.
This is also work-in-progress for better copy-paste handling for multi-items.
Until now, I had decided that, if a selection existed, a copy would copy a
merged version of the selected items. But sometimes you want to have a piece of
each layer, each piece in its own layer. Also you may always merge the pasted
layers afterwards.

So now we will indeed create as many layers out as there are layers in. Being
able to copy a merged down version of all selected layers is still an
interesting feature though. We might add a dedicated "Copy Merged" action,
similarly to the fact we have a "Copy Visible" (which does the same thing but
for all visible layers, not specifically the selected ones).
2022-11-10 22:49:47 +01:00
Jehan
bd186d56ee app: fix position of pasted data.
Position of pasted image data was getting very bad lately, especially with the
multi-item selection logic which confused the hell out of the legacy algorithm.
So I reviewed it a bit, in light of the multi-item abilities, as well as the
recent no-floating-selection paste changes.

One of the particularly wrong paste position was when pasting one or several
pieces (through selection) of existing layers. The positionning was really bad
and sometimes even off-canvas (which was explicitly forbidden by the algorithm,
except it was broken now).

Now the behavior is much more reliable and consistent, by centering on viewport
or on target drawables. If there are several such targets, their bounding box is
used as target position (and the bounding box of all source drawables is also
used now). An interesting consequence of this is that copy-pasting quickly
without removing a selection paste "in-place" since the target this time will
use the selection bounding box.

Aryeom and I are doing some work on specifying copy-paste (based on existing
logic, we tried not to disrupt too much years of logic, but also keeping
consistency and new logic for recent changes, such as multi-items). It will all
be written down into the GIMP developer website, section "Specifications".
2022-11-10 22:49:47 +01:00
Daniel Novomeský
ec3da29f67 flatpak: remove extra lcms2
lcms 2.13 is already present.
2022-11-10 16:50:20 +01:00
Alexandre Prokoudine
61279385fb Update Russian translation 2022-11-10 14:49:21 +03:00
Yuri Chornoivan
178f283a37 Update Ukrainian translation 2022-11-10 09:20:34 +00:00
Jehan
3453c8bd55 app, pdb: paste layers over the top selected drawable.
When several drawables were selected, it was pasting at the top of the layer
stack. Instead, paste over the top selected layer ("top" visually in the Layers
dockable).

There was the question of: what should we do when pasting over a layer group.
Should we consistently paste the new layers above the group or inside the group?
After discussions with Aryeom, we decided to stay consistent and paste above, at
least for now.
2022-11-09 17:22:35 +01:00
Jehan
6083fd81a1 app, desktop: prepare AppData <release/> item for upcoming GIMP 2.99.14. 2022-11-09 15:31:39 +01:00
Jehan
b674fd33f0 app: fix a critical for release demos with a dockable and no specific widget.
Fixes:

> GLib-CRITICAL **: 13:39:39.804: g_strchug: assertion 'string != NULL' failed
2022-11-09 15:22:05 +01:00
Jehan
51fe025afb app: update sensitivity rules of distribute buttons.
Distribute features do not care about the reference object anymore. All we care
about is whether we have more than 2 objects.
2022-11-09 13:20:31 +01:00
Jehan
c3e1197ec9 app: fix a CRITICAL.
We should look at the display stored on the GimpDrawTool.
2022-11-09 13:04:51 +01:00
Zurab Kargareteli
d5f21716f7 Update Georgian translation 2022-11-09 05:13:33 +00:00
Jehan
6b787312c0 NEWS: update. 2022-11-09 02:42:23 +01:00
Jehan
28457ce337 app: display the floating mask over the layer mask.
It would make using floating masks a lot easier as it is visually understandable
that it applies to the layer mask.
2022-11-09 02:15:41 +01:00
Alx Sa
2c4f91f585 app: Paste as new layer by default
This changes the default selection pasting behavior to be a new layer,
rather than a floating selection. It also removes the
"Paste as New Layer" submenu options as they are now redundant.
2022-11-09 00:31:00 +00:00
Jehan
f6dd7f9b3a app: get rid of return_if_no_drawable() macro and…
… gimp_image_get_active_drawable() function!

Also fixing some memory leaks from previous usages of the multi version
return_if_no_drawables().
2022-11-09 01:24:34 +01:00
Jehan
5d75c79c89 app: remove compat registration for gimp-image-get-active-drawable.
Now we must use gimp-image-get-selected-drawables which is not a compatible
signature, as it returns an array of drawables.
2022-11-09 00:59:59 +01:00
Jehan
ddec8e2255 app: remove the last usage of gimp_image_get_active_layer().
The histogram is still not multi-drawable aware. In the future, it would be nice
to add ability to generate histogram for all selected layers (merged and as
separate images) as well as the whole visible image, therefore 3 possible cases.

But for now, it's alright like this (no more, but no less feature than before)
and at least we got rid of the last usage of functions assuming single item
selection.
2022-11-09 00:53:17 +01:00
Jehan
bd87766170 app: various Alignement tool strings update.
- Option dockable is named "Align and Distribute" rather than "Alignment".
  First, because it's not just about alignment; also because this way, it looks
  like other software, such as Inkscape; lastly because it's more consistent
  with other tool options ("Move", "Rotate", etc.).
- Add a tooltip to the Anchor Point widget to explain what it's used for.
- Rewrite various align/distribute button tooltips to make clearer that we are
  aligning anchor points with specific edges (or distributing these anchor
  points).
- Rename the first section to simpler "Targets".
- Some more rewording of other texts.
2022-11-09 00:40:44 +01:00
Jehan
6a63091e68 app: remove the offset feature in the Align/Distribute tool.
It's clearly broken right now. I can see it might have been used even to
progressively shift aligned items, but this was not used anymore. As for being
used while distributing, it doesn't make any sense anymore with the new logic of
not moving the extreme (first/last in coordinates) items.

I can see how an additional concept of offset can be useful in some situations,
but for now, let's get rid of this. We'll see in the future if someone asks for
it and provides valid use cases to work from.
2022-11-09 00:08:16 +01:00
Jehan
e48b002c84 app, icons, libgimpwidgets: add "distribute with evenly gaps" options.
There was one case in Inkscape which we could not do: distributing objects
keeping even gaps between them. Until now, we could only distribute keeping even
distance between anchor points (top, left, bottom, right or center).

With these 2 additional distribute options, I believe that GIMP is able to do
all the Alignment and Distribution options available in Inkscape (not the
"Rearrange" or node features, neither the text align/distrib; I just mean the
common align/distribute on objects), and even a bit more thanks to the anchor
point system (e.g. in Inkscape, we can't left or right-align to a reference
object/image center, or we can't center to a reference left/right/bottom/top
border; but we can do it in GIMP).

The icons are hopefully temporary, until we can make better ones.
2022-11-08 23:48:32 +01:00
Jacob Boerema
9ba5b8dbd6 app: fix issues in gimpmodifiersmanager.c found by coverity
- buttons_key doesn't get freed.
- modifiers could theoretically be used uninitialized.
2022-11-08 16:57:04 -05:00
Jacob Boerema
981979bb39 plug-ins: improve security in flame plug-in
- Use g_malloc* functions instead of malloc, so we don't continue on
failed allocations unless we test for NULL.
- Make sure we don't iterate past the known number of control points (ncps).
- Safely allocate, initialize and free points. Since points seems to be
used uninitialized, we use g_malloc0 to set everything to 0.
2022-11-08 16:57:04 -05:00
Martin
4fa8e7941d Update Slovenian translation 2022-11-08 21:42:45 +00:00
Zurab Kargareteli
a18408f73f Update Georgian translation 2022-11-08 20:50:04 +00:00
Jehan
09543af82a app: distribute while keeping extreme objects unmoved.
After discussing with Aryeom, we decided that "Distribute" should work within
the current horizontal or vertical bounds, as this is how it is usually done in
other software (e.g. Inkscape). For instance, if there are 4 items, the first
and last (coordinate-wise) stay untouched, and only the 2 intermediate items get
distributed evenly.

Since the Reference is not relevant anymore for "Distribute", I undo part of my
previous commit, where I was organizing the reference setting into its own
section of the Alignment tool options. This setting is back as part of the
"Align" section.
2022-11-08 21:39:58 +01:00
Jehan
2b0928d895 app: big UI rework of the align/distribute tool.
- Adding a separate pivot widget to allow choosing which point of the items we
  align or distribute. E.g. until now, we could only align the right side of
  objects to the right side of the reference object, left to left and center to
  center. Now these are independent. Therefore I can align the left side of
  objects to the right border of a selection or a layer, and so on.
- Only keep 2 "distribute" buttons (for now). Most of the distribution actions
  were basically broken or extremely hard to understand. Also they were
  apparently mixing concepts of alignments with distributions. Now let's
  basically only keep the bases: horizontal or vertical distributions.
  Everything is still possible using a mix of alignment and distribution
  buttons, and it's much clearer.
- Since the GimpAlignmentType was used nearly only there (except for some usage
  like to store dock side or filter preview split direction, but these
  GIMP_ARRANGE_* values were unused there), I removed the various enum values
  which we don't use anymore.
- The Reference settings gets its own subsection in the Align tool options.
  Until now, it looked like it only applied to alignment, whereas it applies to
  distribution too.

Note: this is still work-in-progress, mostly some initial dev work to put some
algorithmic bases. We had some UI and specification discussions with Aryeom
already and some things might still change a lot.
2022-11-08 19:19:55 +01:00
Jehan
63dc7dee8a app: redraw handles when needed.
There were various cases when the reference's on-canvas handles were not
redrawn, or drawn at all:

- When the reference is an image, we now draw them. It may seem redundant as
  it's the image bounds, but it's still useful to see what are the reference
  bounds in a glimpse. Moreover in "Show All" mode, it's even more useful.
- Start the tool, hence draw the reference handles, in oper_update() if not
  started yet.
- When the "align-reference" property changes.
- When the display (active image) changes.
2022-11-08 13:05:56 +01:00
Jehan
4c09f194d1 app: more fine-grained align/distribute button sensitivity.
When the reference is a guide in particular, no distribution is possible (on one
dimension, the size is 0, on the other, it's infinite) and alignment is only
possible in one direction (depending on guide orientation).
2022-11-07 22:48:30 +01:00
Martin
a8983f7823 Update Slovenian translation 2022-11-06 20:19:07 +00:00
Luming Zh
06a9240046 Update Chinese (China) translation 2022-11-06 19:22:53 +00:00
Boyuan Yang
c0cd58f38f Update Chinese (China) translation 2022-11-06 19:20:16 +00:00
Daniel Novomeský
e58efc314d flatpak: change recipe for libjxl 2022-11-04 11:17:58 +00:00
Rodrigo Lledó
dab80500f9 Update Spanish translation 2022-11-03 12:43:35 +00:00
Daniel Novomeský
006b77674d flatpak: Upgrade libde265 2022-11-03 12:07:52 +00:00
Hugo Carvalho
7164f27308 Update Portuguese translation 2022-11-03 11:38:08 +00:00
Yuri Chornoivan
e98f9cd797 Update Ukrainian translation 2022-11-02 18:33:52 +00:00
Zurab Kargareteli
7461eb8cd3 Update Georgian translation 2022-11-02 04:52:19 +00:00
Jehan
947130f2cb app: make a copy of selected items before gimp_container_view_select_items().
Otherwise the selected items might change and invalidate the pointer, eventually
leading to a segfault.
2022-11-01 22:57:21 +01:00
Jehan
04810ec95e app: name the "Floating Selection" differently depending it floats a layer or…
… a layer mask.

This is a first step to make a clearer difference between the 2 use cases.
2022-11-01 22:57:21 +01:00
Hugo Carvalho
fae838b227 Update Portuguese translation 2022-11-01 21:44:11 +00:00
Yuri Chornoivan
3c8d873914 Update Ukrainian translation 2022-11-01 20:43:11 +00:00
Zurab Kargareteli
1fac53a91b Update Georgian translation 2022-11-01 19:47:25 +00:00
Jehan
fa2fa71619 app: add a tooltip to "_Don't ask me again" checkbox.
I find these options always a bit unwise when people have no idea how to change
their mind. Therefore adding a tooltip with the information (though maybe we
should even do it even more clearly and adding that in checkbox text too?).
2022-11-01 17:36:45 +01:00
Jehan
092627fdb3 Issue #8697: do not make conversion to another profile the default behavior.
For this to happen, I've updated the main question to be "Keep the Embedded
Working Space?" instead of "Convert to * Working Space?". Basically now we put
emphasis on keeping the image's color profile as being the proposed action.
Therefore "Keep" is the default answer, on the right.
Yet "Convert" stays on the right too. There is no "Cancel" button anymore
because it is not a question we can really escape even though "Esc" still works,
and it still corresponds to "Keep", same as Enter now. The reason is that "Keep"
is actually the non-destructive option. So if someone really doesn't want to
answer and make an explicit choice, we do it for them with the only
non-destructive choice possible.

Also I'm changing "Convert" mnemonic to 'c'. I guess that earlier devs might
have used 'o' because it is the usual mnemonic for "OK", so it was right when
the question was "Convert?". But since now the question is the opposite, there
is no reason to make it look like "OK". Let's just use the first letter, which
is easier to guess (and not taken by any other button here).

I've been hesitating because I don't think "Convert" was the right default
anymore with our anyRGB move. Until now, it was kinda implying that sRGB (when
no preferred color profile was set) was kinda the recommended space. It's not.
If a file already has another space, it's probably much better to keep it.
First because "Convert" is often a destructive change (even more if the target
is sRGB), so for people who don't necessarily understand all the ins and outs,
we were kinda promoting a destructive default behavior.

On the other hand (and that's why I was hesitating):

* "Keep" is also what happens when we hit "Esc" so some might complain that
  there is no easy "Convert" key anymore (there is alt-c, but it's for sure not
  as easy as Esc or Enter). Basically it makes the "Convert" option always a
  much more explicit choice (yet it is likely for the best for people who care
  about their colors).
* There might have been many people who would just use the default (Convert
  until now) without thinking too much of what was asked, and that was working
  good because they would just publish on the web or similar basic usage. If
  they continue just accepting with Enter without reading and understanding what
  is asked, now they could publish images with a color profile (and we know it
  doesn't always work perfectly on the web).
  In other words, it might be the best default for professional usage now, yet
  it requires to understand a bit what you are doing.

It's really a hard call!
2022-11-01 17:24:22 +01:00
Rodrigo Lledó
db97cb4500 Update Spanish translation 2022-11-01 11:56:49 +00:00
Rodrigo Lledó
1a572830a9 Update Spanish translation 2022-11-01 11:08:43 +00:00
Jacob Boerema
89c83ef4c7 plug-ins: fix crash when reading corrupt flame settings file
Thanks to a report by Stefan Cornelius, we became aware that the flame
plug-in does no checking for correct input when loading a pre-saved
settings file.

I reworked the parser to read one or more values based on the type of
token, making sure we also don't read past the end of our token buffer.

All int values have a min and max value set. If any unexpected input is
encountered, we will give a warning.
2022-10-31 14:22:44 -04:00
Jacob Boerema
536c7cbc4b plug-ins: fix missing input buffer length checking in flame
The flame plug-in can read stored settings from a file. The expected
input is that a ; signifies the end of input.

However, with user input we cannot depend on this to be true, so we need
to make sure that we do not read past the end of our input buffer.
To do so, we add a length check.
2022-10-31 14:00:54 -04:00
Jacob Boerema
193596397e plug-ins: fix failure to load flame saved settings from file
We were using the plug-in name with underscores, which is incorrect.
Since nobody ever complained about this, this doesn't seem to be used
very often.

We will use the const that defines the plug-in name instead.
2022-10-31 13:57:14 -04:00
Piotr Drąg
729c876654 Update Polish translation 2022-10-30 13:12:50 +01:00
Hugo Carvalho
6d0dc6a3a1 Update Portuguese translation 2022-10-29 15:59:27 +00:00
Jordi Mas
3274671af4 Update Catalan translation 2022-10-29 17:57:42 +02:00
Yuri Chornoivan
1388d1af9c Update Ukrainian translation 2022-10-29 05:50:46 +00:00
Martin
a9ce2b8539 Update Slovenian translation 2022-10-28 06:30:31 +00:00
Zurab Kargareteli
1f635a50aa Update Georgian translation 2022-10-28 04:13:49 +00:00
Jehan
f7b026e3f0 build: add glib-networking to cross-built Windows jobs.
This dep is needed for various network GIO modules. Also various moving files
around from lib/gio/modules/ were broken in the new brought back jobs.
2022-10-27 16:23:56 +00:00
Jehan
6e2177bcd2 gitlab-ci: no contents in libexec/ on Windows.
Whatever is here on other platforms is in bin/ on Windows.
2022-10-27 16:23:56 +00:00
Jehan
afbb5494fa gitlab-ci: add --output-dll-list option to dll_link.py calls.
I added this option in commit 38d6783299. It makes the script stateful, able to
remember all previously processed DLL, hence making the whole job much faster
and efficient.
2022-10-27 16:23:56 +00:00
Jehan
0b709a99d5 Revert "gitlab-ci: removing win*-nightly jobs."
This reverts commit c11dc69137.
2022-10-27 16:23:56 +00:00
Jehan
b76411ff86 po-plug-ins: add missing plug-ins/file-icns/file-icns-save.c in POTFILES. 2022-10-27 14:36:14 +02:00
Jehan
75dd13981a libgimpconfig: more param spec types to ignore (GeglParamFormat). 2022-10-26 23:29:32 +02:00
Martin
43285bce57 Update Slovenian translation 2022-10-26 21:28:54 +00:00
Jehan
e5d5be4277 Issue #8062: error when offsetting a layer. 2022-10-26 23:10:51 +02:00
Alx Sa
dca12039ea plug-ins: fix #8127 Option to load reduced TIFFs
Adds a toggle to let users load TIFF pages with FILETYPE_REDUCEDIMAGE
tags. The specs do not state that these are always thumbnails, and they 
may have other uses. We assume that if only one page with this metadata
exists then it is a thumbnail; otherwise, the toggle option is 
enabled on load.
2022-10-26 20:34:30 +00:00
Jehan
14c973e522 NEWS: update. 2022-10-26 21:15:40 +02:00
Zurab Kargareteli
e1d0b8b4b3 Update Georgian translation 2022-10-26 03:41:39 +00:00
Jehan
92caf44817 libgimp: improve gimp_procedure_add_menu_path() docs regarding localization.
This was the last remaining bit in #8124. Basically I needed to check how
localization of menu paths worked. I was thinking of maybe have 2 arguments to
gimp_procedure_add_menu_path(), one non-localized (for default menu paths) and
one localized by the plug-in (for custom menus). That would break all plug-ins,
but also looking at our code, it's complicated to do right.

Instead let's just keep current API and add an example in function docs. We'll
see how we can improve the API if the very hypothetical problem I am foreseeing
actually happens some day: say a word in English translates to e.g. "Filters" in
some other language, whereas English "Filters" translates to yet another term;
in such case, this new menu would still merge with the default /Filters/ menu
when localized in this language, so we'd have the weird situation where the
custom menu label would have passed through 2 translations somehow.

But let's see how it goes. If we really need, in the future, we can deprecate
gimp_procedure_add_menu_path() and add a gimp_procedure_add_menu_paths() with a
base_path and a custom_path, while the custom_path would be expected to be
already translated.
2022-10-26 01:13:43 +02:00
Jehan
255cab6b43 plug-ins: fix a crash for closing a FILE twice.
Fixes:

> free(): double free detected in tcache 2

The file is closed also after resource_load() runs. Anyway it's better to free
resource on the same level they were created, so I remove the fclose inside the
function.
2022-10-26 00:23:18 +02:00
Jehan
f686d2afbf app: zlib saving is now multi-threaded too!
For the same file, which was saving in ~50 secs in RLE (now ~12), and ~80 secs
in zlib. It now saves zlib-encoded XCF in ~35 secs on the same machine with 8
threads.
2022-10-25 20:15:43 +02:00
Jehan
52d1743924 app: reorganized multi-thread saving code.
Contributed code was not wrong, far from it! But the whole memory management was
a bit on the hard-to-read side. For maintainability, I prefer some simpler code,
which contains a bit more allocation but it's reasonable and at least much less
indexes to play with.

Also instead of gegl_parallel_distribute(), then waiting for each set of batches
to entirely finish, I'm using a GThreadPool which I progressively fill with new
batch data. And finally I'm running the gegl_buffer_get() inside the threads (I
know that we have only reads on the buffer at this point; also GEGL has an
internal lock mechanism anyway).
These actually do not provide a huge additional speedup (compared to the initial
speedup by just going multi-threaded), most likely because the I/O are now the
bottleneck anyway (which is quite a good thing!).
2022-10-25 20:15:43 +02:00
Jehan
b35bdd2dc9 app: cleaning the previous commit for fast saving of RLE XCF.
- Coding style fixes.
- Removing gimp_gegl_num_processors unknown variable which didn't exist (coming
  from another patch from suzu. See discussion in #4985).
- Removing the `cleanup()` attribute to keep our code as generic as possible
  without specific compiler extensions. Just free memory manually as is expected
  in C.

Testing on a 115MiB XCF file, saving went down (on my machine, as average on
saving a few times) from about 50 seconds to 15 seconds.
This first version is already pretty neat, though we can probably do even
better.
2022-10-25 20:15:43 +02:00
suzu_11
a51434beb4 Issue #4985: Parallelize xcf_save_tile_rle to reduce time when saving xcf file. 2022-10-25 20:15:43 +02:00
Hugo Carvalho
586980a635 Update Portuguese translation 2022-10-25 16:34:09 +00:00
Alx Sa
08fedaa55a plug-ins: Add initial ICNS export support
This adds the ability to export to the most "compatible" modern ICNS
format for a particular layer.
2022-10-24 23:46:17 +00:00
Zurab Kargareteli
869c9bdcdf Update Georgian translation 2022-10-24 21:16:01 +00:00
Michael Schumacher
149358021e app: Add GDK_SCROLL_MASK to gimpviewablebutton initialization.
This makes these buttons respond to scroll wheels again, a regression encountered in GIMP 2.99.x.
Code location and fix found by Massimo Valentini.

Fixes issue #6929.
2022-10-24 00:27:13 +02:00
Jordi Mas
ce6626163e Update Catalan translation 2022-10-22 15:45:52 +02:00
Yuri Chornoivan
9ed613ced8 Update Ukrainian translation 2022-10-21 14:41:23 +00:00
Hugo Carvalho
72f696e3e2 Update Portuguese translation 2022-10-21 12:26:45 +00:00
Martin
df6464dfe2 Update Slovenian translation 2022-10-21 08:44:19 +00:00
Jehan
8f288bf722 libgimp: add gimp_image_list_selected_drawables().
Similar to other functions, we want a variant which returns a GList.
2022-10-20 23:17:07 +02:00
Jehan
831cb91303 app: remove gimp_image_get_active_drawable() usage in colormap actions. 2022-10-20 23:17:07 +02:00
Jehan
81969a0651 app, devel-docs: add a new "Vectors Structure" in the XCF format.
Instead of storing vectors as properties, they have their own structure, which
make them able to store and load all the usual and common properties of other
items. In other words, it makes XCF now able to store locks, color tags and
several selected paths.
2022-10-20 23:17:07 +02:00
Asier Sarasua Garmendia
32cf103939 Update Basque translation 2022-10-20 20:20:10 +00:00
Asier Sarasua Garmendia
caf0006d1e Update Basque translation 2022-10-20 18:59:24 +00:00
Jehan
a77c64fafe app, pdb: fixing gimp_vectors_export*() libgimp API.
It seems I forgot to fix some usage of core gimp_vectors_export*(),
which now take a list of paths (not a single path anymore since commit
9fc8260c7c), as these were used by PDB functions.
2022-10-20 19:07:16 +02:00
Jehan
759ee663f0 app, pdb: fix a few "incompatible pointer type" conversions.
That's the problem when there are still too many old warnings hiding the
new ones!
2022-10-20 18:56:24 +02:00
Jehan
b73278f1a8 app, libgimp, pdb: add missing functions for selected items.
Missing functions were:
* gimp_image_get_selected_channels()
* gimp_image_get_selected_vectors()
* gimp_image_list_selected_channels()
* gimp_image_list_selected_vectors()
* gimp_image_set_selected_channels()
* gimp_image_set_selected_vectors()
* gimp_image_take_selected_channels()
* gimp_image_take_selected_vectors()

There are discussions of renaming GimpVectors to GimpPath, which would
also be consistent with the GUI and make the always-plural less akward
in API. We'll see. For now keeping named like this.
2022-10-20 18:25:43 +02:00
Martin
0c6f7b167a Update Slovenian translation 2022-10-19 14:45:38 +00:00
Yuri Chornoivan
1b507376c4 Update Ukrainian translation 2022-10-19 14:41:18 +00:00
Jehan
6dc48f571c app: fix logic in gimp_edit_selection_tool_translate().
We should not check if all items are locked, but if one item is locked. It is
enough to forbid the translation from happening.
Otherwise it is currently possible to bypass position lock by using keyboard
arrows for layers or channels.
2022-10-19 15:47:11 +02:00
Jehan
789f52c412 app: make moving vectors with keyboard arrows multi-selection aware.
And this is one less usage of gimp_image_get_active_vectors()!
2022-10-19 15:41:23 +02:00
Jehan
48bebb8a27 app: replace one more usage of gimp_image_get_active_drawable(). 2022-10-19 15:14:14 +02:00
Jehan
74b4951e50 app: remove a gimp_image_get_active_drawable() in select actions.
The action "select-float" should probably only work for a single selected
drawable anyway since a floating selection can only be stacked on one drawable
at a time.
2022-10-19 15:09:38 +02:00
Jehan
6716d06aa1 app: remove one more gimp_image_get_active_drawable().
Actions "vectors-fill*" and "vectors-stroke*" require a single drawable to paint
to. So action logic is unchange. I only replace gimp_image_get_active_drawable()
by gimp_image_get_selected_drawables() and counting the drawables.
2022-10-18 22:36:24 +02:00
Jehan
6eb78ca11f app: remaining drawable actions are now multi-layer aware. 2022-10-18 22:19:44 +02:00
Jehan
85adfb46c8 app: make "drawable-lock-content|position" multi-drawable aware. 2022-10-18 22:06:21 +02:00
Yuri Chornoivan
564c37d06b Update Ukrainian translation 2022-10-18 18:48:43 +00:00
Jehan
cff1ae4176 app: remove one more usage of gimp_image_get_active_vectors().
For "text-tool-text-along-path", it makes sense to keep it only usable when a
single path is selected.
2022-10-18 16:35:59 +02:00
Hugo Carvalho
9dd33e0234 Update Portuguese translation 2022-10-18 11:11:46 +00:00
Hugo Carvalho
cd7b2fd99b Update Portuguese translation 2022-10-18 11:01:34 +00:00
Martin
0056b0b2f7 Update Slovenian translation 2022-10-18 04:24:27 +00:00
Jehan
c8547d0a50 app: new option "Use extents of layer contents" to Align tool.
Instead of using the layer borders, we use the bounding box for the contents.
This is similar to first run "Crop to Content" on every selected layer except
we don't actually need to crop. Therefore we can work on bigger layer than the
actual content while still arranging them based on content bounds.

So often the result of alignment/distribution feels wrong because it doesn't
correspond to the content we are seeing. With this option, we'll have the option
to choose the desired behavior.
2022-10-18 00:48:51 +02:00
Jehan
9be6a6b711 app: highlight guides which will be aligned or distributed. 2022-10-17 23:08:33 +02:00
Yuri Chornoivan
33330fb29c Update Ukrainian translation 2022-10-17 19:12:30 +00:00
Jehan
4eaf6c16b9 app: rework the Align tool interaction taking multi-item selection into account.
The old interaction was quite horrible. I don't think I ever really got a good
use of it. It was so hard to understand what you were picking and so on.

Now that we can multi-select items, let's just use this as the base of what we
want to align or distribute. Clicking on canvas will now mostly be used to pick
an item as reference. From now on, only the reference object will get on-canvas
handle, making it very obvious how your alignment or distribution will work.

I leave only an alternative picking method (with Alt or Shift-Alt pick) to add
guides to objects to align or distributes, as these don't have a selection
dockable.

I'm also improving the selection of stacked layers by looping through them
(similar as the layer selection on canvas feature) so that we can select even
background layers which have a lot of layers showing above.

I am planning to improve this tool even further, but this is a first step to
make it actually usable within the new multi-item interaction logic.
2022-10-17 19:03:50 +02:00
Alx Sa
53202a70ed app: Disabled symmetry menu when no image is set
To improve discoverability, the symmetry dockable's combobox menu is now
shown (but disabled) when no image is set.
2022-10-17 14:42:22 +00:00
Jacob Boerema
28e0033ed2 app: fix string of GIMP_HELP_FILE_CREATE_TEMPLATE
Even though GIMP updated the name of the define for Create Template to
GIMP_HELP_FILE_CREATE_TEMPLATE, it did not change the id string.
In gimp-help this string was updated, causing help not found when asking
for help for Create Template.

This commit updates the string used for the help id to be the same as
used in gimp-help. It also removes the old define that is not used
anymore in GIMP.
2022-10-16 17:17:18 -04:00
Hugo Carvalho
9469fd16f4 Update Portuguese translation 2022-10-16 14:15:05 +00:00
Hugo Carvalho
e2416b2ba0 Update Portuguese translation 2022-10-16 14:07:23 +00:00
Piotr Drąg
0581df1caa Update POTFILES.skip 2022-10-16 14:17:40 +02:00
Martin
bb91c380eb Update Slovenian translation 2022-10-16 06:21:57 +00:00
Yuri Chornoivan
05d36f9a27 Update Ukrainian translation 2022-10-16 05:51:29 +00:00
Alx Sa
00232e1787 plug-ins: Add support for loading .icns files
This ports ICNS loading code from Brion Vibber's 2004 plug-in.
It extends support for ICNS files that contain PNG or JP2 format icons.
2022-10-16 02:20:51 +00:00
Jehan
62963aa748 devel-docs: delete various devel docs which are now in developer.gimp.org. 2022-10-15 22:33:25 +02:00
Jehan
6c0c2f15c4 themes: toggle buttons were not styled at all when toggled. 2022-10-15 22:33:25 +02:00
Jacob Boerema
6cb58fbc8d app: remove duplicate GIMP_HELP_TOOL_CURVES define
This caused a missing documentation warning for help id gimp-tool-curves
in gimp-help.
2022-10-15 16:32:29 -04:00
Alx Sa
b317eceda9 pdb: Use floating point offset in stroke_translate
Update gimp_vectors_stroke_translate () to accept
floating point values for offset parameters
like gimp_stroke_translate () does.
2022-10-15 18:26:55 +00:00
Jacob Boerema
4b4dd5ec38 app: remove unused GIMP_HELP_TOOLS_DIALOG help id
This help id was used in the past but all references to it were removed
long ago with commit c53113d0cc.

Let's remove this define too since it causes a warning in gimp-help when
checking for help id's without documentation.
2022-10-15 14:05:03 -04:00
Luming Zh
177e3b7d49 Update Chinese (China) translation 2022-10-15 16:29:52 +00:00
lloyd konneker
7708c3fec3 Issue #8744: refactor overdependence on gimpui.h
To reduce compiling due to changes in libgimpui.
2022-10-15 15:17:08 +00:00
Alexandre Prokoudine
cb49cd84aa Update Russian translation 2022-10-14 18:39:48 +03:00
Yuri Chornoivan
d26761ff01 Update Ukrainian translation 2022-10-13 11:06:51 +00:00
Martin
e7246b1356 Update Slovenian translation 2022-10-13 08:10:06 +00:00
Alx Sa
0aa63806e6 text: Fix xcf load issue caused by MR !751
Loading an .xcf with a patterned outline caused GIMP to crash.
This is because PROP_GIMP was loaded at the end, so it was null when
text->gimp->pattern_factory was called. Moving PROP_GIMP to the
top of the property enum list ensures it's loaded first,
which resolves the issue.
2022-10-13 00:16:44 +00:00
Alx Sa
ca6b58e970 text: Add outline options to text editor
This ports Massimo’s code to work in the latest version of GIMP.
It adds new outline-related properties to GimpText and GimpTextOptions.
These are controlled via the Text Tool Editor.
Cairo is currently used to draw the outline around the text.
2022-10-12 22:00:40 +00:00
Jehan
2080abf0a3 Issue #8734: Python-fu misses sys.stdout.flush.
Just add a no-op flush() as I think it's actually unneeded in the context of a
GtkTextView GUI. At least it doesn't cause issues with copy-pasted code or when
using external libraries using the sys.stdout.flush() interface.
2022-10-12 23:40:04 +02:00
Jehan
bee4dd0fc3 app: finally remove the get_active_item() and set_active_item() abstract…
… methods of GimpItemTreeView.

There were 2 last usages of get_active_item() which are now gone with this
commit.
2022-10-12 22:47:22 +02:00
Jehan
0508148580 app: get rid of one more usage of get_active_item() abstract method. 2022-10-12 22:38:35 +02:00
Martin
6441008fa5 Update Slovenian translation 2022-10-12 20:18:14 +00:00
Jehan
9fc8260c7c app: "vectors-copy" and "vectors-export" are now multi-paths aware. 2022-10-12 22:13:38 +02:00
Jehan
fde780daeb app: "vectors-(raise|lower)*" actions now multi-paths aware. 2022-10-12 21:45:13 +02:00
Jehan
2835e85950 app: make the "vectors-select-*" actions multi-selection aware. 2022-10-12 21:21:22 +02:00
Jehan
acf428b24c app: get rid of one more gimp_image_get_active_vectors(). 2022-10-12 18:02:43 +02:00
Jehan
925d4c317f app: cleaning unused variables.
Removing build warnings!
2022-10-12 17:53:04 +02:00
Jehan
131cdf0f1c app: fix preview for multi-layer transform.
Though it was working in the "Composited preview" case, it was only showing one
of the multiple layers being transformed in the basic case.
2022-10-12 17:52:04 +02:00
Hugo Carvalho
d589547fa0 Update Portuguese translation 2022-10-12 15:48:54 +00:00
Jehan
274c079c4c app: also show rotation preview for multiple-selected paths. 2022-10-12 17:19:10 +02:00
Jehan
b74e6c2198 Issue #8640: Rotate two selected paths creates error window. 2022-10-12 17:19:10 +02:00
Jehan
dd0fc44677 NEWS: update. 2022-10-12 01:08:55 +02:00
Jehan
e4e87d65ca plug-ins: fix the new unit editor (!655).
- Don't forget to run gimp_ui_init() to get GIMP's styling in plug-ins.
- Process the "key-press-event" signal so that Escape key closes the window (as
  it used to before the MR commit).
- Expand vertically the tree view, otherwise resizing the window leaves a lot of
  ugly empty space, even though the tree view is still shown incomplete with a
  scrollbar.
- Fix the Help button (which was doing nothing).
- Use full words for the "Refresh" and "Help" buttons, rather than icons. Text
  is usually prefered for UI discoverability/understandability, unless there is
  a space issue (i.e. too many icons for all of them to be words).
- Add a "OK" button too, and reorder the buttons similarly to how we usually
  order them.
- Minor coding style fixes (alignments…).
2022-10-11 22:11:16 +00:00
Jehan
dc8298ce76 libgimpwidgets: use "system-help" for GIMP_ICON_HELP.
Just "help" is not one of the standard icon names as per the Freedesktop Icon
Naming specification.
See: https://specifications.freedesktop.org/icon-naming-spec/icon-naming-spec-latest.html

Therefore when using this name, we usually don't have any icon (especially as we
don't provide any in our own icon themes).
Use "system-help" instead which is a standard name 'for the “Help” system
category'.
2022-10-11 22:11:16 +00:00
Niels De Graef
567d7beb11 plug-ins: Remove GtkAction from unit editor
Migrate to `GAction` and while we're at it, clean up the plug-in by
using `G_DECLARE_FINAL_TYPE()`.
2022-10-11 22:11:16 +00:00
Jehan
c928fda8ff app: fix GEX installation with warning while decompressing.
There is not only the ARCHIVE_OK and ARCHIVE_FATAL cases. There are also
ARCHIVE_WARN cases which should not break the installation (I think?). Since I
still want to pass the warning over to extension developers, I am printing it to
stderr.

As an additional fix, prevent such a warning when installing an extension over
itself. In such case, it looks like the archive_entry_size() would be 0, which
was triggering some "Writing to Empty File" warning.
2022-10-12 00:08:28 +02:00
Jehan
5df4875c88 app: do not depend on returned image for successful file_open_with_display().
We may return GIMP_PDB_SUCCESS with no image for generic file procedure, such as
is the case with .gex extension files.
file_open_image() already sanitizes the status returned by the plug-in, so at
this point, we should trust the returned status.

This fixes a crash when loading .gex files (GIMP_PDB_SUCCESS status yet a NULL
error).
2022-10-11 23:19:18 +02:00
Jehan
bfc9e4bb72 configure: add an info message to advise building with meson and report bugs. 2022-10-11 16:39:12 +02:00
Jehan
8ac5178214 libgimpwidgets: fix automake syntaxe.
Automake doesn't accept the "if else" syntax. Instead, we must add a new if/else
inside the first else block.

While I'm at it, I also add a G_GNUC_INTERNAL to the internal function
_gimp_pick_button_win32_pick(), though I don't think it's absolutely necessary
(yet explicit is better).
2022-10-11 00:29:57 +02:00
Jehan
fb1cb22f62 app: cleanup MR !734.
- app_activate_callback() moved with other private functions.
- Removing the `if (app)` test in app_activate_callback() as we don't
  set it to NULL anymore. The app variable is always set.
- As a consequence of the previous point, change signature of
  app_exit_after_callback() which doesn't have to change the value of
  app anymore.
- Don't emit direcly the "exit" signal from app_activate_callback(). We
  must call `gimp_exit (gimp, TRUE);` instead, which does more than just
  emitting this signal. It also takes care of cleaning any remaining
  images without a display. If we don't do this, we are leaking
  GeglBuffer when opening images from command lines while quitting
  immediately with --quit.
- Get rid of gimp_core_app_set_values() which was completely bypassing
  the fact that all the properties of a GimpCoreApp were construct-only.
  Instead make these proper properties. I use a trick used in other
  interface, creating a gimp_container_view_install_properties() which
  is called from child classes.
  The point of GimpCoreApp is not just to share a common interface, it's
  rather to weakly simulate some kind of multi-inheritance in GObject.
  Since we want both GimpApp and GimpConsoleApp to inherit from a same
  parent class while we also want them to inherit either from
  GtkApplication and GApplication respectively (yet without linking to
  GTK in this second case), we are stuck as far as normal GObject
  inheritance goes. This is why we use an interface to which we add a
  private struct through a GQuark trick. We want the property settings
  and function implementations to also be part of this shared code.
- Get rid of all the abstract methods of GimpCoreApp of the form
  get_*(). These are useless as we don't expect these to have different
  implementation depending on the actual child class. Once again, our
  main goal was to simulate multiple inheritance rather than actually
  have an interface with various implementations.
- Make "no-splash" a property of GimpApp, because it's cleaner this way.
- Fix gimp_core_app_private_finalize().
- don't use #pragma once, it's not standard. Just use include guards.
- Fix includes: order was wrong, include from the source, not other
  headers, etc.
- Clean various other details, coding styles, fix several more bugs and
  more…
2022-10-09 16:12:07 +02:00
Lukas Oberhuber
1ee1224d05 app: Add in gimpconsoleapp and gimpcoreapp interface
GimpApp is a GtkApplication
GimpCoreApp is an interface for common functions
GimpConsoleApp is a GApplication (to avoid linking in Gtk)
2022-10-09 16:12:07 +02:00
Niels De Graef
27fe67814e app: initial work on moving to GtkApplication.
Reviewer's message (Jehan): This was a work-in-progress by Niels, which
we only keep in this state because Lukas worked over it. I have rebased
and fix-amended many broken part of this commit, because various things
had been changed in these areas of code since this commit was initially
written.
2022-10-09 16:12:07 +02:00
Jehan
8bbde7db25 Issue #8695: fix GIR build in autotools.
Fixing this error:

> Gimp-3.0.o:(.data.rel+0x430): undefined reference to `gimp_text_layer_get_type' linking of temporary binary failed
2022-10-09 16:09:10 +02:00
Martin
5eb65a06a5 Update Slovenian translation 2022-10-09 08:09:34 +00:00
Luca Bacci
d2dc2cb983 Add GimpPickButton implementation for Windows
Fixes https://gitlab.gnome.org/GNOME/gimp/-/issues/8506
2022-10-07 10:45:22 +00:00
Luca Bacci
9ef4aee21b Fix warning about using %d format modifier for an unsigned type
GetLastError () returns a DWORD, which is a typedef for a 32 bit
unsigned integral.
2022-10-07 10:45:22 +00:00
Zurab Kargareteli
36050fd5be Update Georgian translation 2022-10-06 21:40:14 +00:00
Hugo Carvalho
4d592d0b6c Update Portuguese translation 2022-10-05 22:09:00 +00:00
Yuri Chornoivan
dda66fe354 Update Ukrainian translation 2022-10-05 19:55:27 +00:00
Alx Sa
ffbee51776 plug-ins: Fix odd length for .ani metadata
.ani files require metadata fields to be an even length. If the data
length is odd, an extra 0x00 is added for padding.
This patch updates the export and import code to comply with this
requirement.
2022-10-05 19:01:14 +00:00
Hugo Carvalho
30f13a75e3 Update Portuguese translation 2022-10-05 16:06:29 +00:00
Daniel Novomeský
d11e175612 Add libheif-dev and libjxl-dev to Debian container 2022-10-05 16:44:47 +02:00
Daniel Novomeský
eac694905f plug-ins: metadata import/export for JPEG XL format
Changes require libjxl 0.7.0
2022-10-05 14:15:26 +00:00
Lukas Oberhuber
bce3bf23de goat-exercise: fix ability to load js
However, this is still currently crashing on MacOS.
2022-10-04 18:02:38 +01:00
Alx Sa
697b41dc45 plug-ins: Export PSD with paths
Ports PSD path export from file-tiff-save.c so that paths are carried
over in PSD project files as well.
2022-10-02 14:44:46 +00:00
Hugo Carvalho
b3332bb900 Update Portuguese translation 2022-10-01 22:10:06 +00:00
Fran Dieguez
af5587197f Update Galician translation 2022-10-01 19:08:56 +00:00
Luming Zh
b39569cb2e Update Chinese (China) translation 2022-10-01 14:19:37 +00:00
Jehan
892b62ec36 app, libgimp, pdb, plug-ins: new GimpTextLayer class in libgimp.
Now text layers are proper types, which means that the binding API will also be
nicer (e.g. `txt_layer.set_text('hello world')` in Python).

This commit also adds the param specs allowing to create plug-in procedures with
text layer parameters.

Finally it fixes the few calls in file-pdf-save (apparently the only plug-in
using specific text layer API right now) with explicit type conversion.
2022-09-30 20:55:51 +02:00
Gotam Gorabh
091ce7cdf2 libgimp: Add scrollbar to dialog comments
Resolves #8550
Puts comments widget in GtkScrolledWindow widget to prevent
dialogue growing too tall with multi-line comments.
2022-09-30 18:54:07 +00:00
Yuri Chornoivan
aec5c3c108 Update Ukrainian translation 2022-09-30 17:20:50 +00:00
Martin
471f9e641b Update Slovenian translation 2022-09-30 16:18:54 +00:00
Jehan
690949eb34 app, libgimp, pdb: add a note about unsupported markup.
After re-reading #534, I realized I missed the discussion about unsupported
markup by the tool. Then I tested and confirmed what Ian Munsie initially said
in a comment: unsupported markups are properly rendered in the text layer, yet
are simply dropped when editing with the text tool.

This is actually the ideal behavior as it means that with the API, you can even
go further than what is currently possible with the GUI. So it gives nice powers
to people who can script GIMP. We still need some warning in the function
documentation to tell developers about this weakness in the tool GUI.
2022-09-30 00:59:10 +02:00
Jehan
9aa32ffe42 themes: fix textview background color.
It seems I had forgotten some hardcoded color in there. I didn't notice it until
now, because it was not that bad in the few instances where it was shown (for
instance the comment field in export plug-ins), but I really realized there was
a problem with the Python console which was not too practical (white writing on
kinda light background).
2022-09-30 00:51:33 +02:00
Ian Munsie
445909bff5 Issue #534: add a function to set the Pango markup of a text layer
This complements the existing text_layer_get_markup function and allows
scripts to create and modify complex text layers.

It adds the <markup> root tag if it was not supplied and will run the
markup through pango_parse_markup() to check for errors.

Reviewer's (Jehan) note: this is a mostly untouched patch contributed in #534,
except that code moved around. I also fixed the header set in the .pdb, a link
to pango markup docs and added the meson changes.
2022-09-30 00:50:34 +02:00
Jehan
8dcc9345fa libgimp: fix GObject-Introspection build in autotools.
Fixes:

> /usr/bin/ld: ../libgimp/.libs/libgimpui-3.0.so: undefined reference to `gimp_check_custom_color2'

I am actually unsure this fix is fine. It doesn't look like it should
work. And worse, I can't reproduce the fix by reverting it after.

The only other person who reported it was akk, with exactly the same
symptoms.
2022-09-29 23:11:38 +02:00
Jehan
c342bcf1d9 NEWS: update. 2022-09-29 22:47:18 +02:00
Jehan
4e08ab9659 themes: add some border theming to default and active buttons.
I noticed some buttons had a bluish border, showing the system theme leaking
over our default theme. So I'm just overriding this with a grayscale color.

These 2 new rules are especially useful in dialogs so that you know what happens
when you hit "Enter". The "default" action (.suggested-action in GTK CSS) is the
action we set to be the active one by default. E.g. if you open a dialog and hit
Enter immediately, without touching any widget focus, this is what will be
activated.

The GTK CSS .default action on the other hand seems to simply be the button with
focus right now, which can be changed through Tab or other ways. If both types
of styles are visible, the .default one is the actually activated action (not
.suggested-action), which is why I make its style a bit stronger (solid rather
than dotted and a bit more opaque).

Also I discover the shade() function to reuse a color and adding it
transparency!
2022-09-29 21:06:47 +02:00
Jehan
5c53fe7b49 themes: no different background for checked check/radio buttons.
Checked buttons had a background using the @selected-color. This was because of
a too broad rule on `.text-button:checked`. Basically it looks like the broad
rules are not good because they sometimes override more accurate rules for
specific widgets.

I also make a few more rules a bit more accurate. Also I extend some CSS rules
for check and radio buttons.
2022-09-29 19:59:55 +02:00
Alx Sa
4ddb71c8ac plug-ins: Export PSD as CMYK file
Adds an option to export as CMYK (mutually exclusive with the existing
Duotone export option). Header information (mode and number of channels)
are set, and the data itself is converted via Babl.
Layer channels are also hardcoded to 4, since GIMP currently doesn't
support CMYK channels.
2022-09-29 17:27:03 +00:00
Jehan
91ec8a34f3 themes: have the "extreme" CSS colors a bit less extreme.
We had some concept of slightly more extreme theme colors (i.e. darker in dark
themes) to color differently in some widget-in-widget cases.

For instance, we use this in the treeview list to separate it better from nearby
interface. But this extreme dark background may have been a bit "too dark", as
reported by Jacob. The goal is for this list to stand out, but maybe it was
standing out too much. Hopefully it's better now.

As a side change, I also add some borders to the top icon header (with "eye" and
"lock" icons) just above the list. I think it better explain the separation.
2022-09-29 19:01:00 +02:00
Daniel Novomeský
403d11330c flatpak: minor fixes in libde265 and libjxl modules
don't build unnecessary tools from libde265
libjxl uses existing BROTLI library instead of bundled one
2022-09-29 11:51:47 +00:00
Jehan
4ab1102ae2 themes: switch should have a border otherwise it's hard to understand. 2022-09-29 00:04:12 +02:00
Jehan
7c96fc723c Issue #8670: the color of the "selected text" field seems too dark.
Just use an inverted logic for the selected text (i.e. white on black in light
mode, or black on white in dark mode). This is the usual logic for rendering
selected text anyway (except that we don't use non-grayscale colors, e.g. blue
background is common in system themes).
2022-09-28 23:27:50 +02:00
Jehan
a021b1999a libgimp: change signature of get_window() of GimpProgressVtable.
As diagnosed in #8649, using a guint32 for windows identifier may have been
right long ago (was it?), but is definitely not anymore. I can see that a XID is
an unsigned long nowadays (usually 64-bit on 64-bit Linux).

As far as I can see, on Windows, it would be a void* behind (which also
corresponds to the error message in #8649 description):

> typedef void *PVOID;
> typedef PVOID HANDLE;
> typedef HANDLE HWND;

Cf. https://learn.microsoft.com/en-us/windows/win32/winprog/windows-data-types

I *think* that pointers would be 64-bit on Windows 64-bit, though I'm unsure
(after all, this is an OS with 32-bit long int on 64-bit arch!).

Anyway, it's just better to move to 64-bit window identifiers.
2022-09-28 22:41:05 +02:00
Jehan
a93249fa65 Issue #8649: fix "incompatible pointer to integer conversion".
Since Clang 15.0.0:

> The -Wint-conversion warning diagnostic for implicit int <-> pointer
> conversions now defaults to an error in all C language modes. It may be
> downgraded to a warning with -Wno-error=int-conversion, or disabled entirely
> with -Wno-int-conversion.
2022-09-28 22:34:05 +02:00
Jehan
d3458a82d0 Issue #7023: icon size selection on GIMP 2.99.
This kinda reverts commit 6aebd30de1 ("app: remove
icon sizing preferences"), except that the code base is different enough since
this old commit was mainly for GIMP 2.10.x.
In any case, after initially thinking that GTK+3 handling for high density
display would be enough, we finally decide that adding back a Preferences-wide
setting for overriding the theme-set icon size is a good idea (additionally to
GTK+3 automatic support).

The base idea for removing the feature was that GTK+3 has high density display
support, through the "scale factor". Typically a high density display will
normally be set as using a ×2 scale factor so all icons will be double size.
Unfortunately it turns out it's not enough.

For instance, on very small screen estate, even with a scale factor of 1, if the
theme sets 24px toolbox icons, it may still take too much space.
Oppositely on huge screens, even with ×2 factor scale detected by the OS, the
icons may still feel too small (this is possibly what happens with #7023).

Furthermore there is also a matter of taste. Some people like small icons even
when they have the space. Others may want bigger icons, easy to click on.

Finally you can like a theme for its color scheme for instance, but it may not
have the icon size you want. Right now, we'd need to duplicate every theme in
small or bigger size. Instead of doing so, let's just have this global setting
overriding the theme rules.

Comparison with the 2.10 implementation:

- We still provide 4 sizes: small, medium, large and huge.
- We don't have the "Guess ideal size" setting anymore. Instead this is now a
  mix of the GTK+3 scale factor logic and the theme-set or custom size. I.e.
  that on a high density display with ×2 scale factor, we could have toolbox
  icons up to 96 pixels (48×2)!
- We now try to have less custom code in widgets as we append the CSS rules to
  the theme (similar to what we were already doing for dark theme or icon
  variants). What happens in widget code is mostly to connect to changes in
  themes and redraw the widgets which need to be.
- The custom size will now affect: toolbox icons, the FG/BG editor widget (in
  both the toolbox and the color dockable), dockable tab icons, the main
  dockable buttons, eye and lock header icons in item tree views, eye and lock
  cell icons in the item lists.

There are still a bunch of areas where it is not taken into account, such as
plug-ins, and various dialogs, but even in custom-made interface in dockables.
Ultimately it might be interesting to have a way to sync more buttons and
widgets to a global size settings.

Lastly, I fixed a bunch of existing bugs where we were updating icon sizes with
gtk_image_set_from_icon_name() using the const icon name taken from
gtk_image_get_icon_name(). As this was reusing the same string pointer, we were
ending with freeing the icon name.
2022-09-28 21:11:58 +02:00
Jehan
b48bd7d337 themes: do not set a background-color on all .horizontal class widgets.
This was massively breaking GtkScale rendering. Or at least the marks (and mark
texts) added by gtk_scale_add_mark() were simply invisible.
I tried to figure why, staring at the GTK inspector and testing various CSS
rules to fix it without removing this line, but just couldn't make sense of it.
In the end, I'll just remove this line. It looks like in CSS (or just GTK CSS?),
it might be better to set rules on accurate widgets rather than too broad rules. 🤷
2022-09-28 20:49:54 +02:00
Tim Sabsch
1dda74a849 Update German translation 2022-09-27 16:16:31 +00:00
Jehan
624493af4b app: properly resize the GimpFgBgEditor when changing icon size.
This is the needed improvements I was talking about in commit 00fbcbea0b. Right
now, when changing the icon size, the FG/BG color widget was not immediately
resizing. It needed a restart of GIMP.

Now it will properly react to "style-updated" signal, but also to "theme"
property of GimpGuiConfig.
The reset of the color icon pixbufs is also needed when GimpFgBgEditor size is
re-allocated.
2022-09-26 21:53:13 +02:00
Jehan
dfbaf4d501 app: make sure the icon size and button relief are updated when changing theme.
When changing the theme, the style-updated signal is *usually* run, but not
always. For instance, moving from a theme with big icons to one with smaller
icons (or the other way around) sometimes work, and sometimes doesn't. I'm not
sure if it's to be considered a bug in GTK or if this signal depends on other
things. Anyway we have our own "theme" signal on the GimpGuiConfig and we know
exactly that we need to make sure that the icons are properly redrawn in such a
case. So let's just connect to this signal.
2022-09-26 21:10:30 +02:00
Jehan
d2cf2813dd themes: new "Middle Gray" theme.
So what we read on the topic is to use (as base color) the gray which is
perceptually half-way between black and white. Unfortunately it can mean
different colors. For instance if using the sRGB TRC, the #808080 color is
sometimes cited.

Instead I went with the color LCH (50, 0, 0), i.e. with half perceptual
lightness in "CIE LCH(ab) float" babl space, i.e. #777777 in sRGB. It
corresponds to the 18.42% gray which is often refered to, so it seemed a fine
choice.

This replaces proposal in !683 because the contributor is not responding
anymore, and also it uses the common theme base CSS files used by all other
official themes.
2022-09-26 18:37:16 +02:00
Daniel Novomeský
0f8f3c3f1a flatpak: enable BMFF format support in exiv2
Improves AVIF, HEIF, JPEG XL metadata support.
2022-09-23 13:30:12 +02:00
Daniel Novomeský
e0ef799473 flatpak: upgrade libheif and libjxl 2022-09-22 16:32:33 +02:00
Balázs Úr
a50a4ddd1b Update Hungarian translation 2022-09-20 22:07:08 +00:00
Balázs Meskó
524317753a Update Hungarian translation 2022-09-19 23:04:03 +00:00
Balázs Úr
4bb592fd71 Update Hungarian translation 2022-09-19 22:52:19 +00:00
Daniel Novomeský
213aa77fc9 plug-ins: RGB AVIF compatibility with Safari on iOS 16.0
Write both ICC and NCLX boxes for RGB AVIF to make sure that
all browsers render the AVIF images in same manner.
Use heif_init/heif_deinit in libheif 1.13.0+
2022-09-19 14:01:11 +02:00
Martin
bb0e243374 Update Slovenian translation 2022-09-18 09:39:31 +00:00
Sveinn í Felli
dbe81ac91c Update Icelandic translation 2022-09-16 21:48:54 +00:00
Sveinn í Felli
6b10d6e8c1 Update Icelandic translation 2022-09-15 22:45:59 +00:00
Fran Dieguez
27bbc8a5df Update Galician translation 2022-09-15 06:26:32 +00:00
Zurab Kargareteli
42330e30af Update Georgian translation 2022-09-14 15:45:00 +00:00
Boyuan Yang
e94411661e Update Chinese (China) translation 2022-09-13 18:13:04 +00:00
Anders Jonsson
250d82cc7c Update Swedish translation 2022-09-13 17:17:59 +00:00
Anders Jonsson
46e75e952c Update Swedish translation 2022-09-13 17:04:14 +00:00
Boyuan Yang
7c9a1f5021 Update Chinese (China) translation 2022-09-11 19:30:56 +00:00
Hugo Carvalho
1c5c1d90b8 Update Portuguese translation 2022-09-11 13:46:58 +00:00
Yuri Chornoivan
2f6ca56301 Update Ukrainian translation 2022-09-11 06:11:09 +00:00
Jehan
2c3e65a6b6 NEWS: update. 2022-09-10 23:45:08 +02:00
Thomas Klausner
22dee60a9d Issue #8605: Unportable test(1) operator in tools/extract-vector-icon.sh 2022-09-10 23:08:06 +02:00
Jehan
2be2c43c9c plug-ins: new "root-layers-only" argument to file-pdf-save.
Something I wanted to implement for a long time and today I finally took
the time after I had one more annoying case where I had to merge all
groups for exporting then undo for saving!

Now this won't be needed anymore as the plug-in will allow to export
only as pages any first-level layers (groups included, so you could
gather your page compositions in root layer groups). For me, it's the
only way I use this when making/editing PDFs with GIMP, but maybe some
people would still want GIMP to crawl into groups and subgroups and
export layers individually. That's why I make it an option, defaulting
at TRUE.
2022-09-10 22:56:01 +02:00
Jehan
e3ce70c5e8 plug-ins: port "file-pdf-save" to GimpProcedureDialog.
Note that I didn't port "file-pdf-save-multi" at this point, though I
did move to using GimpProcedureConfig instead of GimpValueArray
everywhere.

In any case, that's a lot of code removal and simplification already,
though some part of this plug-in is still a bit ugly.

We also get proper config storing between sessions now.

As for metadata, it unfortunately doesn't look like Exiv2 has PDF
support, so I didn't add metadata settings.
2022-09-10 22:23:03 +02:00
Jehan
b24d4c93e2 libgimp: deactivate metadata flags without appropriate property in…
… gimp_procedure_config_save_metadata().

If you use gimp_procedure_config_save_metadata() or
gimp_procedure_config_end_export(), you don't really control the flags
and let the GimpProcedure API make somes choices for you, based on
various assumptions. One of them is that the procedure has specific
properties (named "save-*", either created manually or with the various
gimp_save_procedure_set_support_*() functions). So if you don't have
them, we should assume this format doesn't handle a given metadata
format and deactivate it.

For plug-ins with a different/specific logic, they are expected not to
use these helper functions. They would likely call lower level functions
such as gimp_image_metadata_save_finish() or the newer
gimp_image_metadata_save_filter(), where you control the metadata flags.
2022-09-10 21:35:00 +02:00
Jehan
646bc3e43b Issue #8604: NetBSD does not provide libdl.
The dl*() functions are in libc directly. This probably applies to all
*BSD too. And from what I read, it should even apply to macOS, even
though a libdl is present there (is it bogus?).

So let's make the libdl check proper by only make it mandatory on Linux
(on Windows it was already unchecked too).
2022-09-10 17:42:28 +02:00
Jehan
a78651aca4 Issue #8604: Linux Input is enabled even though it is not Linux.
Fix the Linux Input test to correctly only depend on whether or not the
header is present. Having X11 target is not enough (e.g. it breaks the
build for NetBSD and probably on all BSDs).
2022-09-10 14:50:38 +02:00
Jehan
76bc349279 devel-docs: starting to move development documents to dev website.
This file was just moved as content/core/specifications/locks.md in the
pat/bootstrap branch of the gimp-web-devel repository.
This branch will soon be merged and become our new website. Removing the
now duplicate in our source repo.
2022-09-09 21:12:25 +02:00
Jehan
cfeedb8736 data, devel-docs, gitlab-ci: improve the docs tarball.
- Use a relative path for GIMP_LOGO_PATH inside the gi-docgen generated
  HTML, and not an absolute path taken from build dir (otherwise this
  would break, for installed docs, but also for the tarball and the
  developer website!).
- Also use either gimp-logo.png or gimp-devel-logo.png depending on
  whether we are on a stable or unstable branch.
- Install these in images/ inside the GIMP docs folder, which
  corresponds to the relative path given to GIMP_LOGO_PATH.
- The installed root dir will be $datadir/doc/gimp-2.99/, e.g.
  /usr/share/doc/gimp-2.99/
- Inside this folder, the library references will be in libgimp-3.0/ and
  libgimpui-3.0/ (instead of weird Gimp-3.0/ and GimpUi-3.0/). Note that
  the root dir uses the application version (2.99) whereas the library
  folder use the API versions. These are different in development phase.
- Archive the gi-docgen installed files, not taken from the build dir,
  to avoid packaging temp files, such as the .toml files. Note that
  `g-ir-docs` files are still taken from the build dir, as we don't
  install them yet.
- Finally package all this in a directory before archiving in a tar.xz,
  named the same as the directory (e.g. gimp-api-docs-2.99.13/ inside
  gimp-api-docs-2.99.13.tar.xz).
2022-09-09 20:32:27 +02:00
Jehan
faff5d00b5 gitlab-ci: generate tarball for GIMP documentation. 2022-09-09 16:54:28 +02:00
Sveinn í Felli
ccfb56d6ce Update Icelandic translation 2022-09-08 16:48:47 +00:00
Sveinn í Felli
c183b4478b Update Icelandic translation 2022-09-08 16:46:18 +00:00
Sveinn í Felli
fb386d09c9 Update Icelandic translation 2022-09-08 16:44:47 +00:00
Sveinn í Felli
49b2241055 Update Icelandic translation 2022-09-08 16:41:41 +00:00
Lukas Oberhuber
7f257a3a33 gimp-updates: fix update checks on macOS
Update processing has to be done on the main thread to avoid
problems with GTK thread safety.
2022-09-06 21:29:18 +01:00
Jordi Mas
f45a62d672 Update Catalan translation 2022-09-06 19:56:52 +02:00
Jehan
fbb5b40345 app, autotools, meson: new GIMP_RELEASE macro.
We were using GIMP_UNSTABLE extensively to differentiate development
from stable code. But there is actually another level of development
code. Basically GIMP_UNSTABLE tells you are on the development branch,
e.g. for current branches, that you are on 2.99.* versions (vs. 2.10).
This depends on the minor version oddness.

GIMP_RELEASE will tell you if it's a release or a in-between-releases
code. This works with the micro version which must be even on release.
Any odd number means you are basically using random git code.

There can be any combination of GIMP_RELEASE and GIMP_UNSTABLE. For
instance 2.99.12 is a release of the unstable branch, whereas 2.10.33 is
development code of the stable branch.

I use this first in the update code as we were using GIMP_UNSTABLE for
both concepts but it made it harder to test. Now:

* GIMP_DEV_VERSIONS_JSON environment variable is only available on
  development code, not on release (whether stable or unstable).
* The weekly check limitation is also only for releases (dev code just
  check at every startup to quickly detect issues and regressions).
* Whether to look on testing website or public website json file depends
  on the code being a release or not.
* Finally only whether to check "DEVELOPMENT" or "STABLE" sections in
  the json file depends on whether we are on stable or unstable
  branches.
2022-09-05 22:16:56 +02:00
Lukas Oberhuber
5735bd7fa8 check_for_updates: fixes update check macos #7325
This was not working due to a missing port in glib.

Potentially could be contributed upstream to GLib.

(cherry picked from commit b391f9f5c8)

Conflicts fixed:
	app/gimp-update.c
2022-09-05 16:33:57 +02:00
Hanabishi
76728fee01 Fix 'gimp-script-fu-interpreter' version
It supposed to use api version instead of app version. And seems like the symlink is excessive, it can't be run by user anyway.
2022-09-05 05:33:32 +05:00
Daniel Novomeský
75121fdbc8 build: remove ilmbase from crossroad build,
because it is no longer offered by MSYS2
2022-09-03 19:19:30 +00:00
Daniel Novomeský
a61299ddb1 plug-ins: fix builing with libheif 1.13.0+ 2022-09-03 19:19:30 +00:00
Zurab Kargareteli
937a7774c2 Update Georgian translation 2022-09-03 18:27:27 +00:00
Hugo Carvalho
f48de7a041 Update Portuguese translation 2022-09-02 14:11:10 +00:00
Hugo Carvalho
cd6011db71 Update Portuguese translation 2022-09-02 13:42:25 +00:00
Balázs Úr
640f9c6bf9 Update Hungarian translation 2022-09-01 23:15:06 +00:00
Jehan
47a56cf644 NEWS: kickstart GIMP 2.99.14 release notes. 2022-08-31 16:34:35 +02:00
Jehan
d4f12a843a Issue #8561: unrecognized command-line options '-mmx', '-sse'.
Fixes:

> gcc: error: unrecognized command-line options '-mmx'; did you mean '-mmmx'?
> gcc: error: unrecognized command-line options '-sse'; did you mean '-msse'?
2022-08-31 15:31:00 +02:00
Hanabishi
358ba0991f Cleanup meson symlinks
More elegant solution to avoid platform-dependent executable extension detection
2022-08-31 13:10:13 +00:00
Jehan
08b7de3b13 Issue #8520: show devel download link when relevant.
This is shown in the About dialog when a new version is available, but
also in the debug dialog (also when a new version is available).

Of course, for stable versions, we should still show the main download
page (which I double-checked current code does).
2022-08-31 13:13:27 +02:00
Jehan
99d16a6f31 meson: fix one more deprecation warning when cross-building.
This meson warning was only showing when configuring a cross-compilation
project.

Fixes:

> WARNING: Project targets '>=0.56.0' but uses feature deprecated since '0.55.0': meson.has_exe_wrapper. use meson.can_run_host_binaries instead.
2022-08-31 12:42:08 +02:00
Jehan
a791151ed0 meson: update the end WARNING about meson being experimental.
Now we call it "extensive testing phase" and encourage packagers to use
meson and report bugs.
2022-08-31 01:40:12 +02:00
Jehan
ca230cb770 meson: fix warnings of deprecated features.
Now that we bumped our meson requirement, meson is complaining about
several features now deprecated even in the minimum required meson
version:

s/meson.source_root/meson.project_source_root/ to fix:

> WARNING: Project targets '>=0.56.0' but uses feature deprecated since '0.56.0': meson.source_root. use meson.project_source_root() or meson.global_source_root() instead.

s/meson.build_root/meson.project_build_root/ to fix:

> WARNING: Project targets '>=0.56.0' but uses feature deprecated since '0.56.0': meson.build_root. use meson.project_build_root() or meson.global_build_root() instead.

Fixing using path() on xdg_email and python ExternalProgram variables:

> WARNING: Project targets '>=0.56.0' but uses feature deprecated since '0.55.0': ExternalProgram.path. use ExternalProgram.full_path() instead

s/get_pkgconfig_variable *(\([^)]*\))/get_variable(pkgconfig: \1)/ to
fix:

> WARNING: Project targets '>=0.56.0' but uses feature deprecated since '0.56.0': dependency.get_pkgconfig_variable. use dependency.get_variable(pkgconfig : ...) instead
2022-08-31 01:29:37 +02:00
Jehan
9ff1358e0b Issue #8552: Failed to build using gimp-2.99.12-autotools.tar.bz2 tarball. 2022-08-31 00:46:29 +02:00
Jehan
dd53de0f0b meson: bump our requirement to meson 0.56.0.
For meson, I want to be particularly careful and not follow the "Debian
testing" rule as it bit us by the past for babl.
But this bump is probably OK:

* Debian stable has meson 0.56.2.
* meson 0.56.0 was released on 2020-10-30.
* GIMP 2.99 is a dev branch with no end release date yet.

This should also fix this warning at configuration time:

> WARNING: Project specifies a minimum meson_version '>=0.53.0' but uses features which were added in newer versions:
>  * 0.55.0: {'Calling "add_dist_script" with File, CustomTarget, Index of CustomTarget, Executable, or ExternalProgram'}

We missed it until now because it was only happening with tarball builds
where gitversion_h could be a files() object, unlike in git builds.
2022-08-31 00:15:36 +02:00
Jehan
76df38399c Issue #8537: GIMP 2.99 tarball fails to configure with Meson. 2022-08-31 00:06:31 +02:00
Jacob Boerema
85134478c7 plug-ins: fix #8553 GIMP 2.99.12 Cannot Open WebP Files
GIMP tried to open webp files as ani (animated cursor) files. The reason
for this is that for ani we had set the file magic as the first 4 bytes
should be RIFF.

However, RIFF is a container format, used by many different file formats,
among which is also webp.
This means that checking for RIFF is not specific enough.

Based on the info on http://fileformats.archiveteam.org/wiki/ANI
we will check the 4 bytes starting at offset 8 for ACON, which is
apparently the identifying part for animated icons.
2022-08-30 15:33:12 -04:00
Balázs Úr
6324f3f142 Update Hungarian translation 2022-08-29 22:47:24 +00:00
Jacob Boerema
268b063c00 plug-ins: fix #8548 export to mng not working
Due to a typo in the config property "default-delay", loading of that
option and the ones after it, failed.

Because of this, default-chunks had an invalid value, which made our
export fail. After correcting the typo the export succeeds.
2022-08-29 12:14:54 -04:00
Jehan
9ce27be989 meson: improve/fix previous commit from MR !725.
- Setting an exec_dir variable is an error. As meson docs says, if
  relative, it is installed relatively to prefix anyway: "If this is a
  relative path, it is assumed to be relative to the prefix."
  On the other hand, it would make problems if someone tried to set an
  absolute bindir.
  Moreover it is a lot clearer now. When we want to install in the
  binary directory unconditionally, then get_option('bindir') is the
  meson way, hence the way to go.
- On the other hand, the `gimp-debug-tool` is installed either in bindir
  for Windows or macOS and libexecdir for all other platforms, at least
  that's how it's set in the autotools build. So let's keep both builds
  consistent.
- Make a hopefully clearer description for enable-default-bin option.
  Let's clarify this is just about creating unversionning links pointing
  to versionned files.
- Adding an item in the "Optional Features" part of the summary listing
  during meson configure, for better discovery.

For the ".exe" extension on Windows, I wished we had an $(EXEEXT)
equivalent on meson rather than trying to set it ourselves (are there
other platforms where we must set a different extension?). But I could
not find any.
2022-08-29 15:43:25 +02:00
Hanabishi
879f7b48de Issue #8546: Meson options fixes
- Implement `enable-console-bin` meson option
- Fix wrong `enable-default-bin` behavior in docs
- Implement `enable-default-bin` meson option
2022-08-29 13:41:08 +00:00
Piotr Drąg
b2729643f8 Update Polish translation 2022-08-28 15:26:07 +02:00
Jehan
efbc422a9d tools: small update to the stats script.
- GTK+3 themes are CSS.
- Also check for cursor updates.
2022-08-28 15:17:19 +02:00
Jehan
e52da94072 NEWS: update.
Minor fix, missing new feature and removing a DDS feature which appeared
in GIMP 2.10.32.
2022-08-28 15:03:36 +02:00
Martin
50a1fd6ed3 Update Slovenian translation 2022-08-26 12:05:01 +00:00
Yuri Chornoivan
82789d469c Update Ukrainian translation 2022-08-25 20:15:01 +00:00
Jacob Boerema
fac6b2f3f1 plug-ins: improve formatting and comments related to resolution export ...
for PSD's
2022-08-24 14:19:46 -04:00
Jacob Boerema
24886f91b1 plug-ins: fix #8508 Print exporting to PSD seems to export as cm ...
and import as inches

When GIMP's display unit was mm, our PSD export converted the X and Y
resolution as if a conversion from mm to inch was needed.

However, PSD's resolution is always measured in pixels per inch, so a
conversion is never necessary.
Removing the conversion, resolves the issue.
2022-08-24 14:19:46 -04:00
Zurab Kargareteli
0dbb00a3c9 Update Georgian translation 2022-08-24 06:44:23 +00:00
Jacob Boerema
0ad54f863a plug-ins: fix #8467 "incorrect value RichTIFFIPTC" when loading TIFF ...
created by Adobe Lightroom 5.1

Adobe products are known to write incorrect RichTIFFIPTC tags in TIFF
images.

Since libtiff correctly detects and handles this there is no real need
for end users to be warned. So instead of a warning we will only output
a message to stderr.
2022-08-23 17:27:18 -04:00
Jacob Boerema
ced071a8ee plug-ins: check for invalid resolution when loading TIFF image
This is essentially the same check as done in gimp_image_set_resolution,
but doing it here means we can load the image instead of throwing an
error.

We still need to get replacement xres and yres values, because these are
used to compute layer_offset_x_pixel and layer_offset_y_pixel.
2022-08-23 17:27:18 -04:00
Jacob Boerema
18d466df7f plug-ins: fix GIMP becoming unresponsive due to corrupt image
Image m2-d0f86ab189cbe900ec389ca6d7464713.tif from the imagetestsuite
is a fuzzed image with an invalid very high number for the channel count.

This causes GIMP to become unresponsive for a very long time. Possibly
trying to allocate memory for all channels or another cause related to
the high number of channels.

Let's go for a more "reasonable" limit of 99 channels like we also do
for Photoshop images and show a message when we find an image with more
channels.
2022-08-23 17:27:17 -04:00
Jacob Boerema
853e9d5cb4 plug-ins: fix crash when loading multi page TIFF images in non interactive mode
When loading a TIFF image using a script/plug-in in non interactive mode,
we did not initialize the list of pages, causing a crash when trying to
access it.

So, always initialize this list when non interactive.
2022-08-23 17:27:17 -04:00
Jacob Boerema
ac5a6e56b7 plug-ins: fix TIFF warnings about unknown tags not filtered out anymore
Due to a change in the format string in libtiff, warnings about unknown
fields were not filtered out anymore.

Adjust our filtering of warning messages so we catch this again since
end-users don't need to worry about this and we don't need the
possible extra issues.
2022-08-23 17:27:17 -04:00
Hugo Carvalho
a66989d534 Update Portuguese translation 2022-08-23 17:01:29 +00:00
Martin
106d0565bf Update Slovenian translation 2022-08-23 08:20:58 +00:00
Jehan
941a53dfbc po-windows-installer: fixing broken po files for Windows installers.
This is purely fixing by meson rebuilds and some regexp fixes. I didn't
touch any semantic.
Basically the "&amp;" XML entity should not have made their way to the
po files. I fixed our script in the previous commit, and now I just
rebuild the po files and clean the entity programmatically so that our
Windows installers for GIMP 2.99.12 release have valid text.

Here is what I did:

(1) I regenerated the pot and po files:

$ meson compile gimp30-windows-installer-pot
$ meson compile gimp30-windows-installer-update-po

(2) I opened all the po files in vim and regexp through them.

Get back the proper Report-Msgid-Bugs-To:

:bufdo! %s$"Report-Msgid-Bugs-To: \\n"$"Report-Msgid-Bugs-To: https://gitlab.gnome.org/GNOME/gimp/issues\\n"$ge|update

No translations were fuzzy in any po files before this change. I remove
all the fuzzy flags, but only if the msgid contains an ampersand, hence
leaving appropriate fuzzy strings in (the ones where the source string
changed since the last translation):

:bufdo! %s/#, fuzzy\n\([^&]*\)&/\1\&/ge|update

Then I replaced &amp; in msgstr (msgid was fixed through the automatic
regeneration thanks to previous commit, but not the translations) with:

:bufdo! %s/&amp;/\&/ge|update

(3) Finally I did a manual `git diff` review to verify all is good.

In particular, I had to fix a bunch of "E&xit". The string is probably
too short so gettext heuristic failed to consider it likely the same as
"E&amp;xit".
2022-08-22 23:00:41 +02:00
Jehan
7375116d46 po-windows-installer: fix double escaped ampersand in XML for the…
… Windows installer localization.

There are kind of 2 separate bugs here:

- Direct i18n.gettext() to the proper data directory where to find the
  ITS file. Otherwise `meson compile gimp30-windows-installer-pot` and
  `meson compile gimp30-windows-installer-update-po` complained about
  not knowing XML and falling back to C, which is obviously a problem:

> /usr/bin/xgettext: warning: file 'build/windows/installer/lang/setup.isl.xml.in' extension 'xml' is unknown; will try C

- Set gt:escapeRule to "no" in the ITS file, otherwise the XML entity is
  kept as-is in the po file (i.e. "&amp;" stays "&amp;" inside the po
  files), but it's considered as raw text when merged back to XML, i.e.
  that the '&' is properly converted to a XML entity, so we end up with
  a double escape "&amp;amp;".
  Now the po file will have a '&' which will still be converted to XML
  entity at merge time. This is actually most likely better than asking
  translators to handle XML entities themselves (with the possibility to
  make typos and break the XML entity).

See https://savannah.gnu.org/bugs/?58643
2022-08-22 20:50:59 +02:00
Alexandre Prokoudine
02739dd6e6 Update Russian translation 2022-08-22 11:24:17 +03:00
Alexandre Prokoudine
dacf838ffe Update Russian translation 2022-08-22 11:07:14 +03:00
Jehan
ba83b30c21 configure.ac, meson.build: post-release version bump to 2.99.13. 2022-08-22 01:44:45 +02:00
Jehan
b1e13b5a15 Release development version GIMP 2.99.12. 2022-08-21 21:21:38 +02:00
Jehan
20d6ae85ea tools: fix generation of welcome-dialog-data.[ch].
This was broken because of the port to gettext (XML tag names for
translatable text were not prefixed by an underscore anymore).
2022-08-21 21:21:38 +02:00
Jehan
e7b81b9f71 README: update information.
- The mailing list URL is now a general discussion URL.
- Gather all discussion channels in a single section.
- Remove some outdated sentence about a web form for plug-ins (no idea
  what this is, but clearly we don't have this anymore).
2022-08-21 21:21:38 +02:00
Sabri Ünal
e6acb15d5c Update Turkish translation 2022-08-21 18:03:18 +00:00
Sabri Ünal
49c5581206 Update Turkish translation 2022-08-21 17:44:10 +00:00
Sabri Ünal
0a587f2601 Update Turkish translation 2022-08-21 17:41:16 +00:00
Sabri Ünal
ba5dd298ca Update Turkish translation 2022-08-21 17:34:32 +00:00
Sabri Ünal
80b5adf517 Update Turkish translation 2022-08-21 17:32:57 +00:00
Jehan
203652651d app: properly release shell scrolling on button release.
If we released first the modifiers, then the pointer button during
scrolling, we could end up blocked on scrolling. This makes sure the
button release is the finale scroll unlock, allowing modifiers to be
only used for starting the scroll.

It also fixes activating custom actions, by storing the action
description from the initial modifiers at press time, not release time.
2022-08-21 17:38:04 +02:00
Jehan
2f83db70ff app: delete duplicate modifier rows in the modifiers editor.
When changing the modifiers of a mapping, we should delete any previous
row with the same modifiers.
2022-08-21 16:51:30 +02:00
Jehan
60d08c87f4 app: delete the previous mapping when changing modifier.
Previously, when updating a modifier mapping, we ended up with a
duplicate for the same action.
2022-08-21 12:50:17 +02:00
Jehan
e916e93c1d themes: better styling for background dialog.
This linear gradient really doesn't render any feeling of "background"
IMO. I only initially implemented it this way because the underlying
theme seemed to use such gradient effect on headerbar for background
dialogs, so I wanted to test this.

Anyway simply using the "disabled" color seem to work well. After all,
the semantic is similar too (if it's in the background, a dialog can be
considered inactive in some way). In any case, the meaning definitely
comes across now.
2022-08-21 12:44:30 +02:00
Jehan
6da9d3aed2 authors: update. 2022-08-21 12:24:20 +02:00
Jehan
c4682be682 themes: use the disabled color more globally.
Don't use it only on menus. For instance, there were disabled checkboxes
(and their label) in plug-ins which were not showing different at all,
and it's confusing. Now both menu items, and other type of settings will
show similar "disabled" style.
2022-08-21 12:12:32 +02:00
Jehan
fbbe3dbaa9 desktop: update Appdata.
Getting ready for release.
Sorry to translators for adding these strings so late!
2022-08-21 02:56:15 +02:00
Jehan
f95a417313 NEWS: update. 2022-08-21 01:26:43 +02:00
Jehan
623346a8a7 app, docs, etc: "Default" is (as the name implies) the new default theme. 2022-08-21 01:03:30 +02:00
Alx Sa
cb7f9f86a8 app: Save simulation intent and bpc in XCF file
Creates two new parasites to save the black point compensation status
and rendering intent simulation settings in GimpImage.
The parasites are saved and loaded as part of the image in the 
.xcf file.
2022-08-20 22:31:07 +00:00
Jehan
64113d67bc themes: new Compact theme.
Something which is regularly asked is to use smaller icons. We used to
have a "Small" theme in 2.8, which got away in 2.10 with icon sizing (cf
issue #6121).

This is a revival of such a theme (except I call it "Compact" because it
feels more appropriate than "Small"). The theme is basically the same as
"Default" (through an include), just tweaking some size related CSS
rules.
2022-08-21 00:05:10 +02:00
Jehan
00fbcbea0b app: size the GimpFgBgEditor relatively to the toolbox icon size.
Until now we were sizing the FG/BG area with hardcoded size ((40, 38)
which I'm not sure where it came from!). Now this allocation size will
depend on the toolbox icon size (I made so that the FG/BG area is more
or less the same size as former hardcoded values with large toolbar
icons).
I had to tweak a bit the size of the default FG/BG icons and the swap
icons, which were also hardcoded. They now also depend on the allocation
size, hence the icons size.

Note that this code still has a limitation: it won't resize when you
switch from a theme with one size to another size of icons. A restart
will be necessary. This is something we should improve.
2022-08-20 23:48:44 +02:00
Jehan
ebbcf67dd9 theme: transform the Light theme into a Default theme and add a dark…
… variant.

Now with my recent code, instead of creating 2 different themes, I make
it a single theme containing both a Light and Dark variant.

I move all semantic logic into common.css which will be included by both
variants after they set up their color definitions.

For choosing the basic gray to use for the dark variant, I first looked
up what is usually recommended. Most articles on the web about dark
themes would cite some "Material design" project (apparently originated
from Google) which makes guidelines for Android/iOS/Flutter and web
applications. Their guidelines recommend #121212 ("Dark Grey") as
background color. I tried, it's **really** dark. Maybe I'm just not used
to it, but it feels like it might be OK for small phone "apps" which
people might want to watch in the dark, but possibly not for a full
grown desktop software. I don't really know, I might be wrong and some
people might want to edit their pictures with such dark GUI.

Anyway for now, I settled for a base background #303030, which is
already quite dark, darker than Adwaita dark or than our 2.10 dark
variant, but at least doesn't feel like a black hole.
2022-08-20 20:10:57 +02:00
Jehan
05fd811662 themes: parameterize colors of our Light theme.
Instead of hardcoding the colors in CSS rules, make variables of them,
with meaningful semantic names. It will help with making consistent
design where a color means something and is reused in several places
(e.g. a color for "hovering" or "selecting").

I add some variants but not too much (e.g. treeviews had even lighter
background, with an inversion of logic, where selected items are on
darker background instead of lighter).
Colors in this theme are mostly the same before and after this commit,
except for a few parts where I felt that having more variants was
detrimental for consistency and maintenance.

As part of the changed colors:

- check and radio buttons' background just reuse the lighter background
  color (as used e.g. in treeviews and entries).
- menus also use this lighter background color with the color inversion
  (same as treeviews) for hovered items.

This commit also brings some improvements to disabled cases:

- Stylize also disabled tree view items (e.g. disabled actions in action
  search were styled the same way as runnable actions).
- Stylize the same way disabled buttons drawn directly or with an image
  widget.

The last use for this change is that it will help to create a dark
variant for the same theme using nearly the same code, hence get
consistent styling.
2022-08-20 19:23:38 +02:00
Jehan
c3dca26d1a app: allow a dark variant of a same theme, instead of having 2 themes.
This way, what will happen is that:

- We can have a single "Default" theme which will have both the light
  and dark versions.
- With our Default theme, when "Use dark theme variant if available" is
  unchecked, we just follow the system-wide dark settings. (though I'm
  unsure we actually do with current code; we do load our theme over the
  system theme, which may be dark, but I don't think we'd load a dark
  theme variant then)
- If the option is checked, we will load the specific dark variant,
  bypassing system settings specifically for GIMP.

Technically for theme designers, all it takes to have a dark variant is
to add a gimp-dark.css next to gimp.css. `gimp-dark.css` is loaded
instead of `gimp.css` when the settings is checked.

Note: there is apparently a new freedesktop portal for setting the
prefered variant (and now it's apparently either light, dark or
default), which is now implemented by GNOME, KDE and Elementary at
least. It would be nice if we could grab this settings and use it if
available. The below link has code sample showing how to do it with
DBus:
https://gitlab.gnome.org/GNOME/Initiatives/-/wikis/Dark-Style-Preference
2022-08-20 19:23:38 +02:00
Anders Jonsson
7b57d1734b Update Swedish translation 2022-08-20 16:03:46 +00:00
Anders Jonsson
93ef3bf1cc Update Swedish translation 2022-08-20 15:55:08 +00:00
MohammadSaleh Kamyab
e98645656d Update Persian translation 2022-08-20 14:05:14 +00:00
Jehan
5b17d08809 themes: improve themes.
- Indent all rules in Light theme with the same number of spaces for
  style consistency.
- When GIMP was set in "Prefer dark variant", spin buttons and other
  entries had too dark borders. Fix this.
- Fix the spinbutton entry's border radius which was at 0, but since the
  buttons of the spin button are themselves rounded, it looks weird only
  on the top and bottom left corners. So apply a 3px radius. I did this
  in the System theme.
2022-08-20 14:04:28 +02:00
Jehan
0cc2dedeb3 gitlab-ci: try to fix the CI for releases (and other CI pipelines). 2022-08-20 11:17:44 +02:00
Alx Sa
0f5431b590 themes: updates to Light theme
Makes the following changes:
*Toolbox Wilber is now visible
*Large black border removed from ScrolledWindow
*"Duplicate text" effect removed from labels
*Toolbox tabs are now stationary when changing selection
*"Add Tabs" menu background color changed to match Light theme
*Unnecessary border around Check Updates box removed
2022-08-20 03:11:53 +00:00
Yuri Chornoivan
82391c8915 Update Ukrainian translation 2022-08-19 20:23:23 +00:00
Yuri Chornoivan
86cbd1a28a Update Ukrainian translation 2022-08-19 20:15:23 +00:00
Alx Sa
a3fb3ca110 plug-ins: Enable export of original Duotone data
Optionally includes the previously saved 
Duotone color space data on PSD export.
New load dialogue alerts user if duotone data was imported.
New export dialogue appears if the image is still grayscale and
the parasite exists.
If selected, the mode is set to PSD_DUOTONE in the header and
the original duotone data is written in the color space section.
2022-08-19 19:19:20 +00:00
Jehan
6b3d69a3c5 themes: some fix to the new Light theme.
These are issues which appeared to me only when GIMP was set to use the
dark theme variant. In such a case, I guess we see quite well CSS rules
coming from parent themes, such as the globally set system theme.

* Remove any background image (which may come from the system theme?) on
  buttons.
* The headerbar was dark and when in the background, it had a dark
  linear gradient (probably coming from my system theme). So make sure
  the background color is right as a general rule, and add back a
  (small) light gradient to indicate the background state.
* GtkListBox had a dark background. We don't have a lot of usage for
  this widget yet, but a few (for instance in icon theme settings, or in
  the modifiers editor).
* The GtkSwitch buttons were dark on dark. Set a light background. Also
  when the switch is ON, I add a bit of color, not too strong, but
  enough to indicate the checked status, because I find this widget
  design not so obvious. Since I don't think we use switch buttons
  anywhere else but in Preferences, this is probably not a big problem
  as it should not affect color perception when working on the canvas.
2022-08-19 20:27:57 +02:00
Akkana Peck
947bd1666a themes: add Light theme
It still has some issues, but it's already pretty usable.
2022-08-19 17:40:49 +00:00
Martin
af3d417ce1 Update Slovenian translation 2022-08-19 14:58:35 +00:00
Martin
5c5f593919 Update Slovenian translation 2022-08-19 14:49:55 +00:00
Jehan
dfb7d2543a Issue #8505: WEBP, be more informative with error.
Add the info about max dimension of WebP with WEBP_MAX_DIMENSION macro.

There is also a test about (picture->width / 4 > INT_MAX / 4), resp.
height, but this should anyway never happen as the C spec says the
smaller range for int is [-32767, 32767], which is an order bigger than
the current WEBP_MAX_DIMENSION (16383).
So we are probably fine assuming all VP8_ENC_ERROR_BAD_DIMENSION errors
will happen because of WEBP_MAX_DIMENSION.
2022-08-19 14:10:15 +02:00
Anders Jonsson
18065236bf Update Swedish translation 2022-08-19 09:54:13 +00:00
Jehan
9b21688501 Issue #6778: Colorpicker (from Colors dockable) shows wrong color.
Actually our X11 implementation is right, and the implementation from
the Freedesktop portal is "as far as it can do", i.e. that we get the
returned RGB value, which is unfortunately in display space. And it
doesn't return any space information together (we don't even know which
display the color comes from, in multi-display setups).

Therefore let's check if we are running GIMP on X11 and if so, let's
call this implementation first.

See this report on xdg-desktop-portal to get proper space info:
https://github.com/flatpak/xdg-desktop-portal/issues/862
2022-08-18 21:42:39 +02:00
Jehan
34ae339099 app: set default simulation intent to relative colorimetric.
We should set these explicitly, otherwise it will usually default to the
first of the enum, which is perceptual (which is usually not a proper
choice).

Relative colorimetric is usually the recommended default.
2022-08-18 19:13:19 +02:00
Jehan
7f1dd80ab2 app: fixing the soft-proof profile chooser.
The GimpColorProfileComboBox widget requires the profile chooser dialog
to be explicitly constructed. It doesn't create it by itself.

I guess I hadn't tested clicking this "Select color profile from disk…"
combo item during review. I only selected visible profiles in the list!
2022-08-18 16:42:39 +02:00
Zurab Kargareteli
ef4ed1a10f Update Georgian translation 2022-08-18 08:17:43 +00:00
Zurab Kargareteli
02cfdc8081 Update Georgian translation 2022-08-18 05:48:19 +00:00
Anders Jonsson
6eb158e799 Update POTFILES.in 2022-08-17 19:37:39 +00:00
Luming Zh
4990968dc1 Update Chinese (China) translation 2022-08-17 18:20:10 +00:00
Alx Sa
bf53e420af Issue #1973: Add toggle to choose PNG bit depth behavior 2022-08-17 18:05:13 +00:00
Jehan
a22575896f NEWS: update. 2022-08-17 18:20:42 +02:00
Alx Sa
7b7ce8c5f0 display: Show Soft-Proofing menu in status bar
This adds a Soft-Proofing pop-over menu when right-clicking the toggle
in GimpStatusBar. It lets users toggle proofing, using BPC and showing
out-of-gamut colors. It also lets users change the profile and
rendering intent.
2022-08-17 11:37:10 -04:00
Jehan
d72a42ed20 app: add a modifier action for opacity change.
Opacity and brush size are among the 2 most common tool options which
people might want to often change, though we should likely later add all
other common types of tool settings angle, aspect ratio, spacing, etc.

I am also unsure using the enum action is the right call because what it
does is just taking into account the distance from initial click to
compute an opacity. Instead it might be more interesting to increase or
decrease slowly or rapidly by going right or left from the initial
click. We'll see. But it's a first step.
2022-08-17 16:46:26 +02:00
Jehan
76ddf4421c app, po: remove GimpControllerMouse code.
The mouse controller had many limitations:

* It was not per-device.
* It was a long hard-coded list of events, which made its evolution
  annoying and scrolling the list boring.
* It was starting at button 8, while the first buttons were supposed to
  be hardcoded interactions. And it stopped at button 12, while some
  device might have more buttons nowadays. See !386.
* The "Grab event" does not seem to work in many cases, according to
  feedbacks.

The new GimpModifiersEditor will now handle any button (except the first
button, which is reserved for tools), you can even override or change
default canvas actions (panning, rotation, etc.). It should not be
limited with a max button number either (though I haven't tested with a
device really having a lot of buttons since I don't have any such device
but I did emulate huge button numbers on my stylus with xsetwacom and it
did work well; hopefully I'll get feedbacks). And now it can even run
custom actions.
So basically it should deprecate the mouse controller as the modifiers
editor can do everything the controller could, and more (unless I missed
anything).
2022-08-17 14:20:18 +02:00
Jehan
dd012d11d2 app: now support custom actions as input device button + modifiers.
Custom actions are basically any action (currently GtkAction) which can
be assigned a shortcut. Now they can also be assigned to an input device
button (with modifier or not).
2022-08-17 14:20:18 +02:00
Jehan
f7d7771038 app: try to make the button selection button more obvious.
From Aryeom's feedback, it's really not obvious enough how we start
customizing button's modifiers.
2022-08-17 14:20:18 +02:00
Jehan
14e8703ff7 app: remove GIMP_MODIFIER_ACTION_BRUSH_SIZE, change defaults and labels.
* The relative brush size change was not implemented anyway. Maybe later.
* Also changing the defaults to GIMP_MODIFIER_ACTION_BRUSH_PIXEL_SIZE
  which I think might be the most understandable size variant.
* Finally re-label "Rotate" to "Rotate View" as per Aryeom's feedback
  because just "Rotate" is indeed confusing as it could mean several
  different actions in GIMP.
2022-08-17 14:20:18 +02:00
Jehan
23dd00b07f app: fix switching seamlessly from constrained to unconstrained canvas…
… rotation and back.
2022-08-17 14:20:18 +02:00
Jehan
156adee410 app: new modifier action to set brush size diameter.
Actually I am renaming GIMP_MODIFIER_ACTION_BRUSH_PIXEL_SIZE into
GIMP_MODIFIER_ACTION_BRUSH_RADIUS_PIXEL_SIZE, which allows to set the
brush size on-canvas, starting from center to border.

The new GIMP_MODIFIER_ACTION_BRUSH_PIXEL_SIZE now sets the brush size
from one border to another.
2022-08-17 14:20:18 +02:00
Jehan
1ab4661bf2 app: fix space actions on canvas.
Space: panning
Ctrl-space: zooming
Shift-space: rotating
Ctrl-shift-space: constrained rotating

Note that these are still hardcoded, unlike the actions through
modifiers + pointer buttons.
2022-08-17 14:20:18 +02:00
Jehan
89f55336a2 app: add a page in Preferences to set the canvas modifiers up.
Finally everything is getting assembled with this commit. It is now
possible to customize the modifiers which will be used on canvas.
2022-08-17 14:20:18 +02:00
Jehan
5167e5aa45 app: new GimpModifiersEditor widget.
This widget will be used to edit the GimpModifiersManager config class
with a graphical interface.
2022-08-17 14:20:18 +02:00
Jehan
100bdeddd9 app: store keys as keyval/modifiers rather than string.
There is really no need to make back and forth between a string and
int/enum representations, and it actually cause problems at times.

It's also a problem for the button representation where a modifier will
be represented as a key.
2022-08-17 14:20:18 +02:00
Jehan
9d3ef444ea app: use modifiers set in GimpModifiersManager rather than hardcoded.
For now GimpModifiersManager returns the same modifiers as what was
previously hardcoded and we have no GUI yet to change the settings. But
the core of the new feature is in place.
2022-08-17 14:20:18 +02:00
Jehan
91b30145cb app: add a GimpModifiersManager object to GimpDisplayConfig.
This object's goal will be to manage customized modifiers per input
device button, which is why I add it to GimpDisplayConfig. It is in its
own new config file (`modifiersrc` in config dir) because it requires
GDK types access (well I could have done without, but it would have been
less semantic, hence not as good of an API). Anyway it is only useful
when running GIMP as GUI.

The GUI widget and the usage code to make this actually useful will come
in upcoming commits.
2022-08-17 14:20:18 +02:00
Jehan
924dea3a35 app, po: show proper instructions in GimpShortcutButton.
When no accelerator was set yet, display relevant information, and when
the button is toggled (waiting for shortcut input), display also
relevant info.
2022-08-17 14:20:18 +02:00
Jehan
fe65b4d4c6 app: new GimpShortcutButton widget.
A widget to grab a shortcut provided interactively. It can also grab
modifier-only shortcuts so we will be able to use it for the new
on-canvas interaction customizability.

Maybe we'll use this later for the shortcuts dialog which should really
be improved some day and has a lot of known issues. We'll see.
2022-08-17 14:20:18 +02:00
Jehan
a853052768 app: new "Canvas Interaction" setting.
Moving the "Space Bar", the "Snapping" and the new "Zoom" (MR !570)
settings there. The idea is that it will also be where we'll customize
more on-canvas related abilities, such as the new zooming behavior
preferences, but also possibility to customizing or disabling the
various canvas action, and finally customizing the new contextual
settings such as brush sizing or other.
2022-08-17 14:20:18 +02:00
Jehan
c804865ddd app: new "tools-paint-select-pixel-size-set" action.
Also ensure that the outline circle is redrawn while changing the
outline size.
2022-08-17 14:20:18 +02:00
Jehan
67d5e59ffb app: new "tools-warp-effect-pixel-size-set" pixel size set action. 2022-08-17 14:20:18 +02:00
Jehan
ebf99132eb app: create a new pixel-size-set action for Ink and Brush tools.
Once this is done, I got rid of the ugly hack I added over the already
ugly hack used on "*-set" enum actions.
2022-08-17 14:20:18 +02:00
Jehan
c7979e7f06 app: new double action "tools-mypaint-brush-pixel-size-set", used as…
… new action_pixel_size of GimpMyBrushTool.

MyPaint brush tool clearly shows the limits of my trick to have some
enum actions work with absolute values whereas others work with
per-mille values between the property min and max.

Indeed firstly MyBrush's "radius" value is logarithmic and can be
negative. Since the enum trick relies on the fact that negative values
are the semantic enumerated constants, it's broken in such case. The
second issue is that while it was acceptable to use int size for most
paint tools (even though they were double), here radius only goes from
-2.0 to 6.0; so using int values only would leave us with jumping brush
sizes.

So now I create a proper double action which simply takes pixel size and
use this from the on-canvas brush size changing. No weird trick, no int
or sign limitations.
I also add a new optional action_pixel_size in GimpToolControl.

Note: I'm also updating a bit the logic for the MyPaint brush outline
function gimp_mybrush_tool_get_outline(). Indeed after skimming a bit
through mypaint-brush.c code in libmypaint, I am not sure at all we need
to use the offset_by_random like this. And really this shown outline
seems more indicative than anything else when I see the actual size
printed by the various brushes. Finally here it was counter-productive
as I needed to get easily the logarithmic radius from the pointer
interaction on canvas.
2022-08-17 14:20:18 +02:00
Jehan
12be7bdc37 app: adding GimpDoubleAction types of actions.
These actions can be activated with a double value. These will be useful
to create new types of size action, which are based on accurate pixel
values instead of an enum hacked to set per-mille values between a
min/max.
2022-08-17 14:20:18 +02:00
Jehan
59709d348c app: distance moved on-canvas set the ink tool size as well. 2022-08-17 14:20:18 +02:00
Jehan
8e9abd5e85 app: make sure the size circle is also displayed for the ink tool.
Note that the other paint tool which is not as common as others is the
MyPaint brush tool. At first I thought the circle outline didn't work.
It does actually work, but the radius concept is simply very weird in
this tool so we have to move a lot. To be investigated.
2022-08-17 14:20:18 +02:00
Jehan
5be997fbdf app: display the brush outline (or fallback or circle) when resizing.
Bypass temporarily the "Show brush outline" settings when resizing
on-canvas.
2022-08-17 14:20:18 +02:00
Jehan
b1124770e8 app: stop alt-right click brush size change when releasing Alt first.
Until now, it was only stopiing when releasing right click, but it's
actually more accurate when releasing the Alt key first as the button is
on the mouse/stylus (so releasing it can provoke small hand moves,
especially visible with stylus, I think). Now it stops whatever is
released first.
2022-08-17 14:20:18 +02:00
Jehan
43f0147bfe app: allow to change the brush size on alt-right click.
I started from mitch's patch (though code changed so it was not working,
yet I ended up with quite a different direction).

Modified from original proposition in #498:

* Do not mix opacity and brush size in a same action, one on horizontal
  movement, the other on vertical. The problem is that it's hard to stay
  perfectly horizontal or vertical, so you nearly necessarily change one
  while changing the other and this would be frustrating.
* Do not just use modifiers, but modifiers + right click. The logics is
  that left (or whatever is the first button) click is for the tool
  actions. The middle click for navigation (panning, rotation, and even
  layer navigation now). Right click for now is only for menu. With this
  change, let's use right click for various settings-related changes
  too. Also we already have people complaining with things like canvas
  rotation happening unexpectedly even though it requires button clicks.
  Imagine an action just made of modifiers! Many people would hit these
  by mistake all the time!
* Focus on brush size only for now. Instead of just calling the action
  repetitively with the "SElECT_NEXT" action as proposed in the original
  patch by mitch, let's compute the actual size between the press and
  release. This would allow to have a real visual hint and also would
  make it a lot more useful and meaningful to be an on-canvas change.
  Say you want to reproduce a stroke size on canvas. You can click the
  center and expand to retrieve approximately the size without computing
  it in pixels.

Limitations and future work:

* This is a first draft and I still want to test if it works well with
  the "lock brush to view" and with scale factor > 1.
* I want to associate this with work done for #7034 so that visual hint
  still appear even when we have no visual hint set.
* I am not so fond of with the way we use enum actions which doesn't
  really make satisfying logics (I hacked a bit over it, but it's
  getting ugly). I'm considering creating int/double actions to really
  set some values with exact numbers through actions.
* Right now we need to stop the right click first. I want to be able to
  stop the brush sizing with releasing Alt too.
* It would be nice to make this all more customizable, which is why I
  called internal variable "mod1_setting". The goal will be to have
  other types of actions possibly. Also it could be deactivatable for
  people really not liking these or hitting these by mistake (while not
  needing these). Same for the navigation shorcuts.
* Similarly the right-click menu could be deactivatable or switched to
  other actions conditionally (through Preferences). It is doubtful how
  useful it is (compared to using the same menus on top of the GUI)
  though I don't want to just delete the option because some people
  would clearly be used to it.
* I think we should start breaking down the whole tool events code a bit
  more, in particular the function gimp_display_shell_canvas_tool_events().
* For more settings, a small on-canvas GUI could be of interest where
  you could customize various values through sliders and buttons, and
  also where you could put your favorite brushes or dynamics or whatnot.
  It's not replacing the more complete dockable but could be a nice
  quick version for fast editing.
2022-08-17 14:20:18 +02:00
Anders Jonsson
4520735208 Update Swedish translation 2022-08-17 08:18:18 +00:00
Jehan
402483c61c NEWS: update. 2022-08-16 21:25:26 +02:00
Jehan
31df4c2bf1 Issue #8498: Quirky text to translate in gradients-save-as-css.py.
Just duplicate the blurb into the help string. I'll leave it to someone
else to write a dedicated, longer help text if needed.

Also fixing the call s/Gimp.init/GimpUi.init/.
2022-08-16 21:18:51 +02:00
Yuri Chornoivan
c4e67e1b50 Update Ukrainian translation 2022-08-16 18:09:12 +00:00
Hugo Carvalho
8ddd3f4cc9 Update Portuguese translation 2022-08-16 13:41:05 +00:00
Jacob Boerema
b0ade14957 build: fix Windows installer
The Hungarian language file for the Windows installer was recently moved
from unofficial to the officially supported languages. However, a new
release including Hungarian by default is not available yet. This causes
our CI to fail because it can't find Hungarian in unofficial.

We change our ci script to download Hungarian from the correct location
for official languages, and adapt gimp3264.iss to reflect the correct
location.
2022-08-15 23:32:47 +00:00
Martin
e5113e635a Update Slovenian translation 2022-08-15 22:22:52 +00:00
Martin
6ec57d2542 Update Slovenian translation 2022-08-15 22:22:16 +00:00
Martin
f05f1dcdb9 Update Slovenian translation 2022-08-15 22:21:04 +00:00
Nikc
1c81c426ae Modules: Convert CMYK color selector to babl 2022-08-15 21:14:14 +00:00
Zurab Kargareteli
1291c20f24 Update Georgian translation 2022-08-15 20:23:59 +00:00
Zurab Kargareteli
6ffd8d3d66 Update Georgian translation 2022-08-15 20:22:14 +00:00
Jacob Boerema
969b71f78d plug-ins: add support for extra layer mask
According to the specs the extra mask (which they call real user supplied
layer mask) is used "when both a user mask and a vector mask are present".

I haven't seen an example that has the extra mask, so not sure which of
the masks would appear first.

For now assuming that the extra mask will be first. The advantage of
adding this here now, is that we won't try to add a mask channel as a
normal channel.
2022-08-15 14:32:54 -04:00
Rodrigo Lledó
493aeee8f0 Update Spanish translation 2022-08-15 17:53:09 +00:00
Rodrigo Lledó
1bb2e8f8e2 Update Spanish translation 2022-08-15 17:41:53 +00:00
Alx Sa
936954436a widgets: Use simulation intent API in ColorFrame
Uses the simulation rendering intent from GimpImage instead of
from GimpColorConfig. This affects the SamplePoint and Pointer dialogues
as well as the Color Info Window.
2022-08-15 01:26:47 +00:00
Alx Sa
94414c1ca8 core: Add simulation settings to Create New Image
Adds a dropdown for Simulation Profile, Intent, and BPC
to the Create a New Image dialog.
This allows users to assign a soft-proofing profile when the image is
first created. It defaults to "None", however. Users can also set the
default simulation rendering intent and BPC status per image.
These options are also removed from the Preferences dialog.
2022-08-14 17:25:25 +00:00
Alx Sa
e28c076622 plug-ins: Use image intent APIs
This updates the JPEG and TIFF CMYK exports to use the image's
simulation rendering intent, rather than always
assuming relative colorimetric
2022-08-14 01:49:56 +00:00
Alx Sa
0587a10543 core: Add simulation intent and BPC to GimpImage
Adds a simulation_bpc and simulation_intent to GimpImage to allow 
plug-ins to access it
for CMYK import/export.
Four pdb functions were added to enable this access:
image_get_simulation_bpc (), image_set_simulation_bpc (), 
image_get_simulation_intent (), and image_set_simulation_intent ().
Next, it updates menu options and code to support GimpImage's
internal simulation intent and bpc.
New 'simulation-intent-changed' and 'simulation-bpc-changed signal 
are emitted via
GimpColorManagedInterface so that relevant tools 
(such as the
CYMK color picker, GimpColorFrame, and future pop-overs)
 are aware of these changes.
2022-08-13 19:39:47 +00:00
lloyd konneker
08686fff8b Create draft devel doc for scriptfu v3 script authors. 2022-08-13 19:07:02 +00:00
Zurab Kargareteli
68029cac89 Update Georgian translation 2022-08-13 18:43:15 +00:00
lloyd konneker
0c1b00b04c Enhance GimpProcedureDialog have int combo widget for G_PARAM_SPEC_ENUM
Resolves #8488
2022-08-13 07:34:17 -04:00
Zurab Kargareteli
062b5290cd Update Georgian translation 2022-08-12 04:36:26 +00:00
Zurab Kargareteli
c7d00c9722 Update Georgian translation 2022-08-12 04:33:00 +00:00
Luming Zh
dbbcc6bd51 Update Chinese (China) translation 2022-08-10 15:15:57 +00:00
Danial Behzadi
abc94e6944 Update Persian translation 2022-08-09 22:06:39 +00:00
Yuri Chornoivan
98eedef51b Update Ukrainian translation 2022-08-09 16:39:44 +00:00
Jehan
caebbe4603 INSTALL: fixing copy-paste bugs.
Thanks to Tobias (@Tobias on Gitlab) for noticing.
2022-08-09 11:49:56 +02:00
Hugo Carvalho
dd580717f0 Update Portuguese translation 2022-08-08 22:43:14 +00:00
Alx Sa
aa51b9e19e plug-ins: Add .ani file import/export 2022-08-08 18:31:45 +00:00
Jehan
e7faae1dc3 INSTALL: update the build instructions to target meson.
If we want to encourage meson usage in GIMP 2.99.12 as a test run, our
INSTALL file should target meson commands and options.

Also I took the opportunity fix a bit some parts which were outdated.
2022-08-08 19:19:21 +02:00
Jehan
af6218fb53 gitlab-ci: rename autotools/meson tarballs.
If we want to encourage packagers to test the meson tarball (better to
do this now with development releases than later on stable releases!),
we should name it prominently. Therefore I will rename the autotools
tarball as gimp-*-autotools.tar.bz2 whereas the meson tarball will be
named gimp-*.tar.xz.

Also renaming `sources` CI job to `sources-autotools`.
2022-08-08 18:15:33 +02:00
Yuri Chornoivan
70fc715422 Update Ukrainian translation 2022-08-07 15:56:09 +00:00
Hugo Carvalho
bec9f380a4 Update Portuguese translation 2022-08-06 22:35:26 +00:00
Jehan
6903909159 NEWS: update. 2022-08-06 19:52:55 +02:00
Povilas Kanapickas
40743c90a2 widgets: Fix out of bounds zoom in gradient editor
When zooming using scroll events it is possible to zoom out of gradient
bounds because the check for out of bounds zoom happens with the zoom
value before the delta is applied. The correct way is to limit the zoom
value after the delta is applied.
2022-08-06 16:28:50 +00:00
Povilas Kanapickas
ae3c4c3577 widgets: Implement zoom focus in gradient editor
Zoom focus centers the point that we're zooming into at the location of
the mouse pointer.

Default zoom focus value is 0.5 which results in previous behavior.
2022-08-06 16:28:50 +00:00
Povilas Kanapickas
8d0e6efa10 widgets: Reset view_last_x whevener gradient editor leaves focus 2022-08-06 16:28:50 +00:00
Povilas Kanapickas
ecb2009960 widgets: Implement support for zoom by pitch in gradient editor 2022-08-06 16:28:50 +00:00
Povilas Kanapickas
62490218ee widgets: Fix support for smooth scrolling in gradient editor
Smooth scrolling requires that we keep the scroll (or zoom, as is in
this case) state as a floating-point number. The scroll deltas are often
less than one, thus storing scroll state as an integer will effectively
ignore most of the scroll events.
2022-08-06 16:28:50 +00:00
Povilas Kanapickas
86799f8762 app: Implement zooming via touchpad gestures on GimpContainerTreeView 2022-08-06 15:49:40 +00:00
Povilas Kanapickas
15ddae315c app: Implement zooming via mouse wheel on GimpContainerTreeView 2022-08-06 15:49:40 +00:00
Alx Sa
ff1766be08 plug-ins: Fix Color XHTML export and GUI crash
Fixes some syntax and makes the plug-in aware of multi-layer selection,
so that the dialog actually appears when exporting as .html.
2022-08-06 15:10:41 +00:00
lloyd konneker
36521f5db2 Fix so that ScriptFu test scripts are not localized. 2022-08-06 14:37:56 +00:00
lloyd konneker
ceddb0d369 Fix #8465 2022-08-06 10:02:17 -04:00
Martin
81391d82f1 Update Slovenian translation 2022-08-05 21:01:29 +00:00
Jehan
fec1f53745 libgimp: don't run defcheck on macOS either.
Similar to commit f5751ec687.
See: https://gitlab.gnome.org/GNOME/gimp/-/issues/8274#note_1520297
2022-08-05 00:52:28 +02:00
Jacob Boerema
5fbd06629d plug-ins: fix #8411 crash when attempting to open PSD
Apparently some layers in PSD files can have extra channels which we
did not account for when computing destination offsets, causing crashes.

So let's make sure we don't include the "extra" channels when computing
the offsets by introducing base_channels. We also move the alpha channel
in the spot of the first extra channel (even though it seems, based on
the one example we have, that the extra channel might be the same as
the alpha channel).
2022-08-03 18:10:32 -04:00
lloyd konneker
031601a92a Fix 8452, crashing scripts.
Bugs in earlier enhancements re GFile, GEnum.
2022-08-03 15:51:15 -04:00
lloyd konneker
974f694cd2 ScriptFu: scripts use v3 API for multilayer gimp_image_get_selected_drawables etc.
Commit a6aba929 deleted the old functions.

Misc drive-by fixes for gtk_adjustment step not < pages

Issue #8155 discusses alternative fixes, convenience functions for compatibility in ScriptFu.
There is one compat function defined already in ScriptFu, temporarily: gimp-image-get-active-drawable
which was written so that testing clothify-v3.scm could proceed.
2022-08-03 12:48:07 +00:00
Hugo Carvalho
c5e526f024 Update Portuguese translation 2022-08-03 09:33:05 +00:00
Luming Zh
c2f9286cff Update Chinese (China) translation 2022-08-02 23:42:20 +00:00
Jehan
f6f50ae1c7 meson: remove autotools-related data from the meson tarball. 2022-08-02 17:04:32 +02:00
Jehan
dfd427d9db Remove old outdated data.
* gimp-zip.in was apparently a very old script to package GIMP for
  Windows into zip files. It has not been updated since 2007 and these
  days, we package GIMP as an installer for Windows. I guess the need of
  having just a compressed folder to move might be wanted for some, but
  anyway this script is so old, it's probably completely broken now. It
  would be much simpler to redo such a process from scratch (we have
  very close jobs in the CI which could be better bases to work from).
* config.h.win32 seems to be an old manually-maintained config.h and it
  has a big "WARNING! OUTDATED!" text at the top (also untouched since
  2007). I guess it might have been used some time long ago. But these
  days, we don't need a specific Windows-only config.h. The generated
  one works fine.
2022-08-02 16:33:09 +02:00
Jehan
ef85c51a58 Issue #7907: work around possible outdated data in meson tarball.
`meson dist` don't imply a reconfigure or a rebuild which is actually
not great as it means a wrong order of commands may create tarballs with
outdated data (typically: build, then pull new code, then dist).

Of course for our official tarballs, it should be fine as we don't
generate tarballs manually anymore, but through the CI. Yet, just to be
on the safe side, force-trigger a reconfigure then a build (which would
likely be very fast anyway in the common use case where we just did a
build right before).

Additionally the INSTALL.in file is not copied anymore in the tarball
and INSTALL will only be generated in git repositories.
2022-08-02 16:06:51 +02:00
Anders Jonsson
3648e6d3be Update Swedish translation 2022-08-02 12:28:13 +00:00
Anders Jonsson
6469b75568 Update Swedish translation 2022-08-02 12:23:40 +00:00
Yuri Chornoivan
ef88a2a2f6 Update Ukrainian translation 2022-08-02 11:14:31 +00:00
lloyd konneker
12c0c18036 ScriptFu: script-fu-register-filter for GimpImageProcedure.
Resolves #8382

Also v2 scripts infer and set sensitivity to drawables

Add two test plugins clothify-v3.scm and test-sphere-v3.scm.
Temporary, to be removed when 3.0 ships.

Some refactoring (extracting methods, moving functions to new files).

Some drive-by fixes to script-fu-arg.c revealed by using GimpProcedureDialog.
2022-08-02 07:45:35 +00:00
Anders Jonsson
25f8b332e9 Update Swedish translation 2022-08-01 23:27:03 +00:00
Alx Sa
b99b7d779e display: Add soft-proof toggle to status bar
Adds a soft-proof toggle button to GimpStatusBar. It's only active when
a simulation profile is set on the current image. It stays in sync with
the View menu soft-proofing option as well.
2022-08-01 23:22:05 +00:00
Luming Zh
626bcbda48 Update Chinese (China) translation 2022-08-01 22:47:06 +00:00
Jehan
8d489b2ef3 gitlab-ci: make gimp-meson-debian more robust to source updates.
The `ninja dist` step fails with:

> ERROR: Repository has uncommitted changes that will not be included in the dist tarball
> Use --allow-dirty to ignore the warning and proceed anyway
> FAILED: meson-dist
> /usr/bin/meson dist

Astonishingly if I run a `git diff` (or git status) in the CI, I saw no
changes and the dist suddenly succeeded. When I remove it, it fails
again. And of course, locally it's alright. No way to diagnose!

Anyway it's not a bad idea to leave some diagnostic logs in the CI so
here we go, properly outputting the diff and exiting the job with an
error when there is a diff. Because anyway, there should be none. It
would mean that there is likely some issue in versionned generated
files.
2022-08-02 00:02:44 +02:00
Jehan
f5751ec687 libgimp: don't run defcheck.py on Windows.
Ironically, it is a test for the Windows platform but it cannot run on
Windows. First, because it expects a .so (which could be easily fixed),
but even more because from web search, it looks like the nm tool may not
exist on Windows (though I haven't checked).

Anyway we only ever ran it from Linux machines and up to now, it worked
just fine and was useful anyway. So let's go with it.

Also clean a bit remnants from older attempts to run this script.
2022-08-01 23:34:50 +02:00
Jehan
ccbf3c4bb0 app, libgimp*: add various stamp files to CLEANFILES.
Fixes:

> ERROR: files left in build directory after distclean:
2022-08-01 23:34:50 +02:00
Jehan
e6ce33e2d1 gitlab-ci: distribute the meson-generated tarball as well.
Maybe let's try to distribute the meson tarball next to the autotools
tarball for our next dev release, and announce that packagers are
invited to test the meson build from tarball and report back.
2022-08-01 23:34:50 +02:00
Luming Zh
3d670e6d3b Update Chinese (China) translation 2022-08-01 21:23:44 +00:00
Jehan
83e465ec16 app, libgimp*: updating autotools script in sync with meson.
Generated *enums.c now have an additional stamp no-op header include
(see last 2 commits). Sync this change into the autotools generation
scripts to prevent back and forth useless generation of these files each
time we switch from one build system to another.
2022-08-01 20:00:01 +02:00
Jehan
979acaaae2 app, libgimp*: commit the newly generated *enums.c files.
They are nearly the same as initially, except that now they include an
intermediate stamp header which will be generated by the build system.

The only 2 enums which don't need these includes (and are not versioned)
are libgimp/gimpenums.c and libgimpthumb/gimpthumb-enums.c.
2022-08-01 20:00:01 +02:00
Jehan
106f2a061d Issue #8145: meson: generation of '*-enums.c' files.
Our meson build system was not properly building the enums.c file,
because they are versionned.

I did a similar trick as what I did for the pdbgen, which is that I used
a wrapper script around the existing perl script, which sets proper
options and generate a stamp file in the end (which is considered by
meson as the actual custom target, not the C file since it is generated
in the source dir).

The most important part is that the stamp file is a generated header
source (not just a random text file) which is **included** by the
generated C file. This is what will force meson to regenerate the C file
if the header is updated, **then** build using this new version, not use
an outdated versionned version (which would make for hard to diagnose
bugs), through the indirection of the intermediate stamp header.

See #4201.
See also: https://github.com/mesonbuild/meson/issues/10196#issuecomment-1080742592
2022-08-01 19:59:53 +02:00
Jehan
f22b82f22f tools: only display "trouble reading […]" message when the script fails.
Displaying it all the time when we fail the first attempt is confusing
as it is expected to fail in the meson build (since build libraries are
in different folders). Instead only output the error message when both
known paths failed, i.e. when we fail the script (and write down both
attempted path in the error message).
2022-08-01 17:07:30 +02:00
Jehan
e4cd2405a9 libgimpwidgets: do not export GResource generated functions.
This explains why the defcheck script never complained for the 2
*_get_resource() functions removed in my previous commit. These were
exported in the libgimpwidgets library on the autotools build (and not
on the meson build).

Fix the discrepancy by not exporting these symbols on autotools as well,
as I don't think this is needed on public API.

This should now fix the distcheck build for autotools.
2022-07-31 23:44:48 +02:00
Yuri Chornoivan
6957134a5b Update Ukrainian translation 2022-07-31 18:25:27 +00:00
Jehan
01e87819ce libgimpwidgets: fix def file.
The defcheck.py file finds these errors:

> Problem found in /home/jehan/dev/src/gimp/libgimpwidgets/gimpwidgets.def
>   the following symbols are listed in the .def-file,
>   but are not exported by the library.
>      - gimp_color_picker_cursors_get_resource
>      - gimp_icon_pixbufs_get_resource

Indeed these don't exist. Unsure why the autootols check failed to
report these until today.
2022-07-31 20:07:00 +02:00
Jehan
4c77c5acaf issue #8274: Port .def files check in meson.
The check script now takes into account both the autotools and meson
file hierarchy (in autotools, built libs are in .libs/ subdirs).

Also it now properly fails on missing lib.
2022-07-31 20:05:40 +02:00
Alx Sa
9f60d24581 core: Save/load soft-proofing profile in Image
Adds a parasite to .xcf that stores the soft-proofing profile.
Existing color profile saving/loading functions now take in a
parasite name parameter so they can be used for either profile.
2022-07-31 16:31:36 +00:00
Jehan
218c78e76a build: search only once for the addbom.sh script.
This avoids repeated "found: YES" output (one per installer language) on
the project configuration.
2022-07-31 18:25:33 +02:00
Jehan
2ac483f9e3 meson: make run_command() calls future-proof.
Some of our calls to run_command() would have failed with future
versions of meson if we didn't set the "check" parameter. In particular,
in various calls, we don't want to fail the whole build configuration
when the command does (as it's an optional feature check). In such a
case, it is important to be explicit as future will default to fail
then.

Fixes:

> WARNING: You should add the boolean check kwarg to the run_command call.
>          It currently defaults to false,
>          but it will default to true in future releases of meson.
>          See also: https://github.com/mesonbuild/meson/issues/9300
2022-07-31 18:23:00 +02:00
Jehan
c857fc58a6 pdb, po-tips: fix meson warnings.
Meson is apparently able to show different warning depending on the
meson version tests we do in specific code paths.

Since our global required meson is 0.53.0 but on some code paths, we
test for 0.57.0, we must use meson.source_root() on older meson and
meson.project_source_root() on newer one.

Fixes:

> pdb/meson.build:141: WARNING: Project targets '>=0.57.0' but uses feature deprecated since '0.56.0': meson.source_root. use meson.project_source_root() or meson.global_source_root() instead.
> pdb/meson.build:141: WARNING: Project targets '>=0.57.0' but uses feature deprecated since '0.56.0': meson.build_root. use meson.project_build_root() or meson.global_build_root() instead.
> po-tips/meson.build:5: WARNING: Project targets '>=0.53.0' but uses feature introduced in '0.56.0': meson.project_source_root.
2022-07-31 18:16:00 +02:00
Jehan
47ba11056f Issue #7386: fix languages non-provided by InnoSetup showing as English.
The language files provided by the InnoSetup project (either the main
ones or the "Unofficial" ones, i.e. less maintained ones) at least
provides the name of the language, possibly in English, ideally
self-localized in its own language.

Unfortunately Kabyle didn't have any language file so we were using the
Default one, which ended up showing the lang as a duplicate (and very
wrong) "English".

With this commit, I add code to provide our own very basic base language
file, which would at least contain the language name. There is also a
concept of language ID to be verified in Windows-provided list.
Unfortunately it doesn't have any (actually it was id-ed 0x1000 like
many other languages, which looked therefore to be the code for an
unsupported lang). InnoSetup docs tells us to leave 0 then. We can add
the ability to set a specific code later in the template if we add other
un-provided languages and if they have their own lang id.

With this base infrastructure, we should be able to better support more
languages.
2022-07-31 15:10:04 +00:00
Alexander Shopov
26d0c2083f Update Bulgarian translation 2022-07-31 13:40:35 +00:00
Alexander Shopov
b065c8a0f7 Update Bulgarian translation 2022-07-31 13:33:46 +00:00
Jehan
195ed374f4 Issue #8338: add BOM to ISL file as external script.
Unfortunately the weird encoding of a string to bytes to get the UTF-8
BOM worked on my local machine, but not on the Windows CI. I'm not going
to fight it and fallback to a shell script.

I am guessing it should work fine on all platform since we use basically
the same sed call in build/windows/gitlab-ci/installer-gimp-msys2.sh
already.
2022-07-31 01:43:05 +02:00
Jehan
4293d05dda Issue #8338: add a BOM to ISL files.
Inno-Setup absolutely requires it to recognize UTF-8 translation files.
This should hopefully be the final fix to #8338.

Note that this fix is full of workaround for meson bugs or limitations.
While it was a one-liner in autotools, added to the existing rule, here
I have to add an additional (non-relevant) target rule, then uglily work
around 2 bugs:
https://github.com/mesonbuild/meson/issues/1564
https://github.com/mesonbuild/meson/issues/7696

I can't say I'm so happy about the resulting change, even though it
seems to work. If anyone can propose a nicer build rule, it would be
welcome.
2022-07-30 23:28:39 +02:00
Niels De Graef
7186907c16 build: Fix windows installer i18n
Whenever we have an element without translation, we try to use the value
without a `xml:lang` attribute. That selector was wrong though, which
leads to https://gitlab.gnome.org/GNOME/gimp/-/issues/8338, which should
now be fixed.
2022-07-29 20:40:41 +02:00
Jürgen Benvenuti
d8f616cb3e Update German translation 2022-07-29 18:20:18 +00:00
Jürgen Benvenuti
b952e34e44 Update German translation 2022-07-29 18:18:47 +00:00
Jehan
c11dc69137 gitlab-ci: removing win*-nightly jobs.
These were originally to distribute cross-built binaries. Nowadays, we
just use the native-made installer, which is also closer to what people
will really get for release versions.
So let's just remove these. I keep the crossroad builds as these are
still useful to detect Windows build bugs quickly, but we don't need
these distribution steps.

This also takes care of failures in the job, but since it's mostly a
useless job nowadays, rather than wasting my time investigating this, I
simplify the CI.
2022-07-28 15:55:19 +02:00
Zurab Kargareteli
69fe09ee10 Add Georgian translation 2022-07-28 07:48:03 +00:00
Zurab Kargareteli
9e3be486dd Add Georgian translation 2022-07-28 07:42:38 +00:00
Lukas Oberhuber
271435534f macos: support for homebrew build
Supports running gimp in homebrew builds which have more complex
structures of where things are placed.
2022-07-27 17:06:21 +00:00
Zurab Kargareteli
177bb822b6 Update Georgian translation 2022-07-27 15:30:42 +00:00
Zurab Kargareteli
3013a8af26 Update Georgian translation 2022-07-27 15:28:51 +00:00
Zurab Kargareteli
9c34adcdc2 Update Georgian translation 2022-07-27 15:26:40 +00:00
Bartłomiej Piotrowski
7c7008a9c6 Update (or drop) the Docker image used by Flatpak job
The gnome-runtime-images have been recently migrated to Quay. This is already reflected in the template.

Please note this MR has been created semi-automatically. If it doesn't make sense, feel free to close it.
2022-07-27 12:06:56 +00:00
Jehan
ea6c79ca30 app: libappconfig does not depend on GTK. 2022-07-27 11:06:22 +02:00
Jehan
d891bf5705 app: properly block selection changed signal.
Avoiding to trigger the signal when unselecting the items.
2022-07-27 11:06:13 +02:00
Jehan
4ca9cef332 Issue #1918: fix CRITICAL in MWM when reopening close dock while…
… an image is opened.
2022-07-27 10:59:31 +02:00
Jehan
4a5acb2448 app: show the tool options in various other error cases.
Similar to the previous commit, use the new
gimp_tools_show_tool_options() before blinking various tool options
widgets since these are good hints for wrongly set options and it's nice
to be able to point at these.
2022-07-27 10:45:40 +02:00
Jehan
6c18c7e497 Issue #7795: fix CRITICAL when tool options dockable is absent.
Create a new utils function gimp_tools_show_tool_options() because
showing the tool options is likely a common action. And use this when we
want to blink the selection mode box, for this particular case.

Note that I could not reproduce the CRITICAL here (i.e. even if the
dockable was not showing, it seems the widget did already exist anyway).
Anyway it's a nice idea to raise the tool options as the goal is to
explicitly show how to fix the issue here. And it should fix the bug for
people encountering it.
2022-07-27 10:13:40 +02:00
Rodrigo Lledó
cac7ed93a0 Update Spanish translation 2022-07-26 14:52:56 +00:00
Rodrigo Lledó
2467d97883 Update Spanish translation 2022-07-26 14:41:07 +00:00
Hugo Carvalho
594929551f Update Portuguese translation 2022-07-26 13:22:00 +00:00
Martin
4924666a62 Update Slovenian translation 2022-07-24 16:03:20 +00:00
Martin
9faa94cd05 Update Slovenian translation 2022-07-24 15:47:30 +00:00
Asier Sarasua Garmendia
e66bc4154d Update Basque translation 2022-07-24 08:50:12 +00:00
Asier Sarasua Garmendia
29b9ddc069 Update Basque translation 2022-07-24 08:47:31 +00:00
Zurab Kargareteli
1ecb43d1ed Update Georgian translation 2022-07-23 13:55:02 +00:00
Asier Sarasua Garmendia
2e5a2736ef Update Basque translation 2022-07-23 09:52:27 +00:00
Asier Sarasua Garmendia
a6dc09824c Update Basque translation 2022-07-23 09:45:14 +00:00
Asier Sarasua Garmendia
5905ec476b Update Basque translation 2022-07-23 09:42:02 +00:00
Zurab Kargareteli
71cf823413 Update Georgian translation 2022-07-22 14:34:42 +00:00
Jehan
fdeb6cd4b8 NEWS: update. 2022-07-21 18:17:37 +02:00
Lukas Oberhuber
831623f33f meson, macos: missing libraries and directories
These changes make it possible to build against homebrew for mac
libraries. Homebrew stores it's libraries in seperate folders and so
blanket includes were not working.

PYTHONPATH is not needed and interferes with homebrew build.
2022-07-21 13:25:22 +00:00
Jehan
8feddf9cd5 plug-ins: store a CMYK profile as soft-proof profile in the right place.
Fixing !646. The call to gimp_image_set_simulation_profile() was only
happening for merged PSD mode (either explicit call or when
special-cases such as no layers).

This is the right place to store the CMYK profile in all cases.
2022-07-21 14:34:31 +02:00
Nikc
22986b6912 plug-ins: Use babl to load CMYK .PSD files
Removes gimp_color_transform_process_pixels () calls
when a CMYK profile is present, and uses babl_format_with_space ()
instead for all cases. Additionally, possible errors are now recorded
during the conversion process.
If attached, the image's CMYK profile is stored in GimpImage
afterwards.
2022-07-21 11:47:41 +00:00
Yuri Chornoivan
c622542fcc Update Ukrainian translation 2022-07-21 06:35:10 +00:00
Jehan
26a3a600e3 Issue #7890: Filter commands Repeat and Re-show last plug-in don't…
… work when no image is loaded.
2022-07-21 01:32:37 +02:00
lloyd konneker
42750c25a7 libgimpconfig: fix missing GimpChannel in gimp_config_param_spec_duplicate
Partial fix to issue 8062

Only fixing the part that I understand, that impedes enhancements to ScriptFu.
2022-07-20 23:09:55 +00:00
Nikc
93399de7cd Converting CMYK sample points to babl process 2022-07-20 22:35:13 +00:00
Alx Sa
388a5a3b4c plug-ins: Fix crash in histogram-export
As noted by @Ofnuts, histogram-export still expected to receive
a single layer from GIMP. The parameters have been updated to
reflect receiving multiple layers/drawables, and the active layer
is selected. The parameter was left in case multi-layer support
is added in the future.
2022-07-20 12:51:03 +00:00
Hugo Carvalho
4509cdbbf7 Update Portuguese translation 2022-07-20 09:33:54 +00:00
Yuri Chornoivan
b3ef62e059 Update Ukrainian translation 2022-07-20 05:59:04 +00:00
Jehan
a6aba929dc app, libgimp, pdb: removing gimp_image_(g|s)et_active_*() functions.
We now have a concept of multiple drawables selectable in GIMP.
Therefore let's get rid of the old single active concept.
2022-07-19 22:52:06 +02:00
Jehan
2a85dd08a9 plug-ins: replace gimp_image_get_active_drawable() by newer function…
… gimp_image_get_selected_drawables().
2022-07-19 22:52:06 +02:00
Jehan
bd199fa0c2 libgimp, pdb, app: new gimp_image_get_selected_drawables() function. 2022-07-19 22:52:06 +02:00
Alx Sa
0f323d0279 plug-ins: Use CMYK profile stored in GimpImage
CMYK profile is now stored in GimpImage on load 
(rather than being discarded) and it's used for export rather than
the default simulation profile stored in Preferences
2022-07-19 19:26:45 +00:00
Jehan
f152e825bf NEWS: update. 2022-07-19 21:11:35 +02:00
Jehan
240dc12912 Issue #8385: problem importing SVG containing huge data.
libxml has a XML_PARSE_HUGE parsing option, which can be turned on with
the RSVG_HANDLE_FLAG_UNLIMITED option in librsvg.
We cannot just set this option by default because it is a security
hazard as a maliciously malformed SVG could use this to consume too much
memory.

Instead, let's just propose the option interactively when we fail to
create a rsvg handle. Unfortunately right now we can't single out this
specific error because librsvg actually returns an unrelated (false
positive created by the huge data) error. So we just propose the option
for any kind of handle creation failure.

Furthermore, the option is only available on interactive plug-in calls
so far. In particular, the PDB API doesn't have an option allowing a
script writer to run "file-svg-load" with the huge data option.

As for the thumbnail API, it is never meant to be used interactively and
not really as a common script function, so it won't have the huge data
option either.
2022-07-19 18:29:28 +02:00
Hugo Carvalho
fa38f75d5c Update Portuguese translation 2022-07-19 12:56:38 +00:00
Jehan
6a08fd6596 libgimpwidgets: fix segfaults on wrongly handled referencing.
gimp_color_config_get_simulation_color_profile() is returning a new
object, so we had 2 code paths giving either allocated data or not.

Therefore simply ref the passed softproof profile in the second code
path, and don't ref it anymore when caching it (especially as it might
also be NULL at that point).
2022-07-18 14:33:42 +02:00
Yuri Chornoivan
d0dd97cbc2 Update Ukrainian translation 2022-07-17 18:42:16 +00:00
Alx Sa
984586f623 plug-ins: Store CMYK profile in image on TIFF load
Now that images can contain their simulation profile,
we can use gimp_image_set_simulation_profile() to retain
the CMYK profile when a TIFF image is loaded.
It will then be accessible in GIMP's Image menu.
2022-07-17 17:12:45 +00:00
Jehan
12c7501552 plug-ins: fix small memory leak from MR !627. 2022-07-17 19:08:37 +02:00
Nikc
714b74568b plugins: fix #356 Add export option for CMYK TIFFs
Adds support for saving 8 and 16 BIT CMYK/A TIFF files using the
image's simulation profile. If no profile or a non-CMYK profile
is set for the simulation profile, naive conversion is used instead.
2022-07-17 16:09:22 +00:00
Martin
620fefac84 Update Slovenian translation 2022-07-16 20:00:45 +00:00
Øyvind Kolås
6cc1e035f1 app, configure, meson: depend on GEGL-0.4.38 2022-07-13 23:31:24 +02:00
MohammadSaleh Kamyab
d627f72b92 Update Persian translation 2022-07-12 20:46:08 +00:00
Rodrigo Lledó
1f92db3eea Update Spanish translation 2022-07-12 17:40:11 +00:00
Rodrigo Lledó
24d775cc00 Update Spanish translation 2022-07-12 17:36:42 +00:00
Hugo Carvalho
6aadd6f862 Update Portuguese translation 2022-07-11 15:28:28 +00:00
Yuri Chornoivan
a2f5551e6d Update Ukrainian translation 2022-07-09 15:32:02 +00:00
Jehan
e1c0c80007 po-plug-ins: adding plug-ins/common/file-wbmp.c to POTFILES.
Thanks to Piotr Drąg for reminding us!
2022-07-09 13:22:30 +02:00
Martin
70331d843d Update Slovenian translation 2022-07-08 17:47:41 +00:00
Martin
7d10a70134 Update Slovenian translation 2022-07-08 17:45:30 +00:00
Hugo Carvalho
a872191393 Update Portuguese translation 2022-07-08 13:36:40 +00:00
Hugo Carvalho
74b208df86 Update Portuguese translation 2022-07-08 13:34:54 +00:00
Hugo Carvalho
d25750f018 Update Portuguese translation 2022-07-08 13:32:41 +00:00
Niels De Graef
1308df4dc1 meson: Fix windows installer translations 2022-07-08 10:08:14 +02:00
Niels De Graef
526a28de3f plug-ins: Make sure we initalize GimpVector4
This fixes a warning about the variable being used uninitialized.
2022-07-08 09:50:25 +02:00
Alexander Shopov
958bd47427 Update Bulgarian translation 2022-07-07 21:03:35 +00:00
Jehan
5a78326589 app: allows for empty string as language.
Language detection was not working fine on Windows when the language was
an empty string rather than NULL.
2022-07-07 22:13:28 +02:00
Jehan
32501f502b plug-ins: fix generated common plug-in files and file-wbmp localization.
The Makefile.am was apparently updated by hand in !662.

Also fixing plug-in label and doc localization, since this changed
recently and must now be localized directly on plug-in side.
2022-07-07 21:27:39 +02:00
ktoyle
d1fac7bfa9 plug-ins: Create wbmp plug-in
Added plug-in that would let the Gimp program to read WBPM image files.

See #2508 and !662.
2022-07-07 19:23:35 +00:00
Jehan
25e35e17fe app: detect system language with a more robust logic.
langinfo.h is not on all systems apparently and/or the locale item we
test for may not be available everywhere. Actually even on Linux, after
testing more deeply, I could create cases where nl_langinfo() would not
return a result (if the locale is broken through environment variable
for instance). setlocale() seems to always return usable value so far,
so I fallback on it. As a last resort, I look at environment variables
(even though these may contain invalid contents.

As for Windows and macOS, I try to use more platform-specific methods.
In macOS in particular, as I understood from reports, GIMP follows
correctly the language preference order, which means we should not look
at a single (top) lang, but at the whole list of prefered languages as a
single settings to determine whether the language was changed or not.

Should fix on Windows:

> fatal error: langinfo.h: No such file or directory

and on macOS:

> error: use of undeclared identifier '_NL_IDENTIFICATION_LANGUAGE'
2022-07-07 18:58:50 +02:00
Yuri Chornoivan
ccf6ecf43f Update Ukrainian translation 2022-07-07 16:44:41 +00:00
Yuri Chornoivan
4383f6aa13 Update Ukrainian translation 2022-07-07 16:43:41 +00:00
Anders Jonsson
e601a6c7de Change GTK+ to GTK
GTK got rid of the + in 2019:
https://lwn.net/Articles/779305/
2022-07-07 14:02:36 +00:00
Jehan
07cd09e290 gitignore: hide various files copied by the autogen.sh step.
These files seem to have appear ever since the recent gettext changes in
commit f663d26ab5.
In particular, the call to autoreconf seems to be creating these.
2022-07-07 15:39:54 +02:00
Hugo Carvalho
15b31d1b72 Update Portuguese translation 2022-07-07 11:35:43 +00:00
Hugo Carvalho
c1f0055794 Update Portuguese translation 2022-07-07 11:24:15 +00:00
Hugo Carvalho
4c0951a687 Update Portuguese translation 2022-07-07 11:21:21 +00:00
Hugo Carvalho
997edb278c Update Portuguese translation 2022-07-07 11:15:44 +00:00
Maíra Canal
bc170d278b Update Brazilian Portuguese translation 2022-07-07 01:31:07 +00:00
Rodrigo Lledó
8f1f698b91 Update Spanish translation 2022-07-06 22:57:04 +00:00
Jehan
0cff1ebe91 Revert "app: force re-querying all plug-ins after a language change."
This reverts commit 82f9ae1ab7.

This is not needed anymore. Cf. previous commit which implements the
force-requery differently and much more widely based on actual language
being stored and compared between runs.
2022-07-06 19:41:00 +02:00
Jehan
a7a027706b app: reload plug-ins when language changes between runs.
Since localization is fully handled plug-in side now (see #8124), we
need to make sure the query functions are run again for all plug-ins
when the UI language changes (otherwise we might end up with
localizations from the previously used languages).

We were already reloading plug-ins when explicitly changing the lang in
the Preferences, but this new implementation is much better as it's
generic. In particular, it will also handle the case when the system
language changes (or when you play with locale environment variables).
2022-07-06 19:33:00 +02:00
Jehan
ca1a0e3650 plug-ins: gimp-plug-in-domain-register PDB procedure doesn't exist…
… any longer.

It's not deprecated in favor of a new name, it just doesn't exist as it
was removed in commit 81b569cb8c.
2022-07-06 16:14:03 +02:00
Jehan
9ace442ca3 NEWS: update. 2022-07-06 16:08:34 +02:00
Lukas Oberhuber
83397cbb15 quit-dialog: stops crashing on quit dialog
@jralls found uninitialized variables in the quit dialog that can cause
crashes.
2022-07-06 12:54:04 +00:00
lloyd konneker
c2b13d6f91 ScriptFu: register args with proper GParamSpecs
Resolves #8328

Except existing GimpParamSpecs seem inadequate to specify less generic widget kinds.
2022-07-05 19:17:52 +00:00
Yuri Chornoivan
1ee477d45b Update Ukrainian translation 2022-07-05 14:47:43 +00:00
Lukas Oberhuber
042eddfb0a canvas: remove limits on ruler & statusbar updates
This removes rate limiting of ruler and statusbar updates which were
required to get acceptable performance on mac for drawing on the canvas.

This requires the latest changes on in Gtk 3.24 to be incorporated.
2022-07-05 13:02:30 +00:00
Jehan
27b09104d9 libgimp: procedure's arguments labels are now localized plug-in side.
Continuing the changes in #8124, let's have properties labels and blurbs
both localized on plug-in code, i.e. with gettext calls directly in
GIMP_PROC_ARG_*() calls.
Note that it was already the case for blurbs (longer description,
tooltip) as I couldn't find code where we'd localize it further down the
line. But we were running gettext on nicks (shorter description, label)
inside GimpProcedureDialog code. Let's not do this anymore.

This will make the whole localization much more clear and obvious. There
is no "later localized" case anymore. Now let's localize everything
directly when the arguments are created.
2022-07-05 14:02:10 +02:00
Jehan
df074bfe09 plug-ins: label and documentation of plug-ins localized plug-in side.
This is the consequence of previous commit. Plug-ins' label and
documentation are now localized before sending these data to GIMP core.
In other words, we replace N_() macros with basic gettext calls.
2022-07-05 12:23:51 +02:00
Jehan
81b569cb8c Issue #8124: plug-in localization now totally moved plug-in side.
Plug-in localization was always partially plug-in side, especially for
things like custom GUI. But labels or blurb in GIMP (such as in menus or
action search) were localizing GIMP side.

It had many drawbacks:

- To get menu localization, a plug-in had to set up gettext, even though
  they might want to use something else for their GUI (after all, giving
  facilities for gettext is a good idea, but there is no reason to force
  using this system).
- There was a complex internal system passing the localization domain
  name, as well as the catalog file system path to core, then through
  various classes which we can now get rid of.
- There could be domain name clashes, if 2 plug-ins were to use the same
  i18n domain name. This was handled in now removed functions
  gimp_plug_in_manager_get_locale_domains() by simply keeping a unique
  one (and gimp_plug_in_manager_bind_text_domains() would just bind the
  domain to the kept directory). In other words, one of the duplicate
  plug-ins would use the wrong catalog. We could try to make the whole
  thing more complicated or try to forbid plug-ins to use any random
  name (in particular made easier with the new extension wrapper). But
  anyway this whole issue doesn't happen anymore if localization is
  fully made plug-in side, so why bother?

I tried to evaluate the advantages of the core-side localization of
plug-in labels/blurbs and could only find one theoretical: if we wanted
to keep access to the original English text. This could be useful
(theoretically) if we wanted to search (e.g. in the action search) in
both localized and English text; or if we wanted to be able to swap
easily en/l10n text in a UI without reload. But even if we were to ever
do this, it would only be possible for plug-ins (GEGL operations in
particular are localized GEGL-side), so it lacks consistency. And it's
unsure why special-casing English should really make sense for other
language natives who want text in their lang, and search in their lang.
They don't necessarily care about original.

So in the end, I decided to simplify the whole thing, make localization
of plug-ins a plug-in side thing. Core will only receive translated text
and that's it. It cuts a lot of code out of the core, simplify runtime
processing and make plug-in creation simpler to understand.

The only think I still want to look at is how exactly menu paths are
translated right now. Note that it still works, but it's possible that
some things may be worth improving/simplifying on this side too.
2022-07-05 12:22:32 +02:00
lloyd konneker
fadae20618 ScriptFu: Extract informal class SFArg from script-fu-script.c
Why: puts most methods for SFArg (a struct) in one place, for ease of maintenance.
Prepares to fix issue 8328.  Prepares to make SF use GimpProcedureDialog.

Mostly moving code, with no intended change in functionality,
except fixed an property.nick for an arg is now what a script author provided,
instead of generated.

All internal to libscriptfu.  No changes to the exported API or to i18n.

Lightly tested, since more substantive changes coming for issue 8328.
ScriptFu>Test>Sphere is the test case.
2022-07-04 08:28:19 +00:00
Rodrigo Lledó
22c35bf189 Update Spanish translation 2022-07-03 12:46:08 +00:00
Martin
8b62866751 Update Slovenian translation 2022-07-03 10:21:46 +00:00
Yuri Chornoivan
ba72943a5c Update Ukrainian translation 2022-07-03 05:36:25 +00:00
Jehan
5df6c735e6 NEWS: update. 2022-07-02 17:50:34 +02:00
Jehan
420f1f5332 app: s/g_warning/g_printerr/ to warn about duplicate actions.
g_warning() (as well as g_critical() and g_return_*()) are reserved for
core code bugs, and therefore triggers a debug dialog with a backtrace
to report.

Here I encountered such duplicate because ts-helloworld.scm was moved
around from scripts/ to plug-ins/ since commit d5a83429b4 and I hadn't
done a clean uninstall (so of course someone with package installation
should not have such a debug dialog). Yet it could actually happen for
various reasons, such as third-party plug-ins actually registering
identically named actions. Such reasons are not core code bugs and we
don't want to trigger a debug dialog (and have people report bugs to us
which are not actual bugs and which we have no power to fix) each time a
plug-in developer uses a too generic action name.

So instead let's just print to stderr for now. I also add the
information on which plug-in was discarded (otherwise if you actually
have 2 different plug-ins doing different things, you wouldn't know
which one is the visible one and which one can't be called).

Note that I hesitated with a g_message() which would pop-up a
user-facing error and would help them better handle their plug-in
conflict. But I'm not sure it's ideal in current state of things either.
It might be much better handled when we will have moved to recommending
extensions wrapping plug-ins.
2022-07-02 16:54:12 +02:00
Alx Sa
0d7fed93ae core: Add softproof profile to GimpImage
Adds a simulation_profile to GimpImage to allow plug-ins to access it
for CMYK import/export.
Two pdb functions were added to enable this access:
image_get_simulation_profile () and image_set_simulation_profile()
Next, it updates menu options and code to support GimpImage's
internal simulation profile. Menu items are moved from View to Image's
Color Management section.
New 'simulation-profile-changed' signal is emitted via
GimpColorManagedInterface so that relevant tools (such as the
CYMK color picker, GimpColorFrame, and future dockable
dialogue) are aware of these changes.
2022-07-02 15:26:19 +02:00
Jehan
b02e47b035 po-script-fu: skip test files from translated sources.
This apparently breaks Damned Lies. Thanks to Piotr Drąg for reporting.
2022-07-01 21:33:36 +02:00
Rodrigo Lledó
2d2901cdea Update Spanish translation 2022-07-01 12:28:43 +00:00
Rodrigo Lledó
6c2f3db117 Update Spanish translation 2022-07-01 12:23:32 +00:00
Rodrigo Lledó
01e69adfe2 Update Spanish translation 2022-07-01 12:13:22 +00:00
Rodrigo Lledó
8955a9f202 Update Spanish translation 2022-07-01 12:12:03 +00:00
Rodrigo Lledó
5ae5f5e997 Update Spanish translation 2022-07-01 11:48:06 +00:00
Rodrigo Lledó
001728cfc0 Update Spanish translation 2022-07-01 11:41:59 +00:00
Tim Sabsch
4768249ce0 Update German translation 2022-06-30 19:33:10 +00:00
lloyd konneker
ea81ae747d ScriptFu: delete unneeded #define G_LOG_DOMAIN
It clutters the compile log.
Compile flag -DG_LOG_DOMAIN="scriptfu" now does this.
2022-06-30 13:44:07 -04:00
lloyd konneker
d5a83429b4 ScriptFu: Add script-fu-interpreter akin to other interpreters
Why:
1) users can install .scm scripts to plug-ins dir
2) Crashing scripts do not crash extension-script-fu

Scripts (.scm files) have a shebang and are executable
and in a same-named subdir of plugin dir.

Interpreter/scripts create PDB procs of type PLUGIN unlike extension-script-fu
which creates PDB procs of type TEMPORARY, owned by extension-script-fu.

Unlike other interpreters, the interpreter is-a plugin outright,
not by virtue of the script subclassing GimpPlugin and using GI.

More details in /plug-ins/script-fu/interpreter/README
2022-06-30 13:39:45 +00:00
Zurab Kargareteli
a0ba969450 Update Georgian translation 2022-06-30 13:04:12 +00:00
Zurab Kargareteli
5be4801cb8 Update Georgian translation 2022-06-30 13:02:16 +00:00
Martin
f45fb06289 Update Slovenian translation 2022-06-29 23:47:53 +00:00
Rafael Fontenelle
256b2d9615 Update Brazilian Portuguese translation 2022-06-28 11:08:26 +00:00
Jehan
69f6f5748a plug-ins: use list() variants in bindings.
Cf. previous commit.
2022-06-27 22:30:42 +02:00
Jehan
15ec254148 Issue #5946: skip gimp_*get_*() API from GObject Introspection.
The get() API are sometimes nicer in C code because it's just simpler to
loop through C arrays, but they end up with similar API to the list()
variants for binding, or with a useless size return value (since most
higher level languages have length-aware array types, which is what
GList are transformed into).

So let's use the list() variants as the main ones and skip the get()
variants. I hesitated to rename the list() variants to get() with
`(rename-to)` annotations but since I am unsure if the get() bindings
are absolutely useless, I don't think it's the best idea. Maybe on some
other language usable as GI binding, the get() variant might be
different again and nicer to use. So if we shadowed these by renaming
list() ones, the day we change our mind, we'd have to rename get() ones
too (which would be very confusing), or else break bindings' API. To
avoid this, I just skip the get() ones altogether in bindings but leave
their name available in the bindings.
2022-06-27 21:20:06 +02:00
Niels De Graef
3473883edb po-tips: Fix gettext translation 2022-06-27 15:48:26 +00:00
Nathan Follens
1e8f2d0a4f Update Dutch translation 2022-06-27 13:44:54 +00:00
lloyd konneker
15ed7157dc devel-docs: document how to add interpreter and .interp file
From my experience with gimp-script-fu-interpreter on Windows.
Feel free to correct mistakes.
2022-06-26 10:37:12 -04:00
lloyd konneker
8d75b752c0 ScriptFu: oops missing file in POTFILE.in for !658 2022-06-26 09:06:59 +00:00
Niels De Graef
a3c5072a1c data: Adapt tips.dtd for gettext changes 2022-06-26 10:54:41 +02:00
Martin
c9819ea4c7 Update Slovenian translation 2022-06-26 08:22:50 +00:00
Martin
4e06e0d70f Update Slovenian translation 2022-06-26 08:18:42 +00:00
Martin
50c7c929ee Update Slovenian translation 2022-06-26 08:16:51 +00:00
Yuri Chornoivan
cac8f7f53e Update Ukrainian translation 2022-06-25 20:05:43 +00:00
Yuri Chornoivan
ca4e6d0d24 Update Ukrainian translation 2022-06-25 20:03:19 +00:00
Yuri Chornoivan
4eb29abfcd Update Ukrainian translation 2022-06-25 19:52:58 +00:00
Lukas Oberhuber
877520896f app, macOS: Remove crash handling conflict 2022-06-25 17:46:19 +00:00
Jehan
dfa1f0fc93 build: intltool is still needed by libmypaint. 2022-06-25 17:06:30 +02:00
Jehan
66812c8862 build: fix the distcheck.
MR !653 was merged too early as Gitlab bugged on us! Anyway this fixes
the distribution contents.
2022-06-25 17:06:21 +02:00
Jehan
8122e8cf36 extensions: fix builds after MR !653 (migrating to gettext).
(1) On recent meson versions, it fixes this error:

> extensions/goat-exercises/meson.build:108:0: ERROR: i18n.merge_file keyword argument 'output' was of type array[str] but should have been str

As docs explains, 'output' only accepts one item in i18n.merge_file().

This bug also happens on older meson (but there the reported error is a
lot less useful as it doesn't mention local meson build code).

(2) `setup.isl.xml` is a temporary intermediary file used to create the
    Windows installer. It must not be installed.

(3) `gimp30-windows-installer.mo` itself is only used to create
    `setup.isl.xml`. It must not be installed as well.

(4) gimp-tips.(its|loc) files (same for gimp-tags ones) should not be
    installed. They are only temporary data.

(5) Fix environment variable: s/GETTEXT_DATA_DIRS/GETTEXTDATADIRS/

Fixes:

> /usr/bin/msgfmt: cannot locate ITS rules for ../../../data/tips/gimp-tips.xml.in

(6) Fix various bugs in the *.setup.isl files creation in autotools
    build (typo, wrong files used, order of options in `xsltproc`
    apparently meaningful, and so on. I guess the autotools build was
    not as well tested as the meson one :P).

(7) Fixing the unit test verifying language lists consistency.

(8) `setup.isl.xml.in` must be added to the distribution.
2022-06-25 12:41:21 +02:00
Niels De Graef
f663d26ab5 Migrate from intltool to gettext
intltool has long been dead upstream. Let's not poke the dead corpse,
please.

This commit is quite large, but that's mostly since trying to support a
hybrid of both gettext and intltool with both Meson and Autotools was
really hard, so I stopped trying.

Due to gettext relying on quite some things being at the exactly right
place in the autotools build (like `ABOUT-NLS` and `config.rpath`) we
really needed to cleanup the `autogen.sh` to only call `aclocal` and
`autoreconf`. No more strange magic; I tried to do it without changing
too much in the file, and things just broke. If people want to do
something more custom, they can just change the script directly. This
change also uncovered some problems in our `configure.ac`, like using
deprecated macros.

The following major changes happened:

* meson: Changed `custom_target()` to `i18n.merge_file()` for all
  supported file types
* Added `.its` and `.loc`  files for the GIMP-specific XML formats, so
  that gettext understands them
* For the `.isl` (Window installer stuff) file, there's no easy way to
  do this in gettext, so instead we start from an XML file (again with
  its own ITS rules etc), translate that with gettext, and then use
  `xsltproc` with a bit of magic to output the .isl file for each
  language
* the `po*/Makefile.in.in` files are migrated to `Makevars` files,
  which gettext natively understands.

Fixes: https://gitlab.gnome.org/GNOME/gimp/-/issues/8028
2022-06-25 10:25:49 +02:00
Zurab Kargareteli
a9f7feabd0 Update Georgian translation 2022-06-25 07:06:46 +00:00
lloyd konneker
1c50e60e9c build:windows: migrate to Python3.10 on MSYS
Evidently MSYS no longer has 3.9, see recent pipeline failures.

Note reports of issues with meson on 3.10, but it might not impact this build.
2022-06-24 14:52:02 +00:00
Nathan Follens
62464563ac Update Dutch translation 2022-06-24 11:10:42 +00:00
Yuri Chornoivan
c813779ff8 Update Ukrainian translation 2022-06-24 06:30:13 +00:00
Hugo Carvalho
9b1cbcf85d Update Portuguese translation 2022-06-23 22:00:06 +00:00
Martin
29790b234f Update Slovenian translation 2022-06-23 05:12:03 +00:00
Jehan
3e6822b49d po-plug-ins: adding js and lua demo plug-ins to the POTFILES.
As noticed by Piotr Drąg.
2022-06-22 22:56:24 +02:00
Jehan
e3cc34fc6d plug-ins: add "planar-configuration" argument to "file-raw-load".
Instead of having a single "Planar RGB" format in the list, let's add
this as a generic parameter. Not only does it make the feature
symmetrical to "file-raw-save", but it also bring the ability to all
multi-channel formats. So now, we can load RGB, RGBA, GRAYA, whatever
the bit depth and the data type stored in planar configuration.
2022-06-22 22:25:18 +02:00
Yuri Chornoivan
70944af024 Update Ukrainian translation 2022-06-22 19:13:09 +00:00
Jehan
559d686d07 plug-ins: break "pixel-format" arg with 2 new args: "data-type" and…
… "endianness".

The list of formats being a single list was actually interesting
UI-wise, in the case where you aren't sure of the data layout (but say
you know at least the dimensions), you can easily and quickly scroll
through the combo list (e.g. with keyboard arrows).

But when you knew your data, it was a pain to use. And as a general
rule, so many choices in a list is not the best interface.

I broke the option into 3 options, and in particular adding a
"data-type" which would tell what type of values are stored (integer,
signed or unsigned, or float) and an "endianness" to tell the byte
order. The idea behind is that these don't change the layout of
components and their size. It means that we can still do the
scrolling-randomly-through-formats trick in some fashion because we
might likely be able to detect shapes when we get at the right layout,
even though we are still set to use the wrong data type and/or the wrong
endianness.
2022-06-22 20:09:10 +02:00
Jehan
657d37a8fe plug-ins: adding RGBA and grayscale float variants + grayscale-alpha…
… loading support as raw data.

Barely any new code (and actually a bit chunk of removed code) as we are
using generic code paths now.

"file-raw-load" procedure now supports all possible formats which can be
exported by the "file-raw-save" procedure (and more).

Only thing remaining now is looking how to simplify the GUI because this
overlong Pixel format combo box is quite a pain.
2022-06-22 19:05:34 +02:00
Hugo Carvalho
b710115759 Update Portuguese translation 2022-06-22 12:59:56 +00:00
Hugo Carvalho
9deb4edcef Update Portuguese translation 2022-06-22 12:14:26 +00:00
Hugo Carvalho
dd6db2eb7c Update Portuguese translation 2022-06-22 12:08:00 +00:00
Hugo Carvalho
cbe879c5b1 Update Portuguese translation 2022-06-22 12:03:59 +00:00
Hugo Carvalho
7408516cd5 Update Portuguese translation 2022-06-22 11:59:35 +00:00
Hugo Carvalho
7181a776ad Update Portuguese translation 2022-06-22 11:17:23 +00:00
Yuri Chornoivan
ed02d91872 Update Ukrainian translation 2022-06-22 05:59:15 +00:00
Zurab Kargareteli
9030443d31 Update Georgian translation 2022-06-22 01:48:32 +00:00
Luming Zh
3ee851c0d1 Update Chinese (China) translation 2022-06-22 01:08:25 +00:00
Jehan
b79d26f097 app: make update detection more robust to string revision field.
The "revision" field in the json file is supposed to be int. But I just
realized that it was set as string a few times, e.g. in Windows
installer revision 1 of GIMP 2.10.32. As a consequence, the revision 0
build was not able to detect the new revision.

I have now fixed the data in gimp-web repo (commit e7690e36), yet just
in case this ever happens again, I make the parsing code more robust by
accepting string revision, then properly converted to int.
2022-06-21 22:31:36 +02:00
Jehan
e3c7791acc plug-ins: adding support for RGB 16 and 32-bit float raw data.
Since we can now export these, let's add import support.

I copied the function halfp2singles() from babl code (as-is, without
formatting according to our coding style on purpose as we might just
want to switch this again later on).
2022-06-21 19:07:17 +02:00
Alexandre Franke
722143835e Update French translation 2022-06-21 15:34:34 +00:00
Yuri Chornoivan
61d79861ae Update Ukrainian translation 2022-06-21 06:33:25 +00:00
Jehan
2ffb7c12d1 plug-ins: now adding support for 16 and 32-bit RGBA raw data.
Quite easy now that we have generic code paths.
2022-06-21 01:49:09 +02:00
Jehan
b953acd2b9 plug-ins: add support for RGB 16 and 32-bit raw data.
I add the Little and Big Endian variants, but not the signed one for
now, because I am unsure how common it is. We have signed grayscale
variants, but it might be specific use cases there.

While adding these new loading support, I factorize the code when
possible by making all full-bytes RGB/Grayscale code more generic and
using the same code paths. In particular, raw_load_gray_8_plus() is now
removed as raw_load_standard() will handle all full-bytes use cases
where the input and output formats have the same components in same
order.

Also RAW_RGB and RAW_RGBA are renamed to RAW_RGB_8BPP and RAW_RGBA_8BPP
respectively.
2022-06-21 01:37:39 +02:00
Zurab Kargareteli
5ea200f67a Update Georgian translation 2022-06-20 21:03:14 +00:00
Jehan
0b1378f235 devel-docs: add an addition release step to test the package.
We regularly have package issues which are discovered soon after
release. Let's try a new step in the release process where we would
build packages in advance just for testing.
2022-06-20 21:54:13 +02:00
Jehan
55790d7bb2 plug-ins: support more cases of grayscale raw data.
- rename raw_load_gray16() into raw_load_gray_8_plus() and make it
  handle all full-byte grayscale data. Move 8-bit grayscale data to use
  this function as well.
- As a consequence of the previous point, we can also easily support
  32-bit grayscale images (little/big endian, signed/unsigned).
- Make preview image code more generic as well.

Also I improve a bit code from previous commit in raw_load_rgb565(). The
allocated and read code didn't need to be the size of the full line
stride. Just the tile rectangle width was enough.
2022-06-20 21:53:19 +02:00
Jehan
ba582253df plug-ins: raw_load_rgb565() ported to GEGL iterators.
Rather than allocating 2 huge data buffers of the whole image size (one
in RGB565 and one in RGB-u8), just iterate through the file only
creating one single small temporary data buffer for single input line in
tiles returned by the iterator. This will be much better,
memory-efficiency wise.
2022-06-20 14:39:09 +02:00
Jehan
e9876a8b7f plug-ins: rename "color-representation" to "pixel-format".
This initial name was really ugly. I think talking of pixel format or
color format is much more common, at least around GIMP codebase.
2022-06-20 14:39:09 +02:00
lloyd konneker
07ceb5a086 ScriptFu: extract PDB proc script-fu-server from plugin script-fu
Create new plugin file script-fu-server-plugin.c
with code extracted from script-fu.c, which is an omnibus plugin
implementing PDB proc extension-script-fu and other PDB procs.

Why:

1. extension-script-fu is smaller and doesn't doesn't link to socket libraries.
   (GIMP always starts extension-script-fu and it stays running.)

2. packagers/admins can omit script-fu-server executable from an installation,
   if they think letting users serve net ports is not secure.

3. crashing script-fu-server does not crash extension-script-fu,
   which requires restart of GIMP

The changes are mostly a simple refactor, extracting code.
No functional change apparent to users.
Low risk of introduced bugs.
Extremely few users use script-fu-server anyway.
Added some logging.
While at it, use G_DECLARE_FINAL_TYPE
2022-06-19 19:18:39 +00:00
Jehan
4e3edb5121 plug-ins: fix some warnings.
Should have paid more attention. I left 2 warnings in the file:

> plug-ins/common/file-raw-data.c:1949:22: warning: variable ‘procedure’ set but not used [-Wunused-but-set-variable]

> plug-ins/common/file-raw-data.c:1970:48: warning: ‘bpp’ may be used uninitialized in this function [-Wmaybe-uninitialized]
2022-06-19 20:26:45 +02:00
Tim Sabsch
538915c48e Update German translation 2022-06-19 15:26:42 +00:00
Martin
3b925f5864 Update Slovenian translation 2022-06-19 07:07:14 +00:00
Jehan
a554349e52 plug-ins: dynamically lower width/height with impossible values.
Even though the scale entries have maximum values based on the file
size, it's still too big for many formats (multi-byte ones) when
thinking in terms of pixels.

Moreover if growing the offset or any dimension, comes a point where the
other dimension needs to shrink. So let's compute max pixels and update
other values depending on this.

Note that it's still quite easy to crash the dialog with big dimensions,
triggering X Window System errors about unsufficient resources in
GimpPreviewArea code. This will have to be handled accordingly.
2022-06-19 01:17:39 +02:00
Jehan
5b22cef644 plug-ins: do not unref anymore int stores given to…
… gimp_procedure_dialog_get_int_combo().

See previous commit.
2022-06-17 17:59:54 +02:00
Jehan
8761d84aef libgimp, libgimpwidgets: more consistent API for widgets using a…
… GimpIntStore for value filling.

GimpIntComboBox was not taking ownership of the value store whereas the
newer GimpIntRadioFrame was taking ownership. As a more common practice,
I decided to leave ownership to the caller (which will therefore have
the responsibility to free the data) in the main class and property
widget APIs.

On the other hand, let's steal ownership of the store objects in the
gimp_procedure_dialog_get_int_*() functions as these are really used for
very quick and easy creation of dialogs by script writers. It would even
allow to create a GimpIntStore inline within the widget creation
function, if one wanted to.
2022-06-17 17:50:18 +02:00
Jehan
38f0535847 plug-ins: port file-raw load procedure to GimpProcedureDialog API.
- Add various relevant arguments to "file-raw-load" PDB call: width,
  height, offset, color-representation, palette-offset palette-type and
  palette-file. This will make the procedure actually usable for
  scripts.
- Use procedure config so that we get configuration storage as all other
  ported plug-ins.
- Update the source to use passed-in config object with these new
  arguments rather than global variables.
- The load dialog now uses the GimpProcedureDialog which means a lot
  simpler and nicer to read/debug code (we don't need all the code for
  argument syncing).

- "file-hgt-load" code now uses a HgtSampleSpacing enum, which makes
  code nicer to read, with semantic constant names.
- Do not show the dialog anymore for HGT load when sample spacing
  detection worked correctly. Indeed, offset and profile selection were
  making sense for random raw data, not for HGT file which we know how
  to process.
- Improve detection logic for sample spacing: in interactive mode, we
  always try and detect and show the dialog when spacing detection
  failed; in non-interactive mode, we only detect when "sample-spacing"
  argument is explicitly set to HGT_SRTM_AUTO_DETECT.

- The argument "image-type" of "file-raw-save" PDB call is renamed to
  "planar-configuration" to sync with the natural language label. Also
  it now uses a separate RawPlanarConfiguration enum rather than using
  specific values of the RawType enum (which made that the possible
  values were 0 or 6, which was a weird API in GIMP 2.10).

The plug-in still cannot load all possibly exportable formats (after
commit 01e0675f67) and I'm still wondering about whether
"color-representation" argument in the load call should not be broken
down into several arguments (it has both advantages and disadvantages).
This will be handled in further commits. For this first step, I needed
to clean the load code.
2022-06-17 17:18:12 +02:00
Jehan
b7d271b7d0 libgimpwidgets: small doc comment fix. 2022-06-17 17:18:12 +02:00
Jehan
42143881d8 libgimp, libgimpwidgets: supporting GFile properties in…
… GimpProcedureDialog.

- gimp_prop_file_chooser_button_new() now works also with properties
  G_PARAM_SPEC_OBJECT having a value_type == G_TYPE_FILE (additionally
  to GIMP_PARAM_SPEC_CONFIG_PATH properties).
- gimp_procedure_dialog_get_widget() will now create a
  GtkFileChooserButton in open mode for such a GFile property.
- New gimp_procedure_dialog_get_file_chooser() API to create
  GtkFileChooserButton for GFile properties in other modes.

Current limitation: GtkFileChooserButton doesn't have a label. This
should be fixed, probably by creating another custom widget with would
be a labelized file chooser button.
2022-06-17 17:18:12 +02:00
Alexandre Prokoudine
5f91f10106 Update Russian translation 2022-06-17 16:41:36 +03:00
Daniel Novomeský
7452c4bc6e plug-ins: ensure that metadata correspond to real image size 2022-06-16 16:46:31 +02:00
Jehan
4b52709725 NEWS: update. 2022-06-16 16:36:53 +02:00
Jehan
5123dc0f83 libgimp: missing new API in def files. 2022-06-16 11:45:33 +02:00
Yuri Chornoivan
19f9b7eead Update Ukrainian translation 2022-06-16 06:29:53 +00:00
Jehan
73868afe15 plug-ins: fix script-fu build in meson.
Fixes:

> plug-ins/script-fu/meson.build:44:0: ERROR: Bad source of type 'SharedLibrary' in target 'script-fu'.
2022-06-15 21:18:37 +02:00
Jehan
319ccb1d81 Issue #7091: Exporting 16-bit precision images to raw *.data.
Another part for the fix: now that it is possible to export any of the
color model and bit depth supported by GIMP core, we should make the
dialog settings clearer. In particular, don't just always show "RGB"
structure sample.

If an alpha channel is present, also show RGBA samples, and if it's a
grayscale image, show "Y" or "YA" samples. Actually when it's a
non-alpha grayscale, just make the option insensitive as planar and
contiguous will be the same thing.
2022-06-15 21:18:37 +02:00
Jehan
01e0675f67 Issue #7091: Exporting 16-bit precision images to raw *.data.
Just use the image format as-is. The only problem now is that we don't
support all formats for loading in file-raw yet.
2022-06-15 21:18:37 +02:00
Jehan
97d0337f92 plug-ins: partly port file-raw-data to newer dialog generation API.
Only port the export dialog so far. We'll see later for the load dialog.
This uses the new gimp_procedure_dialog_get_int_radio().

While doing this, I also better name "Image type" to "Planar
configuration", which is how DICOM standard and TIFF call the same
option. Within this settings, "Standard" is renamed "Contiguous" as a
more correct naming than a very vague "standard".

Similarly I rename "Palette type" to "Palette's configuration".

This is a first step to make RAW export clearer in the path of fixing
issue #7091.
2022-06-15 21:18:37 +02:00
Jehan
ed16fb9c9e libgimp: new gimp_procedure_dialog_get_int_radio().
This allows to create a GimpIntRadioFrame from an int property.
2022-06-15 21:18:37 +02:00
Jehan
41201f0865 libgimpwidgets: new GimpIntRadioFrame object.
A proper class for a frame containing radio buttons. This object has a
"value" property and will therefore be very easy to use in various API
binding a config property to a widget property.

A GimpIntRadioFrame is also what gimp_prop_int_radio_frame_new() will
return now.

gimp_prop_int_radio_box_new() on the other hand is being removed. It is
used nowhere and is unneeded. If someone really needs a non-labelled
group of radio buttons, they can also create a GimpIntRadioFrame, remove
the label and hide the borders. At least they will still be able to
easily bind it to a config property.
2022-06-15 21:18:37 +02:00
Luming Zh
34bdcc72c9 Update Chinese (China) translation 2022-06-13 17:30:17 +00:00
Luming Zh
929c3706ed Update Chinese (China) translation 2022-06-13 17:29:43 +00:00
Hugo Carvalho
5b43206bfe Update Portuguese translation 2022-06-12 21:18:36 +00:00
lloyd konneker
5cc3becf16 ScriptFu: build shared libgimp-scriptfu-3.0.so separate from executable script-fu
Changes are mostly to the dir structures and build system for ScriptFu.
Some changes to the outer plugin source to call the library.

Why: so that other executables (future gimp-scheme-interpreter,
or a future separated script-fu-server) can exist in separate directories,
and share the library in memory (when built shared.)

Whether the library is built shared and installed on its own
(versus static and not installed)
is a compile time option (both automake LibTool and meson abstract it away)
The default is shared and installed, say as libgimp-scriptfu-3.0.so.

Installed alongside other shared libraries (e.g. wherever libgimp is installed)
to simplify packaging.

A preliminary refactoring which helps enable MR gimp!647
2022-06-11 08:58:30 -04:00
Balázs Úr
9486334030 Update Hungarian translation 2022-06-10 23:08:01 +00:00
Balázs Úr
acab78e915 Update Hungarian translation 2022-06-10 22:47:24 +00:00
Balázs Úr
6ae6b548af Update Hungarian translation 2022-06-10 22:45:04 +00:00
Daniel Novomeský
0897ce91c4 win64-nightly: exclude files used by older GIMP only 2022-06-10 14:59:46 +02:00
Martin
f75c55b48c Update Slovenian translation 2022-06-09 21:16:01 +00:00
Martin
efc3f3b69f Update Slovenian translation 2022-06-09 21:13:52 +00:00
Martin
efb725b048 Update Slovenian translation 2022-06-09 21:12:30 +00:00
Yuri Chornoivan
27bab41636 Update Ukrainian translation 2022-06-09 14:34:54 +00:00
Jehan
0b6f88ee8c po-plug-ins: add plug-ins/file-fli/fli.c in POTFILES.
Reported by Piotr Drąg.
2022-06-09 16:22:00 +02:00
Piotr Drąg
76f3e03bbf Update Polish translation 2022-06-09 13:32:09 +02:00
Yuri Chornoivan
2fc4e9c5bd Update Ukrainian translation 2022-06-08 19:17:33 +00:00
Jehan
4477d64c17 devel-docs: add a point about publishing to the Microsoft Store.
See issue #1307.
There doesn't seem to be anything blocking us to publish to the
Microsoft Store, now that there is this new "traditional desktop
application" process allowing us to publish using our existing
installer. So GIMP 2.10.32 should normally be our first published
version there.
2022-06-08 20:59:09 +02:00
Jehan
ec8fb00561 app: only check gimp-release once.
Store the useful package information as static contents rather than
loading and parsing the file repeatedly.
2022-06-08 20:59:09 +02:00
Jehan
1c5491b69e plug-ins: override set_i18n() for file-glob.
I forgot this one, which simply can have its localization disabled. As I
understand, it's mostly for script writer so was never localized. Maybe
it could still be interesting to localize the procedure name and docs,
but for now let's leave it how it always was.
2022-06-08 20:59:09 +02:00
Jehan
2b4e433e87 desktop: adding a <release> tag for GIMP 2.10.32.
(cherry picked from commit 4fbc497c28)
2022-06-08 20:59:09 +02:00
Jacob Boerema
2e4b9bcba7 plug-ins: fix not converting 8 bps grayscale MINISWHITE TIFF
We only set tiff_mode for images with bps < 8, but we also use it for
8 bps grayscale images to detect if MINISWHITE needs to be converted.

So, let's always set tiff_mode for PALETTE, MINISBLACK and MINISWHITE.
2022-06-08 14:34:03 -04:00
Jacob Boerema
94de89febf plug-ins: fix #1790 Artifacts when opening tif images ...
generated by matlabs blocproc function

Based on the suggested solution by Massimo, we should not compute the
remaining pixels per line but only at the end of the whole block, be it
tile or scanline.

I have not been able to find bw or palette examples that use load_separate
instead of load_contiguous, so that case is not tested. But, it also
doesn't make much sense to have planar when you have just one plane.
2022-06-08 13:23:16 -04:00
Jacob Boerema
3e6237030c plug-ins: fix #6766 TIFF B/W image opened as grayscale and not index map
In a previous commit 1, 2 and 4-bit B/W images were converted to grayscale.
However, it seems that there is more of a use case for these images to be
handled as indexed, even though technically they can be considered
grayscale.
Also, the only way to export these images again in the same format, is to
have them as indexed.

So, let's change this back, so that these kind of images will be opened
as indexed. With a reminder that in the future we could add an option
at loading time where the user can choose whether they prefer it to be
loaded as indexed or grayscale.

We use grayscale mappings, that we moved in the previous commit, to
add a palette to these grayscale images.
2022-06-08 13:23:16 -04:00
Jacob Boerema
11ef2e4432 plug-ins: move static variables for grayscale mapping to the top
In preparation of using some of them earlier, we move the variables
used for grayscale mapping of 1, 2 and 4-bit per pixel images to the
top of file-tiff-load.
2022-06-08 13:23:16 -04:00
Jiri Grönroos
660c588d1b Update Finnish translation
(cherry picked from commit 9f17513c85)
2022-06-08 17:09:58 +00:00
Jiri Grönroos
cadadaa2fa Update Finnish translation
(cherry picked from commit 5d34a88fc0)
2022-06-08 16:54:07 +00:00
Jiri Grönroos
72df6ce3ea Update Finnish translation
(cherry picked from commit 55fd1ead15)
2022-06-08 16:42:57 +00:00
Jehan
67f7b76e92 data: fix gimp-release file on Windows.
The '\n' newline is transformed into a space (0x20) when building
natively on Windows. And unfortunately g_key_file_load_from_file() does
not like this.

The autotools rule works properly on all platforms according to my
tests.

Note that at first, I thought it was a LF vs. CRLF issue, and tried to
special-case Windows, but I realized it's just that 'echo' command
seemingly transform newlines unexpectedly in its Windows form. I didn't
want to waste too much time experimenting alternative calls, especially
as I have to test through CI (so each test is very costly, time-wise).
Instead I go the alternative way of using a pre-generated conf file.
2022-06-07 21:41:59 +02:00
Jehan
10145bb938 build: add an option in the Windows installer to disable update check.
This will allow to use the official Windows installer directly in the
Windows Store, as per the new proposed workflow by Microsoft.

Nevertheless our GIMP for Windows has a built-in update check which
would check if a new version exist and warn people (advising them to go
on the website and download the new installer to update). We obviously
don't want this on the Windows Store which has its own update channel.
It would be confusing.

Therefore I added a feature to disable the built-in update check (not
even showing in Preferences) by tweaking a single package variable. The
installer now comes with new option /DISABLECHECKUPDATE=true which will
add said variable.
2022-06-07 17:52:52 +02:00
Martin
e6c58f5254 Update Slovenian translation 2022-06-07 14:53:17 +00:00
Martin
1541a3cd15 Update Slovenian translation 2022-06-07 14:41:31 +00:00
Niels De Graef
175dab9f86 devel-docs: Add a urlmap file
The urlmap file allows gi-docgen to generate links for namespaces that
are also generated by gi-docgen. For example, with this commit, a
reference to `GObject` will now be properly linked to the GObject
documentation.
2022-06-07 09:42:35 +02:00
Zurab Kargareteli
1dded62f6d Add Georgian translation 2022-06-07 03:57:42 +00:00
Jacob Boerema
7231ea54f8 libgimp: fix #1632 GIMP should not write to IPTC tag DateCreated
GIMP was saving the last changed/saved date to IPTC tag DateCreated,
which should only be used for the original creating date of the image
and thus should not be changed by GIMP.

After discussion in the cited issue, there is no tag in IPTC that we can
use, so we remove saving modified date from the IPTC metadata.

Instead we add two XMP tags, one for modified date and the other for the
date that metadata was changed. Since we do both when exporting, both are
saved with the same date/time in ISO 8601 format.

This also fixes another issue where we were not storing the timezone offset
for Xmp.tiff.DateTime. Since this has the same format as the other
XMP tags, we fix this together with this issue.
2022-06-06 19:03:13 -04:00
Anders Jonsson
5e16ef5ae3 Update Swedish translation 2022-06-06 21:20:54 +00:00
Yuri Chornoivan
26859e1ef6 Update Ukrainian translation 2022-06-06 17:02:26 +00:00
Alan Mortensen
8bfb2d65d9 Update Danish translation 2022-06-06 15:18:44 +00:00
Jehan
9ef10c8764 app: allow to disable the new version check altogether through a key…
… in the gimp-release file.

This will be useful to disable the update check for the Windows Store
even though we use the same build as the installer. All it will take
will be to append the line `check-update=false` to the file
`share/gimp/2.10/gimp-release` and it will behave as though the update
check is disabled (even though it is actually built-in).
2022-06-06 01:09:08 +02:00
Jacob Boerema
a842869247 app: check for invalid offsets when loading XCF files
More safety checks for detecting broken xcf files, also based on examining
issue #8230.

After reading an offset where layer, channel, etc. data is stored, we
add a check to make sure that offset is not before where we read the
offset value. Because the data is always written after the offset that
points to it.
2022-06-05 18:52:15 -04:00
Jacob Boerema
24c962b95e app: check max dimensions when loading xcf files
Improvements in loading broken xcf files, based on examining issue #8230.
Besides checking for a minimum width and height, GIMP also has a maximum
size we can and should check.

In the case of the image itself, we change invalid dimensions to a size of
1 in hope that the individual layers etc will have the correct size.
For layer, we will also try to go on, but for channel and layer mask, we
will give up.
2022-06-05 18:52:15 -04:00
Jacob Boerema
22af0bcfe6 app: fix #8230 crash in gimp_layer_invalidate_boundary when channel is NULL
gimp_channel_is_empty returns FALSE if channel is NULL. This causes
gimp_layer_invalidate_boundary to crash if the mask channel is NULL.

With a NULL channel gimp_channel_is_empty should return TRUE, just like
the similar gimp_image_is_empty does, because returning FALSE here
suggests we have a non empty channel.
2022-06-05 18:52:15 -04:00
Nikc
93b9876405 plug-ins: fix #1106 Add CMYK/A loading for TIFFs
Adds support for loading 8 and 16 bit CMYK/A TIFF files with
attached color profiles.
2022-06-05 17:49:54 -04:00
Yuri Chornoivan
d3cee62a3a Update Ukrainian translation 2022-06-05 08:43:34 +00:00
Yuri Chornoivan
ebdb57a51c Update Ukrainian translation 2022-06-05 08:28:20 +00:00
Jehan
b8d1046aa9 plug-ins: fix file-jp2-load build.
I guess I missed this one as I was not building it locally.
Fixes:

> In file included from ../plug-ins/common/file-jp2-load.c:86:
> ../plug-ins/common/file-jp2-load.c: In function ‘jp2_class_init’:
> ../libgimp/stdplugins-intl.h:42:22: error: ‘set_i18n’ undeclared (first use in this function)
2022-06-05 02:32:38 +02:00
Jehan
9905981471 NEWS: better localization API for plug-ins (#8124).
The logic now is not core plug-ins first, but rather any plug-in first.
2022-06-05 02:08:27 +02:00
Jehan
95abf39066 app, libgimp: reverse internal l10n logic of plug-in labels in core app.
I hesitated a lot whether we should just drop the whole localization of
plug-ins' label and description (blurb) within the core. Actually the
commit messages I wrote a few days ago were moving towards this logic.
It really looks to me like plug-in localization can happen fully within
plug-in themselves. As far as I can see, the only advantage which the
current logic has theoretically is that if we needed, we have access to
both the original strings and their translations (e.g. it could be
useful for text search). Nevertheless I am not sure if we will ever make
use of this, and this is limited cases as all filters turned GEGL ops
don't have such ability anyway.

Nevertheless since previous contributors clearly put quite a lot of work
on this code of localizing the plug-in's label and description within
the main binary, I want to give myself a little more time to think and
study the whole thing because doing anything rash.

In the meantime, what changes is that by default now, a plug-in without
a local gettext catalog is simply not localized. In particular, the core
process doesn't try to localize it using the default catalog, a.k.a.
GETTEXT_PACKAGE"-std-plug-ins" ("gimp30-std-plug-ins"). It just doesn't
make sense and the worst which could happen would be to get unexpected
and wrong translations.
Now by default, plug-ins will try to find a catalog in their main
folder, named as this folder. If it fails to find it, a message is
printed to stderr and localization is disabled (rather than falling back
to a default catalog). It is up to plug-in developers to either install
a catalog, or implement set_i18n() to give the right catalog, folder, or
disable localization with gettext, as handled by libgimp.
2022-06-05 01:57:02 +02:00
Jehan
01e9253d7e app, pdb: fix PDB string wrapping in generated calls of…
gimp_procedure_set_static_help().

The indentation was wrong, probably because of changes to function
names. Fix the generation scripts and regenerate the PDB C files.
2022-06-05 01:57:02 +02:00
Jehan
bdd22cd95b app, libgimp, pdb: change docs of _gimp_plug_in_domain_register().
We changed the logic of _gimp_plug_in_domain_register() which is now
only called when a domain is explicitly registered (which is not the
case by default anymore). Let's update the function documentation and
also make it clear that third-party developers in particular should not
play with it if they want their plug-ins to be properly localized.
2022-06-05 01:57:02 +02:00
Jehan
3e57f2f482 extensions, po-plug-ins: demo extensions use the new i18n logic.
Since these are demos, for the sake of showing how the localization
works, let's localize the goat-exercises with a locally installed
catalog.
Note that actually use the gimp30-std-plug-ins catalog, simply I copy it
in the plug-in folder and rename it as org.gimp.extension.goat-exercises
domain.

As a consequence:

- The C plug-in does not need the INIT_I18N anymore, which was
  specifically for the centrally installed catalog and cannot be used by
  third-party plug-in developers (so it's not a good demo code).
- I now use GLib.dgettext() for Python instead of the gettext Python
  module, because the later won't "catch" the catalog declared in
  libgimp.
- The other Goat exercises are now localized correctly, unlike before.
- Just setting GETTEXT_PACKAGE is apparently enough for the Vala
  plug-in.
- Lua is untested. Hopefully the code will work.
2022-06-05 01:57:02 +02:00
Jehan
18c37f7084 plug-ins, libgimp: override set_i18n() for all our core plug-ins.
Hence avoiding the stderr messages. These are going to be localized with
centrally installed catalogs "gimp*-std-plugins", "gimp*-script-fu" and
"gimp*-python".

We now handle core plug-in localizations differently and in particular,
with kind of a reverse logic:

- We don't consider "gimp*-std-plugins" to be the default catalog
  anymore. It made sense in the old world where we would consider the
  core plug-ins to be the most important and numerous ones. But we want
  to push a world where people are even more encouraged to develop their
  own plug-ins. These won't use the standard catalog anymore (because
  there are nearly no reasons that the strings are the same, it's only a
  confusing logic). So let's explicitly set the standard catalogs with
  DEFINE_STD_SET_I18N macro (which maps to a different catalog for
  script-fu plug-ins).
- Doing something similar for Python plug-ins which have again their own
  catalog.
- Getting rid of the INIT_I18N macro since now all the locale domain
  binding is done automatically by libgimp when using the set_i18n()
  method infrastructure.
2022-06-05 01:57:02 +02:00
Jehan
4b9d8a56cb libgimp: add a new set_i18n() method to GimpPlugIn class.
Clearly the old logic for localizing plug-ins was "core plug-ins first":

* In particular, we were defaulting to the "gimp*-std-plugins" domain,
  asking plug-ins to override it with libgimp function
  gimp_plug_in_set_translation_domain(). Obviously any third-party
  plug-in would have to call this function since their strings are most
  likely not the same as GIMP core plug-ins.
* Moreover this was only for the localization of menu items, which means
  we had to duplicate work anyway (simplified for core C plug-ins only
  with the INIT_I18N macro).
* Also plug-ins had to manage the location of the Gettext catalogs,
  which is simpler for core plug-ins with gimp_locale_directory(), but
  more annoying for third-party plug-ins which can be installed
  basically anywhere (assuming their message catalogs are in their
  directory, not centrally installed on the system, especially for
  non-UNIX-like packages, with relocatable GIMP, no central package
  system and so on).
* Finally in this logic of centrally installed catalogs, we were
  requesting that the domain name is unique, which makes sense in a
  Linux world with well maintained packages to avoid name clashes, not
  in a world with people making plug-ins without knowing too much what's
  done by their neighbour.

So now the new logic is:

- By default, GIMP will search for a folder called locale/ on the same
  level as the plug-in executable. The Gettext domain will be the name
  of the executable folder (and it doesn't matter too much if it's not
  unique in such configuration).
- This can be disabled by overriding set_i18n() to NULL or
  reimplementing it. All our core plug-ins will do this since they will
  continue to use the centrally installed "gimp*-std-plugins" domain (or
  "gimp*-python" for Python plug-ins).
- When not disabled while the folder is not available, warning messages
  will be outputted to stderr, so that plug-in developers can easily
  detect what is missing and how to handle it (and how to easily support
  internationalization of their plug-in).
- gimp_plug_in_set_translation_domain() is removed and a future commit
  is going to get rid of _gimp_plug_in_domain_register() because we are
  going to get rid of the core-side localization of menu items (with
  logic explained in the upcoming commit).
2022-06-05 01:16:19 +02:00
Jehan
208d415a1a plug-ins: properly localize core Python plug-ins.
- Set the "gimp30-python" Gettext domain and bind it to the proper
  locale directory as installed by GIMP.
- Localize various strings with gettext.
- Remove calls to self.set_translation_domain() in
  do_query_procedures(). This is technically wrong right now but I am
  going to get rid of the menu item localization for plug-ins done by
  the core.
2022-06-04 14:52:14 +02:00
Jacob Boerema
b6d5707816 plug-ins: fix possible overflow in computation
FLI/FLC width x height is 16-bit unsigned, so theoretically it could
overflow a 32-bit signed int.
We fix this by making it a 64-bit signed int.
2022-06-03 12:52:17 -04:00
Jacob Boerema
862c54ec94 plug-ins: fix resource leak
In case of a certain error condition we forgot to free our resources.
This would only happen if we had a corrupt FLI/FLC image.
2022-06-03 12:48:19 -04:00
Jacob Boerema
6a8299d989 plug-ins: simplify adding tags to store in metadata-viewer
We were using parameter iter in metadata_dialog_add_tag and
metadata_dialog_add_translated_tag.

However, iter is only ever set inside metadata_dialog_add_tag by calling
gtk_list_store_append. So, there is no need to pass this parameter around.

For this reason, let's remove parameter iter from the above two functions
and replace with a local variable.
2022-06-02 21:45:27 -04:00
Jacob Boerema
5cf1ec62b4 libgimpbase: fix crash caused by the previous commit
In other cases we need to free value, but in this case it was used and
trying to free it caused a GIMP to crash.
Let's duplicate value, so we don't need to special case our g_free.
2022-06-02 17:45:13 -04:00
Jacob Boerema
3138fe5158 libgimpbase: fix resource leak in gimpmetadata
Variable value was not always freed. Move it outside the else block.
2022-06-02 15:14:33 -04:00
Jacob Boerema
b130349935 app: fix incorrect order of parameters horizontally and vertically
There was one case where horizontally and vertically were mixed up in a
call to gimp_display_shell_scale_image_stops_to_fit.

The more usual order of parameters is first horizontal and then vertical.
So, let's fix the actual functions that have the illogical order
of vertically, horizontally instead of fixing the one call.

This brings it in line with the order in other functions and makes it less
likely we mistakenly mess up the parameters.

Besides that gimp_display_shell_scale_image_stops_to_fit also was not
declared as a local function, so we add that too.
2022-06-02 13:26:05 -04:00
Kevin Cozens
38e4d5490b Eliminated possible compiler warning. From r130 of TinyScheme in SourceForge. 2022-05-31 19:31:05 -04:00
Kevin Cozens
0af582f309 Allow only one exponent in numbers. From r129 of TinyScheme in SourceForge. 2022-05-31 19:31:05 -04:00
Kevin Cozens
4772f57827 Use trunc() from C99. From revision 128 of TinyScheme in SourceForge. 2022-05-31 19:31:05 -04:00
Kevin Cozens
afca1926f1 Use x and y at top of opexe_2 to save repeating some car() and cadr() calls.
From SVN version 127 of offical version of TinyScheme.
2022-05-31 19:31:05 -04:00
Kevin Cozens
511ada844e Syncing TinyScheme with the 1.42 version in the SourceForge repository.
This picks up changes applied in SVN revisions 120 and 124 which
both clean up compiler warnings.
2022-05-31 19:31:05 -04:00
Kevin Cozens
73e5ef394f R5RS compliance fix. Return proper type for remainder and modulo.
Also fixed quotient to only take two arguments. Applied minor
optimization in execution of quotient, remainder, and modulo.
From revision 122 of the TinyScheme repository in SourceForge.
2022-05-31 19:31:05 -04:00
Kevin Cozens
53b7a0935e String-ref, string-set!, vector-ref, and vector-set! index must be integer.
R5RS compliance fix. From bug #42 reported in the SourgeForge bug tracker.
2022-05-31 19:31:04 -04:00
Kevin Cozens
e0b6a9cab2 Syncing TinyScheme with the 1.42 version in the SourceForge repository.
This picks up changes applied in SVN revisions 100, 103, 106, and 113.
The TinyScheme version number has been updated.
2022-05-31 19:31:04 -04:00
Aleksandr Melman
977cf00f3d Update Russian translation 2022-05-30 16:25:37 +00:00
lloyd konneker
a3b242b2c5 ScriptFu: Break mutual includes between script-fu-server and scheme-wrapper
Instead, make outer script-fu-server register callbacks with inner scheme-wrapper.

Why? the inner scheme-wrapper should not know about the outer script-fu-server.
The change will allow a future, smaller scriptfu shared library,
that does not contain networking code.
We want a scriptfu library shared by separate script-fu-server,
future gimp-scheme-interpreter (!647), and script-fu executables.

This change does not alter observable functioning of the script-fu-server.
Except that I also changing the logging by script-fu-server,
so that I could test the changes.
I put a test plan in the comments.
2022-05-29 08:48:17 -04:00
MohammadSaleh Kamyab
1fc5289405 Update Persian translation 2022-05-29 08:00:40 +00:00
Jacob Boerema
ba841a98da app: fix #6961 Scaled image bug
With large image sizes a 32-bit int is not enough for the intermediate
computations, which byte per pixel, width and height are.

So, just like the function below it does: gimp_gegl_pyramid_get_memsize,
we will cast these to gint64.

Thanks to Massimo Valentini for finding the cause.
2022-05-28 12:14:54 -04:00
Luming Zh
dbd4751a0a Update Chinese (China) translation 2022-05-28 02:41:30 +00:00
Jordi Mas
e301f2e1a3 Update Catalan translation 2022-05-27 07:42:12 +02:00
Jehan
c02b4836dd extensions: remove call to gettext.bind_textdomain_codeset().
I added this call originally, mimicking the C plug-ins. Yet in Python,
this function is deprecated since Python 3.8 and removed in 3.10.
Looking closer in the docs, it looks like Python's gettext module works
differently.

While all the *gettext() functions return strings in the locale's
encoding in C, unless overriden by bind_textdomain_codeset() (therefore
we need this call, in order to have locale-independent string encoding),
this is not the case in Python, whose gettext() call is already
locale-independent. The gettext.bind_textdomain_codeset() function only
applies to the specific l*gettext() functions which are deprecated too.

Fixes the warning:

> goat-exercise-py3.py:37: DeprecationWarning: bind_textdomain_codeset() is deprecated
2022-05-25 10:59:12 +02:00
Jehan
a773e1cdc8 libgimp: minor nitpick fixes.
- Use GLib types even if it's the same thing here.
- Remove one redundant test (`*sp` is already tested by the for() loop).
2022-05-24 23:52:15 +02:00
Jehan
2d192ae804 app: fix GStrv argument validation in PDB calls.
Bugs introduced in commit 8eb7f6df9e:

- The type test was wrong.
- The UTF-8 validation test was also wrong since it was still working on
  a GimpArray even though the data was now a GStrv.

Also I stop at the first invalid UTF-8 string element, otherwise later
valid strings may hide previous invalid ones.

This bug was mostly invisible since we don't have any core PDB API with
GStrv parameter so far, only GStrv return value.
2022-05-24 19:48:36 +02:00
Jehan
8c43e641e3 app: gimp_container_get_name_array() should always return a GStrv.
Even if the container is empty, then we return a GStrv of length 1 (i.e.
an array of length 1, terminating with NULL).

In particular, it improves gimp_container_get_filtered_name_array() as
well, and in turn various list-returning functions in libgimp. This
makes the API more consistent after changes from commit 8eb7f6df9e.

Note that a NULL return can be acceptable for error cases, but an empty
list because this is the expected result for the request should be an
empty GStrv, not NULL.
2022-05-24 17:56:49 +02:00
Jehan
a6fab71a9a app: gimp_pdb_query() returns a GStrv.
In particular, since commit 8eb7f6df9e, even if it returns an empty
array of procedure, it still means an array of size 1 (with the unique
value being NULL).

This also fixes the public API gimp_pdb_query_procedures() which returns
a GStrv using gimp_pdb_query() internally.

Finally don't keep track of the array size, just recompute it with
g_strv_length(), which will be much less bug-prone.
2022-05-24 17:26:50 +02:00
Jehan
8c1414eb02 app: fix gimp_g_value_get_memsize() with GStrv value.
Since GStrv are NULL-terminated arrays, there is always one additional
pointer (NULL).
This is a detail, but still, wrong since commit 8eb7f6df9e which
replaced GimpStringArray by GStrv usage.
2022-05-24 15:56:03 +02:00
Luming Zh
3fd21f98cf Update Chinese (China) translation 2022-05-23 22:16:41 +00:00
Martin
b02b5147ac Update Slovenian translation 2022-05-23 15:48:48 +00:00
Martin
cf737a703f Update Slovenian translation 2022-05-23 15:47:06 +00:00
Martin
a0401340ea Update Slovenian translation 2022-05-23 15:42:49 +00:00
Aleksandr Melman
94484efd30 Update Russian translation 2022-05-23 12:25:12 +00:00
Rodrigo Lledó
d6b8655f97 Update Spanish translation 2022-05-23 08:32:47 +00:00
Jacob Boerema
a96dc81ee5 plug-ins: fix #7613 overwrite export creates thumbnail when it shouldn't
When overwriting the same file when exporting, we didn't check if the
image previously had a thumbnail. If the default setting in Preferences
is to add a thumbnail, then it would add one where it shouldn't.

Since thumbnails get saves as part of the EXIF metadata, we need to check
that to see if there was a thumbnail in the original image.
However, we were always removing the thumbnail from the metadata on import.

Let's delay removing this metadata until we need to, which has the
advantage that the metadata in our viewer is more complete.

When exporting starts, we add a check in gimp_image_metadata_save_prepare
to see if there was a thumbnail in the EXIF metadata. If not, then we
disable the thumbnail flag.

In gimp_image_metadata_save_filter we remove the thumbnail metadata when
the user doesn't want to save a thumbnail, or when the image format
does not support EXIF.
2022-05-22 14:00:36 -04:00
Piotr Drąg
26aafaa843 Update Polish translation 2022-05-22 14:58:41 +02:00
Anders Jonsson
f4fe8f3bd7 Update Swedish translation 2022-05-21 19:48:08 +00:00
Alexandre Prokoudine
7f50e37f91 Fix typos introduced by myself 2022-05-21 09:47:56 +03:00
Niels De Graef
75e42eda31 modules: Make sure we restore cursor in ColorWheel
We set the crosshair cursor when the user starts dragging, but we never
restored it when dragging ended. This commit fixes that.
2022-05-20 17:39:24 +02:00
Rodrigo Lledó
519e8745d2 Update Spanish translation 2022-05-20 14:33:31 +00:00
Rodrigo Lledó
2c7f94d3da Update Spanish translation 2022-05-20 14:14:36 +00:00
Nathan Follens
c2bfb9204f Update Dutch translation 2022-05-19 14:10:27 +00:00
Jehan
8e4055831a NEWS: update. 2022-05-19 11:34:49 +02:00
Hugo Carvalho
0e80f4467d Update Portuguese translation 2022-05-18 14:39:33 +00:00
Jacob Boerema
e268d38fb1 plug-ins: remove unnecessary Windows specific code in tinyscheme
Removal of the snprintf define was also part of the UCRT Windows patch
in MINGW. Although it builds fine without this change, there is no need
anymore to redefine snprintf. In addition, I seem to remember that
_snprintf had a shortcoming.

So let's remove the Windows specific code, since it works fine without it.
2022-05-17 17:23:06 -04:00
Jacob Boerema
ef817dc452 plug-ins: fix Windows build in UCRT environment
The UCRT environment is a successor to the MINGW environment on Windows
with a more modern C runtime library.
Building under UCRT we get this error:
../../gimp/plug-ins/file-raw/file-darktable.c:420:7: error:
 function '__p__environ' is initialized like a variable"

To fix this we use the relevant part of patch 6 from:
https://github.com/msys2/MINGW-packages/tree/master/mingw-w64-gimp
2022-05-17 17:23:06 -04:00
Yuri Chornoivan
7450af8fd1 Update Ukrainian translation 2022-05-17 16:55:15 +00:00
Alexandre Prokoudine
6bdff26969 Deweirdify recent Russian translation update, part 2 of many 2022-05-17 10:34:21 +03:00
Alexandre Prokoudine
5da57f9c51 Deweirdify recent Russian translation update, part 1 of many 2022-05-16 22:03:00 +03:00
Nikc
42cbaff322 Issue #4492: Add "Flip image", save visible layers feature to DDS 2022-05-16 18:56:16 +00:00
Jacob Boerema
3644b9010a plug-ins: fix #1351 Raw Data Import Creates Blank/White Image...
when Offset and Dimensions Bigger than File Size.

If we didn't read the exact amount of bytes, the whole image would be
filled with white.

Let's change this, so we read as much bytes as we can, and fill the rest
with white.
2022-05-16 14:00:17 -04:00
Yuri Chornoivan
ed5d842a0b Update Ukrainian translation 2022-05-16 16:19:20 +00:00
Jacob Boerema
980e604880 plug-ins: fix reading of FLI files where the filesize is off-by-on 2022-05-16 11:22:14 -04:00
Jacob Boerema
ca8eee1755 plug-ins: improve error handling of FLI export
Added GError parameters to all static file write functions, check for
failed writing and return an error if that is the case.

Additionally, at end of file make sure the last dummy byte is written to
make chunks an even size.
2022-05-16 11:22:14 -04:00
Nikc
fccc13b782 Issue #4: Enable loading transparent .EPS files 2022-05-16 14:31:50 +00:00
Aleksandr Melman
18c80c0710 Update Russian translation 2022-05-15 14:35:36 +00:00
Aleksandr Melman
baa406b821 Update Russian translation 2022-05-15 14:16:04 +00:00
Piotr Drąg
8f0a5f2da5 Update Polish translation 2022-05-15 14:16:29 +02:00
Anders Jonsson
5924196007 Update Swedish translation 2022-05-14 18:45:13 +00:00
Jehan
84a21eacb8 devel-docs: work-around the g-ir-docs bugs in autotools too. 2022-05-14 19:55:11 +02:00
Hugo Carvalho
8ef8774d90 Update Portuguese translation 2022-05-14 17:27:05 +00:00
Hugo Carvalho
8f96af147b Update Portuguese translation 2022-05-14 17:23:59 +00:00
Jehan
6f14db9ea2 devel-docs: fix again
This will work around such errors from the g-ir-doc build:

> devel-docs/g-ir-docs/pages/python/Gimp-3.0/Gimp.checks_get_colors.page:46: parser error : EntityRef: expecting ';'
> gimp_checks_get_colors (gimp_check_type (), &color1, &color2);
>                                                    ^

Similar to commit 7123b6c466, it cannot really be considered a proper
fix, barely a workaround for g-ir-doc-tool not even able to produce
valid XML. Here we have ampersands which it should have espaced into XML
entities.
Anyway this will do for now (until we just decide to drop the g-ir-docs
tools?).
2022-05-14 18:47:53 +02:00
Jehan
b0384e8e4f NEWS: updates. 2022-05-14 17:43:39 +02:00
Jehan
0c01a44369 devel-docs, libgimpbase: getting rid of gimp_checks_get_shades().
In the original gimp-2-10 branch where this feature was originally
worked on, we had to keep gimp_checks_get_shades(). But on `master`
where we will reset and break API, let's get rid of this function which
should not be used anymore.
2022-05-14 17:43:39 +02:00
Jehan
8d61c4211f plug-ins: replace gimp_checks_get_shades() by gimp_checks_get_colors().
The animation playback now follows user preferences for checkboard
rendering.
Also fixing a small bug there, as the GIMP_CHECK_SIZE_SMALL_CHECKS was
the wrong type (it needed a check type, not a check size parameter).
2022-05-14 17:43:39 +02:00
Yuri Chornoivan
de246c5fba Update Ukrainian translation 2022-05-14 15:20:31 +00:00
Yuri Chornoivan
64bfebc7a0 Update Ukrainian translation 2022-05-14 15:18:08 +00:00
Jehan
b112e708f5 libgimpbase: bump the protocol version.
Since we changed it, the version must be incremented too. It means that
third-party developers will have to rebuild their plug-ins.

Fixed Conflicts from !274:
	libgimpbase/gimpprotocol.h
2022-05-14 16:31:58 +02:00
Jehan
916c5f9d11 app, libgimpbase: improve preferences and checkboard defaults.
- Slightly nicer layout for the checkboard color widgets.
- Also set the 2 color widgets insensitive when the check type is not
  GIMP_CHECK_TYPE_CUSTOM_CHECKS.
- Default the custom colors to the same colors as the basic default
  grayscale. I mean, red and blue defaults are fun and all, but that's
  like radioactive colors burning the eyes! Ahahah!
- Unlike the gimp-2-10 commit (cf. !274), on the main dev branch, use
  the new GimpLabelColor widget.

Fixed Conflicts from !274:
	app/dialogs/preferences-dialog.c
2022-05-14 16:31:58 +02:00
Jehan
1787492710 plug-ins: tile-small should respect the user-set transparency rendering.
Right now, the various Gimp*Preview classes have code initializing their
transparency colors correctly. Some plug-ins, such as tile-small are
directly using a GimpPreviewArea and need to be initialized directly by
the plug-in.

I also realized that several plug-ins (such as gradient-flare) are
rendering their own alpha checkboard, despite using a GimpPreviewArea
(maybe was it code from a time before this class had support for alpha
checkboard rendering?). So this would have to be improved later.
2022-05-14 16:31:58 +02:00
Jehan
87f7a92786 app, libgimp, libgimpbase, libgimpwidgets: better checkboard colors API.
- Some coding style fixes (alignment, etc.).
- Adding missing "Since: 3.0" annotations. We are still wondering
  whether this should go in 2.10, in which case, it would become
  "Since: 2.10.32" annotations. See discussion in !274.
- Changing gimp_checks_get_colors() signature: merge the 4 color
  arguments into 2 (inout) arguments which seems a bit nicer in C,
  whereas binding handles such arguments correctly. The other
  alternative would have been to at least change the order to have out
  arguments in the end.

  I also hesitated to get another API in libgimp, which would have been
  config-aware (just returning the 2 check colors, depending on user-set
  Preferences), then having GimpPreviewArea handling 2 colors (without a
  GimpCheckType input). But actually, doing this, we'd remove the nice
  menu popup where one could choose a generic check type (not everyone
  wants to play with specific non-gray colors) in Gimp*Preview widgets.
  So in the end, I left this whole thing as-is.
  Instead I document the function with code sample to initialize
  properly the GimpPreviewArea (since libgimpwidgets/ are independent
  with no knowledge of the core config) in order to respect user
  preferences.
- Hide the color properties in gimp_preview_area_menu_new() because
  anyway gimp_preview_area_menu_new() does not support GimpRGB
  properties right now (so all we get are warnings). It's still possible
  to select custom colors on GimpPreviewArea, simply we are stuck at the
  ones set in Preferences globally for now (unless a plug-in creates
  custom GUI to set these).

Fixed Conflicts from !274:
	libgimp/gimp.h
	libgimpwidgets/gimppreviewarea.c
2022-05-14 16:31:50 +02:00
Jehan
a241538da7 libgimp: fix def files.
Fixing the CI for MR !274.
2022-05-14 16:27:26 +02:00
Ben Rogalski
d90b84ba9d Custom transparency checkerboard colors
Reviewer (Jehan) note: cherry picked from MR !274. Still deciding
whether this will be pushed to gimp-2-10 branch too.

Fixed Conflicts from !274:
	app/dialogs/preferences-dialog.c
	app/display/gimpdisplayshell-draw.c
	app/plug-in/gimppluginmanager-call.c
	libgimp/gimp.c
	libgimp/gimp.h
	libgimpwidgets/gimppreviewarea.c
	libgimpwidgets/gimppreviewarea.h
	libgimpwidgets/gimpscrolledpreview.c
2022-05-14 16:27:15 +02:00
Niels De Graef
e5caf21bcb pickbutton: Add version check for XDG portal
`PickColor()` API only got added in version 2, so check for that before
trying to use it.
2022-05-13 11:28:28 +02:00
Hugo Carvalho
ff4e9c649a Update Portuguese translation 2022-05-12 22:06:15 +00:00
Yuri Chornoivan
8cdaf1b686 Update Ukrainian translation 2022-05-12 11:42:06 +00:00
Jacob Boerema
7a2dd01a3a plug-ins: fix wrong return types forgotten in previous commit 2022-05-11 18:37:55 -04:00
Jacob Boerema
dd7c067715 plug-ins: further improvements in error handling in FLI/FLC loading
- Changed all static read functions to have a GError parameter, use a
  parameter for the value read, and return a gboolean that will be FALSE
  when reading from file failed.
- Check the return values of all read functions and set GError when
  needed.
- Added more error checking, like comparing real filesize with what the
  header tells us, check for valid speed and number of frames.
- Added some gdebug statements for easier debugging.
- Don't assume that all FLI/FLC writers followed the specs and wrote an
  even number of bytes per chunk.
- Skip "frames" that do not have the FRAME type (in most cases this is
  a PREFIX chunk).
2022-05-11 16:28:58 -04:00
Jacob Boerema
317e0ca21e plug-ins: update public FLI functions to add a GError and return gboolean
Improvements to the FLI loading and exporting plug-in:
- I added a GError parameter to all public read/write functions.
- All public functions now return a gboolean result to show if they
succeeded or failed. Before most functions were void. For the non void
returns (the two fli_write_color functions) I added a gboolean
parameter.
- Do cleanup if we fail to read a frame. If at least one frame was read
successfully, we will keep the incomplete image/animation.
- Change name of layer to include the delay in ms.
2022-05-11 16:28:58 -04:00
Martin
56cac1cda4 Update Slovenian translation 2022-05-11 10:03:31 +00:00
Martin
c25adf501e Update Slovenian translation 2022-05-11 10:00:05 +00:00
Hugo Carvalho
4823074ec7 Update Portuguese translation 2022-05-10 21:10:20 +00:00
Rodrigo Lledó
3156c7b5c6 Update Spanish translation 2022-05-10 13:02:00 +00:00
Yuri Chornoivan
1448560fbb Update Ukrainian translation 2022-05-09 20:07:15 +00:00
Jehan
45a99ae270 plug-ins: make the BigTIFF warning translatable. 2022-05-09 19:56:46 +02:00
lloyd konneker
5e9c92c5de plug-ins: fix script-fu-font-map error receiving GStrv
Why: MR !389 changed the signature of PDB procedures to return GStrv instead of (int, GimpStringArray)
This changes handling of results from a call to such a changed signature, in a Scheme script.

The symptom was a cryptic TinyScheme "Error: car: argument 1 must be : pair"

Most changed procedures are named like "-list".
I did a cursory grep to look for other instances.

Updated porting guide doc.
2022-05-07 19:14:42 +00:00
Jacob Boerema
b072a42bb7 plug-ins: silence warnings about missing mnemonics in file-fli-save
Also remove the unneeded setting of labeled text.
2022-05-07 14:19:30 -04:00
Jacob Boerema
d143a2d55f plug-ins: fix #5315 Opening FLI with one frame fails
Fix as suggested by Lloyd Konneker.
Even though a one frame animation isn't really an animation, there is no
reason why we can't or shouldn't load it.
2022-05-07 14:19:30 -04:00
Jacob Boerema
5ecf46ccef plug-ins: cleanup of fli plug-in, use glib types and change ulong to guint32
The unsigned long type in this plug-in is always used for reading/writing
32-bit unsigned integers, so let's change it to guin32 to not get
confused.
Changed unsigned short to gushort, unsigned char to guchar.
2022-05-07 14:19:30 -04:00
lloyd konneker
1846f91305 Fix #6026, SF scripts use v3 API for multilayer gimp-edit-copy, -cut, -paste.
Why: in v3 the signature for gimp-edit-foo PDB procedures changed to support multilayer selection.

This finishes the task for ScriptFu scripts in the GIMP repo.
This is not a complete list, since some calls were changed incidentally by prior commits.
You can grep for "edit-copy" etc. in script-fu/scripts to find instances.

This also makes incidental changes, to script calls to plug-in-tile,
which now also has a changed signature to support multilayer.

The changes are simple code transformations.
The changes to gimp-edit-paste calls are more complex,
a mixed bag of a few lines transformed to more lines.
I did not try to understand the larger logic of the changed plugins.
I did not test the changed plugins functionally.
I used a harness to call each changed plugin with improvised parameters,
only checking that the test plugin did not throw runtime errors,
not checking that they produced correct images.

As noted in the issue, this might be undone if the original signatures
for gimp-edit-foo are restored as convenience functions.
2022-05-06 20:44:33 +00:00
Hugo Carvalho
45c2a0b6af Update Portuguese translation 2022-05-06 09:49:25 +00:00
Alan Mortensen
82f45b07d5 Update Danish translation 2022-05-05 17:29:11 +00:00
Niels De Graef
2b8ed6cfae app/display: Remove keyboard grab
Remove `gimp_display_shell_keyboard_grab()` and ...ungrab(), as there
doesn't seem to be any good reason to grab the keyboard away from the
compositor. More annoyingly, in some systems it will pop up a dialog
on each first click whether the user is okay with inhibiting shortcuts.
2022-05-05 14:35:51 +00:00
lloyd konneker
5e1dd03c52 plug-ins: fix PDB proc script-fu-selection-to-pattern
Why: this commit fixes PATTERN using code that commit 708f3228  fixed for BRUSH.

Importance:
There doesn't seem to be any issues it resolves.
No code in the GIMP repo seems to call this procedure.
I don't know whether third party plug-ins rely on this procedure.
Anyway, fix it so a brute force test works.
2022-05-05 13:10:48 +00:00
Jehan
19204d7f97 meson: test version of appstreamcli.
Since the new AppStream URL types are only available since appstream
0.15.3.

Thanks to Eli Schwartz for notification of the availability of the
'version' option, even in find_program().
2022-05-05 14:38:31 +02:00
Fran Dieguez
e97555adce Update Galician translation 2022-05-05 09:46:10 +00:00
Jehan
920041c3a0 desktop: gimp-data-extras AppStream was moved to the appropriate repo.
See the commit 28467cb on the gimp-data-extras repo where I moved this
data in. Not sure why this metadata file was ever pushed to the main
repo as it is obviously for the data-extras package (or else I am
missing some information!).

The old 2017 report where it was originally added:
https://bugzilla.gnome.org/show_bug.cgi?id=763398
2022-05-04 23:00:00 +02:00
Yuri Chornoivan
8363f14357 Update Ukrainian translation 2022-05-04 05:42:20 +00:00
Jehan
6895631388 desktop: add (bogus) date for 2.99.12 release.
appstreamcli on CI fails with error:

> E: org.gimp.GIMP:394: release-time-missing date

I didn't have such error on my local build, because it is a new check
only recently added. The CI appstreamcli errored-out this way.

It forces us to add a bogus release date since we don't know it yet. I
chose May 29, because we usually release on Sundays, and it might soon
be time to make a dev release (so who knows, we might get lucky and it
might happen this day), though it should not be taken as a promise or a
real plan just now. I just needed to fill something in, in order to fix
the CI.

I opened a report to ask that appstreamcli proposes a relaxed check mode
where we can test on the <release> tag before knowing the future date:
https://github.com/ximion/appstream/issues/398
2022-05-04 00:06:43 +02:00
Rodrigo Lledó
fa6efbf834 Update Spanish translation 2022-05-03 21:42:55 +00:00
Jehan
caf506af0c desktop: we might not be valid project_group GNOME?
appstreamcli returns an info message:

> I: org.gimp.GIMP:3: cid-missing-affiliation-gnome org.gimp.GIMP

Checking the message, it happens because the application ID does not
start with "org.gnome." (but "org.gimp.").

Double-checking AppStream docs, a note says:

> You should only identify with an umbrella project if you use all their
> infrastructure and policies, for instance string freezes dates,
> bugtracker and source control instance.

GNOME Foundation is indeed an umbrella for us for the infrastructure and
obviously part of its policies. But we are still independant and don't
depend on GNOME's freeze dates, or release dates, or design rules
(though we try to follow what makes sense), and so on. So I guess it
means we should not set this metadata tag? 🤷 Let's drop it.

See: https://freedesktop.org/software/appstream/docs/chap-Metadata.html#tag-project_group
2022-05-03 22:53:12 +02:00
Jehan
1691d9b8bc desktop: fix the data-extras AppStream file.
appstreamcli was returning the error:

> E: gimp-data-extras:3: cid-is-not-rdns gimp-data-extras

Apparently non-desktop component must absolutely follow the schema with
a unique identifier with 3 parts or more.

As advised in the spec, let's use the main desktop component ID, adding
a specific subpart.

Also use underscore rather than hyphen for maximum compatibility.
See: https://freedesktop.org/software/appstream/docs/chap-Metadata.html#tag-id-generic

Finally for addons, share/metainfo/ is the recommended install path.
See: https://freedesktop.org/software/appstream/docs/sect-Metadata-Addon.html
2022-05-03 22:33:27 +02:00
Jehan
e3d7526732 desktop: fix our AppStream file for appstreamcli validation.
Adding a TODO as date was passing through with appstream-util in relax
validation mode, but there is no such mode in appstreamcli.

Anyway since I have manual check steps for the AppStream files in
devel-docs/release-howto.txt, I never missed setting the date right (so
far! Knocks on wood…) in the AppStream metadata. Therefore let's drop
this trick for now and see how it goes.

It should fix the appstream unit check, but only when using appstreamcli
0.15.3 or over (this version is already on Debian testing).

See issue #8140.
2022-05-03 22:33:08 +02:00
Jehan
ea819ea303 app: missing generated config-enums.c.
This was missing ever since commit 505a78e715 but we weren't seeing this
by using meson. I opened the report #8145 for us to handle this
regression of the build system.
2022-05-03 22:03:26 +02:00
Jehan
0e5ce8b217 .gitlab-ci: add appstream package to the CI Debian testing image.
This should make the AppStream file testing work on the CI.
2022-05-03 21:57:02 +02:00
Jehan
73f1f944c5 desktop: use appstreamcli for testing instead of appstream-util.
As told to us, this is the reference AppStream file testing tool, and it
understands more of the spec.

Also since commit 73e2e701da, appstream-util chokes on newer url types
from the spec. These tags are now supported both in appstream-util and
appstreamcli source code, except that appstreamcli had release 0.15.3,
available in Debian testing, whereas there were apparently no recent
appstream-glib/util release (and none since 2020). So for these various
reasons, let's go with the appstreamcli tool.

The only downside is that appstream package (where appstreamcli lives)
is not available on MSYS2, but since it's only an optional test tool for
XML files which should be common on all platforms, it's probably
acceptable.
2022-05-03 21:48:28 +02:00
Jehan
89fc542fad build: build Georgian localization for Windows installer.
Georgian added in commit 2e07b2d5cc.

This will fix the CI.
2022-05-03 20:57:58 +02:00
lloyd konneker
a1f0757ee7 Fix #8091 ScriptFu scripts use v3 API for drawables in calls to file procedures
This change is part of multilayer select feature of v3.

Only fixes ScriptFu plugins, not Python or C.
Only fixes calls to file load/save procedures and other plugins already multilayer capable.
Any future PDB procedures changed to have multilayer signature will require changes to all callers.

The new code is verbose: "drawable" => "1 (vector drawable)"
Issue 5919 proposes a change to the PDB that would make this less verbose:
"drawable" => (vector drawable)" (without the number of drawables)

Tested that changed procedures will interpret without syntax errors, on one path.
Did not test each changed procedure for functional correctness.
2022-05-03 16:17:44 +00:00
Rodrigo Lledó
09dfb3b05b Update Spanish translation 2022-05-03 07:23:14 +00:00
Jacob Boerema
eb2d99be3d plug-ins: support loading DDS with two 16-bit channels.
We have some examples of DDS images that have two 16-bit channels that
we could not load.

This commit adds checks to see if we need 16-bit channels, and conversion
of the input to a correct 16-bit red, green, blue or alpha channel.
2022-05-02 17:24:56 -04:00
Jacob Boerema
045c3d3208 plug-ins: fix crash in DDS loader when one of the masks is zero. 2022-05-02 17:24:56 -04:00
Jacob Boerema
d914580336 plug-ins: support loading more 16-bit, single channel DDS images
Single channel 16-bit DDS images can use other channels than red, so
let's support all masks with a value of 0xffff.
2022-05-02 17:24:56 -04:00
Jacob Boerema
868a6f1d4a plug-ins: compute DDS variables earlier and support 16-bit masks
To be able to use certain variables we use in our DDS loader earlier,
we move the computation of these variables up.
We also add checks to see if the mask needs to be for 8 or 16-bit, since
there are DDS images with 16 bits per sample.
2022-05-02 17:24:56 -04:00
Martin
22c2fe0e00 Update Slovenian translation 2022-05-02 20:04:20 +00:00
Martin
fa3a5ba8ac Update Slovenian translation 2022-05-02 20:00:21 +00:00
JakobDev
73e2e701da Add new URL types to Appdata 2022-05-02 15:48:07 +00:00
lloyd konneker
513d331ae2 Fix #6842 by deleting second of two strings passed for filenames, in scripts 2022-04-30 11:53:02 +00:00
Jacob Boerema
4f99f1fcfd app: fix #8120 GIMP 2.10.30 crashed when allocate large memory
GIMP could crash if the information regarding old path properties read
from XCF was incorrect. It did not check if xcf_old_path succeeded and
kept trying to load more paths even if the last one failed to load.

Instead we now stop loading paths as soon as that function fails.
In case we have a failure here we also try to skip to the next property
based on the size of the path property, in hopes that the only problem
was this property.
2022-04-29 16:40:32 -04:00
Jacob Boerema
0e462440cc plug-ins: fix #3964 Incorrect position when printing
This was a long standing issue where the image was not printed at the
position as selected in our print preview.

The problem being that we do not take into account the dpi of the print
context we are printing to, but instead always assumed 72.
This is the fix that was suggested by Massimo.
2022-04-29 12:59:59 -04:00
dimspingos
9cbbdce24e Updated Greek translation 2022-04-28 21:51:47 +03:00
Alan Mortensen
940cd267f8 Update Danish translation 2022-04-28 16:26:19 +00:00
Jehan
f0dc690935 app: improve a bit the restart-triggering change list.
When you change a settings in Preferences which requires a restart of
GIMP, the current list was pretty ugly. I am still not fond of the popup
but at least now the list formatting is slightly better:

- Use a unicode bullet point character in UTF-8 encoding (since
  gtk_message_dialog_new() expects UTF-8 input) on each list element,
  instead of just writing them without any kind of formatting.
- Use the "nick" of the changed config, not the name. The "name" is an
  internal string which is really not meant to be viewed by people,
  while the "nick" is more like a short human-readable name or title,
  exactly what we want to show here.
2022-04-27 15:35:33 +02:00
Jehan
82f9ae1ab7 app: force re-querying all plug-ins after a language change.
Some strings might be generated during query() call, in particular all
strings related to procedure parameters. The core will only know the
localized version at query() time, so you could end up in situation with
the core showing you the wrong language. This can be reproduced in the
Procedure Browser when it shows localized procedure data: when you
change the language and restart GIMP, if the plug-ins aren't re-queried,
then it will still show the localization of query time.

Note that it doesn't matter on plug-in side, i.e. anything in the run()
call is properly localized, included the plug-in GUI using the same
procedure parameters for widget labels or tooltips. Only the "vision" of
the core is stuck at what it got when the plug-in was last queried, and
until the next update of the plug-in.
2022-04-27 15:22:32 +02:00
MohammadSaleh Kamyab
717a4a7cb1 Update Persian translation 2022-04-27 11:01:47 +00:00
Hugo Carvalho
2364c179ba Update Portuguese translation 2022-04-27 10:43:59 +00:00
Yuri Chornoivan
080dcfac98 Update Ukrainian translation 2022-04-27 07:24:36 +00:00
Jehan
8d37584ea3 NEWS: update. 2022-04-27 02:19:54 +02:00
Jehan
b904d67af7 plug-ins: localize file-png-save parameters.
Small text tweaks done too:
- Some question marks removed to be more consistent in the tooltip
  style.
- The "save-transparent" only applies to *completely* transparent pixels
  (not partially transparent).
2022-04-26 23:35:41 +02:00
Jehan
c3cc859a88 libgimpwidgets: fix label vertical alignment of GimpSpinScale.
Let's not try to align anymore the label text with the value (numbers
inside the GtkEntry) text. Our previous offset computation was wrong
anyway, but even correctly aligning the text, there could be cases where
the label's actual font was bigger than the number's font.

I had the case with GIMP set in Korean. The number text was 11-pixel
high but the Hangul text on 16 pixels in plug-ins using a GimpSpinScale,
most likely because the font used for numbers didn't have Hangul glyphs.
So we ended up with very ugly scale title on the bottom of the widget,
even out of the progress area. Instead, we just make sure that the label
is exactly in the vertical middle of the widget, disregarding the entry
layout's offset.
2022-04-26 23:06:51 +02:00
Yuri Chornoivan
ba6ec46178 Update Ukrainian translation 2022-04-26 17:38:01 +00:00
Jehan
b5fbe84b09 plug-ins: localize file-webp parameters' titles/docs.
Also changing "RGB->YUV" by using a real Unicode rightward arrow encoded
in UTF-8 since GTK functions (such as `gtk_widget_set_tooltip_text()`)
explicitly uses UTF-8 encoded strings as argument. This renders much
more nicely than an ASCII-made arrow.
2022-04-26 19:09:04 +02:00
Jehan
ada64be8cd plug-ins: new "use-sharp-yuv" param only relevant when non "lossless".
Cf. question to libwebp devs and also grepping the code directly:
https://bugs.chromium.org/p/webp/issues/detail?id=567#c6
2022-04-26 17:18:40 +02:00
Nikc
df402522ef Plug-ins: Add "Use Sharp YUV" for webp export 2022-04-26 12:46:33 +00:00
Jordi Mas
c2badc8cb1 Update Catalan translation 2022-04-25 21:30:06 +02:00
dimspingos
89d7bd2b13 Updated Greek translation 2022-04-25 21:33:07 +03:00
Jacob Boerema
cd4401fee4 plug-ins: fix integer overflow in print-draw-page.c
As mentioned by Massimo in issue #6618, part of the problem there is an
integer overflow when using large size images when computing the offset
in pixels.

Let's fix our part of the problem by casting to guint64.
Besides that, also use casts to correctly compute progress for very
large images.
2022-04-25 14:21:18 -04:00
dimspingos
d72cead60b Updated Greek translation 2022-04-25 15:41:42 +03:00
Zurab Kargareteli
2e07b2d5cc Add Georgian translation 2022-04-25 09:16:46 +00:00
Alan Mortensen
c0461ea955 Update Danish translation 2022-04-24 17:11:16 +00:00
Alan Mortensen
1688eb82d3 Update Danish translation 2022-04-24 17:10:48 +00:00
Zurab Kargareteli
54cdeef950 Add Georgian translation 2022-04-23 18:47:21 +00:00
Zurab Kargareteli
b1b4f288ad Update Georgian translation 2022-04-23 16:31:27 +00:00
Fran Dieguez
9cdd99c2ca Update Galician translation 2022-04-21 21:24:15 +00:00
Jordi Mas
eebb207efd Update Catalan translation 2022-04-21 22:41:41 +02:00
Jehan
c06083158a Issue #8102: crash when using the clone tool.
So it turns out that the "notify::src-drawables" property signal in
particular can happen during gimp_paint_tool_paint_interpolate() called
from gimp_paint_tool_paint_thread(). Though the function
gimp_clone_options_gui_update_src_label() was run in the main thread in
simple cases, being called this way through a paint thread happens when
very quickly changing the source while painting, which is what Aryeom
does (when I see her using the clone tool, she would sometimes change
the source very quickly several times in barely a few seconds).

Yet GTK and GDK calls must not happen in non-main threads. It used to be
acceptable when protected with gdk_threads_enter|leave() calls but doing
this is deprecated. The now sanctioned method is to call the GTK code in
an idle function since these are guaranteed to run in the main thread.

This was most likely explaining why crashes could quite randomly happen,
though I'm not sure why I never had those (even though I could reproduce
the GTK calls happening in non-main threads, but without crashing GIMP)
and why Aryeom gets these much more often suddenly. Maybe some recent
dependency change which would trigger these more easily or other
context-dependant changes (as most non thread-safe code, bugs and crash
often happen in race conditions, so are harder to reproduce reliably)?
2022-04-21 19:13:01 +02:00
Claude Paroz
cad8cdeb36 Update French translation 2022-04-21 08:44:10 +00:00
Claude Paroz
0d0e02433c Update French translation 2022-04-21 08:40:30 +00:00
Jehan
1a840b8e18 libgimpcolor: fix call to cmsCreateProofingTransform().
Wrong argument order! See Little-CMS API.
2022-04-20 20:54:20 +02:00
Boyuan Yang
f19f940916 Update Chinese (China) translation 2022-04-20 13:51:47 +00:00
Yuri Chornoivan
506c18e3a0 Update Ukrainian translation 2022-04-18 11:23:11 +00:00
Rodrigo Lledó
c4610f6671 Update Spanish translation 2022-04-18 09:59:43 +00:00
Rodrigo Lledó
35a74f2b62 Update Spanish translation 2022-04-18 09:26:48 +00:00
Hugo Carvalho
3a6e3a3638 Update Portuguese translation 2022-04-17 21:42:20 +00:00
Hugo Carvalho
da48c5b646 Update Portuguese translation 2022-04-17 21:32:38 +00:00
Jehan
f200594d1c plug-ins: support CMYK import/export for JPEG.
We already had import support through littleCMS. We now use fully
babl/GEGL which makes our code more straightforward and identical,
whichever the input format.

The export support is totally new. It comes with a checkbox to propose
selecting CMYK export and a label displaying the CMYK profile which will
be used.

Now this whole implementation has a few drawbacks so far, but it will be
a good first sample for future CMYK-related improvements to come:

* The export profile I am using is what we call the "simulation
  profile" from the GimpColorConfig. This corresponds to the default
  "Soft-proofing" profile as set in Preferences. In particular, this is
  not the actual soft-proofing profile for this image which might have
  been changed through the View menu because this information is
  currently and unfortunately unavailable to plug-ins. It is not the
  "Preferred CMYK Profile" either, as set in Preferences.
  TODOS:
  - We really need to straighten the soft-proof profile core concept by
    storing it in the image and making it visible to plug-in.
  - Another interesting improvement could be to create a
    GimpColorProfile procedure argument which would be mapped to a color
    profile chooser widget, allowing people to choose profiles in
    plug-ins. For an export plug-in in particular, it could allow to
    select a profile different from the soft-proof one at export time.
* When we export, if no profile is choosen, babl will use a naive
  profile. It would be nice to store this naive profile into the JPEG if
  the "Save color profile" option is checked (same as we store a generic
  sRGB profile when no RGB profile is set).
* When we import, we just import the image as sRGB. Since CMYK gamuts
  are not necessarily within sRGB (some part of the spectrum is usually
  well within, but other well outside), other than the basic conversion
  accuracy issue, we may lose colors. It would be much nicer to be able
  to select an output RGB profile. Optionally if we could create a RGB
  color space which is made to contain the whole input CMYK profile
  color space, without explicit choice step, it would be nice too.
* I am using babl's "cmyk" format, not the expected "CMYK" format.
  "cmyk" is meant to be an inverted CMYK where 0.0 is full ink coverage
  and 1.0 none. Nevertheless when loading the resulting JPEG in other
  software (editors or viewers alike), the normal CMYK would always
  display inverted colors and the inverted cmyk would look fine.
  Finally I found a docs from libjpeg-turbo library, explaining that
  Photoshop was wrongly inverting CMYK color data while it should not.
  This text dates back from 1994, looking at the commit date which
  introduced this paragraph. In the 28 years since then, could this
  color inversion have become the de-facto standard for JPEG because one
  of the main editor would just output all its JPEG files this way?
  See: dfc63d42ee/libjpeg.txt (L1425-L1438)
2022-04-17 23:14:20 +02:00
Jehan
1ccdf467fb INSTALL, NEWS: the macOS build is now officially using meson too.
See MR gimp-macos-build!97.
2022-04-17 15:06:16 +02:00
Jehan
c1d2f35b73 app, plug-ins: redirect plug-in-script-fu-eval to text console in…
… plug-in code.

In particular, we should not hardcode this in core code anymore. The
behavior is otherwise exactly the same, except that we made the core
code generic as it should be.
2022-04-17 14:25:44 +02:00
Yuri Chornoivan
16784c0081 Update Ukrainian translation 2022-04-17 06:15:55 +00:00
Jehan
471ae86f3d NEWS: update. 2022-04-17 00:29:23 +02:00
Jehan
3524fe8fa9 app: improve a bit the output for batch interpreters.
Specifying the --batch-interpreter option seems like it would really
help people better understand what is missing.
2022-04-16 23:36:50 +02:00
Jehan
de1d71bb3f app, libgimp, pdb, plug-ins: batch CLI options now interpreter aware.
The CLI options now know which procedures are batch procedures or not.
First it means that it won't just randomly try any procedure name one
may pass and will properly output an error if you pass a non-existing
interpreter procedure.

Secondly, there is no default interpreter anymore (unless only one
interpreter exists). If you don't set an interpreter procedure with
--batch-interpreter or if you pass a wrong one, it will output the list
of available batch procedure, thus helping you understanding how to use
the --batch option.
2022-04-16 23:28:05 +02:00
Jehan
06ae6a81a2 libgimp: fix def file.
Even in 10 years, I'll probably forget this annoying def file! Ahahah.
2022-04-16 20:45:47 +02:00
Jehan
0555a6815e plug-ins: port plug-in-script-fu-eval to GimpBatchProcedure. 2022-04-16 18:50:29 +02:00
Jehan
752cbd1377 plug-ins: port python-fu-eval to GimpBatchProcedure. 2022-04-16 18:50:29 +02:00
Jehan
52b7273294 app, pdb, libgimp: new GimpBatchProcedure class.
This new class will be used to register procedures usable for batch
processing.
2022-04-16 18:50:28 +02:00
Hugo Carvalho
d815250043 Update Portuguese translation 2022-04-16 16:15:24 +00:00
Yuri Chornoivan
96a831efb0 Update Ukrainian translation 2022-04-16 16:01:17 +00:00
Charles Monzat
9875cfe2c9 Update French translation 2022-04-16 13:32:02 +00:00
Jehan
46a335b68e app: exit GIMP more cleanly when quitting immediately after batch calls.
Call gimp_exit() rather than emitting the signal ourselves. This way in
particular, the still-opened images are properly freed and we avoid
GeglBuffer leaks from images we might have created in a batch script, or
the images loaded in command lines.
2022-04-16 15:02:51 +02:00
Rodrigo Lledó
296772f4d9 Update Spanish translation 2022-04-16 11:13:58 +00:00
Jehan
5831f5ef4e app: when called with --quit, GIMP exit code will report batch failure.
If you call GIMP with batch commands and ask it to quit immediately, you
are likely interested by failure information. For this reason, let's now
report exit code other than success, but only in such case. In
particular, even if the batch commands fail, but GIMP is not set to exit
immediately, we continue reporting SUCCESS run at the very end (when
exiting interactively).

Note that I hardcode a few exit values, as standardly found on Linux
(but not using headers which may not be found on all platforms; in
particular, Windows apparently doesn't use any standard code other than
0 for success, from what my searches return).

Additionally, when several commands are requested, GIMP will now stop at
the first failing and will return its error code, and print a message on
stderr to easily report the failed command for easier debugging.
2022-04-16 02:30:46 +02:00
Jehan
1f74b4fede libgimp: missing annotation colon.
Fixes:

> [33/48] Generating Gimp-3.0.gir with a custom command
> ../../../../../../../dev/src/gimp/libgimp/gimpimageprocedure.c:228: Warning: Gimp: missing ":" at column 41:
>  * @run_func:         (closure run_data) the run function for the new procedure.
>                                         ^
2022-04-16 01:57:55 +02:00
Jehan
028210369a app: add a new --quit CLI option to quit GIMP after a batch script.
Instead of asking for the script to call gimp_quit() which is not too
proper (because this is actually meant to exit the script, not GIMP
itself. Scripts should not have the ability to basically kill the main
GIMP process), let's add a `--quit` option which does what it says: it
quits GIMP immediately (after having processed any task on command line,
such as running batch scripts).

See discussions in issue #7376.
2022-04-16 01:40:17 +02:00
Jehan
2d3476805e app: wait for pending events before actually quitting.
This should fix various hard-to-reproduce cases of:

> (gimp-2.99:50596): Gimp-Core-WARNING **: 00:42:45.324: gimp_finalize: list of contexts not empty upon exit (2 contexts left)
>
> stale context: (null)
> stale context: PDB Context

We had these warnings happening randomly at exit and not always
reproduceable with the same steps. I had it reproduced much more easily
when working with CLI scripts exiting GIMP immediately. The context were
actually properly unref-ed but simply we had to wait a bit for events to
be processed before destroying the main GIMP object.
2022-04-16 01:40:17 +02:00
Jehan
5a93f54994 app: do not sync the PDB context "name" property.
The PDB context name was overwritten when syncing with the parent
context, e.g. the "User" context. Therefore "stale context" warnings,
for instance, were misleadingly telling the "User" context was leaking.
2022-04-16 01:40:17 +02:00
Jacob Boerema
d3e38ea4b9 libgimp: Fix issue #7387 luajit.exe crashes on Windows
On Windows our Lua goat extension crashed when run. After some digging
it appeared that incorrect annotations were the cause.
The destroy annotation was clearly an error when loking at the gir API
documentation. However, it also crashed on `(closure run_func)`, which
seemed to be as it should.

After comparing what other libraries do and testing, it seems that the
documentation for (closure CLOSURE) is incorrect. See the discussion
in the above mentioned issue.
The correct use here seems to be to use it as annotation of the run_func
where CLOSURE points to the user data. So, that's what we implement here.
2022-04-15 18:48:33 -04:00
Yuri Chornoivan
3bb6923122 Update Ukrainian translation 2022-04-15 18:48:18 +00:00
Claude Paroz
a6d59a9b68 Fixed text along path error message 2022-04-15 17:25:20 +02:00
Claude Paroz
74ff1213e5 Update French translation 2022-04-15 13:38:07 +00:00
Aryeom
eb2988aefe Update Korean translation 2022-04-13 09:24:00 +00:00
Sveinn í Felli
3805379ae7 Update Icelandic translation
(cherry picked from commit 60e8093c4e)
2022-04-12 10:20:28 +00:00
Sveinn í Felli
e3a5894bd4 Update Icelandic translation
(cherry picked from commit 900a2ebd0a)
2022-04-12 10:07:47 +00:00
Sveinn í Felli
73b2920ad3 Update Icelandic translation 2022-04-12 09:57:18 +00:00
Jehan
75f9bdccbb libgimpwidgets: add back some GEGL prop special-casing in…
… gimp_prop_spin_scale_new().

This was forgotten when moving the code to libgimpwidgets in commit
7056f1b960. Thanks to Thomas Manni for noticing.
2022-04-09 21:53:32 +02:00
Jehan
78fceca353 libgimpwidgets: GimpSpinScale header was not listed. 2022-04-09 18:35:15 +02:00
Aleksandr Melman
a97d9156b0 Update Russian translation 2022-04-09 15:31:50 +00:00
Sveinn í Felli
90e2af7c74 Update Icelandic translation 2022-04-08 15:38:15 +00:00
Jehan
b502b54041 NEWS: update. 2022-04-07 23:09:13 +02:00
Jordi Mas
f4e640cef1 Update Catalan translation 2022-04-07 22:23:48 +02:00
Martin
f0aad6c9b2 Update Slovenian translation 2022-04-07 19:13:07 +00:00
Sveinn í Felli
c995e37ed3 Update Icelandic translation 2022-04-07 11:29:17 +00:00
Sveinn í Felli
9cfb24070f Update Icelandic translation 2022-04-07 10:26:33 +00:00
Povilas Kanapickas
edcbf18fe6 app: Implement exclusiveness of zoom and rotate gestures
Performing zoom and rotation at the same time is inconvenient because
most of the time the user will want either zoom or rotation. This can be
solved by recognizing a "significant enough" zoom or rotation change
initiated by the gesture recognizer and then ignoring the other gesture.
2022-04-06 18:50:25 +00:00
Povilas Kanapickas
e8cf57f157 app: Implement canvas support for touchpad gesture rotation by pinch 2022-04-06 18:50:25 +00:00
Sveinn í Felli
182bb56953 Update Icelandic translation 2022-04-06 18:48:21 +00:00
Sveinn í Felli
0ae11f02b6 Update Icelandic translation 2022-04-06 18:19:20 +00:00
Sveinn í Felli
9609b96a8f Update Icelandic translation 2022-04-06 16:19:26 +00:00
Hannie Dumoleyn
6dcd1cad7a Update Dutch translation 2022-04-06 15:53:25 +00:00
Sveinn í Felli
c45ea0c3d8 Update Icelandic translation
(cherry picked from commit cc6af232f0)
2022-04-06 13:15:50 +00:00
Rodrigo Lledó
e7cdc80c2e Update Spanish translation 2022-04-06 11:04:22 +00:00
Hugo Carvalho
8ceac59c53 Update Portuguese translation 2022-04-05 21:46:34 +00:00
Yuri Chornoivan
4a42a26e1f Update Ukrainian translation 2022-04-05 18:41:38 +00:00
Jacob Boerema
5b39bc963d app: fix #3928 GIMP cannot open .xcf
GIMP stopped trying to read the XCF as soon as an invalid parasite was
encountered. However, in this specific case only the parasite data is
invalid, while the rest of the image is not corrupt.

Instead of terminating when we see a corrupt parasite, we skip to the
offset after the parasite. This may still be corrupt, but we can handle
that correctly, see e.g. the XCF in bugzilla issue 685086, which was
the reason of some of the previous changes.

Additionally:
- We add some logging to make it easier to handle future issues in this
  area.
- We add tests for a NULL parasite name, and for reading a different
  amount of parasite data than we expected. In both cases we return
  NULL instead of a parasite.
2022-04-05 13:11:22 +00:00
woob
eb58b277d2 app: Add drag-to-zoom speed preference
Adds the new configuration option "drag-zoom-speed" to adjust the rate
at which mouse movement can zoom the canvas, ranging from 25% to 300%
of the base rate and applying to both drag-to-zoom modes.
This option can be found in the preferences dialog as:
  Image Windows -> Zoom & Resize Behavior -> Drag-to-zoom speed
2022-04-05 12:31:11 +00:00
woob
4cffd91af4 app: Halve the rate of distance-based drag-to-zoom scaling
Reduces the rate from +/- 1% of the current scale per pixel, to 0.5% to
allow for more fine control while zooming.
2022-04-05 12:31:11 +00:00
woob
505a78e715 app: Add option to re-enable previous drag-to-zoom behavior
Adds a new configuration option "drag-zoom-mode" to choose whether to
zoom by distance of movement (newly added) or by duration of movement
(previous behavior) when zooming via dragging the mouse, defaulting to
distance.
This option can be found in the preferences dialog as:
  Image Windows -> Zoom & Resize Behavior -> Drag-to-zoom behavior
2022-04-05 12:31:11 +00:00
woob
8b1025919f app: Smoother zooming while dragging with the mouse
Changes the behavior of gimp_display_shell_scale_drag() to factor in 
the distance dragged, rather than just scaling a flat +/- 10% for each 
detected movement event. The factor by which to change the scaling is 
also altered from 10% at each movement event, to 1% compounded for 
each pixel of distance dragged.  
This makes zooming via Ctrl + Middle Click or Ctrl + Spacebar behave 
more consistently and less jittery versus the previous method, while 
offering more fine grained control.
2022-04-05 12:31:11 +00:00
Jacob Boerema
cadf485299 libgimpbase: fix #8025 Slow loading of XCF files...
with many Xmp.photoshop.DocumentAncestors tags

This is similar to #7464, but in this case the XMP metadata was already
included in an XCF image.

We check for the occurrence of Xmp.photoshop.DocumentAncestors and stop
handling values when there are more than a 1000.

It would be easier to just check length for all tags and always
ignore when there are more than a 1000 values.
But in that case we would need to be sure there are no valid reasons for
tags to occur more than a 1000 times. So let's just limit it to this
specific tag.
2022-04-04 16:52:10 -04:00
Ondřej Míchal
6e87466b6b Update dependencies
- cairo 1.17.4 -> 1.17.6
- graphviz 2.50.0 -> 3.0.0
- lcms 2.12 -> 2.13.1
- OpenBLAS 0.3.19 -> 0.3.20
- openexr 2.5.7 -> 2.5.8
- poppler 22.01.0 -> 22.03.0
- SuiteSparse 5.10.1 -> 5.11.0
2022-04-02 18:48:31 +00:00
Ondřej Míchal
54f7f695f3 Replace C-style comments with JSON keys ignored by Flatpak
JSON does not support comments and their support in Flatpak is possible
through use of json-glib[0]. This is problematic in fully utilizing
flatpak-external-data-checker because its JSON writer does not respect
existing comments. To solve this, make use of Fltpak's specific
behaviour where a "//" key is explicitely ignored while parsing[1].

[0] flatpak/flatpak-builder#363 (comment)
[1] 0e98b7ae19/src/builder-utils.c (L1250)
2022-04-02 18:48:31 +00:00
Ondřej Míchal
baaba0e0d1 Add version constraints for OpenEXR and mypaint-brushes
OpenEXR and mypaint-brushes offer next major versions. GIMP is probably
not ready for the changes in OpenEXR and mypaint-brushes are not yet
finalized. Put their versions under constraints so that automatic PR
creation for dependency bumps can be enabled.
2022-04-02 18:48:31 +00:00
Nathan Follens
6999b04525 Update Dutch translation 2022-04-02 18:35:23 +00:00
Jehan
aab8218602 NEWS: update. 2022-04-02 17:27:54 +02:00
Jehan
649687b48b Revert "build: do not build file-mng for 32-bit Windows."
This reverts commit 6ae69f5e84.

Our 32-bit file-mng build has been fixed normally now. I should have
removed this commit before merging!
2022-04-02 17:27:04 +02:00
Claude Paroz
b8156fdf2b Update French translation 2022-04-02 14:04:37 +00:00
Claude Paroz
69e81e3940 Merged French translations from gimp-2-10 branch 2022-04-02 13:42:32 +02:00
Charles Monzat
d67c73f124 Update French translation
(cherry picked from commit 1c7e073379)
2022-04-02 10:18:29 +00:00
Axel Viala
3372dbaf38 Fix -Wdiscarded-qualifiers in gimp_tool_button_update.
[2207/2321] Compiling C object app/widgets/libappwidgets.a.p/gimptoolbutton.c.o
../app/widgets/gimptoolbutton.c: In function ‘gimp_tool_button_update’:
../app/widgets/gimptoolbutton.c:905:19: warning: initialization discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
  905 |       gchar *id = gimp_object_get_name (tool_info);
      |                   ^~~~~~~~~~~~~~~~~~~~
2022-04-01 18:17:12 +00:00
Jehan
2cfe18fcf7 meson: not discouraged anymore on Windows. 2022-04-01 20:02:46 +02:00
Jehan
588d11dc5c INSTALL: update with new recommendation of meson for Windows. 2022-04-01 18:11:55 +02:00
Jehan
b83450f9e2 configure, meson: the build tool depends on very old glib.
For the build tool, we really don't need a recent GLib. Checking the few
function docs, GLib 2.2 is fine, which (looking at git logs) means any
version after 2002. At this point, it's nearly unneeded to add a minimum
required version, but let's be thorough.

Anyway really no need to block a build if we have an old build GLib,
which is completely enough, as long we have the recent host GLib.
2022-04-01 18:11:55 +02:00
Jehan
1c730ce141 meson, plug-ins: further fix the no-pkg-config test for libmng.
As suggested by jeremyd2019 and Biswa96 of MSYS2 project, defining the
MNG_USE_DLL macro would trigger libmng header code to fix the calling
convention. This way, even the old detection code now works with Windows
32-bit.

The reason why we still stick to this old detection code is that the
pkg-config is likely not everywhere (e.g. in Debian package libmng-dev,
there is no `.pc` file). So the pkg-config test is good but we still
definitely need to keep our fallback more old-school test for this
dependency.

See this comment in particular:
https://github.com/msys2/MINGW-packages/issues/11136#issuecomment-1084627263

Note: I am unsure yet how to apply the same trick on the autotools test
because AC_CHECK_LIB() would allow us to tweak the cflags to define a
macro, but we also need to include libmng.h header, otherwise the
calling convention tweak is not run. It doesn't look to be feasible with
the autoconf macro, or at least I haven't found how yet.
2022-04-01 18:11:55 +02:00
Jehan
9242cbdb66 libgimp: fix linking in autotools when cross-compiling.
It was working for native Linux and Windows builds, but not when
cross-compiling for Windows.
2022-04-01 18:11:55 +02:00
Jehan
1866b4c5f8 configure, tools: colorsvg2png must be built as native build executable. 2022-04-01 18:11:55 +02:00
Jehan
e866cb7c9c configure, libgimp: disable GIR build when cross-compiling and…
… add --enable-force-gir-cross-compilation to force it anyway.

Similar to what we already have in the meson build.
2022-04-01 17:33:38 +02:00
Jehan
8a6613bf78 configure: prioritize pkg-config check for libmng.
Make the code similar to the change we made in meson: first pkg-config,
then a basic library check with actual function test.
2022-04-01 17:33:38 +02:00
Jehan
c9a34b88a6 meson: fix libmng test.
The main problem was that file-mng would fail to build on Windows 32-bit
even though the lib was detected. Actually this is because there are
several possible calling conventions and this can be handled by defining
the proper macro. This macro is well defined in the pkg-config file, but
our build was not using it.

So let's change the test to use pkg-config first. If this fails, we
fallback to more basic method of finding the library. Additionally we
augment this fallback test with a function check (as we do already in
autotools) so that our configure test is reliable: we verify that the
lib is there **and** that symbols are visible. Otherwise we'd end up
with a successful configure test followed by a broken build (as until
now in meson).

See the nice explanation here and in next messages:
https://github.com/msys2/MINGW-packages/issues/11136#issuecomment-1083711452
2022-04-01 17:33:38 +02:00
Jehan
fbb484c56b build: no need to build the reference API for the Windows build.
It looks like the gi-docgen build is broken on Windows (though the CI
does show neither stdout nor stderr output, just a failure without
message). This should be fixed, but it's not necessary for the installer
at least.

Note: on autotools, the gi-docgen step works fine on Windows.
2022-04-01 17:33:38 +02:00
Jehan
6ae69f5e84 build: do not build file-mng for 32-bit Windows.
We didn't need to do this on the autotools build, simply because the
configure step is much more elaborated there, and was checking for the
header file as well as well as a working mng_create() API. But since
libmng was broken, the test failed, so we didn't need to disable it.

By the way, we should check when the `.pc` file was added, because if it
was after the required version, then the meson test is very wrong. It
should not have been different from the autotools file.
2022-04-01 17:33:38 +02:00
Jehan
5703b89735 modules: fix one more broken meson rule for directx on Windows.
Fixes:

> ../modules/meson.build:87:2: ERROR: '-lrpcrt4' is not a target.
2022-04-01 17:33:38 +02:00
Jehan
b27dd3ddaa meson: fix broken directx declare_dependency().
The `link_with` arg only accept library targets which are the libraries
we build ourselves, whereas dependency objects (such as returned by
cc.find_library()) must be in the `dependencies` arg.

Yes me too, making a difference here kind of stun me a bit and I don't
get why it's needed, but so be it. Since this code dates back from the
original commit, I assume it means the directx option just never worked
with meson on Windows.

Fixes:

> ../meson.build:847:2: ERROR: Entries in "link_with" may only be self-built targets,
> external dependencies (including libraries) must go to "dependencies".
2022-04-01 17:33:38 +02:00
Jehan
354b0c22d8 build: let's now build the Windows installer with meson.
The meson build still has a bunch of issues and build bugs compared to
the autotools build, nevertheless the last blocker issue was dealt with
a few days ago (PDB source generation).

Moreover since the meson build on Windows especially makes such dramatic
difference, in terms of build speed, this is a big improvement for
Windows contributor's comfort, and as such is one less barrier of entry.
Anyway I believe that most Windows developers build GIMP with meson now
so sticking on autotools on this platform is just counter-productive.

This is why it was decided to now make meson the recommended build
system on Windows, as a further step toward a move to meson. It is still
not the recommended build system on the other platforms yet.
2022-04-01 17:27:02 +02:00
Bartłomiej Piotrowski
a86040b176 gitlab-ci: Set container explicitly to docker
Since the latest release of Kaniko, it fails to detect the container
runtime it runs within.
2022-04-01 14:43:33 +02:00
Jehan
1349168d77 build: remove aalib patches.
These are now directly used in the MSYS2 package. No need to keep them
in the source tree anymore.
2022-03-30 22:13:40 +02:00
Nikc
14fd817b24 Fixes issues with fade-out breaking the script
(cherry picked from commit 09eccc9989)
2022-03-30 20:53:06 +02:00
Nikc
1de60726f4 pdb: Updating the parameter range for brightness
(cherry picked from commit fc5dfa1f75)
2022-03-30 20:52:24 +02:00
GokhanKabar
ed2d1244da app: warning fix (MR !607).
This fixes the following warnings:

```
[2153/2321] Compiling C object app/widgets/libappwidgets.a.p/gimppanedbox.c.o
../app/widgets/gimppanedbox.c: In function ‘gimp_paned_box_dispose’:
../app/widgets/gimppanedbox.c:171:17: warning: comparison of integer expressions of different signedness: ‘gint’ {aka ‘int’} and ‘long unsigned int’ [-Wsign-compare]
  171 |   for (i = 0; i < G_N_ELEMENTS (paned_box->p->dnd_highlights); i++)
      |                 ^
../app/widgets/gimppanedbox.c: In function ‘gimp_paned_box_drop_indicator_draw’:
../app/widgets/gimppanedbox.c:370:17: warning: comparison of integer expressions of different signedness: ‘gint’ {aka ‘int’} and ‘long unsigned int’ [-Wsign-compare]
  370 |   for (i = 0; i < G_N_ELEMENTS (paned_box->p->dnd_highlights); i++)
      |                 ^
```
2022-03-30 18:05:25 +00:00
Jehan
15f98a30ef build: add ability to run dll_link with debug.
The --debug option so far would only output debug info. I want both the
run to actually occur and the debug to be printed, at least in some
cases. So I make this a choice option with 3 variants (no debug, debug
only and run + debug).
2022-03-30 18:03:15 +02:00
Jehan
a97e437efa build: install aalib from MSYS2 where it's now made available.
https://github.com/msys2/MINGW-packages/issues/11115
2022-03-30 17:58:42 +02:00
Hugo Carvalho
0549bcc38e Update Portuguese translation 2022-03-30 12:58:59 +00:00
Rodrigo Lledó
7a3b33f3c3 Update Spanish translation 2022-03-30 11:54:27 +00:00
Jordi Mas
a90cdb58be Update Catalan translation 2022-03-30 11:59:45 +02:00
Hugo Carvalho
51b1d297d1 Update Portuguese translation 2022-03-29 22:30:35 +00:00
Anders Jonsson
2b1de17969 Update Swedish translation 2022-03-29 19:46:43 +00:00
Axel Viala
0098422425 Fix warn -Warray-parameter gflare_read_gradient_name gflare_write_gradient_name 2022-03-29 16:33:58 +00:00
Axel Viala
f0c8adc505 Fix warning in jigsaw.c -Warray-parameter
warning: argument 6 of type ‘gint[2]’ {aka ‘int[2]’} with mismatched bound [-Warray-parameter=]
 1629 |                          gint      py[2],
      |                          ~~~~~~~~~~^~~~~
2022-03-29 16:33:58 +00:00
Nathan Follens
e1a3895974 Update Dutch translation 2022-03-29 16:00:56 +00:00
Hannie Dumoleyn
57a9d07b1b Update Dutch translation 2022-03-29 15:44:42 +00:00
Nathan Follens
e17933d571 Update Dutch translation 2022-03-29 15:42:34 +00:00
Nathan Follens
3a94826055 Update Dutch translation 2022-03-29 15:33:14 +00:00
Nathan Follens
cc849a58d5 Update Dutch translation 2022-03-29 15:30:26 +00:00
Nathan Follens
2fd78cedfb Update Dutch translation 2022-03-29 15:22:51 +00:00
Martin
84a1423069 Update Slovenian translation 2022-03-29 14:44:18 +00:00
Yuri Chornoivan
dba0997f6b Update Ukrainian translation 2022-03-29 13:19:10 +00:00
Balázs Meskó
47707ec6a7 Update Hungarian translation 2022-03-29 13:05:02 +00:00
Jehan
18d1fb61f7 desktop: update the appdata release items. 2022-03-29 14:32:05 +02:00
Jehan
ae36d20c41 configure: fix option --enable-windows-installer.
The name of the base source file changed as its format is now ini before
further transformation.
2022-03-29 00:18:31 +02:00
Jehan
4f7985025b NEWS: update. 2022-03-28 22:41:31 +02:00
Jehan
58353a940a build, extensions, po-windows-installer: update gitignore. 2022-03-28 21:46:02 +02:00
Jehan
7785f96f05 build, po-windows-installer: add ability to leave translator comments.
Similar to the change I pushed to gimp-help repository:

intltool-extract does not consider the `;` isl-syntax comments because
we tell it it is in the ini format. So let's have our source in actual
ini format (POTFILES does not like to look for translated strings in
constructed files, only from source files), then create the .isl files
from it in 3 steps (first, transform the comments in isl format; then
merge all language in a single .isl file; last generate one .isl per
language).

There were already a bunch of comments in the setup.isl.in file (though
not showing in the po files until now). I checked if they seemed
relevant, fixed some, completed others, duplicated the ones which match
several strings, etc.

(This improvement to allow comments for translators in the installer po
files was requested by Piotr Drąg on the gnome-i18n mailing list)
2022-03-28 21:42:25 +02:00
Jehan
8b5a09874f build: intltool is actually a base package, not a mingw-w64 one. 2022-03-28 20:54:05 +02:00
Jehan
32498a72d6 build: also install intltool.
Seems that many tools got moved into different packages these last few
days at MSYS2!
2022-03-28 18:02:17 +02:00
Jehan
b58c7a5c2e build: install MSYS2 autotools package.
Some tools have been moved. `aclocal` (and likely other tools, but this
was the first one making an error in the deps-win*-native CI jobs) is
now in `automake-wrapper` package, which itself is a dependency of
`autotools`.

Cf. https://github.com/msys2/MINGW-packages/issues/11114
2022-03-28 16:38:19 +02:00
Jehan
19afd8ba53 build: use https.
Not sure why this one URL was not in https.
2022-03-28 16:09:46 +02:00
Jehan
f9cf16f46f Issue #4201: meson: pdbgen not working.
Fix the dependency by making the stamp an actual (yet empty/no-op)
header file which is included by all generated source file. This way, we
ensure that meson rebuild .o files when the .pdb sources are changed.

This is the second solution proposed by eli-schwartz here:
https://github.com/mesonbuild/meson/issues/10196#issuecomment-1080053413
2022-03-28 15:25:23 +02:00
Jehan
10afff9319 pdb: remove weird confusing comment.
This was introducted in commit 65eff6f150, i.e. together with the
initial port. I have no idea why this is here and if it is about the
stamp-pdbgen, why would we want to remove it. The PDB is a major piece
of our codebase and the simplicity to generate new PDB procedures is a
core feature.
2022-03-28 00:00:18 +02:00
Jehan
79615541d9 Issue #4291: meson: pdbgen not working.
The build now successfully build the PDB files into the source folder
itself. Unfortunately it seems I can't get meson dependencies to work
properly, once more! I added a "sources" argument to the relevant
library() or static_library() but it still uses old versions to build
these. E.g. if I add an error on purpose to a pdb file, the next build
still passes, yet the second-next fails (as it should have before).

Note that I even tested a declare_dependency() with just the "sources"
arguments, because it says "sources to add to targets (or generated
header files that should be built before sources including them are
built)" (so I assume it means that it should be trigger a rebuild,
otherwise it's useless) but it's just not working. I'll investigate
more.

Still going with this for now, because at least generating the PDB
source was a big miss until now. But we should
2022-03-27 22:18:44 +02:00
Jehan
288a5f1c7e devel-docs: port g-ir-doc-tool hack-fix to autotools build.
I completely forgot to port the hack from commit 7123b6c466 to
autotools as well!
2022-03-27 17:26:35 +02:00
Jehan
c302d2d52a gitlab-ci: new job for dev docs.
Instead of building it on the meson, build it on the autotools build.
Also generate a new distribution job specifically for this.
2022-03-27 16:20:20 +02:00
Jehan
0225e36e9f devel-docs: add more debugging tips. 2022-03-27 15:02:10 +02:00
Jehan
3d983728b0 gitlab-ci: build the specific Python and gjs doc with g-ir-doc. 2022-03-27 15:00:08 +02:00
Jehan
7123b6c466 Issue #7685: g-ir-doc-tool produces broken XML.
To work around the issue, I just wrote a stupid sed script. Of course,
it means that if we encounter again the issue on some other docs, we'll
have to update it. In other words, it's neither robust nor a proper
long-term fix. Just a temporary hack.
See: https://gitlab.gnome.org/GNOME/gobject-introspection/-/issues/425

Also fixing this issue, I encountered another bug, this time in meson,
which changes backslashes in slashes on 'command' arguments, in a
completely uninvited manner! The only workaround to this is apparently
to call an external script, which is ridiculous for such a basic stuff.
But well… here is why I implement this with a script, instead of
directly calling sed in the meson 'command'.
See: https://github.com/mesonbuild/meson/issues/1564
2022-03-26 19:07:48 +01:00
Jehan
c799d5235e app: fix a CRITICAL when physical device axis list changes.
After some investigation, I am a bit unsure of why this happens exactly,
but I have a case that the device's axis number listed is not right and
this only becomes apparent after the stylus gets close then further from
the tablet-display. This fixes it, though I think we should look more
closely and reorganize a bit this whole part of our code, which seems
unecessarily complicated and duplicating some data already in GTK/GDK,
like the list of axis, etc. (though maybe it was necessary back when
this was first implemented before more logics got moved to GDK?)
2022-03-26 19:07:48 +01:00
Jehan
7ca324fb2d Issue #7843: Middle clicking while manipulating canvas with spacebar…
… causes failed assertion.
2022-03-25 23:04:18 +01:00
Jehan
2748dfe83c app: fix coding style for and factorize MR !269.
Fixing broken coding style and factorize the code to avoid redundant
calls, in a separate commit as the contributor hasn't responded for
nearly 2 years. Also no need to get the character count as -1 offset is
equivalent to point after last character (or alternatively we could have
used gtk_text_buffer_get_end_iter()).

I had raised some more questions on a possible better implementation (or
maybe not), but since the discussion never happened, let's just push
as-is. It still improves things and the whole text editor should be
revamped some day anyway.

The MR commit (i.e. previous commit) fixes the specific case when
changing font size with no text selected (changing the size of the whole
text).
2022-03-25 22:09:10 +01:00
houda
2c3e62d926 Allow editing text size when using the editor window 2022-03-25 22:09:10 +01:00
lloyd konneker
dd828f94cc Fix #6839 by deleting call to gimp-context-set-transform-recursion 2022-03-25 18:05:26 +00:00
Jehan
7c3122e55b Issue #8010: Help button in File Open dialog closes dialog and opens…
… main help page.

Also fixed for save and export dialogs.
2022-03-25 15:51:50 +01:00
Jehan
784f166815 plug-ins: clean up the patch !519 as per review.
Some coding style fixes, also one warning fix, and a lot of shuffling
around to reorganize the code. Basically removing the prototype listing
at the file start is a big error. This file is huge and without a
minimum of organization, it's a huge mess to understand what's what.

Basically a class file must always start by the class_init(), then the
init(), then the various object methods (constructed() or finalize() if
any, etc.), and possibly other parent classes' implementations. These
are the entry points, it's normal to start here (not from leaf
functions!).
Then we get the public functions which are other entry points (calls
from other parts of the code). And only after, private functions such as
signal or action callbacks, and utilities at the very end.

This requires a well organized prototype listing, which works as a menu,
and prevents the implementation order to depend on call order (this gets
us completely random order and imply usually that top functions are the
less important ones, such as utilities, just how it was before this
commit).

Anyway I'm not sure why I spent time on this because we deprecated this
plug-in, but if we still want to push nice updates (like MR !519), we
should at least do it well and clean. Also it's a good first example for
plug-in rewrite in modern no-GtkAction code.
2022-03-25 14:55:25 +01:00
Niels De Graef
dddb23c6e5 help-browser: Rewrite without GtkAction
The initial attempt of this commit was to remove the `GtkAction` usage,
but grew a bit wider than that. The following happened:

* The dialog became a proper GObject, rather than being a big chunk of
  static variables that were hopefully initialized before you used them.
* The dialog now uses `GAction`s to implement actions, and converted
  some signal handlers to actions as well.
* The plug-in run procedure now uses `GtkApplication`. This is one hand
  necessary to be able to set accelerators for actions, but on the other
  hand is more future-proof, as GTK4 removes `gtk_main()`
2022-03-25 11:49:39 +00:00
Jehan
83434f7223 Issue #8005: GIMP depends on gvfs, but it is not listed in INSTALL.in.
It's not a direct dependency and doesn't prevent GIMP from any of its
core logics, but HTTP is a used enough format nowadays that we want to
consider it as mandatory nowadays.

From what I know, `gvfs` might be for Windows only though. This would
explain issues we have with remote URL on other platforms.
2022-03-24 23:49:06 +01:00
Jehan
42a5326545 Issue #6886: fix loading PNG images with linear profile or gAMA chunk.
Our main issue is that GIMP does not accept indexed images with linear
backend. MR !460 was an attempt to fix this, but some weird pixel data
conversions were happening so the result was very wrong.

We could try to investigate this and add support for linear RGB palette
colors, but it's unclear how necessary it is (i.e. is there any indexed
image format for which we'd want this? PNG is not one such format as
will be explained below), especially that palette are u8 only right now
and linear RGB u8 is not the best idea anyway.

In cases reported in #6886 though, our code would say the input is
linear mostly because it had a 1.0 gAMA chunk (or we could have a case
with a linear profile too). But then we don't need to set such data as
being in linear RGB. Just set it as non-linear RGB (R'G'B') with the
associated linear profile and that's it.
Setting a linear backend to an imported PNG would only be useful if PNG
had some flag explicitly asking for this, bypassing any profile TRC. But
as far as I can see in its spec, there is no such thing.
2022-03-24 22:31:17 +01:00
Jehan
883eded659 app: missing space in the string.
When concatenating, we get 2 words merges in one "downloadthe".
2022-03-24 21:49:27 +01:00
Jehan
9926c90055 plug-ins: always set an error domain.
The code can be 0, but not the domain. Let's use G_FILE_ERROR as all
these errors are about problematic file contents.

Fixing these warnings:

> g_error_new_valist: runtime check failed: (domain != 0)
2022-03-24 14:24:51 +01:00
Jehan
a36cfe0d96 NEWS: update. 2022-03-24 00:39:13 +01:00
sonia habtiche
3dfb3647d4 Initialize variables that are not initialized to silence warnings.
Committer's (Jehan) note: with clang version 12.0.0 on macOS Big Sur,
it seems that warnings such as the following are outputted:

> plug-ins/file-psd/psd-load.c:447:32: warning: variable 'block_len' is uninitialized when used here [-Wuninitialized]
>   block_len = GUINT32_FROM_BE (block_len);

> plug-ins/file-psd/psd-load.c:2312:34: note: initialize the variable 'comp_mode' to silence this warning
>   guint16               comp_mode;
2022-03-23 23:08:59 +00:00
Jacob Boerema
cb47a72055 Fix: unable to open online help
Recently it was not possibly in master to open online help (F1).

This is also mentioned in issue #7915. However, on macOS there are likely
also other problems, which is why I'm hesitant to close that issue with
this fix.

(help.exe:57964): LibGimpBase-CRITICAL **: 15:24:38.792:
gimp_value_array_index: assertion 'index < value_array->n_values' failed

(help.exe:57964): GLib-GObject-CRITICAL **: 15:24:38.792: g_value_get_boxed:
assertion 'G_VALUE_HOLDS_BOXED (value)' failed

This was most likely caused by 8eb7f6df9e

Changing this to use args 0 and 1 instead of 1 and 2 fixes the problem.
2022-03-23 15:40:28 -04:00
Rodrigo Lledó
f7e4470bcb Update Spanish translation 2022-03-22 19:43:18 +00:00
Rodrigo Lledó
04139a7fb3 Update Spanish translation 2022-03-22 19:37:54 +00:00
Rodrigo Lledó
ff9f1bb8b9 Update Spanish translation 2022-03-22 19:34:35 +00:00
Martin
09949c92ad Update Slovenian translation 2022-03-22 14:17:47 +00:00
Hugo Carvalho
26bb4a2ca6 Update Portuguese translation 2022-03-21 18:05:25 +00:00
Stanislav Grinkov
e19111c160 themes: Issue #2000. Make Color theme H/V chain icons...
... visually distinguishable.

Reused (with a bit of modification) Symbolic theme svg hchain/vchain
icons.
2022-03-21 23:17:35 +06:00
Yuri Chornoivan
9b68817620 Update Ukrainian translation 2022-03-21 15:27:02 +00:00
NikcDC
ba1896fd53 Issue #5648: Allow users to set the number of GIF loops 2022-03-21 14:54:57 +00:00
Jehan
2c6cde8218 build: 7 mandatory parameters in our installer bat script. 2022-03-21 15:09:05 +01:00
Balázs Meskó
906ef8b1ae Update Hungarian translation 2022-03-21 00:13:48 +00:00
Balázs Meskó
d4ab358f3b Update Hungarian translation 2022-03-20 23:47:41 +00:00
Jehan
f465209f03 gitlab-ci: build and test meson dist. 2022-03-19 14:26:57 +01:00
Jehan
4b9f7b2512 build: make clearer mandatory installer-needed macros.
Instead of replacing various needed macros with random hardcoded values,
just make them mandatory and exit with explicit error when a needed
macro is missing.
2022-03-19 13:48:37 +01:00
Jan Tojnar
e4cbfab5ae meson: Fix build from tarball
Since 2afa019c70,
the Meson configure step will fail when building from tarball (missing `.git` and `gitversion.h` is present)
because `gitversion_h` variable will contain a `list[file]` but `custom_target` does not like that in its `depends` kwarg.
2022-03-18 16:05:58 +00:00
Jan Tojnar
0c7a980bc1 meson: Fix dist script 2022-03-18 16:05:58 +00:00
Jan Tojnar
3279bb3351 tools: Use env in shebangs
Having perl and bash in /usr/bin/ is less common than having them on PATH
(e.g. Nix does not have them there).
2022-03-18 16:05:58 +00:00
Jehan
7fc963decb libgimp: fix annotations for gimp_image_metadata_save_filter().
Fixes:

> libgimp/gimpimagemetadata-save.c:541: Warning: Gimp: gimp_image_metadata_save_filter: return value: Missing (transfer) annotation
2022-03-18 16:26:18 +01:00
Jehan
db5910818a NEWS: update. 2022-03-18 15:48:12 +01:00
azetoy
b17b9b7619 libgimpbase: update deprecated functions
"gexiv2_metadata_clear_tag" && "gexiv2_metadata_try_register_xmp_namespace"
2022-03-18 14:44:54 +00:00
Jehan
1cc7510739 configure, meson: bumping GExiv2 requirement to version 0.14.0.
GExiv2 0.14.0 was released last September. It has been on Debian Testing
since October. The MSYS2 repository for Windows also provides this
version now, and I have bumped the version used in gimp-macos-build. So
let's upgrade the requirement (for the dev branch only) so that we can
finally get rid of all the remaining annoying warnings relative to this
library.
2022-03-18 15:00:59 +01:00
Matej Urbančič
7b64a2e98b Update Slovenian translation 2022-03-17 19:32:24 +00:00
Matej Urbančič
6c7110b66b Update Slovenian translation 2022-03-17 19:31:58 +00:00
Matej Urbančič
cb86e4c670 Update Slovenian translation 2022-03-17 11:39:31 +00:00
Daniel Novomeský
884611955a plug-ins: refactor metadata saving in HEIF/AVIF plugin
The plug-in now use gimp_image_metadata_save_filter API
2022-03-16 16:29:17 +01:00
Daniel Novomeský
ff87bc8d4d libgimp: new gimp_image_metadata_save_filter API
This new function is an alternative to existing
gimp_image_metadata_save_finish, when you want to save metadata
yourself and you need only filtering processing.
It returns filtered metadata allowing the caller
to save the finalized metadata via other means
(via native format’s library for example)
This API can be used to support metadata saving of image formats
not directly supported by gexiv2/exiv2.
2022-03-16 13:00:03 +00:00
Luming Zh
55f4177815 Update Chinese (China) translation 2022-03-16 12:10:33 +00:00
Luming Zh
b26bed9e90 Update Chinese (China) translation 2022-03-16 12:08:45 +00:00
Luming Zh
2446871cdf Update Chinese (China) translation 2022-03-16 11:46:29 +00:00
Anders Jonsson
b07975b5f6 Update Swedish translation 2022-03-15 20:51:52 +00:00
Anders Jonsson
f2d321e915 Update Swedish translation 2022-03-15 15:45:36 +00:00
Jehan
2d0ece6a03 clang-format: update.
I tested it against various merge requests and the more I go, the more I
wonder if it will ever be *really* useful. It detects so many false
positive of totally acceptable code. I tweak the style rules, improve
some things but then make other things worse.

Actually the logic of having one "best" case with the penalty system is
flawed IMO. We should really have rules of what is acceptable and should
not trigger changes vs. what is not acceptable styling.
For instance what such a system cannot detect is when we organize some
things on purpose, for instance for semantic reasons. If it's just "best
rule" based, it cannot work, but with an "acceptable style" logic, the
on-purpose organization of code will just pass as long as it doesn't
break the coding style.

Anyway let's see…
2022-03-14 18:16:14 +01:00
Jehan
cab09cd1a6 devel-docs: fix Coding Style document.
We now have a code formatter rule file.
2022-03-14 12:36:53 +01:00
Jehan
f13691558d app: do not feed babl with empty color palette.
Since commit 4cf38d784f, when loading an indexed image, we would first
initialize a palette with 0 colors, then set it to the right colors.
Babl outputs the following message when initializing to 0 colors:

> ../../src/babl/babl/babl-internal.h:214 babl_log()
>	attempt to create a palette with 0 colors. using default palette instead.

Let's only set the palette to Babl when it has colors.
2022-03-14 11:41:37 +01:00
Yuri Chornoivan
e7ef9be000 Update Ukrainian translation 2022-03-14 09:18:47 +00:00
Fran Dieguez
9c2a3d222c Update Galician translation 2022-03-14 08:35:36 +00:00
Fran Dieguez
831deb903a Update Galician translation 2022-03-13 23:21:22 +00:00
Hugo Carvalho
f68aebdacf Update Portuguese translation 2022-03-13 22:07:15 +00:00
Matej Urbančič
f26881375f Update Slovenian translation 2022-03-13 18:29:28 +00:00
Jehan
4cc89e2e5d NEWS, desktop: update release notes. 2022-03-13 17:40:39 +01:00
Jehan
fc063cb2ca app: use the unobtrusive cursor only in no-pointer+no-outline case.
We take a step back from the original MR which was proposing the "single
dot" cursor as a new "Pointer mode" option. I was really unsure this was
the best solution, especially reading again the whole original report.
It means that now nearly all of the original patch has been rewritten
another way, but let's leave the contributor commit as a start point to
get to where we are, and as acknowledgement of the contribution.

The reporter was annoyed by the crosshair when none were requested and
probably mostly for painting tools only (at least examples were about
brush or pencil, etc.) while showing outline. It looks to me like the
real issue was maybe when we were showing the big crosshair when using
the 4-arc fallback outline, for instance when using a dynamics changing
size. If so, this main issue is already fixed by my commit 64dc26064b.
No need of a new option for this, especially if the option can be as
confusing as a barely visible dot-cursor (I can already imagine the bug
reports of people tweaking random preferences and unhappy because the
pointer became invisible, while they don't know how they did it).

Instead I would say that when people specifically uncheck both "Show
brush outline" and "Show pointer" options, showing a huge crosshair
feels quite counter-productive. This is where I think that our small
unobtrusive cursor (probably a better name than "Single dot" by the way,
as it's not a single dot anymore) might be of use, the ultimate case
when someone really want a cursor as inconspicuous as possible, while
still having a visible feedback of the pointer position (even with
display-tablets, parallax issues make such a visual feedback important
to target where one paints).
So let's try this first and see how it goes.
2022-03-13 16:04:40 +01:00
Jehan
365478f24d app: tweak the tool pointers options in Preferences.
- Rename "Mouse Pointers" frame to just "Pointers". It's not just about
  mice but all input devices.
- Move the "Pointers" options from "Image Windows" to "Input Devices"
  tab in Preferences. It looks to me it's more about how you configure
  the device pointers than anything really image window-related.
- Move the paint tool options in their own frame "Paint Tools" to really
  differentiate the generic pointer options from the ones specific to
  paint tools. This frame is added side by side to the "Pointers" frame
  to hopefully underline they are related.

I'm still annoyed by the fact that if you uncheck both the "Show brush
outline" and the "Show pointers for paint tools", it will actually show
a big crosshair in such case. I can understand the logic (not to end up
in a case with absolutely no indication of your pointer position). But
then shouldn't we rather forbid unchecking them both at once? It would
be clearer IMO. On the other hand, are they people who like this big
crosshair and use this?

Other thing I was annoyed about was whether you would not want to have
the "Single dot" only on paint tools. But as Aryeom told me, maybe let's
just try it like this and see if people ask for a double option (pointer
on paint tools vs. pointer on other tools) as it is already very
complicated settings as it is. I mean, at some point, I even thought
about a per-device pointer. I also studied the possibility of detecting
whether you are on a display-tablet (when you are more likely to want an
unobtrusive pointer) or not (then you may be very annoyed each time you
can't even spot easily your pointer on screen). But GTK doesn't give
this later information, and as Carlos reminded me, even a display-tablet
can be mapped to another display, so even if we could detect a
display-tablet, it would not mean it is reliable information for making
a decision on whether we want a light pointer.
2022-03-13 16:04:40 +01:00
Aryeom Han
7ff2b664eb cursors: make the "single dot" cursor actually slightly bigger and B&W.
Committer (Jehan)'s note:

We know the goal is for it not to be too visible, but here it was really
hardly visible at all. Also now we can actually surround the hot spot
position.

As for the color, if the cursor is black only, it becomes extra-hard to
see on dark background images (or even totally invisible on full black
background). All cursors are drawn with B&W color on purpose.

Setting Aryeom as author, because I was trying colors on one side (then
it looked like micro-lines), or bigger checkerboard (looked weird) or
some other design where it looked like a circle in one case and a cross
in another. Aryeom proposed this much better design instead, which stays
symmetrical, small and not-weird/too widely different whatever the
background color.
2022-03-13 16:04:40 +01:00
Jehan
ba21196c48 app, cursors: add meson rules for single dot cursor mode implemented…
… in previous commit.

Also fix some coding style bugs.
Finally change s/"Single Dot"/"Single dot"/ to have the same label
syntax (only capitalize the first letter of the label) as other labels.

Cf. #7034 and !466.
2022-03-13 16:04:40 +01:00
L amander
187d2e3390 Issue #7034: Add single dot cursor mode 2022-03-13 16:04:40 +01:00
Jehan
368e1d7b8a build: add Galician to the Windows installer scripts.
Now that we have a brand new Galician translation for the Windows
installer.
2022-03-13 16:02:02 +01:00
Fran Dieguez
e73fcc5da7 Update Galician translation 2022-03-13 00:56:58 +00:00
Fran Dieguez
f6c2e71cbc Update Galician translation 2022-03-13 00:14:56 +00:00
Fran Dieguez
d857d2ce32 Add Galician translation 2022-03-12 20:58:53 +00:00
Fran Dieguez
96ce3b02f9 Update Galician translation 2022-03-12 20:39:03 +00:00
Fran Dieguez
cbed3d56ff Update Galician translation 2022-03-12 20:23:20 +00:00
Fran Dieguez
0729f70810 Update Galician translation 2022-03-12 18:39:04 +00:00
Jehan
de6e37ebb5 app: use gimp_is_restored() rather than object variables.
Since commit 4473951d4b, the function check for both initialized and
restored variables. So let's use this.
2022-03-12 18:59:36 +01:00
Jehan
f90efdf9d6 app: fix a crash in PDB "gimp-image-get-colormap".
In case we have a palette on an image which is empty, don't return a
colormap together with a size 0, just return NULL.
2022-03-12 18:55:42 +01:00
Jehan
64dc26064b app: do not draw the big handle when we have a fallback for the outline.
If someone explicitly asked not to get a pointer, yet to have the
outline, we should not force a crosshair on them while the fallback
outline is a perfectly visible mark (4 arcs around the pointer's
position, well delimiting the brush size).
2022-03-12 18:55:35 +01:00
Jehan
4473951d4b app: check if both restored and initialized flags are set to determine…
… whether the program is really ready to accept various commands.

In particular, on macOS, one could drop an image to the app icon in the
dock while starting up (visible splash). Then if the profile convert
dialog appears *behind* the splash, it would block loading until an
action is taken (unfortunately as it's hidden, people may miss it and
would think GIMP froze), as reported by cyril and reproduced by lukaso.

I can't test myself, but I'm hoping this will fix the issue (similar to
commit a86ed68870 where we had a similar issue with dbus file opening
on Linux).
2022-03-12 17:31:51 +01:00
Jehan
0ea6e9f783 app: fix brush outline when dynamics is disabled.
Since the "Dynamics Off" is set when the brushcore is started, when we
were running gimp_brush_core_eval_transform_dynamics(), we were using a
previous dynamics output.

Also it's better to shortcut the computation anyway when we know the
dynamics is not for use.
2022-03-12 16:43:53 +01:00
Simon Budig
9c96e34be2 remove the ->position entry from GimpPaletteEntry 2022-03-12 08:57:26 +00:00
Simon Budig
4cf38d784f Get rid of image->n_colors and image->colormap 2022-03-12 08:57:26 +00:00
Fran Dieguez
7f19243bd5 Update Galician translation 2022-03-12 00:20:57 +00:00
Yuri Chornoivan
8363d7a321 Update Ukrainian translation 2022-03-11 20:09:23 +00:00
Yuri Chornoivan
5bd295a180 Update Ukrainian translation 2022-03-11 20:08:02 +00:00
Hugo Carvalho
781adc2ee3 Update Portuguese translation 2022-03-11 18:45:59 +00:00
Hugo Carvalho
1b015b1c29 Update Portuguese translation 2022-03-11 18:44:52 +00:00
Jehan
e88dc5bed0 plug-ins: wrap the warning label to something smaller.
As raised on social networks, the big label grows the horizontal size of
the dialog. Make the label wrappable and give it a smaller wanted size
(otherwise, just making it wrappable is not enough and the dialog is
still too big when first appearing, because of how GTK handles such
widgets :-/).
2022-03-11 18:01:29 +01:00
Jehan
76b15eac18 plug-ins: don't set the BigTIFF checkbox insensitive on second try.
Actually I realized that using BigTIFF is not the only valid alternative
here. We can also try to use a better compression algorithm (or any if
"None" were selected) and try again to export as ClassicTIFF.

So don't check the option ourselves and don't set it insensitive. Let
one choose fully what they prefer to do.
2022-03-11 15:42:19 +01:00
Jehan
f9c68c0346 NEWS, desktop: update release notes. 2022-03-11 15:30:02 +01:00
Jehan
6e71478cd4 plug-ins: propose exporting as BigTIFF once if TIFF export fails…
… because we reached max TIFF size.

We detect the specific TIFF error (by string comparison so it's a bit
weak IMO yet it doesn't seem like libtiff provides anything better;
let's trust they don't change their error strings), then we reopen the
export dialog, pre-checking the BigTIFF checkbox newly created (and
making it insensitive). We still fail with error if an error happens the
second time (even for the same error).
2022-03-11 15:18:39 +01:00
Jehan
871796a126 Issue #7956: Add full BigTiff open/export support to GIMP.
Recent libtiff supports loading BigTiff automatically so we didn't have
anything to do there (as long as a recent libtiff was used). For
creating a BigTIFF though, we simply needed to add a "8" flag to
TIFFOpen/TIFFClientOpen when creating a new image (i.e. using "w8"
mode) as explained here in the "Implementation Strategy" section:
http://www.simplesystems.org/libtiff/BigTIFFProposal.html

What this commit does:

- Explicitly bump our libtiff requirement to version 4.0.0 or higher
  (which is where BigTiff support appeared).
  libtiff 4.0.0 was apparently released on 2011-12-22 and is available
  on all current distributions, so it's probably not a problem.
- Switch to detect libtiff with a pkg-config test (added in libtiff
  commit faf5f3eb before 4.0.0 release, so it's fine) instead of
  function checks.
  (Note: meson was already detecting for libtiff-4 with pkg-config,
  which was obviously wrong since it should have mimicked autotools, but
  well… then changes were minimal on meson)
- Add a new "bigtiff" boolean argument to the "file-tiff-save" PDB
  procedure, FALSE by default. I set this as the first argument as I
  figure that choosing the format you want is quite a major choice.
  Unless I misunderstood something, since BigTIFF is really designed to
  be an evolution of TIFF with a "minimum change strategy", i.e. mostly
  using 64-bit instead of 32-bit offsets, everything which is possible
  in TIFF will be in BigTIFF (and oppositely as well, except of course
  having huge files) so there is no need to have 2 separate procedures.
- Adding this new argument to the GUI dialog as a checkbox.
- Tweak the load and export procedures' documentation strings to make
  clear we support both TIFF and BigTIFF.
  Note: interestingly there doesn't seem to be a separate mimetype for
  BigTIFF so nothing to update on this side.
- Tweak the procedure labels too to mention BigTIFF. Since BigTIFF is
  still a different format (though very closely resembling) from TIFF,
  unlike some others which are just extensions embedded in a TIFF file
  (like GeoTIFF we recently added), I figure it deserves to be
  explicitly cited.
2022-03-11 11:31:53 +01:00
Jehan
fc5e6e6c26 app: handle non-pixel cases to compute a reasonable max size for…
… cursor position label.

This should now resolve any weird jumping around of the cursor label,
hence the GUI. Of course, it could actually still happen when going
really off-canvas (though the max computation takes into account
reasonable off-canvas moving, which is totally possible, especially now
that we can view off-canvas so people can just work there and the GUI
should definitely not do weird stuff there as well).
2022-03-10 22:37:03 +00:00
Jehan
800539d518 app: get rid of macOS-only specific workaround code. 2022-03-10 22:37:03 +00:00
Jehan
3c11b4fd21 app: avoid jumping of label.
This issue was not confirmed to happen on Linux and Windows, but was
making ugly label resizes on macOS by just moving the cursor on canvas
normally. See video in:
https://gitlab.gnome.org/GNOME/gimp/-/merge_requests/572#note_1389445

Ironically enough though, it started to happen even on Linux/X11, at
least, after commit 1baeffc913, which was the commit meant to fix this
on macOS!

This max size computation algorithm should work well enough for any
normal on-canvas usage, and even some off-canvas (yet close enough)
usage.

Note: this code only takes into account the pixel position case, for a
first implementation, which is why it's not pushed immediately in this
form.
2022-03-10 22:37:03 +00:00
Balázs Meskó
2ce82fe696 Update Hungarian translation 2022-03-10 00:30:57 +00:00
Balázs Úr
52411a4a86 Update Hungarian translation 2022-03-10 00:08:37 +00:00
Balázs Úr
b95dd571f5 Update Hungarian translation 2022-03-09 23:43:07 +00:00
Balázs Úr
e3822f212c Update Hungarian translation 2022-03-09 23:40:44 +00:00
Nikc
b48286009e Issue #2509: Adding support for 'locl' in Text Tool 2022-03-09 17:53:19 +00:00
Jacob Boerema
477302fdab plug-ins: replace deprecated gexiv2 functions in metadata-viewer
Since we increased our minimum version of gexiv2 to 0.12.3, several
functions used in the metadata-viewer plug-in have been deprecated.

Replace these functions with the "try_" versions, which include an
error parameter. If this returns non NULL then we print the error
message to the console.
2022-03-09 11:30:56 -05:00
Hugo Carvalho
e5ca710205 Update Portuguese translation 2022-03-08 23:18:34 +00:00
Yuri Chornoivan
d5cf0b25bb Update Ukrainian translation 2022-03-08 19:35:24 +00:00
Jehan
25f891bfce devel-docs: update docs with info on the "release note demo" feature. 2022-03-08 17:37:58 +01:00
Jehan
d5cb5cdf1b desktop: add <release> tag for 2.99.12.
It's better to start early as these need to be translated too and are
now even visible in GIMP itself.

Note that I wrote 2.99.11 in the version attribute, but only to be able
to test this easily during development. It will have to be edited to the
right version at release.
2022-03-08 16:42:21 +01:00
Jehan
10d8765101 app, tools: pre-process release items from AppStream as well.
Since we are pre-processing anyway the AppStream metadata file (because
appstream-glib doesn't pass unknown XML attributes, cf. a previous
commit), it does feel silly now to continue loading the file at runtime
too. Let's just pre-process more data into the constructed C files, i.e.
get the introduction paragraphs and the change items too.

The only other remaining advantage of appstream-glib was that it was
handling the localization but since we also have these localized strings
in our gettext files, we can as well translate with gettext as any other
strings and it works just fine.

It will also get rid of any packaging issue, forgetting to package the
metadata file (as we had on the Windows installer, and still have on the
macOS package). Now it will just always work because data is internal.
2022-03-08 16:32:58 +01:00
Jehan
0593980864 libgimpwidgets: missing API in the def file. 2022-03-07 18:03:56 +01:00
Hugo Carvalho
091b958d11 Update Portuguese translation 2022-03-07 14:44:23 +00:00
Yuri Chornoivan
17474d0ba3 Update Ukrainian translation 2022-03-07 12:50:12 +00:00
Jehan
adc03deb3a app: clearer release note tours.
The changes include:

* A popover will be displayed on tool buttons and relevant property
  widgets.
* Now the welcome dialog gives focus up to its parent window because
  really the whole focus styling issue in GTK is a bit maddening. The
  colors are all faded, the popover widgets are barely visible, and so
  on.
* Timing is tweaked a bit to give more time reading the popover tips.
2022-03-07 13:25:39 +01:00
Hugo Carvalho
8f57b92725 Update Portuguese translation 2022-03-06 21:55:40 +00:00
Jehan
d4ae533080 app: pack all line art settings in a single box.
It's still the same visually but it will be useful for 2 reasons: first,
it makes nicer code to show/hide only this one box instead of 3 frames;
second it will be used for the release note demo feature so that we can
blink the full line art settings box.
2022-03-06 19:30:31 +01:00
Jehan
622d0da43e app, libgimpwidgets: allowing changing a dockable settings value while…
… blinking it.

This will be necessary to demo new features available only in some
situations. E.g. a new option in line art detection mode of bucket fill
would require said mode to be enabled.
2022-03-06 19:30:31 +01:00
Yuri Chornoivan
dbe28aa6f7 Update Ukrainian translation 2022-03-06 14:43:53 +00:00
Jehan
4dc41f1aaf app: make demo scripting even simpler/cleaner.
First I strip now every pieces of text. What it allows it to span the
script elements for instance on several lines, indent them and all that.

The second thing is that since all the dockable start with "gimp-", we
may as well allow use shorter names (both are allowed). Same for tool
(which we special-case), all the tool buttons ID start with "tools-"
since we reused the action names. So let's just allow the shorter
versions.

Finally I create a new gimp_blink_toolbox() which is a specialized
gimp_blink_dockable() for the toolbox in particular. I also move there
the whole code about selecting the right tool.
2022-03-06 13:47:32 +01:00
Yuri Chornoivan
9c97ff750b Update Ukrainian translation 2022-03-06 12:34:20 +00:00
Jehan
3a6965d519 app: improve discoverability of release item demos.
Make a different bullet points for items with demos and items without,
and add an info text explaining you can click on items with the right
bullet point to get a demo.
2022-03-06 13:14:07 +01:00
Jehan
eb871a12e7 app: make welcome-dialog-data.[ch] deps relative to $(top_srcdir).
Hopefully it will fix the following CI errors:

> make[4]: *** No rule to make target '../../tools/generate-welcome-dialog-data.py', needed by 'welcome-dialog-data.h'.  Stop.

I thought using relative paths was fine too here, but I might have been
wrong (even though it worked locally).
2022-03-06 11:53:14 +01:00
Jehan
60b67ec204 libgimpwidgets: fix the def file.
The gimp_widget_set_identifier() doesn't really need to be there since
we don't install the gimpwidgets-private.h header. But I guess it makes
sense that we still need to add it for our internal use at least.

This should fix the CI.
2022-03-06 00:37:36 +01:00
Jehan
4942a9caf3 app: add a bold dot in front of each release note item.
Even when using a GtkListBox, it's just prettier and clearer when having
a text list with dots IMO, especially since some text might wrap on
several lines. Let's just go with that.
2022-03-06 00:29:28 +01:00
Jehan
3904c40dc1 app, tools: allow creating demo "scenarios" from the AppStream metadata.
The idea is to add some "demo" attribute to a list item inside the
<release> tag, since we already decided that (for now at least) we'd
keep a strict "intro + list" logics, as we did until now.

This demo attribute uses an internal format to specify successive
widgets to blink (like a demo path towards a feature). For now, what it
allows is:

* raise the toolbox, select a tool and blink the tool button.
* raise a dockable, blink any widgets in there.

Now it is still limited and needs to evolve. In particular:

* What happens if the blinked tool button was explicitly removed from
  Preferences? Should we re-add it for the demo? And once done, should
  we remove it again? Then should we select back the tool previously
  selected?
* What happens if the dockable widget is not visible? Should we allow
  changing the settings to be able to demo correctly the new/changed
  settings? Should it be temporary? If temporary, it can be annoying as
  you'd still have to look attentively the demo to find back the path to
  the new settings. If not temporary, some people may dislike we touch
  their settings.
* What if docks are hidden? Should we unhide them, then hide them back
  after demo time?

Also regarding the implementation: originally I wanted to just grab the
demo attribute directly from the AppStream metadata file, but I realized
that appstream-glib cleans out unknown attribute from the XML. I could
then simply parse the file with a generic XML parser, but I found
simpler to pre-parse it into a header built within GIMP. I still use
appstream-glib at runtime as it takes care of localization for us
(though in the same time, we also have the localization in the main po
files, so maybe we could just embed the release note strings as well).

See appstream-glib report: https://github.com/hughsie/appstream-glib/issues/431
2022-03-05 23:39:14 +01:00
Jehan
d848c86cd8 app: allow gimp_blink_dockable() with a NULL widget identifier.
It can be used this way simply to raise and blink a dockable.
2022-03-05 22:59:55 +01:00
Jehan
93021b19e1 app, libgimpwidgets: create private gimp_widget_set_identifier() API.
I add it in libgimpwidgets because we need to also use it on propwidgets
created from there, but it's actually only for core GUI usage, so it's
actually in a private part of the library.

Though it's actually doing quite a basic thing, it is nicer and more
foolproof than a manual g_object_set*() everywhere. Moreover it will be
nicer to grep.
2022-03-05 22:51:35 +01:00
Jehan
60a9c90074 app: create a concept of "blink scenario" to blink several widget in…
… a given order, not at the same time.

This will be used for the release item notifications to show people
where new or changed features are, but in an ordered blink scenario. For
instance: select a tool first, then blink some tool icon, open the tool
options and finally blink the specific new/changed option. I am hoping
it would help awareness of changes (just words on a web news may make
some features a bit foreign when not used to look in details in advanced
options).
2022-03-05 17:42:54 +01:00
Jehan
1984ebf716 app: fix gimp_single_window_strategy_show_dockable_dialog()…
… in specific case when there is already a toolbox.

Even if there is already a toolbox in single window mode (hence it needs
neither to be created nor raised, as there is a single window), we still
want to return the dockable widget which can be used for other things.
2022-03-05 17:42:54 +01:00
Jehan
5dcc833398 app: move gimp_tools_blink_widget() as gimp_blink_dockable() in…
… gimpwidgets-utils.h.

It just makes more sense, even in terms of #include-s which we'd need to
make.
2022-03-05 17:42:54 +01:00
Jehan
3011795407 app: display the release notes as a GtkListBox instead of text.
What it means is that we will be a bit strict over our <release>
formatting which will have to always be a <p> introduction followed by a
list of items. This is what gimp_appstream_to_pango_markups() expects.

Since so far, this is how all our <release> tags were formatted anyway,
this is not too much of a problem.

Note that I keep the less strict gimp_appstream_to_pango_markup() and
use it for extension's appstream description as we will have no control
over these.

The main reason for this new rule and new display of our release notes
is that I am going to add the ability to click independent release items
so that people can get "blinking" indications of what changed when
relevant.
2022-03-05 17:42:54 +01:00
Hugo Carvalho
83a3130688 Update Portuguese translation 2022-03-04 22:10:26 +00:00
Jehan
9d3199f14e app: fix gimp_appstream_to_pango_markup().
The newline was added in the wrong place in some cases.
2022-03-04 18:48:42 +01:00
Jehan
dac452f3a2 app: grab focus before blinking a dockable widget.
It should help with scrolling the dockable to make the widget visible,
as I don't see a generic and simple scrolling API for GTK scrollable
containers.
In my own testing, it did work if the dockable was already opened. But
if it was just created by the blink API, then giving focus immediately
doesn't properly scroll. I am not really going to investigate now, but
this should be fixed eventually.
2022-03-04 18:25:47 +01:00
Jehan
3e256451e4 libgimpconfig: fix small typo. 2022-03-04 16:09:09 +01:00
Jehan
e1c3e7d85b app: use new gimp_tools_blink_widget() to blink source scrolldown.
When the bucket fill can't work because the line art source is not
right, let's blink the associated settings for people to know where to
look at.
2022-03-04 15:41:53 +01:00
Jehan
71a2c83a94 app, libgimpwigets: new internal util function gimp_tools_blink_widget()
This function will help us raise attention to various widgets in
dockables by blinking them similarly to how we blink locks or visibility
icons.

I associate this with the fact that property widgets identifier will be
the property name, so we get identifiers for free when creating widgets
through the propwidgets API.
2022-03-04 15:41:02 +01:00
Yuri Chornoivan
ff15dc2a2b Update Ukrainian translation 2022-03-04 14:18:49 +00:00
Jehan
4a6b2e9fbb app: change "Detect opacity" checkbox sensitivity and tooltip depending…
… on the line art source.
Also now the default tooltip itself will be more appropriate rather than
reusing the "fill-transparent" property blurb (maybe I should have made
this its own property in fact).
2022-03-04 14:30:46 +01:00
Hugo Carvalho
e03d3d9a20 Update Portuguese translation 2022-03-04 10:40:55 +00:00
Yuri Chornoivan
81c60c1113 Update Ukrainian translation 2022-03-04 10:00:35 +00:00
Daniel Novomeský
e519e1a02c build: use libjxl package from MSYS2 2022-03-03 19:55:30 +00:00
Jehan
d3686fdb9c app: make the "Automatic closure" a settings of its own.
This is the same thing as setting the max gap length to 0, except that
it would mean constantly having to play with the gap length and possibly
losing settings you carefully tweaked. Instead with this additional
settings, we hide the gap length settings when automatic closure is
disabled.

Also it makes kind of a nice parallel with the "Manual closure" settings
which can also be enabled/disabled similarly.
2022-03-03 20:05:14 +01:00
Jehan
deb5dfcbf6 NEWS: kick start the NEWS for GIMP 2.99.12. 2022-03-03 18:52:35 +01:00
Jehan
08c3bb407b app: source tools should not be choosable for bucket fill stroke.
Since we can't select a source, the source tools would fail stroking
with an error. It was usable when stroking a path or selection as we
can have the source tool started while running these. Since only one
tool can be started at once, this is not possible when running bucket
fill tool (it would require some logics change on tools).

This change has 2 parts: add an "insensitive" column to
GimpContainerComboBox (allowing to mark some cells as insensitive), then
use this new attribute in the GimpBucketFillOptions to show all source
tools as insensitive.
2022-03-03 18:44:03 +01:00
Jehan
46d2d19724 app: new manual closure option can't work with pattern fill. 2022-03-03 18:44:03 +01:00
Jehan
ab8e7b6358 app: allowing to choose the paint tool used for stroking. 2022-03-03 18:44:03 +01:00
Jehan
2eb6787f55 app: apply feather before stroking.
The feather on stroked border is clearly not ideal (though I wonder if
there are cases where it's wanted). Let's do it the other way around.
2022-03-03 18:44:03 +01:00
Jehan
b896b337e2 app: a first step trying to tidying up the line art bucket fill options.
There are clearly 3 types of settings:
1. How the line art is detected.
2. How do we additionally close line art.
3. How to handle fill borders.

Additionally I am rewording some options:
- "Allow closing lines in selected layer" -> "Manual closure in fill
  layer"
- Adding the "Maximum gap length" into an "Automatic closure" frame to
  hopefully make a parallel with the "manual" closure settings.
- "Allow completely transparent regions to be filled" -> "Detect opacity
  rather than grayscale" (only within the context of the line art bucket
  fill) because the main idea of this option is really here that we
  detect lines as being opaque pixels, rather than detecting lines are
  being dark pixels.

Finally don't hide the manual closure frame when in a configuration
where it won't be taken into account. Only make it insensitive. Having
options disappear is not so nice. Usually you want to gray them out to
have people realize they are simply not always usable.
2022-03-03 18:44:03 +01:00
Jehan
76699e89ac app: add a new feature to stroke the line art fill borders.
Currently the option is quite simple. What should happen to make it more
usable:

* Right now, it uses the last stroke options (e.g. as used in a
  previously run "Stroke Selection" or "Stroke Path"). We should have
  some dedicated GUI in the bucket fill options.
* The bucket fill options GUI should really be redesigned. The more we
  add options, the less understandable it is.
* There is a question whether we want to just use whatever brush size is
  being set or if we want to have it vary and follow the line art width
  (since we have proper distance map, we could use this to tweak the
  stroke per-coords).

As usual, this feature was suggested by Aryeom who was still very
saddened that despite all the fancy features in this tool, it is not
able to produce nice rendering. So she proposed that the tool could
stroke the fill region borders.
2022-03-03 18:44:03 +01:00
Jehan
e6722aa8b7 app: add a concept of hidden items to a GimpImage.
Many features can only be run on items belonging to an image, and in
particular attached. It makes sense, but in the same time, there are
often some types of processing you'd like to do in background on
temporary items, not visible in GUI, and without any undo steps.

You could work on buffers directly, but sometimes it's also nice to
attach the semantics of the various items, and reuse logics (in
particular class method implementations) already existing. So I am
adding a concept of "hidden items" which is where you'd put items in
some temporary processing state when you don't want them to go anywhere
visible publicly.
2022-03-03 18:44:03 +01:00
Jehan
63a530f9d1 app: don't use build-time path for the desktop datadir.
Build time directory won't work on Windows (and most likely neither on
macOS with their relocatable packages).
2022-02-28 20:57:48 +01:00
Jehan
1101c237b9 build: package the AppStream file into the Windows installer.
Now needed by the welcome dialog.
2022-02-25 21:42:19 +01:00
Jehan
a0d65b80fb AUTHORS: update.
Actually I should have committed this the last time I updated
authors.xml, but with off-tree builds, I keep forgetting such things.
2022-02-25 21:06:17 +01:00
Matej Urbančič
fedc548206 Update Slovenian translation 2022-02-25 18:44:51 +00:00
Matej Urbančič
aa007e16a1 Update Slovenian translation 2022-02-25 18:44:30 +00:00
Asier Sarasua Garmendia
cba9389bb5 Update Basque translation 2022-02-25 17:03:17 +00:00
Asier Sarasua Garmendia
4c73b4949f Update Basque translation 2022-02-25 16:51:23 +00:00
Luming Zh
ca050d4c13 Update Chinese (China) translation 2022-02-25 00:10:30 +00:00
Jehan
82af34e494 NEWS: update translations for GIMP 2.99.10.
I had forgotten to update the list. Never too late to do good!
2022-02-24 12:55:26 +01:00
Daniel Novomeský
271d6a0bd8 build: fix libjxl compilation 2022-02-24 07:34:58 +01:00
Jehan
140ce80a22 devel-docs: typo fix. 2022-02-23 22:29:03 +01:00
Jehan
eb9b936d23 app: let's also check the appstream in the legacy location as fallback.
For some reason, our flatpak is moving the appstream file elsewhere,
after installation (since all our scripts explicitly install it under
metainfo/).

So in flatpak, it is in /app/share/appdata/ (i.e. $DATADIR/appdata/).

This is not right and should not be done by the flatpak system, but
let's still verify this other location as it is legacy so it would not
be totally impossible that some distributions do something similar when
packaging GIMP.

See also: https://github.com/flatpak/flatpak/issues/4775
2022-02-23 21:23:24 +01:00
Jehan
aaafa8683d devel-docs: add some information about theming.
Hopefully useful to get some theme makers started.
2022-02-23 19:06:40 +01:00
Hugo Carvalho
a12821041e Update Portuguese translation 2022-02-23 12:03:07 +00:00
Yuri Chornoivan
eb0dd2ea52 Update Ukrainian translation 2022-02-23 07:04:14 +00:00
Alexandre Prokoudine
69167b6f4c Update Russian translation 2022-02-23 04:24:52 +03:00
Jehan
64bf8046ff configure.ac, meson.build: post-release version bump to 2.99.11. 2022-02-23 00:28:55 +01:00
Jehan
618e11e602 Release development version GIMP 2.99.10. 2022-02-22 22:30:47 +01:00
Luna Jernberg
25344cd80f Update Swedish translation 2022-02-22 20:55:06 +00:00
Jehan
526271d5c1 desktop: update release date. 2022-02-22 21:39:55 +01:00
Jehan
f32bca6bc5 app: trying a new logic for the image size of the welcome dialog.
As Jacob reports in #6445, on a big-size monitor, the dialog is just too
big, this can be seen in particular with all the space left between info
text. Trying a new logic where I simply leave the dialog to be
allocated, then once I get its size, I generate an image roughly this
same size. This should avoid overly big images.
2022-02-22 21:05:38 +01:00
Jehan
e5509ffcdb app: fix sentence and typo.
Thanks to Liam for the fix/feedback on IRC. There was a typo (s/if/it)
and some better wording proposition.
s/You can call if again/You can show it again/
2022-02-22 15:32:13 +01:00
Jehan
b4b41f7d7c NEWS: update. 2022-02-22 14:09:15 +01:00
Jehan
d31d417cf1 app: make sure the welcome dialog is centered on the GIMP main window.
If there are several windows (when loading files on startup), let's just
use the first. This avoids weird placements in some cases.
2022-02-22 13:19:06 +01:00
Jehan
1f9057d4bf app: rename "last-run-version" property by simpler "config-version".
Thinking again, this is simply the version of the config files, mapping
to the application version. Even though it's not really a user-visible
string (except in config files themselves), I find this a much more
elegant name than the ugly "last-run-version" (which is not even true
anymore once startup passed; it's only the last-run version info at very
beginning of the startup process).
2022-02-22 12:27:58 +01:00
Aryeom Han
7511c81f31 data: new "experiments" splash screen for GIMP 2.99.10. 2022-02-22 12:23:46 +01:00
Jehan
5628b9a591 app: now store the last run version in the core config.
This will be used by the update check to verify you are running a new
version since last time. In the future, it might even allow to handle
some types of config migrations if ever we update some things in-between
micro releases. Until now, we could only detect minor updates through
the config folder name (and even this was limited as the config folder
can be specified, in which case we would not even know what version the
files were for).

Maybe we could start also warning in cases of downgrading too, which can
break some configuration files (though there is not much we can do about
it other than warn as there is no time machine!).

Last point: if the new config value "last-run-version" doesn't exist, it
simply means the config folder was run for a GIMP before this point in
time/commit. So we just show the welcome dialog.
2022-02-22 12:23:46 +01:00
Jehan
62a76d7856 app: new welcome dialog to appear only at first launch after a new…
… installation or an update.
2022-02-22 12:23:46 +01:00
Øyvind Kolås
ef4e1b86a1 configure, meson, app: depend on GEGL 0.4.36 2022-02-21 23:42:06 +01:00
Matej Urbančič
45d34d31a4 Update Slovenian translation 2022-02-21 19:57:54 +00:00
Lukas Oberhuber
b0f0f46b1c gimpcursor: cursor hotspots platform specific
MacOS and Wayland need the hotspot in surface coordinates
  * X11 needs the hotspot in pixel coordinates (not scaled)
  * Windows doesn't handle scaled cursors at all
  * Broadway does not appear to support surface cursors at all,
  let alone scaled surface cursors.
https://gitlab.gnome.org/GNOME/gimp/-/merge_requests/545#note_1388777
2022-02-21 15:18:55 +00:00
Jehan
38d6783299 .gitlab-ci, build: avoid same DLL dependencies from previous runs.
We were already avoiding re-processing a same DLL within the same run
(this can happen when 2 dependencies have themselves a common
dependency). But the dll_link.py script was stateless regarding previous
runs so we might be checking again the same DLLs multiple times (even
though we were not copying them again).

Let's make the script stateful with a new parameter to give a file where
all the previously processed DLL names are stored. I am hoping it would
improve the efficiency of the packaging-win32-native which is suddenly
extra slow (it always times out, even after raising the max job time;
now we time out after 2h30! The 64-bit packaging job just takes 1h,
which is too much already, but still much more reasonable).
2022-02-21 13:36:57 +01:00
Jehan
8370dcc890 NEWS: update.
Forgot to mention the deprecation of webkitGTK based plug-ins. I think
it's a big enough deal to be in this list of changes.
2022-02-20 18:10:56 +01:00
Jehan
8b2ee06f71 app: move appstream to pango markup function to gimp-utils.h.
I'm going to reuse this code in other parts of the file so make it a
utils function.
While doing so, I'm also improving a tiny bit the formatting of lists.
2022-02-20 18:09:58 +01:00
Asier Sarasua Garmendia
2803f3330d Update Basque translation 2022-02-20 12:45:09 +00:00
Anders Jonsson
926d89508b Update Swedish translation 2022-02-20 00:28:55 +00:00
Jordi Mas
753b29a85e Update Catalan translation 2022-02-19 20:24:03 +01:00
Jehan
de44059aee build: do not search again dependencies of already done system DLLs. 2022-02-19 19:17:41 +01:00
Hugo Carvalho
3545069dee Update Portuguese translation 2022-02-19 18:13:14 +00:00
Hugo Carvalho
fce78bbea6 Update Portuguese translation 2022-02-19 17:56:42 +00:00
Jehan
70ddda8b6d authors.xml: update.
- Adding some people in "documenter" role which is a bit small section,
  despite various people improving things: Jacob (he is now gimp-help
  maintainer!), Niels (for recent documentation of API), Lloyd and
  Akkana (for helping in the devel-docs).
- Fixing "Daniel Novomeský" orthography.
- Adding Lukas Oberhuber (obviously for the recent work on macOS and
  more).
- Adding Patrick David (not sure why he was not even there already!).
  With all the work on gimp-web, tutorials and providing images, I added
  him in "artist documenter" section.
2022-02-19 16:02:48 +01:00
Jehan
a9551bbb3c app: update/fix the About's authors.xsl.
I realized the "recent-contributor" template was checking
`last-active >=2 and minor version >= 8`. Because of the second part of
this test, anyone with a last a last-active value of 3.0 was ironically
not included as recent contributors!

Meanwhile, I am bumping the definition of recent as 2.10 and over
(rather than 2.8 and over), for GIMP 3.0 release. Last thing, I am now
sorting by descending last-active (so contributors in GIMP 3.0 are shown
first).
2022-02-19 16:02:14 +01:00
Jehan
201eb46441 NEWS: update.
In particular, make the "API" section a bit less messy by organising in
sublists of changes.
2022-02-19 03:03:01 +01:00
Jehan
657911ce48 plug-ins: using a GimpSpinScale instead of a GimpScaleEntry in…
… various plug-ins.
2022-02-19 02:26:11 +01:00
Jehan
7ca4d0ca45 libgimp: new gimp_procedure_dialog_get_spin_scale() and support of…
… %GIMP_TYPE_SPIN_SCALE in gimp_procedure_dialog_get_widget().

The dedicated function is for when a plug-in wants to use a scale range
multiplied by a factor. Otherwise using the generic function is fine.
2022-02-19 02:26:11 +01:00
Lukas Oberhuber
1baeffc913 macos: Fix 7690 (slow drawing)
Gets drawing in the canvas speed on retina displays up to the speed
of FullHD displays on macOS, making 2.99 usable on macOS.

Generic change:

Changes the cursor_label to delay the drawing phase to the idle
queue, from immediate draw on all platforms.

Before the fix in 32049afd (using a deprecated function in Gtk3)
any draws on this label forced a full canvas redraw. This is due
to a quirk in how GtkLabel functions.

The redraw occurred because GtkLabels resize themselves and everything
around them by sending a resize  message any time they receive new
text. These resizes then trigger the full canvas resize which triggers
a full canvas redraw that cannot be optimized by either Gtk or Big Sur.

MacOS changes:

Only redraws the cursor position label and each of the horizontal and
vertical rules (cursor tracking widgets) 3 times a second max for a
total of 9 redraws a second (ideally out of 60, though I don't believe
under any circumstances that GIMP achieves a 60fps).

Each of the cursor tracking widgets gets its own timeslice, and so
will not redraw when the other cursor tracking widgets are drawing.

This is required because Big Sur is merging all draw rects into
one large rect, dramatically slowing down draws.

This timeslicing ensures that draw rects are maintained at the smallest
possible size. So the typical redraw is a small rect around the
brush. However, 9 times a second, the rect will include one of the
3 cursor tracking widgets (rulers and cursor label).

Additionally, the code tries to minimize resizing the width of the
cursor label by checking if the widget is too small for the text,
then setting the char_width to a greater size so that resizes won't
be that common.

This improves the appearance of the widget as it no longer
constantly jumps about in size on each cursor move.

Here is a discussion of the issue:
https://gitlab.gnome.org/GNOME/gimp/-/merge_requests/572#note_1389445

Reviewer's (Jehan) notes:

* The whole issue about GtkLabel resizing is no more after 32049afd. It 
  is normal for a widget to request a resize when needed. We just don't
  want the statusbar to resize and triggering canvas redraws.
* Changing cursor position text into an idle function generally makes
  sense.
  Also it reverts commit 6de9ea7022 which had a bug I hadn't realized
  when I accepted it: when we test for time, we don't know yet if it
  will be the last position change, hence we could "refuse" the last
  update. Therefore displayed cursor position would end up outdated
  on macOS. This new implementation doesn't have the problem (the last
  idle update always happens after the last move).
* The change about giving 1/3 timeslices to side canvas components 
  (rulers and statusbar) is a complete hack to work around the fact that
  macOs doesn't report properly each damaged rectangle. Instead it
  returns a huge bounding box. The workaround here is to expose these
  area separately.
  We have not been able to find a proper solution yet. This is the only
  reason why I accept this code, for macOS only, to at least have
  something usable there.
  See discussions in MRs gimp!572 and gimp-macos-build!86. With these 2 
  MRs, Lukas reported GIMP 2.99 to perform even better than GIMP 2.10 on
  Monterey, though it could not be tested on Big Sur unfortunately.
* Lastly the set_width_chars() thing is also an ugly hack which I will
  try later to revisit (see !581). I only accepted it (with mandatory 
  macOS-only macro) to have an acceptable state for release after seeing
  a screencast where the label size indeed "jumps around" on macOS.
2022-02-19 01:25:51 +00:00
Jehan
7056f1b960 app, libgimpwidgets: move gimp_prop_spin_scale_new() and…
… gimp_prop_widget_set_factor() to libgimpwidgets.

Now that GimpSpinScale is in libgimpwidgets, it's time to move the
associated prop too, to make it a prop widget with such a widget easily
creatable by plug-ins.

While doing so, I update both these functions logic, binding properties
together with the g_object_bind_property*() APIs (as we do already in
some other recent prop functions) rather than connecting to signals
ourselves. It makes for much simpler code.
2022-02-19 00:14:44 +01:00
Anders Jonsson
aa5a61ed5b Update Swedish translation 2022-02-18 20:27:27 +00:00
Jehan
6d117b257f build: fixing Exiv2 source URL in flatpak manifest.
The source apparently got changed to using the forge's download section.
The checksum stayed the same (as checked by myself).
2022-02-18 16:35:02 +01:00
Jehan
cf84f0e707 libgimp: fix more gi-docgen "qualifier fragment".
Now the warning is:

WARNING: Invalid fragment for 'Gimp.Config': it should be struct
It implements the [iface@Config] interface and therefore has all its
                  ^~~~~~~~~~~~~~

This warning feels wrong as we use GimpConfig for the name of the
interface, yet in the .gir file, I see `<record name="Config" …>` yet
`<interface name="ConfigInterface" …>`.
I suppose gi-docgen would want us to use [iface@ConfigInterface] if we
want to link the interface. But looking at the gir file, all interesting
interface methods are associated to the Config record. So let's just go
with the [struct@Config] proposed by the warning.
In any case, something feels wrong or broken here, but we need to fix
this for the CI. I hope Niels can look at it at some point.
2022-02-18 14:03:47 +01:00
Jehan
29f23c8f98 libgimp, libgimpconfig: fixing gi-docgen "qualifier fragments".
Fixing these 2 warnings in the CI which end up fatal:

WARNING: Invalid fragment for 'Gimp.Parasite': it should be struct
Serializes the object properties of @config to a [class@Parasite].
                                                 ^~~~~~~~~~~~~~~~
WARNING: Invalid fragment for 'GLib.MainLoop': it should be struct
it has a GUI and is hanging around in a [class@GLib.MainLoop], it must call
                                        ^~~~~~~~~~~~~~~~~~~~~
2022-02-18 12:11:01 +01:00
Jehan
6b76e3cd8d libgimpwidgets: updating .def file.
I still manage to forget this file, nearly every time!
2022-02-18 12:04:37 +01:00
Ngọc Quân Trần
3126e493b4 Update Vietnamese translation 2022-02-18 07:28:43 +00:00
Yuri Chornoivan
cf55f3f4d7 Update Ukrainian translation 2022-02-18 07:05:14 +00:00
Yuri Chornoivan
8f200ba00e Update Ukrainian translation 2022-02-18 07:02:15 +00:00
Jehan
9ce93ece00 desktop: add some AppStream release items.
These are visible enough changes (in the GUI) that they deserve to be
mentioned here.
2022-02-18 01:11:58 +01:00
Jehan
fd6bf8427e NEWS: update. 2022-02-18 01:06:26 +01:00
Anders Jonsson
f6a68b436e Update Swedish translation 2022-02-17 23:29:00 +00:00
Anders Jonsson
3f5fbe21bf Update Swedish translation 2022-02-17 23:14:43 +00:00
Jehan
b889de3ff6 app: remove early macOS optimizations which are now counter-productive.
Basically disabling commit 4f9b7373e6.
After some new patches for GTK3 I wrote, and removing the settings on
NSViewUsesAutomaticLayerBackingStores, Lukas reported that it works like
never before, faster than 2.10 even. Note that this could only be tested
on Monterey, nobody tested on Big Sur with this specific combination
yet.

In any case, we decided to remove this settings and add the new GTK3
patches.
See: https://gitlab.gnome.org/Infrastructure/gimp-macos-build/-/merge_requests/86#note_1384727
2022-02-17 23:42:57 +01:00
Jehan
97b81118aa libgimpwidgets: add a "mnemonic-widget-changed" signal to GimpLabeled.
This allows to track changes of mnemonic widgets, as we do in
GimpLabelColor when we switch from editable to non-editable (or
reverse).
2022-02-17 23:24:05 +01:00
Jehan
65077a605f plug-ins: update foggigy after changes in GimpProcedureDialog.
The default for color properties (GimpRGB) is now to be editable. So
let's remove the formerly specific call for this.

Also fixing a clashing mnemonics ('c' both for '_Color' and '_Cancel').
2022-02-17 23:13:43 +01:00
Jehan
0f36ce596a libgimp: improves the support of GimpParamRGB properties.
Now using the new GimpLabelColor as new default for RGB properties. It
makes more sense that the default is editable widgets. Also it has a
label, which is better default widget.

Also gimp_procedure_dialog_get_color_widget() now only returns
GimpLabelColor widgets.
2022-02-17 23:13:43 +01:00
Jehan
4fecdd57d8 libgimpwidgets: allow editable GimpLabelColor.
I was initially considering a second widget, but it makes actually much
more sense to make the editability a property of the GimpLabelColor. It
also mean it can be switched on or off depending on situations.
2022-02-17 23:13:42 +01:00
Jehan
1c03df05c5 libgimpwidgets: new gimp_prop_label_color_new(). 2022-02-17 23:13:42 +01:00
Jehan
d7fb0842a1 libgimpwidgets: new GimpLabelColor widget (color area with a label).
I tried to have a not too overwhelming API, so we just ask for the label
and initial color at construction. We keep sane defaults for the rest
and let people tweak the result by getting the color area widgets
themselves (if they need to force-showing flat colors or change the drag
buttons in particular).

Another thing I wondered about was the initial size of the color area.
Without a size request or being in some container expanding its
children (which may also be ugly), it ends up too small. I can imagine
such widget being used especially when you want to display several
color rectangles next to each other with a label each. So I just set it
this way. Anyone is free to request a resize after constructing the
object.

Last but not least, the position of the label was especially of interest
here. For my idea of a list of colors, I could definitely imagine color
blocks aligned with vertically-oriented labels above or below. It might
be worth adding an API for this later on.
2022-02-17 23:13:42 +01:00
Jehan
f50976d81b libgimpwidgets: new gimp_color_area_enable_drag() API.
This would allow to enable, configure or disable drag ability of a
GimpColorArea ater its creation.

I tested that it works correctly in binding. For instance in Python:

> area.enable_drag(0)
> area.enable_drag(Gdk.ModifierType.BUTTON1_MASK |
>                  Gdk.ModifierType.BUTTON2_MASK)

… correctly disable then reanable the drag with buttons 1 and 2 (in
particular, I wanted to verify there was any reason why the property was
G_PARAM_CONSTRUCT_ONLY. Turns out there was no good reason).

I was interested by such API because having long list of parameters in
various APIs is very annoying. It is much nicer to have simple
constructors with decent defaults and proper API to modify a widget
afterwards in order to cater to special needs.
2022-02-17 23:13:42 +01:00
Jehan
81692874fc Issue #7301: default GimpProcedureDialog widget for string property…
… has no label.

Now fixed with the new GimpLabelEntry created in the previous commit.
2022-02-17 23:13:42 +01:00
Jehan
9357552059 libgimpwidgets: new GimpLabelEntry widget and associated prop API…
… gimp_prop_label_entry_new().
2022-02-17 23:13:42 +01:00
Jehan
6b5037f039 libgimpwidgets, themes: more compact GimpSpinScale.
There were some complaint about the height of these scale.
The min-height was clearly too high. I also made the buttons a bit more
compact by removing a bit of padding.

Finally I add a CSS name to the class, in order to avoid using the
parent class name ("spinbutton"). This makes for clearer and more
customizable themes (ability to style the GimpSpinScale without styling
GtkSpinButton too).
2022-02-17 23:13:42 +01:00
Jehan
c93742f178 libgimpwidgets: improving (kinda) GimpSpinScale in RTL layout.
The label was simply completely invisible because of broken progress
computation. Now it is visible at least when the progress fully cover
the label, but a part of the label is not drawn when the progression is
smaller than the label. I still have not figured out how to fix this,
though I am starting to wonder if we should not just drop this 2-color
fancy drawing of the label. Clearly the fact we can't get the exact
progression gadget dimension is biting us.

Another issue I noticed when playing with RTL layout is that when
editing the value, it gets printed on the right side (together with the
label) which gets messy. This is also something to figure out, hoping we
get an API for this on the GTK side.

Also I am setting "auto dir" to FALSE on the Pango layout, making sure
it follows the widget direction, whatsoever. In particular, even if the
contents is not RTL characters, we should keep a RTL layout to avoid
completely broken layout.
2022-02-17 23:13:42 +01:00
Jehan
dfd05c0717 libgimpwidgets: improve a bit the position of progress and normal text.
The logics to get the progress position is not proper because the text
area (as returned by gtk_entry_get_text_area()) is actually slightly
smaller than the progress area. Unfortunately it doesn't look like there
is an API to get the exact progress area. This commit improves a bit the
situation by starting the progress rectangle when excluding the
intersection of 2 rectangles in pango at the start of the text area (not
at 0).

It's still not perfect as the progress width will be anyway a bit too
small and we don't have the data to compute it properly, but it's better
than it used to be. I also set several variables to double instead of
int to be more accurate, though this part doesn't help much.

Finally I used the ink extents rather than the logical extents. Since we
are here to draw, this is the ink extents which is really needed.

Note: for the bug to be visible, you need to have a different text color
for the progress and non-progress part of the scale.

Also I'm unsure about the right-to-left logics which seems very broken.
2022-02-17 23:13:42 +01:00
Jehan
ab1fc79a07 app, libgimpwidgets: move GimpSpinScale to libgimpwidgets.
There is really nothing specific to the core application, it is quite a
generic widget, so it would be nice for plug-ins to be able to use this
widget.
2022-02-17 23:13:42 +01:00
dimspingos
17528d787e Updated Greek translation 2022-02-17 10:58:37 +02:00
Bruce Cowan
19ac1f3c4f Update British English translation 2022-02-16 16:52:57 +00:00
Bruce Cowan
4adb49383b Update British English translation 2022-02-16 16:51:39 +00:00
Bruce Cowan
6d11b36a7e Update British English translation 2022-02-16 16:34:55 +00:00
Yuri Chornoivan
5e50603d3c Update Ukrainian translation 2022-02-16 07:44:43 +00:00
Jordi Mas
919101aef7 Update Catalan translation 2022-02-16 07:27:25 +01:00
Stanislav Grinkov
65fcda3b70 themes: Add a bit of padding around treeview header column icons 2022-02-16 04:07:50 +00:00
Stanislav Grinkov
50ae1d1a68 themes: issue #7303. Add on-hover indicator around...
... inactive/unset eye/locked toggles in Layer/Channels/Paths dialogs.

Resolves: #7303 (GNOME gitlab tracker)
2022-02-16 04:07:50 +00:00
Anders Jonsson
9f15da20aa Update Swedish translation
(cherry picked from commit 8bfcaaa504)
2022-02-16 01:11:17 +00:00
Jehan
27ca25f15a app: this string became singular. Fix the grammar.
Thanks to Anders Jonsson for notifying the bug.
2022-02-15 23:52:08 +01:00
Jehan
61a0d97292 devel-docs: add specifications for the various locks behavior.
As I review and tweak various aspects of GIMP UI, I also write down
specifications for these subparts. Here is one for the locks behaviors.

We worked on these specifications with Aryeom and tried to make the most
useful and also somehow obvious logics for these locks, in particular
the cases when applied to layer groups which can have wider ranges of
meaning (on leaf items, it is much simpler). The various previous
commits are implemented based on these specifications.
2022-02-15 22:52:43 +01:00
Yuri Chornoivan
2bbd128862 Update Ukrainian translation 2022-02-15 21:32:08 +00:00
Jehan
e52955bc2f NEWS: update. 2022-02-15 22:17:13 +01:00
Jehan
aa3808addf app, devel-docs: bumping the XCF version to 17.
XCF 17 includes the new visibility locks and the ability to add position
and alpha locks on layer groups.
I am going to push the various commits implementing these different
features together which is why we gather them as a single XCF version.
2022-02-15 22:08:23 +01:00
Jehan
05d226c343 app, desktop: fix the Alt-click exclusive visibility case.
We want it to work whatever the level in the item tree. We only care
about whether the items are selected or not.

Also fixing the AppStream release tag for the description of this
feature.
2022-02-15 22:08:23 +01:00
Jehan
50496b8fb1 app: update the item visibility lock logics.
Unlike other locks, visibility lock is less useful for locking a whole
hierarchy of item and their children. On the other hand, being able to
lock a group visibility while editing the children visibility is quite
useful.
2022-02-15 22:08:23 +01:00
Jehan
2e64bfc61b app: allow "Lock alpha" to be set on layer groups.
It can be argued that layer groups can't be painted on, and that's
probably the original reason, but it's really just the same as "Lock
pixels". It is interesting to be able to lock alpha channels on a layer
group to simply lock all its contents alpha channels.
2022-02-15 22:08:23 +01:00
Jehan
ed59344406 app: allowing to "Lock position" on layer groups.
Since we are now allowed to move groups (which is the same thing as
multi-selecting all its children and moving them), it makes no sense
that this lock is disabled.

This works the same way as "Lock pixels" in that a locked grouped also
forbid moving children. And there was already some logics so that you
can't move a layer group if one of it's children is locked. So this lock
really works both ways and is a bit special.

Finally I cleaned up a bit the multi-layer selection logics and
messaging, as well as which lock to blink (similar to the previous
commit) for the "Lock position" case.
2022-02-15 22:08:23 +01:00
Jehan
e72f5614da app: properly blink the right locked layer when pixels are locked.
In particular, if painting on a layer whose parent's pixels are locked,
we were blinking an empty lock spot, which is confusing. Now
gimp_item_is_content_locked() will also return the proper item (when
relevant, i.e. when returning TRUE) which is locked. It may or may not
the same item as passed in (it may also be a parent item in particular).
2022-02-15 22:08:23 +01:00
Jehan
957b547fac Issue #7864: store and load "lock visibility" flag on items.
This was just completely forgotten!
2022-02-15 22:08:23 +01:00
Yuri Chornoivan
2ce4984693 Update Ukrainian translation 2022-02-15 16:28:56 +00:00
Hugo Carvalho
b618adcd6f Update Portuguese translation 2022-02-15 13:46:55 +00:00
Jehan
73414b9320 desktop: prepare an AppStream <release> tag for GIMP 2.99.10. 2022-02-15 13:47:19 +01:00
Jehan
89f06c68d5 NEWS: update. 2022-02-15 12:54:14 +01:00
Jehan
4ba8aa2322 icons: fix the native Windows build in CI with autotools.
Fixes:

> make[3]: *** No rule to make target '64/dialog-question.png', needed
> by 'gimp-core-pixbufs.gresource.xml'.  Stop.

It looks like a bug in autotools on Windows because there is no reason
why it would fail. The missing PNG should be caught by the '64/%.png'
rule. Anyway after testing, it fixes the gimp-win(32|64)-native CI jobs.
2022-02-14 23:22:39 +01:00
Anders Jonsson
b881ad0482 Update Swedish translation 2022-02-14 21:30:25 +00:00
Hugo Carvalho
eaf6604631 Update Portuguese translation 2022-02-14 12:38:57 +00:00
Hugo Carvalho
1849887ce1 Update Portuguese translation 2022-02-14 12:37:16 +00:00
Daniel Novomeský
f61f389233 plug-ins: remove save-bit-depth heuristics in HEIF plug-in 2022-02-14 11:37:14 +00:00
Matej Urbančič
50b3078cb8 Update Slovenian translation 2022-02-14 11:32:41 +00:00
Matej Urbančič
0cdb76a25c Update Slovenian translation 2022-02-14 11:32:14 +00:00
Daniel Novomeský
cbbae3a907 plug-ins: fix procedure parameter in file-jpegxl-save 2022-02-14 09:48:19 +01:00
Anders Jonsson
7fa04b1c17 Update Swedish translation 2022-02-13 21:36:21 +00:00
Jehan
f361009783 devel-docs: edit and rename debugging-tips file.
Also list it from the devel-docs README.
2022-02-13 21:07:05 +01:00
Jehan
1918736b99 Issue #6792: broken annotation for GimpRunBrushCallback.
As Massimo notes, the issue is not about the callback being broken in
bindings, but simply that bindings fail to handle random data without an
associated size. So let's just add the size. I confirmed testing API in
the Python binding that it now works fine.
2022-02-13 19:02:54 +01:00
Matej Urbančič
6fe62ce7f5 Update Slovenian translation 2022-02-13 17:03:08 +00:00
Matej Urbančič
c1b0364468 Update Slovenian translation 2022-02-13 17:02:39 +00:00
Yuri Chornoivan
643a5f88ab Update Ukrainian translation 2022-02-13 16:53:43 +00:00
Jehan
32049afd05 app: don't propagate resize requests from statusbar to display shell.
See discussion in !572, #7840 and #7690. Note that this was reported on
macOS where the consequences were pretty dire, but it actually also
happens on other platforms, at least on Linux too (as confirmed in X11
with the GTK Inspector set to show graphics updates; on Wayland this
debug option doesn't work, but I assume it is the same).

I am not perfectly happy with this change either, because it is based on
part of the API which has various deprecated parts (hence doesn't exist
anymore on the main dev tree, i.e. it might have to be reviewed in GTK4;
of course, it's unsure, maybe the whole resize propagation to parent
containers is just better handled there and the problem won't exist
anymore).
In any case, it is cleaner than the proposition for this part of the
problem in !572 which is problematic (patching GtkLabel with a new API
which won't trigger resize even when actually needed, hence which likely
won't ever get accepted upstream because it's not right).
2022-02-13 15:24:32 +01:00
Anders Jonsson
2bb2c8949b app: fix typo in name of lens mode enum 2022-02-13 13:49:36 +01:00
Alexandre Prokoudine
89159f0da7 Update Russian translation 2022-02-13 02:18:01 +03:00
Yuri Chornoivan
6b45c03f15 Update Ukrainian translation 2022-02-12 20:51:37 +00:00
Jehan
cef6737d86 app: plural is expected here with multi-layer selected support.
Thanks to Anders Jonsson for noticing.
2022-02-12 18:55:56 +01:00
Yuri Chornoivan
ac204595b3 Update Ukrainian translation 2022-02-12 16:22:28 +00:00
Jehan
d14b1d0523 plug-ins: change export dialog format name for Windows Cursors. 2022-02-12 13:54:20 +01:00
Anders Jonsson
6492186d76 Update Swedish translation 2022-02-12 11:32:18 +00:00
Jehan
061a20d30a NEWS: update. 2022-02-12 01:51:47 +01:00
Jehan
ce236b843e plug-ins: rename "write-color-space-info" arg into "write-color-space".
Let's sync with the proposal in !571 after discussing with Jacob. The
shorter naming is fine and the '-info' suffix feels a bit redundant
anyway. Also since this arg never even existed in GIMP 2.10 (until !571
which is soon to be merged), there is really not even a historical
reason.
2022-02-12 01:43:48 +01:00
Jehan
3e1c914358 plug-ins: fix file-gih.
"sel" argument was wrongly numbered.
2022-02-12 00:07:53 +00:00
Jehan
a9e443fe4a plug-ins: fixing "file-glob" with the new GStrv return value.
Tested with:

> c = Gimp.get_pdb().lookup_procedure('file-glob').create_config()
> c.set_property('pattern', '/home/jehan/*.png')
> r = Gimp.get_pdb().run_procedure_config('file-glob', c)
> r.index(1)
2022-02-12 00:07:53 +00:00
Jehan
87916e5069 libgimpbase: pass a NULL GStrv as an empty GStrv.
NULL is not a proper value for GStrv yet we cannot escape it in the PDB
since we generate default values for non-passed arguments (especially in
interactive case where most procedure arguments aren't set). And for
such boxed type, it will be NULL.

So when we see a NULL GStrv parameter, let's not ignore it (which will
just crash the plug-in). Simply transform it to a GStrv of size 0.
2022-02-12 00:07:53 +00:00
Niels De Graef
1e34a95db7 app, libgimp: pdbgen for previous commit. 2022-02-12 00:07:53 +00:00
Niels De Graef
8eb7f6df9e Remove GimpStringArray in favor of GStrv
GLib has a specific type of NULL-terminated string arrays:
`G_TYPE_STRV`, which is the `GType` of `char**` aka `GStrv`.

By using this type, we can avoid having a `GimpStringArray` which is a
bit cumbersome to use for both the C API, as well as bindings. By using
`GStrv`, we allow other languages to pass on string lists as they are
used to, while the bindings will make sure to do the right thing.

In the end, it makes the API a little bit simpler for everyone, and
reduces confusion for people who are used to working with string arrays
in other C/GLib based code (and not having 2 different types to denote
the same thing).

Related: https://gitlab.gnome.org/GNOME/gimp/-/issues/5919
2022-02-12 00:07:53 +00:00
Hugo Carvalho
406247a1d1 Update Portuguese translation 2022-02-11 23:29:20 +00:00
Jehan
6c5a3d96b3 NEWS: update. 2022-02-11 18:05:59 +01:00
Jehan
43f44288ef libgimp: new gimp_pdb_run_procedure_config() function.
While we do have quite a few gimp_pdb_run_procedure*() functions now, I
always felt that one based on a config file was missing, even more as we
are getting further and further into using config objects in plug-ins.

In C, the gimp_pdb_run_procedure() function is without a doubt the
easiest one. But such variable arg functions are not available on
bindings, and having to deal with GValue and GimpValueArray is a real
pain.

Also using a config file has the very great advantage that we don't need
to care about order. For instance, if I need to set the 10th argument of
a PDB call (and leave the rest to default values), I don't have to set
all 9 previous arguments. I can set only this one if I want. This
advantage is useful also for C code by the way.

For the record, here is how you could load then export an image with the
"file-png-*" PDB procedures in Python:

> c = Gimp.get_pdb().lookup_procedure('file-png-load').create_config()
> c.set_property('file', Gio.file_new_for_path('/path/sample.png'))
> r = Gimp.get_pdb().run_procedure_config('file-png-load', c)
> d = Gimp.Display.new(r.index(1)) # Give it a display to work on it.

Now exporting:

> img = r.index(1)
> c = Gimp.get_pdb().lookup_procedure('file-png-save').create_config()
> c.set_property('image', img)
> c.set_property('file', Gio.file_new_for_path('/path/exported.png'))
> layers = img.get_layers()
> c.set_property('drawables', Gimp.ObjectArray.new(Gimp.Drawable, layers, False))
> c.set_property('num-drawables', len(layers))
> r = Gimp.get_pdb().run_procedure_config('file-png-save', c)
2022-02-11 17:56:42 +01:00
Jehan
0734ac2aec libgimp: fix gimp_procedure_config_get_values().
The config object has one additional property per construction, which is
the "procedure" property.
2022-02-11 17:42:39 +01:00
Jehan
e7a7edd29c libgimpconfig: fix gimp_config_param_spec_duplicate() for objects and…
… object arrays.

We were not supporting duplicating object pspec for no good reason. Well
maybe the reason was that libgimpconfig does not see these types which
are in libgimp. But then the trick is to compare by name.

As for object array, they are present as subtypes of GimpArray specs.
Yet most GimpParamSpec*Array-s are subclass of GimpParamSpecArray but
GimpParamSpecObjectArray are their own GParamSpecBoxed subclass (same as
the Gimp*Array-s are just typedef-s of GimpArray but GimpObjectArray is
its own boxed type).
So I had to move the object array test as its own case to fix support.

Finally do not ignore anymore any type in gimp_config_class_init(). When
we create a GimpConfig, we want to know when a type is not implemented
as parameter (and if it's a well known type, we need to implement it).
2022-02-11 17:31:30 +01:00
Jehan
e6350f9459 libgimpconfig: this is the appropriate fix for the previous assert.
Since the parsing failure I was experiencing was normal (not a bug), and
since I was not seeing error being passed down to deserialize(), I
assume this assert was always wrong. I hadn't realize that the GError
object was in fact populated by deserialized through g_scanner_error()
calls which were setting the GError passed at creation of the scanner
through a handler.

So there was indeed a bug in one of the functions called by our
deserialize() implementation. There was one failure case where the error
was just reported with g_warning() instead of g_scanner_error().

Now that it's fixed, I brought back the asserts (previous commits)
because the error object is actually always well populated.
2022-02-10 22:18:03 +01:00
Jehan
f4c7ea7e02 Revert "libgimp, libgimpconfig: gimp_config_deserialize_file() should not…"
This reverts commit 73c0ee8da7.

Actually I was wrong, there was a bug in gimpconfig-deserialize.c. See
coming commit.
2022-02-10 22:18:03 +01:00
Jehan
1ed8ed8223 Revert "libgimpconfig: remove more g_assert()."
This reverts commit 40bebec273.

Actually I was wrong, there was a bug in gimpconfig-deserialize.c. See
coming commits.
2022-02-10 22:18:03 +01:00
Yuri Chornoivan
30b6d1ad0a Update Ukrainian translation 2022-02-10 20:46:35 +00:00
Yuri Chornoivan
1020e0544f Update Ukrainian translation 2022-02-10 20:43:27 +00:00
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
Anders Jonsson
55aa462faa plug-ins: add translation context for tag values 2022-02-02 17:29:48 +00:00
Yuri Chornoivan
a6a0756904 Update Ukrainian translation 2022-02-02 16:47:10 +00:00
Hugo Carvalho
839f9ccf92 Update Portuguese translation 2022-02-02 16:35:45 +00:00
Jehan
3f5af6511a NEWS: update. 2022-02-02 17:32:24 +01:00
Jehan
e0299ead94 extensions: fixing Vala goat-exercise build (Vala lib renamed). 2022-02-02 17:03:44 +01:00
Jehan
69ee9c927b app: fix build warning. 2022-02-02 16:20:28 +01:00
Jehan
e9bea93324 Issue #7720: Layer Sets UI Suggestion.
Using the "list-add" icon instead of "document-save" indeed makes more
sense for the button to store a layer set.

Also renaming "Named Selection" to "New layer set's name", which should
hopefully be less confusing. In particular, we keep consistency with the
"No layer set stored" label (naming the concept "layer set" both times).
And it should be clearer that it is a field to write down a name for
creating a new layer set.
2022-02-02 16:15:25 +01:00
Jehan
f38cd88a00 Issue #7521: VAPI file name different on meson and autotools.
Let's go with major.minor like our other library files, i.e.
gimp-3.0.vapi and gimp-ui-3.0.vapi.
2022-02-02 16:00:07 +01:00
Jehan
edf0d081bd devel-docs, extensions: more gitignore updates. 2022-02-02 14:18:51 +01:00
Jehan
aed8573eb9 devel-docs: add some .gitignore in reference/ subdirs. 2022-02-02 00:16:10 +01:00
Jehan
02220766b0 app: small code reorganization.
Signal handler to the end with other private functions.
2022-02-01 23:36:40 +01:00
Jehan
55b3e3a336 app: fix selecting fonts with arrow keys in Fonts dockable.
My commit ca28934dfc was very wrong. We absolutely need to set context
in list view editors too. In particular, we could not loop through fonts
in the Fonts dockable very quickly with up/down arrow keys anymore
(since the GimpFontFactoryView is a GimpContainerEditor).

When doing this though, we could have some weird crash in the
GimpContainerPopup watching for context change through button
press/release. Indeed when doing this, simply opening the popup (for
instance clicking on the Fonts icon in text tool options) would trigger
a context change as a button click consequence.
The solution is obviously to check which widget the button event belongs
to and ignore it if it happened on any other widget than the popup.
2022-02-01 23:31:47 +01:00
Jehan
59cd3afe50 icons: now unused meson.build files. 2022-02-01 17:39:28 +01:00
Jehan
3b6b17d30e icons: oups, forgot to commit the locks.list. 2022-02-01 15:43:49 +01:00
Jehan
63a17608ef icons, tools: review visible, linked and lock icons.
They all seem to only be needed in 16x16. As a consequence, the 20x20
category disappears.
2022-02-01 15:31:49 +01:00
Jehan
03272a9d54 devel-docs, tools: move the release-stats script to tools/.
Makes more sense and I am trying to make the devel-docs more readable
(which includes less crowded, especially with scripts which are not
really docs).
2022-02-01 14:34:46 +01:00
Jehan
4d8c1e3439 devel-docs: removing version.in.
I was wondering what this version file was for. After some git
archeology, turns out this was used for gtk-docs. Since we replaced
gtk-docs with gi-docgen in commit 92e80d12e8, this can be removed as
well.
2022-02-01 14:00:21 +01:00
Jehan
407f54f33e icons: more factorization of icon installation/build code.
Though the Color and Symbolic icon themes will have a different build
process and naming scheme for their icons, the base list is meant to be
the same by maintenance principle. So I am moving out the lists to the
icons/ directory's meson file.

Bumping meson requirement to 0.53.0 because I need to ability to use a
variable as dictionary key (not only string literals), which appeared in
this version. Meson 0.53.0 was released 2020-01-07 and seem to be used
in any stable distribution released since 2020. In any case, it seems
widespread enough to bump it now for our dev branch.
2022-02-01 13:07:25 +01:00
Jehan
20479ee137 devel-docs: improve a bit the icons docs. 2022-02-01 11:11:38 +01:00
Jehan
097e09f60c devel-docs: make the icons docs into markdown.
Better for links. Maybe we'll play with images this way too.
2022-02-01 10:47:01 +01:00
Luming Zh
48d6699af3 Update Chinese (China) translation 2022-01-31 23:36:14 +00:00
Jehan
960a239366 gitlab-ci: install native librsvg in a cross-build environment.
Needed to construct the icons.
2022-01-31 23:06:34 +01:00
Jehan
26f9bcb3b5 INSTALL: explaining a bit more the deal with librsvg.
Rust dependencies are not really making everyone happy apparently. We
don't want to make SVG support optional anymore because it is too
important, and unfortunately there doesn't seem to be any suitable
replacement SVG libs so far (or we haven't found them).

We explain this in the INSTALL file and also explain a bit how to bypass
the SVG parts for packagers really needing to do so, allowing GIMP to be
as portable as possible.

See also issue #6821.
2022-01-31 23:02:33 +01:00
Jehan
ae6c58652e icons, tools: fix the CI when building icon resources with vector icons.
Ok that was a bit of a mess with the 4 build cases (combinations of
meson, autotools, vector and raster icons). I *think* this is now OK.

Basically we still need to build the colorsvg2png tool even when
installing vector icons, just for the purpose of the 2 icons
dialog-question and gimp-wilber-eek which we compile into GLib resources
from PNG images.

Also it looks like I completely forgot to add the subdir meson.build in
icons/Color/.
2022-01-31 22:33:30 +01:00
Jehan
92a919aee1 icons, tools: touch the meson.build files when regenerating icon list.
Even though we only generate makefiles, we actually want to make meson
aware of the list change because it continues using the file list from
the previous configuration. We do this by "touching" the meson.build
files, i.e. editing their access time.

Also rebuild the icon-list as there are small changes forgotten.
2022-01-31 21:52:26 +01:00
Jehan
c872dcbf20 app, icons, libgimpwidgets: fix icon's gresources rules.
Now the source images are in the build dirs.

Also:
- clean the EXTRA_DIST contents on autotools;
- add dependencies rules in meson gresources to make sure icons are
  built before resource build;
- finally remove a duplicate build rule in Color Makefile.
2022-01-31 21:37:20 +01:00
Jehan
5a93168a96 icons: actually remove all the now-generated icons.
These are all generated from their SVG source, either with colorsvg2png
(for the Color icons) or gtk-encode-symbolic-svg (for Symbolic icons).
2022-01-31 21:31:12 +01:00
Jehan
a0ffddf7fd icons: argh I should not have touched the Legacy theme!
Bad usage of `find`. I didn't pay attention that I removed icons from
the Legacy icon theme which is frozen. Obviously the previous commit was
only expecting to touch Color and Symbolic icon themes.
2022-01-31 20:32:48 +01:00
Jehan
b6e0ebc663 icons: removing some now unused icons. 2022-01-31 19:25:24 +01:00
Jehan
8f136abb01 icons: clean the icon list a bit.
- Remove some forgotten lines related to 24x24 vector icons which were
  removed a few days ago already.
- Don't install the 64x64 icons anymore as PNG when in the vector icon
  case. Not sure why we ever did this, but it doesn't look useful.
- This should also fix the CI which was not looking for the tool
  gtk-encode-symbolic-svg in vector icon install.
2022-01-31 18:54:32 +01:00
Luming Zh
cb6ae8526b Update Chinese (China) translation 2022-01-31 17:10:11 +00:00
Jehan
ddd9fe8bdc icons, tools: new icon lists for modules. 2022-01-31 17:59:11 +01:00
Jehan
c0431df6f5 icons, tools: new 'templates' icon list.
Some points to note:
- gimp-web and gimp-toilet-paper had some usage elsewhere so I also left
  them in 2 of the more generic size files.
- I remove gimp-floppy altogether as it's used nowhere in any of our
  code or data files.
2022-01-31 16:12:19 +01:00
Jehan
9052762225 icons: tool icons are another big group of icons handled all the same. 2022-01-31 15:18:10 +01:00
Jehan
d2db539591 icons, tools: start grouping icons by their usage.
There are some clear and obvious groups in the icons. For instance, the
Preferences icons are one of them. Looking up the code, we only use them
in 16px (in Preferences side menu) and 48px (in Preferences page
headers). Until now, we were storing in other unrelated size (22px) and
also the lists per-sizes were not consistent. Some icons were missing
here, other there.

With this new organization, the Preferences icons are listed in a single
file, ensuring usage and contents consistency. Also it allows to install
them only for the needed sizes (note that it is possible that they might
be needed in different size, for instance with custom themes; but we
can't just randomly distribute icons in all sizes; or to be more
accurate, this is exactly why we encourage rather the SVG/scalable
icons, so if some people explicitly go for raster icons, they also get
the drawbacks which come with).

Last note: it may be possible that some icons end up in different
"semantic" icon group. This is not a problem with this new organization
as my scripts handle duplicates gracefully.
2022-01-31 14:52:42 +01:00
Jehan
bc999325be icons, tools: new colorsvg2png tool to build PNG out of SVG.
Build-time tool, which basically just rasterize SVG images (it doesn't
do anything special like gtk-encode-symbolic-svg which creates special
PNG for GTK to recolor them).

It looks like I had this prepared since 2018 according to file header,
but I just never finished doing it! :P

Basically now PNG icons of the Color icon themes do not need anymore to
be committed in the repository. They will be generated from the SVG
icons.

Also adding a missing icon from the 16px list (the Playground icon for
Preferences dialog was needed in 16x16 as well, yet missing).
2022-01-31 14:52:42 +01:00
Jehan
3e47e395a5 app: some typo fix.
Found while looking at this part of the code.
2022-01-31 14:52:42 +01:00
Jehan
0747db5bff icons: 24x24 SVG icons are redundant.
It may actually be meaningful to have redundant vector icons at specific
size, for instance when you want sligthly different designs (e.g. more
details at bigger size). But here looking at our 24x24 vector icons, it
doesn't look like it at all. It's mostly the exact same icons,
duplicated (with some forgotten).

Makes no sense here. So let's simply install the scalable/ icons for all
size, and that's it.
2022-01-31 14:52:42 +01:00
Luming Zh
069393d49f Update Chinese (China) translation 2022-01-31 04:18:17 +00:00
Ask Hjorth Larsen
96855390f3 Updated Danish translation of gimp-plug-ins 2022-01-30 16:15:07 +01:00
Ask Hjorth Larsen
64361f9852 Updated Danish translation 2022-01-30 16:15:07 +01:00
Alan Mortensen
89b4592750 Updated Danish translation of gimp-windows-installer 2022-01-30 15:58:02 +01:00
Alan Mortensen
015da415e8 Updated Danish translation of gimp-script-fu 2022-01-30 15:58:02 +01:00
Ask Hjorth Larsen
ee9b35f910 Update Danish translation 2022-01-30 12:54:54 +01:00
Jehan
4a00c109a0 icons: clean up old lists.
Argh I had forgotten to clean up old icon lists on meson (now that it
uses the common icons/icon-lists/ listing.
2022-01-27 21:10:56 +01:00
Jehan
f3702a7ec9 gitlab-ci: add a new GIMP_CI_RASTER_ICONS to test raster icon build.
Since this is probably much less tested than the default vector icon
case, any bug there might go unseen for some time. So let's add a new
pipeline to check this. I make so this pipeline is not actually run on
every commit (i.e. manually only), then I'll just add a scheduled
pipeline to check the non-vector icon case at regular intervals.

This pipeline also test the icon-list.mk files are not outdated.
2022-01-27 17:06:56 +01:00
Jehan
6e9b137f50 icons, tools: allow newlines in the icon lists.
This is nicer for icon organization, allowing to group them by
categories (Freedesktop, GTK and GIMP namespace icons).
2022-01-27 16:18:55 +01:00
Rodrigo Lledó
8a5120e021 Update Spanish translation 2022-01-27 10:23:47 +00:00
Rodrigo Lledó
b37fad26c7 Update Spanish translation 2022-01-27 10:11:05 +00:00
Jehan
2b843aa674 devel-docs: update icons docs. 2022-01-27 02:13:13 +01:00
Jehan
cfc770b85e Coding Style: update regarding tabs in Makefile-s.
Possibly the only place where we expect them?
2022-01-27 01:19:26 +01:00
Jehan
7a2f4b82f0 icons, tools: add a comment to generated icon-list.mk.
Just so that someone who happens to look in there is not tempted to
modify these files directly and get some instructions.
The comment is inspired from other similarly generated Makefile.am (i.e.
in plug-ins/commons/).
2022-01-27 01:00:20 +01:00
Jehan
3ed7c92f25 icons: regenerate the icon-list.mk-s with the new tool.
The lists are still exactly the same (except for one icon file whose
name the script fixed, which proves its usage/need even starting this
initial commit).

Now we also get more consistent tabbing than the manual one. Only
missing thing is that it was nice to separate some icons by categories
for easy reading. Maybe later.
2022-01-27 00:49:51 +01:00
Jehan
fc12d9e414 tools: new tool to generate the icon-list.mk-s from icons/icon-lists/…
… listing.

This way, both the Color and Symbolic icon themes, both on meson and
autotools build systems all share the exact same list of icons.

I think there are still improvements to be done on what we list and
chosen sizes and icon categories. But this step is about just getting on
the same state as we currently are, simply with shared listings. Once we
are there, we can go forward.
2022-01-27 00:49:12 +01:00
Jehan
8aee873c95 icons: remove use of meson 'fs' module.
I realize that this module is available since meson 0.53.0 though our
current requirement is meson 0.50.0.
Note sure why meson was not popping any warning (normally it does when
we use a feature younger than the minimum requirement; but maybe this
doesn't work for modules).

Anyway this does the same thing without the 'fs' module, and maybe even
better (we know which icons should be converted or used from source, no
need to add any test logics here).
2022-01-26 16:43:18 +01:00
Jehan
8f0d67779c meson: rename -Dvec-icons to -Dvector-icons.
Should we really be that stingy for letters that we don't want to use
full words?! :-D
Let's have clear option names.
2022-01-26 02:55:27 +01:00
Jehan
784a209ba2 icons: share the same list for symbolic and color icons in meson.
Now we get back (slowly) to something a bit saner, with a common list
shared on both icon themes. This way, we make sure we won't miss any
icon when we will add/remove/change any icon.

This is only for the meson build right now, but next step is to use the
same list in the autotools build as well. This will get maximum
consistency across build systems.
2022-01-26 02:48:30 +01:00
Jehan
11183f4fa4 icons: have -Dvec-icons=false option work with meson.
The whole logics of creating specially prepared PNG images for vector
icons (with gtk-encode-symbolic-svg) was absent. This option was
basically completely broken, yet we now know that we need the ability to
install PNG alternatives for the icons (see #6821).

This is a continuation of previous commit which is straightening a bit
our whole icon theme builds. Note though that more needs to be done
because I definitely still see room for more mess and far too much
duplication.
2022-01-26 01:04:27 +01:00
Jehan
ae861e01cd icons: sync all icon lists between autotools and meson.
Some icons were missing on one side or another side, though mostly on
the meson build. Also the option -Dvec-icons=false was basically
completely broken and clearly untested, most likely ever since the
original meson build contribution.

This commit doesn't even completely fix the non-vector icon rule,
because even the file names are wrong, and the bitmap icons are not even
constructed from their vector counterpart! I am going to fix this in the
next commit.
2022-01-25 22:12:38 +01:00
Jehan
d266100ab7 devel-docs: update icons.txt and icon theme section in README. 2022-01-25 17:27:48 +01:00
Jehan
a08224f7b3 INSTALL: update the install instructions regarding librsvg.
Currently it's a mandatory option (and it has been the case for years,
ever since commit 43e218859b) so let's update the info.

Note that there are still discussions going on about this dependency and
it being hard or impossible to build on many platforms (which are stuck
on old C version, before the move to Rust). See #6821.
We'll see how it goes.
2022-01-25 01:33:34 +01:00
Jehan
650e0fa7f3 build: sync nightly flatpak with updates from the dev flatpak.
This includes:
- "copy-icon" set
- Permission and cleanup rules updated
- Exiv2 bumped to 0.27.5
- Adding an x-checker-data for OpenEXR
- Poppler bumped to 22.01.00
- OpenBlas bumped to 0.3.19
- graphviz bumped to 2.50.0
2022-01-25 01:21:55 +01:00
Matej Urbančič
54e2c30f82 Update Slovenian translation 2022-01-24 19:57:55 +00:00
Jehan
996e5ef1eb icons: fix missing icons with the --disable-vector-icons option.
We should really get back to a single shared list as we have in
gimp-2-10.

Also just keeping the "no SVG icons" option feels wrong to me, yet it
turns out librsvg is quite a problem because of Rust, so recent versions
are just not available on many platforms (see #6821). This is what
blocked me so far to remove this whole listing of PNG variants for our
vector icon themes. Otherwise they would be gone by now.

I really wonder as well about all these size categories. Not that they
are not needed when in PNG format, but because it feels like nobody has
really taken the time to list which icons are needed in which size for
years. We really need to do some cleaning in this area.
2022-01-24 17:21:08 +01:00
Lukas Oberhuber
96c23903bc macos: support standard fullscreen
This moves to standard fullscreen behavior for Gimp.

Added benefit is that it no longer requires gdkquartz-cocoa-access.h
which the Gtk team wish to stop supporting https://gitlab.gnome.org/GNOME/gtk/-/merge_requests/4303.

Bug 756178 also no longer manifests, cdc7542d46
so it is now safe to do.

Finally, removes dependency on objective c in the app/display directory.
2022-01-24 14:49:42 +00:00
Jehan
84d298d4d3 devel-docs: fix autotools dist rules.
Since I removed some files and forgot to change these rules. Though I
actually wonder if this still makes sense to distribute all these files
within the tarball anymore. It made sense in the way software was
distributed 20 years ago, but nowadays people who want to develop would
clone the git repo not get a tarball. We'll see.
2022-01-24 15:45:43 +01:00
Boyuan Yang
c2ef33e63c Update Chinese (China) translation 2022-01-24 13:55:14 +00:00
Lukas Oberhuber
ce90cc28a1 macos: support python plugins in meson
This change makes sure that plugins can load when gimp is built with
meson. This is because .typelibs and .gir files do not have full library
paths when build using meson (this is different from autotools).
2022-01-24 02:12:22 +00:00
Piotr Drąg
10fe910728 Update Polish translation 2022-01-23 12:34:01 +01:00
Jehan
4065c33bf0 devel-docs: update the developer documentation further.
Add some more text and links to existing documents.

I also remove 3 files which are now either outdated or whose contents is
also written (with more or less similar text) in other more up-to-date
files.
2022-01-23 01:05:58 +01:00
Jehan
67a1d9f4d0 devel-docs: update further the devel docs.
Add more links to other files after I reviewed they were still relevant.

The `gitlab-milestones.txt` in particular had to be updated because the
contents was outdated (though we still need to manage milestones, simply
now we are a bit more fine-grained).
2022-01-22 23:00:50 +01:00
Jehan
e4cb7e12b4 devel-docs: add CI info in developer docs.
Also remove the now deprecated Jenkins tutorial. We have not had this CI
system running for some time now, and the Gitlab CI has totally replaced
it.
2022-01-22 21:55:50 +01:00
Jehan
fac84db028 devel-docs: add directory structure of the repo to developer docs.
Loosely based on the old structure.xml, except it was widely outdated.
So I removed or updated what was obsolete and added missing folders.

Obviously getting rid of the old `structure.xml` (now we have easier doc
generation through Gitlab).

Finally, I fix the table of contents and replaced the title with some
metadata-style stuff which Gitlab docs suggest (otherwise the document
title ends up in the table of contents, which is a bit silly).
2022-01-22 17:44:38 +01:00
Jehan
66cfa75291 tools: add a flatpak-releases tool for quick testing with Flatpak.
Sometimes we want to make quick tests on old versions of GIMP.
Rebuilding from source is definitely still an option, yet with flatpak,
we have many past builds available easily to us (at time of writing: 19
stable builds, 12 dev point-release builds and at least 3 nightlies —
though I seem to have issues with signatures on gnome-nightly right now,
so maybe there are more!).

There are some command lines needed to check the build history, then to
install a specific build, which I explained in developer docs (see
devel-docs/debugging-tips.txt, section "Testing older GIMP versions").
Yet it's clearly cumbersome and slow so I wrote this script today to
automatize the process a bit.

Running simply this command will list all available releases on the
Flathub repository (adding --beta or --nightly will list the development
releases and nightly builds instead):

$ tools/flatpak-releases

The listing will contain a topic describing the build as well as the
date, all this prefixed by a number. For instance, this is an excerpt of
the output for the dev releases:

$ tools/flatpak-releases --beta
 0: Update dependencies (127a0fa7) [2022-01-13 16:59:43 +0000]
 1: Issue #106:  File->Create->From Screenshot not working. (9c831b14) [2021-12-14 21:46:52 +0000]
 2: Release GIMP 2.99.8. (908bf5b0) [2021-10-20 20:29:00 +0000]
 3: Release GIMP 2.99.6. (e04355dd) [2021-04-26 14:08:32 +0000]
 …

The last build updates dependencies, the previous one fixes some
specific issue and the 2 previous ones are point releases.
Now say I needed to test/compare some behavior with how it was in 2.99.6
(e.g. to verify a regression), I would then run:

$ tools/flatpak-releases --beta -3

This would install this specific dev build number 3. In just 2
easy-to-remember commands and a few seconds, we can therefore list and
install specific Flatpak builds.
2022-01-22 16:04:35 +01:00
Anders Jonsson
db5964ba90 Update Swedish translation 2022-01-21 20:19:58 +00:00
Nikc
998479706b Issue #4107: Removing titlebar/borders from Windows Splash Screen 2022-01-21 13:49:18 +00:00
Jehan
1aeee787a8 devel-docs: add a README.md.
This will be the root page for the developer documentation. Note that
there are other files in this directory (old `README` included) which
will need to be deleted but I don't do it just yet on purpose until I
checked them and integrate anything which could be of interest back into
the new documentation.
2022-01-20 22:14:07 +01:00
Jehan
b35c44cb05 devel-docs: move specifications to their own subfolder.
Let's make the devel-docs folder a bit less crowded.
2022-01-20 20:41:44 +01:00
Jehan
2e8abf46ee libgimpbase: undeprecate GExiv2 calls in GimpMetadata.
There are still deprecations going around but for GExiv2 0.14.0 so we
can't change these yet.

Note also that I try a slightly different approach as I don't set a
GError for well-known tags as there is no reason these fail. I only add
a GError when we construct tags or similar calls.
2022-01-20 20:18:53 +01:00
Jehan
c76172d971 libgimp: more un-deprecating GExiv2.
Last deprecated usages in this file. Actually there are a few other
calls but deprecated on GExiv2 0.14.0, hence over our current
requirement. So we'll have to handle these later.
2022-01-20 18:45:08 +01:00
Jehan
0d33ede670 libgimp: undeprecate some more GExiv2 calls.
Replace functions gexiv2_metadata_set_xmp_tag_struct() and
gexiv2_metadata_get_tag_type() with their _try_ variants.

Note that I print to stderr rather than raising a warning here as I am
quite unsure where the list of XMP metadata we are gathering comes from.
Is it fully validated by GExiv2, and therefore no errors are ever
supposed to happen? (in such case, we should raise a warning if it does)
Or is it user-provided data (e.g. from a file loaded in GIMP which can
contain broken metadata)? In such a case, we should probably handle the
error slightly differently to warn for non-processable data (hence
possibly metadata loss at export time).

For the time being, then go with this weak handling and take care of
this better when we can look further into this.
2022-01-20 18:26:07 +01:00
Jehan
e3c803299a libgimp: port a bunch of gexiv2_metadata_set_tag_string() to …
… gexiv2_metadata_try_set_tag_string().

These are usage where we have full control over tag names and values so
no error is supposed to happen. This is why we use them as code warnings
and not returned error (because if an error did happen, this would be a
bug rather than a user error or a system error).
2022-01-20 17:56:28 +01:00
Jehan
96e25b7817 libgimp: fix and workaround Exif.Photo.UserComment interpretation.
Here are the changes:
- Separate the check for comment contents and the one of whether or not
  it starts with "charset=Ascii ". Indeed in my tests, we still want to
  handle the empty string case or the "binary comment" case even without
  the charset prefix (currently it was both or none, so I encountered
  cases with a broken "binary comment" comment because the charset
  prefix was absent).
- Add some #warning in order not to forget to remove the bogus "binary
  comment" test. Indeed after some digging in Exiv2 code, I could
  confirm this return value got removed in commit 9b510858 of Exiv2
  repository, i.e. since Exiv2 0.27.4. Now in my test case where I had a
  tag containing only 0s, Exiv2 returns an empty string, which is
  perfectly fine (and it's up to us to keep or ignore it).
- Use gexiv2_metadata_try_get_tag_interpreted_string() instead of their
  deprecate non-try counterparses. Right now, I am just outputting any
  error message to stderr, as I'm not sure if this is the kind of errors
  we want to warn people about. I guess it would depend on which type of
  errors exactly are returned, so let's see if we encounter some case in
  the future. For now stderr is fine to detect these.
2022-01-20 16:47:04 +01:00
Jehan
3294586438 libgimpcolor: use the proper GimpColorRenderingIntent type.
GimpColorRenderingIntent and BablIccIntent are actually 1-on-1
equivalent (for the common base values), but it's better anyway to call
with the right type. Also fixes this warning:

> libgimpcolor/gimpcolortransform.c:215:53: warning: implicit conversion
> from 'enum <anonymous>' to 'GimpColorRenderingIntent'
> [-Wenum-conversion]
2022-01-20 12:08:00 +01:00
Jehan
3d97a408ea clang-format: improve according to our coding style.
- Align macro values.
- Align backslashes to escape newlines.
- Added explicit PointerAlignment though this one seems unneeded.
- Increase the column limit (even though 80 is really the official one)
  and add some penalty on breaking on very unexpected places, such as
  around assignments or on first parameters in calls/declaration. We
  want short lines but this is more of a soft rule which should not
  override sensible line breaking rules.
- Group some rules and reorder rule names alphabetically within groups.
2022-01-19 23:17:23 +01:00
Jehan
1e47c8916a .gitlab: search common git ancestor with mr-origin remote.
It looks like origin is the same as mr-origin when the contributor
pushes to one's branch. But when a reviewer rebases through the Gitlab
"Rebase" button on web GUI, I got a fatal error:

> fatal: ambiguous argument 'origin/asalle/use-dynamics-flag': unknown
  revision or path not in the working tree.

Possibly `origin` is then the remote of the person who rebased (it would
be weird, yet it's a fact the branch is not found). Let's go with this
assumption.
2022-01-19 22:22:40 +01:00
Asa
9385a6405a .gitlab-ci.yml: add clang-format rules and pipeline
Fixes #950

`.gitlab/search-common-ancestor.sh`'s original authors are
Philip Withnall and Frederic Martinsons.
(Jehan/reviewer's note: script further improved by Asalle)
2022-01-19 20:44:45 +00:00
Hugo Carvalho
26ed0d63cd Update Portuguese translation 2022-01-19 16:10:01 +00:00
Jehan
df06eebe8b Coding style: update.
- Add recommendations on whether to break MRs into 1 or more commits.
- Add style for one-line struct initialization.
- Protect some texts in backticks' markdown syntax.
2022-01-19 16:36:59 +01:00
Nikc
94c7f80282 Issue #4009: enables option to capture cursor in screenshot (Windows) 2022-01-19 01:28:47 +00:00
Yuri Chornoivan
5c4c5c5b5e Update Ukrainian translation 2022-01-18 22:56:41 +00:00
Jacob Boerema
e51ca66ee5 plug-ins: fix #7524 DICOM File is broken
This is the same issue as with IM000001.dcm mentioned in issue #313.

There are two problems: incorrect endian conversion for 16 bits per pixel,
and not handling photometric interpretation "MONOCHROME1", which means
minimum value is white instead of black.

The endian conversion was fixed as suggested in issue #313.
For "MONOCHROME1" we added a variable bw_inverted and we invert the pixel
value if that variable is true.
2022-01-18 16:30:28 -05:00
Jacob Boerema
059599fc78 plug-ins: fix #6871 indexed tga file cannot be saved
Exporting an image to TGA fails with a crash when it's an indexed image
with alpha channel. We were not taking into account that even though
the output is 1 byte per pixel, the input should allocate memory for
2 bytes per pixel (1 color index and 1 alpha channel).
2022-01-18 15:00:22 -05:00
Rodrigo Lledó
1c8aad4f68 Update Spanish translation 2022-01-16 22:31:26 +00:00
Matej Urbančič
0986fec1fb Update Slovenian translation 2022-01-16 21:30:49 +00:00
Matej Urbančič
3f8934b33a Update Slovenian translation 2022-01-16 21:29:47 +00:00
Hugo Carvalho
794b27ef62 Update Portuguese translation 2022-01-13 11:57:03 +00:00
Rodrigo Lledó
2fe6b11158 Update Spanish translation 2022-01-11 18:17:49 +00:00
Marco Ciampa
3f6bf3cee9 Updated Italian translation 2022-01-11 10:58:43 +01:00
Marco Ciampa
c27e972778 Updated Italian translation 2022-01-11 08:54:23 +01:00
Jehan
407472f091 build: fix windows-installer-langs unit test.
Also improving a bit the download script by specifying the .isl or .islu
file extension. It's nicer than trying to download randomly, and also it
allows to better compare the list of downloaded files with the list in
gimp3264.iss script.
2022-01-10 23:58:00 +01:00
Jehan
9ba44aab2a build: Improve BOM-adding on InnoSetup files.
My previous command was also adding a linefeed just after the BOM. While
I'm not sure it would really break anything for processing these, it's
anyway much more correct to only add the 3 BOM bytes. So here is the
improved command.
2022-01-10 21:27:12 +01:00
Jehan
5872d8dd45 build: factorize downloading code for InnoSetup languages.
Also some language files are supposed to be UTF-8 yet they are missing
the BOM markup (only method to recognize them for InnoSetup). This is
the case for Chinese Traditional. See issue #7676.
Make sure that this lang file has a BOM.
2022-01-10 21:09:23 +01:00
Yuri Chornoivan
3c0e21e4bf Update Ukrainian translation 2022-01-09 12:20:37 +00:00
Anders Jonsson
53d6d460b7 Update Swedish translation 2022-01-09 01:00:29 +00:00
Daniel Novomeský
7e85e8f9a2 plug-ins: new speed levels possible for JXL export
JPEG XL plug-in can use very fast export settings:
thunder and the fastest lightning.
Compression slider is disabled for lossless
2022-01-08 23:21:36 +00:00
Jacob Boerema
1858d72d03 app: fix #7682 crash loading xcf with linked text layers
Due to recent changes on master the linked layers concept doesn't exist
anymore. The conversion code checks whether all linked layers are valid.
However, text layers need special handling.

In the past updating the linked_layers wasn't needed when the layer pointer
of a text layer was changed. Now, that has changed because we parse that
list for valid layers. To fix this we update linked_layers in the same
way as already was done for selected_layers.
2022-01-06 15:04:06 -05:00
Jehan
56d6cf6aa1 INSTALL, libgimp: document a bit better the GIR cross-tool exception. 2022-01-06 19:24:32 +01:00
Markus Volk
c9fabacca2 meson: make gir buildable
yocto/oe is capable of building gobject introspection despite cross-compiling.
add an option to enable gir build even if cross-compiling

Signed-off-by: Markus Volk <f_l_k@t-online.de>

Reviewer note (Jehan): this whole stuff is a mess. Actually I'd like to
simply get rid of the whole no-gir-when-cross-compiling logics but I
still can't figure out how to cross-build generically with GIR.
Yet since some manage it with yocto, let's unblock them.
See #7208.
2022-01-06 18:58:08 +01:00
Rodrigo Lledó
4ab3284fb3 Update Spanish translation 2022-01-05 06:50:01 +00:00
Rodrigo Lledó
e5ce2d7b18 Update Spanish translation 2022-01-04 13:35:28 +00:00
Daniel Novomeský
37c04cc9bc NEWS: update. 2022-01-04 13:39:41 +01:00
Daniel Novomeský
6da9a71aed plug-ins: adjust selection of precision during JXL import
There is no change for lossless images, where import precision
is directly related to bits_per_sample.
However, according JXL developers, for lossy images
(which generally use XYB color space), decoded data are not tightly
bound to bits_per_sample from header, import in 32bit
float precision can be used for better import quality
(libjxl works internally in 32bit float precision).
2022-01-04 12:28:54 +00:00
Jehan
1b8a5016f3 NEWS: update. 2022-01-04 00:15:13 +01:00
Daniel Novomeský
9bc971a466 plug-ins: use newer gexiv2 0.12.2 API in HEIF export 2022-01-03 15:33:39 +00:00
Jehan
bea0618883 INSTALL: add xdg-desktop-portal in the runtime dependencies.
Cf. #1074 for color-picking, as well as the screenshot plug-in.
2022-01-02 19:48:32 +01:00
Daniel Novomeský
eb42bbb6a8 build: remove gtk-doc from MSYS2 build environment 2022-01-02 17:42:50 +01:00
6031 changed files with 997633 additions and 1114107 deletions

44
.clang-format Normal file
View File

@@ -0,0 +1,44 @@
# For more information, see:
#
# https://clang.llvm.org/docs/ClangFormat.html
# https://clang.llvm.org/docs/ClangFormatStyleOptions.html
#
---
BasedOnStyle: GNU
AlignAfterOpenBracket: Align
AlignArrayOfStructures: Left
AlignConsecutiveAssignments: Consecutive
AlignConsecutiveDeclarations: Consecutive
AlignConsecutiveMacros: Consecutive
AlignEscapedNewlines: Left
AllowAllParametersOfDeclarationOnNextLine: false
AlwaysBreakAfterReturnType: AllDefinitions
BinPackParameters: false
BreakBeforeBraces: GNU
IndentWidth: 2
PointerAlignment: Right
UseTab: Never
SpaceBeforeParens: Always
SpaceAfterLogicalNot: true
SpaceAfterCStyleCast: true
# Our column limit is more around 80 characters but we want to avoid
# this rule to be over-agressive. So for clang-format, let's use a
# higher limit. Then let's put some biggish penalties on breaking on
# assignment, or parentheses, or other similar cases. Actually with such
# limits, if clang-format really ends up re-formatting, there might be
# something better to do code-wise (i.e. we might be in an akwardly
# over-nested block case).
ColumnLimit: 80
PenaltyBreakAssignment: 60
PenaltyBreakBeforeFirstCallParameter: 100
PenaltyBreakOpenParenthesis: 40
PenaltyExcessCharacter: 1
# Strings are more often longer by usage, so let's give these slightly
# more space to breath.
PenaltyBreakString: 60
PenaltyReturnTypeOnItsOwnLine: 50

62
.gitignore vendored
View File

@@ -1,62 +1,2 @@
# Meson
/_build
/compile_commands.json
# Atom editor
/.vscode
# Autotools
*.la
*.lo
*.o
*~
/*.config
/*.creator
/*.creator.user
/*.files
/*.includes
/ChangeLog
/Gimp-3.0.gir
/Gimp-3.0.typelib
/INSTALL
/Makefile
/Makefile.in
/aclocal.m4
/authors.md
/autom4te.cache
/compile
/config.cache
/config.guess
/config.h
/config.h.in
/config.log
/config.status
/config.status.lineno
/config.sub
/configure
/cscope.files
/cscope.out
/depcomp
/gimp-3.0.pc
/gimp-zip
/gimpthumb-3.0.pc
/gimpui-3.0.pc
/git-version.h
/gtk-doc.make
/install-sh
/intltool-extract
/intltool-extract.in
/intltool-merge
/intltool-merge.in
/intltool-modules
/intltool-update
/intltool-update.in
/libtool
/ltmain.sh
/missing
/mkinstalldirs
/py-compile
/stamp-h
/stamp-h.in
/stamp-h1
/test-driver
/compile_commands.json

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,32 @@
#!/usr/bin/python3
# Equivalent to:
# configure_file(input: src,
# output: name / src,
# copy: true,
# install_dir: gimpplugindir / 'plug-ins' / name,
# install_mode: 'rwxr-xr-x')
# Except that configure_file() does not accept output in a subdirectory. So we
# use this wrapper for now.
# See: https://github.com/mesonbuild/meson/issues/2320
import os
import shutil
import stat
import sys
src_file = sys.argv[1]
dir_name = sys.argv[2]
dummy_path = None
if len(sys.argv) > 3:
dummy_path = sys.argv[3]
os.makedirs(dir_name, exist_ok=True)
file_name = os.path.basename(src_file)
dst_file = os.path.join(dir_name, file_name)
shutil.copyfile(src_file, dst_file)
os.chmod(dst_file, stat.S_IRWXU | stat.S_IRGRP | stat.S_IXGRP | stat.S_IROTH | stat.S_IXOTH)
if dummy_path is not None:
# Just touch the dummy file.
open(dummy_path, mode='w').close()

View File

@@ -0,0 +1,44 @@
<!-- ⚠️ IMPORTANT: READ ME! ⚠️
This is the default template for bug reports.
For feature requests or performance issues, please switch instead to the appropriate template in the "Choose a template" list.
It is important that you fill all the fields of the template.
There are a few issues we get reports about quite frequently. If you want to check if what you have encountered is among these, please see:
https://gitlab.gnome.org/GNOME/gimp/-/issues/?sort=updated_desc&state=all&label_name%5B%5D=Duplication%20target&first_page_size=100
-->
### Environment/Versions
- GIMP version:
- Package: <!--[flatpak? Installer from gimp.org? If another installer, tell us where from] (write it after the > symbol)-->
- Operating System: <!--[Windows? macOS? Linux? All?] (write it after the > symbol) -->
<!--Note: bug reporters are expected to have verified the bug still exists
either in the last stable version of GIMP or on updated development code
(master branch).-->
### Description of the bug
<!--Please describe your issue with details.
Add screenshot or other files if needed.(write it after the > symbol)-->
### Reproduction
Is the bug reproducible? <!--[Always / Randomly / Happened only once ] (write it after the > symbol)-->
Reproduction steps:
1.
2.
3.
Expected result:
Actual result:
### Additional information
If you have a backtrace for a crash or a warning, paste it here.

View File

@@ -1,34 +0,0 @@
### Environment/Versions
- GIMP version:
- Package: <!--[flatpak? Installer from gimp.org? If another installer, tell us where from] (write it after the > symbol)-->
- Operating System: <!--[Windows? macOS? Linux? All?] (write it after the > symbol) -->
<!--Note: bug reporters are expected to have verified the bug still exists
either in the last stable version of GIMP or on updated development code
(master branch).-->
### Description of the bug
<!--Please describe your issue with details.
Add screenshot or other files if needed.(write it after the > symbol)-->
### Reproduction
Is the bug reproducible? <!--[Always / Randomly / Happened only once ] (write it after the > symbol)-->
Reproduction steps:
1.
2.
3.
Expected result:
Actual result:
### Additional information
If you have a backtrace for a crash or a warning, paste it here.

View File

@@ -2,14 +2,13 @@
### Description of the feature
<!-- Please describe your feature with details.
Add screenshots, design images or other files which would help for
understanding the feature or for implementation.
Also add links when needed, for instance for implementation standards
or other relevant resources.-->
<!-- Please describe your feature with details. Also:
- If the feature is UI-related, add screenshots, mockups or videos;
- If the feature is about some standard or API, link relevant resources;
- If you have a patch, see: https://developer.gimp.org/core/submit-patch/ -->
### Use cases
<!-- If not obvious, explain the use cases or problems to solve. -->
<!-- Explain the use cases or problems to solve.
If you are unsure, you should first discuss with the community in the forums
or talk with the developers on IRC: https://www.gimp.org/discuss.html -->

View File

@@ -17,7 +17,7 @@ either in the last stable version of GIMP or on updated development code
<!-- Please record a performance log demonstrating the issue, and attach it to the report.
For more information, see
https://gitlab.gnome.org/GNOME/gimp/blob/master/devel-docs/performance-logs/performance-logs.md
https://developer.gimp.org/core/debug/performance-logs/
-->

View File

@@ -1,7 +1,7 @@
Contribution guidelines:
<!-- Contribution guidelines:
- Follow our coding style, which is mostly the GNU coding style
with some specificities: see [HACKING](HACKING#L123).
with some specificities: see [Coding Style](https://developer.gimp.org/core/coding_style/).
- Make sure no trailing spaces or tabs are left out.
@@ -12,4 +12,4 @@ Contribution guidelines:
documentation, but enabling the feature instead of disabling it
(unlike what the docs says, Container Registry is disabled by default
on our Gitlab instance):
https://docs.gitlab.com/ee/user/packages/container_registry/#disable-the-container-registry-for-a-project
https://docs.gitlab.com/ee/user/packages/container_registry/#disable-the-container-registry-for-a-project -->

30
.gitlab/run_style_check_diff.sh Executable file
View File

@@ -0,0 +1,30 @@
#!/bin/bash
set -e
ancestor_horizon=28 # days (4 weeks)
echo ""
echo "This script may be wrong. You may disregard it if it conflicts with"
echo "https://gitlab.gnome.org/GNOME/gimp/-/blob/master/CODING_STYLE.md"
clang-format --version
# Wrap everything in a subshell so we can propagate the exit status.
(
source .gitlab/search-common-ancestor.sh
git diff -U0 --no-color "${newest_common_ancestor_sha}" | clang-format-diff -p1 > format-diff.log
)
exit_status=$?
[ ${exit_status} == 0 ] || exit ${exit_status}
format_diff="$(<format-diff.log)"
if [ -n "${format_diff}" ]; then
cat format-diff.log
exit 1
fi

View File

@@ -0,0 +1,39 @@
#!/bin/bash
set -e
ancestor_horizon=28 # days (4 weeks)
# We need to add a new remote for the upstream target branch, since this script
# could be running in a personal fork of the repository which has out of date
# branches.
#
# Limit the fetch to a certain date horizon to limit the amount of data we get.
# If the branch was forked from origin/main before this horizon, it should
# probably be rebased.
if ! git ls-remote --exit-code upstream >/dev/null 2>&1 ; then
git remote add upstream https://gitlab.gnome.org/GNOME/gimp.git
fi
git fetch --shallow-since="$(date --date="${ancestor_horizon} days ago" +%Y-%m-%d)" upstream &> ./fetch_upstream.log
# Work out the newest common ancestor between the detached HEAD that this CI job
# has checked out, and the upstream target branch (which will typically be
# `upstream/main` or `upstream/glib-2-62`).
# `${CI_MERGE_REQUEST_TARGET_BRANCH_NAME}` or `${CI_MERGE_REQUEST_SOURCE_BRANCH_NAME}`
# are only defined if were running in a merge request pipeline,
# fall back to `${CI_DEFAULT_BRANCH}` or `${CI_COMMIT_BRANCH}` respectively
# otherwise.
# add mr-origin
git remote add mr-origin ${CI_MERGE_REQUEST_SOURCE_PROJECT_URL}
source_branch="${CI_MERGE_REQUEST_SOURCE_BRANCH_NAME:-${CI_COMMIT_BRANCH}}"
git fetch --shallow-since="$(date --date="${ancestor_horizon} days ago" +%Y-%m-%d)" mr-origin "${source_branch}" &> ./fetch_origin.log
newest_common_ancestor_sha=$(diff --old-line-format='' --new-line-format='' <(git rev-list --first-parent "upstream/${CI_MERGE_REQUEST_TARGET_BRANCH_NAME:-${CI_DEFAULT_BRANCH}}") <(git rev-list --first-parent "mr-origin/${source_branch}") | head -1)
if [ -z "${newest_common_ancestor_sha}" ]; then
echo "Couldnt find common ancestor with upstream main branch. This typically"
echo "happens if you branched from main a long time ago. Please update"
echo "your clone, rebase, and re-push your branch."
exit 1
fi

4
.gitmodules vendored Normal file
View File

@@ -0,0 +1,4 @@
[submodule "gimp-data"]
path = gimp-data
url = https://gitlab.gnome.org/GNOME/gimp-data.git
shallow = true

11
.vscode/settings.json vendored Normal file
View File

@@ -0,0 +1,11 @@
{
"C_Cpp.clang_format_fallbackStyle": "GNU",
"editor.rulers": [
80
],
"editor.tabSize": 2,
"editor.renderControlCharacters": true,
"editor.renderWhitespace": "trailing",
"files.trimTrailingWhitespace": true,
"files.eol": "\n"
}

View File

@@ -225,9 +225,10 @@ The following people have contributed code to GIMP:
Jon Nordby
Martin Nordholts
Stephen Robert Norris
Daniel Novomesky
Daniel Novomeský
Erik Nygren
Miles O'Neal
Lukas Oberhuber
David Odin
Nelson A. de Oliveira
Victor Oliveira
@@ -342,6 +343,7 @@ The following people have contributed art to GIMP:
Lapo Calamandrei
Paul Davey
Patrick David
Alexia Death
Aurore Derriennic
Philipp Haegi
@@ -361,18 +363,22 @@ The following people have helped to document GIMP:
Ignacio AntI
Žygimantas Beručka
Jacob Boerema
Carey Bunks
Marco Ciampa
Sven Claussner
Patrick David
Dust
Ulf-D. Ehlert
Alessandro Falappa
Jakub Friedl
Niels De Graef
Michael Hammel
Julien Hardelin
Simon Janes
Róman Joost
Hans de Jonge
Lloyd Konneker
Semka Kuloviæ-Debals
Karin Kylander
Olof S Kylander
@@ -380,6 +386,7 @@ The following people have helped to document GIMP:
Vitaly Lomov
Ed Mackey
Ian Main
Akkana Peck
Pierre Perrier
Alexandre Prokoudine
Manuel Quiñones

View File

@@ -1,921 +0,0 @@
# GIMP Coding Style
This document describes the preferred coding style for the GIMP source code.
It was originally inspired by [GNU's coding
style](https://www.gnu.org/prep/standards/standards.html#Writing-C) and
developed from there across the years.
Coding style is completely arbitrary as it is a a matter of consistency,
readability and maintenance, not taste. Therefore it doesn't matter what
you prefer (we all have some part of the rules we would like different,
and we can apply these to our personal projects), just follow these
rules so that we can work together efficiently.
This document will use examples at the very least to provide
authoritative and consistent answers to common questions regarding the
coding style and will also try to identify the allowed exceptions.
## Table of contents
[TOC]
## Dealing with the old code
__The new GIMP code should adhere to the style explained below.__ The existing
GIMP code largely follows these conventions, but there are some differences like
extra or missing whitespace, tabs instead of space, wrong formatting, etc.
__Our policy is to update the style of a code block or function if and only if
you happen to touch that code.__
Please don't waste your time and reviewers' time with merge requests or patches
with _only_ code style fixes unless you have push rights to the GIMP's
repository.
## Git usage
### Commit messages
Commit messages should follow the following rules:
- Always provide informative titles. No one-word commits saying nothing
like "bug fix", so that we can at least search through the git history
if needed. It can still be short messages for very simple fixes: for
instance "Fix typo" or "Fix small memory leak" are informative of the
type of fix.
- Prefix the title with the codebase section (i.e. the root folder
usually) which was changed. For instance: `libgimpbase: fix memory
leak` immediately tells us it was a memory leak fix in the
`libgimpbase` library. If several sections are touched, list them with
comma-separation.
- Alternatively, when the change is a response to a bug report, you may
prefix with `Issue #123:` (where `#123` is the report ID) instead.
- If the changed code itself is not self-explanatory enough, you can add
longer change description (2 lines after the title) to explain more.
It is not mandatory, but it is never unwelcome because old code
exploration to understand why things were done (possibly years before
by people long gone) is a real thing we do all the time. So if it's
not obvious, explain us.
- Explanations can also be made in the shape of links to a bug report
(ours, or a third-party project tracker, or some manual), even though
additional text explanations may still be useful (unfortunately URLs
may change or disappear). If the link is to our own bug tracker,
usually giving the ID is enough.
- Same [as for code](#line-width), wrap your commit message to
reasonable line widths, such as 72 or 80 maximum so that other
contributors don't have to scroll horizontally on narrow
vizualisation. There may be exceptions, for instance when pasting some
error messages which may end up confusing when wrapped. But other than
this, wrap your text (most `git` client would have a feature to do it
for you).
- If the title is too long because of the max-width settings, a common
format is to break it with '…' and to continue the title 2 lines below.
Then the description goes again 2 lines below.
Here is an example of a well formatted fix in the `plug-ins/` section:
```
plug-ins: fix file-gih.
We currently cannot call gimp_pdb_run_procedure() for procedures
containing arrays because this C-type doesn't contain the size
information (which is in a second parameter but since the rule is not
hard-coded, our API can't know this).
See issue #7369.
```
Here is another as a response to a bug report and a long title:
```
Issue #6695: Wrong tab after JPG export because of "Show preview"…
… feature.
Using the new gimp_display_present() function in file-jpeg to make sure
the original display is back to the top.
```
If you want to see more good examples, this `git` command will list
commits whose messages are generally well formatted:
`git log --author="Jehan\|mitch\|Jacob Boerema"`
### Linear git log
Nearly all our repositories (`gimp-web` being the exception) have a
fully linear history. The "merge commit" workflow is definitely good and
useful in some projects' workflow, especially with bigger projects with
many contributors and subdivided maintenance roles (where the main tree
is mostly about merging public trees of several submaintainers' public
trees, who themselves applied contributed commits by individuals).
This doesn't work well with GIMP's current workflow and our number of
contributors. This is even worse with the completely useless merge
commits created by hosting tools which completely misused (or even
misunderstood) the merge concept.
This is why our Gitlab projects are configured to only push commits
linearly. This means that when a contributed tree is behind, you must
first rebase it through the "Rebase" button in the merge request (which
requires contributors to check the "*Allow commits from members who can
merge to the target branch*" option) or by rebasing in the tree then
force-pushing when Gitlab is unable to merge.
When you push directly (for contributors with push rights), you are also
expected to never push a merge commit.
## C code
### Line width
The recommended line width for source files is _80 characters_ whenever possible.
Longer lines are usually an indication that you either need a function or a
pre-processor macro.
The point is to have clear code to read and not overly long lines. Don't break
code into ugly and choppy parts to blindly follow this rule.
Function definitions in the function forward declaration block don't have to
obey the 80 characters limit. The only general rule for headers is to align the
function definitions vertically in three columns.
See more information in [Headers sections](#Headers)
### Whitespaces
#### Indentation
Each new level is indented 2 or more spaces than the previous level:
```c
if (condition)
single_statement ();
```
Use only __space characters__ to achieve this. Code indented with tabs will not
be accepted into the GIMP codebase.
Even if two spaces for each indentation level allow deeper nesting, GIMP favors
self-documenting function names that can be quite long. For this reason, you
should avoid deeply nested code.
#### Vertical spaces (new lines)
Except for one single newline at the end of the file, other empty lines (at the
beginning and the end) of a file are not allowed.
On the other hand, empty lines in the middle of code are very encouraged
for well-ventilated code. For instance gathering and separating code by
logical parts making it easy to read and understand.
#### Horizontal spaces
Always put a space before an opening parenthesis but never after:
```c
/* valid */
if (condition)
do_my_things ();
/* valid */
switch (condition)
{
}
/* invalid */
if(condition)
do_my_things();
/* invalid */
if ( condition )
do_my_things ( );
```
Do not eliminate whitespace and newlines just because something would
fit on 80 characters:
```c
/* invalid */
if (condition) foo (); else bar ();
```
#### Tab characters in strings
Use `\t` instead of literal tab inside the source code strings.
### Braces
#### If-else
Don't use curly braces for single statement blocks:
```c
/* valid */
if (condition)
single_statement ();
else
another_single_statement (arg1);
```
In the case of multiple statements, put curly braces on another indentation level:
```c
/* valid */
if (condition)
{
statement_1 ();
statement_2 ();
statement_3 ();
}
/* invalid */
if (condition) {
statement_1 ();
statement_2 ();
}
/* invalid */
if (condition)
{
statement_1 ();
statement_2 ();
}
```
The "no block for single statements" rule has only three exceptions:
_Both sides of the if-else statement_ must have curly braces when
either side of this if-else statement has braces or when
the single statement covers multiple lines, and it's followed
by else or else if (e.g., for functions with many arguments).
```c
/* valid */
if (condition)
{
a_single_statement_with_many_arguments (some_lengthy_argument,
another_lengthy_argument,
and_another_one,
plus_one);
}
else
{
another_single_statement (arg1, arg2);
}
```
② if the condition is composed of many lines:
```c
/* valid */
if (condition1 ||
(condition2 && condition3) ||
condition4 ||
(condition5 && (condition6 || condition7)))
{
a_single_statement ();
}
```
③ In the case of nested if's, the block should be placed on the outermost if:
```c
/* valid */
if (condition)
{
if (another_condition)
single_statement ();
else
another_single_statement ();
}
/* invalid */
if (condition)
if (another_condition)
single_statement ();
else if (yet_another_condition)
another_single_statement ();
```
#### Switch
A `switch()` should open a block on a new indentation level, and each case
should start on the same indentation level as the curly braces, with the
case block on a new indentation level:
```c
/* valid */
switch (condition)
{
case FOO:
do_foo ();
break;
case BAR:
do_bar ();
break;
}
/* invalid */
switch (condition) {
case FOO: do_foo (); break;
case BAR: do_bar (); break;
}
/* invalid */
switch (condition)
{
case FOO: do_foo ();
break;
case BAR: do_bar ();
break;
}
/* invalid */
switch (condition)
{
case FOO:
do_foo ();
break;
case BAR:
do_bar ();
break;
}
```
It is preferable, though not mandatory, to separate the various cases with
a newline:
```c
switch (condition)
{
case FOO:
do_foo ();
break;
case BAR:
do_bar ();
break;
default:
do_default ();
break;
}
```
If a case block needs to declare new variables, the same rules as the inner
blocks (see above) apply; place the break statement outside of the inner block:
```c
switch (condition)
{
case FOO:
{
int foo;
foo = do_foo ();
}
break;
...
}
```
Do not add `default:` case if your `switch ()` is supposed to handle _all cases_.
#### Random blocks
Using blocks to group code is discouraged and must not be used in newly
written code.
```c
int retval = 0;
gbool condition = retval >= 0;
statement_1 ();
statement_2 ();
/* discouraged in newly written code */
{
int var1 = 42;
gboolean res = FALSE;
res = statement_3 (var1);
retval = res ? -1 : 1;
}
```
### Conditions
Do not check boolean values for equality:
```c
/* valid */
if (another_condition)
do_bar ();
/* invalid */
if (condition == TRUE)
do_foo ();
```
Even if C handles NULL equality like a boolean, be explicit:
```c
/* valid */
if (some_pointer == NULL)
do_blah ();
/* invalid */
if (some_other_pointer)
do_blurp ();
```
When conditions split over multiple lines, the logical operators should always
go at the end of the line. Align the same level boolean operators to show
explicitly which are on the same level and which are not:
```c
/* valid */
if (condition1 &&
condition2 &&
(condition3 || (condition4 && condition5)))
{
do_blah ();
}
/* invalid */
if (condition1
|| condition2
|| condition3)
{
do_foo ();
}
```
### Variables declaration and definition
Place each variable on a new line. The variable name must be right-aligned,
taking into account pointers:
```c
/* valid */
int first = 42;
gboolean second = TRUE;
GimpObject *third = NULL;
```
Blocks of variable declaration/initialization should align the variable names,
allowing quick skimming of the variable list.
### Functions
Function header has the return type on one line; the name starting in the first
column of the following line. Prototype each parameter and place each on a
new line.
In function names, each word must be lowercase and separated by an underscore.
In the function definition, place the return value on a separate line from the
function name:
```c
void
my_function (void)
{
}
```
The parameters list must be broken into a new line for each parameter, with the
parameter names right-aligned, taking into account pointers:
```c
void
my_function (some_type_t some_param,
another_type_t *a_pointer_param,
final_type_t final_param)
{
}
```
While curly braces for function definitions should rest on a new line they
should not add an indentation level:
```c
/* valid */
static void
my_function (int parameter)
{
do_my_things ();
}
```
The alignment also holds when invoking a function:
```c
align_function_arguments (first_argument,
second_argument,
third_argument);
```
If your function name is very long, it's always better to extract arguments into
separate variables to improve readability:
```c
/* valid */
first_a = argument_the_first;
second_a = argument_the_second;
a_very_long_function_name_with_long_arguments (first_a, second_a);
```
Keep the function name and the arguments on the same line. Otherwise, it will
hurt readability.
```c
/* invalid */
a_very_long_function_name_with_long_arguments
(argument_the_first, argument_the_second);
```
### Macros
Try to avoid private macros unless strictly necessary. Remember to `#undef`
them at the end of a block or a series of functions needing them.
Use inline functions instead of private macro definitions.
Do not use public macros unless they evaluate to a constant.
### Includes
GIMP source files should never include the global `gimp.h` header, but instead
include the individual headers that are needed.
Includes must be in the following order:
0. `config.h` first;
0. System and third-party headers;
0. GIMP library headers (libgimp* headers);
0. GIMP core/app headers that it needs including its own;
Sort alphabetically the includes within the blocks.
```c
/* valid */
#include "config.h"
#include <gegl.h>
#include <gtk/gtk.h>
#include "libgimpbase/gimpbase.h"
#include "libgimpcolor/gimpcolor.h"
#include "core/gimp.h"
#include "core/gimpcontainer.h"
#include "gimpcolorpanel.h"
#include "gimpcontainerentry.h"
```
### Structures
When declaring a structure type use newlines to separate logical sections:
```c
/* preferred for new code*/
typedef struct
{
gint n_pages;
gint *pages;
gbool read_only;
} Pages;
```
### Memory management
To dynamically allocate data on the heap, use `g_new()`. To allocate memory for
multiple small data structures, `g_slice_new()`.
When possible, all public structure types should be returned fully initialized,
either explicitly for each member or by using g_new0() or g_slice_new0().
As a general programming rule, it is better to allocate and free data on the
same level. It is much easier to review code because you know that when you
allocate something there, then you also free it there.
```c
GeglBuffer *buffer;
void *p;
*buffer = gegl_buffer_new (some, args);
*p = g_new (something, n);
/* do stuff */
g_object_unref (buffer);
g_free (p);
```
When a transfer of ownership is unavoidable make it clear in the function
documentation.
### Comments
#### In-code explanation
The only allowed style is C-style comments `/* */`. In particular C++
comments `//` are strictly forbidden from our source.
We are not asking contributors to over-comment their code, yet we highly
value quality comments to explain complicated algorithms or non-obvious
code. Just ask yourself this: what if someone sees my code 5 years later
(another contributor or even your future self)…
- will one easily understand what you meant to do?
- In particular: if it needs to be removed later, won't one be scared to
delete now-useless code by fear of unexpected side-effects?
- Or oppositely: won't someone delete the code by mistake because it
looks useless while it was actually dealing with a very particular
(yet absolutely non-obvious) issue?
Adding links which explain well a problem or the reason for some
non-obvious code is also permitted. For instance a link to a bug report
(ours or some other projects') can sometimes be a good complement to a
comment.
Nevertheless it should not be overdone and in particular not for links
likely to disappear (personal blog posts, forums, corporate websites
which often revamp their design, breaking URLs, etc.).
#### Public API Documentation
All public APIs (i.e. any function exported in a header inside
`libgimp*/` folders) **MUST** have proper GObject-introspection (GIR) comments.
For functions, these should be placed in the source file directly above.
These annotations are also relevant for [GObject
Introspection](https://gi.readthedocs.io/en/latest/annotations/giannotations.html)
to generate bindings for other languages.
```c
/* valid */
/**
* gimp_object_set_name:
* @object: a #GimpObject
* @name: the @object's new name (transfer none)
*
* Sets the @object's name. Takes care of freeing the old name and
* emitting the ::name_changed signal if the old and new name differ.
**/
void
gimp_object_set_name (GimpObject *object,
const gchar *name)
{
...
}
```
Doc comments for macros, function types, class structs, etc., should be placed
next to the definitions, typically in headers.
#### Non-public API documentation
Project-only code (for instance any code from the `app/` folder) can be
less documented. For instance when a function has obvious naming, not
explaining it is perfectly acceptable.
Nevertheless adding documentation even for these private APIs is
welcome, especially when the usage is not as obvious as it looks, or
to make sure to advertize the proper memory handling (does it allocate
new memory? Which function to free it with? Or shouldn't the returned
memory be freed?), avoiding silly bugs and not wasting developer times
(when we have to look at the implementation to verify each time we use a
function).
In such a case, using gtk-docs syntax is still a nice idea as we will
understand it directly (even though we won't generate any docs from it).
### Public API
#### No variables
Avoid exporting variables as public API since this is cumbersome on some
platforms. It is always preferable to add getters and setters instead.
#### Def files for Windows
List all public functions alphabetically in the corresponding `.def` file.
- `app/gimpcore.def`
- `libgimp/gimp.def`
- `libgimpbase/gimpbase.def`
- etc
## Natural language text
### Base rules
Any text in GIMP source should follow these base rules:
- Our base language is US English, both for historical reason and
because this is the usual expectation with `gettext`, the
localization tool used by GIMP. In particular when variants of words
or idioms exist in several native English countries, we should choose
the US variant. Other English variants can be used in specific locales
(such as `en_GB` or `en_CA`…).
- Text meant for technical people, such as API documentation (in-code
comments, in-repository documentation, or gtk-doc/docgen style
comments for generated docs…) usually does not need localization, and
therefore can just be written in US English.
- Text meant to be viewed by all users should be translatable. In
particular in GIMP source code, it means that we need to use `gettext`
API.
- Use gender-neutral terms, in particular not using words such as "she/he"
or "her/his" is better. We should not use over-complicated wording to
achieve this and should look for simpler writing if necessary.
- Be nice and open-minded in all text, even in code comments. Remember
these will be read by others and that we are here to have fun
together, not fight.
### User-visible text in C code
As explained, C code uses the gettext API. Any text which might appear
in front of people should be translatable, with the following
exceptions:
- Error or warning output in `stderr` might often be untranslated
(because we assume these are mostly used for debugging and people who
will see these would be more comfortable with digging into issue
causes; also it makes debugging and searches in code easier).
- Technical error text in the graphical interface when it is made to be
reported to developers. Basically error messages meant for users
themselves should still be translatable. For instance, if one tries to
draw on a layer group, we'd display:
```C
_("Cannot modify the pixels of layer groups.")
```
Indeed this is an error message to give an information to the user.
It's not a bug.
Now when a crash happens, we add a translated header message to
explain a problem occured, but the core information stays in English
because we are not asking people to understand it, only report it to
us.
The most common variant of gettext API is the underscore `_()` (alias of
`gettext()`) for simple text:
```C
frame = gimp_frame_new (_("Shadows"));
```
When used in some widgets, we may want to add mnemonics for
accessibility. This is done with the underscore:
```C
label = gtk_label_new_with_mnemonic (_("_Width:"));
```
Note that it is a good idea to not change well-known mnemonics, such as
`_("_OK")`, `_("_Cancel")` or `_("_Reset")`. Also you should avoid using
the same mnemonics in 2 widgets on the same interface (even though GTK
has some way to handle mnemonic duplicate, but it's not really
practical).
Translators may (and often will) change mnemonics. It is therefore up to
them to take care of not having the same mnemonics on a same interface
in their specific locale.
When some messages cannot be translated at initialization, you must use
the no-op variant `N_()`. For instance, when we declare and initialize a
struct:
```C
static const struct
{
const gchar *name;
const gchar *description;
}
babl_descriptions[] =
{
{ "RGB u8", N_("RGB") },
[…]
{ "Y u8", N_("Grayscale") },
[…]
{ "R u8", N_("Red component") },
[…]
{ "G u8", N_("Green component") },
[…]
};
```
The normal gettext `_()` would not compile because you must initialize
struct elements with constants. `N_()` allows the gettext tools to
detect the strings which will need to go into the translator files.
Note though that these strings will still need to be translated when
used at runtime:
```C
g_hash_table_insert (babl_description_hash,
(gpointer) babl_descriptions[i].name,
gettext (babl_descriptions[i].description));
```
Finally note that for any strings which depends on a variable number,
you must use the ngettext variant:
```C
desc = g_strdup_printf (ngettext ("Crop Layer to Selection",
"Crop %d Layers to Selection",
g_list_length (layers)),
g_list_length (layers));
```
It is important to use `ngettext()` even in cases where there will
always be a count bigger than 1. Say our indexed image do not support
the monochrome (1 color) case, and even less 0 colors, then this seems
useless because we will always use the second string only:
```C
g_snprintf (buf, sizeof (buf),
ngettext ("Indexed color (monochrome)",
"Indexed color (%d colors)",
gimp_image_get_colormap_size (image)),
gimp_image_get_colormap_size (image));
```
Yet it's actually not useless as it allows translators for languages
with more plural forms to translate GIMP correctly. For instance,
[gettext documentation](https://www.gnu.org/software/gettext/manual/gettext.html#Plural-forms)
mentions the Polish language has different grammatical agreements for
2,3,4 and 5-21 or again 22-24 and so on. If we were to use solely
`_("Indexed color (%d colors)")`, Polish translators would not be able
to list all these cases (therefore GIMP would have a crappy Polish
localization), so we have to use `ngettext()` even if it feels useless
in English.
Finally when you add translated strings in a file which had none until
now, for it to be processed by `gettext`, you need to add its path in
alphabetical order in `po/POTFILES.in` for core files (or other
`POTFILES.in`, for instance `po-plug-ins/POTFILES.in` for plug-ins). We
have a test checking this, so the `make distcheck` step will fail anyway
when you forgot to add a new file with translation. Yet as developers
don't always run this step locally, the bug may be discovered during CI
builds. It is obviously prefered to not forget it hence not push code
which breaks the CI (and localization).
## Helping tools
### Git
We recommend enabling the default git pre-commit hook that detects trailing
whitespace and non-ASCII filenames for you and helps you to avoid corrupting
GIMP's tree with it.
In the terminal, navigate into your GIMP source code folder. Then do that as
follows (one command at a time):
```shell
cp -v .git/hooks/pre-commit.sample .git/hooks/pre-commit
chmod a+x .git/hooks/pre-commit
```
If any command above fails, visit your `.git/hooks/` folder and check for the
existence of `pre-commit.sample` or `pre-commit` files.
You might also find the `git-stripspace` utility helpful, which acts as a filter
to remove trailing whitespace as well as initial, final, and duplicate blank
lines.
### Code editor / Integrated Development Environment (IDE)
GIMP's codebase is not tied to a specific editor or IDE. The whole build
can be performed from anywhere, and we don't care what you write your
code with (as long as it follows syntax rules from this document).
Several configuration files were contributed across the years to
configure your favorite software to follow our coding style.
You are very welcome to use them (or improve them and contribute the
change when they are not perfect):
- [.dir-locals.el](.dir-locals.el) for Emacs;
- [.kateconfig](.kateconfig) for Kate;
- [c.vim](devel-docs/c.vim) for Vim (check the top comments to see how
to enable it automatically when opening a file in the GIMP tree).
*Note: the Kate and Emacs config file should work out-of-the-box, but
the Vim one needs to be enabled explicitly because it is too powerful,
hence is basically [unsafe](https://github.com/vim/vim/issues/1015).*
If you use another software to write code, you are welcome to contribute
coding style files following our rules.
### Code Formatter
We don't use a code formatter to re-format code because it is unable to
handle special cases well as far as we know.
Nevertheless we would be interested to use these to perform at least
some soft verification of contributed patches. A CI-performed check
could help new contributors to fix their basic newcomer coding style
mistakes and free up reviewing contributors' time.
The tool Clang-format has been mentionned as relevant, though nobody has
written syntax files for this tool yet (contribution welcome for this
too). See also #950.

149
HACKING
View File

@@ -1,149 +0,0 @@
Requirements
------------
If you want to hack on the GIMP project, it will make your life easier
to have the following packages (or newer versions) installed:
* GNU autoconf 2.54 or over
- ftp://ftp.gnu.org/gnu/autoconf/
* GNU automake 1.13 or over
- ftp://ftp.gnu.org/gnu/automake/
* GNU libtool 1.5 or over
- ftp://ftp.gnu.org/gnu/libtool/
Alternatively a build with meson 0.54.0 or over is possible but it is
not complete yet, hence not usable for packaging (yet usable for
development).
Fine GNU mirrors are listed at https://www.gnu.org/prep/ftp.html
Beta software can be found at alpha.gnu.org.
* pkg-config 0.16.0 (or preferably a newer version)
- https://www.freedesktop.org/software/pkgconfig/
* xsltproc
- ftp://ftp.gnome.org/pub/GNOME/sources/libxslt/1.1/
These are only the additional requirements if you want to compile from
the git repository. The file INSTALL lists the various libraries we
depend on.
Compilation
-----------
If you are accessing gimp via git, then you will need to take several
steps to get it to compile. You can do all these steps at once by
running:
gimp/trunk$ ./autogen.sh
Basically this does the following for you:
gimp/trunk$ aclocal-1.9; libtoolize; automake-1.9 -a;
gimp/trunk$ autoconf; intltoolize --automake
The above commands create the "configure" script. Now you can run the
configure script in gimp/trunk to create all the Makefiles.
Before running autogen.sh or configure, make sure you have libtool in
your path. Also make sure glib-2.0.m4 glib-gettext.m4, gtk-2.0.m4,
pkg.m4 and intltool.m4 are either installed in the same
$prefix/share/aclocal relative to your automake/aclocal installation
or call autogen.sh as follows:
$ ACLOCAL_FLAGS="-I $prefix/share/aclocal" ./autogen.sh
Note that autogen.sh runs configure for you. If you wish to pass
options like --prefix=/usr to configure you can give those options to
autogen.sh and they will be passed on to configure.
If AUTOGEN_CONFIGURE_ARGS is set, these options will also be passed to
the configure script. If for example you want to enable the build of
the GIMP API reference manuals, you can set AUTOGEN_CONFIGURE_ARGS to
"--enable-gtk-doc". Please note that you will then need a recent
version of gtk-doc as well as a working setup for handling DocBook/XML.
If you do not have a recent version of gtk-doc, you can pass the
option "--disable-gtk-doc" to autogen.sh. This will completely
disable the support for gtk-doc so you will not be able to generate
the API documentation.
If you want to use libraries from a non-standard prefix, you should set
PKG_CONFIG_PATH appropriately. Some libraries do not use pkgconfig, see
the output of ./configure --help for information on what environment
variables to set to point the compiler and linker to the correct path.
Note that you need to do this even if you are installing Gimp itself
into the same prefix as the library.
Git
---
GIMP is available from GNOME Git. You can use the following commands
to get GIMP from the the git server:
$ git clone https://gitlab.gnome.org/GNOME/gimp.git
You can read more on using GNOME's git service at these URLs:
https://wiki.gnome.org/Git
https://www.kernel.org/pub/software/scm/git/docs/
You will also need relatively new stable releases of glib, pango, atk,
gtk+, cairo, gtkhtml2, etc. for building GIMP, which you can get as a
part of recent Linux distribution releases.
Patches
-------
The best way to submit patches is to provide files created with
git-format-patch. The recommended command for a patch against the
`master` branch is:
$ git format-patch origin/master
It is recommended that you file a bug report at
https://gitlab.gnome.org/GNOME/gimp
and either create a merge request or attach your patch to it as a plain
text file, not compressed. If your patch is reasonably small you can
submit it to the gimp-developer-list@gnome.org mailing list.
If the patch needs to be discussed, you should also consider using the
mailing list instead of Bugzilla because bug reports tend to be hard
to read if they contain too many comments. For the code, please try to
follow the guidelines given in Hackordnung, below.
Auto-generated Files
--------------------
Please notice that some files in the source are generated from other
sources. All those files have a short notice about being generated
somewhere at the top. Among them are the files ending in pdb.[ch] in
the libgimp directory and the files ending in cmds.c in the app/pdb
subdirectory. Those are generated from the respective .pdb files in
pdb/groups.
Hackordnung
-----------
We encourage you to follow the GIMP coding style throughout the GIMP
project. For the core components (application and libs) this coding
style is enforced. See separate CODING_STYLE.md for a detailed description
of the source code style.
Try to make use of GLib's object system as much as possible. Do not
create wrappers around functions of parent classes. If you end up
duplicating code, try to create a common parent class and implement
the common methods there.
Don't include headers in headers except where unavoidable (e.g. for
deriving objects). Opaque typedefs go to app/base/base-types.h,
app/core/core-types.h etc. See devel-docs/includes.txt for a
detailed description of the include policy.
Don't use the GTK wrappers around the GLib object and signal system.
One goal of GIMP development is to make the GIMP code more readable
and understandable. Please help us to achieve this goal by cleaning up
the present code and make sure that all new code follows the coding
guidelines.

View File

@@ -4,22 +4,30 @@ Installation instructions for GIMP @GIMP_APP_VERSION@
There are some basic steps to building and installing GIMP.
GIMP @GIMP_APP_VERSION@ replaces earlier GIMP 2.x versions. It is advised that you
uninstall them before installing GIMP @GIMP_APP_VERSION@. If you want to keep your
older GIMP 2.x installation in parallel to GIMP @GIMP_APP_VERSION@, you have to
choose a separate prefix which is not in your default library search
path.
GIMP @GIMP_APP_VERSION@ replaces earlier GIMP 2.99.x versions. It is advised to
uninstall them before installing GIMP @GIMP_APP_VERSION@. Since libgimp* libraries
and data are all versionned anyway, it is possible to keep your older
GIMP 2.x installation in parallel to GIMP @GIMP_APP_VERSION@ on a same prefix.
GIMP @GIMP_APP_VERSION@ is fully backward compatible to all earlier GIMP 2.x version.
Plug-ins and scripts written for GIMP 2.8, 2.6 or earlier GIMP 2.x
versions will continue to work and don't need to be changed nor
recompiled to be used with GIMP @GIMP_APP_VERSION@.
GIMP @GIMP_APP_VERSION@ is not backward compatible with GIMP 2.10 and earlier
versions. Plug-ins and scripts written for GIMP 2.10, 2.8, 2.6 or
earlier GIMP 2.x versions will not work because the API changed.
The most important part is to make sure the requirements for a build
are fulfilled. We depend on a number of tools and libraries which are
are fulfilled. We depend on a number of tools and libraries which are
listed below. For libraries this means you need to also have the
header files installed.
This file is generated (versions are filled by our build system) and
focuses on keeping an up-to-date list of dependencies intended to
packagers, contributors or whoever wants to compile GIMP from source.
Building and running self-built software often requires more setup, in
particular environment variables so that your system knows where to
find the various pieces of the software. The following document can
help in that regard:
https://developer.gimp.org/core/setup/build/
******************************************************************
* Unless you are experienced with building software from source, *
@@ -31,12 +39,10 @@ header files installed.
1. You need to have installed a recent version of pkg-config (>= @GIMP_PKGCONFIG_VERSION@) available
from https://www.freedesktop.org/software/pkgconfig/.
The compatible pkgconf utility would also work.
2. You need intltool (at least @INTLTOOL_REQUIRED_VERSION@, but preferably a newer version).
Intltool can be downloaded from
https://ftp.gnome.org/pub/gnome/sources/intltool/
You also need gettext version @XGETTEXT_REQUIRED_VERSION@ or over. Earlier gettext had
issues with script-fu localization, ending up in incomplete GIMP localization.
2. You need gettext version 0.19.8 or newer. Older versions did not have support yet
for certain file formats.
3. You need to have GEGL version @GEGL_REQUIRED_VERSION@ or newer and babl version
@BABL_REQUIRED_VERSION@ or newer. You can get them from https://gegl.org/ or clone
@@ -48,6 +54,13 @@ header files installed.
GEGL must be built with Cairo support, i.e. -Dcairo=enabled option (required
for some mandatory operations such as "gegl:npd").
Introspection must be enabled for both babl and GEGL with -Denable-gir=true
and -Dintrospection=true respectively. The only case where we don't build
GIR data is when cross-compiling because of the difficulty to make cross-tools
for GObject Introspection.
Nevertheless if you have working GIR cross-tools, you can force the expected
behavior with GIMP's meson option -Dcan-crosscompile-gir=true
Optional:
- build GEGL with libumfpack (SuiteSparse) (`-Dumfpack=enabled`)
@@ -62,10 +75,10 @@ header files installed.
"gegl:introspect" which is always built but deactivated unless
the `dot` tool from graphviz is available (runtime dependency).
4. You need to have installed GTK+ version @GTK_REQUIRED_VERSION@ or newer.
4. You need to have installed GTK version @GTK_REQUIRED_VERSION@ or newer.
GIMP also needs a recent version of GLib (>= @GLIB_REQUIRED_VERSION@), GDK-Pixbuf
(>= @GDK_PIXBUF_REQUIRED_VERSION@), and Pango (>= @PANGOCAIRO_REQUIRED_VERSION@). Sources for these can be grabbed
from ftp://ftp.gtk.org/.
(>= @GDK_PIXBUF_REQUIRED_VERSION@), and Pango (>= @PANGO_REQUIRED_VERSION@). Sources for these can be grabbed
from https://download.gnome.org/sources/.
5. We use cairo >= @CAIRO_REQUIRED_VERSION@, which is hosted at
https://www.cairographics.org/.
@@ -76,10 +89,13 @@ header files installed.
and fontconfig @FONTCONFIG_REQUIRED_VERSION@ or newer. Older versions are known to have
bugs that seriously affect the stability of GIMP.
We also require HarfBuzz @HARFBUZZ_REQUIRED_VERSION@ or newer, an
OpenType text shaping tool. As this is a dependency for Pango, you
will likely have it installed, but you may have to install a
development package for the headers.
On Windows, we recommend fontconfig 2.13.95 (or over) where support
of fonts in user directory (Windows 1809 feature) appeared.
We also require HarfBuzz @HARFBUZZ_REQUIRED_VERSION@ or newer, an OpenType text shaping
tool. As this is a dependency for Pango, you will likely have it
installed, but you may have to install a development package for
the headers.
7. The file-compressor plug-in requires zlib, libbzip2, and liblzma to
be installed. All these libraries are required dependencies.
@@ -87,8 +103,31 @@ header files installed.
8. For metadata access GIMP requires the gexiv2 @GEXIV2_REQUIRED_VERSION@ or newer library.
It is hosted at: https://wiki.gnome.org/Projects/gexiv2
9. libpng, libjpeg, libtiff and lcms are hard dependencies that can
not be disabled.
9. libpng, libjpeg, libtiff, librsvg and lcms are hard dependencies
that can not be disabled. poppler is also a hard dependency because
PDF is too common nowadays for it to be an option (at least for
import); and poppler-data (CJK and Cyrillic support in PDF) is also
required because no languages should be considered "second class
citizen". If we support PDF, let's support it properly, i.e.
exhaustively.
There might be some issues with librsvg, based on the fact newer
versions are in Rust which is not buildable on all platforms. Yet
SVG support was deemed too important to be considered "optional"
for a decent graphics activity. Nevertheless a packager really
intent to have GIMP running on an architecture with no Rust support
could still:
1) easily patch out the file-svg plug-in from build system;
2) build GIMP with -Dvector-icons=false. Ironically librsvg is
needed at build time for this option, in order to create PNG
variants of icons (making librsvg unneeded at runtime). So all it
takes is to have a build machine with librsvg to create the PNG
icons, package and deliver them for machines without librsvg.
This is the compromise we came with, i.e. officially making SVG a
first-class file format, yet explaining how you could ignore it if
you really wanted or needed to.
10. For MyPaint brushes, brushlib (libmypaint) @LIBMYPAINT_REQUIRED_VERSION@ is used.
The libmypaint repository is hosted at:
@@ -112,8 +151,9 @@ header files installed.
If installing from repository, install from branch "v1.3.x" or the
last tag "v1.y.z" (e.g. "v1.3.1" at time of writing).
In particular do NOT install from `master` branch which installs
brushes incompatible with GIMP (the `master` branch brushes are
targeted to libmypaint upcoming v2, not v1).
brushes incompatible with GIMP (the `master` branch and v2 brushes
are targeted to software using recent libmypaint which GIMP wasn't
ported to yet).
Also this is a data packages and therefore it will install the
pkg-config file inside `$PREFIX/share/pkgconfig/`. If you install
@@ -121,12 +161,39 @@ header files installed.
have to make sure your $PKG_CONFIG_PATH environment variable also
lists `$PREFIX/share/pkgconfig/`.
12. You may want to install other third party libraries or programs
12. GIMP uses GLib's GIO library to handle file URIs and any I/O in
general, transparently, regardless where the file is stored, i.e.
locally, remotely, with which scheme, and so on. GIO in turn
supports various backends through modules. We don't know all the
modules available but since HTTP and HTTPS are so pervasive
nowadays, we kind of consider a least GIO modules for these schemes
mandatory (it allows to open from a pasted URL or just drag'n drop
from e.g. a browser).
For HTTP support (and many other schemes), on Linux at least, you
should install `gvfs`:
https://wiki.gnome.org/Projects/gvfs
It is unclear whether `gvfs` can be built and installed on other
platforms such as Windows and macOS.
For HTTPS support, you should install `glib-networking`:
https://gitlab.gnome.org/GNOME/glib-networking
Of course there might be more modules providing support of more
storage backends. Ideally GIMP would have support to load from any
backend so packaging together with more GIO modules or recommending
them in a package manager would be ideal. In any case, installing
the ones for HTTP and HTTPS seems like the minimum nowadays.
13. You may want to install other third party libraries or programs
that are needed for some of the available plug-ins. We recommend
to check that the following libraries are installed: openjpeg,
webkit, libmng, librsvg, libwmf, libaa and libgs (Ghostscript).
libmng, libwmf, libaa and libgs (Ghostscript).
13. HEIF support depends on the libheif library. If you don't have
14. HEIF support depends on the libheif library. If you don't have
access to pre-built packages, the code is available at:
https://github.com/strukturag/libheif
@@ -136,29 +203,30 @@ header files installed.
libaom decoder and encoder (for AV1, i.e. AVIF files), otherwise
the plug-in is mostly useless.
14. GObject Introspection requires the following dependencies to be
15. GObject Introspection requires the following dependencies to be
built and installed with introspection as well: babl, cairo,
GdkPixbuf, GEGL, GIO, GLib, GObject and GTK+.
GdkPixbuf, GEGL, GIO, GLib, GObject and GTK.
15. Windows builds can now generate backtrace logs upon a crash.
16. Windows builds can now generate backtrace logs upon a crash.
The logs will be available in: %APPDATA%\GIMP\@GIMP_APP_VERSION@\CrashLog\
The feature depends on Dr.MinGW's ExcHndl library:
https://github.com/jrfonseca/drmingw
16. Configure GIMP by running the `configure' script. You may want
to pass some options to it, see below.
17. Optional step if compiling GIMP from git (unneeded from tarball): you need
to initialize submodules with command `git submodule update --init`.
17. Build GIMP by running `make'. The use of GNU make is recommended.
If you need to tweak the build to make it work with other flavours
of make, we'd appreciate if you'd send us a patch with the changes.
18. Configure GIMP by running `meson _build`. You may want to pass some
options to it, see below.
18. Install GIMP by running `make install'. In order to avoid clashes
with other versions of GIMP, we install a binary called gimp-@GIMP_APP_VERSION@.
By default there's also a link created so that you can type 'gimp'
to start gimp-@GIMP_APP_VERSION@.
19. Build GIMP by running `ninja -C _build'.
19. Summary of required packages and what version you need:
20. Install GIMP by running `ninja -C _build install'. In order to
avoid clashes with other versions of GIMP, we install a binary
called gimp-@GIMP_APP_VERSION@. By default there's also a link created so that
you can type 'gimp' to start gimp-@GIMP_APP_VERSION@.
21. Summary of required packages and what version you need:
Package Name Version
@@ -174,7 +242,8 @@ header files installed.
GIO
GLib @GLIB_REQUIRED_VERSION@
glib-networking
GTK+ @GTK_REQUIRED_VERSION@
GTK @GTK_REQUIRED_VERSION@
gvfs (on Linux)
HarfBuzz @HARFBUZZ_REQUIRED_VERSION@
libbzip2
libjpeg
@@ -183,22 +252,24 @@ header files installed.
libpng @LIBPNG_REQUIRED_VERSION@
libpoppler-glib @POPPLER_REQUIRED_VERSION@
librsvg @RSVG_REQUIRED_VERSION@
libtiff
libtiff @LIBTIFF_REQUIRED_VERSION@
Little CMS @LCMS_REQUIRED_VERSION@
mypaint-brushes-1.0
pangocairo @PANGOCAIRO_REQUIRED_VERSION@
pangocairo @PANGO_REQUIRED_VERSION@
poppler-data @POPPLER_DATA_REQUIRED_VERSION@
zlib
20. Summary of optional packages:
22. Summary of optional packages:
Package Name Version Feature
cairo-pdf @CAIRO_PDF_REQUIRED_VERSION@ PDF export
cfitsio - FITS
ExcHndl - Crash logs on Windows with Dr. MinGW
gs - ghostscript
libaa - ASCII art
libheif @LIBHEIF_REQUIRED_VERSION@ HEIF
libilbm - Amiga IFF/ILBM
libmng - MNG
libwebp @WEBP_REQUIRED_VERSION@ WebP (built with --enable-libwebpmux and --enable-libwebpdemux)
libwmf @WMF_REQUIRED_VERSION@ WMF
@@ -206,10 +277,12 @@ header files installed.
libxpm - XPM
openexr @OPENEXR_REQUIRED_VERSION@ OpenEXR
OpenJPEG @OPENJPEG_REQUIRED_VERSION@ JPEG 2000
Python @PYTHON3_REQUIRED_VERSION@ Python 3 plug-ins
qoi - QOI
webkit @WEBKITGTK_REQUIRED_VERSION@ Help browser & webpage
vala - Vala plug-ins
21. Summary of optional runtime dependencies:
23. Summary of optional runtime dependencies:
darktable >= 1.7, with lua support enabled for raw loading
RawTherapee >= 5.2 for raw loading
@@ -217,10 +290,10 @@ header files installed.
sendmail for sending emails if --with-sendmail enabled
gdb or lldb for our new bug-reporting dialog
"gegl:matting-levin" GEGL operation for alternative matting engine
Python @PYTHON3_REQUIRED_VERSION@ and PyGObject for Python 3 plug-ins
GJS for Javascript plug-ins
LuaJIT and LGI for Lua plug-ins
Lua 5.1 (or LuaJIT) and LGI for Lua plug-ins
dot for "Show Image Graph" (unstable branches)
xdg-desktop-portal implemented for your desktop for various D-Bus API (screenshot, color-picking…)
@@ -229,203 +302,139 @@ packages are included below. Here is an illustration of commands that
might be used to build and install GIMP. The actual configuration,
compilation and installation output is not shown.
% tar xvfz gimp-@GIMP_VERSION@.tar.gz # unpack the sources
% cd gimp-@GIMP_VERSION@ # change to the toplevel directory
% ./configure # run the `configure' script
% make # build GIMP
% make install # install GIMP
% tar xvf gimp-@GIMP_VERSION@.tar.xz # unpack the sources
% cd gimp-@GIMP_VERSION@ # change to the toplevel directory
% meson _build # `configure' step
% ninja -C _build # build GIMP
% ninja -C _build install # install GIMP
Note: if building from repository (not tarballs), you may notice a meson
build system is also available in the repository. It is not the main
build system and is not recommended for stable packages as it still has
several known issues, including build flag errors leading to crashes and
missing features.
We only invite contributors to use the meson build if they wish to help
with debugging.
The `configure' script examines your system, and adapts GIMP to run on
The `configure' step examines your system, and adapts GIMP to run on
it. The script has many options, some of which are described in the
generic instructions included at the end of this file. All of the
options can be listed using the command `./configure --help'. There
are several special options the GIMP `configure' script recognizes.
options can be listed using the command `meson configure' if you
successfully configured already, or by reading the file `meson_options.txt`.
There are several special options the GIMP configure script recognizes.
These are:
--disable-vector-icons. This option installs raster icons instead of
-Dvector-icons=false This option installs raster icons instead of
vector icons.
--enable-relocatable-bundle. This option forces GIMP to search some
-Drelocatable-bundle=yes This option forces GIMP to search some
resources (e.g. MyPaint brushes or libwmf fonts) relatively to the
running prefix, rather than using build-time paths.
--enable-shared and --disable-shared. This option affects whether
shared libraries will be built or not. Shared libraries provide
for much smaller executables. The default is to enable shared
libraries. Disabling shared libraries is almost never a good idea.
-Dansi=true This option causes stricter ANSI C checking to be
performed when compiling with GCC. The default is for strict
checking to be disabled. NOTE: This option is intended primarily as
a convenience for developers.
--enable-debug and --disable-debug. This option causes the build
process to compile with debugging enabled. If debugging is
disabled, GIMP will instead be compiled with optimizations turned
on. The default is for debugging to be disabled. NOTE: This
option is intended primarily as a convenience for developers.
--enable-profile and --disable-profile. This option causes the build
process to compile with execution profiling enabled. The default is
for profiling to be disabled. NOTE: This option is intended primarily
as a convenience for developers.
--enable-ansi and --disable-ansi. This option causes stricter
ANSI C checking to be performed when compiling with GCC. The
default is for strict checking to be disabled. NOTE: This option
is intended primarily as a convenience for developers.
--with-gimpdir=DIR. This option changes the default directory
GIMP uses to search for its configuration files from
~/.config/GIMP/@GIMP_APP_VERSION@ (the directory .config/GIMP/@GIMP_APP_VERSION@
in the user's home directory) to ~/.config/DIR/@GIMP_APP_VERSION@.
-Dgimpdir=DIR. This option changes the default directory GIMP uses to
search for its configuration files from ~/.config/GIMP/@GIMP_APP_VERSION@ (the
directory .config/GIMP/@GIMP_APP_VERSION@ in the user's home directory) to
~/.config/DIR/@GIMP_APP_VERSION@.
If DIR is an absolute path, the directory will be changed to DIR.
--with-shm=[none|sysv|posix|auto]. This option allows you to specify
how image data is transported between the core and plug-ins. Usually
the best way to do this is detected automatically.
-Dshmem-type=[none|sysv|posix|win32|auto]. This option allows you to
specify how image data is transported between the core and plug-ins.
Usually the best way to do this is detected automatically.
--without-aa. The AA plug-in needs libaa and configure checks for
its presence. Use --without-aa if you run into problems.
-Daa=disabled The AA plug-in needs libaa and configure checks for
its presence. Use -Daa=disabled if you run into problems.
--without-libxpm. The XPM plug-in needs libxpm and configure checks
-Dxpm=disabled The XPM plug-in needs libxpm and configure checks
for its presence. If for some reason you don't want to build the
XPM plug-in even though the library is installed, use
--without-libxpm to disable it explicitly.
-Dxpm=disabled to disable it explicitly.
--without-libmng. The MNG plug-in needs libmng and configure checks
-Dmng=disabled The MNG plug-in needs libmng and configure checks
for its presence. If for some reason you don't want to build the
MNG plug-in even though the library is installed, use
--without-libmng to disable it explicitly.
-Dmng=disabled to disable it explicitly.
--without-wmf. The WMF plug-in needs libwmf2 and configure checks for
its presence. Use --without-wmf if you run into problems.
-Dwmf=disabled The WMF plug-in needs libwmf2 and configure checks for
its presence. Use -Dwmf=disabled if you run into problems.
--without-webkit. If for some reason you don't want to build the
Help Browser plug-in, you can use --without-webkit to disable
it explicitly.
-Dwebkit-unmaintained=true We do not recommend to install the Help
browser and Webpage plug-ins anymore. If for some reason you want
these anyway, you can force the build with this explicit option.
--without-librsvg. If for some reason you want to build GIMP without
SVG support, you can build --without-librsvg.
-Dprint=false If for some reason you don't want to build the Print
plug-in based on the GtkPrint API, you can build with -Dprint=false.
--without-print. If for some reason you don't want to build the Print
plug-in based on the GtkPrint API, you can build with --without-print.
-Dalsa=disabled If you don't want to compile ALSA support into the
MIDI input controller module, you can use the -Dalsa=disabled option.
--without-alsa. If you don't want to compile ALSA support into the
MIDI input controller module, you can use the --without-alsa option.
-Dlinux-input=disabled If you don't want to compile the Linux Input
controller module, you can use the -Dlinux-input=disabled option.
--without-linux-input. If you don't want to compile the Linux Input
controller module, you can use the --without-linux-input option.
-Dgi-docgen=enabled|disabled This option controls whether the libgimp
C API references will be created using gi-docgen.
--without-hal. If you want to build the Linux Input controller module
without HAL support, you can use the --without-hal option.
-Dg-ir-doc=true This option controls whether the libgimp API
references for some binding languages will be created using
g-ir-doc-tool and yelp-build.
--without-mac-twain. If you don't want to compile the Mac OS X
TWAIN plug-in, you can use the --without-mac-twain option.
-Denable-multiproc=false This option allows you to disable support for
multiple processors. It is enabled by default.
--with-gif-compression=[lzw|rle|none]. Allows to tune the compression
algorithm used by the GIF plug-in. If you are afraid of Unisys' LZW
patent (which should have expired in most countries by now), you
can go for simple run-length encoding or even configure the plug-in
to create uncompressed GIFs.
--enable-gtk-doc. This option controls whether the libgimp API
references will be created using gtk-doc. The HTML pages are
included in a standard tarball, so you will only need this if you
are building from SVN.
--with-html-dir=PATH. This option allows to specify where the
libgimp API reference should be installed. You might want to modify
the path so it points to the place where glib and gtk+ installed
their API references so that the libgimp reference can link to
them.
--disable-mp. This option allows you to disable support for multiple
processors. It is enabled by default.
--with-sendmail[=PATH]. This option is used to tell GIMP to send email
-Dwith-sendmail[=PATH] This option is used to tell GIMP to send email
through sendmail instead of xdg-email. You can optionally indicate
where to find the sendmail command. Otherwise sendmail will simply
be searched in your $PATH at runtime.
--with-desktop-dir=[PATH]. This option specifies where to install
desktop files. These files are used by desktop environments that
comply to the specs published at freedesktop.org. The default
value ${prefix}/share should be fine if your desktop environment
is installed in the same prefix as gimp. No files are installed
if you call configure with --without-desktop-dir.
--disable-default-binary. Use this option if you don't want to make
-Denable-default-bin=false Use this option if you don't want to make
gimp-@GIMP_APP_VERSION@ the default GIMP installation. Otherwise a link called
gimp pointing to the gimp-@GIMP_APP_VERSION@ executable will be installed.
--disable-gimp-console. Use this option if you don't want the
-Denable-console-bin=false Use this option if you don't want the
gimp-console binary to be built in addition to the standard binary.
gimp-console is useful for command-line batch mode or as a server.
--without-python. If for some reason you don't want to install the
Python plug-ins, you can use --with-python=no. Oppositely you can
force the installations even without Python or PyGObject installed
by setting --with-python=force (these are runtime dependencies
which you can install later).
-Djavascript=false If for some reason you don't want to install the
JavaScript plug-ins, you can use -Djavascript=false.
--without-javascript. If for some reason you don't want to install the
JavaScript plug-ins, you can use --with-javascript=no. Oppositely
you can force the installations even without GJS installed by
setting --with-javascript=force (GJS is a runtime dependency which
you can install later).
-Dlua=false If for some reason you don't want to install the
Lua plug-ins, you can use -Dlua=false.
--without-lua. If for some reason you don't want to install the
Lua plug-ins, you can use --with-lua=no. Oppositely you can force
the installations even without LuaJIT or LGI installed by setting
--with-lua=force (these are runtime dependencies which you can
install later).
--without-vala. If for some reason you don't want to build the Vala
plug-ins, you can use --without-vala.
--without-script-fu. If for some reason you don't want to build the
Script-Fu plug-in, you can use --without-script-fu.
--without-xmc. The X11 Mouse Cursor(XMC) plug-in needs libXcursor
and configure checks for its presence. If for some reason you
don't want to build the XMC plug-in even though the library is
installed, use --without-xmc to disable it explicitly.
-Dvala-plugins=disabled If for some reason you don't want to install the
Vala plug-ins, you can use -Dvala-plugins=disabled.
The `make' command builds several things:
This list is manually maintained. To get an exhaustive listing of options,
read `meson_options.txt'.
Additionally meson supports a wide range of common built-in options. See
documentation: https://mesonbuild.com/Builtin-options.html
The `ninja' command builds several things:
- A bunch of public libraries in the directories starting with 'libgimp'.
- The plug-in programs in the 'plug-ins' directory.
- Some modules in the 'modules' subdirectory.
- The main GIMP program 'gimp-@GIMP_APP_VERSION@' in `app'.
The `make install' commands installs the GIMP header files associated
The `ninja install' command installs the GIMP header files associated
with the libgimp libraries, the plug-ins, some data files and the GIMP
executable. After running `make install' and assuming the build process
executable. After running `ninja install' and assuming the build process
was successful you should be able to run `gimp'.
When ./configure fails
When configure fails
======================
'configure' uses pkg-config, a tool that replaces the old foo-config
The configuration step uses pkg-config, a tool that replaces the old foo-config
scripts. The most recent version is available from
https://www.freedesktop.org/software/pkgconfig/
'configure' tries to compile and run a short GTK+ program. There are
'configure' tries to compile and run a short GTK program. There are
several reasons why this might fail:
* pkg-config could not find the file 'gtk+-2.0.pc' that gets installed
* pkg-config could not find the file 'gtk+-3.0.pc' that gets installed
with GTK. (This file is used to get information about where GTK+ is
installed.)
Fix: Either make sure that this file is in the path where pkg-config
looks for it (try 'pkg-config --debug' or add the location of
gtk+-2.0.pc to the environment variable PKG_CONFIG_PATH before running
gtk+-3.0.pc to the environment variable PKG_CONFIG_PATH before running
configure.
* Libraries you installed are not found when you attempt to start GIMP.
@@ -443,26 +452,26 @@ several reasons why this might fail:
or
LDFLAGS="-Wl,-rpath -Wl,/home/joe/lib" ./configure
* An old version of the GTK+ libraries was found instead of
* An old version of the GTK libraries was found instead of
your newly installed version. This commonly happens if a
binary package of GTK+ was previously installed on your system,
and you later compiled GTK+ from source.
binary package of GTK was previously installed on your system,
and you later compiled GTK from source.
Fix: Remove the old libraries and include files. If you are afraid
that removing the old libraries may break other packages supplied by
your distributor, you can try installing GLib, GTK+ and other
your distributor, you can try installing GLib, GTK and other
libraries in a different prefix after setting the environment
variable PKG_CONFIG_LIBDIR to point to lib/pkgconfig/ in that new
prefix so that it does not try to read the *.pc files from the
default directory (/usr/lib/pkgconfig). However, removing the old
packages is often the easier solution.
A detailed log of the ./configure output is written to the file
config.log. This may help diagnose problems.
A detailed log of the meson output is written to the file meson-logs/meson-log.txt.
This may help diagnose problems.
When ./configure fails on plug-ins
==================================
When meson configure fails on plug-ins
======================================
There are some GIMP plug-ins that need additional third-party libraries
installed on your system. For example to compile the plug-ins that load
@@ -481,102 +490,4 @@ before you run configure.
Set your CPPFLAGS environment variable to look for the header file in a
certain place, e.g. if you are working in a bash shell you would say:
export CPPFLAGS="-I<path_to_header_file> -I<path_to_another_one>"
before you run configure.
Generic Instructions for Building Auto-Configured Packages
==========================================================
To compile this package:
1. Configure the package for your system. In the directory that this
file is in, type `./configure'. If you're using `csh' on an old
version of System V, you might need to type `sh configure' instead to
prevent `csh' from trying to execute `configure' itself.
The `configure' shell script attempts to guess correct values for
various system-dependent variables used during compilation, and
creates the Makefile(s) (one in each subdirectory of the source
directory). In some packages it creates a C header file containing
system-dependent definitions. It also creates a file `config.status'
that you can run in the future to recreate the current configuration.
Running `configure' takes a minute or two.
To compile the package in a different directory from the one
containing the source code, you must use GNU make. `cd' to the
directory where you want the object files and executables to go and
run `configure' with the option `--srcdir=DIR', where DIR is the
directory that contains the source code. Using this option is
actually unnecessary if the source code is in the parent directory of
the one in which you are compiling; `configure' automatically checks
for the source code in `..' if it does not find it in the current
directory.
By default, `make install' will install the package's files in
/usr/local/bin, /usr/local/lib, /usr/local/man, etc. You can specify
an installation prefix other than /usr/local by giving `configure' the
option `--prefix=PATH'.
You can specify separate installation prefixes for machine-specific
files and machine-independent files. If you give `configure' the
option `--exec-prefix=PATH', the package will use PATH as the prefix
for installing programs and libraries. Normally, all files are
installed using the same prefix.
`configure' ignores any other arguments that you give it.
If your system requires unusual options for compilation or linking
that `configure' doesn't know about, you can give `configure' initial
values for some variables by setting them in the environment. In
Bourne-compatible shells, you can do that on the command line like
this:
CC='gcc -traditional' DEFS=-D_POSIX_SOURCE ./configure
The `make' variables that you might want to override with environment
variables when running `configure' are:
(For these variables, any value given in the environment overrides the
value that `configure' would choose:)
CC C compiler program.
Default is `cc', or `gcc' if `gcc' is in your PATH.
INSTALL Program to use to install files.
Default is `install' if you have it, `cp' otherwise.
INCLUDEDIR Directory for `configure' to search for include files.
Default is /usr/include.
(For these variables, any value given in the environment is added to
the value that `configure' chooses:)
DEFS Configuration options, in the form '-Dfoo -Dbar ...'
LIBS Libraries to link with, in the form '-lfoo -lbar ...'
If you need to do unusual things to compile the package, we encourage
you to teach `configure' how to do them and mail the diffs to the
address given in the README so we can include them in the next
release.
2. Type `make' to compile the package.
3. Type `make install' to install programs, data files, and
documentation.
4. You can remove the program binaries and object files from the
source directory by typing `make clean'. To also remove the
Makefile(s), the header file containing system-dependent definitions
(if the package uses one), and `config.status' (all the files that
`configure' created), type `make distclean'.
The file `configure.ac' is used as a template to create `configure' by
a program called `autoconf'. You will only need it if you want to
regenerate `configure' using a newer version of `autoconf'.
More autotools commands
=======================
GIMP uses the autotools build system which follows the GNU coding
standards. In particular all usual standard targets are obviously
supported (e.g. `make uninstall` for uninstalling) as well as common
variables and options, cross-compilation host and target, etc.
If you wish to know more, please refer to GNU documentation:
https://www.gnu.org/prep/standards/html_node/Managing-Releases.html
before you run meson.

22
LICENSE
View File

@@ -25,3 +25,25 @@
GNU LESSER GENERAL PUBLIC LICENSE -- see the 'COPYING' file in the
libgimp directory for details.
* Icon themes are licensed under Creative Commons by-sa 3.0 or 4.0. See
the 'COPYING' files in icons/Symbolic and icons/Color respectively.
* Any data used in artworks, such as brushes, patterns and the like, and more
broadly likely all data inside the data/ folder should be under a CC0 license
(Creative Commons Zero) or equivalent, i.e. "No rights Reserved", because GIMP
contributors clearly don't intend to claim any right on anyone's work just
because they used GIMP and its default data.
We cannot clearly give proper licensing on all existing data, prior to the
addition of this note in the LICENSE file (for historical reasons, simply
because their contributors are since long gone), though we can say that an
uncountable number of users have used these for dozens of years and never had
legal problems as far as we know (it is anyway unclear whether anyone could
really claim any right for very basic brush or pattern usage). Since 2015, we
even have a clear FAQ entry to explicitly say the GIMP project has no
intention whatsoever to put restrictions on people's work:
https://www.gimp.org/docs/userfaq.html#can-i-use-gimp-commercially
Therefore any new data file under the data/ folder will be expected to be CC0.
All contributors are expected to read the LICENSE file and therefore are
implicitly agreeing to license their data under CC0 by contributing it as core
GIMP data.

View File

@@ -1,170 +0,0 @@
## Process this file with automake to produce Makefile.in
ACLOCAL_AMFLAGS = -I m4macros ${ACLOCAL_FLAGS}
if WITH_PDBGEN
PDB = pdb
endif
SUBDIRS = \
m4macros \
cursors \
themes \
po \
po-libgimp \
po-plug-ins \
po-python \
po-script-fu \
po-tips \
po-windows-installer \
data \
desktop \
menus \
libgimpbase \
tools \
$(PDB) \
icons \
libgimpcolor \
libgimpmath \
libgimpconfig \
libgimpmodule \
libgimpthumb \
libgimpwidgets \
libgimp \
app \
app-tools \
$(GIMP_MODULES) \
$(GIMP_PLUGINS) \
$(GIMP_EXTENSIONS) \
etc \
devel-docs \
docs \
build
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = \
gimp-@GIMP_PKGCONFIG_VERSION@.pc \
gimpthumb-@GIMP_PKGCONFIG_VERSION@.pc \
gimpui-@GIMP_PKGCONFIG_VERSION@.pc
AUTHORS: authors.xml authors.xsl
if HAVE_XSLTPROC
$(XSLTPROC) -o $(@) $(top_srcdir)/authors.xsl $< || rm -f $(@)
endif
authors.md: authors.xml authors4gimp-web.xsl
if HAVE_XSLTPROC
$(XSLTPROC) --stringparam today "`date --iso-8601=seconds`" -o $(@) $(top_srcdir)/authors4gimp-web.xsl $< || rm -f $(@)
endif
EXTRA_DIST = \
AUTHORS \
COPYING \
ChangeLog \
ChangeLog.pre-1-0 \
ChangeLog.pre-1-2 \
ChangeLog.pre-2-0 \
ChangeLog.pre-2-2 \
ChangeLog.pre-2-4 \
ChangeLog.pre-2-6 \
ChangeLog.pre-git \
HACKING \
INSTALL \
LICENSE \
NEWS \
NEWS.pre-2-0 \
NEWS.pre-2-2 \
NEWS.pre-2-4 \
NEWS.pre-2-6 \
NEWS.pre-2-8 \
NEWS.pre-2-10 \
README \
README.i18n \
authors.dtd \
authors.xml \
authors.xsl \
config.h.win32 \
gimp-zip.in \
git-version.h
AM_DISTCHECK_CONFIGURE_FLAGS = --enable-gi-docgen --with-python=force --with-javascript=force --with-lua=force
check-defs:
@$(PYTHON) $(top_srcdir)/tools/defcheck.py $(top_srcdir) || \
( echo "*** .def files inconsistent ***"; exit 1; )
validate-authors:
if HAVE_XMLLINT
@cd $(srcdir); \
$(XMLLINT) --noout --valid authors.xml || \
( echo "*** authors.xml INVALID ***"; exit 1; )
endif
all-local: AUTHORS
dist-hook: check-defs validate-authors
CHANGELOG_START = 74424325abb54620b370f2595445b2b2a19fe5e7
ChangeLog: $(srcdir)/ChangeLog $(srcdir)/ChangeLog.pre-git
$(srcdir)/ChangeLog:
@echo Creating $@ based on git log
@if test -d "$(srcdir)/.git"; then \
(GIT_DIR=$(top_srcdir)/.git ./missing --run \
git log $(CHANGELOG_START)^.. --stat) | fmt --split-only > $@.tmp \
&& mv -f $@.tmp $@ && echo Appending ChangeLog.pre-git && cat ChangeLog.pre-git >> $@ \
|| ($(RM) $@.tmp; \
echo Failed to generate ChangeLog, your ChangeLog may be outdated >&2; \
(test -f $@ || echo git-log is required to generate this file >> $@)); \
else \
test -f $@ || \
(echo A git checkout and git-log is required to generate ChangeLog >&2 && \
echo A git checkout and git-log is required to generate this file >> $@); \
fi
.PHONY: $(srcdir)/ChangeLog
generated_sources = \
git-version.h
# Build git-version.h before anything in the subdirs as this is needed
# in the about and debug dialog (app/) and in the debug tool (tools/).
BUILT_SOURCES = $(generated_sources)
CLEANFILES = $(generated_sources)
# If git is available, always check if git-version.h should be
# updated. If git is not available, don't do anything if git-version.h
# already exists because then we are probably working with a tarball
# in which case the git-version.h we ship is correct.
git-version.h: update-git-version-header
@if test -e "$(top_srcdir)/.git"; then \
git_version="`git --git-dir=$(top_srcdir)/.git describe --always`"; \
git_version_abbrev="`git --git-dir=$(top_srcdir)/.git rev-parse --short HEAD`"; \
git_last_commit_year="`git --git-dir=$(top_srcdir)/.git log -n1 --reverse --pretty=%ci | cut -b 1-4`"; \
elif test ! -f "$@"; then \
git_version="Unknown, shouldn't happen"; \
git_version_abbrev="$$git_version"; \
git_last_commit_timestamp=-1; \
git_last_commit_year="`date -u '+%Y'`"; \
fi; \
if test -n "$$git_version"; then \
echo "#ifndef __GIT_VERSION_H__" > "$@.tmp"; \
echo "#define __GIT_VERSION_H__" >> "$@.tmp"; \
echo "#define GIMP_GIT_VERSION \"$$git_version\"" >> "$@.tmp"; \
echo "#define GIMP_GIT_VERSION_ABBREV \"$$git_version_abbrev\"" >> "$@.tmp"; \
echo "#define GIMP_GIT_LAST_COMMIT_YEAR \"$$git_last_commit_year\"" >> "$@.tmp"; \
echo "#endif /* __GIT_VERSION_H__ */" >> "$@.tmp"; \
fi
@if ( test -f "$@.tmp" && test -f "$@" && cmp "$@.tmp" "$@" > /dev/null ); then \
rm -f "$@.tmp"; \
elif test -f "$@.tmp"; then \
mv "$@.tmp" "$@"; \
echo " git HEAD changed: $@ regenerated"; \
fi
.PHONY: update-git-version-header

1868
NEWS

File diff suppressed because it is too large Load Diff

77
README
View File

@@ -4,16 +4,16 @@
------------------------------
This is an unstable development release, an intermediate state on the
way to the next stable release: GIMP 3. GIMP 2.99 may or may not do what
you expect. Save your work early and often. If you want a stable
way to the next stable release: GIMP 3.0. GIMP 2.99 may or may not do
what you expect. Save your work early and often. If you want a stable
version, please use GIMP 2.10 instead.
If you think you found a bug in this version, please make sure that it
hasn't been reported earlier and that it is not just new stuff that is
still being worked on and obviously not quite finished yet.
If you want to hack on GIMP, please read the file HACKING. For
detailed installation instructions, see the file INSTALL.
If you want to hack on GIMP, please read the file devel-docs/README.md.
For detailed installation instructions, see the file INSTALL.
1. Web Resources
@@ -26,46 +26,54 @@ GIMP's home page is at:
Please be sure to visit this site for information, documentation,
tutorials, news, etc. All things GIMP-ish are available from there.
There you can get the latest versions of plug-ins, using a convenient
forms-based interface.
The latest version of GIMP can be found at:
https://www.gimp.org/downloads/
We also have a website dedicated to documentation at:
2. Mailing Lists
================
We have several mailing lists dedicated to GIMP user and development
discussion. There is more info at
https://www.gimp.org/mail_lists.html
Links to several archives of the mailing lists are included in that page.
Gimp-user-list is a mailing list dedicated to user problems, hints and
tips, discussion of cool effects, etc. Gimp-developer-list is oriented
to GIMP core and plug-in developers. Gimp-gui-list is for discussing
about GIMP interface to improve user experience. Most people will only
want to be subscribed to gimp-user-list. If you want to help develop
GIMP, the gimp-developer mailing list is a good starting point; if you
want to help with GUI design, the gimp-gui list is where you want to
subscribe.
https://docs.gimp.org/
3. IRC
======
2. Contributing
===============
And finally, for the real junkies, there is an IRC channel devoted to
GIMP. On GIMPNet (a private free software oriented network) there is
#gimp. Many of the developers hang out there. Some of the GIMPNet
servers are:
GIMP source code can be found at:
https://gitlab.gnome.org/GNOME/gimp/
Resources for contributors:
https://developer.gimp.org/
In particular, you may want to look in the "Core Development" section. Some
articles of particular interest for newcomers could be:
* Setting up your developer environment: https://developer.gimp.org/core/setup/
* GIMP Coding Style: https://developer.gimp.org/core/coding_style/
* Submit your first patch: https://developer.gimp.org/core/submit-patch/
3. Discussion Channels
======================
We have several discussion channels dedicated to GIMP user and
development discussion. There is more info at:
https://www.gimp.org/discuss.html
For the real junkies, there are IRC channels (e.g. #gimp or #gimp-user)
devoted to GIMP on GIMPNet (a private free software oriented network).
Many of the developers hang out there. Some of the GIMPNet servers are:
irc.gimp.org:6667
irc.us.gimp.org:6667
irc.eu.gimp.org:6667
More discussion channels, such as forums, will be listed on the above
"discuss" page when they are moderated by a team member.
Links to archives of former discussion methods (e.g. mailing lists) are
also included in that page.
4. Customizing
==============
@@ -76,11 +84,8 @@ gtk.css in particular) or by using "themes" (ready-made customizations).
Additionally, GIMP reads `${XDG_CONFIG_HOME}/GIMP/2.99/gimp.css` so you
can have settings that only apply to GIMP.
Included is a set of keybindings similar to those in Adobe Photoshop.
You can find them in the ps-menurc file. To use them, copy this file
to `${XDG_CONFIG_HOME}/GIMP/2.99/menurc`. You can also manually change
the keybindings to any of your choice by editing:
`${XDG_CONFIG_HOME}/GIMP/2.99/menurc`.
You can also manually change the keybindings to any of your choice by
editing: `${XDG_CONFIG_HOME}/GIMP/2.99/shortcutsrc`.
Have fun,

View File

@@ -1,9 +0,0 @@
m4_include([m4macros/alsa.m4])
m4_include([m4macros/ax_compare_version.m4])
m4_include([m4macros/ax_cxx_compile_stdcxx.m4])
m4_include([m4macros/ax_gcc_func_attribute.m4])
m4_include([m4macros/ax_prog_cc_for_build.m4])
m4_include([m4macros/ax_prog_perl_version.m4])
m4_include([m4macros/detectcflags.m4])
m4_include([m4macros/python3dev.m4])
m4_include([m4macros/vapigen.m4])

View File

@@ -1,6 +0,0 @@
/Makefile
/Makefile.in
/.deps
/.libs
/gimp-debug-tool-2.99
/gimp-debug-tool-2.99.exe

View File

@@ -1,85 +0,0 @@
## Process this file with automake to produce Makefile.in
AUTOMAKE_OPTIONS = subdir-objects
libapp = $(top_builddir)/app/libapp.a
libappwidgets = $(top_builddir)/app/widgets/libappwidgets.a
libgimpbase = $(top_builddir)/libgimpbase/libgimpbase-$(GIMP_API_VERSION).la
if PLATFORM_OSX
xobjective_c = "-xobjective-c"
xobjective_cxx = "-xobjective-c++"
xnone = "-xnone"
framework_appkit = -framework AppKit
endif
if OS_WIN32
bin_PROGRAMS = gimp-debug-tool-@GIMP_TOOL_VERSION@
else
if PLATFORM_OSX
bin_PROGRAMS = gimp-debug-tool-@GIMP_TOOL_VERSION@
else
libexec_PROGRAMS = gimp-debug-tool-@GIMP_TOOL_VERSION@
endif
endif
gimp_debug_tool_@GIMP_TOOL_VERSION@_SOURCES = \
gimp-debug-tool.c
gimp_debug_tool_@GIMP_TOOL_VERSION@_CPPFLAGS = \
-DCC_VERSION=\""$(CC_VERSION)"\" \
-I$(top_srcdir)/app \
-I$(top_builddir)/app \
$(AM_CPPFLAGS) \
$(GIO_CFLAGS) \
$(GEGL_CFLAGS) \
$(GTK_CFLAGS) \
$(FONTCONFIG_CFLAGS)
gimp_debug_tool_@GIMP_TOOL_VERSION@_LDADD = \
$(libappwidgets) \
$(libapp) \
$(libgimpbase) \
$(GIO_LIBS) \
$(GEGL_LIBS) \
$(GTK_LIBS) \
$(FONTCONFIG_LIBS)
AM_CPPFLAGS = \
-DGIMP_APP_VERSION=\"@GIMP_APP_VERSION@\" \
-DLOCALEDIR=\""$(gimplocaledir)"\" \
-DPREFIX=\""$(prefix)"\" \
-DEXEC_PREFIX=\""$(exec_prefix)"\" \
-DBINDIR=\""$(bindir)"\" \
-DSBINDIR=\""$(sbindir)"\" \
-DLIBEXECDIR=\""$(libexecdir)"\" \
-DDATADIR=\""$(datadir)"\" \
-DDATAROOTDIR=\""$(datarootdir)"\" \
-DSYSCONFDIR=\""$(sysconfdir)"\" \
-DSHAREDSTATEDIR=\""$(sharedstatedir)"\" \
-DLOCALSTATEDIR=\""$(localstatedir)"\" \
-DLIBDIR=\""$(libdir)"\" \
-DINFODIR=\""$(infodir)"\" \
-DMANDIR=\""$(mandir)"\" \
-DGIMPPLUGINDIR=\""$(gimpplugindir)"\" \
-DGIMPDATADIR=\""$(gimpdatadir)"\" \
-DCC=\""$(CC)"\" \
-DGIMPDIR=\""$(gimpdir)"\" \
-DGIMP_PLUGIN_VERSION=\""$(GIMP_PLUGIN_VERSION)"\" \
-I$(top_srcdir) \
$(GTK_CFLAGS) \
-I$(includedir)
AM_CFLAGS = \
$(xobjective_c)
AM_CXXFLAGS = \
$(xobjective_cxx)
AM_LDFLAGS = \
$(framework_appkit) \
$(xnone)

View File

@@ -1,5 +1,11 @@
if platform_windows or platform_osx
gimp_debug_tool_dir = get_option('bindir')
else
gimp_debug_tool_dir = get_option('libexecdir')
endif
gimp_debug_tool = executable('gimp-debug-tool-' + gimp_app_version,
gimp_debug_tool = executable('gimp-debug-tool' + exec_ver,
'gimp-debug-tool.c',
include_directories: rootInclude,
dependencies: [
@@ -14,5 +20,17 @@ gimp_debug_tool = executable('gimp-debug-tool-' + gimp_app_version,
libgimpbase,
],
install: true,
install_dir: get_option('libexecdir')
install_dir: gimp_debug_tool_dir
)
if enable_default_bin
if not platform_windows
install_symlink(fs.name(gimp_debug_tool.full_path()).replace(exec_ver, ''),
pointing_to: fs.name(gimp_debug_tool.full_path()),
install_dir: gimp_debug_tool_dir
)
else
meson.add_install_script('sh', '-c',
'cp -f "@0@" "$MESON_INSTALL_DESTDIR_PREFIX/bin/@1@"'.format((gimp_debug_tool.full_path()), fs.name(gimp_debug_tool.name()).replace(exec_ver, '.exe')))
endif
endif

9
app/.gitignore vendored
View File

@@ -1,9 +0,0 @@
/.deps
/.libs
/Makefile
/Makefile.in
/gimp-2.*
/gimp-console-2.*
/gimp.rc
/libapp.a
/makefile.mingw

View File

@@ -1,295 +0,0 @@
## Process this file with automake to produce Makefile.in
if PLATFORM_OSX
xobjective_c = "-xobjective-c"
xobjective_cxx = "-xobjective-c++"
xnone = "-xnone"
endif
libgimpbase = $(top_builddir)/libgimpbase/libgimpbase-$(GIMP_API_VERSION).la
libgimpconfig = $(top_builddir)/libgimpconfig/libgimpconfig-$(GIMP_API_VERSION).la
libgimpcolor = $(top_builddir)/libgimpcolor/libgimpcolor-$(GIMP_API_VERSION).la
libgimpmath = $(top_builddir)/libgimpmath/libgimpmath-$(GIMP_API_VERSION).la
libgimpmodule = $(top_builddir)/libgimpmodule/libgimpmodule-$(GIMP_API_VERSION).la
libgimpwidgets = $(top_builddir)/libgimpwidgets/libgimpwidgets-$(GIMP_API_VERSION).la
libgimpthumb = $(top_builddir)/libgimpthumb/libgimpthumb-$(GIMP_API_VERSION).la
# Sort this by architectural dependencies, lowest level at the top,
# so that when e.g. changing a header-file the subdirs are built in
# the right order
SUBDIRS = \
config \
core \
operations \
gegl \
text \
vectors \
paint \
plug-in \
xcf \
file \
file-data \
pdb \
widgets \
propgui \
display \
tools \
dialogs \
actions \
menus \
gui \
. \
tests
# Put the GIMP core in a lib so we can conveniently link against that
# in test cases
noinst_LIBRARIES = libapp.a
if ENABLE_GIMP_CONSOLE
bin_PROGRAMS = gimp-@GIMP_APP_VERSION@ gimp-console-@GIMP_APP_VERSION@
else
bin_PROGRAMS = gimp-@GIMP_APP_VERSION@
endif
libapp_sources = \
about.h \
app.c \
app.h \
errors.c \
errors.h \
language.c \
language.h \
sanity.c \
sanity.h \
signals.c \
signals.h \
tests.c \
tests.h \
unique.c \
unique.h \
gimp-debug.c \
gimp-debug.h \
gimp-intl.h \
gimp-log.c \
gimp-log.h \
gimp-priorities.h \
gimp-update.c \
gimp-update.h \
gimp-version.c \
gimp-version.h
libapp_a_SOURCES = $(libapp_sources)
gimp_@GIMP_APP_VERSION@_SOURCES = $(libapp_sources) main.c
if PLATFORM_LINUX
libdl = -ldl
endif
if PLATFORM_OSX
framework_cocoa = -framework Cocoa
endif
if OS_WIN32
win32_ldflags = -mwindows -Wl,--tsaware $(WIN32_LARGE_ADDRESS_AWARE)
# for GimpDashboard and GimpBacktrace
psapi_cflags = -DPSAPI_VERSION=1
libpsapi = -lpsapi
# for GimpBacktrace
libdbghelp = -ldbghelp
# for I_RpcExceptionFilter()
librpcrt4 = -lrpcrt4
if HAVE_EXCHNDL
exchndl = -lexchndl
endif
else
libm = -lm
endif
if ENABLE_RELOCATABLE_RESOURCES
munix = -Wl,-rpath '-Wl,$$ORIGIN/../lib'
endif
if HAVE_WINDRES
include $(top_srcdir)/build/windows/gimprc.rule
GIMPRC = gimp-$(GIMP_APP_VERSION).rc.o
GIMPCONSOLERC = gimp-console-$(GIMP_APP_VERSION).rc.o
endif
AM_CPPFLAGS = \
-DGIMPDIR=\""$(gimpdir)"\" \
-DLIBEXECDIR=\""$(libexecdir)"\" \
-DGIMP_USER_VERSION=\"$(GIMP_USER_VERSION)\" \
-DGIMP_TOOL_VERSION=\"$(GIMP_TOOL_VERSION)\" \
-DG_LOG_DOMAIN=\"Gimp\" \
-DGIMP_APP_GLUE_COMPILATION \
-DCC_VERSION=\""$(CC_VERSION)"\" \
-I$(top_srcdir) \
$(GTK_CFLAGS) \
$(PANGOCAIRO_CFLAGS) \
$(GEGL_CFLAGS) \
$(LCMS_CFLAGS) \
$(GEXIV2_CFLAGS) \
$(psapi_cflags) \
$(xobjective_c) \
-I$(includedir) \
-I$(builddir)/gui
# We need this due to circular dependencies
AM_LDFLAGS = \
$(munix) \
-Wl,-u,$(SYMPREFIX)gimp_vectors_undo_get_type \
-Wl,-u,$(SYMPREFIX)gimp_vectors_mod_undo_get_type \
-Wl,-u,$(SYMPREFIX)gimp_config_param_spec_duplicate \
-Wl,-u,$(SYMPREFIX)gimp_operations_init \
-Wl,-u,$(SYMPREFIX)xcf_init \
-Wl,-u,$(SYMPREFIX)internal_procs_init \
-Wl,-u,$(SYMPREFIX)gimp_pdb_compat_procs_register \
-Wl,-u,$(SYMPREFIX)gimp_plug_in_manager_restore \
-Wl,-u,$(SYMPREFIX)gimp_layer_mode_is_legacy \
-Wl,-u,$(SYMPREFIX)gimp_parallel_init \
-Wl,-u,$(SYMPREFIX)gimp_async_set_new \
-Wl,-u,$(SYMPREFIX)gimp_uncancelable_waitable_new
gimpconsoleldadd = \
xcf/libappxcf.a \
pdb/libappinternal-procs.a \
pdb/libapppdb.a \
plug-in/libappplug-in.a \
vectors/libappvectors.a \
core/libappcore.a \
file/libappfile.a \
file-data/libappfile-data.a \
text/libapptext.a \
paint/libapppaint.a \
operations/libappoperations.a \
operations/layer-modes/libapplayermodes.a \
operations/layer-modes-legacy/libapplayermodeslegacy.a \
gegl/libappgegl.a \
config/libappconfig.a \
$(libgimpconfig) \
$(libgimpmath) \
$(libgimpthumb) \
$(libgimpcolor) \
$(libgimpmodule) \
$(libgimpbase) \
$(APPSTREAM_GLIB_LIBS) \
$(GDK_PIXBUF_LIBS) \
$(FREETYPE_LIBS) \
$(FONTCONFIG_LIBS) \
$(PANGOCAIRO_LIBS) \
$(HARFBUZZ_LIBS) \
$(CAIRO_LIBS) \
$(GIO_UNIX_LIBS) \
$(GIO_WINDOWS_LIBS) \
$(GEGL_LIBS) \
$(GLIB_LIBS) \
$(LCMS_LIBS) \
$(GEXIV2_LIBS) \
$(Z_LIBS) \
$(JSON_C_LIBS) \
$(LIBARCHIVE_LIBS) \
$(LIBMYPAINT_LIBS) \
$(LIBBACKTRACE_LIBS) \
$(LIBUNWIND_LIBS) \
$(INTLLIBS) \
$(RT_LIBS) \
$(libm) \
$(libdl) \
$(libpsapi) \
$(libdbghelp) \
$(librpcrt4)
gimp_@GIMP_APP_VERSION@_LDFLAGS = \
$(AM_LDFLAGS) \
$(win32_ldflags) \
$(framework_cocoa) \
-Wl,-u,$(SYMPREFIX)gimp_lebl_dialog \
-Wl,-u,$(SYMPREFIX)gimp_core_pixbufs_get_resource \
-Wl,-u,$(SYMPREFIX)gimp_tool_cursors_get_resource
gimp_@GIMP_APP_VERSION@_LDADD = \
gui/libappgui.a \
menus/libappmenus.a \
actions/libappactions.a \
dialogs/libappdialogs.a \
tools/libapptools.a \
display/libappdisplay.a \
propgui/libapppropgui.a \
widgets/libappwidgets.a \
$(libgimpwidgets) \
$(GTK_LIBS) \
$(GTK_MAC_INTEGRATION_LIBS) \
$(gimpconsoleldadd) \
$(exchndl) \
$(GIMPRC)
if ENABLE_GIMP_CONSOLE
gimp_console_@GIMP_APP_VERSION@_SOURCES = $(libapp_sources) main.c
gimp_console_@GIMP_APP_VERSION@_CPPFLAGS = \
$(AM_CPPFLAGS) \
-DGIMP_CONSOLE_COMPILATION
gimp_console_@GIMP_APP_VERSION@_LDADD = \
$(gimpconsoleldadd) \
$(GIMPCONSOLERC)
endif
install-exec-hook:
if DEFAULT_BINARY
cd $(DESTDIR)$(bindir) \
&& rm -f gimp$(EXEEXT) \
&& $(LN_S) gimp-$(GIMP_APP_VERSION)$(EXEEXT) gimp$(EXEEXT)
if ENABLE_GIMP_CONSOLE
cd $(DESTDIR)$(bindir) \
&& rm -f gimp-console$(EXEEXT) \
&& $(LN_S) gimp-console-$(GIMP_APP_VERSION)$(EXEEXT) gimp-console$(EXEEXT)
endif
endif
uninstall-local:
if DEFAULT_BINARY
rm -f $(DESTDIR)$(bindir)/gimp$(EXEEXT)
if ENABLE_GIMP_CONSOLE
rm -f $(DESTDIR)$(bindir)/gimp-console$(EXEEXT)
endif
endif
# require gimp-console when making dist
#
if ENABLE_GIMP_CONSOLE
dist-check-gimp-console:
else
dist-check-gimp-console:
@echo "*** gimp-console must be enabled in order to make dist"
@false
endif
# hook to assure that the system gimprc and the gimprc manpage are
# uptodate when a release is made
#
dist-dump-gimprc: gimp-console-$(GIMP_APP_VERSION)$(EXEEXT)
./$< --dump-gimprc-system > gimprc.tmp \
&& (cmp -s gimprc.tmp $(top_srcdir)/etc/gimprc.in || \
cp gimprc.tmp $(top_srcdir)/etc/gimprc.in) \
&& rm gimprc.tmp
./$< --dump-gimprc-manpage > gimprc.tmp \
&& (cmp -s gimprc.tmp $(top_srcdir)/docs/gimprc.5.in ||\
cp gimprc.tmp $(top_srcdir)/docs/gimprc.5.in) \
&& rm gimprc.tmp
dist-hook: dist-check-gimp-console dist-dump-gimprc

View File

@@ -1,7 +0,0 @@
/Makefile
/Makefile.in
/.deps
/.libs
/*.lo
/libappactions.a
/libappactions.la

View File

@@ -1,206 +0,0 @@
## Process this file with automake to produce Makefile.in
AM_CPPFLAGS = \
-DG_LOG_DOMAIN=\"Gimp-Actions\" \
-I$(top_builddir) \
-I$(top_srcdir) \
-I$(top_builddir)/app \
-I$(top_srcdir)/app \
$(GEGL_CFLAGS) \
$(GTK_CFLAGS) \
-I$(includedir)
noinst_LIBRARIES = libappactions.a
libappactions_a_SOURCES = \
actions-types.h \
actions.c \
actions.h \
\
gimpgeglprocedure.c \
gimpgeglprocedure.h \
\
brush-editor-actions.c \
brush-editor-actions.h \
brushes-actions.c \
brushes-actions.h \
buffers-actions.c \
buffers-actions.h \
buffers-commands.c \
buffers-commands.h \
channels-actions.c \
channels-actions.h \
channels-commands.c \
channels-commands.h \
colormap-actions.c \
colormap-actions.h \
colormap-commands.c \
colormap-commands.h \
context-actions.c \
context-actions.h \
context-commands.c \
context-commands.h \
cursor-info-actions.c \
cursor-info-actions.h \
cursor-info-commands.c \
cursor-info-commands.h \
dashboard-actions.c \
dashboard-actions.h \
dashboard-commands.c \
dashboard-commands.h \
data-commands.c \
data-commands.h \
data-editor-commands.c \
data-editor-commands.h \
debug-actions.c \
debug-actions.h \
debug-commands.c \
debug-commands.h \
dialogs-actions.c \
dialogs-actions.h \
dialogs-commands.c \
dialogs-commands.h \
dock-actions.c \
dock-actions.h \
dock-commands.c \
dock-commands.h \
dockable-actions.c \
dockable-actions.h \
dockable-commands.c \
dockable-commands.h \
documents-actions.c \
documents-actions.h \
documents-commands.c \
documents-commands.h \
drawable-actions.c \
drawable-actions.h \
drawable-commands.c \
drawable-commands.h \
dynamics-actions.c \
dynamics-actions.h \
dynamics-editor-actions.c \
dynamics-editor-actions.h \
edit-actions.c \
edit-actions.h \
edit-commands.c \
edit-commands.h \
error-console-actions.c \
error-console-actions.h \
error-console-commands.c \
error-console-commands.h \
file-actions.c \
file-actions.h \
file-commands.c \
file-commands.h \
filters-actions.c \
filters-actions.h \
filters-commands.c \
filters-commands.h \
fonts-actions.c \
fonts-actions.h \
gradient-editor-actions.c \
gradient-editor-actions.h \
gradient-editor-commands.c \
gradient-editor-commands.h \
gradients-actions.c \
gradients-actions.h \
gradients-commands.c \
gradients-commands.h \
help-actions.c \
help-actions.h \
help-commands.c \
help-commands.h \
image-actions.c \
image-actions.h \
image-commands.c \
image-commands.h \
images-actions.c \
images-actions.h \
images-commands.c \
images-commands.h \
items-commands.c \
items-commands.h \
items-actions.c \
items-actions.h \
layers-actions.c \
layers-actions.h \
layers-commands.c \
layers-commands.h \
mypaint-brushes-actions.c \
mypaint-brushes-actions.h \
palette-editor-actions.c \
palette-editor-actions.h \
palette-editor-commands.c \
palette-editor-commands.h \
palettes-actions.c \
palettes-actions.h \
palettes-commands.c \
palettes-commands.h \
patterns-actions.c \
patterns-actions.h \
plug-in-actions.c \
plug-in-actions.h \
plug-in-commands.c \
plug-in-commands.h \
procedure-commands.c \
procedure-commands.h \
quick-mask-actions.c \
quick-mask-actions.h \
quick-mask-commands.c \
quick-mask-commands.h \
sample-points-actions.c \
sample-points-actions.h \
sample-points-commands.c \
sample-points-commands.h \
select-actions.c \
select-actions.h \
select-commands.c \
select-commands.h \
templates-actions.c \
templates-actions.h \
templates-commands.c \
templates-commands.h \
text-editor-actions.c \
text-editor-actions.h \
text-editor-commands.c \
text-editor-commands.h \
text-tool-actions.c \
text-tool-actions.h \
text-tool-commands.c \
text-tool-commands.h \
tool-options-actions.c \
tool-options-actions.h \
tool-options-commands.c \
tool-options-commands.h \
tool-presets-actions.c \
tool-presets-actions.h \
tool-presets-commands.c \
tool-presets-commands.h \
tool-preset-editor-actions.c \
tool-preset-editor-actions.h \
tool-preset-editor-commands.c \
tool-preset-editor-commands.h \
tools-actions.c \
tools-actions.h \
tools-commands.c \
tools-commands.h \
vector-toolpath-actions.c \
vector-toolpath-actions.h \
vector-toolpath-commands.c \
vector-toolpath-commands.h \
vectors-actions.c \
vectors-actions.h \
vectors-commands.c \
vectors-commands.h \
view-actions.c \
view-actions.h \
view-commands.c \
view-commands.h \
window-actions.c \
window-actions.h \
window-commands.c \
window-commands.h \
windows-actions.c \
windows-actions.h \
windows-commands.c \
windows-commands.h

View File

@@ -80,6 +80,7 @@
#include "mypaint-brushes-actions.h"
#include "palette-editor-actions.h"
#include "palettes-actions.h"
#include "paths-actions.h"
#include "patterns-actions.h"
#include "plug-in-actions.h"
#include "quick-mask-actions.h"
@@ -93,7 +94,6 @@
#include "tool-preset-editor-actions.h"
#include "tools-actions.h"
#include "vector-toolpath-actions.h"
#include "vectors-actions.h"
#include "view-actions.h"
#include "windows-actions.h"
@@ -238,9 +238,9 @@ static const GimpActionFactoryEntry action_groups[] =
{ "vector-toolpath", N_("Path Toolpath"), GIMP_ICON_PATH,
vector_toolpath_actions_setup,
vector_toolpath_actions_update },
{ "vectors", N_("Paths"), GIMP_ICON_PATH,
vectors_actions_setup,
vectors_actions_update },
{ "paths", N_("Paths"), GIMP_ICON_PATH,
paths_actions_setup,
paths_actions_update },
{ "view", N_("View"), GIMP_ICON_VISIBLE,
view_actions_setup,
view_actions_update },
@@ -365,9 +365,17 @@ action_data_get_image (gpointer data)
recursion = TRUE;
if (GIMP_IS_ITEM_TREE_VIEW (data))
result = gimp_item_tree_view_get_image ((GimpItemTreeView *) data);
{
result = gimp_item_tree_view_get_image ((GimpItemTreeView *) data);
recursion = FALSE;
return result;
}
else if (GIMP_IS_IMAGE_EDITOR (data))
result = ((GimpImageEditor *) data)->image;
{
result = ((GimpImageEditor *) data)->image;
recursion = FALSE;
return result;
}
if (! result)
{
@@ -492,6 +500,26 @@ action_data_sel_count (gpointer data)
}
}
/* action_select_value:
* @select_type:
* @value:
* @min:
* max:
* def:
* small_inc:
* inc:
* skip_inc:
* delta_factor:
* wrap:
*
* For any valid enum @value (which are all negative), the corresponding
* action computes the semantic value (default, first, next, etc.).
* For a positive @value, it is considered as a per-thousand value
* between the @min and @max (possibly wrapped if @wrap is set, clamped
* otherwise), allowing to compute the returned value.
*
* Returns: the computed value to use for the action.
*/
gdouble
action_select_value (GimpActionSelectType select_type,
gdouble value,

View File

@@ -91,47 +91,28 @@ void action_message (GimpDisplay *display,
if (! widget) \
return
#define return_if_no_drawable(image,drawable,data) \
return_if_no_image (image,data); \
drawable = gimp_image_get_active_drawable (image); \
if (! drawable) \
return
#define return_if_no_drawables(image,drawables,data) \
return_if_no_image (image,data); \
drawables = gimp_image_get_selected_drawables (image); \
if (! drawables) \
return
#define return_if_no_layer(image,layer,data) \
return_if_no_image (image,data); \
layer = gimp_image_get_active_layer (image); \
if (! layer) \
return
#define return_if_no_layers(image,layers,data) \
return_if_no_image (image,data); \
layers = gimp_image_get_selected_layers (image); \
if (! layers) \
return
#define return_if_no_channel(image,channel,data) \
return_if_no_image (image,data); \
channel = gimp_image_get_active_channel (image); \
if (! channel) \
return
#define return_if_no_channels(image,channels,data) \
return_if_no_image (image,data); \
channels = gimp_image_get_selected_channels (image); \
if (! channels) \
return
#define return_if_no_vectors(image,vectors,data) \
#define return_if_no_paths(image,paths,data) \
return_if_no_image (image,data); \
vectors = gimp_image_get_active_vectors (image); \
if (! vectors) \
paths = gimp_image_get_selected_paths (image); \
if (! paths) \
return

View File

@@ -37,17 +37,10 @@
#include "gimp-intl.h"
static const GimpActionEntry brush_editor_actions[] =
{
{ "brush-editor-popup", GIMP_ICON_BRUSH,
NC_("brush-editor-action", "Brush Editor Menu"), NULL, NULL, NULL,
GIMP_HELP_BRUSH_EDITOR_DIALOG }
};
static const GimpToggleActionEntry brush_editor_toggle_actions[] =
{
{ "brush-editor-edit-active", GIMP_ICON_LINKED,
NC_("brush-editor-action", "Edit Active Brush"), NULL, NULL,
NC_("brush-editor-action", "Edit Active Brush"), NULL, { NULL }, NULL,
data_editor_edit_active_cmd_callback,
FALSE,
GIMP_HELP_BRUSH_EDITOR_EDIT_ACTIVE }
@@ -57,10 +50,6 @@ static const GimpToggleActionEntry brush_editor_toggle_actions[] =
void
brush_editor_actions_setup (GimpActionGroup *group)
{
gimp_action_group_add_actions (group, "brush-editor-action",
brush_editor_actions,
G_N_ELEMENTS (brush_editor_actions));
gimp_action_group_add_toggle_actions (group, "brush-editor-action",
brush_editor_toggle_actions,
G_N_ELEMENTS (brush_editor_toggle_actions));

View File

@@ -39,48 +39,44 @@
static const GimpActionEntry brushes_actions[] =
{
{ "brushes-popup", GIMP_ICON_BRUSH,
NC_("brushes-action", "Brushes Menu"), NULL, NULL, NULL,
GIMP_HELP_BRUSH_DIALOG },
{ "brushes-open-as-image", GIMP_ICON_DOCUMENT_OPEN,
NC_("brushes-action", "_Open Brush as Image"), NULL,
NC_("brushes-action", "_Open Brush as Image"), NULL, { NULL },
NC_("brushes-action", "Open brush as image"),
data_open_as_image_cmd_callback,
GIMP_HELP_BRUSH_OPEN_AS_IMAGE },
{ "brushes-new", GIMP_ICON_DOCUMENT_NEW,
NC_("brushes-action", "_New Brush"), NULL,
NC_("brushes-action", "_New Brush"), NULL, { NULL },
NC_("brushes-action", "Create a new brush"),
data_new_cmd_callback,
GIMP_HELP_BRUSH_NEW },
{ "brushes-duplicate", GIMP_ICON_OBJECT_DUPLICATE,
NC_("brushes-action", "D_uplicate Brush"), NULL,
NC_("brushes-action", "D_uplicate Brush"), NULL, { NULL },
NC_("brushes-action", "Duplicate this brush"),
data_duplicate_cmd_callback,
GIMP_HELP_BRUSH_DUPLICATE },
{ "brushes-copy-location", GIMP_ICON_EDIT_COPY,
NC_("brushes-action", "Copy Brush _Location"), NULL,
NC_("brushes-action", "Copy Brush _Location"), NULL, { NULL },
NC_("brushes-action", "Copy brush file location to clipboard"),
data_copy_location_cmd_callback,
GIMP_HELP_BRUSH_COPY_LOCATION },
{ "brushes-show-in-file-manager", GIMP_ICON_FILE_MANAGER,
NC_("brushes-action", "Show in _File Manager"), NULL,
NC_("brushes-action", "Show in _File Manager"), NULL, { NULL },
NC_("brushes-action", "Show brush file location in the file manager"),
data_show_in_file_manager_cmd_callback,
GIMP_HELP_BRUSH_SHOW_IN_FILE_MANAGER },
{ "brushes-delete", GIMP_ICON_EDIT_DELETE,
NC_("brushes-action", "_Delete Brush"), NULL,
NC_("brushes-action", "_Delete Brush"), NULL, { NULL },
NC_("brushes-action", "Delete this brush"),
data_delete_cmd_callback,
GIMP_HELP_BRUSH_DELETE },
{ "brushes-refresh", GIMP_ICON_VIEW_REFRESH,
NC_("brushes-action", "_Refresh Brushes"), NULL,
NC_("brushes-action", "_Refresh Brushes"), NULL, { NULL },
NC_("brushes-action", "Refresh brushes"),
data_refresh_cmd_callback,
GIMP_HELP_BRUSH_REFRESH }
@@ -89,7 +85,7 @@ static const GimpActionEntry brushes_actions[] =
static const GimpStringActionEntry brushes_edit_actions[] =
{
{ "brushes-edit", GIMP_ICON_EDIT,
NC_("brushes-action", "_Edit Brush..."), NULL,
NC_("brushes-action", "_Edit Brush..."), NULL, { NULL },
NC_("brushes-action", "Edit this brush"),
"gimp-brush-editor",
GIMP_HELP_BRUSH_EDIT }

View File

@@ -38,18 +38,14 @@
static const GimpActionEntry buffers_actions[] =
{
{ "buffers-popup", GIMP_ICON_BUFFER,
NC_("buffers-action", "Buffers Menu"), NULL, NULL, NULL,
GIMP_HELP_BUFFER_DIALOG },
{ "buffers-paste-as-new-image", GIMP_ICON_EDIT_PASTE_AS_NEW,
NC_("buffers-action", "Paste Buffer as _New Image"), NULL,
NC_("buffers-action", "Paste Buffer as _New Image"), NULL, { NULL },
NC_("buffers-action", "Paste the selected buffer as a new image"),
buffers_paste_as_new_image_cmd_callback,
GIMP_HELP_BUFFER_PASTE_AS_NEW_IMAGE },
{ "buffers-delete", GIMP_ICON_EDIT_DELETE,
NC_("buffers-action", "_Delete Buffer"), NULL,
NC_("buffers-action", "_Delete Buffer"), NULL, { NULL },
NC_("buffers-action", "Delete the selected buffer"),
buffers_delete_cmd_callback,
GIMP_HELP_BUFFER_DELETE }
@@ -58,38 +54,38 @@ static const GimpActionEntry buffers_actions[] =
static const GimpEnumActionEntry buffers_paste_actions[] =
{
{ "buffers-paste", GIMP_ICON_EDIT_PASTE,
NC_("buffers-action", "_Paste Buffer"), NULL,
NC_("buffers-action", "_Paste Buffer"), NULL, { NULL },
NC_("buffers-action", "Paste the selected buffer"),
GIMP_PASTE_TYPE_FLOATING, FALSE,
GIMP_HELP_BUFFER_PASTE },
{ "buffers-paste-in-place", GIMP_ICON_EDIT_PASTE,
NC_("buffers-action", "Paste Buffer In Pl_ace"), NULL,
NC_("buffers-action", "Paste Buffer In Pl_ace"), NULL, { NULL },
NC_("buffers-action", "Paste the selected buffer at its original position"),
GIMP_PASTE_TYPE_FLOATING_IN_PLACE, FALSE,
GIMP_HELP_BUFFER_PASTE_IN_PLACE },
{ "buffers-paste-into", GIMP_ICON_EDIT_PASTE_INTO,
NC_("buffers-action", "Paste Buffer _Into The Selection"), NULL,
NC_("buffers-action", "Paste Buffer _Into The Selection"), NULL, { NULL },
NC_("buffers-action", "Paste the selected buffer into the selection"),
GIMP_PASTE_TYPE_FLOATING_INTO, FALSE,
GIMP_HELP_BUFFER_PASTE_INTO },
{ "buffers-paste-into-in-place", GIMP_ICON_EDIT_PASTE_INTO,
NC_("buffers-action", "Paste Buffer Into The Selection In Place"), NULL,
NC_("buffers-action", "Paste Buffer Into The Selection In Place"), NULL, { NULL },
NC_("buffers-action",
"Paste the selected buffer into the selection at its original position"),
GIMP_PASTE_TYPE_FLOATING_INTO_IN_PLACE, FALSE,
GIMP_HELP_BUFFER_PASTE_INTO_IN_PLACE },
{ "buffers-paste-as-new-layer", GIMP_ICON_EDIT_PASTE_AS_NEW,
NC_("buffers-action", "Paste Buffer as New _Layer"), NULL,
NC_("buffers-action", "Paste Buffer as New _Layer"), NULL, { NULL },
NC_("buffers-action", "Paste the selected buffer as a new layer"),
GIMP_PASTE_TYPE_NEW_LAYER, FALSE,
GIMP_HELP_BUFFER_PASTE_AS_NEW_LAYER },
{ "buffers-paste-as-new-layer-in-place", GIMP_ICON_EDIT_PASTE_AS_NEW,
NC_("buffers-action", "Paste Buffer as New Layer in Place"), NULL,
NC_("buffers-action", "Paste Buffer as New Layer in Place"), NULL, { NULL },
NC_("buffers-action",
"Paste the selected buffer as a new layer at its original position"),
GIMP_PASTE_TYPE_NEW_LAYER_IN_PLACE, FALSE,

View File

@@ -20,6 +20,7 @@
#include <gegl.h>
#include <gtk/gtk.h>
#include "libgimpbase/gimpbase.h"
#include "libgimpwidgets/gimpwidgets.h"
#include "actions-types.h"
@@ -90,9 +91,9 @@ buffers_paste_cmd_callback (GimpAction *action,
{
GList *drawables = gimp_image_get_selected_drawables (image);
g_list_free (gimp_edit_paste (image,
g_list_length (drawables) == 1 ? drawables->data : NULL,
g_list_free (gimp_edit_paste (image, drawables,
GIMP_OBJECT (buffer), paste_type,
context, FALSE,
x, y, width, height));
gimp_image_flush (image);
@@ -122,9 +123,10 @@ buffers_paste_as_new_image_cmd_callback (GimpAction *action,
GimpImage *new_image;
new_image = gimp_edit_paste_as_new_image (context->gimp,
GIMP_OBJECT (buffer));
GIMP_OBJECT (buffer),
context);
gimp_create_display (context->gimp, new_image,
GIMP_UNIT_PIXEL, 1.0,
gimp_unit_pixel (), 1.0,
G_OBJECT (gimp_widget_get_monitor (widget)));
g_object_unref (new_image);
}

View File

@@ -41,66 +41,58 @@
static const GimpActionEntry channels_actions[] =
{
{ "channels-popup", GIMP_ICON_DIALOG_CHANNELS,
NC_("channels-action", "Channels Menu"), NULL, NULL, NULL,
GIMP_HELP_CHANNEL_DIALOG },
{ "channels-color-tag-menu", NULL,
NC_("channels-action", "Color Tag"), NULL, NULL, NULL,
GIMP_HELP_CHANNEL_COLOR_TAG },
{ "channels-edit-attributes", GIMP_ICON_EDIT,
NC_("channels-action", "_Edit Channel Attributes..."), NULL,
NC_("channels-action", "_Edit Channel Attributes..."), NULL, { NULL },
NC_("channels-action", "Edit the channel's name, color and opacity"),
channels_edit_attributes_cmd_callback,
GIMP_HELP_CHANNEL_EDIT },
{ "channels-new", GIMP_ICON_DOCUMENT_NEW,
NC_("channels-action", "_New Channel..."), NULL,
NC_("channels-action", "_New Channel..."), NULL, { NULL },
NC_("channels-action", "Create a new channel"),
channels_new_cmd_callback,
GIMP_HELP_CHANNEL_NEW },
{ "channels-new-last-values", GIMP_ICON_DOCUMENT_NEW,
NC_("channels-action", "_New Channel"), NULL,
NC_("channels-action", "_New Channel"), NULL, { NULL },
NC_("channels-action", "Create a new channel with last used values"),
channels_new_last_vals_cmd_callback,
GIMP_HELP_CHANNEL_NEW },
{ "channels-duplicate", GIMP_ICON_OBJECT_DUPLICATE,
NC_("channels-action", "D_uplicate Channels"), NULL,
NC_("channels-action", "D_uplicate Channels"), NULL, { NULL },
NC_("channels-action",
"Create duplicates of selected channels and add them to the image"),
channels_duplicate_cmd_callback,
GIMP_HELP_CHANNEL_DUPLICATE },
{ "channels-delete", GIMP_ICON_EDIT_DELETE,
NC_("channels-action", "_Delete Channels"), NULL,
NC_("channels-action", "_Delete Channels"), NULL, { NULL },
NC_("channels-action", "Delete selected channels"),
channels_delete_cmd_callback,
GIMP_HELP_CHANNEL_DELETE },
{ "channels-raise", GIMP_ICON_GO_UP,
NC_("channels-action", "_Raise Channels"), NULL,
NC_("channels-action", "_Raise Channels"), NULL, { NULL },
NC_("channels-action", "Raise these channels one step in the channel stack"),
channels_raise_cmd_callback,
GIMP_HELP_CHANNEL_RAISE },
{ "channels-raise-to-top", GIMP_ICON_GO_TOP,
NC_("channels-action", "Raise Channels to _Top"), NULL,
NC_("channels-action", "Raise Channels to _Top"), NULL, { NULL },
NC_("channels-action",
"Raise these channels to the top of the channel stack"),
channels_raise_to_top_cmd_callback,
GIMP_HELP_CHANNEL_RAISE_TO_TOP },
{ "channels-lower", GIMP_ICON_GO_DOWN,
NC_("channels-action", "_Lower Channels"), NULL,
NC_("channels-action", "_Lower Channels"), NULL, { NULL },
NC_("channels-action", "Lower these channels one step in the channel stack"),
channels_lower_cmd_callback,
GIMP_HELP_CHANNEL_LOWER },
{ "channels-lower-to-bottom", GIMP_ICON_GO_BOTTOM,
NC_("channels-action", "Lower Channels to _Bottom"), NULL,
NC_("channels-action", "Lower Channels to _Bottom"), NULL, { NULL },
NC_("channels-action",
"Lower these channels to the bottom of the channel stack"),
channels_lower_to_bottom_cmd_callback,
@@ -110,19 +102,19 @@ static const GimpActionEntry channels_actions[] =
static const GimpToggleActionEntry channels_toggle_actions[] =
{
{ "channels-visible", GIMP_ICON_VISIBLE,
NC_("channels-action", "Toggle Channel _Visibility"), NULL, NULL,
NC_("channels-action", "Toggle Channel _Visibility"), NULL, { NULL }, NULL,
channels_visible_cmd_callback,
FALSE,
GIMP_HELP_CHANNEL_VISIBLE },
{ "channels-lock-content", GIMP_ICON_LOCK_CONTENT,
NC_("channels-action", "L_ock Pixels of Channel"), NULL, NULL,
NC_("channels-action", "L_ock Pixels of Channel"), NULL, { NULL }, NULL,
channels_lock_content_cmd_callback,
FALSE,
GIMP_HELP_CHANNEL_LOCK_PIXELS },
{ "channels-lock-position", GIMP_ICON_LOCK_POSITION,
NC_("channels-action", "L_ock Position of Channel"), NULL, NULL,
NC_("channels-action", "L_ock Position of Channel"), NULL, { NULL }, NULL,
channels_lock_position_cmd_callback,
FALSE,
GIMP_HELP_CHANNEL_LOCK_POSITION }
@@ -131,55 +123,55 @@ static const GimpToggleActionEntry channels_toggle_actions[] =
static const GimpEnumActionEntry channels_color_tag_actions[] =
{
{ "channels-color-tag-none", GIMP_ICON_EDIT_CLEAR,
NC_("channels-action", "None"), NULL,
NC_("channels-action", "None"), NULL, { NULL },
NC_("channels-action", "Channel Color Tag: Clear"),
GIMP_COLOR_TAG_NONE, FALSE,
GIMP_HELP_CHANNEL_COLOR_TAG },
{ "channels-color-tag-blue", NULL,
NC_("channels-action", "Blue"), NULL,
NC_("channels-action", "Blue"), NULL, { NULL },
NC_("channels-action", "Channel Color Tag: Set to Blue"),
GIMP_COLOR_TAG_BLUE, FALSE,
GIMP_HELP_CHANNEL_COLOR_TAG },
{ "channels-color-tag-green", NULL,
NC_("channels-action", "Green"), NULL,
NC_("channels-action", "Green"), NULL, { NULL },
NC_("channels-action", "Channel Color Tag: Set to Green"),
GIMP_COLOR_TAG_GREEN, FALSE,
GIMP_HELP_CHANNEL_COLOR_TAG },
{ "channels-color-tag-yellow", NULL,
NC_("channels-action", "Yellow"), NULL,
NC_("channels-action", "Yellow"), NULL, { NULL },
NC_("channels-action", "Channel Color Tag: Set to Yellow"),
GIMP_COLOR_TAG_YELLOW, FALSE,
GIMP_HELP_CHANNEL_COLOR_TAG },
{ "channels-color-tag-orange", NULL,
NC_("channels-action", "Orange"), NULL,
NC_("channels-action", "Orange"), NULL, { NULL },
NC_("channels-action", "Channel Color Tag: Set to Orange"),
GIMP_COLOR_TAG_ORANGE, FALSE,
GIMP_HELP_CHANNEL_COLOR_TAG },
{ "channels-color-tag-brown", NULL,
NC_("channels-action", "Brown"), NULL,
NC_("channels-action", "Brown"), NULL, { NULL },
NC_("channels-action", "Channel Color Tag: Set to Brown"),
GIMP_COLOR_TAG_BROWN, FALSE,
GIMP_HELP_CHANNEL_COLOR_TAG },
{ "channels-color-tag-red", NULL,
NC_("channels-action", "Red"), NULL,
NC_("channels-action", "Red"), NULL, { NULL },
NC_("channels-action", "Channel Color Tag: Set to Red"),
GIMP_COLOR_TAG_RED, FALSE,
GIMP_HELP_CHANNEL_COLOR_TAG },
{ "channels-color-tag-violet", NULL,
NC_("channels-action", "Violet"), NULL,
NC_("channels-action", "Violet"), NULL, { NULL },
NC_("channels-action", "Channel Color Tag: Set to Violet"),
GIMP_COLOR_TAG_VIOLET, FALSE,
GIMP_HELP_CHANNEL_COLOR_TAG },
{ "channels-color-tag-gray", NULL,
NC_("channels-action", "Gray"), NULL,
NC_("channels-action", "Gray"), NULL, { NULL },
NC_("channels-action", "Channel Color Tag: Set to Gray"),
GIMP_COLOR_TAG_GRAY, FALSE,
GIMP_HELP_CHANNEL_COLOR_TAG }
@@ -188,26 +180,26 @@ static const GimpEnumActionEntry channels_color_tag_actions[] =
static const GimpEnumActionEntry channels_to_selection_actions[] =
{
{ "channels-selection-replace", GIMP_ICON_SELECTION_REPLACE,
NC_("channels-action", "Channel to Sele_ction"), NULL,
NC_("channels-action", "Replace the selection with this channel"),
NC_("channels-action", "Channels to Sele_ction"), NULL, { NULL },
NC_("channels-action", "Replace the selection with selected channels"),
GIMP_CHANNEL_OP_REPLACE, FALSE,
GIMP_HELP_CHANNEL_SELECTION_REPLACE },
{ "channels-selection-add", GIMP_ICON_SELECTION_ADD,
NC_("channels-action", "_Add to Selection"), NULL,
NC_("channels-action", "Add this channel to the current selection"),
NC_("channels-action", "_Add Channels to Selection"), NULL, { NULL },
NC_("channels-action", "Add selected channels to the current selection"),
GIMP_CHANNEL_OP_ADD, FALSE,
GIMP_HELP_CHANNEL_SELECTION_ADD },
{ "channels-selection-subtract", GIMP_ICON_SELECTION_SUBTRACT,
NC_("channels-action", "_Subtract from Selection"), NULL,
NC_("channels-action", "Subtract this channel from the current selection"),
NC_("channels-action", "_Subtract Channels from Selection"), NULL, { NULL },
NC_("channels-action", "Subtract selected channels from the current selection"),
GIMP_CHANNEL_OP_SUBTRACT, FALSE,
GIMP_HELP_CHANNEL_SELECTION_SUBTRACT },
{ "channels-selection-intersect", GIMP_ICON_SELECTION_INTERSECT,
NC_("channels-action", "_Intersect with Selection"), NULL,
NC_("channels-action", "Intersect this channel with the current selection"),
NC_("channels-action", "_Intersect Channels with Selection"), NULL, { NULL },
NC_("channels-action", "Intersect selected channels with the current selection and each other"),
GIMP_CHANNEL_OP_INTERSECT, FALSE,
GIMP_HELP_CHANNEL_SELECTION_INTERSECT }
};
@@ -215,25 +207,25 @@ static const GimpEnumActionEntry channels_to_selection_actions[] =
static const GimpEnumActionEntry channels_select_actions[] =
{
{ "channels-select-top", NULL,
NC_("channels-action", "Select _Top Channel"), NULL,
NC_("channels-action", "Select _Top Channel"), NULL, { NULL },
NC_("channels-action", "Select the topmost channel"),
GIMP_ACTION_SELECT_FIRST, FALSE,
GIMP_HELP_CHANNEL_TOP },
{ "channels-select-bottom", NULL,
NC_("channels-action", "Select _Bottom Channel"), NULL,
NC_("channels-action", "Select _Bottom Channel"), NULL, { NULL },
NC_("channels-action", "Select the bottommost channel"),
GIMP_ACTION_SELECT_LAST, FALSE,
GIMP_HELP_CHANNEL_BOTTOM },
{ "channels-select-previous", NULL,
NC_("channels-action", "Select _Previous Channel"), NULL,
NC_("channels-action", "Select _Previous Channels"), NULL, { NULL },
NC_("channels-action", "Select the channels above the selected channels"),
GIMP_ACTION_SELECT_PREVIOUS, FALSE,
GIMP_HELP_CHANNEL_PREVIOUS },
{ "channels-select-next", NULL,
NC_("channels-action", "Select _Next Channels"), NULL,
NC_("channels-action", "Select _Next Channels"), NULL, { NULL },
NC_("channels-action", "Select the channels below the selected channels"),
GIMP_ACTION_SELECT_NEXT, FALSE,
GIMP_HELP_CHANNEL_NEXT }
@@ -281,6 +273,8 @@ channels_actions_update (GimpActionGroup *group,
gint n_channels = 0;
gboolean have_prev = FALSE; /* At least 1 selected channel has a previous sibling. */
gboolean have_next = FALSE; /* At least 1 selected channel has a next sibling. */
gboolean first_selected = FALSE; /* First channel is selected */
gboolean last_selected = FALSE; /* Last channel is selected */
if (image)
{
@@ -310,14 +304,16 @@ channels_actions_update (GimpActionGroup *group,
if (list)
{
if (gimp_item_get_index (list->data) == 0)
first_selected = TRUE;
if (gimp_item_get_index (list->data) == n_channels - 1)
last_selected = TRUE;
if (g_list_previous (list))
have_prev = TRUE;
if (g_list_next (list))
have_next = TRUE;
}
if (have_prev && have_next)
break;
}
}
}
@@ -332,15 +328,15 @@ channels_actions_update (GimpActionGroup *group,
SET_SENSITIVE ("channels-duplicate", !fs && (n_selected_channels > 0 || component));
SET_SENSITIVE ("channels-delete", !fs && n_selected_channels > 0);
SET_SENSITIVE ("channels-raise", !fs && n_selected_channels > 0 && have_prev);
SET_SENSITIVE ("channels-raise", !fs && n_selected_channels > 0 && have_prev && !first_selected);
SET_SENSITIVE ("channels-raise-to-top", !fs && n_selected_channels > 0 && have_prev);
SET_SENSITIVE ("channels-lower", !fs && n_selected_channels > 0 && have_next);
SET_SENSITIVE ("channels-lower", !fs && n_selected_channels > 0 && have_next && !last_selected);
SET_SENSITIVE ("channels-lower-to-bottom", !fs && n_selected_channels > 0 && have_next);
SET_SENSITIVE ("channels-selection-replace", !fs && (n_selected_channels == 1 || component));
SET_SENSITIVE ("channels-selection-add", !fs && (n_selected_channels == 1 || component));
SET_SENSITIVE ("channels-selection-subtract", !fs && (n_selected_channels == 1 || component));
SET_SENSITIVE ("channels-selection-intersect", !fs && (n_selected_channels == 1 || component));
SET_SENSITIVE ("channels-selection-replace", !fs && (n_selected_channels > 0 || component));
SET_SENSITIVE ("channels-selection-add", !fs && (n_selected_channels > 0 || component));
SET_SENSITIVE ("channels-selection-subtract", !fs && (n_selected_channels > 0 || component));
SET_SENSITIVE ("channels-selection-intersect", !fs && (n_selected_channels > 0 || component));
SET_SENSITIVE ("channels-select-top", !fs && n_channels > 0 && (n_selected_channels == 0 || have_prev));
SET_SENSITIVE ("channels-select-bottom", !fs && n_channels > 0 && (n_selected_channels == 0 || have_next));

View File

@@ -65,24 +65,26 @@ static void channels_new_callback (GtkWidget *dialog,
GimpChannel *channel,
GimpContext *context,
const gchar *channel_name,
const GimpRGB *channel_color,
GeglColor *channel_color,
gboolean save_selection,
gboolean channel_visible,
GimpColorTag channel_color_tag,
gboolean channel_lock_content,
gboolean channel_lock_position,
gboolean channel_lock_visibility,
gpointer user_data);
static void channels_edit_attributes_callback (GtkWidget *dialog,
GimpImage *image,
GimpChannel *channel,
GimpContext *context,
const gchar *channel_name,
const GimpRGB *channel_color,
GeglColor *channel_color,
gboolean save_selection,
gboolean channel_visible,
GimpColorTag channel_color_tag,
gboolean channel_lock_content,
gboolean channel_lock_position,
gboolean channel_lock_visibility,
gpointer user_data);
@@ -95,14 +97,19 @@ channels_edit_attributes_cmd_callback (GimpAction *action,
{
GimpImage *image;
GimpChannel *channel;
GList *channels;
GtkWidget *widget;
GtkWidget *dialog;
return_if_no_channel (image, channel, data);
return_if_no_channels (image, channels, data);
return_if_no_widget (widget, data);
#define EDIT_DIALOG_KEY "gimp-channel-edit-attributes-dialog"
dialog = dialogs_get_dialog (G_OBJECT (channel), EDIT_DIALOG_KEY);
if (g_list_length (channels) != 1)
return;
channel = channels->data;
dialog = dialogs_get_dialog (G_OBJECT (channel), EDIT_DIALOG_KEY);
if (! dialog)
{
@@ -120,11 +127,12 @@ channels_edit_attributes_cmd_callback (GimpAction *action,
_("_Fill opacity:"),
FALSE,
gimp_object_get_name (channel),
&channel->color,
channel->color,
gimp_item_get_visible (item),
gimp_item_get_color_tag (item),
gimp_item_get_lock_content (item),
gimp_item_get_lock_position (item),
gimp_item_get_lock_visibility (item),
channels_edit_attributes_callback,
NULL);
@@ -165,11 +173,12 @@ channels_new_cmd_callback (GimpAction *action,
_("_Fill opacity:"),
TRUE,
config->channel_new_name,
&config->channel_new_color,
config->channel_new_color,
TRUE,
GIMP_COLOR_TAG_NONE,
FALSE,
FALSE,
FALSE,
channels_new_callback,
NULL);
@@ -195,7 +204,7 @@ channels_new_last_vals_cmd_callback (GimpAction *action,
gimp_image_get_width (image),
gimp_image_get_height (image),
config->channel_new_name,
&config->channel_new_color);
config->channel_new_color);
gimp_drawable_fill (GIMP_DRAWABLE (channel),
action_data_get_context (data),
@@ -223,7 +232,15 @@ channels_raise_cmd_callback (GimpAction *action,
index = gimp_item_get_index (iter->data);
if (index > 0)
raised_channels = g_list_prepend (raised_channels, iter->data);
{
raised_channels = g_list_prepend (raised_channels, iter->data);
}
else
{
gimp_image_flush (image);
g_list_free (raised_channels);
return;
}
}
gimp_image_undo_group_start (image,
@@ -231,7 +248,7 @@ channels_raise_cmd_callback (GimpAction *action,
ngettext ("Raise Channel",
"Raise Channels",
g_list_length (raised_channels)));
raised_channels = g_list_reverse (raised_channels);
for (iter = raised_channels; iter; iter = iter->next)
gimp_image_raise_item (image, iter->data, NULL);
@@ -295,7 +312,15 @@ channels_lower_cmd_callback (GimpAction *action,
layer_list = gimp_item_get_container_iter (GIMP_ITEM (iter->data));
index = gimp_item_get_index (iter->data);
if (index < g_list_length (layer_list) - 1)
lowered_channels = g_list_prepend (lowered_channels, iter->data);
{
lowered_channels = g_list_prepend (lowered_channels, iter->data);
}
else
{
gimp_image_flush (image);
g_list_free (lowered_channels);
return;
}
}
gimp_image_undo_group_start (image,
@@ -474,11 +499,23 @@ channels_to_selection_cmd_callback (GimpAction *action,
}
else
{
GimpChannel *channel;
return_if_no_channel (image, channel, data);
GList *channels;
GList *iter;
return_if_no_channels (image, channels, data);
gimp_item_to_selection (GIMP_ITEM (channel),
op, TRUE, FALSE, 0.0, 0.0);
gimp_image_undo_group_start (image,
GIMP_UNDO_GROUP_DRAWABLE_MOD,
_("Channels to selection"));
for (iter = channels; iter; iter = iter->next)
{
gimp_item_to_selection (iter->data, op, TRUE, FALSE, 0.0, 0.0);
if (op == GIMP_CHANNEL_OP_REPLACE && iter == channels)
op = GIMP_CHANNEL_OP_ADD;
}
gimp_image_undo_group_end (image);
}
gimp_image_flush (image);
@@ -489,11 +526,11 @@ channels_visible_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data)
{
GimpImage *image;
GimpChannel *channel;
return_if_no_channel (image, channel, data);
GimpImage *image;
GList *channels;
return_if_no_channels (image, channels, data);
items_visible_cmd_callback (action, value, image, GIMP_ITEM (channel));
items_visible_cmd_callback (action, value, image, channels);
}
void
@@ -501,11 +538,11 @@ channels_lock_content_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data)
{
GimpImage *image;
GimpChannel *channel;
return_if_no_channel (image, channel, data);
GimpImage *image;
GList *channels;
return_if_no_channels (image, channels, data);
items_lock_content_cmd_callback (action, value, image, GIMP_ITEM (channel));
items_lock_content_cmd_callback (action, value, image, channels);
}
void
@@ -513,11 +550,11 @@ channels_lock_position_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data)
{
GimpImage *image;
GimpChannel *channel;
return_if_no_channel (image, channel, data);
GimpImage *image;
GList *channels;
return_if_no_channels (image, channels, data);
items_lock_position_cmd_callback (action, value, image, GIMP_ITEM (channel));
items_lock_position_cmd_callback (action, value, image, channels);
}
void
@@ -526,14 +563,13 @@ channels_color_tag_cmd_callback (GimpAction *action,
gpointer data)
{
GimpImage *image;
GimpChannel *channel;
GList *channels;
GimpColorTag color_tag;
return_if_no_channel (image, channel, data);
return_if_no_channels (image, channels, data);
color_tag = (GimpColorTag) g_variant_get_int32 (value);
items_color_tag_cmd_callback (action, image, GIMP_ITEM (channel),
color_tag);
items_color_tag_cmd_callback (action, image, channels, color_tag);
}
void
@@ -593,12 +629,13 @@ channels_new_callback (GtkWidget *dialog,
GimpChannel *channel,
GimpContext *context,
const gchar *channel_name,
const GimpRGB *channel_color,
GeglColor *channel_color,
gboolean save_selection,
gboolean channel_visible,
GimpColorTag channel_color_tag,
gboolean channel_lock_content,
gboolean channel_lock_position,
gboolean channel_lock_visibility,
gpointer user_data)
{
GimpDialogConfig *config = GIMP_DIALOG_CONFIG (image->gimp->config);
@@ -617,7 +654,7 @@ channels_new_callback (GtkWidget *dialog,
gimp_object_set_name (GIMP_OBJECT (channel),
config->channel_new_name);
gimp_channel_set_color (channel, &config->channel_new_color, FALSE);
gimp_channel_set_color (channel, config->channel_new_color, FALSE);
}
else
{
@@ -625,7 +662,7 @@ channels_new_callback (GtkWidget *dialog,
gimp_image_get_width (image),
gimp_image_get_height (image),
config->channel_new_name,
&config->channel_new_color);
config->channel_new_color);
gimp_drawable_fill (GIMP_DRAWABLE (channel), context,
GIMP_FILL_TRANSPARENT);
@@ -635,6 +672,7 @@ channels_new_callback (GtkWidget *dialog,
gimp_item_set_color_tag (GIMP_ITEM (channel), channel_color_tag, FALSE);
gimp_item_set_lock_content (GIMP_ITEM (channel), channel_lock_content, FALSE);
gimp_item_set_lock_position (GIMP_ITEM (channel), channel_lock_position, FALSE);
gimp_item_set_lock_visibility (GIMP_ITEM (channel), channel_lock_visibility, FALSE);
gimp_image_add_channel (image, channel,
GIMP_IMAGE_ACTIVE_PARENT, -1, TRUE);
@@ -649,22 +687,24 @@ channels_edit_attributes_callback (GtkWidget *dialog,
GimpChannel *channel,
GimpContext *context,
const gchar *channel_name,
const GimpRGB *channel_color,
GeglColor *channel_color,
gboolean save_selection,
gboolean channel_visible,
GimpColorTag channel_color_tag,
gboolean channel_lock_content,
gboolean channel_lock_position,
gboolean channel_lock_visibility,
gpointer user_data)
{
GimpItem *item = GIMP_ITEM (channel);
if (strcmp (channel_name, gimp_object_get_name (channel)) ||
gimp_rgba_distance (channel_color, &channel->color) > RGBA_EPSILON ||
channel_visible != gimp_item_get_visible (item) ||
channel_color_tag != gimp_item_get_color_tag (item) ||
channel_lock_content != gimp_item_get_lock_content (item) ||
channel_lock_position != gimp_item_get_lock_position (item))
if (strcmp (channel_name, gimp_object_get_name (channel)) ||
! gimp_color_is_perceptually_identical (channel_color, channel->color) ||
channel_visible != gimp_item_get_visible (item) ||
channel_color_tag != gimp_item_get_color_tag (item) ||
channel_lock_content != gimp_item_get_lock_content (item) ||
channel_lock_position != gimp_item_get_lock_position (item) ||
channel_lock_visibility != gimp_item_get_lock_visibility (item))
{
gimp_image_undo_group_start (image,
GIMP_UNDO_GROUP_ITEM_PROPERTIES,
@@ -673,7 +713,7 @@ channels_edit_attributes_callback (GtkWidget *dialog,
if (strcmp (channel_name, gimp_object_get_name (channel)))
gimp_item_rename (GIMP_ITEM (channel), channel_name, NULL);
if (gimp_rgba_distance (channel_color, &channel->color) > RGBA_EPSILON)
if (! gimp_color_is_perceptually_identical (channel_color, channel->color))
gimp_channel_set_color (channel, channel_color, TRUE);
if (channel_visible != gimp_item_get_visible (item))
@@ -688,6 +728,9 @@ channels_edit_attributes_callback (GtkWidget *dialog,
if (channel_lock_position != gimp_item_get_lock_position (item))
gimp_item_set_lock_position (item, channel_lock_position, TRUE);
if (channel_lock_visibility != gimp_item_get_lock_visibility (item))
gimp_item_set_lock_visibility (item, channel_lock_visibility, TRUE);
gimp_image_undo_group_end (image);
gimp_image_flush (image);

View File

@@ -28,8 +28,10 @@
#include "core/gimpdrawable.h"
#include "core/gimpimage.h"
#include "core/gimpimage-colormap.h"
#include "core/gimppalette.h"
#include "widgets/gimpactiongroup.h"
#include "widgets/gimpcolormapeditor.h"
#include "widgets/gimphelp-ids.h"
#include "actions.h"
@@ -41,27 +43,29 @@
static const GimpActionEntry colormap_actions[] =
{
{ "colormap-popup", GIMP_ICON_COLORMAP,
NC_("colormap-action", "Colormap Menu"), NULL, NULL, NULL,
GIMP_HELP_INDEXED_PALETTE_DIALOG },
{ "colormap-edit-color", GIMP_ICON_EDIT,
NC_("colormap-action", "_Edit Color..."), NULL,
NC_("colormap-action", "_Edit Color..."), NULL, { NULL },
NC_("colormap-action", "Edit this color"),
colormap_edit_color_cmd_callback,
GIMP_HELP_INDEXED_PALETTE_EDIT },
{ "colormap-delete-color", GIMP_ICON_EDIT_DELETE,
NC_("colormap-action", "_Delete Color..."), NULL, { NULL },
NC_("colormap-action", "Delete this color"),
colormap_delete_color_cmd_callback,
GIMP_HELP_INDEXED_PALETTE_EDIT }
};
static const GimpEnumActionEntry colormap_add_color_actions[] =
{
{ "colormap-add-color-from-fg", GIMP_ICON_LIST_ADD,
NC_("colormap-action", "_Add Color from FG"), "",
NC_("colormap-action", "_Add Color from FG"), NULL, { NULL },
NC_("colormap-action", "Add current foreground color"),
FALSE, FALSE,
GIMP_HELP_INDEXED_PALETTE_ADD },
{ "colormap-add-color-from-bg", GIMP_ICON_LIST_ADD,
NC_("colormap-action", "_Add Color from BG"), "",
NC_("colormap-action", "_Add Color from BG"), NULL, { NULL },
NC_("colormap-action", "Add current background color"),
TRUE, FALSE,
GIMP_HELP_INDEXED_PALETTE_ADD }
@@ -70,25 +74,25 @@ static const GimpEnumActionEntry colormap_add_color_actions[] =
static const GimpEnumActionEntry colormap_to_selection_actions[] =
{
{ "colormap-selection-replace", GIMP_ICON_SELECTION_REPLACE,
NC_("colormap-action", "_Select this Color"), NULL,
NC_("colormap-action", "_Select this Color"), NULL, { NULL },
NC_("colormap-action", "Select all pixels with this color"),
GIMP_CHANNEL_OP_REPLACE, FALSE,
GIMP_HELP_INDEXED_PALETTE_SELECTION_REPLACE },
{ "colormap-selection-add", GIMP_ICON_SELECTION_ADD,
NC_("colormap-action", "_Add to Selection"), NULL,
NC_("colormap-action", "_Add to Selection"), NULL, { NULL },
NC_("colormap-action", "Add all pixels with this color to the current selection"),
GIMP_CHANNEL_OP_ADD, FALSE,
GIMP_HELP_INDEXED_PALETTE_SELECTION_ADD },
{ "colormap-selection-subtract", GIMP_ICON_SELECTION_SUBTRACT,
NC_("colormap-action", "_Subtract from Selection"), NULL,
NC_("colormap-action", "_Subtract from Selection"), NULL, { NULL },
NC_("colormap-action", "Subtract all pixels with this color from the current selection"),
GIMP_CHANNEL_OP_SUBTRACT, FALSE,
GIMP_HELP_INDEXED_PALETTE_SELECTION_SUBTRACT },
{ "colormap-selection-intersect", GIMP_ICON_SELECTION_INTERSECT,
NC_("colormap-action", "_Intersect with Selection"), NULL,
NC_("colormap-action", "_Intersect with Selection"), NULL, { NULL },
NC_("colormap-action", "Intersect all pixels with this color with the current selection"),
GIMP_CHANNEL_OP_INTERSECT, FALSE,
GIMP_HELP_INDEXED_PALETTE_SELECTION_INTERSECT }
@@ -116,13 +120,12 @@ void
colormap_actions_update (GimpActionGroup *group,
gpointer data)
{
GimpImage *image = action_data_get_image (data);
GimpContext *context = action_data_get_context (data);
gboolean indexed = FALSE;
gboolean drawable_indexed = FALSE;
gint num_colors = 0;
GimpRGB fg;
GimpRGB bg;
GimpColormapEditor *editor = GIMP_COLORMAP_EDITOR (data);
GimpImage *image = action_data_get_image (data);
GimpContext *context = action_data_get_context (data);
gboolean indexed = FALSE;
gboolean drawable_indexed = FALSE;
gint num_colors = 0;
if (image)
{
@@ -130,19 +133,17 @@ colormap_actions_update (GimpActionGroup *group,
if (indexed)
{
GimpDrawable *drawable = gimp_image_get_active_drawable (image);
GList *drawables = gimp_image_get_selected_drawables (image);
num_colors = gimp_image_get_colormap_size (image);
drawable_indexed = gimp_drawable_is_indexed (drawable);
num_colors = gimp_palette_get_n_colors (gimp_image_get_colormap_palette ((image)));
if (g_list_length (drawables) == 1)
drawable_indexed = gimp_drawable_is_indexed (drawables->data);
g_list_free (drawables);
}
}
if (context)
{
gimp_context_get_foreground (context, &fg);
gimp_context_get_background (context, &bg);
}
#define SET_SENSITIVE(action,condition) \
gimp_action_group_set_action_sensitive (group, action, (condition) != 0, NULL)
#define SET_COLOR(action,color) \
@@ -150,14 +151,17 @@ colormap_actions_update (GimpActionGroup *group,
SET_SENSITIVE ("colormap-edit-color",
indexed && num_colors > 0);
SET_SENSITIVE ("colormap-delete-color",
indexed && num_colors > 0 &&
gimp_colormap_editor_is_color_deletable (editor));
SET_SENSITIVE ("colormap-add-color-from-fg",
indexed && num_colors < 256);
SET_SENSITIVE ("colormap-add-color-from-bg",
indexed && num_colors < 256);
SET_COLOR ("colormap-add-color-from-fg", context ? &fg : NULL);
SET_COLOR ("colormap-add-color-from-bg", context ? &bg : NULL);
SET_COLOR ("colormap-add-color-from-fg", context ? gimp_context_get_foreground (context) : NULL);
SET_COLOR ("colormap-add-color-from-bg", context ? gimp_context_get_background (context) : NULL);
SET_SENSITIVE ("colormap-selection-replace",
drawable_indexed && num_colors > 0);

View File

@@ -26,6 +26,7 @@
#include "core/gimpcontext.h"
#include "core/gimpimage.h"
#include "core/gimpimage-colormap.h"
#include "core/gimppalette.h"
#include "widgets/gimpcolormapeditor.h"
#include "widgets/gimpcolormapselection.h"
@@ -46,6 +47,16 @@ colormap_edit_color_cmd_callback (GimpAction *action,
gimp_colormap_editor_edit_color (editor);
}
void
colormap_delete_color_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data)
{
GimpColormapEditor *editor = GIMP_COLORMAP_EDITOR (data);
gimp_colormap_editor_delete_color (editor);
}
void
colormap_add_color_cmd_callback (GimpAction *action,
GVariant *value,
@@ -59,16 +70,16 @@ colormap_add_color_cmd_callback (GimpAction *action,
background = (gboolean) g_variant_get_int32 (value);
if (gimp_image_get_colormap_size (image) < 256)
if (gimp_palette_get_n_colors (gimp_image_get_colormap_palette ((image))) < 256)
{
GimpRGB color;
GeglColor *color;
if (background)
gimp_context_get_background (context, &color);
color = gimp_context_get_background (context);
else
gimp_context_get_foreground (context, &color);
color = gimp_context_get_foreground (context);
gimp_image_add_colormap_entry (image, &color);
gimp_image_add_colormap_entry (image, color);
gimp_image_flush (image);
}
}
@@ -81,6 +92,7 @@ colormap_to_selection_cmd_callback (GimpAction *action,
GimpColormapSelection *selection;
GimpColormapEditor *editor;
GimpImage *image;
GList *drawables;
GimpChannelOps op;
gint col_index;
@@ -92,10 +104,22 @@ colormap_to_selection_cmd_callback (GimpAction *action,
op = (GimpChannelOps) g_variant_get_int32 (value);
drawables = gimp_image_get_selected_drawables (image);
if (g_list_length (drawables) != 1)
{
/* We should not reach this anyway as colormap-actions.c normally takes
* care at making the action insensitive when the item selection is wrong.
*/
g_warning ("This action requires exactly one selected drawable.");
g_list_free (drawables);
return;
}
gimp_channel_select_by_index (gimp_image_get_mask (image),
gimp_image_get_active_drawable (image),
drawables->data,
col_index, op,
FALSE, 0.0, 0.0);
g_list_free (drawables);
gimp_image_flush (image);
}

View File

@@ -22,6 +22,9 @@
void colormap_edit_color_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data);
void colormap_delete_color_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data);
void colormap_add_color_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data);

File diff suppressed because it is too large Load Diff

View File

@@ -34,7 +34,9 @@
#include "core/gimpbrushgenerated.h"
#include "core/gimpcontext.h"
#include "core/gimpdatafactory.h"
#include "core/gimpimage.h"
#include "core/gimplist.h"
#include "core/gimppaintinfo.h"
#include "core/gimptoolinfo.h"
#include "paint/gimppaintoptions.h"
@@ -60,19 +62,19 @@ static gint context_paint_mode_index (GimpLayerMode paint_mode,
gint n_modes);
static void context_select_color (GimpActionSelectType select_type,
GimpRGB *color,
GeglColor *color,
gboolean use_colormap,
gboolean use_palette);
static gint context_get_color_index (gboolean use_colormap,
gboolean use_palette,
const GimpRGB *color);
GeglColor *color);
static gint context_max_color_index (gboolean use_colormap,
gboolean use_palette);
static gboolean context_set_color_index (gint index,
gboolean use_colormap,
gboolean use_palette,
GimpRGB *color);
GeglColor *color);
static GimpPaletteEditor * context_get_palette_editor (void);
static GimpColormapEditor * context_get_colormap_editor (void);
@@ -109,16 +111,17 @@ context_##name##_##fgbg##ground_cmd_callback (GimpAction *action, \
gpointer data) \
{ \
GimpContext *context; \
GimpRGB color; \
GeglColor *color; \
GimpActionSelectType select_type; \
return_if_no_context (context, data); \
\
select_type = (GimpActionSelectType) g_variant_get_int32 (value); \
\
gimp_context_get_##fgbg##ground (context, &color); \
context_select_color (select_type, &color, \
color = gegl_color_duplicate (gimp_context_get_##fgbg##ground (context)); \
context_select_color (select_type, color, \
use_colormap, use_palette); \
gimp_context_set_##fgbg##ground (context, &color); \
gimp_context_set_##fgbg##ground (context, color); \
g_object_unref (color); \
}
SELECT_COLOR_CMD_CALLBACK (palette, fore, FALSE, TRUE)
@@ -134,18 +137,30 @@ context_foreground_red_cmd_callback (GimpAction *action,
gpointer data)
{
GimpContext *context;
GimpRGB color;
GeglColor *color;
const Babl *format;
gdouble pixel[4];
GimpActionSelectType select_type;
return_if_no_context (context, data);
select_type = (GimpActionSelectType) g_variant_get_int32 (value);
gimp_context_get_foreground (context, &color);
color.r = action_select_value (select_type,
color.r,
0.0, 1.0, 1.0,
1.0 / 255.0, 0.01, 0.1, 0.0, FALSE);
gimp_context_set_foreground (context, &color);
color = gegl_color_duplicate (gimp_context_get_foreground (context));
format = gimp_context_get_rgba_format (context, color, "double", NULL);
gegl_color_get_pixel (color, format, pixel);
/* TODO: if value was already out-of-gamut, say we want to decrease it
* progressively. Should the algorithm allow it to be decreased while still
* staying out-of-gamut? Currently the function always clamps the result to
* min/max.
*/
pixel[0] = action_select_value (select_type,
pixel[0],
0.0, 1.0, 1.0,
1.0 / 255.0, 0.01, 0.1, 0.0, FALSE);
gegl_color_set_pixel (color, format, pixel);
gimp_context_set_foreground (context, color);
g_object_unref (color);
}
void
@@ -154,18 +169,25 @@ context_foreground_green_cmd_callback (GimpAction *action,
gpointer data)
{
GimpContext *context;
GimpRGB color;
GeglColor *color;
const Babl *format;
gdouble pixel[4];
GimpActionSelectType select_type;
return_if_no_context (context, data);
select_type = (GimpActionSelectType) g_variant_get_int32 (value);
gimp_context_get_foreground (context, &color);
color.g = action_select_value (select_type,
color.g,
0.0, 1.0, 1.0,
1.0 / 255.0, 0.01, 0.1, 0.0, FALSE);
gimp_context_set_foreground (context, &color);
color = gegl_color_duplicate (gimp_context_get_foreground (context));
format = gimp_context_get_rgba_format (context, color, "double", NULL);
gegl_color_get_pixel (color, format, pixel);
pixel[1] = action_select_value (select_type,
pixel[1],
0.0, 1.0, 1.0,
1.0 / 255.0, 0.01, 0.1, 0.0, FALSE);
gegl_color_set_pixel (color, format, pixel);
gimp_context_set_foreground (context, color);
g_object_unref (color);
}
void
@@ -174,18 +196,25 @@ context_foreground_blue_cmd_callback (GimpAction *action,
gpointer data)
{
GimpContext *context;
GimpRGB color;
GeglColor *color;
const Babl *format;
gdouble pixel[4];
GimpActionSelectType select_type;
return_if_no_context (context, data);
select_type = (GimpActionSelectType) g_variant_get_int32 (value);
gimp_context_get_foreground (context, &color);
color.b = action_select_value (select_type,
color.b,
0.0, 1.0, 1.0,
1.0 / 255.0, 0.01, 0.1, 0.0, FALSE);
gimp_context_set_foreground (context, &color);
color = gegl_color_duplicate (gimp_context_get_foreground (context));
format = gimp_context_get_rgba_format (context, color, "double", NULL);
gegl_color_get_pixel (color, format, pixel);
pixel[2] = action_select_value (select_type,
pixel[2],
0.0, 1.0, 1.0,
1.0 / 255.0, 0.01, 0.1, 0.0, FALSE);
gegl_color_set_pixel (color, format, pixel);
gimp_context_set_foreground (context, color);
g_object_unref (color);
}
void
@@ -194,18 +223,25 @@ context_background_red_cmd_callback (GimpAction *action,
gpointer data)
{
GimpContext *context;
GimpRGB color;
GeglColor *color;
const Babl *format;
gdouble pixel[4];
GimpActionSelectType select_type;
return_if_no_context (context, data);
select_type = (GimpActionSelectType) g_variant_get_int32 (value);
gimp_context_get_background (context, &color);
color.r = action_select_value (select_type,
color.r,
0.0, 1.0, 1.0,
1.0 / 255.0, 0.01, 0.1, 0.0, FALSE);
gimp_context_set_background (context, &color);
color = gegl_color_duplicate (gimp_context_get_background (context));
format = gimp_context_get_rgba_format (context, color, "double", NULL);
gegl_color_get_pixel (color, format, pixel);
pixel[0] = action_select_value (select_type,
pixel[0],
0.0, 1.0, 1.0,
1.0 / 255.0, 0.01, 0.1, 0.0, FALSE);
gegl_color_set_pixel (color, format, pixel);
gimp_context_set_background (context, color);
g_object_unref (color);
}
void
@@ -214,18 +250,25 @@ context_background_green_cmd_callback (GimpAction *action,
gpointer data)
{
GimpContext *context;
GimpRGB color;
GeglColor *color;
const Babl *format;
gdouble pixel[4];
GimpActionSelectType select_type;
return_if_no_context (context, data);
select_type = (GimpActionSelectType) g_variant_get_int32 (value);
gimp_context_get_background (context, &color);
color.g = action_select_value (select_type,
color.g,
0.0, 1.0, 1.0,
1.0 / 255.0, 0.01, 0.1, 0.0, FALSE);
gimp_context_set_background (context, &color);
color = gegl_color_duplicate (gimp_context_get_background (context));
format = gimp_context_get_rgba_format (context, color, "double", NULL);
gegl_color_get_pixel (color, format, pixel);
pixel[1] = action_select_value (select_type,
pixel[1],
0.0, 1.0, 1.0,
1.0 / 255.0, 0.01, 0.1, 0.0, FALSE);
gegl_color_set_pixel (color, format, pixel);
gimp_context_set_background (context, color);
g_object_unref (color);
}
void
@@ -234,18 +277,25 @@ context_background_blue_cmd_callback (GimpAction *action,
gpointer data)
{
GimpContext *context;
GimpRGB color;
GeglColor *color;
const Babl *format;
gdouble pixel[4];
GimpActionSelectType select_type;
return_if_no_context (context, data);
select_type = (GimpActionSelectType) g_variant_get_int32 (value);
gimp_context_get_background (context, &color);
color.b = action_select_value (select_type,
color.b,
0.0, 1.0, 1.0,
1.0 / 255.0, 0.01, 0.1, 0.0, FALSE);
gimp_context_set_background (context, &color);
color = gegl_color_duplicate (gimp_context_get_background (context));
format = gimp_context_get_rgba_format (context, color, "double", NULL);
gegl_color_get_pixel (color, format, pixel);
pixel[2] = action_select_value (select_type,
pixel[2],
0.0, 1.0, 1.0,
1.0 / 255.0, 0.01, 0.1, 0.0, FALSE);
gegl_color_set_pixel (color, format, pixel);
gimp_context_set_background (context, color);
g_object_unref (color);
}
void
@@ -254,21 +304,22 @@ context_foreground_hue_cmd_callback (GimpAction *action,
gpointer data)
{
GimpContext *context;
GimpRGB color;
GimpHSV hsv;
GeglColor *color;
gfloat pixel[3];
GimpActionSelectType select_type;
return_if_no_context (context, data);
select_type = (GimpActionSelectType) g_variant_get_int32 (value);
gimp_context_get_foreground (context, &color);
gimp_rgb_to_hsv (&color, &hsv);
hsv.h = action_select_value (select_type,
hsv.h,
0.0, 1.0, 1.0,
1.0 / 360.0, 0.01, 0.1, 0.0, FALSE);
gimp_hsv_to_rgb (&hsv, &color);
gimp_context_set_foreground (context, &color);
color = gegl_color_duplicate (gimp_context_get_foreground (context));
gegl_color_get_pixel (color, babl_format_with_space ("HSV float", NULL), pixel);
pixel[0] = (gfloat) action_select_value (select_type,
pixel[0],
0.0, 1.0, 1.0,
1.0 / 360.0, 0.01, 0.1, 0.0, FALSE);
gegl_color_set_pixel (color, babl_format_with_space ("HSV float", NULL), pixel);
gimp_context_set_foreground (context, color);
g_object_unref (color);
}
void
@@ -277,21 +328,22 @@ context_foreground_saturation_cmd_callback (GimpAction *action,
gpointer data)
{
GimpContext *context;
GimpRGB color;
GimpHSV hsv;
GeglColor *color;
gfloat pixel[3];
GimpActionSelectType select_type;
return_if_no_context (context, data);
select_type = (GimpActionSelectType) g_variant_get_int32 (value);
gimp_context_get_foreground (context, &color);
gimp_rgb_to_hsv (&color, &hsv);
hsv.s = action_select_value (select_type,
hsv.s,
0.0, 1.0, 1.0,
0.01, 0.01, 0.1, 0.0, FALSE);
gimp_hsv_to_rgb (&hsv, &color);
gimp_context_set_foreground (context, &color);
color = gegl_color_duplicate (gimp_context_get_foreground (context));
gegl_color_get_pixel (color, babl_format_with_space ("HSV float", NULL), pixel);
pixel[1] = (gfloat) action_select_value (select_type,
pixel[1],
0.0, 1.0, 1.0,
0.01, 0.01, 0.1, 0.0, FALSE);
gegl_color_set_pixel (color, babl_format_with_space ("HSV float", NULL), pixel);
gimp_context_set_foreground (context, color);
g_object_unref (color);
}
void
@@ -300,21 +352,22 @@ context_foreground_value_cmd_callback (GimpAction *action,
gpointer data)
{
GimpContext *context;
GimpRGB color;
GimpHSV hsv;
GeglColor *color;
gfloat pixel[3];
GimpActionSelectType select_type;
return_if_no_context (context, data);
select_type = (GimpActionSelectType) g_variant_get_int32 (value);
gimp_context_get_foreground (context, &color);
gimp_rgb_to_hsv (&color, &hsv);
hsv.v = action_select_value (select_type,
hsv.v,
0.0, 1.0, 1.0,
0.01, 0.01, 0.1, 0.0, FALSE);
gimp_hsv_to_rgb (&hsv, &color);
gimp_context_set_foreground (context, &color);
color = gegl_color_duplicate (gimp_context_get_foreground (context));
gegl_color_get_pixel (color, babl_format_with_space ("HSV float", NULL), pixel);
pixel[2] = (gfloat) action_select_value (select_type,
pixel[2],
0.0, 1.0, 1.0,
0.01, 0.01, 0.1, 0.0, FALSE);
gegl_color_set_pixel (color, babl_format_with_space ("HSV float", NULL), pixel);
gimp_context_set_foreground (context, color);
g_object_unref (color);
}
void
@@ -323,21 +376,22 @@ context_background_hue_cmd_callback (GimpAction *action,
gpointer data)
{
GimpContext *context;
GimpRGB color;
GimpHSV hsv;
GeglColor *color;
gfloat pixel[3];
GimpActionSelectType select_type;
return_if_no_context (context, data);
select_type = (GimpActionSelectType) g_variant_get_int32 (value);
gimp_context_get_background (context, &color);
gimp_rgb_to_hsv (&color, &hsv);
hsv.h = action_select_value (select_type,
hsv.h,
0.0, 1.0, 1.0,
1.0 / 360.0, 0.01, 0.1, 0.0, FALSE);
gimp_hsv_to_rgb (&hsv, &color);
gimp_context_set_background (context, &color);
color = gegl_color_duplicate (gimp_context_get_background (context));
gegl_color_get_pixel (color, babl_format_with_space ("HSV float", NULL), pixel);
pixel[0] = (gfloat) action_select_value (select_type,
pixel[0],
0.0, 1.0, 1.0,
1.0 / 360.0, 0.01, 0.1, 0.0, FALSE);
gegl_color_set_pixel (color, babl_format_with_space ("HSV float", NULL), pixel);
gimp_context_set_background (context, color);
g_object_unref (color);
}
void
@@ -346,21 +400,22 @@ context_background_saturation_cmd_callback (GimpAction *action,
gpointer data)
{
GimpContext *context;
GimpRGB color;
GimpHSV hsv;
GeglColor *color;
gfloat pixel[3];
GimpActionSelectType select_type;
return_if_no_context (context, data);
select_type = (GimpActionSelectType) g_variant_get_int32 (value);
gimp_context_get_background (context, &color);
gimp_rgb_to_hsv (&color, &hsv);
hsv.s = action_select_value (select_type,
hsv.s,
0.0, 1.0, 1.0,
0.01, 0.01, 0.1, 0.0, FALSE);
gimp_hsv_to_rgb (&hsv, &color);
gimp_context_set_background (context, &color);
color = gegl_color_duplicate (gimp_context_get_background (context));
gegl_color_get_pixel (color, babl_format_with_space ("HSV float", NULL), pixel);
pixel[1] = (gfloat) action_select_value (select_type,
pixel[1],
0.0, 1.0, 1.0,
0.01, 0.01, 0.1, 0.0, FALSE);
gegl_color_set_pixel (color, babl_format_with_space ("HSV float", NULL), pixel);
gimp_context_set_background (context, color);
g_object_unref (color);
}
void
@@ -369,21 +424,22 @@ context_background_value_cmd_callback (GimpAction *action,
gpointer data)
{
GimpContext *context;
GimpRGB color;
GimpHSV hsv;
GeglColor *color;
gfloat pixel[3];
GimpActionSelectType select_type;
return_if_no_context (context, data);
select_type = (GimpActionSelectType) g_variant_get_int32 (value);
gimp_context_get_background (context, &color);
gimp_rgb_to_hsv (&color, &hsv);
hsv.v = action_select_value (select_type,
hsv.v,
0.0, 1.0, 1.0,
0.01, 0.01, 0.1, 0.0, FALSE);
gimp_hsv_to_rgb (&hsv, &color);
gimp_context_set_background (context, &color);
color = gegl_color_duplicate (gimp_context_get_background (context));
gegl_color_get_pixel (color, babl_format_with_space ("HSV float", NULL), pixel);
pixel[2] = (gfloat) action_select_value (select_type,
pixel[2],
0.0, 1.0, 1.0,
0.01, 0.01, 0.1, 0.0, FALSE);
gegl_color_set_pixel (color, babl_format_with_space ("HSV float", NULL), pixel);
gimp_context_set_background (context, color);
g_object_unref (color);
}
void
@@ -797,6 +853,39 @@ context_brush_angle_cmd_callback (GimpAction *action,
}
}
void
context_toggle_dynamics_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data)
{
GimpContext *context;
GimpPaintInfo *paint_info;
gboolean enabled;
return_if_no_context (context, data);
paint_info = gimp_context_get_paint_info (context);
if (paint_info)
{
GimpPaintOptions *paint_options;
GimpDisplay *display;
paint_options = paint_info->paint_options;
enabled = gimp_paint_options_are_dynamics_enabled (paint_options);
gimp_paint_options_enable_dynamics (paint_options, ! enabled);
display = action_data_get_display (data);
if (enabled)
action_message (display, G_OBJECT (paint_options),
_("Dynamics disabled"));
else
action_message (display, G_OBJECT (paint_options),
_("Dynamics enabled"));
}
}
/* private functions */
@@ -834,7 +923,7 @@ context_paint_mode_index (GimpLayerMode paint_mode,
static void
context_select_color (GimpActionSelectType select_type,
GimpRGB *color,
GeglColor *color,
gboolean use_colormap,
gboolean use_palette)
{
@@ -853,9 +942,9 @@ context_select_color (GimpActionSelectType select_type,
}
static gint
context_get_color_index (gboolean use_colormap,
gboolean use_palette,
const GimpRGB *color)
context_get_color_index (gboolean use_colormap,
gboolean use_palette,
GeglColor *color)
{
if (use_colormap)
{
@@ -920,10 +1009,10 @@ context_max_color_index (gboolean use_colormap,
}
static gboolean
context_set_color_index (gint index,
gboolean use_colormap,
gboolean use_palette,
GimpRGB *color)
context_set_color_index (gint index,
gboolean use_colormap,
gboolean use_palette,
GeglColor *color)
{
if (use_colormap)
{

View File

@@ -136,5 +136,9 @@ void context_brush_angle_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data);
void context_toggle_dynamics_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data);
#endif /* __CONTEXT_COMMANDS_H__ */

View File

@@ -35,17 +35,10 @@
#include "gimp-intl.h"
static const GimpActionEntry cursor_info_actions[] =
{
{ "cursor-info-popup", GIMP_ICON_CURSOR,
NC_("cursor-info-action", "Pointer Information Menu"), NULL, NULL, NULL,
GIMP_HELP_POINTER_INFO_DIALOG }
};
static const GimpToggleActionEntry cursor_info_toggle_actions[] =
{
{ "cursor-info-sample-merged", NULL,
NC_("cursor-info-action", "_Sample Merged"), "",
NC_("cursor-info-action", "_Sample Merged"), NULL, { NULL },
NC_("cursor-info-action", "Use the composite color of all visible layers"),
cursor_info_sample_merged_cmd_callback,
TRUE,
@@ -56,10 +49,6 @@ static const GimpToggleActionEntry cursor_info_toggle_actions[] =
void
cursor_info_actions_setup (GimpActionGroup *group)
{
gimp_action_group_add_actions (group, "cursor-info-action",
cursor_info_actions,
G_N_ELEMENTS (cursor_info_actions));
gimp_action_group_add_toggle_actions (group, "cursor-info-action",
cursor_info_toggle_actions,
G_N_ELEMENTS (cursor_info_toggle_actions));

View File

@@ -36,10 +36,6 @@
static const GimpActionEntry dashboard_actions[] =
{
{ "dashboard-popup", GIMP_ICON_DIALOG_DASHBOARD,
NC_("dashboard-action", "Dashboard Menu"), NULL, NULL, NULL,
GIMP_HELP_DASHBOARD_DIALOG },
{ "dashboard-groups", NULL,
NC_("dashboard-action", "_Groups") },
{ "dashboard-update-interval", NULL,
@@ -48,25 +44,25 @@ static const GimpActionEntry dashboard_actions[] =
NC_("dashboard-action", "_History Duration") },
{ "dashboard-log-record", GIMP_ICON_RECORD,
NC_("dashboard-action", "_Start/Stop Recording..."), NULL,
NC_("dashboard-action", "_Start/Stop Recording..."), NULL, { NULL },
NC_("dashboard-action", "Start/stop recording performance log"),
dashboard_log_record_cmd_callback,
GIMP_HELP_DASHBOARD_LOG_RECORD },
{ "dashboard-log-add-marker", GIMP_ICON_MARKER,
NC_("dashboard-action", "_Add Marker..."), NULL,
NC_("dashboard-action", "_Add Marker..."), NULL, { NULL },
NC_("dashboard-action", "Add an event marker "
"to the performance log"),
dashboard_log_add_marker_cmd_callback,
GIMP_HELP_DASHBOARD_LOG_ADD_MARKER },
{ "dashboard-log-add-empty-marker", GIMP_ICON_MARKER,
NC_("dashboard-action", "Add _Empty Marker"), NULL,
NC_("dashboard-action", "Add _Empty Marker"), NULL, { NULL },
NC_("dashboard-action", "Add an empty event marker "
"to the performance log"),
dashboard_log_add_empty_marker_cmd_callback,
GIMP_HELP_DASHBOARD_LOG_ADD_EMPTY_MARKER },
{ "dashboard-reset", GIMP_ICON_RESET,
NC_("dashboard-action", "_Reset"), NULL,
NC_("dashboard-action", "_Reset"), NULL, { NULL },
NC_("dashboard-action", "Reset cumulative data"),
dashboard_reset_cmd_callback,
GIMP_HELP_DASHBOARD_RESET },
@@ -75,7 +71,7 @@ static const GimpActionEntry dashboard_actions[] =
static const GimpToggleActionEntry dashboard_toggle_actions[] =
{
{ "dashboard-low-swap-space-warning", NULL,
NC_("dashboard-action", "_Low Swap Space Warning"), NULL,
NC_("dashboard-action", "_Low Swap Space Warning"), NULL, { NULL },
NC_("dashboard-action", "Raise the dashboard when "
"the swap size approaches its limit"),
dashboard_low_swap_space_warning_cmd_callback,
@@ -86,27 +82,27 @@ static const GimpToggleActionEntry dashboard_toggle_actions[] =
static const GimpRadioActionEntry dashboard_update_interval_actions[] =
{
{ "dashboard-update-interval-0-25-sec", NULL,
NC_("dashboard-update-interval", "0.25 Seconds"), NULL, NULL,
NC_("dashboard-update-interval", "0.25 Seconds"), NULL, { NULL }, NULL,
GIMP_DASHBOARD_UPDATE_INTERVAL_0_25_SEC,
GIMP_HELP_DASHBOARD_UPDATE_INTERVAL },
{ "dashboard-update-interval-0-5-sec", NULL,
NC_("dashboard-update-interval", "0.5 Seconds"), NULL, NULL,
NC_("dashboard-update-interval", "0.5 Seconds"), NULL, { NULL }, NULL,
GIMP_DASHBOARD_UPDATE_INTERVAL_0_5_SEC,
GIMP_HELP_DASHBOARD_UPDATE_INTERVAL },
{ "dashboard-update-interval-1-sec", NULL,
NC_("dashboard-update-interval", "1 Second"), NULL, NULL,
NC_("dashboard-update-interval", "1 Second"), NULL, { NULL }, NULL,
GIMP_DASHBOARD_UPDATE_INTERVAL_1_SEC,
GIMP_HELP_DASHBOARD_UPDATE_INTERVAL },
{ "dashboard-update-interval-2-sec", NULL,
NC_("dashboard-update-interval", "2 Seconds"), NULL, NULL,
NC_("dashboard-update-interval", "2 Seconds"), NULL, { NULL }, NULL,
GIMP_DASHBOARD_UPDATE_INTERVAL_2_SEC,
GIMP_HELP_DASHBOARD_UPDATE_INTERVAL },
{ "dashboard-update-interval-4-sec", NULL,
NC_("dashboard-update-interval", "4 Seconds"), NULL, NULL,
NC_("dashboard-update-interval", "4 Seconds"), NULL, { NULL }, NULL,
GIMP_DASHBOARD_UPDATE_INTERVAL_4_SEC,
GIMP_HELP_DASHBOARD_UPDATE_INTERVAL }
};
@@ -114,27 +110,27 @@ static const GimpRadioActionEntry dashboard_update_interval_actions[] =
static const GimpRadioActionEntry dashboard_history_duration_actions[] =
{
{ "dashboard-history-duration-15-sec", NULL,
NC_("dashboard-history-duration", "15 Seconds"), NULL, NULL,
NC_("dashboard-history-duration", "15 Seconds"), NULL, { NULL }, NULL,
GIMP_DASHBOARD_HISTORY_DURATION_15_SEC,
GIMP_HELP_DASHBOARD_HISTORY_DURATION },
{ "dashboard-history-duration-30-sec", NULL,
NC_("dashboard-history-duration", "30 Seconds"), NULL, NULL,
NC_("dashboard-history-duration", "30 Seconds"), NULL, { NULL }, NULL,
GIMP_DASHBOARD_HISTORY_DURATION_30_SEC,
GIMP_HELP_DASHBOARD_HISTORY_DURATION },
{ "dashboard-history-duration-60-sec", NULL,
NC_("dashboard-history-duration", "60 Seconds"), NULL, NULL,
NC_("dashboard-history-duration", "60 Seconds"), NULL, { NULL }, NULL,
GIMP_DASHBOARD_HISTORY_DURATION_60_SEC,
GIMP_HELP_DASHBOARD_HISTORY_DURATION },
{ "dashboard-history-duration-120-sec", NULL,
NC_("dashboard-history-duration", "120 Seconds"), NULL, NULL,
NC_("dashboard-history-duration", "120 Seconds"), NULL, { NULL }, NULL,
GIMP_DASHBOARD_HISTORY_DURATION_120_SEC,
GIMP_HELP_DASHBOARD_HISTORY_DURATION },
{ "dashboard-history-duration-240-sec", NULL,
NC_("dashboard-history-duration", "240 Seconds"), NULL, NULL,
NC_("dashboard-history-duration", "240 Seconds"), NULL, { NULL }, NULL,
GIMP_DASHBOARD_HISTORY_DURATION_240_SEC,
GIMP_HELP_DASHBOARD_HISTORY_DURATION }
};

View File

@@ -116,11 +116,15 @@ data_new_cmd_callback (GimpAction *action,
if (data)
{
GtkWidget *edit_button;
gimp_context_set_by_type (context,
gimp_data_factory_view_get_children_type (view),
GIMP_OBJECT (data));
gtk_button_clicked (GTK_BUTTON (gimp_data_factory_view_get_edit_button (view)));
edit_button = gimp_data_factory_view_get_edit_button (view);
if (edit_button && gtk_widget_get_visible (edit_button))
gtk_button_clicked (GTK_BUTTON (gimp_data_factory_view_get_edit_button (view)));
}
}
}
@@ -148,11 +152,15 @@ data_duplicate_cmd_callback (GimpAction *action,
if (new_data)
{
GtkWidget *edit_button;
gimp_context_set_by_type (context,
gimp_data_factory_view_get_children_type (view),
GIMP_OBJECT (new_data));
gtk_button_clicked (GTK_BUTTON (gimp_data_factory_view_get_edit_button (view)));
edit_button = gimp_data_factory_view_get_edit_button (view);
if (edit_button && gtk_widget_get_visible (edit_button))
gtk_button_clicked (GTK_BUTTON (gimp_data_factory_view_get_edit_button (view)));
}
}
}
@@ -286,6 +294,7 @@ data_edit_cmd_callback (GimpAction *action,
{
GdkMonitor *monitor = gimp_widget_get_monitor (GTK_WIDGET (view));
GtkWidget *dockable;
GtkWidget *editor = NULL;
dockable =
gimp_window_strategy_show_dockable_dialog (GIMP_WINDOW_STRATEGY (gimp_get_window_strategy (context->gimp)),
@@ -295,7 +304,10 @@ data_edit_cmd_callback (GimpAction *action,
g_variant_get_string (value,
NULL));
gimp_data_editor_set_data (GIMP_DATA_EDITOR (gtk_bin_get_child (GTK_BIN (dockable))),
data);
if (dockable)
editor = gtk_bin_get_child (GTK_BIN (dockable));
if (editor && GIMP_IS_DATA_EDITOR (editor))
gimp_data_editor_set_data (GIMP_DATA_EDITOR (editor), data);
}
}

View File

@@ -31,52 +31,42 @@
#include "debug-actions.h"
#include "debug-commands.h"
#include "gimp-intl.h"
static const GimpActionEntry debug_actions[] =
{
{ "debug-menu", NULL, "_Debug" },
{ "debug-gtk-inspector", NULL,
"Start _GtkInspector", NULL, NULL,
N_("Start _GtkInspector"), NULL, { NULL }, NULL,
debug_gtk_inspector_cmd_callback,
NULL },
{ "debug-mem-profile", NULL,
"_Memory Profile", NULL, NULL,
N_("_Memory Profile"), NULL, { NULL }, NULL,
debug_mem_profile_cmd_callback,
NULL },
{ "debug-benchmark-projection", NULL,
"Benchmark _Projection", NULL,
"Invalidates the entire projection, measures the time it takes to "
N_("Benchmark _Projection"), NULL, { NULL },
N_("Invalidates the entire projection, measures the time it takes to "
"validate (render) the part that is visible in the active display, "
"and print the result to stdout.",
"and print the result to stdout."),
debug_benchmark_projection_cmd_callback,
NULL },
{ "debug-show-image-graph", NULL,
"Show Image _Graph", NULL,
"Creates a new image showing the GEGL graph of this image",
N_("Show Image _Graph"), NULL, { NULL },
N_("Creates a new image showing the GEGL graph of this image"),
debug_show_image_graph_cmd_callback,
NULL },
{ "debug-dump-items", NULL,
"_Dump Items", NULL, NULL,
debug_dump_menus_cmd_callback,
NULL },
{ "debug-dump-managers", NULL,
"Dump _UI Managers", NULL, NULL,
debug_dump_managers_cmd_callback,
NULL },
{ "debug-dump-keyboard-shortcuts", NULL,
"Dump _Keyboard Shortcuts", NULL, NULL,
N_("Dump _Keyboard Shortcuts"), NULL, { NULL }, NULL,
debug_dump_keyboard_shortcuts_cmd_callback,
NULL },
{ "debug-dump-attached-data", NULL,
"Dump Attached Data", NULL, NULL,
N_("Dump _Attached Data"), NULL, { NULL }, NULL,
debug_dump_attached_data_cmd_callback,
NULL }
};

View File

@@ -55,19 +55,11 @@
static gboolean debug_benchmark_projection (GimpDisplay *display);
static gboolean debug_show_image_graph (GimpImage *source_image);
static void debug_dump_menus_recurse_menu (GtkWidget *menu,
gint depth,
gchar *path);
static void debug_print_qdata (GimpObject *object);
static void debug_print_qdata_foreach (GQuark key_id,
gpointer data,
gpointer user_data);
static gboolean debug_accel_find_func (GtkAccelKey *key,
GClosure *closure,
gpointer data);
/* public functions */
@@ -117,94 +109,19 @@ debug_show_image_graph_cmd_callback (GimpAction *action,
g_idle_add ((GSourceFunc) debug_show_image_graph, g_object_ref (source_image));
}
void
debug_dump_menus_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data)
{
GList *list;
for (list = gimp_menu_factory_get_registered_menus (global_menu_factory);
list;
list = g_list_next (list))
{
GimpMenuFactoryEntry *entry = list->data;
GList *managers;
managers = gimp_ui_managers_from_name (entry->identifier);
if (managers)
{
GimpUIManager *manager = managers->data;
GList *list;
for (list = manager->registered_uis; list; list = g_list_next (list))
{
GimpUIManagerUIEntry *ui_entry = list->data;
if (GTK_IS_MENU_SHELL (ui_entry->widget))
{
g_print ("\n\n"
"========================================\n"
"Menu: %s%s\n"
"========================================\n\n",
entry->identifier, ui_entry->ui_path);
debug_dump_menus_recurse_menu (ui_entry->widget, 1,
entry->identifier);
g_print ("\n");
}
}
}
}
}
void
debug_dump_managers_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data)
{
GList *list;
for (list = gimp_menu_factory_get_registered_menus (global_menu_factory);
list;
list = g_list_next (list))
{
GimpMenuFactoryEntry *entry = list->data;
GList *managers;
managers = gimp_ui_managers_from_name (entry->identifier);
if (managers)
{
g_print ("\n\n"
"========================================\n"
"UI Manager: %s\n"
"========================================\n\n",
entry->identifier);
g_print ("%s\n", gimp_ui_manager_get_ui (managers->data));
}
}
}
void
debug_dump_keyboard_shortcuts_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data)
{
GimpDisplay *display;
GimpImageWindow *window;
GimpUIManager *manager;
GtkAccelGroup *accel_group;
GList *group_it;
GList *strings = NULL;
GimpDisplay *display;
GimpUIManager *manager;
GList *group_it;
GList *strings = NULL;
return_if_no_display (display, data);
window = gimp_display_shell_get_window (gimp_display_get_shell (display));
manager = gimp_image_window_get_ui_manager (window);
accel_group = gimp_ui_manager_get_accel_group (manager);
manager = menus_get_image_manager_singleton (display->gimp);
/* Gather formatted strings of keyboard shortcuts */
for (group_it = gimp_ui_manager_get_action_groups (manager);
@@ -220,43 +137,34 @@ debug_dump_keyboard_shortcuts_cmd_callback (GimpAction *action,
for (action_it = actions; action_it; action_it = g_list_next (action_it))
{
GimpAction *action = action_it->data;
const gchar *name = gimp_action_get_name (action);
GClosure *accel_closure = NULL;
gchar **accels;
GimpAction *action = action_it->data;
const gchar *name = gimp_action_get_name (action);
if (strstr (name, "-menu") ||
strstr (name, "-popup") ||
name[0] == '<')
continue;
if (name[0] == '<')
continue;
accel_closure = gimp_action_get_accel_closure (action);
accels = gimp_action_get_display_accels (action);
if (accel_closure)
if (accels && accels[0])
{
GtkAccelKey *key = gtk_accel_group_find (accel_group,
debug_accel_find_func,
accel_closure);
if (key &&
key->accel_key &&
key->accel_flags & GTK_ACCEL_VISIBLE)
{
const gchar *label_tmp;
gchar *label;
gchar *key_string;
const gchar *label_tmp;
gchar *label;
label_tmp = gimp_action_get_label (action);
label = gimp_strip_uline (label_tmp);
key_string = gtk_accelerator_get_label (key->accel_key,
key->accel_mods);
label_tmp = gimp_action_get_label (action);
label = gimp_strip_uline (label_tmp);
strings = g_list_prepend (strings,
g_strdup_printf ("%-20s %s",
key_string, label));
strings = g_list_prepend (strings,
g_strdup_printf ("%-20s %s",
accels[0], label));
g_free (key_string);
g_free (label);
}
g_free (label);
for (gint i = 1; accels[i] != NULL; i++)
strings = g_list_prepend (strings, g_strdup (accels[i]));
}
g_strfreev (accels);
}
g_list_free (actions);
@@ -371,54 +279,6 @@ debug_show_image_graph (GimpImage *source_image)
return FALSE;
}
static void
debug_dump_menus_recurse_menu (GtkWidget *menu,
gint depth,
gchar *path)
{
GList *children;
GList *list;
children = gtk_container_get_children (GTK_CONTAINER (menu));
for (list = children; list; list = g_list_next (list))
{
GtkWidget *menu_item = GTK_WIDGET (list->data);
GtkWidget *child = gtk_bin_get_child (GTK_BIN (menu_item));
if (GTK_IS_LABEL (child))
{
GtkWidget *submenu;
const gchar *label;
gchar *full_path;
gchar *help_page;
gchar *format_str;
label = gtk_label_get_text (GTK_LABEL (child));
full_path = g_strconcat (path, "/", label, NULL);
help_page = g_object_get_data (G_OBJECT (menu_item), "gimp-help-id");
help_page = g_strdup (help_page);
format_str = g_strdup_printf ("%%%ds%%%ds %%-20s %%s\n",
depth * 2, depth * 2 - 40);
g_print (format_str,
"", label, "", help_page ? help_page : "");
g_free (format_str);
g_free (help_page);
submenu = gtk_menu_item_get_submenu (GTK_MENU_ITEM (menu_item));
if (submenu)
debug_dump_menus_recurse_menu (submenu, depth + 1, full_path);
g_free (full_path);
}
}
g_list_free (children);
}
static void
debug_print_qdata (GimpObject *object)
{
@@ -436,11 +296,3 @@ debug_print_qdata_foreach (GQuark key_id,
{
g_print ("%s: %p\n", g_quark_to_string (key_id), data);
}
static gboolean
debug_accel_find_func (GtkAccelKey *key,
GClosure *closure,
gpointer data)
{
return (GClosure *) data == closure;
}

View File

@@ -34,9 +34,6 @@ void debug_show_image_graph_cmd_callback (GimpAction *action,
void debug_dump_menus_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data);
void debug_dump_managers_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data);
void debug_dump_keyboard_shortcuts_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data);

View File

@@ -44,199 +44,259 @@
const GimpStringActionEntry dialogs_dockable_actions[] =
{
{ "dialogs-toolbox", NULL,
NC_("windows-action", "Tool_box"), "<primary>B",
NC_("windows-action", "Tool_box"), NULL, { "<primary>B", NULL },
NULL /* set in dialogs_actions_update() */,
"gimp-toolbox",
GIMP_HELP_TOOLBOX },
{ "dialogs-tool-options", GIMP_ICON_DIALOG_TOOL_OPTIONS,
NC_("dialogs-action", "Tool _Options"), NULL,
NC_("dialogs-action", "Tool _Options Dialog"),
NC_("dialogs-action", "Tool _Options"),
{ NULL },
NC_("dialogs-action", "Open the tool options dialog"),
"gimp-tool-options",
GIMP_HELP_TOOL_OPTIONS_DIALOG },
{ "dialogs-device-status", GIMP_ICON_DIALOG_DEVICE_STATUS,
NC_("dialogs-action", "_Device Status"), NULL,
NC_("dialogs-action", "_Device Status Dialog"),
NC_("dialogs-action", "_Device Status"),
{ NULL },
NC_("dialogs-action", "Open the device status dialog"),
"gimp-device-status",
GIMP_HELP_DEVICE_STATUS_DIALOG },
{ "dialogs-symmetry", GIMP_ICON_SYMMETRY,
NC_("dialogs-action", "_Symmetry Painting"), NULL,
NC_("dialogs-action", "_Symmetry Painting Dialog"),
NC_("dialogs-action", "_Symmetry Painting"),
{ NULL },
NC_("dialogs-action", "Open the symmetry dialog"),
"gimp-symmetry-editor",
GIMP_HELP_SYMMETRY_DIALOG },
{ "dialogs-layers", GIMP_ICON_DIALOG_LAYERS,
NC_("dialogs-action", "_Layers"), "<primary>L",
NC_("dialogs-action", "_Layers Dialog"),
NC_("dialogs-action", "_Layers"),
{ "<primary>L", NULL },
NC_("dialogs-action", "Open the layers dialog"),
"gimp-layer-list",
GIMP_HELP_LAYER_DIALOG },
{ "dialogs-channels", GIMP_ICON_DIALOG_CHANNELS,
NC_("dialogs-action", "_Channels"), NULL,
NC_("dialogs-action", "_Channels Dialog"),
NC_("dialogs-action", "_Channels"),
{ NULL },
NC_("dialogs-action", "Open the channels dialog"),
"gimp-channel-list",
GIMP_HELP_CHANNEL_DIALOG },
{ "dialogs-vectors", GIMP_ICON_DIALOG_PATHS,
NC_("dialogs-action", "_Paths"), NULL,
NC_("dialogs-action", "_Paths Dialog"),
NC_("dialogs-action", "_Paths"),
{ NULL },
NC_("dialogs-action", "Open the paths dialog"),
"gimp-vectors-list",
GIMP_HELP_PATH_DIALOG },
{ "dialogs-indexed-palette", GIMP_ICON_COLORMAP,
NC_("dialogs-action", "Color_map"), NULL,
NC_("dialogs-action", "Color_map Dialog"),
NC_("dialogs-action", "Color_map"),
{ NULL },
NC_("dialogs-action", "Open the colormap dialog"),
"gimp-indexed-palette",
GIMP_HELP_INDEXED_PALETTE_DIALOG },
{ "dialogs-histogram", GIMP_ICON_HISTOGRAM,
NC_("dialogs-action", "Histogra_m"), NULL,
NC_("dialogs-action", "Histogra_m Dialog"),
NC_("dialogs-action", "Histogra_m"),
{ NULL },
NC_("dialogs-action", "Open the histogram dialog"),
"gimp-histogram-editor",
GIMP_HELP_HISTOGRAM_DIALOG },
{ "dialogs-selection-editor", GIMP_ICON_SELECTION,
NC_("dialogs-action", "_Selection Editor"), NULL,
{ NULL },
NC_("dialogs-action", "Open the selection editor"),
"gimp-selection-editor",
GIMP_HELP_SELECTION_DIALOG },
{ "dialogs-navigation", GIMP_ICON_DIALOG_NAVIGATION,
NC_("dialogs-action", "Na_vigation"), NULL,
NC_("dialogs-action", "Na_vigation Dialog"),
NC_("dialogs-action", "Na_vigation"),
{ NULL },
NC_("dialogs-action", "Open the display navigation dialog"),
"gimp-navigation-view",
GIMP_HELP_NAVIGATION_DIALOG },
{ "dialogs-undo-history", GIMP_ICON_DIALOG_UNDO_HISTORY,
NC_("dialogs-action", "Undo _History"), NULL,
NC_("dialogs-action", "Undo _History Dialog"),
NC_("dialogs-action", "Undo _History"),
{ NULL },
NC_("dialogs-action", "Open the undo history dialog"),
"gimp-undo-history",
GIMP_HELP_UNDO_DIALOG },
{ "dialogs-cursor", GIMP_ICON_CURSOR,
NC_("dialogs-action", "_Pointer"), NULL,
NC_("dialogs-action", "_Pointer Dialog"),
NC_("dialogs-action", "_Pointer"),
{ NULL },
NC_("dialogs-action", "Open the pointer information dialog"),
"gimp-cursor-view",
GIMP_HELP_POINTER_INFO_DIALOG },
{ "dialogs-sample-points", GIMP_ICON_SAMPLE_POINT,
NC_("dialogs-action", "_Sample Points"), NULL,
NC_("dialogs-action", "_Sample Points Dialog"),
NC_("dialogs-action", "_Sample Points"),
{ NULL },
NC_("dialogs-action", "Open the sample points dialog"),
"gimp-sample-point-editor",
GIMP_HELP_SAMPLE_POINT_DIALOG },
{ "dialogs-colors", GIMP_ICON_COLORS_DEFAULT,
NC_("dialogs-action", "Colo_rs"), NULL,
NC_("dialogs-action", "Colo_rs Dialog"),
NC_("dialogs-action", "Colo_rs"),
{ NULL },
NC_("dialogs-action", "Open the FG/BG color dialog"),
"gimp-color-editor",
GIMP_HELP_COLOR_DIALOG },
{ "dialogs-brushes", GIMP_ICON_BRUSH,
NC_("dialogs-action", "_Brushes"), "<primary><shift>B",
NC_("dialogs-action", "_Brushes Dialog"),
NC_("dialogs-action", "_Brushes"),
{ "<primary><shift>B", NULL },
NC_("dialogs-action", "Open the brushes dialog"),
"gimp-brush-grid|gimp-brush-list",
GIMP_HELP_BRUSH_DIALOG },
{ "dialogs-brush-editor", GIMP_ICON_BRUSH,
NC_("dialogs-action", "Brush Editor"), NULL,
{ NULL },
NC_("dialogs-action", "Open the brush editor"),
"gimp-brush-editor",
GIMP_HELP_BRUSH_EDIT },
{ "dialogs-dynamics", GIMP_ICON_DYNAMICS,
NC_("dialogs-action", "Paint D_ynamics"), NULL,
NC_("dialogs-action", "Paint D_ynamics Dialog"),
NC_("dialogs-action", "Paint D_ynamics"),
{ NULL },
NC_("dialogs-action", "Open paint dynamics dialog"),
"gimp-dynamics-list|gimp-dynamics-grid",
GIMP_HELP_DYNAMICS_DIALOG },
{ "dialogs-dynamics-editor", GIMP_ICON_DYNAMICS,
NC_("dialogs-action", "Paint Dynamics Editor"), NULL,
{ NULL },
NC_("dialogs-action", "Open the paint dynamics editor"),
"gimp-dynamics-editor",
GIMP_HELP_DYNAMICS_EDITOR_DIALOG },
{ "dialogs-mypaint-brushes", GIMP_ICON_MYPAINT_BRUSH,
NC_("dialogs-action", "_MyPaint Brushes"), NULL,
NC_("dialogs-action", "_MyPaint Brushes Dialog"),
NC_("dialogs-action", "_MyPaint Brushes"),
{ NULL },
NC_("dialogs-action", "Open the mypaint brushes dialog"),
"gimp-mypaint-brush-grid|gimp-mapyint-brush-list",
GIMP_HELP_MYPAINT_BRUSH_DIALOG },
{ "dialogs-patterns", GIMP_ICON_PATTERN,
NC_("dialogs-action", "P_atterns"), "<primary><shift>P",
NC_("dialogs-action", "P_atterns Dialog"),
NC_("dialogs-action", "P_atterns"),
{ "<primary><shift>P", NULL },
NC_("dialogs-action", "Open the patterns dialog"),
"gimp-pattern-grid|gimp-pattern-list",
GIMP_HELP_PATTERN_DIALOG },
{ "dialogs-gradients", GIMP_ICON_GRADIENT,
NC_("dialogs-action", "_Gradients"), "<primary>G",
NC_("dialogs-action", "_Gradients Dialog"),
NC_("dialogs-action", "_Gradients"),
{ "<primary>G", NULL },
NC_("dialogs-action", "Open the gradients dialog"),
"gimp-gradient-list|gimp-gradient-grid",
GIMP_HELP_GRADIENT_DIALOG },
{ "dialogs-gradient-editor", GIMP_ICON_GRADIENT,
NC_("dialogs-action", "Gradient Editor"), NULL,
{ NULL },
NC_("dialogs-action", "Open the gradient editor"),
"gimp-gradient-editor",
GIMP_HELP_GRADIENT_EDIT },
{ "dialogs-palettes", GIMP_ICON_PALETTE,
NC_("dialogs-action", "Pal_ettes"), NULL,
NC_("dialogs-action", "Pal_ettes Dialog"),
NC_("dialogs-action", "Pal_ettes"),
{ NULL },
NC_("dialogs-action", "Open the palettes dialog"),
"gimp-palette-list|gimp-palette-grid",
GIMP_HELP_PALETTE_DIALOG },
{ "dialogs-palette-editor", GIMP_ICON_PALETTE,
NC_("dialogs-action", "Palette _Editor"), NULL,
NC_("dialogs-action", "Palette _Editor"),
NC_("dialogs-action", "Palette _Editor"),
{ NULL },
NC_("dialogs-action", "Open the palette editor"),
"gimp-palette-editor",
GIMP_HELP_PALETTE_EDIT },
{ "dialogs-tool-presets", GIMP_ICON_TOOL_PRESET,
NC_("dialogs-action", "Tool Pre_sets"), NULL,
NC_("dialogs-action", "Tool Pre_sets Dialog"),
NC_("dialogs-action", "Tool Pre_sets"),
{ NULL },
NC_("dialogs-action", "Open tool presets dialog"),
"gimp-tool-preset-list|gimp-tool-preset-grid",
GIMP_HELP_TOOL_PRESET_DIALOG },
{ "dialogs-fonts", GIMP_ICON_FONT,
NC_("dialogs-action", "_Fonts"), NULL,
NC_("dialogs-action", "_Fonts Dialog"),
NC_("dialogs-action", "_Fonts"),
{ NULL },
NC_("dialogs-action", "Open the fonts dialog"),
"gimp-font-list|gimp-font-grid",
GIMP_HELP_FONT_DIALOG },
{ "dialogs-buffers", GIMP_ICON_BUFFER,
NC_("dialogs-action", "B_uffers"), "",
NC_("dialogs-action", "B_uffers Dialog"),
NC_("dialogs-action", "B_uffers"),
{ NULL },
NC_("dialogs-action", "Open the named buffers dialog"),
"gimp-buffer-list|gimp-buffer-grid",
GIMP_HELP_BUFFER_DIALOG },
{ "dialogs-images", GIMP_ICON_DIALOG_IMAGES,
NC_("dialogs-action", "_Images"), NULL,
NC_("dialogs-action", "_Images Dialog"),
NC_("dialogs-action", "_Images"),
{ NULL },
NC_("dialogs-action", "Open the images dialog"),
"gimp-image-list|gimp-image-grid",
GIMP_HELP_IMAGE_DIALOG },
{ "dialogs-document-history", GIMP_ICON_DOCUMENT_OPEN_RECENT,
NC_("dialogs-action", "Document Histor_y"), "",
NC_("dialogs-action", "Document Histor_y Dialog"),
NC_("dialogs-action", "Document Histor_y"),
{ NULL },
NC_("dialogs-action", "Open the document history dialog"),
"gimp-document-list|gimp-document-grid",
GIMP_HELP_DOCUMENT_DIALOG },
{ "dialogs-templates", GIMP_ICON_TEMPLATE,
NC_("dialogs-action", "_Templates"), "",
NC_("dialogs-action", "_Templates Dialog"),
NC_("dialogs-action", "_Templates"),
{ NULL },
NC_("dialogs-action", "Open the image templates dialog"),
"gimp-template-list|gimp-template-grid",
GIMP_HELP_TEMPLATE_DIALOG },
{ "dialogs-error-console", GIMP_ICON_DIALOG_WARNING,
NC_("dialogs-action", "Error Co_nsole"), NULL,
NC_("dialogs-action", "Error Co_nsole"),
NC_("dialogs-action", "Error Co_nsole"),
{ NULL },
NC_("dialogs-action", "Open the error console"),
"gimp-error-console",
GIMP_HELP_ERRORS_DIALOG },
{ "dialogs-dashboard", GIMP_ICON_DIALOG_DASHBOARD,
NC_("dialogs-action", "_Dashboard"), NULL,
NC_("dialogs-action", "_Dashboard"),
NC_("dialogs-action", "_Dashboard"),
{ NULL },
NC_("dialogs-action", "Open the dashboard"),
"gimp-dashboard",
GIMP_HELP_ERRORS_DIALOG }
@@ -247,35 +307,56 @@ gint n_dialogs_dockable_actions = G_N_ELEMENTS (dialogs_dockable_actions);
static const GimpStringActionEntry dialogs_toplevel_actions[] =
{
{ "dialogs-preferences", GIMP_ICON_PREFERENCES_SYSTEM,
NC_("dialogs-action", "_Preferences"), NULL,
#if defined(PLATFORM_OSX)
NC_("dialogs-action", "_Settings..."),
NC_("dialogs-action", "_Settings..."),
#else
NC_("dialogs-action", "_Preferences"),
NC_("dialogs-action", "_Preferences"),
#endif
{ NULL },
NC_("dialogs-action", "Open the preferences dialog"),
"gimp-preferences-dialog",
GIMP_HELP_PREFS_DIALOG },
{ "dialogs-input-devices", GIMP_ICON_INPUT_DEVICE,
NC_("dialogs-action", "_Input Devices"), NULL,
NC_("dialogs-action", "_Input Devices Editor"),
NC_("dialogs-action", "_Input Devices"),
{ NULL },
NC_("dialogs-action", "Open the input devices editor"),
"gimp-input-devices-dialog",
GIMP_HELP_INPUT_DEVICES },
{ "dialogs-keyboard-shortcuts", GIMP_ICON_CHAR_PICKER,
NC_("dialogs-action", "_Keyboard Shortcuts"), NULL,
NC_("dialogs-action", "_Keyboard Shortcuts Editor"),
NC_("dialogs-action", "_Keyboard Shortcuts"),
{ NULL },
NC_("dialogs-action", "Open the keyboard shortcuts editor"),
"gimp-keyboard-shortcuts-dialog",
GIMP_HELP_KEYBOARD_SHORTCUTS },
{ "dialogs-module-dialog", GIMP_ICON_SYSTEM_RUN,
NC_("dialogs-action", "_Modules"), NULL,
NC_("dialogs-action", "_Modules Dialog"),
NC_("dialogs-action", "_Modules"),
{ NULL },
NC_("dialogs-action", "Open the module manager dialog"),
"gimp-module-dialog",
GIMP_HELP_MODULE_DIALOG },
{ "dialogs-tips", GIMP_ICON_DIALOG_INFORMATION,
NC_("dialogs-action", "_Tip of the Day"), NULL,
{ NULL },
NC_("dialogs-action", "Show some helpful tips on using GIMP"),
"gimp-tips-dialog",
GIMP_HELP_TIPS_DIALOG },
{ "dialogs-welcome", GIMP_ICON_DIALOG_INFORMATION,
NC_("dialogs-action", "Welcome Dialog"), NULL,
{ NULL },
NC_("dialogs-action", "Show information on running GIMP release"),
"gimp-welcome-dialog",
GIMP_HELP_WELCOME_DIALOG },
{ "dialogs-about", GIMP_ICON_HELP_ABOUT,
#if defined(G_OS_WIN32)
NC_("dialogs-action", "About GIMP"),
@@ -284,22 +365,26 @@ static const GimpStringActionEntry dialogs_toplevel_actions[] =
#else /* UNIX: use GNOME HIG */
NC_("dialogs-action", "_About"),
#endif
NULL,
NULL, { NULL },
NC_("dialogs-action", "About GIMP"),
"gimp-about-dialog",
GIMP_HELP_ABOUT_DIALOG },
{ "dialogs-action-search", GIMP_ICON_TOOL_ZOOM,
NC_("dialogs-action", "_Search and Run a Command"), "slash",
NC_("dialogs-action", "_Search and Run a Command"), NULL,
{ "slash", "KP_Divide", NULL },
NC_("dialogs-action", "Search commands by keyword, and run them"),
"gimp-action-search-dialog",
GIMP_HELP_ACTION_SEARCH_DIALOG },
#ifndef GIMP_RELEASE
{ "dialogs-extensions", GIMP_ICON_PLUGIN,
NC_("dialogs-action", "Manage _Extensions"), NULL,
{ NULL },
NC_("dialogs-action", "Manage Extensions: search, install, uninstall, update."),
"gimp-extensions-dialog",
GIMP_HELP_EXTENSIONS_DIALOG }
#endif
};

View File

@@ -42,17 +42,13 @@
static const GimpActionEntry dock_actions[] =
{
{ "dock-move-to-screen-menu", GIMP_ICON_WINDOW_MOVE_TO_SCREEN,
NC_("dock-action", "M_ove to Screen"), NULL, NULL, NULL,
GIMP_HELP_DOCK_CHANGE_SCREEN },
{ "dock-close", GIMP_ICON_WINDOW_CLOSE,
NC_("dock-action", "Close Dock"), "", NULL,
NC_("dock-action", "Close Dock"), NULL, { NULL }, NULL,
window_close_cmd_callback,
GIMP_HELP_DOCK_CLOSE },
{ "dock-open-display", NULL,
NC_("dock-action", "_Open Display..."), NULL,
NC_("dock-action", "_Open Display..."), NULL, { NULL },
NC_("dock-action", "Connect to another display"),
window_open_display_cmd_callback,
NULL }
@@ -61,13 +57,13 @@ static const GimpActionEntry dock_actions[] =
static const GimpToggleActionEntry dock_toggle_actions[] =
{
{ "dock-show-image-menu", NULL,
NC_("dock-action", "_Show Image Selection"), NULL, NULL,
NC_("dock-action", "_Show Image Selection"), NULL, { NULL }, NULL,
dock_toggle_image_menu_cmd_callback,
TRUE,
GIMP_HELP_DOCK_IMAGE_MENU },
{ "dock-auto-follow-active", NULL,
NC_("dock-action", "Auto _Follow Active Image"), NULL, NULL,
NC_("dock-action", "Auto _Follow Active Image"), NULL, { NULL }, NULL,
dock_toggle_auto_cmd_callback,
TRUE,
GIMP_HELP_DOCK_AUTO_BUTTON }

View File

@@ -45,37 +45,25 @@
static const GimpActionEntry dockable_actions[] =
{
{ "dockable-popup", NULL,
NC_("dockable-action", "Dialogs Menu"), NULL, NULL, NULL,
GIMP_HELP_DOCK },
{ "dockable-menu", "image-missing", "" },
{ "dockable-add-tab-menu", NULL, NC_("dockable-action",
"_Add Tab") },
{ "dockable-preview-size-menu", NULL, NC_("dockable-action",
"_Preview Size") },
{ "dockable-tab-style-menu", NULL, NC_("dockable-action",
"_Tab Style") },
{ "dockable-close-tab", "window-close",
NC_("dockable-action", "_Close Tab"), "", NULL,
NC_("dockable-action", "_Close Tab"), NULL, { NULL }, NULL,
dockable_close_tab_cmd_callback,
GIMP_HELP_DOCK_TAB_CLOSE },
{ "dockable-detach-tab", GIMP_ICON_DETACH,
NC_("dockable-action", "_Detach Tab"), "", NULL,
NC_("dockable-action", "_Detach Tab"), NULL, { NULL }, NULL,
dockable_detach_tab_cmd_callback,
GIMP_HELP_DOCK_TAB_DETACH }
};
#define VIEW_SIZE(action,label,size) \
{ "dockable-preview-size-" action, NULL, \
(label), NULL, NULL, \
(label), NULL, { NULL }, NULL, \
(size), \
GIMP_HELP_DOCK_PREVIEW_SIZE }
#define TAB_STYLE(action,label,style) \
{ "dockable-tab-style-" action, NULL, \
(label), NULL, NULL, \
(label), NULL, { NULL }, NULL, \
(style), \
GIMP_HELP_DOCK_TAB_STYLE }
@@ -122,7 +110,7 @@ static const GimpRadioActionEntry dockable_tab_style_actions[] =
static const GimpToggleActionEntry dockable_toggle_actions[] =
{
{ "dockable-lock-tab", NULL,
NC_("dockable-action", "Loc_k Tab to Dock"), NULL,
NC_("dockable-action", "Loc_k Tab to Dock"), NULL, { NULL },
NC_("dockable-action",
"Protect this tab from being dragged with the mouse pointer"),
dockable_lock_tab_cmd_callback,
@@ -130,7 +118,7 @@ static const GimpToggleActionEntry dockable_toggle_actions[] =
GIMP_HELP_DOCK_TAB_LOCK },
{ "dockable-show-button-bar", NULL,
NC_("dockable-action", "Show _Button Bar"), NULL, NULL,
NC_("dockable-action", "Show _Button Bar"), NULL, { NULL }, NULL,
dockable_show_button_bar_cmd_callback,
TRUE,
GIMP_HELP_DOCK_SHOW_BUTTON_BAR }
@@ -139,12 +127,12 @@ static const GimpToggleActionEntry dockable_toggle_actions[] =
static const GimpRadioActionEntry dockable_view_type_actions[] =
{
{ "dockable-view-type-list", NULL,
NC_("dockable-action", "View as _List"), NULL, NULL,
NC_("dockable-action", "View as _List"), NULL, { NULL }, NULL,
GIMP_VIEW_TYPE_LIST,
GIMP_HELP_DOCK_VIEW_AS_LIST },
{ "dockable-view-type-grid", NULL,
NC_("dockable-action", "View as _Grid"), NULL, NULL,
NC_("dockable-action", "View as _Grid"), NULL, { NULL }, NULL,
GIMP_VIEW_TYPE_GRID,
GIMP_HELP_DOCK_VIEW_AS_GRID }
};
@@ -288,7 +276,16 @@ dockable_actions_update (GimpActionGroup *group,
SET_ACTIVE ("dockable-lock-tab", locked);
SET_VISIBLE ("dockable-preview-size-menu", view_size != -1);
/* Submenus become invisible if all options inside them are hidden. */
SET_VISIBLE ("dockable-preview-size-gigantic", view_size != -1);
SET_VISIBLE ("dockable-preview-size-enormous", view_size != -1);
SET_VISIBLE ("dockable-preview-size-huge", view_size != -1);
SET_VISIBLE ("dockable-preview-size-extra-large", view_size != -1);
SET_VISIBLE ("dockable-preview-size-large", view_size != -1);
SET_VISIBLE ("dockable-preview-size-medium", view_size != -1);
SET_VISIBLE ("dockable-preview-size-small", view_size != -1);
SET_VISIBLE ("dockable-preview-size-extra-small", view_size != -1);
SET_VISIBLE ("dockable-preview-size-tiny", view_size != -1);
if (view_size != -1)
{

View File

@@ -38,66 +38,62 @@
static const GimpActionEntry documents_actions[] =
{
{ "documents-popup", GIMP_ICON_DOCUMENT_OPEN_RECENT,
NC_("documents-action", "Documents Menu"), NULL, NULL, NULL,
GIMP_HELP_DOCUMENT_DIALOG },
{ "documents-open", GIMP_ICON_DOCUMENT_OPEN,
NC_("documents-action", "_Open Image"), NULL,
NC_("documents-action", "_Open Image"), NULL, { NULL },
NC_("documents-action", "Open the selected entry"),
documents_open_cmd_callback,
GIMP_HELP_DOCUMENT_OPEN },
{ "documents-raise-or-open", NULL,
NC_("documents-action", "_Raise or Open Image"), NULL,
NC_("documents-action", "_Raise or Open Image"), NULL, { NULL },
NC_("documents-action", "Raise window if already open"),
documents_raise_or_open_cmd_callback,
GIMP_HELP_DOCUMENT_OPEN },
{ "documents-file-open-dialog", NULL,
NC_("documents-action", "File Open _Dialog"), NULL,
NC_("documents-action", "File Open _Dialog"), NULL, { NULL },
NC_("documents-action", "Open image dialog"),
documents_file_open_dialog_cmd_callback,
GIMP_HELP_DOCUMENT_OPEN },
{ "documents-copy-location", GIMP_ICON_EDIT_COPY,
NC_("documents-action", "Copy Image _Location"), NULL,
NC_("documents-action", "Copy Image _Location"), NULL, { NULL },
NC_("documents-action", "Copy image location to clipboard"),
documents_copy_location_cmd_callback,
GIMP_HELP_DOCUMENT_COPY_LOCATION },
{ "documents-show-in-file-manager", GIMP_ICON_FILE_MANAGER,
NC_("documents-action", "Show in _File Manager"), NULL,
NC_("documents-action", "Show in _File Manager"), NULL, { NULL },
NC_("documents-action", "Show image location in the file manager"),
documents_show_in_file_manager_cmd_callback,
GIMP_HELP_DOCUMENT_SHOW_IN_FILE_MANAGER },
{ "documents-remove", GIMP_ICON_LIST_REMOVE,
NC_("documents-action", "Remove _Entry"), NULL,
NC_("documents-action", "Remove _Entry"), NULL, { NULL },
NC_("documents-action", "Remove the selected entry"),
documents_remove_cmd_callback,
GIMP_HELP_DOCUMENT_REMOVE },
{ "documents-clear", GIMP_ICON_SHRED,
NC_("documents-action", "_Clear History"), NULL,
NC_("documents-action", "_Clear History"), NULL, { NULL },
NC_("documents-action", "Clear the entire document history"),
documents_clear_cmd_callback,
GIMP_HELP_DOCUMENT_CLEAR },
{ "documents-recreate-preview", GIMP_ICON_VIEW_REFRESH,
NC_("documents-action", "Recreate _Preview"), NULL,
NC_("documents-action", "Recreate _Preview"), NULL, { NULL },
NC_("documents-action", "Recreate preview"),
documents_recreate_preview_cmd_callback,
GIMP_HELP_DOCUMENT_REFRESH },
{ "documents-reload-previews", NULL,
NC_("documents-action", "Reload _all Previews"), NULL,
NC_("documents-action", "Reload _all Previews"), NULL, { NULL },
NC_("documents-action", "Reload all previews"),
documents_reload_previews_cmd_callback,
GIMP_HELP_DOCUMENT_REFRESH },
{ "documents-remove-dangling", NULL,
NC_("documents-action", "Remove Dangling E_ntries"), NULL,
NC_("documents-action", "Remove Dangling E_ntries"), NULL, { NULL },
NC_("documents-action",
"Remove entries for which the corresponding file is not available"),
documents_remove_dangling_cmd_callback,

View File

@@ -34,6 +34,7 @@
#include "core/gimpcontainer.h"
#include "core/gimpcontext.h"
#include "core/gimpimagefile.h"
#include "core/gimpimage.h"
#include "file/file-open.h"
@@ -121,7 +122,7 @@ documents_raise_or_open_cmd_callback (GimpAction *action,
closure.name = gimp_object_get_name (imagefile);
closure.found = FALSE;
gimp_container_foreach (context->gimp->displays,
gimp_container_foreach (GIMP_CONTAINER (context->gimp->displays),
(GFunc) documents_raise_display,
&closure);
@@ -399,11 +400,24 @@ static void
documents_raise_display (GimpDisplay *display,
RaiseClosure *closure)
{
const gchar *uri = gimp_object_get_name (gimp_display_get_image (display));
GimpImage *image;
GFile *file;
gchar *uri = NULL;
image = gimp_display_get_image (display);
file = gimp_image_get_file (image);
if (! file)
file = gimp_image_get_imported_file (image);
if (file)
uri = g_file_get_uri (file);
if (! g_strcmp0 (closure->name, uri))
{
closure->found = TRUE;
gimp_display_shell_present (gimp_display_get_shell (display));
}
g_free (uri);
}

View File

@@ -42,13 +42,13 @@
static const GimpActionEntry drawable_actions[] =
{
{ "drawable-equalize", NULL,
NC_("drawable-action", "_Equalize"), NULL,
NC_("drawable-action", "_Equalize"), NULL, { NULL },
NC_("drawable-action", "Automatic contrast enhancement"),
drawable_equalize_cmd_callback,
GIMP_HELP_LAYER_EQUALIZE },
{ "drawable-levels-stretch", NULL,
NC_("drawable-action", "_White Balance"), NULL,
NC_("drawable-action", "_White Balance"), NULL, { NULL },
NC_("drawable-action", "Automatic white balance correction"),
drawable_levels_stretch_cmd_callback,
GIMP_HELP_LAYER_WHITE_BALANCE }
@@ -57,23 +57,23 @@ static const GimpActionEntry drawable_actions[] =
static const GimpToggleActionEntry drawable_toggle_actions[] =
{
{ "drawable-visible", GIMP_ICON_VISIBLE,
NC_("drawable-action", "Toggle Drawable _Visibility"), NULL, NULL,
NC_("drawable-action", "Toggle Drawables _Visibility"), NULL, { NULL }, NULL,
drawable_visible_cmd_callback,
FALSE,
GIMP_HELP_LAYER_VISIBLE },
{ "drawable-lock-content", GIMP_ICON_LOCK_CONTENT,
NC_("drawable-action", "L_ock Pixels of Drawable"), NULL,
NC_("drawable-action", "L_ock Pixels of Drawables"), NULL, { NULL },
NC_("drawable-action",
"Keep the pixels on this drawable from being modified"),
"Keep the pixels on selected drawables from being modified"),
drawable_lock_content_cmd_callback,
FALSE,
GIMP_HELP_LAYER_LOCK_PIXELS },
{ "drawable-lock-position", GIMP_ICON_LOCK_POSITION,
NC_("drawable-action", "L_ock Position of Drawable"), NULL,
NC_("drawable-action", "L_ock Position of Drawables"), NULL, { NULL },
NC_("drawable-action",
"Keep the position on this drawable from being modified"),
"Keep the position on selected drawables from being modified"),
drawable_lock_position_cmd_callback,
FALSE,
GIMP_HELP_LAYER_LOCK_POSITION },
@@ -82,13 +82,13 @@ static const GimpToggleActionEntry drawable_toggle_actions[] =
static const GimpEnumActionEntry drawable_flip_actions[] =
{
{ "drawable-flip-horizontal", GIMP_ICON_OBJECT_FLIP_HORIZONTAL,
NC_("drawable-action", "Flip _Horizontally"), NULL,
NC_("drawable-action", "Flip _Horizontally"), NULL, { NULL },
NC_("drawable-action", "Flip drawable horizontally"),
GIMP_ORIENTATION_HORIZONTAL, FALSE,
GIMP_HELP_LAYER_FLIP_HORIZONTAL },
{ "drawable-flip-vertical", GIMP_ICON_OBJECT_FLIP_VERTICAL,
NC_("drawable-action", "Flip _Vertically"), NULL,
NC_("drawable-action", "Flip _Vertically"), NULL, { NULL },
NC_("drawable-action", "Flip drawable vertically"),
GIMP_ORIENTATION_VERTICAL, FALSE,
GIMP_HELP_LAYER_FLIP_VERTICAL }
@@ -97,21 +97,21 @@ static const GimpEnumActionEntry drawable_flip_actions[] =
static const GimpEnumActionEntry drawable_rotate_actions[] =
{
{ "drawable-rotate-90", GIMP_ICON_OBJECT_ROTATE_90,
NC_("drawable-action", "Rotate 90° _clockwise"), NULL,
NC_("drawable-action", "Rotate 90° _clockwise"), NULL, { NULL },
NC_("drawable-action", "Rotate drawable 90 degrees to the right"),
GIMP_ROTATE_90, FALSE,
GIMP_ROTATE_DEGREES90, FALSE,
GIMP_HELP_LAYER_ROTATE_90 },
{ "drawable-rotate-180", GIMP_ICON_OBJECT_ROTATE_180,
NC_("drawable-action", "Rotate _180°"), NULL,
NC_("drawable-action", "Rotate _180°"), NULL, { NULL },
NC_("drawable-action", "Turn drawable upside-down"),
GIMP_ROTATE_180, FALSE,
GIMP_ROTATE_DEGREES180, FALSE,
GIMP_HELP_LAYER_ROTATE_180 },
{ "drawable-rotate-270", GIMP_ICON_OBJECT_ROTATE_270,
NC_("drawable-action", "Rotate 90° counter-clock_wise"), NULL,
NC_("drawable-action", "Rotate 90° counter-clock_wise"), NULL, { NULL },
NC_("drawable-action", "Rotate drawable 90 degrees to the left"),
GIMP_ROTATE_270, FALSE,
GIMP_ROTATE_DEGREES270, FALSE,
GIMP_HELP_LAYER_ROTATE_270 }
};
@@ -151,56 +151,67 @@ void
drawable_actions_update (GimpActionGroup *group,
gpointer data)
{
GimpImage *image;
GimpDrawable *drawable = NULL;
GList *drawables = NULL;
gboolean has_visible = FALSE;
gboolean is_rgb = FALSE;
gboolean locked = FALSE;
gboolean can_lock = FALSE;
gboolean locked_pos = FALSE;
gboolean can_lock_pos = FALSE;
gboolean writable = FALSE;
gboolean movable = FALSE;
gboolean children = FALSE;
GList *iter;
GimpImage *image;
GList *drawables = NULL;
GList *iter;
gboolean has_visible = FALSE;
gboolean locked = TRUE;
gboolean can_lock = FALSE;
gboolean locked_pos = TRUE;
gboolean can_lock_pos = FALSE;
gboolean all_rgb = TRUE;
gboolean all_writable = TRUE;
gboolean all_movable = TRUE;
gboolean none_children = TRUE;
image = action_data_get_image (data);
if (image)
{
drawable = gimp_image_get_active_drawable (image);
drawables = gimp_image_get_selected_drawables (image);
for (iter = drawables; iter; iter = iter->next)
{
GimpItem *item;
if (gimp_item_get_visible (iter->data))
has_visible = TRUE;
if (has_visible)
break;
}
if (gimp_item_can_lock_content (iter->data))
{
if (! gimp_item_get_lock_content (iter->data))
locked = FALSE;
can_lock = TRUE;
}
if (drawable)
{
GimpItem *item;
if (gimp_item_can_lock_position (iter->data))
{
if (! gimp_item_get_lock_position (iter->data))
locked_pos = FALSE;
can_lock_pos = TRUE;
}
is_rgb = gimp_drawable_is_rgb (drawable);
if (gimp_viewable_get_children (GIMP_VIEWABLE (iter->data)))
none_children = FALSE;
if (GIMP_IS_LAYER_MASK (drawable))
item = GIMP_ITEM (gimp_layer_mask_get_layer (GIMP_LAYER_MASK (drawable)));
if (! gimp_drawable_is_rgb (iter->data))
all_rgb = FALSE;
if (GIMP_IS_LAYER_MASK (iter->data))
item = GIMP_ITEM (gimp_layer_mask_get_layer (GIMP_LAYER_MASK (iter->data)));
else
item = GIMP_ITEM (drawable);
item = GIMP_ITEM (iter->data);
locked = gimp_item_get_lock_content (item);
can_lock = gimp_item_can_lock_content (item);
writable = ! gimp_item_is_content_locked (item);
locked_pos = gimp_item_get_lock_position (item);
can_lock_pos = gimp_item_can_lock_position (item);
movable = ! gimp_item_is_position_locked (item);
if (gimp_item_is_content_locked (item, NULL))
all_writable = FALSE;
if (gimp_viewable_get_children (GIMP_VIEWABLE (drawable)))
children = TRUE;
if (gimp_item_is_position_locked (item, NULL))
all_movable = FALSE;
if (has_visible && ! locked && ! locked_pos &&
! none_children && ! all_rgb &&
! all_writable && ! all_movable)
break;
}
}
@@ -209,8 +220,8 @@ drawable_actions_update (GimpActionGroup *group,
#define SET_ACTIVE(action,condition) \
gimp_action_group_set_action_active (group, action, (condition) != 0)
SET_SENSITIVE ("drawable-equalize", writable && !children);
SET_SENSITIVE ("drawable-levels-stretch", writable && !children && is_rgb);
SET_SENSITIVE ("drawable-equalize", drawables && all_writable && none_children);
SET_SENSITIVE ("drawable-levels-stretch", drawables && all_writable && none_children && all_rgb);
SET_SENSITIVE ("drawable-visible", drawables);
SET_SENSITIVE ("drawable-lock-content", can_lock);
@@ -220,12 +231,12 @@ drawable_actions_update (GimpActionGroup *group,
SET_ACTIVE ("drawable-lock-content", locked);
SET_ACTIVE ("drawable-lock-position", locked_pos);
SET_SENSITIVE ("drawable-flip-horizontal", writable && movable);
SET_SENSITIVE ("drawable-flip-vertical", writable && movable);
SET_SENSITIVE ("drawable-flip-horizontal", drawables && all_writable && all_movable);
SET_SENSITIVE ("drawable-flip-vertical", drawables && all_writable && all_movable);
SET_SENSITIVE ("drawable-rotate-90", writable && movable);
SET_SENSITIVE ("drawable-rotate-180", writable && movable);
SET_SENSITIVE ("drawable-rotate-270", writable && movable);
SET_SENSITIVE ("drawable-rotate-90", drawables && all_writable && all_movable);
SET_SENSITIVE ("drawable-rotate-180", drawables && all_writable && all_movable);
SET_SENSITIVE ("drawable-rotate-270", drawables && all_writable && all_movable);
#undef SET_SENSITIVE
#undef SET_ACTIVE

View File

@@ -49,12 +49,25 @@ drawable_equalize_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data)
{
GimpImage *image;
GimpDrawable *drawable;
return_if_no_drawable (image, drawable, data);
GimpImage *image;
GList *drawables;
GList *iter;
return_if_no_drawables (image, drawables, data);
if (g_list_length (drawables) > 1)
gimp_image_undo_group_start (image,
GIMP_UNDO_GROUP_DRAWABLE_MOD,
_("Equalize"));
for (iter = drawables; iter; iter = iter->next)
gimp_drawable_equalize (iter->data, TRUE);
if (g_list_length (drawables) > 1)
gimp_image_undo_group_end (image);
gimp_drawable_equalize (drawable, TRUE);
gimp_image_flush (image);
g_list_free (drawables);
}
void
@@ -63,24 +76,40 @@ drawable_levels_stretch_cmd_callback (GimpAction *action,
gpointer data)
{
GimpImage *image;
GimpDrawable *drawable;
GList *drawables;
GList *iter;
GimpDisplay *display;
GtkWidget *widget;
return_if_no_drawable (image, drawable, data);
return_if_no_drawables (image, drawables, data);
return_if_no_display (display, data);
return_if_no_widget (widget, data);
if (! gimp_drawable_is_rgb (drawable))
for (iter = drawables; iter; iter = iter->next)
{
gimp_message_literal (image->gimp,
G_OBJECT (widget), GIMP_MESSAGE_WARNING,
_("White Balance operates only on RGB color "
"layers."));
return;
if (! gimp_drawable_is_rgb (iter->data))
{
gimp_message_literal (image->gimp,
G_OBJECT (widget), GIMP_MESSAGE_WARNING,
_("White Balance operates only on RGB color "
"layers."));
return;
}
}
gimp_drawable_levels_stretch (drawable, GIMP_PROGRESS (display));
if (g_list_length (drawables) > 1)
gimp_image_undo_group_start (image,
GIMP_UNDO_GROUP_DRAWABLE_MOD,
_("Levels"));
for (iter = drawables; iter; iter = iter->next)
gimp_drawable_levels_stretch (iter->data, GIMP_PROGRESS (display));
if (g_list_length (drawables) > 1)
gimp_image_undo_group_end (image);
gimp_image_flush (image);
g_list_free (drawables);
}
void
@@ -154,6 +183,7 @@ drawable_visible_cmd_callback (GimpAction *action,
gimp_image_undo_group_end (image);
gimp_image_flush (image);
g_list_free (drawables);
}
void
@@ -161,35 +191,67 @@ drawable_lock_content_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data)
{
GimpImage *image;
GimpDrawable *drawable;
gboolean locked;
return_if_no_drawable (image, drawable, data);
GimpImage *image;
GList *drawables;
GList *iter;
gboolean locked;
gboolean push_undo = TRUE;
return_if_no_drawables (image, drawables, data);
locked = g_variant_get_boolean (value);
if (GIMP_IS_LAYER_MASK (drawable))
drawable =
GIMP_DRAWABLE (gimp_layer_mask_get_layer (GIMP_LAYER_MASK (drawable)));
if (locked != gimp_item_get_lock_content (GIMP_ITEM (drawable)))
if (GIMP_IS_LAYER_MASK (drawables->data))
{
#if 0
GimpUndo *undo;
#endif
gboolean push_undo = TRUE;
GimpLayerMask *mask = GIMP_LAYER_MASK (drawables->data);
#if 0
undo = gimp_image_undo_can_compress (image, GIMP_TYPE_ITEM_UNDO,
GIMP_UNDO_ITEM_VISIBILITY);
if (undo && GIMP_ITEM_UNDO (undo)->item == GIMP_ITEM (drawable))
push_undo = FALSE;
#endif
gimp_item_set_lock_content (GIMP_ITEM (drawable), locked, push_undo);
gimp_image_flush (image);
g_list_free (drawables);
drawables = g_list_prepend (NULL, gimp_layer_mask_get_layer (mask));
}
for (iter = drawables; iter; iter = iter->next)
{
if (! locked && ! gimp_item_get_lock_content (iter->data))
{
/* If any of the drawables are already unlocked, we don't toggle the
* lock. This prevents the SET_ACTIVE() in drawables-actions.c to
* toggle locks unexpectedly.
*/
g_list_free (drawables);
return;
}
}
for (iter = drawables; iter; iter = iter->next)
if (locked != gimp_item_get_lock_content (iter->data))
break;
if (g_list_length (drawables) == 1)
{
GimpUndo *undo;
undo = gimp_image_undo_can_compress (image, GIMP_TYPE_ITEM_UNDO,
GIMP_UNDO_ITEM_LOCK_CONTENT);
if (undo && GIMP_ITEM_UNDO (undo)->item == GIMP_ITEM (drawables->data))
push_undo = FALSE;
}
else
{
/* TODO: undo groups cannot be compressed so far. */
gimp_image_undo_group_start (image,
GIMP_UNDO_GROUP_ITEM_LOCK_CONTENTS,
_("Lock/Unlock content"));
}
for (; iter; iter = iter->next)
gimp_item_set_lock_content (iter->data, locked, push_undo);
if (g_list_length (drawables) != 1)
gimp_image_undo_group_end (image);
gimp_image_flush (image);
g_list_free (drawables);
}
void
@@ -197,31 +259,67 @@ drawable_lock_position_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data)
{
GimpImage *image;
GimpDrawable *drawable;
gboolean locked;
return_if_no_drawable (image, drawable, data);
GimpImage *image;
GList *drawables;
GList *iter;
gboolean locked;
gboolean push_undo = TRUE;
return_if_no_drawables (image, drawables, data);
locked = g_variant_get_boolean (value);
if (GIMP_IS_LAYER_MASK (drawable))
drawable =
GIMP_DRAWABLE (gimp_layer_mask_get_layer (GIMP_LAYER_MASK (drawable)));
if (GIMP_IS_LAYER_MASK (drawables->data))
{
GimpLayerMask *mask = GIMP_LAYER_MASK (drawables->data);
if (locked != gimp_item_get_lock_position (GIMP_ITEM (drawable)))
g_list_free (drawables);
drawables = g_list_prepend (NULL, gimp_layer_mask_get_layer (mask));
}
for (iter = drawables; iter; iter = iter->next)
{
if (! locked && ! gimp_item_get_lock_position (iter->data))
{
/* If any of the drawables are already unlocked, we don't toggle the
* lock. This prevents the SET_ACTIVE() in drawables-actions.c to
* toggle locks unexpectedly.
*/
g_list_free (drawables);
return;
}
}
for (iter = drawables; iter; iter = iter->next)
if (locked != gimp_item_get_lock_position (iter->data))
break;
if (g_list_length (drawables) == 1)
{
GimpUndo *undo;
gboolean push_undo = TRUE;
undo = gimp_image_undo_can_compress (image, GIMP_TYPE_ITEM_UNDO,
GIMP_UNDO_ITEM_LOCK_POSITION);
if (undo && GIMP_ITEM_UNDO (undo)->item == GIMP_ITEM (drawable))
if (undo && GIMP_ITEM_UNDO (undo)->item == GIMP_ITEM (drawables->data))
push_undo = FALSE;
gimp_item_set_lock_position (GIMP_ITEM (drawable), locked, push_undo);
gimp_image_flush (image);
}
else
{
/* TODO: undo groups cannot be compressed so far. */
gimp_image_undo_group_start (image,
GIMP_UNDO_GROUP_ITEM_LOCK_POSITION,
_("Lock/Unlock position"));
}
for (; iter; iter = iter->next)
gimp_item_set_lock_position (iter->data, locked, push_undo);
if (g_list_length (drawables) != 1)
gimp_image_undo_group_end (image);
gimp_image_flush (image);
g_list_free (drawables);
}
void
@@ -230,39 +328,54 @@ drawable_flip_cmd_callback (GimpAction *action,
gpointer data)
{
GimpImage *image;
GimpDrawable *drawable;
GimpItem *item;
GList *drawables;
GList *iter;
GimpContext *context;
gint off_x, off_y;
gdouble axis = 0.0;
GimpOrientationType orientation;
return_if_no_drawable (image, drawable, data);
return_if_no_drawables (image, drawables, data);
return_if_no_context (context, data);
orientation = (GimpOrientationType) g_variant_get_int32 (value);
item = GIMP_ITEM (drawable);
if (g_list_length (drawables) > 1)
gimp_image_undo_group_start (image,
GIMP_UNDO_GROUP_DRAWABLE_MOD,
_("Flip Drawables"));
gimp_item_get_offset (item, &off_x, &off_y);
switch (orientation)
for (iter = drawables; iter; iter = iter->next)
{
case GIMP_ORIENTATION_HORIZONTAL:
axis = ((gdouble) off_x + (gdouble) gimp_item_get_width (item) / 2.0);
break;
GimpItem *item;
case GIMP_ORIENTATION_VERTICAL:
axis = ((gdouble) off_y + (gdouble) gimp_item_get_height (item) / 2.0);
break;
item = GIMP_ITEM (iter->data);
default:
break;
gimp_item_get_offset (item, &off_x, &off_y);
switch (orientation)
{
case GIMP_ORIENTATION_HORIZONTAL:
axis = ((gdouble) off_x + (gdouble) gimp_item_get_width (item) / 2.0);
break;
case GIMP_ORIENTATION_VERTICAL:
axis = ((gdouble) off_y + (gdouble) gimp_item_get_height (item) / 2.0);
break;
default:
break;
}
gimp_item_flip (item, context, orientation, axis,
gimp_item_get_clip (item, FALSE));
}
gimp_item_flip (item, context, orientation, axis,
gimp_item_get_clip (item, FALSE));
if (g_list_length (drawables) > 1)
gimp_image_undo_group_end (image);
gimp_image_flush (image);
g_list_free (drawables);
}
void
@@ -271,27 +384,42 @@ drawable_rotate_cmd_callback (GimpAction *action,
gpointer data)
{
GimpImage *image;
GimpDrawable *drawable;
GList *drawables;
GList *iter;
GimpContext *context;
GimpItem *item;
gint off_x, off_y;
gdouble center_x, center_y;
GimpRotationType rotation_type;
return_if_no_drawable (image, drawable, data);
return_if_no_drawables (image, drawables, data);
return_if_no_context (context, data);
rotation_type = (GimpRotationType) g_variant_get_int32 (value);
item = GIMP_ITEM (drawable);
if (g_list_length (drawables) > 1)
gimp_image_undo_group_start (image,
GIMP_UNDO_GROUP_DRAWABLE_MOD,
_("Rotate Drawables"));
gimp_item_get_offset (item, &off_x, &off_y);
for (iter = drawables; iter; iter = iter->next)
{
GimpItem *item;
gint off_x, off_y;
gdouble center_x, center_y;
center_x = ((gdouble) off_x + (gdouble) gimp_item_get_width (item) / 2.0);
center_y = ((gdouble) off_y + (gdouble) gimp_item_get_height (item) / 2.0);
item = GIMP_ITEM (iter->data);
gimp_item_rotate (item, context,
rotation_type, center_x, center_y,
gimp_item_get_clip (item, FALSE));
gimp_item_get_offset (item, &off_x, &off_y);
center_x = ((gdouble) off_x + (gdouble) gimp_item_get_width (item) / 2.0);
center_y = ((gdouble) off_y + (gdouble) gimp_item_get_height (item) / 2.0);
gimp_item_rotate (item, context,
rotation_type, center_x, center_y,
gimp_item_get_clip (item, FALSE));
}
if (g_list_length (drawables) > 1)
gimp_image_undo_group_end (image);
gimp_image_flush (image);
g_list_free (drawables);
}

View File

@@ -39,42 +39,38 @@
static const GimpActionEntry dynamics_actions[] =
{
{ "dynamics-popup", GIMP_ICON_DYNAMICS,
NC_("dynamics-action", "Paint Dynamics Menu"), NULL, NULL, NULL,
GIMP_HELP_DYNAMICS_DIALOG },
{ "dynamics-new", GIMP_ICON_DOCUMENT_NEW,
NC_("dynamics-action", "_New Dynamics"), NULL,
NC_("dynamics-action", "_New Dynamics"), NULL, { NULL },
NC_("dynamics-action", "Create a new dynamics"),
data_new_cmd_callback,
GIMP_HELP_DYNAMICS_NEW },
{ "dynamics-duplicate", GIMP_ICON_OBJECT_DUPLICATE,
NC_("dynamics-action", "D_uplicate Dynamics"), NULL,
NC_("dynamics-action", "D_uplicate Dynamics"), NULL, { NULL },
NC_("dynamics-action", "Duplicate this dynamics"),
data_duplicate_cmd_callback,
GIMP_HELP_DYNAMICS_DUPLICATE },
{ "dynamics-copy-location", GIMP_ICON_EDIT_COPY,
NC_("dynamics-action", "Copy Dynamics _Location"), NULL,
NC_("dynamics-action", "Copy Dynamics _Location"), NULL, { NULL },
NC_("dynamics-action", "Copy dynamics file location to clipboard"),
data_copy_location_cmd_callback,
GIMP_HELP_DYNAMICS_COPY_LOCATION },
{ "dynamics-show-in-file-manager", GIMP_ICON_FILE_MANAGER,
NC_("dynamics-action", "Show in _File Manager"), NULL,
NC_("dynamics-action", "Show in _File Manager"), NULL, { NULL },
NC_("dynamics-action", "Show dynamics file location in the file manager"),
data_show_in_file_manager_cmd_callback,
GIMP_HELP_DYNAMICS_SHOW_IN_FILE_MANAGER },
{ "dynamics-delete", GIMP_ICON_EDIT_DELETE,
NC_("dynamics-action", "_Delete Dynamics"), NULL,
NC_("dynamics-action", "_Delete Dynamics"), NULL, { NULL },
NC_("dynamics-action", "Delete this dynamics"),
data_delete_cmd_callback,
GIMP_HELP_DYNAMICS_DELETE },
{ "dynamics-refresh", GIMP_ICON_VIEW_REFRESH,
NC_("dynamics-action", "_Refresh Dynamics"), NULL,
NC_("dynamics-action", "_Refresh Dynamics"), NULL, { NULL },
NC_("dynamics-action", "Refresh dynamics"),
data_refresh_cmd_callback,
GIMP_HELP_DYNAMICS_REFRESH }
@@ -83,7 +79,7 @@ static const GimpActionEntry dynamics_actions[] =
static const GimpStringActionEntry dynamics_edit_actions[] =
{
{ "dynamics-edit", GIMP_ICON_EDIT,
NC_("dynamics-action", "_Edit Dynamics..."), NULL,
NC_("dynamics-action", "_Edit Dynamics..."), NULL, { NULL },
NC_("dynamics-action", "Edit this dynamics"),
"gimp-dynamics-editor",
GIMP_HELP_DYNAMICS_EDIT }

View File

@@ -37,18 +37,10 @@
#include "gimp-intl.h"
static const GimpActionEntry dynamics_editor_actions[] =
{
{ "dynamics-editor-popup", GIMP_ICON_DYNAMICS,
NC_("dynamics-editor-action", "Paint Dynamics Editor Menu"), NULL, NULL, NULL,
GIMP_HELP_BRUSH_EDITOR_DIALOG }
};
static const GimpToggleActionEntry dynamics_editor_toggle_actions[] =
{
{ "dynamics-editor-edit-active", GIMP_ICON_LINKED,
NC_("dynamics-editor-action", "Edit Active Dynamics"), NULL, NULL,
NC_("dynamics-editor-action", "Edit Active Dynamics"), NULL, { NULL }, NULL,
data_editor_edit_active_cmd_callback,
FALSE,
GIMP_HELP_BRUSH_EDITOR_EDIT_ACTIVE }
@@ -58,10 +50,6 @@ static const GimpToggleActionEntry dynamics_editor_toggle_actions[] =
void
dynamics_editor_actions_setup (GimpActionGroup *group)
{
gimp_action_group_add_actions (group, "dynamics-editor-action",
dynamics_editor_actions,
G_N_ELEMENTS (dynamics_editor_actions));
gimp_action_group_add_toggle_actions (group, "dynamics-editor-action",
dynamics_editor_toggle_actions,
G_N_ELEMENTS (dynamics_editor_toggle_actions));

View File

@@ -50,10 +50,10 @@
/* local function prototypes */
static void edit_actions_foreground_changed (GimpContext *context,
const GimpRGB *color,
GeglColor *color,
GimpActionGroup *group);
static void edit_actions_background_changed (GimpContext *context,
const GimpRGB *color,
GeglColor *color,
GimpActionGroup *group);
static void edit_actions_pattern_changed (GimpContext *context,
GimpPattern *pattern,
@@ -62,102 +62,90 @@ static void edit_actions_pattern_changed (GimpContext *context,
static const GimpActionEntry edit_actions[] =
{
{ "edit-menu", NULL, NC_("edit-action", "_Edit") },
{ "edit-paste-as-menu", NULL, NC_("edit-action", "Paste _as") },
{ "edit-buffer-menu", NULL, NC_("edit-action", "_Buffer") },
{ "undo-popup",
"edit-undo", NC_("edit-action", "Undo History Menu"), NULL, NULL, NULL,
GIMP_HELP_UNDO_DIALOG },
{ "edit-undo", GIMP_ICON_EDIT_UNDO,
NC_("edit-action", "_Undo"), "<primary>Z",
NC_("edit-action", "_Undo"), NULL, { "<primary>Z", NULL },
NC_("edit-action", "Undo the last operation"),
edit_undo_cmd_callback,
GIMP_HELP_EDIT_UNDO },
{ "edit-redo", GIMP_ICON_EDIT_REDO,
NC_("edit-action", "_Redo"), "<primary>Y",
NC_("edit-action", "_Redo"), NULL, { "<primary>Y", NULL },
NC_("edit-action", "Redo the last operation that was undone"),
edit_redo_cmd_callback,
GIMP_HELP_EDIT_REDO },
{ "edit-strong-undo", GIMP_ICON_EDIT_UNDO,
NC_("edit-action", "Strong Undo"), "<primary><shift>Z",
NC_("edit-action", "Strong Undo"), NULL, { "<primary><shift>Z", NULL },
NC_("edit-action", "Undo the last operation, skipping visibility changes"),
edit_strong_undo_cmd_callback,
GIMP_HELP_EDIT_STRONG_UNDO },
{ "edit-strong-redo", GIMP_ICON_EDIT_REDO,
NC_("edit-action", "Strong Redo"), "<primary><shift>Y",
NC_("edit-action", "Strong Redo"), NULL, { "<primary><shift>Y", NULL },
NC_("edit-action",
"Redo the last operation that was undone, skipping visibility changes"),
edit_strong_redo_cmd_callback,
GIMP_HELP_EDIT_STRONG_REDO },
{ "edit-undo-clear", GIMP_ICON_SHRED,
NC_("edit-action", "_Clear Undo History"), NULL,
NC_("edit-action", "_Clear Undo History"), NULL, { NULL },
NC_("edit-action", "Remove all operations from the undo history"),
edit_undo_clear_cmd_callback,
GIMP_HELP_EDIT_UNDO_CLEAR },
{ "edit-cut", GIMP_ICON_EDIT_CUT,
NC_("edit-action", "Cu_t"), "<primary>X",
NC_("edit-action", "Cu_t"), NULL, { "<primary>X", "Cut", NULL },
NC_("edit-action", "Move the selected pixels to the clipboard"),
edit_cut_cmd_callback,
GIMP_HELP_EDIT_CUT },
{ "edit-copy", GIMP_ICON_EDIT_COPY,
NC_("edit-action", "_Copy"), "<primary>C",
NC_("edit-action", "_Copy"), NULL, { "<primary>C", "Copy", NULL },
NC_("edit-action", "Copy the selected pixels to the clipboard"),
edit_copy_cmd_callback,
GIMP_HELP_EDIT_COPY },
{ "edit-copy-visible", NULL, /* GIMP_ICON_COPY_VISIBLE, */
NC_("edit-action", "Copy _Visible"), "<primary><shift>C",
NC_("edit-action", "Copy _Visible"), NULL, { "<primary><shift>C", "<shift>Copy", NULL },
NC_("edit-action", "Copy what is visible in the selected region"),
edit_copy_visible_cmd_callback,
GIMP_HELP_EDIT_COPY_VISIBLE },
{ "edit-paste-as-new-image", GIMP_ICON_EDIT_PASTE_AS_NEW,
NC_("edit-action", "From _Clipboard"), "<primary><shift>V",
NC_("edit-action", "Create a new image from the content of the clipboard"),
edit_paste_as_new_image_cmd_callback,
GIMP_HELP_EDIT_PASTE_AS_NEW_IMAGE },
{ "edit-paste-as-new-image-short", GIMP_ICON_EDIT_PASTE_AS_NEW,
NC_("edit-action", "_New Image"), NULL,
NC_("edit-action", "Paste as _New Image"),
NC_("edit-action", "From _Clipboard"),
{ "<primary><shift>V", "<shift>Paste", NULL },
NC_("edit-action", "Create a new image from the content of the clipboard"),
edit_paste_as_new_image_cmd_callback,
GIMP_HELP_EDIT_PASTE_AS_NEW_IMAGE },
{ "edit-named-cut", GIMP_ICON_EDIT_CUT,
NC_("edit-action", "Cu_t Named..."), NULL,
NC_("edit-action", "Cu_t Named..."), NULL, { NULL },
NC_("edit-action", "Move the selected pixels to a named buffer"),
edit_named_cut_cmd_callback,
GIMP_HELP_BUFFER_CUT },
{ "edit-named-copy", GIMP_ICON_EDIT_COPY,
NC_("edit-action", "_Copy Named..."), NULL,
NC_("edit-action", "_Copy Named..."), NULL, { NULL },
NC_("edit-action", "Copy the selected pixels to a named buffer"),
edit_named_copy_cmd_callback,
GIMP_HELP_BUFFER_COPY },
{ "edit-named-copy-visible", NULL, /* GIMP_ICON_COPY_VISIBLE, */
NC_("edit-action", "Copy _Visible Named..."), "",
NC_("edit-action", "Copy _Visible Named..."), NULL, { NULL },
NC_("edit-action",
"Copy what is visible in the selected region to a named buffer"),
edit_named_copy_visible_cmd_callback,
GIMP_HELP_BUFFER_COPY },
{ "edit-named-paste", GIMP_ICON_EDIT_PASTE,
NC_("edit-action", "_Paste Named..."), NULL,
NC_("edit-action", "_Paste Named..."), NULL, { NULL },
NC_("edit-action", "Paste the content of a named buffer"),
edit_named_paste_cmd_callback,
GIMP_HELP_BUFFER_PASTE },
{ "edit-clear", GIMP_ICON_EDIT_CLEAR,
NC_("edit-action", "Cl_ear"), "Delete",
NC_("edit-action", "Cl_ear"), NULL, { "Delete", NULL },
NC_("edit-action", "Clear the selected pixels"),
edit_clear_cmd_callback,
GIMP_HELP_EDIT_CLEAR }
@@ -166,64 +154,75 @@ static const GimpActionEntry edit_actions[] =
static const GimpEnumActionEntry edit_paste_actions[] =
{
{ "edit-paste", GIMP_ICON_EDIT_PASTE,
NC_("edit-action", "_Paste"), "<primary>V",
NC_("edit-action", "_Paste"), NULL, { "<primary>V", "Paste", NULL },
NC_("edit-action", "Paste the content of the clipboard"),
GIMP_PASTE_TYPE_FLOATING, FALSE,
GIMP_PASTE_TYPE_NEW_LAYER_OR_FLOATING, FALSE,
GIMP_HELP_EDIT_PASTE },
{ "edit-paste-in-place", GIMP_ICON_EDIT_PASTE,
NC_("edit-action", "Paste In P_lace"), "<primary><alt>V",
NC_("edit-action", "Paste In P_lace"), NULL, { "<primary><alt>V", "<alt>Paste", NULL },
NC_("edit-action",
"Paste the content of the clipboard at its original position"),
GIMP_PASTE_TYPE_FLOATING_IN_PLACE, FALSE,
GIMP_PASTE_TYPE_NEW_LAYER_OR_FLOATING_IN_PLACE, FALSE,
GIMP_HELP_EDIT_PASTE_IN_PLACE },
{ "edit-paste-merged", GIMP_ICON_EDIT_PASTE,
NC_("edit-action", "_Paste as Single Layer"), NULL, { NULL },
NC_("edit-action", "Paste the content of the clipboard as a single layer"),
GIMP_PASTE_TYPE_NEW_MERGED_LAYER_OR_FLOATING, FALSE,
GIMP_HELP_EDIT_PASTE },
{ "edit-paste-merged-in-place", GIMP_ICON_EDIT_PASTE,
NC_("edit-action", "Paste as Single Layer In P_lace"), NULL, { NULL },
NC_("edit-action",
"Paste the content of the clipboard at its original position as a single layer"),
GIMP_PASTE_TYPE_NEW_MERGED_LAYER_OR_FLOATING_IN_PLACE, FALSE,
GIMP_HELP_EDIT_PASTE_IN_PLACE },
{ "edit-paste-into", GIMP_ICON_EDIT_PASTE_INTO,
NC_("edit-action", "Paste _Into Selection"), NULL,
NC_("edit-action", "Paste as Floating Data _Into Selection"), NULL, { NULL },
NC_("edit-action",
"Paste the content of the clipboard into the current selection"),
GIMP_PASTE_TYPE_FLOATING_INTO, FALSE,
GIMP_HELP_EDIT_PASTE_INTO },
{ "edit-paste-into-in-place", GIMP_ICON_EDIT_PASTE_INTO,
NC_("edit-action", "Paste Int_o Selection In Place"), NULL,
NC_("edit-action", "Paste as Floating Data Int_o Selection In Place"), NULL, { NULL },
NC_("edit-action",
"Paste the content of the clipboard into the current selection "
"at its original position"),
GIMP_PASTE_TYPE_FLOATING_INTO_IN_PLACE, FALSE,
GIMP_HELP_EDIT_PASTE_INTO_IN_PLACE },
{ "edit-paste-as-new-layer", GIMP_ICON_EDIT_PASTE_AS_NEW,
NC_("edit-action", "New _Layer"), NULL,
NC_("edit-action", "Create a new layer from the content of the clipboard"),
GIMP_PASTE_TYPE_NEW_LAYER, FALSE,
GIMP_HELP_EDIT_PASTE_AS_NEW_LAYER },
{ "edit-paste-float", GIMP_ICON_EDIT_PASTE,
NC_("edit-action", "Paste as _Floating Data"), NULL, { NULL },
NC_("edit-action", "Paste the content of the clipboard as Floating Data"),
GIMP_PASTE_TYPE_FLOATING, FALSE,
GIMP_HELP_EDIT_PASTE },
{ "edit-paste-as-new-layer-in-place", GIMP_ICON_EDIT_PASTE_AS_NEW,
NC_("edit-action", "New Layer In _Place"), NULL,
NC_("edit-action",
"Create a new layer from the content of the clipboard "
"and place it at its original position"),
GIMP_PASTE_TYPE_NEW_LAYER_IN_PLACE, FALSE,
GIMP_HELP_EDIT_PASTE_AS_NEW_LAYER_IN_PLACE }
{ "edit-paste-float-in-place", GIMP_ICON_EDIT_PASTE,
NC_("edit-action", "Paste as Floa_ting Data In Place"), NULL, { NULL },
NC_("edit-action", "Paste the content of the clipboard as Floating Data at its original position"),
GIMP_PASTE_TYPE_FLOATING_IN_PLACE, FALSE,
GIMP_HELP_EDIT_PASTE }
};
static const GimpEnumActionEntry edit_fill_actions[] =
{
{ "edit-fill-fg", GIMP_ICON_TOOL_BUCKET_FILL,
NC_("edit-action", "Fill with _FG Color"), "<primary>comma",
NC_("edit-action", "Fill with _FG Color"), NULL, { "<primary>comma", NULL },
NC_("edit-action", "Fill the selection using the foreground color"),
GIMP_FILL_FOREGROUND, FALSE,
GIMP_HELP_EDIT_FILL_FG },
{ "edit-fill-bg", GIMP_ICON_TOOL_BUCKET_FILL,
NC_("edit-action", "Fill with B_G Color"), "<primary>period",
NC_("edit-action", "Fill with B_G Color"), NULL, { "<primary>period", NULL },
NC_("edit-action", "Fill the selection using the background color"),
GIMP_FILL_BACKGROUND, FALSE,
GIMP_HELP_EDIT_FILL_BG },
{ "edit-fill-pattern", GIMP_ICON_PATTERN,
NC_("edit-action", "Fill _with Pattern"), "<primary>semicolon",
NC_("edit-action", "Fill _with Pattern"), NULL, { "<primary>semicolon", NULL },
NC_("edit-action", "Fill the selection using the active pattern"),
GIMP_FILL_PATTERN, FALSE,
GIMP_HELP_EDIT_FILL_PATTERN }
@@ -234,9 +233,8 @@ void
edit_actions_setup (GimpActionGroup *group)
{
GimpContext *context = gimp_get_user_context (group->gimp);
GimpRGB color;
GeglColor *color;
GimpPattern *pattern;
GimpAction *action;
gimp_action_group_add_actions (group, "edit-action",
edit_actions,
@@ -252,15 +250,6 @@ edit_actions_setup (GimpActionGroup *group)
G_N_ELEMENTS (edit_fill_actions),
edit_fill_cmd_callback);
action = gimp_action_group_get_action (group,
"edit-paste-as-new-image-short");
gimp_action_set_accel_path (action,
"<Actions>/edit/edit-paste-as-new-image");
gimp_action_group_set_action_context (group, "edit-fill-fg", context);
gimp_action_group_set_action_context (group, "edit-fill-bg", context);
gimp_action_group_set_action_context (group, "edit-fill-pattern", context);
g_signal_connect_object (context, "foreground-changed",
G_CALLBACK (edit_actions_foreground_changed),
group, 0);
@@ -271,11 +260,11 @@ edit_actions_setup (GimpActionGroup *group)
G_CALLBACK (edit_actions_pattern_changed),
group, 0);
gimp_context_get_foreground (context, &color);
edit_actions_foreground_changed (context, &color, group);
color = gimp_context_get_foreground (context);
edit_actions_foreground_changed (context, color, group);
gimp_context_get_background (context, &color);
edit_actions_background_changed (context, &color, group);
color = gimp_context_get_background (context);
edit_actions_background_changed (context, color, group);
pattern = gimp_context_get_pattern (context);
edit_actions_pattern_changed (context, pattern, group);
@@ -306,7 +295,7 @@ edit_actions_update (GimpActionGroup *group,
if (! gimp_viewable_get_children (GIMP_VIEWABLE (iter->data)))
have_no_groups = TRUE;
if (! gimp_item_is_content_locked (GIMP_ITEM (iter->data)))
if (! gimp_item_is_content_locked (GIMP_ITEM (iter->data), NULL))
have_writable = TRUE;
if (have_no_groups && have_writable)
@@ -369,8 +358,6 @@ edit_actions_update (GimpActionGroup *group,
SET_SENSITIVE ("edit-paste-in-place", image);
SET_SENSITIVE ("edit-paste-into", image);
SET_SENSITIVE ("edit-paste-into-in-place", image);
SET_SENSITIVE ("edit-paste-as-new-layer", image);
SET_SENSITIVE ("edit-paste-as-new-layer-in-place", image);
SET_SENSITIVE ("edit-named-cut", have_writable && have_no_groups);
SET_SENSITIVE ("edit-named-copy", drawables);
@@ -393,7 +380,7 @@ edit_actions_update (GimpActionGroup *group,
static void
edit_actions_foreground_changed (GimpContext *context,
const GimpRGB *color,
GeglColor *color,
GimpActionGroup *group)
{
gimp_action_group_set_action_color (group, "edit-fill-fg", color, FALSE);
@@ -401,7 +388,7 @@ edit_actions_foreground_changed (GimpContext *context,
static void
edit_actions_background_changed (GimpContext *context,
const GimpRGB *color,
GeglColor *color,
GimpActionGroup *group)
{
gimp_action_group_set_action_color (group, "edit-fill-bg", color, FALSE);

View File

@@ -33,13 +33,17 @@
#include "core/gimpcontainer.h"
#include "core/gimpdrawable.h"
#include "core/gimpdrawable-edit.h"
#include "core/gimpdrawable-filters.h"
#include "core/gimpdrawablefilter.h"
#include "core/gimpfilloptions.h"
#include "core/gimplayer.h"
#include "core/gimplayer-new.h"
#include "core/gimplayermask.h"
#include "core/gimplist.h"
#include "core/gimpimage.h"
#include "core/gimpimage-undo.h"
#include "vectors/gimpvectors-import.h"
#include "vectors/gimppath-import.h"
#include "widgets/gimpclipboard.h"
#include "widgets/gimphelp-ids.h"
@@ -68,6 +72,7 @@ static gboolean check_drawable_alpha (GimpDrawable *drawable,
gpointer data);
static void edit_paste (GimpDisplay *display,
GimpPasteType paste_type,
gboolean merged,
gboolean try_svg);
static void cut_named_buffer_callback (GtkWidget *widget,
const gchar *name,
@@ -278,7 +283,7 @@ edit_copy_cmd_callback (GimpAction *action,
return_if_no_drawables (image, drawables, data);
copy = gimp_edit_copy (image, drawables, action_data_get_context (data),
&error);
FALSE, &error);
if (copy)
{
@@ -340,10 +345,14 @@ edit_paste_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data)
{
GimpImage *image;
GimpDisplay *display = action_data_get_display (data);
GimpPasteType paste_type = (GimpPasteType) g_variant_get_int32 (value);
GimpPasteType converted_type;
GList *drawables;
gboolean merged = FALSE;
if (paste_type == GIMP_PASTE_TYPE_FLOATING)
if (paste_type == GIMP_PASTE_TYPE_NEW_LAYER_OR_FLOATING)
{
if (! display || ! gimp_display_get_image (display))
{
@@ -352,6 +361,8 @@ edit_paste_cmd_callback (GimpAction *action,
}
}
return_if_no_image (image, data);
if (! display)
return;
@@ -361,12 +372,43 @@ edit_paste_cmd_callback (GimpAction *action,
case GIMP_PASTE_TYPE_FLOATING_IN_PLACE:
case GIMP_PASTE_TYPE_FLOATING_INTO:
case GIMP_PASTE_TYPE_FLOATING_INTO_IN_PLACE:
edit_paste (display, paste_type, TRUE);
edit_paste (display, paste_type, merged, TRUE);
break;
case GIMP_PASTE_TYPE_NEW_LAYER:
case GIMP_PASTE_TYPE_NEW_LAYER_IN_PLACE:
edit_paste (display, paste_type, FALSE);
edit_paste (display, paste_type, merged, FALSE);
break;
case GIMP_PASTE_TYPE_NEW_MERGED_LAYER_OR_FLOATING:
case GIMP_PASTE_TYPE_NEW_MERGED_LAYER_OR_FLOATING_IN_PLACE:
merged = TRUE;
case GIMP_PASTE_TYPE_NEW_LAYER_OR_FLOATING:
case GIMP_PASTE_TYPE_NEW_LAYER_OR_FLOATING_IN_PLACE:
drawables = gimp_image_get_selected_drawables (image);
if (drawables &&
(g_list_length (drawables) == 1) &&
GIMP_IS_LAYER_MASK (drawables->data))
{
converted_type = (paste_type == GIMP_PASTE_TYPE_NEW_LAYER_OR_FLOATING ||
paste_type == GIMP_PASTE_TYPE_NEW_MERGED_LAYER_OR_FLOATING) ?
GIMP_PASTE_TYPE_FLOATING :
GIMP_PASTE_TYPE_FLOATING_IN_PLACE;
edit_paste (display, converted_type, merged, TRUE);
}
else
{
converted_type = (paste_type == GIMP_PASTE_TYPE_NEW_LAYER_OR_FLOATING ||
paste_type == GIMP_PASTE_TYPE_NEW_MERGED_LAYER_OR_FLOATING) ?
GIMP_PASTE_TYPE_NEW_LAYER :
GIMP_PASTE_TYPE_NEW_LAYER_IN_PLACE;
edit_paste (display, converted_type, merged, FALSE);
}
g_list_free (drawables);
break;
}
}
@@ -387,13 +429,14 @@ edit_paste_as_new_image_cmd_callback (GimpAction *action,
if (paste)
{
image = gimp_edit_paste_as_new_image (gimp, paste);
image = gimp_edit_paste_as_new_image (gimp, paste,
action_data_get_context (data));
g_object_unref (paste);
}
if (image)
{
gimp_create_display (gimp, image, GIMP_UNIT_PIXEL, 1.0,
gimp_create_display (gimp, image, gimp_unit_pixel (), 1.0,
G_OBJECT (gimp_widget_get_monitor (widget)));
g_object_unref (image);
}
@@ -512,7 +555,7 @@ edit_clear_cmd_callback (GimpAction *action,
for (iter = drawables; iter; iter = iter->next)
if (! gimp_viewable_get_children (GIMP_VIEWABLE (iter->data)) &&
! gimp_item_is_content_locked (GIMP_ITEM (iter->data)))
! gimp_item_is_content_locked (GIMP_ITEM (iter->data), NULL))
gimp_drawable_edit_clear (iter->data, action_data_get_context (data));
gimp_image_undo_group_end (image);
@@ -568,9 +611,11 @@ static gboolean
check_drawable_alpha (GimpDrawable *drawable,
gpointer data)
{
GimpLayer *locked_layer = NULL;
if (gimp_drawable_has_alpha (drawable) &&
GIMP_IS_LAYER (drawable) &&
gimp_layer_get_lock_alpha (GIMP_LAYER (drawable)))
gimp_layer_is_alpha_locked (GIMP_LAYER (drawable), &locked_layer))
{
Gimp *gimp = action_data_get_gimp (data);
GimpDisplay *display = action_data_get_display (data);
@@ -581,7 +626,7 @@ check_drawable_alpha (GimpDrawable *drawable,
gimp, G_OBJECT (display), GIMP_MESSAGE_WARNING,
_("A selected layer's alpha channel is locked."));
gimp_tools_blink_lock_box (gimp, GIMP_ITEM (drawable));
gimp_tools_blink_lock_box (gimp, GIMP_ITEM (locked_layer));
}
return FALSE;
@@ -593,11 +638,17 @@ check_drawable_alpha (GimpDrawable *drawable,
static void
edit_paste (GimpDisplay *display,
GimpPasteType paste_type,
gboolean merged,
gboolean try_svg)
{
GimpImage *image = gimp_display_get_image (display);
GimpObject *paste;
g_return_if_fail (paste_type != GIMP_PASTE_TYPE_NEW_LAYER_OR_FLOATING &&
paste_type != GIMP_PASTE_TYPE_NEW_LAYER_OR_FLOATING_IN_PLACE &&
paste_type != GIMP_PASTE_TYPE_NEW_MERGED_LAYER_OR_FLOATING &&
paste_type != GIMP_PASTE_TYPE_NEW_MERGED_LAYER_OR_FLOATING_IN_PLACE);
if (try_svg)
{
gchar *svg;
@@ -607,10 +658,10 @@ edit_paste (GimpDisplay *display,
if (svg)
{
if (gimp_vectors_import_buffer (image, svg, svg_size,
TRUE, FALSE,
GIMP_IMAGE_ACTIVE_PARENT, -1,
NULL, NULL))
if (gimp_path_import_buffer (image, svg, svg_size,
TRUE, FALSE,
GIMP_IMAGE_ACTIVE_PARENT, -1,
NULL, NULL))
{
gimp_image_flush (image);
}
@@ -627,33 +678,29 @@ edit_paste (GimpDisplay *display,
{
GimpDisplayShell *shell = gimp_display_get_shell (display);
GList *drawables = gimp_image_get_selected_drawables (image);
GimpDrawable *drawable = NULL;
GList *pasted_layers;
gint x, y;
gint width, height;
/* Paste on multiple selection is probably wrong right now (though
* I guess it can be argued). For now we just default to the same
* as pasting with no selected drawable, which will just create a
* new drawable.
*/
if (g_list_length (drawables) == 1)
drawable = drawables->data;
g_list_free (drawables);
if (drawable &&
paste_type != GIMP_PASTE_TYPE_NEW_LAYER &&
paste_type != GIMP_PASTE_TYPE_NEW_LAYER_IN_PLACE)
if (g_list_length (drawables) != 1 ||
(paste_type != GIMP_PASTE_TYPE_NEW_LAYER &&
paste_type != GIMP_PASTE_TYPE_NEW_LAYER_IN_PLACE))
{
if (gimp_viewable_get_children (GIMP_VIEWABLE (drawable)))
if (g_list_length (drawables) != 1)
{
gimp_message_literal (display->gimp, G_OBJECT (display),
GIMP_MESSAGE_INFO,
_("Pasted as new layer because the "
"target is not a single layer or layer mask."));
}
else if (gimp_viewable_get_children (GIMP_VIEWABLE (drawables->data)))
{
gimp_message_literal (display->gimp, G_OBJECT (display),
GIMP_MESSAGE_INFO,
_("Pasted as new layer because the "
"target is a layer group."));
}
else if (gimp_item_is_content_locked (GIMP_ITEM (drawable)))
else if (gimp_item_is_content_locked (GIMP_ITEM (drawables->data), NULL))
{
gimp_message_literal (display->gimp, G_OBJECT (display),
GIMP_MESSAGE_INFO,
@@ -669,14 +716,66 @@ edit_paste (GimpDisplay *display,
! gimp_display_shell_get_infinite_canvas (shell),
&x, &y, &width, &height);
if ((pasted_layers = gimp_edit_paste (image, drawable, paste,
paste_type, x, y, width, height)))
if ((pasted_layers = gimp_edit_paste (image, drawables, paste, paste_type,
gimp_get_user_context (display->gimp),
merged, x, y, width, height)))
{
gimp_image_set_selected_layers (image, pasted_layers);
/* Copy over layer effects */
if (GIMP_IS_IMAGE (paste))
{
GList *old_layers_list;
GList *new_layers_list;
old_layers_list = gimp_image_get_layer_iter (GIMP_IMAGE (paste));
for (new_layers_list = pasted_layers; new_layers_list;
new_layers_list = g_list_next (new_layers_list))
{
GimpLayer *layer = old_layers_list->data;
GimpLayer *new_layer = new_layers_list->data;
if (gimp_drawable_has_filters (GIMP_DRAWABLE (layer)))
{
GList *filter_list;
GimpContainer *filters;
filters = gimp_drawable_get_filters (GIMP_DRAWABLE (layer));
for (filter_list = GIMP_LIST (filters)->queue->tail;
filter_list;
filter_list = g_list_previous (filter_list))
{
if (GIMP_IS_DRAWABLE_FILTER (filter_list->data))
{
GimpDrawableFilter *old_filter = filter_list->data;
GimpDrawableFilter *filter;
filter =
gimp_drawable_filter_duplicate (GIMP_DRAWABLE (new_layer),
old_filter);
if (filter != NULL)
{
gimp_drawable_filter_apply (filter, NULL);
gimp_drawable_filter_commit (filter, TRUE, NULL, FALSE);
gimp_drawable_filter_layer_mask_freeze (filter);
g_object_unref (filter);
}
}
}
}
old_layers_list = g_list_next (old_layers_list);
}
}
g_list_free (pasted_layers);
gimp_image_flush (image);
}
g_list_free (drawables);
g_object_unref (paste);
}
else

View File

@@ -36,37 +36,33 @@
static const GimpActionEntry error_console_actions[] =
{
{ "error-console-popup", GIMP_ICON_DIALOG_WARNING,
NC_("error-console-action", "Error Console Menu"), NULL, NULL, NULL,
GIMP_HELP_ERRORS_DIALOG },
{ "error-console-clear", GIMP_ICON_EDIT_CLEAR,
NC_("error-console-action", "_Clear"), NULL,
NC_("error-console-action", "_Clear"), NULL, { NULL },
NC_("error-console-action", "Clear error console"),
error_console_clear_cmd_callback,
GIMP_HELP_ERRORS_CLEAR },
{ "error-console-select-all", NULL,
NC_("error-console-action", "Select _All"), "",
NC_("error-console-action", "Select _All"), NULL, { NULL },
NC_("error-console-action", "Select all error messages"),
error_console_select_all_cmd_callback,
GIMP_HELP_ERRORS_SELECT_ALL },
{ "error-console-highlight", NULL,
NC_("error-console-action", "_Highlight"), NULL, NULL, NULL,
NC_("error-console-action", "_Highlight"), NULL, { NULL }, NULL, NULL,
GIMP_HELP_ERRORS_HIGHLIGHT }
};
static const GimpEnumActionEntry error_console_save_actions[] =
{
{ "error-console-save-all", GIMP_ICON_DOCUMENT_SAVE_AS,
NC_("error-console-action", "_Save Error Log to File..."), NULL,
NC_("error-console-action", "_Save Error Log to File..."), NULL, { NULL },
NC_("error-console-action", "Write all error messages to a file"),
FALSE, FALSE,
GIMP_HELP_ERRORS_SAVE },
{ "error-console-save-selection", GIMP_ICON_DOCUMENT_SAVE_AS,
NC_("error-console-action", "Save S_election to File..."), NULL,
NC_("error-console-action", "Save S_election to File..."), NULL, { NULL },
NC_("error-console-action", "Write the selected error messages to a file"),
TRUE, FALSE,
GIMP_HELP_ERRORS_SAVE }
@@ -75,21 +71,21 @@ static const GimpEnumActionEntry error_console_save_actions[] =
static const GimpToggleActionEntry error_console_highlight_actions[] =
{
{ "error-console-highlight-error", NULL,
NC_("error-console-action", "_Errors"), NULL,
NC_("error-console-action", "_Errors"), NULL, { NULL },
NC_("error-console-action", "Highlight error console on errors"),
error_console_highlight_error_cmd_callback,
FALSE,
GIMP_HELP_ERRORS_HIGHLIGHT },
{ "error-console-highlight-warning", NULL,
NC_("error-console-action", "_Warnings"), NULL,
NC_("error-console-action", "_Warnings"), NULL, { NULL },
NC_("error-console-action", "Highlight error console on warnings"),
error_console_highlight_warning_cmd_callback,
FALSE,
GIMP_HELP_ERRORS_HIGHLIGHT },
{ "error-console-highlight-info", NULL,
NC_("error-console-action", "_Messages"), NULL,
NC_("error-console-action", "_Messages"), NULL, { NULL },
NC_("error-console-action", "Highlight error console on messages"),
error_console_highlight_info_cmd_callback,
FALSE,

View File

@@ -30,6 +30,7 @@
#include "widgets/gimperrorconsole.h"
#include "widgets/gimphelp-ids.h"
#include "widgets/gimptextbuffer.h"
#include "widgets/gimpwidgets-utils.h"
#include "error-console-commands.h"
@@ -104,14 +105,13 @@ error_console_save_cmd_callback (GimpAction *action,
gtk_dialog_set_default_response (GTK_DIALOG (dialog), GTK_RESPONSE_OK);
gimp_dialog_set_alternative_button_order (GTK_DIALOG (dialog),
GTK_RESPONSE_OK,
GTK_RESPONSE_CANCEL,
-1);
GTK_RESPONSE_OK,
GTK_RESPONSE_CANCEL,
-1);
console->save_selection = selection;
g_object_add_weak_pointer (G_OBJECT (dialog),
(gpointer) &console->file_dialog);
g_set_weak_pointer (&console->file_dialog, dialog);
gtk_window_set_screen (GTK_WINDOW (dialog),
gtk_widget_get_screen (GTK_WIDGET (console)));
@@ -133,6 +133,10 @@ error_console_save_cmd_callback (GimpAction *action,
}
gtk_window_present (GTK_WINDOW (console->file_dialog));
#ifdef G_OS_WIN32
gimp_window_set_title_bar_theme (console->gimp, console->file_dialog);
#endif
}
void

View File

@@ -69,60 +69,56 @@ static gchar * file_actions_create_label (const gchar *format,
static const GimpActionEntry file_actions[] =
{
{ "file-menu", NULL, NC_("file-action", "_File") },
{ "file-create-menu", NULL, NC_("file-action", "Crea_te") },
{ "file-open-recent-menu", NULL, NC_("file-action", "Open _Recent") },
{ "file-open", GIMP_ICON_IMAGE_OPEN,
NC_("file-action", "_Open..."), "<primary>O",
NC_("file-action", "_Open..."), NULL, { "<primary>O", NULL },
NC_("file-action", "Open an image file"),
file_open_cmd_callback,
GIMP_HELP_FILE_OPEN },
{ "file-open-as-layers", GIMP_ICON_LAYER,
NC_("file-action", "Op_en as Layers..."), "<primary><alt>O",
NC_("file-action", "Op_en as Layers..."), NULL, { "<primary><alt>O", NULL },
NC_("file-action", "Open an image file as layers"),
file_open_as_layers_cmd_callback,
GIMP_HELP_FILE_OPEN_AS_LAYER },
{ "file-open-location", GIMP_ICON_WEB,
NC_("file-action", "Open _Location..."), NULL,
NC_("file-action", "Open _Location..."), NULL, { NULL },
NC_("file-action", "Open an image file from a specified location"),
file_open_location_cmd_callback,
GIMP_HELP_FILE_OPEN_LOCATION },
{ "file-create-template", NULL,
NC_("file-action", "Create _Template..."), NULL,
NC_("file-action", "Create _Template..."), NULL, { NULL },
NC_("file-action", "Create a new template from this image"),
file_create_template_cmd_callback,
GIMP_HELP_FILE_CREATE_TEMPLATE },
{ "file-revert", GIMP_ICON_IMAGE_RELOAD,
NC_("file-action", "Re_vert"), NULL,
NC_("file-action", "Re_vert"), NULL, { NULL },
NC_("file-action", "Reload the image file from disk"),
file_revert_cmd_callback,
GIMP_HELP_FILE_REVERT },
{ "file-close-all", GIMP_ICON_CLOSE_ALL,
NC_("file-action", "C_lose All"), "<primary><shift>W",
NC_("file-action", "C_lose All"), NULL, { "<primary><shift>W", NULL },
NC_("file-action", "Close all opened images"),
file_close_all_cmd_callback,
GIMP_HELP_FILE_CLOSE_ALL },
{ "file-copy-location", GIMP_ICON_EDIT_COPY,
NC_("file-action", "Copy _Image Location"), NULL,
NC_("file-action", "Copy _Image Location"), NULL, { NULL },
NC_("file-action", "Copy image file location to clipboard"),
file_copy_location_cmd_callback,
GIMP_HELP_FILE_COPY_LOCATION },
{ "file-show-in-file-manager", GIMP_ICON_FILE_MANAGER,
NC_("file-action", "Show in _File Manager"), "<primary><alt>F",
NC_("file-action", "Show in _File Manager"), NULL, { "<primary><alt>F", NULL },
NC_("file-action", "Show image file location in the file manager"),
file_show_in_file_manager_cmd_callback,
GIMP_HELP_FILE_SHOW_IN_FILE_MANAGER },
{ "file-quit", GIMP_ICON_APPLICATION_EXIT,
NC_("file-action", "_Quit"), "<primary>Q",
NC_("file-action", "_Quit"), NULL, { "<primary>Q", NULL },
NC_("file-action", "Quit the GNU Image Manipulation Program"),
file_quit_cmd_callback,
GIMP_HELP_FILE_QUIT }
@@ -131,19 +127,19 @@ static const GimpActionEntry file_actions[] =
static const GimpEnumActionEntry file_save_actions[] =
{
{ "file-save", GIMP_ICON_DOCUMENT_SAVE,
NC_("file-action", "_Save"), "<primary>S",
NC_("file-action", "_Save"), NULL, { "<primary>S", NULL },
NC_("file-action", "Save this image"),
GIMP_SAVE_MODE_SAVE, FALSE,
GIMP_HELP_FILE_SAVE },
{ "file-save-as", GIMP_ICON_DOCUMENT_SAVE_AS,
NC_("file-action", "Save _As..."), "<primary><shift>S",
NC_("file-action", "Save _As..."), NULL, { "<primary><shift>S", NULL },
NC_("file-action", "Save this image with a different name"),
GIMP_SAVE_MODE_SAVE_AS, FALSE,
GIMP_HELP_FILE_SAVE_AS },
{ "file-save-a-copy", NULL,
NC_("file-action", "Save a Cop_y..."), NULL,
NC_("file-action", "Save a Cop_y..."), NULL, { NULL },
NC_("file-action",
"Save a copy of this image, without affecting the source file "
"(if any) or the current state of the image"),
@@ -151,25 +147,25 @@ static const GimpEnumActionEntry file_save_actions[] =
GIMP_HELP_FILE_SAVE_A_COPY },
{ "file-save-and-close", NULL,
NC_("file-action", "Save and Close..."), NULL,
NC_("file-action", "Save and Close..."), NULL, { NULL },
NC_("file-action", "Save this image and close its window"),
GIMP_SAVE_MODE_SAVE_AND_CLOSE, FALSE,
GIMP_HELP_FILE_SAVE },
{ "file-export", NULL,
NC_("file-action", "E_xport..."), "<primary>E",
NC_("file-action", "E_xport..."), NULL, { "<primary>E", NULL },
NC_("file-action", "Export the image"),
GIMP_SAVE_MODE_EXPORT, FALSE,
GIMP_HELP_FILE_EXPORT },
{ "file-overwrite", NULL,
NC_("file-action", "Over_write"), "",
NC_("file-action", "Over_write"), NULL, { NULL },
NC_("file-action", "Export the image back to the imported file in the import format"),
GIMP_SAVE_MODE_OVERWRITE, FALSE,
GIMP_HELP_FILE_OVERWRITE },
{ "file-export-as", NULL,
NC_("file-action", "E_xport As..."), "<primary><shift>E",
NC_("file-action", "E_xport As..."), NULL, { "<primary><shift>E", NULL },
NC_("file-action", "Export the image to various file formats such as PNG or JPEG"),
GIMP_SAVE_MODE_EXPORT_AS, FALSE,
GIMP_HELP_FILE_EXPORT_AS }
@@ -206,11 +202,11 @@ file_actions_setup (GimpActionGroup *group)
entries[i].value_variable = FALSE;
if (i < 9)
entries[i].accelerator = g_strdup_printf ("<primary>%d", i + 1);
entries[i].accelerator[0] = g_strdup_printf ("<primary>%d", i + 1);
else if (i == 9)
entries[i].accelerator = g_strdup ("<primary>0");
entries[i].accelerator[0] = g_strdup ("<primary>0");
else
entries[i].accelerator = NULL;
entries[i].accelerator[0] = NULL;
}
gimp_action_group_add_enum_actions (group, NULL, entries, n_entries,
@@ -219,12 +215,10 @@ file_actions_setup (GimpActionGroup *group)
for (i = 0; i < n_entries; i++)
{
gimp_action_group_set_action_visible (group, entries[i].name, FALSE);
gimp_action_group_set_action_context (group, entries[i].name,
gimp_get_user_context (group->gimp));
g_free ((gchar *) entries[i].name);
if (entries[i].accelerator)
g_free ((gchar *) entries[i].accelerator);
if (entries[i].accelerator[0])
g_free ((gchar *) entries[i].accelerator[0]);
}
g_free (entries);
@@ -366,12 +360,13 @@ file_actions_last_opened_update (GimpContainer *container,
GimpImagefile *imagefile = (GimpImagefile *)
gimp_container_get_child_by_index (container, i);
if (GIMP_ACTION_IMPL (action)->viewable != (GimpViewable *) imagefile)
if (gimp_action_get_viewable (action) != (GimpViewable *) imagefile)
{
GFile *file;
const gchar *name;
gchar *basename;
gchar *escaped;
gchar *label;
file = gimp_imagefile_get_file (imagefile);
@@ -379,17 +374,22 @@ file_actions_last_opened_update (GimpContainer *container,
basename = g_path_get_basename (name);
escaped = gimp_escape_uline (basename);
g_free (basename);
/* TRANSLATORS: the %s will be replaced by the file name of a
* recently opened image.
*/
label = g_strdup_printf (_("Open \"%s\""), escaped);
g_object_set (action,
"label", escaped,
"tooltip", name,
"visible", TRUE,
"viewable", imagefile,
"label", label,
"short-label", escaped,
"tooltip", name,
"visible", TRUE,
"viewable", imagefile,
NULL);
g_free (escaped);
g_free (label);
g_free (escaped);
}
}
else

View File

@@ -258,9 +258,27 @@ file_save_cmd_callback (GimpAction *action,
! GIMP_GUI_CONFIG (image->gimp->config)->trust_dirty_flag) ||
file == NULL)
{
GimpPlugInProcedure *save_proc = gimp_image_get_save_proc (image);
GimpPlugInProcedure *save_proc = gimp_image_get_save_proc (image);
gboolean valid_file = FALSE;
if (file && ! save_proc)
if (file)
{
gchar *uri = g_file_get_uri (file);
/* Non-valid URI (such as "Untitled.xcd" without a scheme) are
* considered non-native by GLib and will trigger remote file code
* path in file_save_dialog_save_image(), eventually failing with
* a weird error. When we encounter such non-valid URI, we just
* consider that the file was entered manually with a bogus name
* (possibly by some script or plug-in) and we fall through
* directly to showing the file dialog. The file name will still
* be useful as default file name.
*/
valid_file = g_uri_is_valid (uri, G_URI_FLAGS_NONE, NULL);
g_free (uri);
}
if (valid_file && ! save_proc)
{
save_proc =
gimp_plug_in_manager_file_procedure_find (image->gimp->plug_in_manager,
@@ -268,7 +286,7 @@ file_save_cmd_callback (GimpAction *action,
file, NULL);
}
if (file && save_proc)
if (valid_file && save_proc)
{
saved = file_save_dialog_save_image (GIMP_PROGRESS (display),
gimp, image, file,
@@ -823,7 +841,7 @@ file_revert_confirm_response (GtkWidget *dialog,
new_image = file_open_image (gimp, gimp_get_user_context (gimp),
GIMP_PROGRESS (display),
file, FALSE, NULL,
file, 0, 0, FALSE, NULL,
GIMP_RUN_INTERACTIVE,
&status, NULL, &error);

File diff suppressed because it is too large Load Diff

View File

@@ -51,12 +51,6 @@ static gchar * filters_parse_operation (Gimp *gimp,
const gchar *icon_name,
GimpObject **settings);
static void filters_run_procedure (Gimp *gimp,
GimpDisplay *display,
GimpProcedure *procedure,
GimpRunMode run_mode);
/* public functions */
void
@@ -65,12 +59,20 @@ filters_apply_cmd_callback (GimpAction *action,
gpointer data)
{
GimpImage *image;
GimpDrawable *drawable;
GList *drawables;
gchar *operation;
GimpObject *settings;
GimpProcedure *procedure;
GVariant *variant;
return_if_no_drawable (image, drawable, data);
return_if_no_drawables (image, drawables, data);
if (g_list_length (drawables) != 1)
{
/* We only support running filters on single drawable for now. */
g_list_free (drawables);
return;
}
operation = filters_parse_operation (image->gimp,
g_variant_get_string (value, NULL),
@@ -78,6 +80,7 @@ filters_apply_cmd_callback (GimpAction *action,
&settings);
procedure = gimp_gegl_procedure_new (image->gimp,
NULL,
GIMP_RUN_NONINTERACTIVE, settings,
operation,
gimp_action_get_name (action),
@@ -99,6 +102,7 @@ filters_apply_cmd_callback (GimpAction *action,
g_variant_unref (variant);
g_object_unref (procedure);
g_list_free (drawables);
}
void
@@ -107,12 +111,21 @@ filters_apply_interactive_cmd_callback (GimpAction *action,
gpointer data)
{
GimpImage *image;
GimpDrawable *drawable;
GList *drawables;
GimpProcedure *procedure;
GVariant *variant;
return_if_no_drawable (image, drawable, data);
return_if_no_drawables (image, drawables, data);
if (g_list_length (drawables) != 1)
{
/* We only support running filters on single drawable for now. */
g_list_free (drawables);
return;
}
procedure = gimp_gegl_procedure_new (image->gimp,
NULL,
GIMP_RUN_INTERACTIVE, NULL,
g_variant_get_string (value, NULL),
gimp_action_get_name (action),
@@ -129,6 +142,7 @@ filters_apply_interactive_cmd_callback (GimpAction *action,
g_variant_unref (variant);
g_object_unref (procedure);
g_list_free (drawables);
}
void
@@ -136,20 +150,20 @@ filters_repeat_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data)
{
GimpImage *image;
GimpDrawable *drawable;
Gimp *gimp;
GimpDisplay *display;
GimpProcedure *procedure;
GimpRunMode run_mode;
return_if_no_drawable (image, drawable, data);
return_if_no_gimp (gimp, data);
return_if_no_display (display, data);
run_mode = (GimpRunMode) g_variant_get_int32 (value);
procedure = gimp_filter_history_nth (image->gimp, 0);
procedure = gimp_filter_history_nth (gimp, 0);
if (procedure)
filters_run_procedure (image->gimp, display, procedure, run_mode);
filters_run_procedure (gimp, display, procedure, run_mode);
}
void
@@ -222,7 +236,7 @@ filters_parse_operation (Gimp *gimp,
return g_strdup (operation_str);
}
static void
void
filters_run_procedure (Gimp *gimp,
GimpDisplay *display,
GimpProcedure *procedure,

View File

@@ -33,5 +33,10 @@ void filters_history_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data);
void filters_run_procedure (Gimp *gimp,
GimpDisplay *display,
GimpProcedure *procedure,
GimpRunMode run_mode);
#endif /* __FILTERS_COMMANDS_H__ */

View File

@@ -40,12 +40,8 @@
static const GimpActionEntry fonts_actions[] =
{
{ "fonts-popup", GIMP_ICON_FONT,
NC_("fonts-action", "Fonts Menu"), NULL, NULL, NULL,
GIMP_HELP_FONT_DIALOG },
{ "fonts-refresh", GIMP_ICON_VIEW_REFRESH,
NC_("fonts-action", "_Rescan Font List"), NULL,
NC_("fonts-action", "_Rescan Font List"), NULL, { NULL },
NC_("fonts-action", "Rescan the installed fonts"),
data_refresh_cmd_callback,
GIMP_HELP_FONT_REFRESH }

View File

@@ -41,6 +41,7 @@
#include "core/gimpcontext.h"
#include "core/gimpdisplay.h"
#include "core/gimpdrawable-operation.h"
#include "core/gimpdrawablefilter.h"
#include "core/gimpimage.h"
#include "core/gimplayermask.h"
#include "core/gimpparamspecs.h"
@@ -185,11 +186,12 @@ gimp_gegl_procedure_get_sensitive (GimpProcedure *procedure,
else
item = GIMP_ITEM (drawable);
sensitive = ! gimp_item_is_content_locked (item);
sensitive = ! gimp_item_is_content_locked (item, NULL);
if (gimp_viewable_get_children (GIMP_VIEWABLE (drawable)))
sensitive = FALSE;
}
g_list_free (drawables);
return sensitive;
@@ -203,30 +205,38 @@ gimp_gegl_procedure_execute (GimpProcedure *procedure,
GimpValueArray *args,
GError **error)
{
GimpImage *image;
GimpDrawable *drawable;
GObject *config;
GeglNode *node;
GimpImage *image;
gint n_drawables;
GObject **drawables;
GObject *config;
image = g_value_get_object (gimp_value_array_index (args, 1));
drawable = g_value_get_object (gimp_value_array_index (args, 2));
config = g_value_get_object (gimp_value_array_index (args, 3));
image = g_value_get_object (gimp_value_array_index (args, 1));
n_drawables = g_value_get_int (gimp_value_array_index (args, 2));
drawables = gimp_value_get_object_array (gimp_value_array_index (args, 3));
config = g_value_get_object (gimp_value_array_index (args, 4));
node = gegl_node_new_child (NULL,
"operation",
GIMP_GEGL_PROCEDURE (procedure)->operation,
NULL);
if (n_drawables == 1)
{
GeglNode *node;
gimp_drawable_apply_operation_with_config (
drawable,
progress, gimp_procedure_get_label (procedure),
node, config);
node = gegl_node_new_child (NULL,
"operation",
GIMP_GEGL_PROCEDURE (procedure)->operation,
NULL);
g_object_unref (node);
gimp_drawable_apply_operation_with_config (GIMP_DRAWABLE (drawables[0]),
progress,
gimp_procedure_get_label (procedure),
node, config);
gimp_image_flush (image);
g_object_unref (node);
return gimp_procedure_get_return_values (procedure, TRUE, NULL);
gimp_image_flush (image);
return gimp_procedure_get_return_values (procedure, TRUE, NULL);
}
return gimp_procedure_get_return_values (procedure, FALSE, NULL);
}
static void
@@ -244,7 +254,7 @@ gimp_gegl_procedure_execute_async (GimpProcedure *procedure,
const gchar *tool_name;
run_mode = g_value_get_enum (gimp_value_array_index (args, 0));
settings = g_value_get_object (gimp_value_array_index (args, 3));
settings = g_value_get_object (gimp_value_array_index (args, 4));
if (! settings &&
(run_mode != GIMP_RUN_INTERACTIVE ||
@@ -255,7 +265,7 @@ gimp_gegl_procedure_execute_async (GimpProcedure *procedure,
GType config_type;
GimpContainer *container;
config_type = G_VALUE_TYPE (gimp_value_array_index (args, 3));
config_type = G_VALUE_TYPE (gimp_value_array_index (args, 4));
container = gimp_operation_config_get_container (gimp, config_type,
(GCompareFunc)
@@ -282,7 +292,7 @@ gimp_gegl_procedure_execute_async (GimpProcedure *procedure,
{
GimpValueArray *return_vals;
g_value_set_object (gimp_value_array_index (args, 3), settings);
g_value_set_object (gimp_value_array_index (args, 4), settings);
return_vals = gimp_procedure_execute (procedure, gimp, context, progress,
args, NULL);
gimp_value_array_unref (return_vals);
@@ -357,6 +367,7 @@ gimp_gegl_procedure_execute_async (GimpProcedure *procedure,
if (! strcmp (tool_name, "gimp-operation-tool"))
{
gimp_operation_tool_set_operation (GIMP_OPERATION_TOOL (active_tool),
gegl_procedure->filter,
gegl_procedure->operation,
gimp_procedure_get_label (procedure),
gimp_procedure_get_label (procedure),
@@ -367,6 +378,74 @@ gimp_gegl_procedure_execute_async (GimpProcedure *procedure,
tool_manager_initialize_active (gimp, display);
/* For GIMP-specific GEGL operations, we need to copy over the
* config object stored in the GeglNode */
if (gegl_procedure->filter)
{
GeglNode *node;
GIMP_FILTER_TOOL (active_tool)->existing_filter = gegl_procedure->filter;
gimp_filter_set_active (GIMP_FILTER (gegl_procedure->filter), FALSE);
node = gimp_drawable_filter_get_operation (gegl_procedure->filter);
if (gimp_operation_config_is_custom (gimp, gegl_procedure->operation))
{
gegl_node_get (node,
"config", &settings,
NULL);
}
else
{
GParamSpec **pspecs;
guint n_pspecs;
gdouble opacity;
GimpLayerMode paint_mode;
GimpFilterRegion region;
opacity = gimp_drawable_filter_get_opacity (gegl_procedure->filter);
paint_mode = gimp_drawable_filter_get_paint_mode (gegl_procedure->filter);
region = gimp_drawable_filter_get_region (gegl_procedure->filter);
settings =
g_object_new (gimp_operation_config_get_type (active_tool->tool_info->gimp,
gegl_procedure->operation,
gimp_tool_get_icon_name (active_tool),
GIMP_TYPE_OPERATION_SETTINGS),
NULL);
pspecs = gegl_operation_list_properties (gegl_procedure->operation, &n_pspecs);
for (gint i = 0; i < n_pspecs; i++)
{
GValue value = G_VALUE_INIT;
GParamSpec *pspec = pspecs[i];
GParamSpec *gimp_pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (settings),
pspec->name);
g_value_init (&value, pspec->value_type);
gegl_node_get_property (node, pspec->name,
&value);
if (gimp_pspec)
g_object_set_property (G_OBJECT (settings), gimp_pspec->name,
&value);
else
g_critical ("%s: property '%s' of operation '%s' doesn't exist in config %s",
G_STRFUNC, pspec->name, gegl_procedure->operation,
g_type_name (G_TYPE_FROM_INSTANCE (settings)));
g_value_unset (&value);
}
g_free (pspecs);
g_object_set (settings,
"gimp-opacity", opacity,
"gimp-mode", paint_mode,
"gimp-region", region,
NULL);
}
}
if (settings)
gimp_filter_tool_set_config (GIMP_FILTER_TOOL (active_tool),
GIMP_CONFIG (settings));
@@ -377,15 +456,16 @@ gimp_gegl_procedure_execute_async (GimpProcedure *procedure,
/* public functions */
GimpProcedure *
gimp_gegl_procedure_new (Gimp *gimp,
GimpRunMode default_run_mode,
GimpObject *default_settings,
const gchar *operation,
const gchar *name,
const gchar *menu_label,
const gchar *tooltip,
const gchar *icon_name,
const gchar *help_id)
gimp_gegl_procedure_new (Gimp *gimp,
GimpDrawableFilter *filter,
GimpRunMode default_run_mode,
GimpObject *default_settings,
const gchar *operation,
const gchar *name,
const gchar *menu_label,
const gchar *tooltip,
const gchar *icon_name,
const gchar *help_id)
{
GimpProcedure *procedure;
GimpGeglProcedure *gegl_procedure;
@@ -403,6 +483,7 @@ gimp_gegl_procedure_new (Gimp *gimp,
gegl_procedure = GIMP_GEGL_PROCEDURE (procedure);
gegl_procedure->filter = filter;
gegl_procedure->operation = g_strdup (operation);
gegl_procedure->default_run_mode = default_run_mode;
gegl_procedure->menu_label = g_strdup (menu_label);
@@ -433,11 +514,17 @@ gimp_gegl_procedure_new (Gimp *gimp,
FALSE,
GIMP_PARAM_READWRITE));
gimp_procedure_add_argument (procedure,
gimp_param_spec_drawable ("drawable",
"Drawable",
"Input drawable",
TRUE,
GIMP_PARAM_READWRITE));
g_param_spec_int ("num-drawables",
"N drawables",
"The number of drawables",
0, G_MAXINT32, 0,
GIMP_PARAM_READWRITE));
gimp_procedure_add_argument (procedure,
gimp_param_spec_object_array ("drawables",
"Drawables",
"Input drawables",
GIMP_TYPE_DRAWABLE,
GIMP_PARAM_READWRITE));
gimp_procedure_add_argument (procedure,
g_param_spec_object ("settings",
"Settings",

View File

@@ -40,12 +40,13 @@ struct _GimpGeglProcedure
{
GimpProcedure parent_instance;
gchar *operation;
GimpDrawableFilter *filter;
gchar *operation;
GimpRunMode default_run_mode;
GimpObject *default_settings;
GimpRunMode default_run_mode;
GimpObject *default_settings;
gchar *menu_label;
gchar *menu_label;
};
struct _GimpGeglProcedureClass
@@ -56,15 +57,15 @@ struct _GimpGeglProcedureClass
GType gimp_gegl_procedure_get_type (void) G_GNUC_CONST;
GimpProcedure * gimp_gegl_procedure_new (Gimp *gimp,
GimpRunMode default_run_mode,
GimpObject *default_settings,
const gchar *operation,
const gchar *name,
const gchar *menu_label,
const gchar *tooltip,
const gchar *icon_name,
const gchar *help_id);
GimpProcedure * gimp_gegl_procedure_new (Gimp *gimp,
GimpDrawableFilter *filter,
GimpRunMode default_run_mode,
GimpObject *default_settings,
const gchar *operation,
const gchar *name,
const gchar *menu_label,
const gchar *tooltip,
const gchar *icon_name,
const gchar *help_id);
#endif /* __GIMP_GEGL_PROCEDURE_H__ */

View File

@@ -32,6 +32,7 @@
#include "widgets/gimpactiongroup.h"
#include "widgets/gimpgradienteditor.h"
#include "widgets/gimphelp-ids.h"
#include "widgets/gimpradioaction.h"
#include "data-editor-commands.h"
#include "gradient-editor-actions.h"
@@ -42,10 +43,6 @@
static const GimpActionEntry gradient_editor_actions[] =
{
{ "gradient-editor-popup", GIMP_ICON_GRADIENT,
NC_("gradient-editor-action", "Gradient Editor Menu"), NULL, NULL, NULL,
GIMP_HELP_GRADIENT_EDITOR_DIALOG },
{ "gradient-editor-left-color-type", NULL,
NC_("gradient-editor-action", "Left Color Type") },
{ "gradient-editor-load-left-color", GIMP_ICON_DOCUMENT_REVERT,
@@ -60,61 +57,64 @@ static const GimpActionEntry gradient_editor_actions[] =
{ "gradient-editor-save-right-color", GIMP_ICON_DOCUMENT_SAVE,
NC_("gradient-editor-action", "Sa_ve Right Color To") },
/* TODO GMenu: remove these 2 bogus actions once old style XML menu files are
* deleted.
*/
{ "gradient-editor-blending-func", NULL, "blending-function" },
{ "gradient-editor-coloring-type", NULL, "coloring-type" },
{ "gradient-editor-left-color", NULL,
NC_("gradient-editor-action", "L_eft Endpoint's Color..."), NULL, NULL,
NC_("gradient-editor-action", "L_eft Endpoint's Color..."), NULL, { NULL }, NULL,
gradient_editor_left_color_cmd_callback,
GIMP_HELP_GRADIENT_EDITOR_LEFT_COLOR },
{ "gradient-editor-right-color", NULL,
NC_("gradient-editor-action", "R_ight Endpoint's Color..."), NULL, NULL,
NC_("gradient-editor-action", "R_ight Endpoint's Color..."), NULL, { NULL }, NULL,
gradient_editor_right_color_cmd_callback,
GIMP_HELP_GRADIENT_EDITOR_RIGHT_COLOR },
{ "gradient-editor-flip", GIMP_ICON_OBJECT_FLIP_HORIZONTAL,
"flip", NULL, NULL,
NC_("gradient-editor-action", "Flip"), NULL, { NULL }, NULL,
gradient_editor_flip_cmd_callback,
GIMP_HELP_GRADIENT_EDITOR_FLIP },
{ "gradient-editor-replicate", GIMP_ICON_OBJECT_DUPLICATE,
"replicate", NULL, NULL,
NC_("gradient-editor-action", "Replicate"), NULL, { NULL }, NULL,
gradient_editor_replicate_cmd_callback,
GIMP_HELP_GRADIENT_EDITOR_FLIP },
{ "gradient-editor-split-midpoint", NULL,
"splitmidpoint", NULL, NULL,
NC_("gradient-editor-action", "Split Midpoint"), NULL, { NULL }, NULL,
gradient_editor_split_midpoint_cmd_callback,
GIMP_HELP_GRADIENT_EDITOR_SPLIT_MIDPOINT },
{ "gradient-editor-split-uniform", NULL,
"splituniform", NULL, NULL,
NC_("gradient-editor-action", "Split Uniformly"), NULL, { NULL }, NULL,
gradient_editor_split_uniformly_cmd_callback,
GIMP_HELP_GRADIENT_EDITOR_SPLIT_UNIFORM },
{ "gradient-editor-delete", GIMP_ICON_EDIT_DELETE,
"delete", "", NULL,
NC_("gradient-editor-action", "Delete"), NULL, { NULL }, NULL,
gradient_editor_delete_cmd_callback,
GIMP_HELP_GRADIENT_EDITOR_DELETE },
{ "gradient-editor-recenter", NULL,
"recenter", NULL, NULL,
NC_("gradient-editor-action", "Recenter"), NULL, { NULL }, NULL,
gradient_editor_recenter_cmd_callback,
GIMP_HELP_GRADIENT_EDITOR_RECENTER },
{ "gradient-editor-redistribute", NULL,
"redistribute", NULL, NULL,
NC_("gradient-editor-action", "Redistribute"), NULL, { NULL }, NULL,
gradient_editor_redistribute_cmd_callback,
GIMP_HELP_GRADIENT_EDITOR_REDISTRIBUTE },
{ "gradient-editor-blend-color", NULL,
NC_("gradient-editor-action", "Ble_nd Endpoints' Colors"), NULL, NULL,
NC_("gradient-editor-action", "Ble_nd Endpoints' Colors"), NULL, { NULL }, NULL,
gradient_editor_blend_color_cmd_callback,
GIMP_HELP_GRADIENT_EDITOR_BLEND_COLOR },
{ "gradient-editor-blend-opacity", NULL,
NC_("gradient-editor-action", "Blend Endpoints' Opacit_y"), NULL, NULL,
NC_("gradient-editor-action", "Blend Endpoints' Opacit_y"), NULL, { NULL }, NULL,
gradient_editor_blend_opacity_cmd_callback,
GIMP_HELP_GRADIENT_EDITOR_BLEND_OPACITY }
};
@@ -122,7 +122,7 @@ static const GimpActionEntry gradient_editor_actions[] =
static const GimpToggleActionEntry gradient_editor_toggle_actions[] =
{
{ "gradient-editor-edit-active", GIMP_ICON_LINKED,
NC_("gradient-editor-action", "Edit Active Gradient"), NULL, NULL,
NC_("gradient-editor-action", "Edit Active Gradient"), NULL, { NULL }, NULL,
data_editor_edit_active_cmd_callback,
FALSE,
GIMP_HELP_GRADIENT_EDITOR_EDIT_ACTIVE }
@@ -131,44 +131,44 @@ static const GimpToggleActionEntry gradient_editor_toggle_actions[] =
#define LOAD_LEFT_FROM(num,magic) \
{ "gradient-editor-load-left-" num, NULL, \
num, NULL, NULL, \
num, NULL, { NULL }, NULL, \
(magic), FALSE, \
GIMP_HELP_GRADIENT_EDITOR_LEFT_LOAD }
#define SAVE_LEFT_TO(num,magic) \
{ "gradient-editor-save-left-" num, NULL, \
num, NULL, NULL, \
num, NULL, { NULL }, NULL, \
(magic), FALSE, \
GIMP_HELP_GRADIENT_EDITOR_LEFT_SAVE }
#define LOAD_RIGHT_FROM(num,magic) \
{ "gradient-editor-load-right-" num, NULL, \
num, NULL, NULL, \
num, NULL, { NULL }, NULL, \
(magic), FALSE, \
GIMP_HELP_GRADIENT_EDITOR_RIGHT_LOAD }
#define SAVE_RIGHT_TO(num,magic) \
{ "gradient-editor-save-right-" num, NULL, \
num, NULL, NULL, \
num, NULL, { NULL }, NULL, \
(magic), FALSE, \
GIMP_HELP_GRADIENT_EDITOR_RIGHT_SAVE }
static const GimpEnumActionEntry gradient_editor_load_left_actions[] =
{
{ "gradient-editor-load-left-left-neighbor", NULL,
NC_("gradient-editor-action", "_Left Neighbor's Right Endpoint"), NULL, NULL,
NC_("gradient-editor-action", "_Left Neighbor's Right Endpoint"), NULL, { NULL }, NULL,
GRADIENT_EDITOR_COLOR_NEIGHBOR_ENDPOINT, FALSE,
GIMP_HELP_GRADIENT_EDITOR_LEFT_LOAD },
{ "gradient-editor-load-left-right-endpoint", NULL,
NC_("gradient-editor-action", "_Right Endpoint"), NULL, NULL,
NC_("gradient-editor-action", "_Right Endpoint"), NULL, { NULL }, NULL,
GRADIENT_EDITOR_COLOR_OTHER_ENDPOINT, FALSE,
GIMP_HELP_GRADIENT_EDITOR_LEFT_LOAD },
{ "gradient-editor-load-left-fg", NULL,
NC_("gradient-editor-action", "_Foreground Color"), NULL, NULL,
NC_("gradient-editor-action", "_Foreground Color"), NULL, { NULL }, NULL,
GRADIENT_EDITOR_COLOR_FOREGROUND, FALSE,
GIMP_HELP_GRADIENT_EDITOR_LEFT_LOAD },
{ "gradient-editor-load-left-bg", NULL,
NC_("gradient-editor-action", "_Background Color"), NULL, NULL,
NC_("gradient-editor-action", "_Background Color"), NULL, { NULL }, NULL,
GRADIENT_EDITOR_COLOR_BACKGROUND, FALSE,
GIMP_HELP_GRADIENT_EDITOR_LEFT_LOAD },
@@ -201,22 +201,22 @@ static const GimpEnumActionEntry gradient_editor_save_left_actions[] =
static const GimpEnumActionEntry gradient_editor_load_right_actions[] =
{
{ "gradient-editor-load-right-right-neighbor", NULL,
NC_("gradient-editor-action", "_Right Neighbor's Left Endpoint"), NULL, NULL,
NC_("gradient-editor-action", "_Right Neighbor's Left Endpoint"), NULL, { NULL }, NULL,
GRADIENT_EDITOR_COLOR_NEIGHBOR_ENDPOINT, FALSE,
GIMP_HELP_GRADIENT_EDITOR_RIGHT_LOAD },
{ "gradient-editor-load-right-left-endpoint", NULL,
NC_("gradient-editor-action", "_Left Endpoint"), NULL, NULL,
NC_("gradient-editor-action", "_Left Endpoint"), NULL, { NULL }, NULL,
GRADIENT_EDITOR_COLOR_OTHER_ENDPOINT, FALSE,
GIMP_HELP_GRADIENT_EDITOR_RIGHT_LOAD },
{ "gradient-editor-load-right-fg", NULL,
NC_("gradient-editor-action", "_Foreground Color"), NULL, NULL,
NC_("gradient-editor-action", "_Foreground Color"), NULL, { NULL }, NULL,
GRADIENT_EDITOR_COLOR_FOREGROUND, FALSE,
GIMP_HELP_GRADIENT_EDITOR_RIGHT_LOAD },
{ "gradient-editor-load-right-bg", NULL,
NC_("gradient-editor-action", "_Background Color"), NULL, NULL,
NC_("gradient-editor-action", "_Background Color"), NULL, { NULL }, NULL,
GRADIENT_EDITOR_COLOR_BACKGROUND, FALSE,
GIMP_HELP_GRADIENT_EDITOR_RIGHT_LOAD },
@@ -255,29 +255,27 @@ static const GimpEnumActionEntry gradient_editor_save_right_actions[] =
static const GimpRadioActionEntry gradient_editor_left_color_type_actions[] =
{
{ "gradient-editor-left-color-fixed", NULL,
NC_("gradient-editor-color-type", "_Fixed"), NULL, NULL,
NC_("gradient-editor-color-type", "_Fixed"), NULL, { NULL }, NULL,
GIMP_GRADIENT_COLOR_FIXED,
GIMP_HELP_GRADIENT_EDITOR_LEFT_COLOR },
{ "gradient-editor-left-color-foreground", NULL,
NC_("gradient-editor-color-type", "F_oreground Color"), NULL, NULL,
NC_("gradient-editor-color-type", "F_oreground Color"), NULL, { NULL }, NULL,
GIMP_GRADIENT_COLOR_FOREGROUND,
GIMP_HELP_GRADIENT_EDITOR_LEFT_COLOR },
{ "gradient-editor-left-color-foreground-transparent", NULL,
NC_("gradient-editor-color-type",
"Fo_reground Color (Transparent)"), NULL, NULL,
NC_("gradient-editor-color-type", "Fo_reground Color (Transparent)"), NULL, { NULL }, NULL,
GIMP_GRADIENT_COLOR_FOREGROUND_TRANSPARENT,
GIMP_HELP_GRADIENT_EDITOR_LEFT_COLOR },
{ "gradient-editor-left-color-background", NULL,
NC_("gradient-editor-color-type", "_Background Color"), NULL, NULL,
NC_("gradient-editor-color-type", "_Background Color"), NULL, { NULL }, NULL,
GIMP_GRADIENT_COLOR_BACKGROUND,
GIMP_HELP_GRADIENT_EDITOR_LEFT_COLOR },
{ "gradient-editor-left-color-background-transparent", NULL,
NC_("gradient-editor-color-type",
"B_ackground Color (Transparent)"), NULL, NULL,
NC_("gradient-editor-color-type", "B_ackground Color (Transparent)"), NULL, { NULL }, NULL,
GIMP_GRADIENT_COLOR_BACKGROUND_TRANSPARENT,
GIMP_HELP_GRADIENT_EDITOR_LEFT_COLOR }
};
@@ -285,29 +283,27 @@ static const GimpRadioActionEntry gradient_editor_left_color_type_actions[] =
static const GimpRadioActionEntry gradient_editor_right_color_type_actions[] =
{
{ "gradient-editor-right-color-fixed", NULL,
NC_("gradient-editor-color-type", "_Fixed"), NULL, NULL,
NC_("gradient-editor-color-type", "_Fixed"), NULL, { NULL }, NULL,
GIMP_GRADIENT_COLOR_FIXED,
GIMP_HELP_GRADIENT_EDITOR_RIGHT_COLOR },
{ "gradient-editor-right-color-foreground", NULL,
NC_("gradient-editor-color-type", "F_oreground Color"), NULL, NULL,
NC_("gradient-editor-color-type", "F_oreground Color"), NULL, { NULL }, NULL,
GIMP_GRADIENT_COLOR_FOREGROUND,
GIMP_HELP_GRADIENT_EDITOR_RIGHT_COLOR },
{ "gradient-editor-right-color-foreground-transparent", NULL,
NC_("gradient-editor-color-type",
"Fo_reground Color (Transparent)"), NULL, NULL,
NC_("gradient-editor-color-type", "Fo_reground Color (Transparent)"), NULL, { NULL }, NULL,
GIMP_GRADIENT_COLOR_FOREGROUND_TRANSPARENT,
GIMP_HELP_GRADIENT_EDITOR_RIGHT_COLOR },
{ "gradient-editor-right-color-background", NULL,
NC_("gradient-editor-color-type", "_Background Color"), NULL, NULL,
NC_("gradient-editor-color-type", "_Background Color"), NULL, { NULL }, NULL,
GIMP_GRADIENT_COLOR_BACKGROUND,
GIMP_HELP_GRADIENT_EDITOR_RIGHT_COLOR },
{ "gradient-editor-right-color-background-transparent", NULL,
NC_("gradient-editor-color-type",
"B_ackground Color (Transparent)"), NULL, NULL,
NC_("gradient-editor-color-type", "B_ackground Color (Transparent)"), NULL, { NULL }, NULL,
GIMP_GRADIENT_COLOR_BACKGROUND_TRANSPARENT,
GIMP_HELP_GRADIENT_EDITOR_RIGHT_COLOR }
};
@@ -315,37 +311,37 @@ static const GimpRadioActionEntry gradient_editor_right_color_type_actions[] =
static const GimpRadioActionEntry gradient_editor_blending_actions[] =
{
{ "gradient-editor-blending-linear", NULL,
NC_("gradient-editor-blending", "_Linear"), NULL, NULL,
NC_("gradient-editor-blending", "_Linear"), NULL, { NULL }, NULL,
GIMP_GRADIENT_SEGMENT_LINEAR,
GIMP_HELP_GRADIENT_EDITOR_BLENDING },
{ "gradient-editor-blending-curved", NULL,
NC_("gradient-editor-blending", "_Curved"), NULL, NULL,
NC_("gradient-editor-blending", "_Curved"), NULL, { NULL }, NULL,
GIMP_GRADIENT_SEGMENT_CURVED,
GIMP_HELP_GRADIENT_EDITOR_BLENDING },
{ "gradient-editor-blending-sine", NULL,
NC_("gradient-editor-blending", "_Sinusoidal"), NULL, NULL,
NC_("gradient-editor-blending", "_Sinusoidal"), NULL, { NULL }, NULL,
GIMP_GRADIENT_SEGMENT_SINE,
GIMP_HELP_GRADIENT_EDITOR_BLENDING },
{ "gradient-editor-blending-sphere-increasing", NULL,
NC_("gradient-editor-blending", "Spherical (i_ncreasing)"), NULL, NULL,
NC_("gradient-editor-blending", "Spherical (i_ncreasing)"), NULL, { NULL }, NULL,
GIMP_GRADIENT_SEGMENT_SPHERE_INCREASING,
GIMP_HELP_GRADIENT_EDITOR_BLENDING },
{ "gradient-editor-blending-sphere-decreasing", NULL,
NC_("gradient-editor-blending", "Spherical (_decreasing)"), NULL, NULL,
NC_("gradient-editor-blending", "Spherical (_decreasing)"), NULL, { NULL }, NULL,
GIMP_GRADIENT_SEGMENT_SPHERE_DECREASING,
GIMP_HELP_GRADIENT_EDITOR_BLENDING },
{ "gradient-editor-blending-step", NULL,
NC_("gradient-editor-blending", "S_tep"), NULL, NULL,
NC_("gradient-editor-blending", "S_tep"), NULL, { NULL }, NULL,
GIMP_GRADIENT_SEGMENT_STEP,
GIMP_HELP_GRADIENT_EDITOR_BLENDING },
{ "gradient-editor-blending-varies", NULL,
NC_("gradient-editor-blending", "(Varies)"), NULL, NULL,
NC_("gradient-editor-blending", "(Varies)"), NULL, { NULL }, NULL,
-1,
GIMP_HELP_GRADIENT_EDITOR_BLENDING }
};
@@ -353,22 +349,22 @@ static const GimpRadioActionEntry gradient_editor_blending_actions[] =
static const GimpRadioActionEntry gradient_editor_coloring_actions[] =
{
{ "gradient-editor-coloring-rgb", NULL,
NC_("gradient-editor-coloring", "_RGB"), NULL, NULL,
NC_("gradient-editor-coloring", "_RGB"), NULL, { NULL }, NULL,
GIMP_GRADIENT_SEGMENT_RGB,
GIMP_HELP_GRADIENT_EDITOR_COLORING },
{ "gradient-editor-coloring-hsv-ccw", NULL,
NC_("gradient-editor-coloring", "HSV (_counter-clockwise hue)"), NULL, NULL,
NC_("gradient-editor-coloring", "HSV (_counter-clockwise hue)"), NULL, { NULL }, NULL,
GIMP_GRADIENT_SEGMENT_HSV_CCW,
GIMP_HELP_GRADIENT_EDITOR_COLORING },
{ "gradient-editor-coloring-hsv-cw", NULL,
NC_("gradient-editor-coloring", "HSV (clockwise _hue)"), NULL, NULL,
NC_("gradient-editor-coloring", "HSV (clockwise _hue)"), NULL, { NULL }, NULL,
GIMP_GRADIENT_SEGMENT_HSV_CW,
GIMP_HELP_GRADIENT_EDITOR_COLORING },
{ "gradient-editor-coloring-varies", NULL,
NC_("gradient-editor-coloring", "(Varies)"), NULL, NULL,
NC_("gradient-editor-coloring", "(Varies)"), NULL, { NULL }, NULL,
-1,
GIMP_HELP_GRADIENT_EDITOR_COLORING }
};
@@ -376,19 +372,19 @@ static const GimpRadioActionEntry gradient_editor_coloring_actions[] =
static const GimpEnumActionEntry gradient_editor_zoom_actions[] =
{
{ "gradient-editor-zoom-in", GIMP_ICON_ZOOM_IN,
N_("Zoom In"), NULL,
N_("Zoom In"), NULL, { NULL },
N_("Zoom in"),
GIMP_ZOOM_IN, FALSE,
GIMP_HELP_GRADIENT_EDITOR_ZOOM_IN },
{ "gradient-editor-zoom-out", GIMP_ICON_ZOOM_OUT,
N_("Zoom Out"), NULL,
N_("Zoom Out"), NULL, { NULL },
N_("Zoom out"),
GIMP_ZOOM_OUT, FALSE,
GIMP_HELP_GRADIENT_EDITOR_ZOOM_OUT },
{ "gradient-editor-zoom-all", GIMP_ICON_ZOOM_FIT_BEST,
N_("Zoom All"), NULL,
N_("Zoom All"), NULL, { NULL },
N_("Zoom all"),
GIMP_ZOOM_OUT_MAX, FALSE,
GIMP_HELP_GRADIENT_EDITOR_ZOOM_ALL }
@@ -411,7 +407,7 @@ gradient_editor_actions_setup (GimpActionGroup *group)
G_N_ELEMENTS (gradient_editor_load_left_actions),
gradient_editor_load_left_cmd_callback);
gimp_action_group_add_enum_actions (group, "gradient-editor-action",
gimp_action_group_add_enum_actions (group, NULL,
gradient_editor_save_left_actions,
G_N_ELEMENTS (gradient_editor_save_left_actions),
gradient_editor_save_left_cmd_callback);
@@ -422,7 +418,7 @@ gradient_editor_actions_setup (GimpActionGroup *group)
gradient_editor_load_right_cmd_callback);
gimp_action_group_add_enum_actions (group, "gradient-editor-action",
gimp_action_group_add_enum_actions (group, NULL,
gradient_editor_save_right_actions,
G_N_ELEMENTS (gradient_editor_save_right_actions),
gradient_editor_save_right_cmd_callback);
@@ -465,23 +461,22 @@ void
gradient_editor_actions_update (GimpActionGroup *group,
gpointer data)
{
GimpGradientEditor *editor = GIMP_GRADIENT_EDITOR (data);
GimpDataEditor *data_editor = GIMP_DATA_EDITOR (data);
GimpGradientEditor *editor = GIMP_GRADIENT_EDITOR (data);
GimpDataEditor *data_editor = GIMP_DATA_EDITOR (data);
GimpGradient *gradient;
gboolean editable = FALSE;
GimpRGB left_color;
GimpRGB right_color;
GimpRGB left_seg_color;
GimpRGB right_seg_color;
GimpRGB fg;
GimpRGB bg;
gboolean blending_equal = TRUE;
gboolean coloring_equal = TRUE;
gboolean left_editable = TRUE;
gboolean right_editable = TRUE;
gboolean selection = FALSE;
gboolean delete = FALSE;
gboolean edit_active = FALSE;
gboolean editable = FALSE;
GeglColor *color;
GeglColor *left_color = NULL;
GeglColor *right_color = NULL;
GeglColor *left_seg_color = NULL;
GeglColor *right_seg_color = NULL;
gboolean blending_equal = TRUE;
gboolean coloring_equal = TRUE;
gboolean left_editable = TRUE;
gboolean right_editable = TRUE;
gboolean selection = FALSE;
gboolean delete = FALSE;
gboolean edit_active = FALSE;
gradient = GIMP_GRADIENT (data_editor->data);
@@ -496,35 +491,31 @@ gradient_editor_actions_update (GimpActionGroup *group,
if (data_editor->data_editable)
editable = TRUE;
gimp_gradient_segment_get_left_flat_color (gradient,
data_editor->context,
editor->control_sel_l,
&left_color);
left_color = gimp_gradient_segment_get_left_flat_color (gradient,
data_editor->context,
editor->control_sel_l);
if (editor->control_sel_l->prev)
left_seg = editor->control_sel_l->prev;
else
left_seg = gimp_gradient_segment_get_last (editor->control_sel_l);
gimp_gradient_segment_get_right_flat_color (gradient,
data_editor->context,
left_seg,
&left_seg_color);
left_seg_color = gimp_gradient_segment_get_right_flat_color (gradient,
data_editor->context,
left_seg);
gimp_gradient_segment_get_right_flat_color (gradient,
data_editor->context,
editor->control_sel_r,
&right_color);
right_color = gimp_gradient_segment_get_right_flat_color (gradient,
data_editor->context,
editor->control_sel_r);
if (editor->control_sel_r->next)
right_seg = editor->control_sel_r->next;
else
right_seg = gimp_gradient_segment_get_first (editor->control_sel_r);
gimp_gradient_segment_get_left_flat_color (gradient,
data_editor->context,
right_seg,
&right_seg_color);
right_seg_color = gimp_gradient_segment_get_left_flat_color (gradient,
data_editor->context,
right_seg);
left_editable = (editor->control_sel_l->left_color_type ==
GIMP_GRADIENT_COLOR_FIXED);
@@ -550,12 +541,6 @@ gradient_editor_actions_update (GimpActionGroup *group,
delete = (editor->control_sel_l->prev || editor->control_sel_r->next);
}
if (data_editor->context)
{
gimp_context_get_foreground (data_editor->context, &fg);
gimp_context_get_background (data_editor->context, &bg);
}
/* pretend the gradient not being editable while the dialog is
* insensitive. prevents the gradient from being modified while a
* dialog is running. bug #161411 --mitch
@@ -577,6 +562,9 @@ gradient_editor_actions_update (GimpActionGroup *group,
gimp_action_group_set_action_color (group, action, (color), (set_label))
#define SET_LABEL(action,label) \
gimp_action_group_set_action_label (group, action, (label))
#define SET_GROUP_LABEL(action,label) \
gimp_radio_action_set_group_label (GIMP_RADIO_ACTION (gimp_action_group_get_action (group, action)), \
label)
#define SET_SENSITIVE(action,condition) \
gimp_action_group_set_action_sensitive (group, action, (condition) != 0, NULL)
#define SET_VISIBLE(action,condition) \
@@ -614,23 +602,22 @@ gradient_editor_actions_update (GimpActionGroup *group,
SET_SENSITIVE ("gradient-editor-load-left-left-neighbor", editable);
SET_SENSITIVE ("gradient-editor-load-left-right-endpoint", editable);
color = gegl_color_new (NULL);
if (gradient)
{
SET_COLOR ("gradient-editor-left-color",
&left_color, FALSE);
SET_COLOR ("gradient-editor-load-left-left-neighbor",
&left_seg_color, FALSE);
SET_COLOR ("gradient-editor-load-left-right-endpoint",
&right_color, FALSE);
SET_COLOR ("gradient-editor-left-color", left_color, FALSE);
SET_COLOR ("gradient-editor-load-left-left-neighbor", left_seg_color, FALSE);
SET_COLOR ("gradient-editor-load-left-right-endpoint", right_color, FALSE);
}
SET_SENSITIVE ("gradient-editor-load-left-fg", left_editable);
SET_SENSITIVE ("gradient-editor-load-left-bg", left_editable);
SET_COLOR ("gradient-editor-load-left-fg",
data_editor->context ? &fg : NULL, FALSE);
data_editor->context ? gimp_context_get_foreground (data_editor->context) : NULL, FALSE);
SET_COLOR ("gradient-editor-load-left-bg",
data_editor->context ? &bg : NULL, FALSE);
data_editor->context ? gimp_context_get_background (data_editor->context) : NULL, FALSE);
SET_SENSITIVE ("gradient-editor-load-left-01", left_editable);
SET_SENSITIVE ("gradient-editor-load-left-02", left_editable);
@@ -643,16 +630,26 @@ gradient_editor_actions_update (GimpActionGroup *group,
SET_SENSITIVE ("gradient-editor-load-left-09", left_editable);
SET_SENSITIVE ("gradient-editor-load-left-10", left_editable);
SET_COLOR ("gradient-editor-load-left-01", &editor->saved_colors[0], TRUE);
SET_COLOR ("gradient-editor-load-left-02", &editor->saved_colors[1], TRUE);
SET_COLOR ("gradient-editor-load-left-03", &editor->saved_colors[2], TRUE);
SET_COLOR ("gradient-editor-load-left-04", &editor->saved_colors[3], TRUE);
SET_COLOR ("gradient-editor-load-left-05", &editor->saved_colors[4], TRUE);
SET_COLOR ("gradient-editor-load-left-06", &editor->saved_colors[5], TRUE);
SET_COLOR ("gradient-editor-load-left-07", &editor->saved_colors[6], TRUE);
SET_COLOR ("gradient-editor-load-left-08", &editor->saved_colors[7], TRUE);
SET_COLOR ("gradient-editor-load-left-09", &editor->saved_colors[8], TRUE);
SET_COLOR ("gradient-editor-load-left-10", &editor->saved_colors[9], TRUE);
gegl_color_set_pixel (color, babl_format ("R'G'B'A double"), &editor->saved_colors[0]);
SET_COLOR ("gradient-editor-load-left-01", color, TRUE);
gegl_color_set_pixel (color, babl_format ("R'G'B'A double"), &editor->saved_colors[1]);
SET_COLOR ("gradient-editor-load-left-02", color, TRUE);
gegl_color_set_pixel (color, babl_format ("R'G'B'A double"), &editor->saved_colors[2]);
SET_COLOR ("gradient-editor-load-left-03", color, TRUE);
gegl_color_set_pixel (color, babl_format ("R'G'B'A double"), &editor->saved_colors[3]);
SET_COLOR ("gradient-editor-load-left-04", color, TRUE);
gegl_color_set_pixel (color, babl_format ("R'G'B'A double"), &editor->saved_colors[4]);
SET_COLOR ("gradient-editor-load-left-05", color, TRUE);
gegl_color_set_pixel (color, babl_format ("R'G'B'A double"), &editor->saved_colors[5]);
SET_COLOR ("gradient-editor-load-left-06", color, TRUE);
gegl_color_set_pixel (color, babl_format ("R'G'B'A double"), &editor->saved_colors[6]);
SET_COLOR ("gradient-editor-load-left-07", color, TRUE);
gegl_color_set_pixel (color, babl_format ("R'G'B'A double"), &editor->saved_colors[7]);
SET_COLOR ("gradient-editor-load-left-08", color, TRUE);
gegl_color_set_pixel (color, babl_format ("R'G'B'A double"), &editor->saved_colors[8]);
SET_COLOR ("gradient-editor-load-left-09", color, TRUE);
gegl_color_set_pixel (color, babl_format ("R'G'B'A double"), &editor->saved_colors[9]);
SET_COLOR ("gradient-editor-load-left-10", color, TRUE);
SET_SENSITIVE ("gradient-editor-save-left-01", gradient);
SET_SENSITIVE ("gradient-editor-save-left-02", gradient);
@@ -665,16 +662,26 @@ gradient_editor_actions_update (GimpActionGroup *group,
SET_SENSITIVE ("gradient-editor-save-left-09", gradient);
SET_SENSITIVE ("gradient-editor-save-left-10", gradient);
SET_COLOR ("gradient-editor-save-left-01", &editor->saved_colors[0], TRUE);
SET_COLOR ("gradient-editor-save-left-02", &editor->saved_colors[1], TRUE);
SET_COLOR ("gradient-editor-save-left-03", &editor->saved_colors[2], TRUE);
SET_COLOR ("gradient-editor-save-left-04", &editor->saved_colors[3], TRUE);
SET_COLOR ("gradient-editor-save-left-05", &editor->saved_colors[4], TRUE);
SET_COLOR ("gradient-editor-save-left-06", &editor->saved_colors[5], TRUE);
SET_COLOR ("gradient-editor-save-left-07", &editor->saved_colors[6], TRUE);
SET_COLOR ("gradient-editor-save-left-08", &editor->saved_colors[7], TRUE);
SET_COLOR ("gradient-editor-save-left-09", &editor->saved_colors[8], TRUE);
SET_COLOR ("gradient-editor-save-left-10", &editor->saved_colors[9], TRUE);
gegl_color_set_pixel (color, babl_format ("R'G'B'A double"), &editor->saved_colors[0]);
SET_COLOR ("gradient-editor-save-left-01", color, TRUE);
gegl_color_set_pixel (color, babl_format ("R'G'B'A double"), &editor->saved_colors[1]);
SET_COLOR ("gradient-editor-save-left-02", color, TRUE);
gegl_color_set_pixel (color, babl_format ("R'G'B'A double"), &editor->saved_colors[2]);
SET_COLOR ("gradient-editor-save-left-03", color, TRUE);
gegl_color_set_pixel (color, babl_format ("R'G'B'A double"), &editor->saved_colors[3]);
SET_COLOR ("gradient-editor-save-left-04", color, TRUE);
gegl_color_set_pixel (color, babl_format ("R'G'B'A double"), &editor->saved_colors[4]);
SET_COLOR ("gradient-editor-save-left-05", color, TRUE);
gegl_color_set_pixel (color, babl_format ("R'G'B'A double"), &editor->saved_colors[5]);
SET_COLOR ("gradient-editor-save-left-06", color, TRUE);
gegl_color_set_pixel (color, babl_format ("R'G'B'A double"), &editor->saved_colors[6]);
SET_COLOR ("gradient-editor-save-left-07", color, TRUE);
gegl_color_set_pixel (color, babl_format ("R'G'B'A double"), &editor->saved_colors[7]);
SET_COLOR ("gradient-editor-save-left-08", color, TRUE);
gegl_color_set_pixel (color, babl_format ("R'G'B'A double"), &editor->saved_colors[8]);
SET_COLOR ("gradient-editor-save-left-09", color, TRUE);
gegl_color_set_pixel (color, babl_format ("R'G'B'A double"), &editor->saved_colors[9]);
SET_COLOR ("gradient-editor-save-left-10", color, TRUE);
SET_SENSITIVE ("gradient-editor-right-color-fixed", editable);
SET_SENSITIVE ("gradient-editor-right-color-foreground", editable);
@@ -710,21 +717,18 @@ gradient_editor_actions_update (GimpActionGroup *group,
if (gradient)
{
SET_COLOR ("gradient-editor-right-color",
&right_color, FALSE);
SET_COLOR ("gradient-editor-load-right-right-neighbor",
&right_seg_color, FALSE);
SET_COLOR ("gradient-editor-load-right-left-endpoint",
&left_color, FALSE);
SET_COLOR ("gradient-editor-right-color", right_color, FALSE);
SET_COLOR ("gradient-editor-load-right-right-neighbor", right_seg_color, FALSE);
SET_COLOR ("gradient-editor-load-right-left-endpoint", left_color, FALSE);
}
SET_SENSITIVE ("gradient-editor-load-right-fg", right_editable);
SET_SENSITIVE ("gradient-editor-load-right-bg", right_editable);
SET_COLOR ("gradient-editor-load-right-fg",
data_editor->context ? &fg : NULL, FALSE);
data_editor->context ? gimp_context_get_foreground (data_editor->context) : NULL, FALSE);
SET_COLOR ("gradient-editor-load-right-bg",
data_editor->context ? &bg : NULL, FALSE);
data_editor->context ? gimp_context_get_background (data_editor->context) : NULL, FALSE);
SET_SENSITIVE ("gradient-editor-load-right-01", right_editable);
SET_SENSITIVE ("gradient-editor-load-right-02", right_editable);
@@ -737,16 +741,26 @@ gradient_editor_actions_update (GimpActionGroup *group,
SET_SENSITIVE ("gradient-editor-load-right-09", right_editable);
SET_SENSITIVE ("gradient-editor-load-right-10", right_editable);
SET_COLOR ("gradient-editor-load-right-01", &editor->saved_colors[0], TRUE);
SET_COLOR ("gradient-editor-load-right-02", &editor->saved_colors[1], TRUE);
SET_COLOR ("gradient-editor-load-right-03", &editor->saved_colors[2], TRUE);
SET_COLOR ("gradient-editor-load-right-04", &editor->saved_colors[3], TRUE);
SET_COLOR ("gradient-editor-load-right-05", &editor->saved_colors[4], TRUE);
SET_COLOR ("gradient-editor-load-right-06", &editor->saved_colors[5], TRUE);
SET_COLOR ("gradient-editor-load-right-07", &editor->saved_colors[6], TRUE);
SET_COLOR ("gradient-editor-load-right-08", &editor->saved_colors[7], TRUE);
SET_COLOR ("gradient-editor-load-right-09", &editor->saved_colors[8], TRUE);
SET_COLOR ("gradient-editor-load-right-10", &editor->saved_colors[9], TRUE);
gegl_color_set_pixel (color, babl_format ("R'G'B'A double"), &editor->saved_colors[0]);
SET_COLOR ("gradient-editor-load-right-01", color, TRUE);
gegl_color_set_pixel (color, babl_format ("R'G'B'A double"), &editor->saved_colors[1]);
SET_COLOR ("gradient-editor-load-right-02", color, TRUE);
gegl_color_set_pixel (color, babl_format ("R'G'B'A double"), &editor->saved_colors[2]);
SET_COLOR ("gradient-editor-load-right-03", color, TRUE);
gegl_color_set_pixel (color, babl_format ("R'G'B'A double"), &editor->saved_colors[3]);
SET_COLOR ("gradient-editor-load-right-04", color, TRUE);
gegl_color_set_pixel (color, babl_format ("R'G'B'A double"), &editor->saved_colors[4]);
SET_COLOR ("gradient-editor-load-right-05", color, TRUE);
gegl_color_set_pixel (color, babl_format ("R'G'B'A double"), &editor->saved_colors[5]);
SET_COLOR ("gradient-editor-load-right-06", color, TRUE);
gegl_color_set_pixel (color, babl_format ("R'G'B'A double"), &editor->saved_colors[6]);
SET_COLOR ("gradient-editor-load-right-07", color, TRUE);
gegl_color_set_pixel (color, babl_format ("R'G'B'A double"), &editor->saved_colors[7]);
SET_COLOR ("gradient-editor-load-right-08", color, TRUE);
gegl_color_set_pixel (color, babl_format ("R'G'B'A double"), &editor->saved_colors[8]);
SET_COLOR ("gradient-editor-load-right-09", color, TRUE);
gegl_color_set_pixel (color, babl_format ("R'G'B'A double"), &editor->saved_colors[9]);
SET_COLOR ("gradient-editor-load-right-10", color, TRUE);
SET_SENSITIVE ("gradient-editor-save-right-01", gradient);
SET_SENSITIVE ("gradient-editor-save-right-02", gradient);
@@ -759,16 +773,26 @@ gradient_editor_actions_update (GimpActionGroup *group,
SET_SENSITIVE ("gradient-editor-save-right-09", gradient);
SET_SENSITIVE ("gradient-editor-save-right-10", gradient);
SET_COLOR ("gradient-editor-save-right-01", &editor->saved_colors[0], TRUE);
SET_COLOR ("gradient-editor-save-right-02", &editor->saved_colors[1], TRUE);
SET_COLOR ("gradient-editor-save-right-03", &editor->saved_colors[2], TRUE);
SET_COLOR ("gradient-editor-save-right-04", &editor->saved_colors[3], TRUE);
SET_COLOR ("gradient-editor-save-right-05", &editor->saved_colors[4], TRUE);
SET_COLOR ("gradient-editor-save-right-06", &editor->saved_colors[5], TRUE);
SET_COLOR ("gradient-editor-save-right-07", &editor->saved_colors[6], TRUE);
SET_COLOR ("gradient-editor-save-right-08", &editor->saved_colors[7], TRUE);
SET_COLOR ("gradient-editor-save-right-09", &editor->saved_colors[8], TRUE);
SET_COLOR ("gradient-editor-save-right-10", &editor->saved_colors[9], TRUE);
gegl_color_set_pixel (color, babl_format ("R'G'B'A double"), &editor->saved_colors[0]);
SET_COLOR ("gradient-editor-save-right-01", color, TRUE);
gegl_color_set_pixel (color, babl_format ("R'G'B'A double"), &editor->saved_colors[1]);
SET_COLOR ("gradient-editor-save-right-02", color, TRUE);
gegl_color_set_pixel (color, babl_format ("R'G'B'A double"), &editor->saved_colors[2]);
SET_COLOR ("gradient-editor-save-right-03", color, TRUE);
gegl_color_set_pixel (color, babl_format ("R'G'B'A double"), &editor->saved_colors[3]);
SET_COLOR ("gradient-editor-save-right-04", color, TRUE);
gegl_color_set_pixel (color, babl_format ("R'G'B'A double"), &editor->saved_colors[4]);
SET_COLOR ("gradient-editor-save-right-05", color, TRUE);
gegl_color_set_pixel (color, babl_format ("R'G'B'A double"), &editor->saved_colors[5]);
SET_COLOR ("gradient-editor-save-right-06", color, TRUE);
gegl_color_set_pixel (color, babl_format ("R'G'B'A double"), &editor->saved_colors[6]);
SET_COLOR ("gradient-editor-save-right-07", color, TRUE);
gegl_color_set_pixel (color, babl_format ("R'G'B'A double"), &editor->saved_colors[7]);
SET_COLOR ("gradient-editor-save-right-08", color, TRUE);
gegl_color_set_pixel (color, babl_format ("R'G'B'A double"), &editor->saved_colors[8]);
SET_COLOR ("gradient-editor-save-right-09", color, TRUE);
gegl_color_set_pixel (color, babl_format ("R'G'B'A double"), &editor->saved_colors[9]);
SET_COLOR ("gradient-editor-save-right-10", color, TRUE);
SET_SENSITIVE ("gradient-editor-flip", editable);
SET_SENSITIVE ("gradient-editor-replicate", editable);
@@ -780,10 +804,10 @@ gradient_editor_actions_update (GimpActionGroup *group,
if (! selection)
{
SET_LABEL ("gradient-editor-blending-func",
_("_Blending Function for Segment"));
SET_LABEL ("gradient-editor-coloring-type",
_("Coloring _Type for Segment"));
SET_GROUP_LABEL ("gradient-editor-blending-linear",
_("_Blending Function for Segment"));
SET_GROUP_LABEL ("gradient-editor-coloring-rgb",
_("Coloring _Type for Segment"));
SET_LABEL ("gradient-editor-flip",
_("_Flip Segment"));
@@ -802,10 +826,10 @@ gradient_editor_actions_update (GimpActionGroup *group,
}
else
{
SET_LABEL ("gradient-editor-blending-func",
_("_Blending Function for Selection"));
SET_LABEL ("gradient-editor-coloring-type",
_("Coloring _Type for Selection"));
SET_GROUP_LABEL ("gradient-editor-blending-linear",
_("_Blending Function for Selection"));
SET_GROUP_LABEL ("gradient-editor-coloring-rgb",
_("Coloring _Type for Selection"));
SET_LABEL ("gradient-editor-flip",
_("_Flip Selection"));
@@ -903,4 +927,10 @@ gradient_editor_actions_update (GimpActionGroup *group,
#undef SET_LABEL
#undef SET_SENSITIVE
#undef SET_VISIBLE
g_object_unref (color);
g_clear_object (&left_color);
g_clear_object (&right_color);
g_clear_object (&left_seg_color);
g_clear_object (&right_seg_color);
}

View File

@@ -80,18 +80,21 @@ gradient_editor_left_color_type_cmd_callback (GimpAction *action,
color_type !=
gimp_gradient_segment_get_left_color_type (gradient, left))
{
GimpRGB color;
gimp_gradient_segment_get_left_flat_color (gradient,
GIMP_DATA_EDITOR (editor)->context,
left, &color);
gimp_data_freeze (GIMP_DATA (gradient));
gimp_gradient_segment_set_left_color_type (gradient, left, color_type);
if (color_type == GIMP_GRADIENT_COLOR_FIXED)
gimp_gradient_segment_set_left_color (gradient, left, &color);
{
GeglColor *color;
color = gimp_gradient_segment_get_left_flat_color (gradient,
GIMP_DATA_EDITOR (editor)->context,
left);
gimp_gradient_segment_set_left_color (gradient, left, color);
g_object_unref (color);
}
gimp_data_thaw (GIMP_DATA (gradient));
}
@@ -108,7 +111,7 @@ gradient_editor_load_left_cmd_callback (GimpAction *action,
GimpGradientSegment *left;
GimpGradientSegment *right;
GimpGradientSegment *seg;
GimpRGB color;
GeglColor *color;
GimpGradientColor color_type = GIMP_GRADIENT_COLOR_FIXED;
gint index = g_variant_get_int32 (value);
@@ -132,11 +135,11 @@ gradient_editor_load_left_cmd_callback (GimpAction *action,
break;
case GRADIENT_EDITOR_COLOR_FOREGROUND:
gimp_context_get_foreground (data_editor->context, &color);
color = gimp_context_get_foreground (data_editor->context);
break;
case GRADIENT_EDITOR_COLOR_BACKGROUND:
gimp_context_get_background (data_editor->context, &color);
color = gimp_context_get_background (data_editor->context);
break;
default: /* Load a color */
@@ -146,10 +149,8 @@ gradient_editor_load_left_cmd_callback (GimpAction *action,
gimp_data_freeze (GIMP_DATA (gradient));
gimp_gradient_segment_range_blend (gradient, left, right,
&color,
&right->right_color,
TRUE, TRUE);
gimp_gradient_segment_range_blend (gradient, left, right, color,
right->right_color, TRUE, TRUE);
gimp_gradient_segment_set_left_color_type (gradient, left, color_type);
gimp_data_thaw (GIMP_DATA (gradient));
@@ -167,8 +168,8 @@ gradient_editor_save_left_cmd_callback (GimpAction *action,
gimp_gradient_editor_get_selection (editor, &gradient, &left, NULL);
gimp_gradient_segment_get_left_color (gradient, left,
&editor->saved_colors[index]);
g_clear_object (&editor->saved_colors[index]);
editor->saved_colors[index] = gegl_color_duplicate (gimp_gradient_segment_get_left_color (gradient, left));
}
void
@@ -200,18 +201,20 @@ gradient_editor_right_color_type_cmd_callback (GimpAction *action,
color_type !=
gimp_gradient_segment_get_right_color_type (gradient, right))
{
GimpRGB color;
gimp_gradient_segment_get_right_flat_color (gradient,
GIMP_DATA_EDITOR (editor)->context,
right, &color);
gimp_data_freeze (GIMP_DATA (gradient));
gimp_gradient_segment_set_right_color_type (gradient, right, color_type);
if (color_type == GIMP_GRADIENT_COLOR_FIXED)
gimp_gradient_segment_set_right_color (gradient, right, &color);
{
GeglColor *color;
color = gimp_gradient_segment_get_right_flat_color (gradient, GIMP_DATA_EDITOR (editor)->context,
right);
gimp_gradient_segment_set_right_color (gradient, right, color);
g_object_unref (color);
}
gimp_data_thaw (GIMP_DATA (gradient));
}
@@ -228,7 +231,7 @@ gradient_editor_load_right_cmd_callback (GimpAction *action,
GimpGradientSegment *left;
GimpGradientSegment *right;
GimpGradientSegment *seg;
GimpRGB color;
GeglColor *color;
GimpGradientColor color_type = GIMP_GRADIENT_COLOR_FIXED;
gint index = g_variant_get_int32 (value);
@@ -252,11 +255,11 @@ gradient_editor_load_right_cmd_callback (GimpAction *action,
break;
case GRADIENT_EDITOR_COLOR_FOREGROUND:
gimp_context_get_foreground (data_editor->context, &color);
color = gimp_context_get_foreground (data_editor->context);
break;
case GRADIENT_EDITOR_COLOR_BACKGROUND:
gimp_context_get_background (data_editor->context, &color);
color = gimp_context_get_background (data_editor->context);
break;
default: /* Load a color */
@@ -266,10 +269,8 @@ gradient_editor_load_right_cmd_callback (GimpAction *action,
gimp_data_freeze (GIMP_DATA (gradient));
gimp_gradient_segment_range_blend (gradient, left, right,
&left->left_color,
&color,
TRUE, TRUE);
gimp_gradient_segment_range_blend (gradient, left, right, left->left_color,
color, TRUE, TRUE);
gimp_gradient_segment_set_right_color_type (gradient, left, color_type);
gimp_data_thaw (GIMP_DATA (gradient));
@@ -287,8 +288,8 @@ gradient_editor_save_right_cmd_callback (GimpAction *action,
gimp_gradient_editor_get_selection (editor, &gradient, NULL, &right);
gimp_gradient_segment_get_right_color (gradient, right,
&editor->saved_colors[index]);
g_clear_object (&editor->saved_colors[index]);
editor->saved_colors[index] = gegl_color_duplicate (gimp_gradient_segment_get_right_color (gradient, right));
}
void
@@ -629,8 +630,8 @@ gradient_editor_blend_color_cmd_callback (GimpAction *action,
gimp_gradient_editor_get_selection (editor, &gradient, &left, &right);
gimp_gradient_segment_range_blend (gradient, left, right,
&left->left_color,
&right->right_color,
left->left_color,
right->right_color,
TRUE, FALSE);
}
@@ -647,8 +648,8 @@ gradient_editor_blend_opacity_cmd_callback (GimpAction *action,
gimp_gradient_editor_get_selection (editor, &gradient, &left, &right);
gimp_gradient_segment_range_blend (gradient, left, right,
&left->left_color,
&right->right_color,
left->left_color,
right->right_color,
FALSE, TRUE);
}
@@ -660,7 +661,7 @@ gradient_editor_zoom_cmd_callback (GimpAction *action,
GimpGradientEditor *editor = GIMP_GRADIENT_EDITOR (data);
GimpZoomType zoom_type = (GimpZoomType) g_variant_get_int32 (value);
gimp_gradient_editor_zoom (editor, zoom_type, 1.0);
gimp_gradient_editor_zoom (editor, zoom_type, 1.0, 0.5);
}

View File

@@ -40,48 +40,44 @@
static const GimpActionEntry gradients_actions[] =
{
{ "gradients-popup", GIMP_ICON_GRADIENT,
NC_("gradients-action", "Gradients Menu"), NULL, NULL, NULL,
GIMP_HELP_GRADIENT_DIALOG },
{ "gradients-new", GIMP_ICON_DOCUMENT_NEW,
NC_("gradients-action", "_New Gradient"), NULL,
NC_("gradients-action", "_New Gradient"), NULL, { NULL },
NC_("gradients-action", "Create a new gradient"),
data_new_cmd_callback,
GIMP_HELP_GRADIENT_NEW },
{ "gradients-duplicate", GIMP_ICON_OBJECT_DUPLICATE,
NC_("gradients-action", "D_uplicate Gradient"), NULL,
NC_("gradients-action", "D_uplicate Gradient"), NULL, { NULL },
NC_("gradients-action", "Duplicate this gradient"),
data_duplicate_cmd_callback,
GIMP_HELP_GRADIENT_DUPLICATE },
{ "gradients-copy-location", GIMP_ICON_EDIT_COPY,
NC_("gradients-action", "Copy Gradient _Location"), NULL,
NC_("gradients-action", "Copy Gradient _Location"), NULL, { NULL },
NC_("gradients-action", "Copy gradient file location to clipboard"),
data_copy_location_cmd_callback,
GIMP_HELP_GRADIENT_COPY_LOCATION },
{ "gradients-show-in-file-manager", GIMP_ICON_FILE_MANAGER,
NC_("gradients-action", "Show in _File Manager"), NULL,
NC_("gradients-action", "Show in _File Manager"), NULL, { NULL },
NC_("gradients-action", "Show gradient file location in the file manager"),
data_show_in_file_manager_cmd_callback,
GIMP_HELP_GRADIENT_SHOW_IN_FILE_MANAGER },
{ "gradients-save-as-pov", GIMP_ICON_DOCUMENT_SAVE_AS,
NC_("gradients-action", "Save as _POV-Ray..."), NULL,
NC_("gradients-action", "Save as _POV-Ray..."), NULL, { NULL },
NC_("gradients-action", "Save gradient as POV-Ray"),
gradients_save_as_pov_ray_cmd_callback,
GIMP_HELP_GRADIENT_SAVE_AS_POV },
{ "gradients-delete", GIMP_ICON_EDIT_DELETE,
NC_("gradients-action", "_Delete Gradient"), NULL,
NC_("gradients-action", "_Delete Gradient"), NULL, { NULL },
NC_("gradients-action", "Delete this gradient"),
data_delete_cmd_callback,
GIMP_HELP_GRADIENT_DELETE },
{ "gradients-refresh", GIMP_ICON_VIEW_REFRESH,
NC_("gradients-action", "_Refresh Gradients"), NULL,
NC_("gradients-action", "_Refresh Gradients"), NULL, { NULL },
NC_("gradients-action", "Refresh gradients"),
data_refresh_cmd_callback,
GIMP_HELP_GRADIENT_REFRESH }
@@ -90,7 +86,7 @@ static const GimpActionEntry gradients_actions[] =
static const GimpStringActionEntry gradients_edit_actions[] =
{
{ "gradients-edit", GIMP_ICON_EDIT,
NC_("gradients-action", "_Edit Gradient..."), NULL,
NC_("gradients-action", "_Edit Gradient..."), NULL, { NULL },
NC_("gradients-action", "Edit this gradient"),
"gimp-gradient-editor",
GIMP_HELP_GRADIENT_EDIT }

View File

@@ -31,6 +31,7 @@
#include "widgets/gimpcontainereditor.h"
#include "widgets/gimpcontainerview.h"
#include "widgets/gimphelp-ids.h"
#include "widgets/gimpwidgets-utils.h"
#include "dialogs/dialogs.h"
@@ -85,9 +86,9 @@ gradients_save_as_pov_ray_cmd_callback (GimpAction *action,
gtk_dialog_set_default_response (GTK_DIALOG (dialog), GTK_RESPONSE_OK);
gimp_dialog_set_alternative_button_order (GTK_DIALOG (dialog),
GTK_RESPONSE_OK,
GTK_RESPONSE_CANCEL,
-1);
GTK_RESPONSE_OK,
GTK_RESPONSE_CANCEL,
-1);
g_object_set_data (G_OBJECT (dialog), "gimp", context->gimp);
@@ -119,6 +120,10 @@ gradients_save_as_pov_ray_cmd_callback (GimpAction *action,
}
gtk_window_present (GTK_WINDOW (dialog));
#ifdef G_OS_WIN32
gimp_window_set_title_bar_theme (context->gimp, dialog);
#endif
}

View File

@@ -35,16 +35,14 @@
static const GimpActionEntry help_actions[] =
{
{ "help-menu", NULL, NC_("help-action", "_Help") },
{ "help-help", "gimp-prefs-help-system",
NC_("help-action", "_Help"), "F1",
NC_("help-action", "_Help"), NULL, { "F1", NULL },
NC_("help-action", "Open the GIMP user manual"),
help_help_cmd_callback,
GIMP_HELP_HELP },
{ "help-context-help", "gimp-prefs-help-system",
NC_("help-action", "_Context Help"), "<shift>F1",
NC_("help-action", "_Context Help"), NULL, { "<shift>F1", NULL },
NC_("help-action", "Show the help for a specific user interface item"),
help_context_help_cmd_callback,
GIMP_HELP_HELP_CONTEXT }

View File

@@ -20,6 +20,7 @@
#include <gegl.h>
#include <gtk/gtk.h>
#include "libgimpconfig/gimpconfig.h"
#include "libgimpwidgets/gimpwidgets.h"
#include "actions-types.h"
@@ -35,6 +36,9 @@
#include "core/gimpimage-color-profile.h"
#include "core/gimpitemstack.h"
#include "display/gimpdisplay.h"
#include "display/gimpdisplayshell.h"
#include "widgets/gimpactiongroup.h"
#include "widgets/gimphelp-ids.h"
@@ -47,129 +51,110 @@
static const GimpActionEntry image_actions[] =
{
{ "image-menubar", NULL,
NC_("image-action", "Image Menu"), NULL, NULL, NULL,
GIMP_HELP_IMAGE_WINDOW },
{ "image-popup", NULL,
NC_("image-action", "Image Menu"), NULL, NULL, NULL,
GIMP_HELP_IMAGE_WINDOW },
{ "image-menu", NULL, NC_("image-action", "_Image") },
{ "image-mode-menu", NULL, NC_("image-action", "_Mode") },
{ "image-precision-menu", NULL, NC_("image-action", "_Encoding") },
{ "image-color-management-menu", NULL, NC_("image-action",
"Color Ma_nagement") },
{ "image-transform-menu", NULL, NC_("image-action", "_Transform") },
{ "image-guides-menu", NULL, NC_("image-action", "_Guides") },
{ "image-metadata-menu", NULL, NC_("image-action", "Meta_data") },
{ "colors-menu", NULL, NC_("image-action", "_Colors") },
{ "colors-info-menu", NULL, NC_("image-action", "I_nfo") },
{ "colors-auto-menu", NULL, NC_("image-action", "_Auto") },
{ "colors-map-menu", NULL, NC_("image-action", "_Map") },
{ "colors-tone-mapping-menu", NULL, NC_("image-action", "_Tone Mapping") },
{ "colors-components-menu", NULL, NC_("image-action", "C_omponents") },
{ "colors-desaturate-menu", NULL, NC_("image-action", "D_esaturate") },
{ "image-new", GIMP_ICON_DOCUMENT_NEW,
NC_("image-action", "_New..."), "<primary>N",
NC_("image-action", "_New..."), NULL, { "<primary>N", NULL },
NC_("image-action", "Create a new image"),
image_new_cmd_callback,
GIMP_HELP_FILE_NEW },
{ "image-duplicate", GIMP_ICON_OBJECT_DUPLICATE,
NC_("image-action", "_Duplicate"), "<primary>D",
NC_("image-action", "_Duplicate"), NULL, { "<primary>D", NULL },
NC_("image-action", "Create a duplicate of this image"),
image_duplicate_cmd_callback,
GIMP_HELP_IMAGE_DUPLICATE },
{ "image-color-profile-assign", NULL,
NC_("image-action", "_Assign Color Profile..."), NULL,
NC_("image-action", "_Assign Color Profile..."), NULL, { NULL },
NC_("image-action", "Set a color profile on the image"),
image_color_profile_assign_cmd_callback,
GIMP_HELP_IMAGE_COLOR_PROFILE_ASSIGN },
{ "image-color-profile-convert", NULL,
NC_("image-action", "_Convert to Color Profile..."), NULL,
NC_("image-action", "_Convert to Color Profile..."), NULL, { NULL },
NC_("image-action", "Apply a color profile to the image"),
image_color_profile_convert_cmd_callback,
GIMP_HELP_IMAGE_COLOR_PROFILE_CONVERT },
{ "image-color-profile-discard", NULL,
NC_("image-action", "_Discard Color Profile"), NULL,
NC_("image-action", "_Discard Color Profile"), NULL, { NULL },
NC_("image-action", "Remove the image's color profile"),
image_color_profile_discard_cmd_callback,
GIMP_HELP_IMAGE_COLOR_PROFILE_DISCARD },
{ "image-softproof-profile", NULL,
NC_("image-action", "_Soft-proof Profile..."), NULL, { NULL },
NC_("image-action", "Set the soft-proofing profile"),
image_softproof_profile_cmd_callback,
GIMP_HELP_VIEW_COLOR_MANAGEMENT },
{ "image-color-profile-save", NULL,
NC_("image-action", "_Save Color Profile to File..."), NULL,
NC_("image-action", "_Save Color Profile to File..."), NULL, { NULL },
NC_("image-action", "Save the image's color profile to an ICC file"),
image_color_profile_save_cmd_callback,
GIMP_HELP_IMAGE_COLOR_PROFILE_SAVE },
{ "image-resize", GIMP_ICON_OBJECT_RESIZE,
NC_("image-action", "Can_vas Size..."), NULL,
NC_("image-action", "Can_vas Size..."), NULL, { NULL },
NC_("image-action", "Adjust the image dimensions"),
image_resize_cmd_callback,
GIMP_HELP_IMAGE_RESIZE },
{ "image-resize-to-layers", NULL,
NC_("image-action", "Fit Canvas to L_ayers"), NULL,
NC_("image-action", "Fit Canvas to L_ayers"), NULL, { NULL },
NC_("image-action", "Resize the image to enclose all layers"),
image_resize_to_layers_cmd_callback,
GIMP_HELP_IMAGE_RESIZE_TO_LAYERS },
{ "image-resize-to-selection", NULL,
NC_("image-action", "F_it Canvas to Selection"), NULL,
NC_("image-action", "F_it Canvas to Selection"), NULL, { NULL },
NC_("image-action", "Resize the image to the extents of the selection"),
image_resize_to_selection_cmd_callback,
GIMP_HELP_IMAGE_RESIZE_TO_SELECTION },
{ "image-print-size", GIMP_ICON_DOCUMENT_PRINT_RESOLUTION,
NC_("image-action", "_Print Size..."), NULL,
NC_("image-action", "_Print Size..."), NULL, { NULL },
NC_("image-action", "Adjust the print resolution"),
image_print_size_cmd_callback,
GIMP_HELP_IMAGE_PRINT_SIZE },
{ "image-scale", GIMP_ICON_OBJECT_SCALE,
NC_("image-action", "_Scale Image..."), NULL,
NC_("image-action", "_Scale Image..."), NULL, { NULL },
NC_("image-action", "Change the size of the image content"),
image_scale_cmd_callback,
GIMP_HELP_IMAGE_SCALE },
{ "image-crop-to-selection", GIMP_ICON_TOOL_CROP,
NC_("image-action", "_Crop to Selection"), NULL,
NC_("image-action", "_Crop to Selection"), NULL, { NULL },
NC_("image-action", "Crop the image to the extents of the selection"),
image_crop_to_selection_cmd_callback,
GIMP_HELP_IMAGE_CROP },
{ "image-crop-to-content", GIMP_ICON_TOOL_CROP,
NC_("image-action", "Crop to C_ontent"), NULL,
NC_("image-action", "Crop to C_ontent"), NULL, { NULL },
NC_("image-action", "Crop the image to the extents of its content (remove empty borders from the image)"),
image_crop_to_content_cmd_callback,
GIMP_HELP_IMAGE_CROP },
{ "image-merge-layers", NULL,
NC_("image-action", "Merge Visible _Layers..."), "<primary>M",
NC_("image-action", "Merge Visible _Layers..."), NULL, { "<primary>M", NULL },
NC_("image-action", "Merge all visible layers into one layer"),
image_merge_layers_cmd_callback,
GIMP_HELP_IMAGE_MERGE_LAYERS },
{ "image-flatten", NULL,
NC_("image-action", "_Flatten Image"), NULL,
NC_("image-action", "_Flatten Image"), NULL, { NULL },
NC_("image-action", "Merge all layers into one and remove transparency"),
image_flatten_image_cmd_callback,
GIMP_HELP_IMAGE_FLATTEN },
{ "image-configure-grid", GIMP_ICON_GRID,
NC_("image-action", "Configure G_rid..."), NULL,
NC_("image-action", "Configure G_rid..."), NULL, { NULL },
NC_("image-action", "Configure the grid for this image"),
image_configure_grid_cmd_callback,
GIMP_HELP_IMAGE_GRID },
{ "image-properties", "dialog-information",
NC_("image-action", "Image Pr_operties"), "<alt>Return",
NC_("image-action", "Image Pr_operties"), NULL, { "<alt>Return", NULL },
NC_("image-action", "Display information about this image"),
image_properties_cmd_callback,
GIMP_HELP_IMAGE_PROPERTIES }
@@ -178,29 +163,36 @@ static const GimpActionEntry image_actions[] =
static const GimpToggleActionEntry image_toggle_actions[] =
{
{ "image-color-profile-use-srgb", NULL,
NC_("image-action", "Use _sRGB Profile"), NULL,
NC_("image-action", "Use _sRGB Profile"), NULL, { NULL },
NC_("image-action", "Temporarily use an sRGB profile for the image. "
"This is the same as discarding the image's color profile, but "
"allows to easily restore the profile."),
image_color_profile_use_srgb_cmd_callback,
TRUE,
GIMP_HELP_IMAGE_COLOR_PROFILE_USE_SRGB }
GIMP_HELP_IMAGE_COLOR_PROFILE_USE_SRGB },
{ "image-softproof-black-point-compensation", NULL,
NC_("image-action", "_Black Point Compensation"), NULL, { NULL },
NC_("image-action", "Use black point compensation for soft-proofing"),
image_softproof_bpc_cmd_callback,
TRUE,
GIMP_HELP_VIEW_COLOR_MANAGEMENT }
};
static const GimpRadioActionEntry image_convert_base_type_actions[] =
{
{ "image-convert-rgb", GIMP_ICON_CONVERT_RGB,
NC_("image-convert-action", "_RGB"), NULL,
NC_("image-convert-action", "_RGB"), NULL, { NULL },
NC_("image-convert-action", "Convert the image to the RGB colorspace"),
GIMP_RGB, GIMP_HELP_IMAGE_CONVERT_RGB },
{ "image-convert-grayscale", GIMP_ICON_CONVERT_GRAYSCALE,
NC_("image-convert-action", "_Grayscale"), NULL,
NC_("image-convert-action", "_Grayscale"), NULL, { NULL },
NC_("image-convert-action", "Convert the image to grayscale"),
GIMP_GRAY, GIMP_HELP_IMAGE_CONVERT_GRAYSCALE },
{ "image-convert-indexed", GIMP_ICON_CONVERT_INDEXED,
NC_("image-convert-action", "_Indexed..."), NULL,
NC_("image-convert-action", "_Indexed..."), NULL, { NULL },
NC_("image-convert-action", "Convert the image to indexed colors"),
GIMP_INDEXED, GIMP_HELP_IMAGE_CONVERT_INDEXED }
};
@@ -208,58 +200,58 @@ static const GimpRadioActionEntry image_convert_base_type_actions[] =
static const GimpRadioActionEntry image_convert_precision_actions[] =
{
{ "image-convert-u8", NULL,
NC_("image-convert-action", "8 bit integer"), NULL,
NC_("image-convert-action", "8-bit integer"), NULL, { NULL },
NC_("image-convert-action",
"Convert the image to 8 bit integer"),
"Convert the image to 8-bit integer"),
GIMP_COMPONENT_TYPE_U8, GIMP_HELP_IMAGE_CONVERT_U8 },
{ "image-convert-u16", NULL,
NC_("image-convert-action", "16 bit integer"), NULL,
NC_("image-convert-action", "16-bit integer"), NULL, { NULL },
NC_("image-convert-action",
"Convert the image to 16 bit integer"),
"Convert the image to 16-bit integer"),
GIMP_COMPONENT_TYPE_U16, GIMP_HELP_IMAGE_CONVERT_U16 },
{ "image-convert-u32", NULL,
NC_("image-convert-action", "32 bit integer"), NULL,
NC_("image-convert-action", "32-bit integer"), NULL, { NULL },
NC_("image-convert-action",
"Convert the image to 32 bit integer"),
"Convert the image to 32-bit integer"),
GIMP_COMPONENT_TYPE_U32, GIMP_HELP_IMAGE_CONVERT_U32 },
{ "image-convert-half", NULL,
NC_("image-convert-action", "16 bit floating point"), NULL,
NC_("image-convert-action", "16-bit floating point"), NULL, { NULL },
NC_("image-convert-action",
"Convert the image to 16 bit floating point"),
"Convert the image to 16-bit floating point"),
GIMP_COMPONENT_TYPE_HALF, GIMP_HELP_IMAGE_CONVERT_HALF },
{ "image-convert-float", NULL,
NC_("image-convert-action", "32 bit floating point"), NULL,
NC_("image-convert-action", "32-bit floating point"), NULL, { NULL },
NC_("image-convert-action",
"Convert the image to 32 bit floating point"),
"Convert the image to 32-bit floating point"),
GIMP_COMPONENT_TYPE_FLOAT, GIMP_HELP_IMAGE_CONVERT_FLOAT },
{ "image-convert-double", NULL,
NC_("image-convert-action", "64 bit floating point"), NULL,
NC_("image-convert-action", "64-bit floating point"), NULL, { NULL },
NC_("image-convert-action",
"Convert the image to 64 bit floating point"),
"Convert the image to 64-bit floating point"),
GIMP_COMPONENT_TYPE_DOUBLE, GIMP_HELP_IMAGE_CONVERT_DOUBLE }
};
static const GimpRadioActionEntry image_convert_trc_actions[] =
{
{ "image-convert-linear", NULL,
NC_("image-convert-action", "Linear light"), NULL,
NC_("image-convert-action", "Linear light"), NULL, { NULL },
NC_("image-convert-action",
"Convert the image to linear light"),
GIMP_TRC_LINEAR, GIMP_HELP_IMAGE_CONVERT_GAMMA },
{ "image-convert-non-linear", NULL,
NC_("image-convert-action", "Non-Linear"), NULL,
NC_("image-convert-action", "Non-Linear"), NULL, { NULL },
NC_("image-convert-action",
"Convert the image to non-linear gamma from the color profile"),
GIMP_TRC_NON_LINEAR, GIMP_HELP_IMAGE_CONVERT_GAMMA },
{ "image-convert-perceptual", NULL,
NC_("image-convert-action", "Perceptual (sRGB)"), NULL,
NC_("image-convert-action", "Perceptual (sRGB)"), NULL, { NULL },
NC_("image-convert-action",
"Convert the image to perceptual (sRGB) gamma"),
GIMP_TRC_PERCEPTUAL, GIMP_HELP_IMAGE_CONVERT_GAMMA }
@@ -268,13 +260,13 @@ static const GimpRadioActionEntry image_convert_trc_actions[] =
static const GimpEnumActionEntry image_flip_actions[] =
{
{ "image-flip-horizontal", GIMP_ICON_OBJECT_FLIP_HORIZONTAL,
NC_("image-action", "Flip _Horizontally"), NULL,
NC_("image-action", "Flip _Horizontally"), NULL, { NULL },
NC_("image-action", "Flip image horizontally"),
GIMP_ORIENTATION_HORIZONTAL, FALSE,
GIMP_HELP_IMAGE_FLIP_HORIZONTAL },
{ "image-flip-vertical", GIMP_ICON_OBJECT_FLIP_VERTICAL,
NC_("image-action", "Flip _Vertically"), NULL,
NC_("image-action", "Flip _Vertically"), NULL, { NULL },
NC_("image-action", "Flip image vertically"),
GIMP_ORIENTATION_VERTICAL, FALSE,
GIMP_HELP_IMAGE_FLIP_VERTICAL }
@@ -283,24 +275,51 @@ static const GimpEnumActionEntry image_flip_actions[] =
static const GimpEnumActionEntry image_rotate_actions[] =
{
{ "image-rotate-90", GIMP_ICON_OBJECT_ROTATE_90,
NC_("image-action", "Rotate 90° _clockwise"), NULL,
NC_("image-action", "Rotate 90° _clockwise"), NULL, { NULL },
NC_("image-action", "Rotate the image 90 degrees to the right"),
GIMP_ROTATE_90, FALSE,
GIMP_ROTATE_DEGREES90, FALSE,
GIMP_HELP_IMAGE_ROTATE_90 },
{ "image-rotate-180", GIMP_ICON_OBJECT_ROTATE_180,
NC_("image-action", "Rotate _180°"), NULL,
NC_("image-action", "Rotate _180°"), NULL, { NULL },
NC_("image-action", "Turn the image upside-down"),
GIMP_ROTATE_180, FALSE,
GIMP_ROTATE_DEGREES180, FALSE,
GIMP_HELP_IMAGE_ROTATE_180 },
{ "image-rotate-270", GIMP_ICON_OBJECT_ROTATE_270,
NC_("image-action", "Rotate 90° counter-clock_wise"), NULL,
NC_("image-action", "Rotate 90° counter-clock_wise"), NULL, { NULL },
NC_("image-action", "Rotate the image 90 degrees to the left"),
GIMP_ROTATE_270, FALSE,
GIMP_ROTATE_DEGREES270, FALSE,
GIMP_HELP_IMAGE_ROTATE_270 }
};
static const GimpRadioActionEntry image_softproof_intent_actions[] =
{
{ "image-softproof-intent-perceptual", NULL,
NC_("image-action", "_Perceptual"), NULL, { NULL },
NC_("image-action", "Soft-proofing rendering intent is perceptual"),
GIMP_COLOR_RENDERING_INTENT_PERCEPTUAL,
GIMP_HELP_VIEW_COLOR_MANAGEMENT },
{ "image-softproof-intent-relative-colorimetric", NULL,
NC_("image-action", "_Relative Colorimetric"), NULL, { NULL },
NC_("image-action", "Soft-proofing rendering intent is relative colorimetric"),
GIMP_COLOR_RENDERING_INTENT_RELATIVE_COLORIMETRIC,
GIMP_HELP_VIEW_COLOR_MANAGEMENT },
{ "image-softproof-intent-saturation", NULL,
NC_("image-action", "_Saturation"), NULL, { NULL },
NC_("image-action", "Soft-proofing rendering intent is saturation"),
GIMP_COLOR_RENDERING_INTENT_SATURATION,
GIMP_HELP_VIEW_COLOR_MANAGEMENT },
{ "image-softproof-intent-absolute-colorimetric", NULL,
NC_("image-action", "_Absolute Colorimetric"), NULL, { NULL },
NC_("image-action", "Soft-proofing rendering intent is absolute colorimetric"),
GIMP_COLOR_RENDERING_INTENT_ABSOLUTE_COLORIMETRIC,
GIMP_HELP_VIEW_COLOR_MANAGEMENT }
};
void
image_actions_setup (GimpActionGroup *group)
@@ -313,6 +332,13 @@ image_actions_setup (GimpActionGroup *group)
image_toggle_actions,
G_N_ELEMENTS (image_toggle_actions));
gimp_action_group_add_radio_actions (group, "image-action",
image_softproof_intent_actions,
G_N_ELEMENTS (image_softproof_intent_actions),
NULL,
GIMP_COLOR_MANAGEMENT_DISPLAY,
image_softproof_intent_cmd_callback);
gimp_action_group_add_radio_actions (group, "image-convert-action",
image_convert_base_type_actions,
G_N_ELEMENTS (image_convert_base_type_actions),
@@ -355,17 +381,18 @@ void
image_actions_update (GimpActionGroup *group,
gpointer data)
{
GimpImage *image = action_data_get_image (data);
gboolean is_indexed = FALSE;
gboolean is_u8_gamma = FALSE;
gboolean is_double = FALSE;
gboolean aux = FALSE;
gboolean lp = FALSE;
gboolean sel = FALSE;
gboolean groups = FALSE;
gboolean profile_srgb = FALSE;
gboolean profile_hidden = FALSE;
gboolean profile = FALSE;
GimpImage *image = action_data_get_image (data);
gboolean is_indexed = FALSE;
gboolean is_u8_gamma = FALSE;
gboolean is_double = FALSE;
gboolean aux = FALSE;
gboolean lp = FALSE;
gboolean sel = FALSE;
gboolean groups = FALSE;
gboolean profile_srgb = FALSE;
gboolean profile_hidden = FALSE;
gboolean profile = FALSE;
gboolean s_bpc = FALSE;
#define SET_LABEL(action,label) \
gimp_action_group_set_action_label (group, action, (label))
@@ -445,6 +472,29 @@ image_actions_update (GimpActionGroup *group,
profile_srgb = gimp_image_get_use_srgb_profile (image, &profile_hidden);
profile = (gimp_image_get_color_profile (image) != NULL);
switch (gimp_image_get_simulation_intent (image))
{
case GIMP_COLOR_RENDERING_INTENT_PERCEPTUAL:
action = "image-softproof-intent-perceptual";
break;
case GIMP_COLOR_RENDERING_INTENT_RELATIVE_COLORIMETRIC:
action = "image-softproof-intent-relative-colorimetric";
break;
case GIMP_COLOR_RENDERING_INTENT_SATURATION:
action = "image-softproof-intent-saturation";
break;
case GIMP_COLOR_RENDERING_INTENT_ABSOLUTE_COLORIMETRIC:
action = "image-softproof-intent-absolute-colorimetric";
break;
}
gimp_action_group_set_action_active (group, action, TRUE);
s_bpc = gimp_image_get_simulation_bpc (image);
}
else
{
@@ -472,6 +522,14 @@ image_actions_update (GimpActionGroup *group,
SET_SENSITIVE ("image-convert-grayscale", image);
SET_SENSITIVE ("image-convert-indexed", image && !groups && is_u8_gamma);
SET_SENSITIVE ("image-softproof-profile", image);
SET_SENSITIVE ("image-softproof-intent-perceptual", image);
SET_SENSITIVE ("image-softproof-intent-relative-colorimetric", image);
SET_SENSITIVE ("image-softproof-intent-saturation", image);
SET_SENSITIVE ("image-softproof-intent-absolute-colorimetric", image);
SET_SENSITIVE ("image-softproof-black-point-compensation", image);
SET_ACTIVE ("image-softproof-black-point-compensation", s_bpc);
SET_SENSITIVE ("image-convert-u8", image);
SET_SENSITIVE ("image-convert-u16", image && !is_indexed);
SET_SENSITIVE ("image-convert-u32", image && !is_indexed);

View File

@@ -22,6 +22,7 @@
#include "libgimpbase/gimpbase.h"
#include "libgimpcolor/gimpcolor.h"
#include "libgimpconfig/gimpconfig.h"
#include "libgimpwidgets/gimpwidgets.h"
#include "actions-types.h"
@@ -135,12 +136,12 @@ static void image_resize_callback (GtkWidget *dialog,
GimpContext *context,
gint width,
gint height,
GimpUnit unit,
GimpUnit *unit,
gint offset_x,
gint offset_y,
gdouble xres,
gdouble yres,
GimpUnit res_unit,
GimpUnit *res_unit,
GimpFillType fill_type,
GimpItemSet layer_set,
gboolean resize_text_layers,
@@ -150,18 +151,18 @@ static void image_print_size_callback (GtkWidget *dialog,
GimpImage *image,
gdouble xresolution,
gdouble yresolution,
GimpUnit resolution_unit,
GimpUnit *resolution_unit,
gpointer user_data);
static void image_scale_callback (GtkWidget *dialog,
GimpViewable *viewable,
gint width,
gint height,
GimpUnit unit,
GimpUnit *unit,
GimpInterpolationType interpolation,
gdouble xresolution,
gdouble yresolution,
GimpUnit resolution_unit,
GimpUnit *resolution_unit,
gpointer user_data);
static void image_merge_layers_callback (GtkWidget *dialog,
@@ -172,11 +173,20 @@ static void image_merge_layers_callback (GtkWidget *dialog,
gboolean discard_invisible,
gpointer user_data);
static void image_softproof_profile_callback (GtkWidget *dialog,
GimpImage *image,
GimpColorProfile *new_profile,
GFile *new_file,
GimpColorRenderingIntent intent,
gboolean bpc,
gpointer user_data);
/* private variables */
static GimpUnit image_resize_unit = GIMP_UNIT_PIXEL;
static GimpUnit image_scale_unit = GIMP_UNIT_PIXEL;
static GimpUnit *image_resize_unit = NULL;
static GimpUnit *image_scale_unit = NULL;
static GimpInterpolationType image_scale_interp = -1;
static GimpPalette *image_convert_indexed_custom_palette = NULL;
@@ -647,7 +657,7 @@ image_resize_cmd_callback (GimpAction *action,
{
GimpDialogConfig *config = GIMP_DIALOG_CONFIG (image->gimp->config);
if (image_resize_unit != GIMP_UNIT_PERCENT)
if (image_resize_unit != gimp_unit_percent ())
image_resize_unit = gimp_display_get_shell (display)->unit;
dialog = resize_dialog_new (GIMP_VIEWABLE (image),
@@ -776,7 +786,7 @@ image_scale_cmd_callback (GimpAction *action,
if (! dialog)
{
if (image_scale_unit != GIMP_UNIT_PERCENT)
if (image_scale_unit != gimp_unit_percent ())
image_scale_unit = gimp_display_get_shell (display)->unit;
if (image_scale_interp == -1)
@@ -1167,15 +1177,7 @@ image_convert_indexed_callback (GtkWidget *dialog,
"image-convert-indexed-dither-text-layers", dither_text_layers,
NULL);
if (image_convert_indexed_custom_palette)
g_object_remove_weak_pointer (G_OBJECT (image_convert_indexed_custom_palette),
(gpointer) &image_convert_indexed_custom_palette);
image_convert_indexed_custom_palette = custom_palette;
if (image_convert_indexed_custom_palette)
g_object_add_weak_pointer (G_OBJECT (image_convert_indexed_custom_palette),
(gpointer) &image_convert_indexed_custom_palette);
g_set_weak_pointer (&image_convert_indexed_custom_palette, custom_palette);
progress = gimp_progress_start (GIMP_PROGRESS (display), FALSE,
_("Converting to indexed colors"));
@@ -1362,12 +1364,12 @@ image_resize_callback (GtkWidget *dialog,
GimpContext *context,
gint width,
gint height,
GimpUnit unit,
GimpUnit *unit,
gint offset_x,
gint offset_y,
gdouble xres,
gdouble yres,
GimpUnit res_unit,
GimpUnit *res_unit,
GimpFillType fill_type,
GimpItemSet layer_set,
gboolean resize_text_layers,
@@ -1384,7 +1386,7 @@ image_resize_callback (GtkWidget *dialog,
GimpProgress *progress;
gdouble old_xres;
gdouble old_yres;
GimpUnit old_res_unit;
GimpUnit *old_res_unit;
gboolean update_resolution;
g_object_set (config,
@@ -1446,7 +1448,7 @@ image_print_size_callback (GtkWidget *dialog,
GimpImage *image,
gdouble xresolution,
gdouble yresolution,
GimpUnit resolution_unit,
GimpUnit *resolution_unit,
gpointer data)
{
gdouble xres;
@@ -1477,11 +1479,11 @@ image_scale_callback (GtkWidget *dialog,
GimpViewable *viewable,
gint width,
gint height,
GimpUnit unit,
GimpUnit *unit,
GimpInterpolationType interpolation,
gdouble xresolution,
gdouble yresolution,
GimpUnit resolution_unit,
GimpUnit *resolution_unit,
gpointer user_data)
{
GimpProgress *progress = user_data;
@@ -1563,3 +1565,101 @@ image_merge_layers_callback (GtkWidget *dialog,
g_clear_pointer (&dialog, gtk_widget_destroy);
}
void
image_softproof_profile_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data)
{
GimpImage *image;
GimpDisplayShell *shell;
GtkWidget *dialog;
return_if_no_image (image, data);
return_if_no_shell (shell, data);
#define SOFTPROOF_PROFILE_DIALOG_KEY "gimp-softproof-profile-dialog"
dialog = dialogs_get_dialog (G_OBJECT (shell), SOFTPROOF_PROFILE_DIALOG_KEY);
if (! dialog)
{
GimpColorProfile *current_profile;
current_profile = gimp_image_get_simulation_profile (image);
dialog = color_profile_dialog_new (COLOR_PROFILE_DIALOG_SELECT_SOFTPROOF_PROFILE,
image,
action_data_get_context (data),
GTK_WIDGET (shell),
current_profile,
NULL,
0, 0,
image_softproof_profile_callback,
shell);
dialogs_attach_dialog (G_OBJECT (shell),
SOFTPROOF_PROFILE_DIALOG_KEY, dialog);
}
gtk_window_present (GTK_WINDOW (dialog));
}
static void
image_softproof_profile_callback (GtkWidget *dialog,
GimpImage *image,
GimpColorProfile *new_profile,
GFile *new_file,
GimpColorRenderingIntent intent,
gboolean bpc,
gpointer user_data)
{
GimpDisplayShell *shell = user_data;
/* Update image's simulation profile */
gimp_image_set_simulation_profile (image, new_profile);
gimp_color_managed_simulation_profile_changed (GIMP_COLOR_MANAGED (shell));
gtk_widget_destroy (dialog);
}
void
image_softproof_intent_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data)
{
GimpImage *image;
GimpDisplayShell *shell;
GimpColorRenderingIntent intent;
return_if_no_image (image, data);
return_if_no_shell (shell, data);
intent = (GimpColorRenderingIntent) g_variant_get_int32 (value);
if (intent != gimp_image_get_simulation_intent (image))
{
gimp_image_set_simulation_intent (image, intent);
shell->color_config_set = TRUE;
gimp_color_managed_simulation_intent_changed (GIMP_COLOR_MANAGED (shell));
}
}
void
image_softproof_bpc_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data)
{
GimpImage *image;
GimpDisplayShell *shell;
gboolean bpc;
return_if_no_image (image, data);
return_if_no_shell (shell, data);
bpc = g_variant_get_boolean (value);
if (bpc != gimp_image_get_simulation_bpc (image))
{
gimp_image_set_simulation_bpc (image, bpc);
shell->color_config_set = TRUE;
gimp_color_managed_simulation_bpc_changed (GIMP_COLOR_MANAGED (shell));
}
}

View File

@@ -97,5 +97,14 @@ void image_properties_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data);
void image_softproof_profile_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data);
void image_softproof_intent_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data);
void image_softproof_bpc_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data);
#endif /* __IMAGE_COMMANDS_H__ */

View File

@@ -39,24 +39,20 @@
static const GimpActionEntry images_actions[] =
{
{ "images-popup", GIMP_ICON_DIALOG_IMAGES,
NC_("images-action", "Images Menu"), NULL, NULL, NULL,
GIMP_HELP_IMAGE_DIALOG },
{ "images-raise-views", GIMP_ICON_GO_TOP,
NC_("images-action", "_Raise Views"), NULL,
NC_("images-action", "_Raise Views"), NULL, { NULL },
NC_("images-action", "Raise this image's displays"),
images_raise_views_cmd_callback,
NULL },
{ "images-new-view", GIMP_ICON_DOCUMENT_NEW,
NC_("images-action", "_New View"), NULL,
NC_("images-action", "_New View"), NULL, { NULL },
NC_("images-action", "Create a new display for this image"),
images_new_view_cmd_callback,
NULL },
{ "images-delete", GIMP_ICON_EDIT_DELETE,
NC_("images-action", "_Delete Image"), NULL,
NC_("images-action", "_Delete Image"), NULL, { NULL },
NC_("images-action", "Delete this image"),
images_delete_image_cmd_callback,
NULL }

View File

@@ -20,6 +20,7 @@
#include <gegl.h>
#include <gtk/gtk.h>
#include "libgimpbase/gimpbase.h"
#include "libgimpwidgets/gimpwidgets.h"
#include "actions-types.h"
@@ -88,7 +89,7 @@ images_new_view_cmd_callback (GimpAction *action,
if (image && gimp_container_have (container, GIMP_OBJECT (image)))
{
gimp_create_display (image->gimp, image, GIMP_UNIT_PIXEL, 1.0,
gimp_create_display (image->gimp, image, gimp_unit_pixel (), 1.0,
G_OBJECT (gimp_widget_get_monitor (GTK_WIDGET (editor))));
}
}

View File

@@ -55,13 +55,11 @@ items_actions_setup (GimpActionGroup *group,
}
else
{
GimpRGB color;
GeglColor *color = gegl_color_new ("none");
gimp_action_group_set_action_context (group, action,
gimp_get_user_context (group->gimp));
gimp_get_color_tag_color (value->value, &color, FALSE);
gimp_action_group_set_action_color (group, action, &color, FALSE);
gimp_get_color_tag_color (value->value, color, FALSE);
gimp_action_group_set_action_color (group, action, color, FALSE);
g_object_unref (color);
}
}
@@ -76,14 +74,14 @@ items_actions_update (GimpActionGroup *group,
GEnumClass *enum_class;
GEnumValue *value;
gchar action[32];
gboolean visible = FALSE;
gboolean has_color_tag = FALSE;
gboolean visible = FALSE;
gboolean has_color_tag = FALSE;
gboolean lock_content = TRUE;
gboolean can_lock_content = FALSE;
gboolean lock_position = TRUE;
gboolean can_lock_position = FALSE;
GimpRGB tag_color;
GList *iter;
GeglColor *tag_color = gegl_color_new ("none");
GList *iter;
for (iter = items; iter; iter = iter->next)
{
@@ -115,15 +113,14 @@ items_actions_update (GimpActionGroup *group,
has_color_tag = (has_color_tag ||
gimp_get_color_tag_color (gimp_item_get_color_tag (item),
&tag_color, FALSE));
tag_color, FALSE));
}
g_object_unref (tag_color);
#define SET_SENSITIVE(action,condition) \
gimp_action_group_set_action_sensitive (group, action, (condition) != 0, NULL)
#define SET_ACTIVE(action,condition) \
gimp_action_group_set_action_active (group, action, (condition) != 0)
#define SET_COLOR(action,color) \
gimp_action_group_set_action_color (group, action, color, FALSE)
g_snprintf (action, sizeof (action), "%s-visible", prefix);
SET_SENSITIVE (action, items);
@@ -137,9 +134,6 @@ items_actions_update (GimpActionGroup *group,
SET_SENSITIVE (action, can_lock_position);
SET_ACTIVE (action, lock_position);
g_snprintf (action, sizeof (action), "%s-color-tag-menu", prefix);
SET_COLOR (action, has_color_tag ? &tag_color : NULL);
enum_class = g_type_class_ref (GIMP_TYPE_COLOR_TAG);
for (value = enum_class->values; value->value_name; value++)
@@ -154,5 +148,4 @@ items_actions_update (GimpActionGroup *group,
#undef SET_SENSITIVE
#undef SET_ACTIVE
#undef SET_COLOR
}

View File

@@ -46,13 +46,13 @@
/* local function prototypes */
static void items_fill_callback (GtkWidget *dialog,
GimpItem *item,
GList *items,
GList *drawables,
GimpContext *context,
GimpFillOptions *options,
gpointer user_data);
static void items_stroke_callback (GtkWidget *dialog,
GimpItem *item,
GList *items,
GList *drawables,
GimpContext *context,
GimpStrokeOptions *options,
@@ -65,102 +65,198 @@ void
items_visible_cmd_callback (GimpAction *action,
GVariant *value,
GimpImage *image,
GimpItem *item)
GList *items)
{
gboolean visible = g_variant_get_boolean (value);
GimpUndo *undo;
gboolean push_undo = TRUE;
GList *start = NULL;
GList *iter;
gboolean visible = g_variant_get_boolean (value);
gint n_items = 0;
if (visible != gimp_item_get_visible (item))
for (iter = items; iter; iter = iter->next)
{
GimpUndo *undo;
gboolean push_undo = TRUE;
if (visible && gimp_item_get_visible (iter->data))
{
/* If any of the items are already visible, we don't
* toggle the selection visibility.
*/
return;
}
}
for (iter = items; iter; iter = iter->next)
if (visible != gimp_item_get_visible (iter->data))
{
if (start == NULL)
start = iter;
n_items++;
}
if (n_items == 0)
{
return;
}
else if (n_items == 1)
{
undo = gimp_image_undo_can_compress (image, GIMP_TYPE_ITEM_UNDO,
GIMP_UNDO_ITEM_VISIBILITY);
if (undo && GIMP_ITEM_UNDO (undo)->item == item)
if (undo && GIMP_ITEM_UNDO (undo)->item == GIMP_ITEM (start->data))
push_undo = FALSE;
gimp_item_set_visible (item, visible, push_undo);
gimp_image_flush (image);
}
else
{
/* TODO: undo groups cannot be compressed so far. */
gimp_image_undo_group_start (image,
GIMP_UNDO_GROUP_ITEM_VISIBILITY,
"Item visibility");
}
for (iter = start; iter; iter = iter->next)
if (visible != gimp_item_get_visible (iter->data))
gimp_item_set_visible (iter->data, visible, push_undo);
if (n_items != 1)
gimp_image_undo_group_end (image);
gimp_image_flush (image);
}
void
items_lock_content_cmd_callback (GimpAction *action,
GVariant *value,
GimpImage *image,
GimpItem *item)
GList *items)
{
gboolean locked = g_variant_get_boolean (value);
GList *locked_items = NULL;
GList *iter;
gchar *undo_label;
gboolean locked = g_variant_get_boolean (value);
if (locked != gimp_item_get_lock_content (item))
{
GimpUndo *undo;
gboolean push_undo = TRUE;
for (iter = items; iter; iter = iter->next)
if (gimp_item_can_lock_content (iter->data))
{
if (! locked && ! gimp_item_get_lock_content (iter->data))
{
/* When unlocking, we expect all selected items to be locked. */
g_list_free (locked_items);
return;
}
else if (locked != gimp_item_get_lock_content (iter->data))
{
locked_items = g_list_prepend (locked_items, iter->data);
}
}
undo = gimp_image_undo_can_compress (image, GIMP_TYPE_ITEM_UNDO,
GIMP_UNDO_ITEM_LOCK_CONTENT);
if (! locked_items)
return;
if (undo && GIMP_ITEM_UNDO (undo)->item == item)
push_undo = FALSE;
if (locked)
undo_label = _("Lock content");
else
undo_label = _("Unlock content");
gimp_item_set_lock_content (item, locked, push_undo);
gimp_image_flush (image);
}
gimp_image_undo_group_start (image,
GIMP_UNDO_GROUP_ITEM_LOCK_CONTENTS,
undo_label);
for (iter = locked_items; iter; iter = iter->next)
gimp_item_set_lock_content (iter->data, locked, TRUE);
gimp_image_flush (image);
gimp_image_undo_group_end (image);
g_list_free (locked_items);
}
void
items_lock_position_cmd_callback (GimpAction *action,
GVariant *value,
GimpImage *image,
GimpItem *item)
GList *items)
{
gboolean locked = g_variant_get_boolean (value);
GList *iter;
GList *locked_items = NULL;
gchar *undo_label;
gboolean locked = g_variant_get_boolean (value);
if (locked != gimp_item_get_lock_position (item))
{
GimpUndo *undo;
gboolean push_undo = TRUE;
for (iter = items; iter; iter = iter->next)
if (gimp_item_can_lock_position (iter->data))
{
if (! locked && ! gimp_item_get_lock_position (iter->data))
{
/* When unlocking, we expect all selected items to be locked. */
g_list_free (locked_items);
return;
}
else if (locked != gimp_item_get_lock_position (iter->data))
{
locked_items = g_list_prepend (locked_items, iter->data);
}
}
undo = gimp_image_undo_can_compress (image, GIMP_TYPE_ITEM_UNDO,
GIMP_UNDO_ITEM_LOCK_POSITION);
if (! locked_items)
return;
if (undo && GIMP_ITEM_UNDO (undo)->item == item)
push_undo = FALSE;
if (locked)
undo_label = _("Lock position");
else
undo_label = _("Unlock position");
gimp_image_undo_group_start (image,
GIMP_UNDO_GROUP_ITEM_LOCK_POSITION,
undo_label);
gimp_item_set_lock_position (item, locked, push_undo);
gimp_image_flush (image);
}
for (iter = locked_items; iter; iter = iter->next)
gimp_item_set_lock_position (iter->data, locked, TRUE);
gimp_image_flush (image);
gimp_image_undo_group_end (image);
g_list_free (locked_items);
}
void
items_color_tag_cmd_callback (GimpAction *action,
GimpImage *image,
GimpItem *item,
GList *items,
GimpColorTag color_tag)
{
if (color_tag != gimp_item_get_color_tag (item))
{
GimpUndo *undo;
gboolean push_undo = TRUE;
GimpUndo *undo;
gboolean push_undo = TRUE;
GList *iter;
if (g_list_length (items) == 1)
{
undo = gimp_image_undo_can_compress (image, GIMP_TYPE_ITEM_UNDO,
GIMP_UNDO_ITEM_COLOR_TAG);
if (undo && GIMP_ITEM_UNDO (undo)->item == item)
if (undo && GIMP_ITEM_UNDO (undo)->item == GIMP_ITEM (items->data))
push_undo = FALSE;
gimp_item_set_color_tag (item, color_tag, push_undo);
gimp_image_flush (image);
}
else
{
/* TODO: undo groups cannot be compressed so far. */
gimp_image_undo_group_start (image,
GIMP_UNDO_GROUP_ITEM_PROPERTIES,
"Item color tag");
}
for (iter = items; iter; iter = iter->next)
if (color_tag != gimp_item_get_color_tag (iter->data))
gimp_item_set_color_tag (iter->data, color_tag, push_undo);
if (g_list_length (items) != 1)
gimp_image_undo_group_end (image);
gimp_image_flush (image);
}
void
items_fill_cmd_callback (GimpAction *action,
GimpImage *image,
GimpItem *item,
const gchar *dialog_key,
GList *items,
const gchar *dialog_title,
const gchar *dialog_icon_name,
const gchar *dialog_help_id,
@@ -177,29 +273,20 @@ items_fill_cmd_callback (GimpAction *action,
{
gimp_message_literal (image->gimp,
G_OBJECT (widget), GIMP_MESSAGE_WARNING,
_("There are no selected layers or channels to fill."));
_("There are no selected items to fill."));
return;
}
dialog = dialogs_get_dialog (G_OBJECT (item), dialog_key);
if (! dialog)
{
GimpDialogConfig *config = GIMP_DIALOG_CONFIG (image->gimp->config);
dialog = fill_dialog_new (item,
drawables,
action_data_get_context (data),
dialog_title,
dialog_icon_name,
dialog_help_id,
widget,
config->fill_options,
items_fill_callback,
NULL);
dialogs_attach_dialog (G_OBJECT (item), dialog_key, dialog);
}
dialog = fill_dialog_new (items,
drawables,
action_data_get_context (data),
dialog_title,
dialog_icon_name,
dialog_help_id,
widget,
GIMP_DIALOG_CONFIG (image->gimp->config)->fill_options,
items_fill_callback,
NULL);
gtk_window_present (GTK_WINDOW (dialog));
g_list_free (drawables);
@@ -208,7 +295,7 @@ items_fill_cmd_callback (GimpAction *action,
void
items_fill_last_vals_cmd_callback (GimpAction *action,
GimpImage *image,
GimpItem *item,
GList *items,
gpointer data)
{
GList *drawables;
@@ -229,25 +316,29 @@ items_fill_last_vals_cmd_callback (GimpAction *action,
config = GIMP_DIALOG_CONFIG (image->gimp->config);
if (! gimp_item_fill (item, drawables,
config->fill_options, TRUE, NULL, &error))
{
gimp_message_literal (image->gimp, G_OBJECT (widget),
GIMP_MESSAGE_WARNING, error->message);
g_clear_error (&error);
}
else
{
gimp_image_flush (image);
}
gimp_image_undo_group_start (image,
GIMP_UNDO_GROUP_DRAWABLE_MOD,
"Fill");
for (GList *iter = items; iter; iter = iter->next)
if (! gimp_item_fill (iter->data, drawables,
config->fill_options, TRUE, NULL, &error))
{
gimp_message_literal (image->gimp, G_OBJECT (widget),
GIMP_MESSAGE_WARNING, error->message);
g_clear_error (&error);
break;
}
gimp_image_undo_group_end (image);
gimp_image_flush (image);
g_list_free (drawables);
}
void
items_stroke_cmd_callback (GimpAction *action,
GimpImage *image,
GimpItem *item,
const gchar *dialog_key,
GList *items,
const gchar *dialog_title,
const gchar *dialog_icon_name,
const gchar *dialog_help_id,
@@ -268,25 +359,17 @@ items_stroke_cmd_callback (GimpAction *action,
return;
}
dialog = dialogs_get_dialog (G_OBJECT (item), dialog_key);
if (! dialog)
{
GimpDialogConfig *config = GIMP_DIALOG_CONFIG (image->gimp->config);
dialog = stroke_dialog_new (item,
drawables,
action_data_get_context (data),
dialog_title,
dialog_icon_name,
dialog_help_id,
widget,
config->stroke_options,
items_stroke_callback,
NULL);
dialogs_attach_dialog (G_OBJECT (item), dialog_key, dialog);
}
dialog = stroke_dialog_new (items,
drawables,
action_data_get_context (data),
dialog_title,
dialog_icon_name,
dialog_help_id,
widget,
GIMP_DIALOG_CONFIG (image->gimp->config)->stroke_options,
items_stroke_callback,
NULL);
gtk_window_present (GTK_WINDOW (dialog));
g_list_free (drawables);
@@ -295,7 +378,7 @@ items_stroke_cmd_callback (GimpAction *action,
void
items_stroke_last_vals_cmd_callback (GimpAction *action,
GimpImage *image,
GimpItem *item,
GList *items,
gpointer data)
{
GList *drawables;
@@ -316,20 +399,24 @@ items_stroke_last_vals_cmd_callback (GimpAction *action,
config = GIMP_DIALOG_CONFIG (image->gimp->config);
if (! gimp_item_stroke (item, drawables,
action_data_get_context (data),
config->stroke_options, NULL,
TRUE, NULL, &error))
{
gimp_message_literal (image->gimp, G_OBJECT (widget),
GIMP_MESSAGE_WARNING, error->message);
g_clear_error (&error);
}
else
{
gimp_image_flush (image);
}
gimp_image_undo_group_start (image,
GIMP_UNDO_GROUP_DRAWABLE_MOD,
"Stroke");
for (GList *iter = items; iter; iter = iter->next)
if (! gimp_item_stroke (iter->data, drawables,
action_data_get_context (data),
config->stroke_options, NULL,
TRUE, NULL, &error))
{
gimp_message_literal (image->gimp, G_OBJECT (widget),
GIMP_MESSAGE_WARNING, error->message);
g_clear_error (&error);
break;
}
gimp_image_undo_group_end (image);
gimp_image_flush (image);
g_list_free (drawables);
}
@@ -338,30 +425,36 @@ items_stroke_last_vals_cmd_callback (GimpAction *action,
static void
items_fill_callback (GtkWidget *dialog,
GimpItem *item,
GList *items,
GList *drawables,
GimpContext *context,
GimpFillOptions *options,
gpointer user_data)
{
GimpDialogConfig *config = GIMP_DIALOG_CONFIG (context->gimp->config);
GimpImage *image = gimp_item_get_image (item);
GimpImage *image = gimp_item_get_image (items->data);
GError *error = NULL;
gimp_config_sync (G_OBJECT (options),
G_OBJECT (config->fill_options), 0);
if (! gimp_item_fill (item, drawables, options, TRUE, NULL, &error))
{
gimp_message_literal (context->gimp,
G_OBJECT (dialog),
GIMP_MESSAGE_WARNING,
error ? error->message : "NULL");
gimp_image_undo_group_start (image,
GIMP_UNDO_GROUP_DRAWABLE_MOD,
"Fill");
g_clear_error (&error);
return;
}
for (GList *iter = items; iter; iter = iter->next)
if (! gimp_item_fill (iter->data, drawables, options, TRUE, NULL, &error))
{
gimp_message_literal (context->gimp,
G_OBJECT (dialog),
GIMP_MESSAGE_WARNING,
error ? error->message : "NULL");
g_clear_error (&error);
break;
}
gimp_image_undo_group_end (image);
gimp_image_flush (image);
gtk_widget_destroy (dialog);
@@ -369,31 +462,37 @@ items_fill_callback (GtkWidget *dialog,
static void
items_stroke_callback (GtkWidget *dialog,
GimpItem *item,
GList *items,
GList *drawables,
GimpContext *context,
GimpStrokeOptions *options,
gpointer data)
{
GimpDialogConfig *config = GIMP_DIALOG_CONFIG (context->gimp->config);
GimpImage *image = gimp_item_get_image (item);
GimpImage *image = gimp_item_get_image (items->data);
GError *error = NULL;
gimp_config_sync (G_OBJECT (options),
G_OBJECT (config->stroke_options), 0);
if (! gimp_item_stroke (item, drawables, context, options, NULL,
TRUE, NULL, &error))
{
gimp_message_literal (context->gimp,
G_OBJECT (dialog),
GIMP_MESSAGE_WARNING,
error ? error->message : "NULL");
gimp_image_undo_group_start (image,
GIMP_UNDO_GROUP_DRAWABLE_MOD,
"Stroke");
g_clear_error (&error);
return;
}
for (GList *iter = items; iter; iter = iter->next)
if (! gimp_item_stroke (iter->data, drawables, context, options, NULL,
TRUE, NULL, &error))
{
gimp_message_literal (context->gimp,
G_OBJECT (dialog),
GIMP_MESSAGE_WARNING,
error ? error->message : "NULL");
g_clear_error (&error);
break;
}
gimp_image_undo_group_end (image);
gimp_image_flush (image);
gtk_widget_destroy (dialog);

View File

@@ -22,45 +22,43 @@
void items_visible_cmd_callback (GimpAction *action,
GVariant *value,
GimpImage *image,
GimpItem *item);
GList *items);
void items_lock_content_cmd_callback (GimpAction *action,
GVariant *value,
GimpImage *image,
GimpItem *item);
GList *items);
void items_lock_position_cmd_callback (GimpAction *action,
GVariant *value,
GimpImage *image,
GimpItem *item);
GList *items);
void items_color_tag_cmd_callback (GimpAction *action,
GimpImage *image,
GimpItem *item,
GList *items,
GimpColorTag color_tag);
void items_fill_cmd_callback (GimpAction *action,
GimpImage *image,
GimpItem *item,
const gchar *dialog_key,
GList *items,
const gchar *dialog_title,
const gchar *dialog_icon_name,
const gchar *dialog_help_id,
gpointer data);
void items_fill_last_vals_cmd_callback (GimpAction *action,
GimpImage *image,
GimpItem *item,
GList *items,
gpointer data);
void items_stroke_cmd_callback (GimpAction *action,
GimpImage *image,
GimpItem *item,
const gchar *dialog_key,
GList *items,
const gchar *dialog_title,
const gchar *dialog_icon_name,
const gchar *dialog_help_id,
gpointer data);
void items_stroke_last_vals_cmd_callback (GimpAction *action,
GimpImage *image,
GimpItem *item,
GList *items,
gpointer data);

View File

@@ -48,131 +48,94 @@
static const GimpActionEntry layers_actions[] =
{
{ "layers-popup", GIMP_ICON_DIALOG_LAYERS,
NC_("layers-action", "Layers Menu"), NULL, NULL, NULL,
GIMP_HELP_LAYER_DIALOG },
{ "layers-blend-space-menu", NULL,
NC_("layers-action", "Blend Space"), NULL, NULL, NULL,
NULL },
{ "layers-composite-space-menu", NULL,
NC_("layers-action", "Composite Space"), NULL, NULL, NULL,
NULL },
{ "layers-composite-mode-menu", NULL,
NC_("layers-action", "Composite Mode"), NULL, NULL, NULL,
NULL },
{ "layers-color-tag-menu", NULL,
NC_("layers-action", "Color Tag"), NULL, NULL, NULL,
GIMP_HELP_LAYER_COLOR_TAG },
{ "layers-menu", NULL,
NC_("layers-action", "_Layer") },
{ "layers-stack-menu", NULL,
NC_("layers-action", "Stac_k") },
{ "layers-mask-menu", NULL,
NC_("layers-action", "_Mask") },
{ "layers-transparency-menu", NULL,
NC_("layers-action", "Tr_ansparency") },
{ "layers-transform-menu", NULL,
NC_("layers-action", "_Transform") },
{ "layers-properties-menu", GIMP_ICON_DOCUMENT_PROPERTIES,
NC_("layers-action", "_Properties") },
{ "layers-opacity-menu", GIMP_ICON_TRANSPARENCY,
NC_("layers-action", "_Opacity") },
{ "layers-mode-menu", GIMP_ICON_TOOL_PENCIL,
NC_("layers-action", "Layer _Mode") },
{ "layers-edit", GIMP_ICON_EDIT,
NC_("layers-action", "Default Edit Action"), NULL,
NC_("layers-action", "Default Edit Action"), NULL, { NULL },
NC_("layers-action", "Activate the default edit action for this type of layer"),
layers_edit_cmd_callback,
GIMP_HELP_LAYER_EDIT },
{ "layers-edit-text", GIMP_ICON_EDIT,
NC_("layers-action", "Edit Te_xt on canvas"), NULL,
NC_("layers-action", "Edit Te_xt on canvas"), NULL, { NULL },
NC_("layers-action", "Edit this text layer content on canvas"),
layers_edit_text_cmd_callback,
GIMP_HELP_LAYER_EDIT },
{ "layers-edit-attributes", GIMP_ICON_EDIT,
NC_("layers-action", "_Edit Layer Attributes..."), NULL,
NC_("layers-action", "_Edit Layer Attributes..."), NULL, { NULL },
NC_("layers-action", "Edit the layer's name"),
layers_edit_attributes_cmd_callback,
GIMP_HELP_LAYER_EDIT },
{ "layers-new", GIMP_ICON_DOCUMENT_NEW,
NC_("layers-action", "_New Layer..."), "<primary><shift>N",
NC_("layers-action", "_New Layer..."), NULL, { "<primary><shift>N", NULL },
NC_("layers-action", "Create a new layer and add it to the image"),
layers_new_cmd_callback,
GIMP_HELP_LAYER_NEW },
{ "layers-new-last-values", GIMP_ICON_DOCUMENT_NEW,
NC_("layers-action", "_New Layer"), NULL,
NC_("layers-action", "_New Layer"), NULL, { NULL },
NC_("layers-action", "Create new layers with last used values"),
layers_new_last_vals_cmd_callback,
GIMP_HELP_LAYER_NEW },
{ "layers-new-from-visible", NULL,
NC_("layers-action", "New from _Visible"), NULL,
NC_("layers-action", "New from _Visible"), NULL, { NULL },
NC_("layers-action",
"Create a new layer from what is visible in this image"),
layers_new_from_visible_cmd_callback,
GIMP_HELP_LAYER_NEW_FROM_VISIBLE },
{ "layers-new-group", GIMP_ICON_FOLDER_NEW,
NC_("layers-action", "New Layer _Group"), NULL,
NC_("layers-action", "New Layer _Group"), NULL, { NULL },
NC_("layers-action", "Create a new layer group and add it to the image"),
layers_new_group_cmd_callback,
GIMP_HELP_LAYER_NEW },
{ "layers-duplicate", GIMP_ICON_OBJECT_DUPLICATE,
NC_("layers-action", "D_uplicate Layer"), "<primary><shift>D",
NC_("layers-action", "D_uplicate Layers"), NULL, { "<primary><shift>D", NULL },
NC_("layers-action",
"Create duplicates of selected layers and add them to the image"),
layers_duplicate_cmd_callback,
GIMP_HELP_LAYER_DUPLICATE },
{ "layers-delete", GIMP_ICON_EDIT_DELETE,
NC_("layers-action", "_Delete Layers"), NULL,
NC_("layers-action", "_Delete Layers"), NULL, { NULL },
NC_("layers-action", "Delete selected layers"),
layers_delete_cmd_callback,
GIMP_HELP_LAYER_DELETE },
{ "layers-raise", GIMP_ICON_GO_UP,
NC_("layers-action", "_Raise Layer"), NULL,
NC_("layers-action", "Raise this layer one step in the layer stack"),
NC_("layers-action", "_Raise Layers"), NULL, { NULL },
NC_("layers-action", "Raise the selected layers one step in the layer stack"),
layers_raise_cmd_callback,
GIMP_HELP_LAYER_RAISE },
{ "layers-raise-to-top", GIMP_ICON_GO_TOP,
NC_("layers-action", "Layer to _Top"), NULL,
NC_("layers-action", "Move this layer to the top of the layer stack"),
NC_("layers-action", "Layers to _Top"), NULL, { NULL },
NC_("layers-action", "Move the selected layers to the top of the layer stack"),
layers_raise_to_top_cmd_callback,
GIMP_HELP_LAYER_RAISE_TO_TOP },
{ "layers-lower", GIMP_ICON_GO_DOWN,
NC_("layers-action", "_Lower Layer"), NULL,
NC_("layers-action", "Lower this layer one step in the layer stack"),
NC_("layers-action", "_Lower Layers"), NULL, { NULL },
NC_("layers-action", "Lower the selected layers one step in the layer stack"),
layers_lower_cmd_callback,
GIMP_HELP_LAYER_LOWER },
{ "layers-lower-to-bottom", GIMP_ICON_GO_BOTTOM,
NC_("layers-action", "Layer to _Bottom"), NULL,
NC_("layers-action", "Move this layer to the bottom of the layer stack"),
NC_("layers-action", "Layers to _Bottom"), NULL, { NULL },
NC_("layers-action", "Move the selected layers to the bottom of the layer stack"),
layers_lower_to_bottom_cmd_callback,
GIMP_HELP_LAYER_LOWER_TO_BOTTOM },
{ "layers-anchor", GIMP_ICON_LAYER_ANCHOR,
NC_("layers-action", "_Anchor Layer"), "<primary>H",
NC_("layers-action", "Anchor the floating layer"),
NC_("layers-action", "_Anchor Floating Layer or Mask"), NULL, { "<primary>H", NULL },
NC_("layers-action", "Anchor the floating layer or mask"),
layers_anchor_cmd_callback,
GIMP_HELP_LAYER_ANCHOR },
{ "layers-merge-down", GIMP_ICON_LAYER_MERGE_DOWN,
NC_("layers-action", "Merge Do_wn"), NULL,
NC_("layers-action", "Merge Do_wn"), NULL, { NULL },
NC_("layers-action", "Merge these layers with the first visible layer below each"),
layers_merge_down_cmd_callback,
GIMP_HELP_LAYER_MERGE_DOWN },
@@ -181,85 +144,85 @@ static const GimpActionEntry layers_actions[] =
* the layer can't be merged down
*/
{ "layers-merge-down-button", GIMP_ICON_LAYER_MERGE_DOWN,
NC_("layers-action", "Merge Do_wn"), NULL,
NC_("layers-action", "Merge Do_wn"), NULL, { NULL },
NC_("layers-action", "Merge these layers with the first visible layer below each"),
layers_merge_down_cmd_callback,
GIMP_HELP_LAYER_MERGE_DOWN },
{ "layers-merge-group", NULL,
NC_("layers-action", "Merge Layer Groups"), NULL,
NC_("layers-action", "Merge Layer Groups"), NULL, { NULL },
NC_("layers-action", "Merge the layer groups' layers into one normal layer"),
layers_merge_group_cmd_callback,
GIMP_HELP_LAYER_MERGE_GROUP },
{ "layers-merge-layers", NULL,
NC_("layers-action", "Merge _Visible Layers..."), NULL,
NC_("layers-action", "Merge _Visible Layers..."), NULL, { NULL },
NC_("layers-action", "Merge all visible layers into one layer"),
image_merge_layers_cmd_callback,
GIMP_HELP_IMAGE_MERGE_LAYERS },
{ "layers-merge-layers-last-values", NULL,
NC_("layers-action", "Merge _Visible Layers"), NULL,
NC_("layers-action", "Merge _Visible Layers"), NULL, { NULL },
NC_("layers-action", "Merge all visible layers with last used values"),
image_merge_layers_last_vals_cmd_callback,
GIMP_HELP_IMAGE_MERGE_LAYERS },
{ "layers-flatten-image", NULL,
NC_("layers-action", "_Flatten Image"), NULL,
NC_("layers-action", "_Flatten Image"), NULL, { NULL },
NC_("layers-action", "Merge all layers into one and remove transparency"),
image_flatten_image_cmd_callback,
GIMP_HELP_IMAGE_FLATTEN },
{ "layers-text-discard", GIMP_ICON_TOOL_TEXT,
NC_("layers-action", "_Discard Text Information"), NULL,
NC_("layers-action", "Turn this text layer into a normal layer"),
NC_("layers-action", "_Discard Text Information"), NULL, { NULL },
NC_("layers-action", "Turn these text layers into normal layers"),
layers_text_discard_cmd_callback,
GIMP_HELP_LAYER_TEXT_DISCARD },
{ "layers-text-to-vectors", GIMP_ICON_TOOL_TEXT,
NC_("layers-action", "Text to _Path"), NULL,
NC_("layers-action", "Create a path from this text layer"),
NC_("layers-action", "Text to _Path"), NULL, { NULL },
NC_("layers-action", "Create paths from text layers"),
layers_text_to_vectors_cmd_callback,
GIMP_HELP_LAYER_TEXT_TO_PATH },
{ "layers-text-along-vectors", GIMP_ICON_TOOL_TEXT,
NC_("layers-action", "Text alon_g Path"), NULL,
NC_("layers-action", "Text alon_g Path"), NULL, { NULL },
NC_("layers-action", "Warp this layer's text along the current path"),
layers_text_along_vectors_cmd_callback,
GIMP_HELP_LAYER_TEXT_ALONG_PATH },
{ "layers-resize", GIMP_ICON_OBJECT_RESIZE,
NC_("layers-action", "Layer B_oundary Size..."), NULL,
NC_("layers-action", "Layer B_oundary Size..."), NULL, { NULL },
NC_("layers-action", "Adjust the layer dimensions"),
layers_resize_cmd_callback,
GIMP_HELP_LAYER_RESIZE },
{ "layers-resize-to-image", GIMP_ICON_LAYER_TO_IMAGESIZE,
NC_("layers-action", "Layers to _Image Size"), NULL,
NC_("layers-action", "Layers to _Image Size"), NULL, { NULL },
NC_("layers-action", "Resize the layers to the size of the image"),
layers_resize_to_image_cmd_callback,
GIMP_HELP_LAYER_RESIZE_TO_IMAGE },
{ "layers-scale", GIMP_ICON_OBJECT_SCALE,
NC_("layers-action", "_Scale Layer..."), NULL,
NC_("layers-action", "_Scale Layer..."), NULL, { NULL },
NC_("layers-action", "Change the size of the layer content"),
layers_scale_cmd_callback,
GIMP_HELP_LAYER_SCALE },
{ "layers-crop-to-selection", GIMP_ICON_TOOL_CROP,
NC_("layers-action", "_Crop to Selection"), NULL,
NC_("layers-action", "Crop the layers to the extents of the selection"),
NC_("layers-action", "_Resize Layers to Selection"), NULL, { NULL },
NC_("layers-action", "Resize the layers to the extents of the selection"),
layers_crop_to_selection_cmd_callback,
GIMP_HELP_LAYER_CROP },
GIMP_HELP_LAYER_RESIZE_TO_SELECTION },
{ "layers-crop-to-content", GIMP_ICON_TOOL_CROP,
NC_("layers-action", "Crop to C_ontent"), NULL,
NC_("layers-action", "Crop Layers to C_ontent"), NULL, { NULL },
NC_("layers-action", "Crop the layers to the extents of their content (remove empty borders from the layer)"),
layers_crop_to_content_cmd_callback,
GIMP_HELP_LAYER_CROP },
GIMP_HELP_LAYER_CROP_TO_CONTENT },
{ "layers-mask-add", GIMP_ICON_LAYER_MASK,
NC_("layers-action", "Add La_yer Masks..."), NULL,
NC_("layers-action", "Add La_yer Masks..."), NULL, { NULL },
NC_("layers-action",
"Add masks to selected layers that allows non-destructive editing of transparency"),
layers_mask_add_cmd_callback,
@@ -269,27 +232,27 @@ static const GimpActionEntry layers_actions[] =
* there is a mask on the layer
*/
{ "layers-mask-add-button", GIMP_ICON_LAYER_MASK,
NC_("layers-action", "Add La_yer Masks..."), NULL,
NC_("layers-action", "Add La_yer Masks..."), NULL, { NULL },
NC_("layers-action",
"Add masks to selected layers that allows non-destructive editing of transparency"),
layers_mask_add_cmd_callback,
GIMP_HELP_LAYER_MASK_ADD },
{ "layers-mask-add-last-values", GIMP_ICON_LAYER_MASK,
NC_("layers-action", "Add La_yer Masks"), NULL,
NC_("layers-action", "Add La_yer Masks with Last Values"), NULL, { NULL },
NC_("layers-action",
"Add mask to selected layers with last used values"),
layers_mask_add_last_vals_cmd_callback,
GIMP_HELP_LAYER_MASK_ADD },
{ "layers-alpha-add", GIMP_ICON_TRANSPARENCY,
NC_("layers-action", "Add Alpha C_hannel"), NULL,
NC_("layers-action", "Add Alpha C_hannel"), NULL, { NULL },
NC_("layers-action", "Add transparency information to the layer"),
layers_alpha_add_cmd_callback,
GIMP_HELP_LAYER_ALPHA_ADD },
{ "layers-alpha-remove", NULL,
NC_("layers-action", "_Remove Alpha Channel"), NULL,
NC_("layers-action", "_Remove Alpha Channel"), NULL, { NULL },
NC_("layers-action", "Remove transparency information from the layer"),
layers_alpha_remove_cmd_callback,
GIMP_HELP_LAYER_ALPHA_REMOVE }
@@ -298,45 +261,45 @@ static const GimpActionEntry layers_actions[] =
static const GimpToggleActionEntry layers_toggle_actions[] =
{
{ "layers-mask-edit", GIMP_ICON_EDIT,
NC_("layers-action", "_Edit Layer Mask"), NULL,
NC_("layers-action", "_Edit Layer Mask"), NULL, { NULL },
NC_("layers-action", "Work on the layer mask"),
layers_mask_edit_cmd_callback,
FALSE,
GIMP_HELP_LAYER_MASK_EDIT },
{ "layers-mask-show", GIMP_ICON_VISIBLE,
NC_("layers-action", "S_how Layer Masks"), NULL, NULL,
NC_("layers-action", "S_how Layer Masks"), NULL, { NULL }, NULL,
layers_mask_show_cmd_callback,
FALSE,
GIMP_HELP_LAYER_MASK_SHOW },
{ "layers-mask-disable", NULL,
NC_("layers-action", "_Disable Layer Masks"), NULL,
NC_("layers-action", "Dismiss the effect of the layer mask"),
NC_("layers-action", "_Disable Layer Masks"), NULL, { NULL },
NC_("layers-action", "Dismiss the effect of the layer masks"),
layers_mask_disable_cmd_callback,
FALSE,
GIMP_HELP_LAYER_MASK_DISABLE },
{ "layers-visible", GIMP_ICON_VISIBLE,
NC_("layers-action", "Toggle Layer _Visibility"), NULL, NULL,
NC_("layers-action", "Toggle Layer _Visibility"), NULL, { NULL }, NULL,
layers_visible_cmd_callback,
FALSE,
GIMP_HELP_LAYER_VISIBLE },
{ "layers-lock-content", GIMP_ICON_LOCK_CONTENT,
NC_("layers-action", "L_ock Pixels of Layer"), NULL, NULL,
NC_("layers-action", "L_ock Pixels of Layer"), NULL, { NULL }, NULL,
layers_lock_content_cmd_callback,
FALSE,
GIMP_HELP_LAYER_LOCK_PIXELS },
{ "layers-lock-position", GIMP_ICON_LOCK_POSITION,
NC_("layers-action", "L_ock Position of Layer"), NULL, NULL,
NC_("layers-action", "L_ock Position of Layer"), NULL, { NULL }, NULL,
layers_lock_position_cmd_callback,
FALSE,
GIMP_HELP_LAYER_LOCK_POSITION },
{ "layers-lock-alpha", GIMP_ICON_LOCK_ALPHA,
NC_("layers-action", "Lock Alph_a Channel"), NULL,
NC_("layers-action", "Lock Alph_a Channel"), NULL, { NULL },
NC_("layers-action",
"Keep transparency information on this layer from being modified"),
layers_lock_alpha_cmd_callback,
@@ -347,19 +310,19 @@ static const GimpToggleActionEntry layers_toggle_actions[] =
static const GimpRadioActionEntry layers_blend_space_actions[] =
{
{ "layers-blend-space-auto", NULL,
NC_("layers-action", "Auto"), NULL,
NC_("layers-action", "Auto"), NULL, { NULL },
NC_("layers-action", "Layer Blend Space: Auto"),
GIMP_LAYER_COLOR_SPACE_AUTO,
NULL },
{ "layers-blend-space-rgb-linear", NULL,
NC_("layers-action", "RGB (linear)"), NULL,
NC_("layers-action", "RGB (linear)"), NULL, { NULL },
NC_("layers-action", "Layer Blend Space: RGB (linear)"),
GIMP_LAYER_COLOR_SPACE_RGB_LINEAR,
NULL },
{ "layers-blend-space-rgb-perceptual", NULL,
NC_("layers-action", "RGB (perceptual)"), NULL,
NC_("layers-action", "RGB (perceptual)"), NULL, { NULL },
NC_("layers-action", "Layer Blend Space: RGB (perceptual)"),
GIMP_LAYER_COLOR_SPACE_RGB_PERCEPTUAL,
NULL }
@@ -368,19 +331,19 @@ static const GimpRadioActionEntry layers_blend_space_actions[] =
static const GimpRadioActionEntry layers_composite_space_actions[] =
{
{ "layers-composite-space-auto", NULL,
NC_("layers-action", "Auto"), NULL,
NC_("layers-action", "Auto"), NULL, { NULL },
NC_("layers-action", "Layer Composite Space: Auto"),
GIMP_LAYER_COLOR_SPACE_AUTO,
NULL },
{ "layers-composite-space-rgb-linear", NULL,
NC_("layers-action", "RGB (linear)"), NULL,
NC_("layers-action", "RGB (linear)"), NULL, { NULL },
NC_("layers-action", "Layer Composite Space: RGB (linear)"),
GIMP_LAYER_COLOR_SPACE_RGB_LINEAR,
NULL },
{ "layers-composite-space-rgb-perceptual", NULL,
NC_("layers-action", "RGB (perceptual)"), NULL,
NC_("layers-action", "RGB (perceptual)"), NULL, { NULL },
NC_("layers-action", "Layer Composite Space: RGB (perceptual)"),
GIMP_LAYER_COLOR_SPACE_RGB_PERCEPTUAL,
NULL }
@@ -389,31 +352,31 @@ static const GimpRadioActionEntry layers_composite_space_actions[] =
static const GimpRadioActionEntry layers_composite_mode_actions[] =
{
{ "layers-composite-mode-auto", NULL,
NC_("layers-action", "Auto"), NULL,
NC_("layers-action", "Auto"), NULL, { NULL },
NC_("layers-action", "Layer Composite Mode: Auto"),
GIMP_LAYER_COMPOSITE_AUTO,
NULL },
{ "layers-composite-mode-union", NULL,
NC_("layers-action", "Union"), NULL,
NC_("layers-action", "Union"), NULL, { NULL },
NC_("layers-action", "Layer Composite Mode: Union"),
GIMP_LAYER_COMPOSITE_UNION,
NULL },
{ "layers-composite-mode-clip-to-backdrop", NULL,
NC_("layers-action", "Clip to Backdrop"), NULL,
NC_("layers-action", "Clip to Backdrop"), NULL, { NULL },
NC_("layers-action", "Layer Composite Mode: Clip to Backdrop"),
GIMP_LAYER_COMPOSITE_CLIP_TO_BACKDROP,
NULL },
{ "layers-composite-mode-clip-to-layer", NULL,
NC_("layers-action", "Clip to Layer"), NULL,
NC_("layers-action", "Clip to Layer"), NULL, { NULL },
NC_("layers-action", "Layer Composite Mode: Clip to Layer"),
GIMP_LAYER_COMPOSITE_CLIP_TO_LAYER,
NULL },
{ "layers-composite-mode-intersection", NULL,
NC_("layers-action", "Intersection"), NULL,
NC_("layers-action", "Intersection"), NULL, { NULL },
NC_("layers-action", "Layer Composite Mode: Intersection"),
GIMP_LAYER_COMPOSITE_INTERSECTION,
NULL }
@@ -422,55 +385,55 @@ static const GimpRadioActionEntry layers_composite_mode_actions[] =
static const GimpEnumActionEntry layers_color_tag_actions[] =
{
{ "layers-color-tag-none", GIMP_ICON_EDIT_CLEAR,
NC_("layers-action", "None"), NULL,
NC_("layers-action", "None"), NULL, { NULL },
NC_("layers-action", "Layer Color Tag: Clear"),
GIMP_COLOR_TAG_NONE, FALSE,
GIMP_HELP_LAYER_COLOR_TAG },
{ "layers-color-tag-blue", NULL,
NC_("layers-action", "Blue"), NULL,
NC_("layers-action", "Blue"), NULL, { NULL },
NC_("layers-action", "Layer Color Tag: Set to Blue"),
GIMP_COLOR_TAG_BLUE, FALSE,
GIMP_HELP_LAYER_COLOR_TAG },
{ "layers-color-tag-green", NULL,
NC_("layers-action", "Green"), NULL,
NC_("layers-action", "Green"), NULL, { NULL },
NC_("layers-action", "Layer Color Tag: Set to Green"),
GIMP_COLOR_TAG_GREEN, FALSE,
GIMP_HELP_LAYER_COLOR_TAG },
{ "layers-color-tag-yellow", NULL,
NC_("layers-action", "Yellow"), NULL,
NC_("layers-action", "Yellow"), NULL, { NULL },
NC_("layers-action", "Layer Color Tag: Set to Yellow"),
GIMP_COLOR_TAG_YELLOW, FALSE,
GIMP_HELP_LAYER_COLOR_TAG },
{ "layers-color-tag-orange", NULL,
NC_("layers-action", "Orange"), NULL,
NC_("layers-action", "Orange"), NULL, { NULL },
NC_("layers-action", "Layer Color Tag: Set to Orange"),
GIMP_COLOR_TAG_ORANGE, FALSE,
GIMP_HELP_LAYER_COLOR_TAG },
{ "layers-color-tag-brown", NULL,
NC_("layers-action", "Brown"), NULL,
NC_("layers-action", "Brown"), NULL, { NULL },
NC_("layers-action", "Layer Color Tag: Set to Brown"),
GIMP_COLOR_TAG_BROWN, FALSE,
GIMP_HELP_LAYER_COLOR_TAG },
{ "layers-color-tag-red", NULL,
NC_("layers-action", "Red"), NULL,
NC_("layers-action", "Red"), NULL, { NULL },
NC_("layers-action", "Layer Color Tag: Set to Red"),
GIMP_COLOR_TAG_RED, FALSE,
GIMP_HELP_LAYER_COLOR_TAG },
{ "layers-color-tag-violet", NULL,
NC_("layers-action", "Violet"), NULL,
NC_("layers-action", "Violet"), NULL, { NULL },
NC_("layers-action", "Layer Color Tag: Set to Violet"),
GIMP_COLOR_TAG_VIOLET, FALSE,
GIMP_HELP_LAYER_COLOR_TAG },
{ "layers-color-tag-gray", NULL,
NC_("layers-action", "Gray"), NULL,
NC_("layers-action", "Gray"), NULL, { NULL },
NC_("layers-action", "Layer Color Tag: Set to Gray"),
GIMP_COLOR_TAG_GRAY, FALSE,
GIMP_HELP_LAYER_COLOR_TAG }
@@ -479,13 +442,13 @@ static const GimpEnumActionEntry layers_color_tag_actions[] =
static const GimpEnumActionEntry layers_mask_apply_actions[] =
{
{ "layers-mask-apply", NULL,
NC_("layers-action", "Apply Layer _Mask"), NULL,
NC_("layers-action", "Apply the effect of the layer mask and remove it"),
NC_("layers-action", "Apply Layer _Masks"), NULL, { NULL },
NC_("layers-action", "Apply the effect of the layer masks and remove them"),
GIMP_MASK_APPLY, FALSE,
GIMP_HELP_LAYER_MASK_APPLY },
{ "layers-mask-delete", GIMP_ICON_EDIT_DELETE,
NC_("layers-action", "Delete Layer Mas_k"), NULL,
NC_("layers-action", "Delete Layer Mas_ks"), NULL, { NULL },
NC_("layers-action", "Remove layer masks and their effect"),
GIMP_MASK_DISCARD, FALSE,
GIMP_HELP_LAYER_MASK_DELETE }
@@ -494,25 +457,25 @@ static const GimpEnumActionEntry layers_mask_apply_actions[] =
static const GimpEnumActionEntry layers_mask_to_selection_actions[] =
{
{ "layers-mask-selection-replace", GIMP_ICON_SELECTION_REPLACE,
NC_("layers-action", "_Masks to Selection"), NULL,
NC_("layers-action", "_Masks to Selection"), NULL, { NULL },
NC_("layers-action", "Replace the selection with the layer masks"),
GIMP_CHANNEL_OP_REPLACE, FALSE,
GIMP_HELP_LAYER_MASK_SELECTION_REPLACE },
{ "layers-mask-selection-add", GIMP_ICON_SELECTION_ADD,
NC_("layers-action", "_Add Masks to Selection"), NULL,
NC_("layers-action", "_Add Masks to Selection"), NULL, { NULL },
NC_("layers-action", "Add the layer masks to the current selection"),
GIMP_CHANNEL_OP_ADD, FALSE,
GIMP_HELP_LAYER_MASK_SELECTION_ADD },
{ "layers-mask-selection-subtract", GIMP_ICON_SELECTION_SUBTRACT,
NC_("layers-action", "_Subtract Masks from Selection"), NULL,
NC_("layers-action", "_Subtract Masks from Selection"), NULL, { NULL },
NC_("layers-action", "Subtract the layer masks from the current selection"),
GIMP_CHANNEL_OP_SUBTRACT, FALSE,
GIMP_HELP_LAYER_MASK_SELECTION_SUBTRACT },
{ "layers-mask-selection-intersect", GIMP_ICON_SELECTION_INTERSECT,
NC_("layers-action", "_Intersect Masks with Selection"), NULL,
NC_("layers-action", "_Intersect Masks with Selection"), NULL, { NULL },
NC_("layers-action", "Intersect the layer masks with the current selection"),
GIMP_CHANNEL_OP_INTERSECT, FALSE,
GIMP_HELP_LAYER_MASK_SELECTION_INTERSECT }
@@ -521,28 +484,28 @@ static const GimpEnumActionEntry layers_mask_to_selection_actions[] =
static const GimpEnumActionEntry layers_alpha_to_selection_actions[] =
{
{ "layers-alpha-selection-replace", GIMP_ICON_SELECTION_REPLACE,
NC_("layers-action", "Al_pha to Selection"), NULL,
NC_("layers-action", "Al_pha to Selection"), NULL, { NULL },
NC_("layers-action",
"Replace the selection with the layer's alpha channel"),
GIMP_CHANNEL_OP_REPLACE, FALSE,
GIMP_HELP_LAYER_ALPHA_SELECTION_REPLACE },
{ "layers-alpha-selection-add", GIMP_ICON_SELECTION_ADD,
NC_("layers-action", "A_dd Alpha to Selection"), NULL,
NC_("layers-action", "A_dd Alpha to Selection"), NULL, { NULL },
NC_("layers-action",
"Add the layer's alpha channel to the current selection"),
GIMP_CHANNEL_OP_ADD, FALSE,
GIMP_HELP_LAYER_ALPHA_SELECTION_ADD },
{ "layers-alpha-selection-subtract", GIMP_ICON_SELECTION_SUBTRACT,
NC_("layers-action", "_Subtract Alpha from Selection"), NULL,
NC_("layers-action", "_Subtract Alpha from Selection"), NULL, { NULL },
NC_("layers-action",
"Subtract the layer's alpha channel from the current selection"),
GIMP_CHANNEL_OP_SUBTRACT, FALSE,
GIMP_HELP_LAYER_ALPHA_SELECTION_SUBTRACT },
{ "layers-alpha-selection-intersect", GIMP_ICON_SELECTION_INTERSECT,
NC_("layers-action", "_Intersect Alpha with Selection"), NULL,
NC_("layers-action", "_Intersect Alpha with Selection"), NULL, { NULL },
NC_("layers-action",
"Intersect the layer's alpha channel with the current selection"),
GIMP_CHANNEL_OP_INTERSECT, FALSE,
@@ -552,25 +515,25 @@ static const GimpEnumActionEntry layers_alpha_to_selection_actions[] =
static const GimpEnumActionEntry layers_select_actions[] =
{
{ "layers-select-top", NULL,
NC_("layers-action", "Select _Top Layer"), "Home",
NC_("layers-action", "Select _Top Layer"), NULL, { "Home", NULL },
NC_("layers-action", "Select the topmost layer"),
GIMP_ACTION_SELECT_FIRST, FALSE,
GIMP_HELP_LAYER_TOP },
{ "layers-select-bottom", NULL,
NC_("layers-action", "Select _Bottom Layer"), "End",
NC_("layers-action", "Select _Bottom Layer"), NULL, { "End", NULL },
NC_("layers-action", "Select the bottommost layer"),
GIMP_ACTION_SELECT_LAST, FALSE,
GIMP_HELP_LAYER_BOTTOM },
{ "layers-select-previous", NULL,
NC_("layers-action", "Select _Previous Layers"), "Prior",
NC_("layers-action", "Select _Previous Layers"), NULL, { "Prior", NULL },
NC_("layers-action", "Select the layers above the current layers"),
GIMP_ACTION_SELECT_PREVIOUS, FALSE,
GIMP_HELP_LAYER_PREVIOUS },
{ "layers-select-next", NULL,
NC_("layers-action", "Select _Next Layers"), "Next",
NC_("layers-action", "Select _Next Layers"), NULL, { "Next", NULL },
NC_("layers-action", "Select the layers below the current layers"),
GIMP_ACTION_SELECT_NEXT, FALSE,
GIMP_HELP_LAYER_NEXT }
@@ -579,31 +542,31 @@ static const GimpEnumActionEntry layers_select_actions[] =
static const GimpEnumActionEntry layers_opacity_actions[] =
{
{ "layers-opacity-set", GIMP_ICON_TRANSPARENCY,
NC_("layers-action", "Layer Opacity: Set"), NULL, NULL,
NC_("layers-action", "Layer Opacity: Set"), NULL, { NULL }, NULL,
GIMP_ACTION_SELECT_SET, TRUE,
GIMP_HELP_LAYER_OPACITY },
{ "layers-opacity-transparent", GIMP_ICON_TRANSPARENCY,
NC_("layers-action", "Layer Opacity: Make Completely Transparent"), NULL, NULL,
NC_("layers-action", "Layer Opacity: Make Completely Transparent"), NULL, { NULL }, NULL,
GIMP_ACTION_SELECT_FIRST, FALSE,
GIMP_HELP_LAYER_OPACITY },
{ "layers-opacity-opaque", GIMP_ICON_TRANSPARENCY,
NC_("layers-action", "Layer Opacity: Make Completely Opaque"), NULL, NULL,
NC_("layers-action", "Layer Opacity: Make Completely Opaque"), NULL, { NULL }, NULL,
GIMP_ACTION_SELECT_LAST, FALSE,
GIMP_HELP_LAYER_OPACITY },
{ "layers-opacity-decrease", GIMP_ICON_TRANSPARENCY,
NC_("layers-action", "Layer Opacity: Make More Transparent"), NULL, NULL,
NC_("layers-action", "Layer Opacity: Make More Transparent"), NULL, { NULL }, NULL,
GIMP_ACTION_SELECT_PREVIOUS, FALSE,
GIMP_HELP_LAYER_OPACITY },
{ "layers-opacity-increase", GIMP_ICON_TRANSPARENCY,
NC_("layers-action", "Layer Opacity: Make More Opaque"), NULL, NULL,
NC_("layers-action", "Layer Opacity: Make More Opaque"), NULL, { NULL }, NULL,
GIMP_ACTION_SELECT_NEXT, FALSE,
GIMP_HELP_LAYER_OPACITY },
{ "layers-opacity-decrease-skip", GIMP_ICON_TRANSPARENCY,
NC_("layers-action", "Layer Opacity: Make 10% More Transparent"), NULL, NULL,
NC_("layers-action", "Layer Opacity: Make 10% More Transparent"), NULL, { NULL }, NULL,
GIMP_ACTION_SELECT_SKIP_PREVIOUS, FALSE,
GIMP_HELP_LAYER_OPACITY },
{ "layers-opacity-increase-skip", GIMP_ICON_TRANSPARENCY,
NC_("layers-action", "Layer Opacity: Make 10% More Opaque"), NULL, NULL,
NC_("layers-action", "Layer Opacity: Make 10% More Opaque"), NULL, { NULL }, NULL,
GIMP_ACTION_SELECT_SKIP_NEXT, FALSE,
GIMP_HELP_LAYER_OPACITY }
};
@@ -611,19 +574,19 @@ static const GimpEnumActionEntry layers_opacity_actions[] =
static const GimpEnumActionEntry layers_mode_actions[] =
{
{ "layers-mode-first", GIMP_ICON_TOOL_PENCIL,
NC_("layers-action", "Layer Mode: Select First"), NULL, NULL,
NC_("layers-action", "Layer Mode: Select First"), NULL, { NULL }, NULL,
GIMP_ACTION_SELECT_FIRST, FALSE,
GIMP_HELP_LAYER_MODE },
{ "layers-mode-last", GIMP_ICON_TOOL_PENCIL,
NC_("layers-action", "Layer Mode: Select Last"), NULL, NULL,
NC_("layers-action", "Layer Mode: Select Last"), NULL, { NULL }, NULL,
GIMP_ACTION_SELECT_LAST, FALSE,
GIMP_HELP_LAYER_MODE },
{ "layers-mode-previous", GIMP_ICON_TOOL_PENCIL,
NC_("layers-action", "Layer Mode: Select Previous"), NULL, NULL,
NC_("layers-action", "Layer Mode: Select Previous"), NULL, { NULL }, NULL,
GIMP_ACTION_SELECT_PREVIOUS, FALSE,
GIMP_HELP_LAYER_MODE },
{ "layers-mode-next", GIMP_ICON_TOOL_PENCIL,
NC_("layers-action", "Layer Mode: Select Next"), NULL, NULL,
NC_("layers-action", "Layer Mode: Select Next"), NULL, { NULL }, NULL,
GIMP_ACTION_SELECT_NEXT, FALSE,
GIMP_HELP_LAYER_MODE }
};
@@ -774,6 +737,9 @@ layers_actions_update (GimpActionGroup *group,
gboolean last_mode = FALSE;
gboolean first_mode = FALSE;
gboolean first_selected = FALSE; /* First layer is selected */
gboolean last_selected = FALSE; /* Last layer is selected */
gboolean have_masks = FALSE; /* At least 1 selected layer has a mask. */
gboolean have_no_masks = FALSE; /* At least 1 selected layer has no mask. */
gboolean have_groups = FALSE; /* At least 1 selected layer is a group. */
@@ -793,6 +759,7 @@ layers_actions_update (GimpActionGroup *group,
gint n_selected_layers = 0;
gint n_layers = 0;
gint n_text_layers = 0;
if (image)
{
@@ -836,12 +803,12 @@ layers_actions_update (GimpActionGroup *group,
else
have_no_groups = TRUE;
if (! gimp_item_is_content_locked (GIMP_ITEM (iter->data)))
if (! gimp_item_is_content_locked (GIMP_ITEM (iter->data), NULL))
have_writable = TRUE;
else
all_writable = FALSE;
if (gimp_item_is_position_locked (GIMP_ITEM (iter->data)))
if (gimp_item_is_position_locked (GIMP_ITEM (iter->data), NULL))
all_movable = FALSE;
if (gimp_layer_can_lock_alpha (iter->data))
@@ -874,6 +841,11 @@ layers_actions_update (GimpActionGroup *group,
{
GList *next_visible;
if (gimp_item_get_index (iter2->data) == 0)
first_selected = TRUE;
if (gimp_item_get_index (iter2->data) == n_layers - 1)
last_selected = TRUE;
if (g_list_previous (iter2))
have_prev = TRUE;
@@ -889,7 +861,7 @@ layers_actions_update (GimpActionGroup *group,
/* "next_visible" is actually "next_visible" and
* "writable" and "not group"
*/
if (gimp_item_is_content_locked (next_visible->data) ||
if (gimp_item_is_content_locked (next_visible->data, NULL) ||
gimp_viewable_get_children (next_visible->data))
next_visible = NULL;
@@ -916,19 +888,8 @@ layers_actions_update (GimpActionGroup *group,
else
have_no_alpha = TRUE;
if (have_masks && have_no_masks &&
have_groups && have_no_groups &&
have_writable && ! all_writable &&
! all_movable &&
! all_masks_shown &&
! all_masks_disabled &&
! lock_alpha && can_lock_alpha &&
! prev_mode && ! next_mode &&
have_prev && have_next &&
bs_mutable && cs_mutable && cm_mutable &&
! all_visible && ! all_next_visible &&
have_alpha && have_no_alpha)
break;
if (GIMP_IS_TEXT_LAYER (iter->data))
n_text_layers++;
}
if (n_selected_layers == 1)
@@ -1015,7 +976,7 @@ layers_actions_update (GimpActionGroup *group,
SET_SENSITIVE ("layers-new", image);
SET_SENSITIVE ("layers-new-last-values", image);
SET_SENSITIVE ("layers-new-from-visible", image);
SET_SENSITIVE ("layers-new-group", image && !indexed);
SET_SENSITIVE ("layers-new-group", image && !indexed && !fs);
SET_SENSITIVE ("layers-duplicate", n_selected_layers > 0 && !fs && !ac);
SET_SENSITIVE ("layers-delete", n_selected_layers > 0 && !ac);
@@ -1029,9 +990,9 @@ layers_actions_update (GimpActionGroup *group,
SET_SENSITIVE ("layers-select-previous", n_selected_layers > 0 && !fs && !ac && have_prev);
SET_SENSITIVE ("layers-select-next", n_selected_layers > 0 && !fs && !ac && have_next);
SET_SENSITIVE ("layers-raise", n_selected_layers > 0 && !fs && !ac && have_prev);
SET_SENSITIVE ("layers-raise", n_selected_layers > 0 && !fs && !ac && have_prev && !first_selected);
SET_SENSITIVE ("layers-raise-to-top", n_selected_layers > 0 && !fs && !ac && have_prev);
SET_SENSITIVE ("layers-lower", n_selected_layers > 0 && !fs && !ac && have_next);
SET_SENSITIVE ("layers-lower", n_selected_layers > 0 && !fs && !ac && have_next && !last_selected);
SET_SENSITIVE ("layers-lower-to-bottom", n_selected_layers > 0 && !fs && !ac && have_next);
SET_VISIBLE ("layers-anchor", fs && !ac);
@@ -1044,8 +1005,8 @@ layers_actions_update (GimpActionGroup *group,
SET_SENSITIVE ("layers-merge-layers", n_selected_layers > 0 && !fs && !ac);
SET_SENSITIVE ("layers-flatten-image", !fs && !ac);
SET_VISIBLE ("layers-text-discard", text_layer && !ac);
SET_VISIBLE ("layers-text-to-vectors", text_layer && !ac);
SET_VISIBLE ("layers-text-discard", n_text_layers > 0 && !ac);
SET_VISIBLE ("layers-text-to-vectors", n_text_layers > 0 && !ac);
SET_VISIBLE ("layers-text-along-vectors", text_layer && !ac);
SET_SENSITIVE ("layers-resize", n_selected_layers == 1 && all_writable && all_movable && !ac);

View File

@@ -39,6 +39,8 @@
#include "core/gimpcontainer.h"
#include "core/gimpcontext.h"
#include "core/gimpdrawable-fill.h"
#include "core/gimpdrawable-filters.h"
#include "core/gimpdrawablefilter.h"
#include "core/gimpgrouplayer.h"
#include "core/gimpimage.h"
#include "core/gimpimage-merge.h"
@@ -48,6 +50,7 @@
#include "core/gimplayerpropundo.h"
#include "core/gimplayer-floating-selection.h"
#include "core/gimplayer-new.h"
#include "core/gimplist.h"
#include "core/gimppickable.h"
#include "core/gimppickable-auto-shrink.h"
#include "core/gimptoolinfo.h"
@@ -55,12 +58,12 @@
#include "core/gimpprogress.h"
#include "text/gimptext.h"
#include "text/gimptext-vectors.h"
#include "text/gimptext-path.h"
#include "text/gimptextlayer.h"
#include "vectors/gimppath.h"
#include "vectors/gimppath-warp.h"
#include "vectors/gimpstroke.h"
#include "vectors/gimpvectors.h"
#include "vectors/gimpvectors-warp.h"
#include "widgets/gimpaction.h"
#include "widgets/gimpdock.h"
@@ -108,6 +111,7 @@ static void layers_new_callback (GtkWidget *dialog,
GimpColorTag layer_color_tag,
gboolean layer_lock_pixels,
gboolean layer_lock_position,
gboolean layer_lock_visibility,
gboolean layer_lock_alpha,
gboolean rename_text_layer,
gpointer user_data);
@@ -130,6 +134,7 @@ static void layers_edit_attributes_callback (GtkWidget *dialog,
GimpColorTag layer_color_tag,
gboolean layer_lock_pixels,
gboolean layer_lock_position,
gboolean layer_lock_visibility,
gboolean layer_lock_alpha,
gboolean rename_text_layer,
gpointer user_data);
@@ -143,23 +148,23 @@ static void layers_scale_callback (GtkWidget *dialog,
GimpViewable *viewable,
gint width,
gint height,
GimpUnit unit,
GimpUnit *unit,
GimpInterpolationType interpolation,
gdouble xresolution,
gdouble yresolution,
GimpUnit resolution_unit,
GimpUnit *resolution_unit,
gpointer user_data);
static void layers_resize_callback (GtkWidget *dialog,
GimpViewable *viewable,
GimpContext *context,
gint width,
gint height,
GimpUnit unit,
GimpUnit *unit,
gint offset_x,
gint offset_y,
gdouble unused0,
gdouble unused1,
GimpUnit unused2,
GimpUnit *unused2,
GimpFillType fill_type,
GimpItemSet unused3,
gboolean unused4,
@@ -172,8 +177,8 @@ static gint layers_mode_index (GimpLayerMode layer_mode
/* private variables */
static GimpUnit layer_resize_unit = GIMP_UNIT_PIXEL;
static GimpUnit layer_scale_unit = GIMP_UNIT_PIXEL;
static GimpUnit *layer_resize_unit = NULL;
static GimpUnit *layer_scale_unit = NULL;
static GimpInterpolationType layer_scale_interp = -1;
@@ -185,12 +190,15 @@ layers_edit_cmd_callback (GimpAction *action,
gpointer data)
{
GimpImage *image;
GimpLayer *layer;
GList *layers;
GtkWidget *widget;
return_if_no_layer (image, layer, data);
return_if_no_layers (image, layers, data);
return_if_no_widget (widget, data);
if (gimp_item_is_text_layer (GIMP_ITEM (layer)))
if (g_list_length (layers) != 1)
return;
if (gimp_item_is_text_layer (GIMP_ITEM (layers->data)))
{
layers_edit_text_cmd_callback (action, value, data);
}
@@ -207,11 +215,16 @@ layers_edit_text_cmd_callback (GimpAction *action,
{
GimpImage *image;
GimpLayer *layer;
GList *layers;
GtkWidget *widget;
GimpTool *active_tool;
return_if_no_layer (image, layer, data);
return_if_no_layers (image, layers, data);
return_if_no_widget (widget, data);
if (g_list_length (layers) != 1)
return;
layer = layers->data;
g_return_if_fail (gimp_item_is_text_layer (GIMP_ITEM (layer)));
active_tool = tool_manager_get_active (image->gimp);
@@ -247,11 +260,17 @@ layers_edit_attributes_cmd_callback (GimpAction *action,
{
GimpImage *image;
GimpLayer *layer;
GList *layers;
GtkWidget *widget;
GtkWidget *dialog;
return_if_no_layer (image, layer, data);
return_if_no_layers (image, layers, data);
return_if_no_widget (widget, data);
if (g_list_length (layers) != 1)
return;
layer = layers->data;
#define EDIT_DIALOG_KEY "gimp-layer-edit-attributes-dialog"
dialog = dialogs_get_dialog (G_OBJECT (layer), EDIT_DIALOG_KEY);
@@ -280,6 +299,7 @@ layers_edit_attributes_cmd_callback (GimpAction *action,
gimp_item_get_color_tag (item),
gimp_item_get_lock_content (item),
gimp_item_get_lock_position (item),
gimp_item_get_lock_visibility (item),
gimp_layer_get_lock_alpha (layer),
layers_edit_attributes_callback,
NULL);
@@ -365,6 +385,7 @@ layers_new_cmd_callback (GimpAction *action,
FALSE,
FALSE,
FALSE,
FALSE,
layers_new_callback,
NULL);
g_free (desc);
@@ -636,7 +657,15 @@ layers_raise_cmd_callback (GimpAction *action,
index = gimp_item_get_index (iter->data);
if (index > 0)
raised_layers = g_list_prepend (raised_layers, iter->data);
{
raised_layers = g_list_prepend (raised_layers, iter->data);
}
else
{
gimp_image_flush (image);
g_list_free (raised_layers);
return;
}
}
gimp_image_undo_group_start (image,
@@ -644,6 +673,8 @@ layers_raise_cmd_callback (GimpAction *action,
ngettext ("Raise Layer",
"Raise Layers",
g_list_length (raised_layers)));
raised_layers = g_list_reverse (raised_layers);
for (iter = raised_layers; iter; iter = iter->next)
gimp_image_raise_item (image, iter->data, NULL);
@@ -707,7 +738,15 @@ layers_lower_cmd_callback (GimpAction *action,
layer_list = gimp_item_get_container_iter (GIMP_ITEM (iter->data));
index = gimp_item_get_index (iter->data);
if (index < g_list_length (layer_list) - 1)
lowered_layers = g_list_prepend (lowered_layers, iter->data);
{
lowered_layers = g_list_prepend (lowered_layers, iter->data);
}
else
{
gimp_image_flush (image);
g_list_free (lowered_layers);
return;
}
}
gimp_image_undo_group_start (image,
@@ -793,6 +832,38 @@ layers_duplicate_cmd_callback (GimpAction *action,
gimp_item_get_index (iter->data),
TRUE);
new_layers = g_list_prepend (new_layers, new_layer);
/* Import any attached layer effects */
if (gimp_drawable_has_filters (GIMP_DRAWABLE (iter->data)))
{
GList *filter_list;
GimpContainer *filters;
filters = gimp_drawable_get_filters (GIMP_DRAWABLE (iter->data));
for (filter_list = GIMP_LIST (filters)->queue->tail; filter_list;
filter_list = g_list_previous (filter_list))
{
if (GIMP_IS_DRAWABLE_FILTER (filter_list->data))
{
GimpDrawableFilter *old_filter = filter_list->data;
GimpDrawableFilter *filter;
filter =
gimp_drawable_filter_duplicate (GIMP_DRAWABLE (new_layer),
old_filter);
if (filter != NULL)
{
gimp_drawable_filter_apply (filter, NULL);
gimp_drawable_filter_commit (filter, TRUE, NULL, FALSE);
gimp_drawable_filter_layer_mask_freeze (filter);
g_object_unref (filter);
}
}
}
}
}
gimp_image_set_selected_layers (image, new_layers);
@@ -968,11 +1039,16 @@ layers_text_discard_cmd_callback (GimpAction *action,
gpointer data)
{
GimpImage *image;
GimpLayer *layer;
return_if_no_layer (image, layer, data);
GList *layers;
GList *iter;
return_if_no_layers (image, layers, data);
if (GIMP_IS_TEXT_LAYER (layer))
gimp_text_layer_discard (GIMP_TEXT_LAYER (layer));
gimp_image_undo_group_start (image, GIMP_UNDO_GROUP_TEXT,
_("Discard Text Information"));
for (iter = layers; iter; iter = iter->next)
if (GIMP_IS_TEXT_LAYER (iter->data))
gimp_text_layer_discard (GIMP_TEXT_LAYER (iter->data));
gimp_image_undo_group_end (image);
}
void
@@ -981,23 +1057,33 @@ layers_text_to_vectors_cmd_callback (GimpAction *action,
gpointer data)
{
GimpImage *image;
GimpLayer *layer;
return_if_no_layer (image, layer, data);
GList *layers;
GList *iter;
return_if_no_layers (image, layers, data);
if (GIMP_IS_TEXT_LAYER (layer))
/* TODO: have the proper undo group. */
gimp_image_undo_group_start (image, GIMP_UNDO_GROUP_PATHS_IMPORT,
_("Add Paths"));
for (iter = layers; iter; iter = iter->next)
{
GimpVectors *vectors;
gint x, y;
GimpLayer *layer = iter->data;
vectors = gimp_text_vectors_new (image, GIMP_TEXT_LAYER (layer)->text);
if (GIMP_IS_TEXT_LAYER (layer))
{
GimpPath *path;
gint x, y;
gimp_item_get_offset (GIMP_ITEM (layer), &x, &y);
gimp_item_translate (GIMP_ITEM (vectors), x, y, FALSE);
path = gimp_text_path_new (image, GIMP_TEXT_LAYER (layer)->text);
gimp_image_add_vectors (image, vectors,
GIMP_IMAGE_ACTIVE_PARENT, -1, TRUE);
gimp_image_flush (image);
gimp_item_get_offset (GIMP_ITEM (layer), &x, &y);
gimp_item_translate (GIMP_ITEM (path), x, y, FALSE);
gimp_image_add_path (image, path,
GIMP_IMAGE_ACTIVE_PARENT, -1, TRUE);
gimp_image_flush (image);
}
}
gimp_image_undo_group_end (image);
}
void
@@ -1006,22 +1092,29 @@ layers_text_along_vectors_cmd_callback (GimpAction *action,
gpointer data)
{
GimpImage *image;
GList *layers;
GList *paths;
GimpLayer *layer;
GimpVectors *vectors;
return_if_no_layer (image, layer, data);
return_if_no_vectors (image, vectors, data);
GimpPath *path;
return_if_no_layers (image, layers, data);
return_if_no_paths (image, paths, data);
if (g_list_length (layers) != 1 || g_list_length (paths) != 1)
return;
layer = layers->data;
path = paths->data;
if (GIMP_IS_TEXT_LAYER (layer))
{
gdouble box_width;
gdouble box_height;
GimpVectors *new_vectors;
gdouble offset;
gdouble box_width;
gdouble box_height;
GimpPath *new_path;
gdouble offset;
box_width = gimp_item_get_width (GIMP_ITEM (layer));
box_height = gimp_item_get_height (GIMP_ITEM (layer));
new_vectors = gimp_text_vectors_new (image, GIMP_TEXT_LAYER (layer)->text);
new_path = gimp_text_path_new (image, GIMP_TEXT_LAYER (layer)->text);
offset = 0;
switch (GIMP_TEXT_LAYER (layer)->text->base_dir)
@@ -1037,7 +1130,7 @@ layers_text_along_vectors_cmd_callback (GimpAction *action,
{
GimpStroke *stroke = NULL;
while ((stroke = gimp_vectors_stroke_get_next (new_vectors, stroke)))
while ((stroke = gimp_path_stroke_get_next (new_path, stroke)))
{
gimp_stroke_rotate (stroke, 0, 0, 270);
gimp_stroke_translate (stroke, 0, box_width);
@@ -1047,13 +1140,12 @@ layers_text_along_vectors_cmd_callback (GimpAction *action,
break;
}
gimp_path_warp_path (path, new_path, offset);
gimp_vectors_warp_vectors (vectors, new_vectors, offset);
gimp_item_set_visible (GIMP_ITEM (new_path), TRUE, FALSE);
gimp_item_set_visible (GIMP_ITEM (new_vectors), TRUE, FALSE);
gimp_image_add_vectors (image, new_vectors,
GIMP_IMAGE_ACTIVE_PARENT, -1, TRUE);
gimp_image_add_path (image, new_path,
GIMP_IMAGE_ACTIVE_PARENT, -1, TRUE);
gimp_image_flush (image);
}
}
@@ -1087,7 +1179,10 @@ layers_resize_cmd_callback (GimpAction *action,
if (GIMP_IS_IMAGE_WINDOW (data))
display = action_data_get_display (data);
if (layer_resize_unit != GIMP_UNIT_PERCENT && display)
if (layer_resize_unit == NULL)
layer_resize_unit = gimp_unit_pixel ();
if (layer_resize_unit != gimp_unit_percent () && display)
layer_resize_unit = gimp_display_get_shell (display)->unit;
dialog = resize_dialog_new (GIMP_VIEWABLE (layer),
@@ -1162,7 +1257,10 @@ layers_scale_cmd_callback (GimpAction *action,
if (GIMP_IS_IMAGE_WINDOW (data))
display = action_data_get_display (data);
if (layer_scale_unit != GIMP_UNIT_PERCENT && display)
if (layer_scale_unit == NULL)
layer_scale_unit = gimp_unit_pixel ();;
if (layer_scale_unit != gimp_unit_percent () && display)
layer_scale_unit = gimp_display_get_shell (display)->unit;
if (layer_scale_interp == -1)
@@ -1458,7 +1556,7 @@ layers_mask_apply_cmd_callback (GimpAction *action,
if (gimp_layer_get_mask (iter->data) &&
(mode != GIMP_MASK_APPLY ||
(! gimp_viewable_get_children (GIMP_VIEWABLE (iter->data)) &&
! gimp_item_is_content_locked (GIMP_ITEM (iter->data)))))
! gimp_item_is_content_locked (GIMP_ITEM (iter->data), NULL))))
break;
}
if (iter == NULL)
@@ -1490,7 +1588,7 @@ layers_mask_apply_cmd_callback (GimpAction *action,
{
if (mode == GIMP_MASK_APPLY &&
(gimp_viewable_get_children (GIMP_VIEWABLE (iter->data)) ||
gimp_item_is_content_locked (GIMP_ITEM (iter->data))))
gimp_item_is_content_locked (GIMP_ITEM (iter->data), NULL)))
/* Layer groups cannot apply masks. Neither can
* content-locked layers.
*/
@@ -2017,13 +2115,13 @@ layers_composite_mode_cmd_callback (GimpAction *action,
void
layers_visible_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data)
gpointer data)
{
GimpImage *image;
GimpLayer *layer;
return_if_no_layer (image, layer, data);
GList *layers;
return_if_no_layers (image, layers, data);
items_visible_cmd_callback (action, value, image, GIMP_ITEM (layer));
items_visible_cmd_callback (action, value, image, layers);
}
void
@@ -2033,46 +2131,9 @@ layers_lock_content_cmd_callback (GimpAction *action,
{
GimpImage *image;
GList *layers;
GList *iter;
GList *locked_layers = NULL;
gboolean locked = g_variant_get_boolean (value);
gchar *undo_label;
return_if_no_layers (image, layers, data);
for (iter = layers; iter; iter = iter->next)
if (gimp_item_can_lock_content (iter->data))
{
if (! locked && ! gimp_item_get_lock_content (iter->data))
{
/* When unlocking, we expect all selected layers to be locked. */
g_list_free (locked_layers);
return;
}
else if (locked != gimp_item_get_lock_content (iter->data))
{
locked_layers = g_list_prepend (locked_layers, iter->data);
}
}
if (! locked_layers)
return;
if (locked)
undo_label = _("Lock content");
else
undo_label = _("Unlock content");
gimp_image_undo_group_start (image,
GIMP_UNDO_GROUP_ITEM_LOCK_CONTENTS,
undo_label);
for (iter = locked_layers; iter; iter = iter->next)
gimp_item_set_lock_content (iter->data, locked, TRUE);
gimp_image_flush (image);
gimp_image_undo_group_end (image);
g_list_free (locked_layers);
items_lock_content_cmd_callback (action, value, image, layers);
}
void
@@ -2082,46 +2143,9 @@ layers_lock_position_cmd_callback (GimpAction *action,
{
GimpImage *image;
GList *layers;
GList *iter;
GList *locked_layers = NULL;
gboolean locked = g_variant_get_boolean (value);
gchar *undo_label;
return_if_no_layers (image, layers, data);
for (iter = layers; iter; iter = iter->next)
if (gimp_item_can_lock_position (iter->data))
{
if (! locked && ! gimp_item_get_lock_position (iter->data))
{
/* When unlocking, we expect all selected layers to be locked. */
g_list_free (locked_layers);
return;
}
else if (locked != gimp_item_get_lock_position (iter->data))
{
locked_layers = g_list_prepend (locked_layers, iter->data);
}
}
if (! locked_layers)
return;
if (locked)
undo_label = _("Lock position");
else
undo_label = _("Unlock position");
gimp_image_undo_group_start (image,
GIMP_UNDO_GROUP_ITEM_LOCK_POSITION,
undo_label);
for (iter = locked_layers; iter; iter = iter->next)
gimp_item_set_lock_position (iter->data, locked, TRUE);
gimp_image_flush (image);
gimp_image_undo_group_end (image);
g_list_free (locked_layers);
items_lock_position_cmd_callback (action, value, image, layers);
}
void
@@ -2179,15 +2203,12 @@ layers_color_tag_cmd_callback (GimpAction *action,
{
GimpImage *image;
GList *layers;
GList *iter;
GimpColorTag color_tag;
return_if_no_layers (image, layers, data);
color_tag = (GimpColorTag) g_variant_get_int32 (value);
for (iter = layers; iter; iter = iter->next)
items_color_tag_cmd_callback (action, image, GIMP_ITEM (iter->data),
color_tag);
items_color_tag_cmd_callback (action, image, layers, color_tag);
}
@@ -2213,6 +2234,7 @@ layers_new_callback (GtkWidget *dialog,
GimpColorTag layer_color_tag,
gboolean layer_lock_pixels,
gboolean layer_lock_position,
gboolean layer_lock_visibility,
gboolean layer_lock_alpha,
gboolean rename_text_layer, /* unused */
gpointer user_data)
@@ -2282,6 +2304,8 @@ layers_new_callback (GtkWidget *dialog,
FALSE);
gimp_item_set_lock_position (GIMP_ITEM (layer), layer_lock_position,
FALSE);
gimp_item_set_lock_visibility (GIMP_ITEM (layer), layer_lock_visibility,
FALSE);
gimp_layer_set_lock_alpha (layer, layer_lock_alpha, FALSE);
gimp_layer_set_blend_space (layer, layer_blend_space, FALSE);
gimp_layer_set_composite_space (layer, layer_composite_space, FALSE);
@@ -2326,6 +2350,7 @@ layers_edit_attributes_callback (GtkWidget *dialog,
GimpColorTag layer_color_tag,
gboolean layer_lock_pixels,
gboolean layer_lock_position,
gboolean layer_lock_visibility,
gboolean layer_lock_alpha,
gboolean rename_text_layer,
gpointer user_data)
@@ -2344,6 +2369,7 @@ layers_edit_attributes_callback (GtkWidget *dialog,
layer_color_tag != gimp_item_get_color_tag (item) ||
layer_lock_pixels != gimp_item_get_lock_content (item) ||
layer_lock_position != gimp_item_get_lock_position (item) ||
layer_lock_visibility != gimp_item_get_lock_visibility (item) ||
layer_lock_alpha != gimp_layer_get_lock_alpha (layer))
{
gimp_image_undo_group_start (image,
@@ -2399,6 +2425,9 @@ layers_edit_attributes_callback (GtkWidget *dialog,
if (layer_lock_position != gimp_item_get_lock_position (item))
gimp_item_set_lock_position (item, layer_lock_position, TRUE);
if (layer_lock_visibility != gimp_item_get_lock_visibility (item))
gimp_item_set_lock_visibility (item, layer_lock_visibility, TRUE);
if (layer_lock_alpha != gimp_layer_get_lock_alpha (layer))
gimp_layer_set_lock_alpha (layer, layer_lock_alpha, TRUE);
@@ -2469,11 +2498,11 @@ layers_scale_callback (GtkWidget *dialog,
GimpViewable *viewable,
gint width,
gint height,
GimpUnit unit,
GimpUnit *unit,
GimpInterpolationType interpolation,
gdouble xresolution, /* unused */
gdouble yresolution, /* unused */
GimpUnit resolution_unit,/* unused */
GimpUnit *resolution_unit,/* unused */
gpointer user_data)
{
GimpDisplay *display = GIMP_DISPLAY (user_data);
@@ -2530,12 +2559,12 @@ layers_resize_callback (GtkWidget *dialog,
GimpContext *context,
gint width,
gint height,
GimpUnit unit,
GimpUnit *unit,
gint offset_x,
gint offset_y,
gdouble unused0,
gdouble unused1,
GimpUnit unused2,
GimpUnit *unused2,
GimpFillType fill_type,
GimpItemSet unused3,
gboolean unused4,

View File

@@ -59,6 +59,8 @@ libappactions_sources = [
'palette-editor-commands.c',
'palettes-actions.c',
'palettes-commands.c',
'paths-actions.c',
'paths-commands.c',
'patterns-actions.c',
'plug-in-actions.c',
'plug-in-commands.c',
@@ -85,8 +87,6 @@ libappactions_sources = [
'tools-commands.c',
'vector-toolpath-actions.c',
'vector-toolpath-commands.c',
'vectors-actions.c',
'vectors-commands.c',
'view-actions.c',
'view-commands.c',
'window-actions.c',

View File

@@ -39,42 +39,38 @@
static const GimpActionEntry mypaint_brushes_actions[] =
{
{ "mypaint-brushes-popup", GIMP_ICON_MYPAINT_BRUSH,
NC_("mypaint-brushes-action", "MyPaint Brushes Menu"), NULL, NULL, NULL,
GIMP_HELP_MYPAINT_BRUSH_DIALOG },
{ "mypaint-brushes-new", GIMP_ICON_DOCUMENT_NEW,
NC_("mypaint-brushes-action", "_New MyPaint Brush"), NULL,
NC_("mypaint-brushes-action", "_New MyPaint Brush"), NULL, { NULL },
NC_("mypaint-brushes-action", "Create a new MyPaint brush"),
data_new_cmd_callback,
GIMP_HELP_MYPAINT_BRUSH_NEW },
{ "mypaint-brushes-duplicate", GIMP_ICON_OBJECT_DUPLICATE,
NC_("mypaint-brushes-action", "D_uplicate MyPaint Brush"), NULL,
NC_("mypaint-brushes-action", "D_uplicate MyPaint Brush"), NULL, { NULL },
NC_("mypaint-brushes-action", "Duplicate this MyPaint brush"),
data_duplicate_cmd_callback,
GIMP_HELP_MYPAINT_BRUSH_DUPLICATE },
{ "mypaint-brushes-copy-location", GIMP_ICON_EDIT_COPY,
NC_("mypaint-brushes-action", "Copy MyPaint Brush _Location"), NULL,
NC_("mypaint-brushes-action", "Copy MyPaint Brush _Location"), NULL, { NULL },
NC_("mypaint-brushes-action", "Copy MyPaint brush file location to clipboard"),
data_copy_location_cmd_callback,
GIMP_HELP_MYPAINT_BRUSH_COPY_LOCATION },
{ "mypaint-brushes-show-in-file-manager", GIMP_ICON_FILE_MANAGER,
NC_("mypaint-brushes-action", "Show in _File Manager"), NULL,
NC_("mypaint-brushes-action", "Show in _File Manager"), NULL, { NULL },
NC_("mypaint-brushes-action", "Show MyPaint brush file location in the file manager"),
data_show_in_file_manager_cmd_callback,
GIMP_HELP_MYPAINT_BRUSH_SHOW_IN_FILE_MANAGER },
{ "mypaint-brushes-delete", GIMP_ICON_EDIT_DELETE,
NC_("mypaint-brushes-action", "_Delete MyPaint Brush"), NULL,
NC_("mypaint-brushes-action", "_Delete MyPaint Brush"), NULL, { NULL },
NC_("mypaint-brushes-action", "Delete this MyPaint brush"),
data_delete_cmd_callback,
GIMP_HELP_MYPAINT_BRUSH_DELETE },
{ "mypaint-brushes-refresh", GIMP_ICON_VIEW_REFRESH,
NC_("mypaint-brushes-action", "_Refresh MyPaint Brushes"), NULL,
NC_("mypaint-brushes-action", "_Refresh MyPaint Brushes"), NULL, { NULL },
NC_("mypaint-brushes-action", "Refresh MyPaint brushes"),
data_refresh_cmd_callback,
GIMP_HELP_MYPAINT_BRUSH_REFRESH }
@@ -83,7 +79,7 @@ static const GimpActionEntry mypaint_brushes_actions[] =
static const GimpStringActionEntry mypaint_brushes_edit_actions[] =
{
{ "mypaint-brushes-edit", GIMP_ICON_EDIT,
NC_("mypaint-brushes-action", "_Edit MyPaint Brush..."), NULL,
NC_("mypaint-brushes-action", "_Edit MyPaint Brush..."), NULL, { NULL },
NC_("mypaint-brushes-action", "Edit MyPaint brush"),
"gimp-mybrush-editor",
GIMP_HELP_MYPAINT_BRUSH_EDIT }

View File

@@ -40,18 +40,14 @@
static const GimpActionEntry palette_editor_actions[] =
{
{ "palette-editor-popup", GIMP_ICON_PALETTE,
NC_("palette-editor-action", "Palette Editor Menu"), NULL, NULL, NULL,
GIMP_HELP_PALETTE_EDITOR_DIALOG },
{ "palette-editor-edit-color", GIMP_ICON_EDIT,
NC_("palette-editor-action", "_Edit Color..."), NULL,
NC_("palette-editor-action", "_Edit Color..."), NULL, { NULL },
NC_("palette-editor-action", "Edit this entry"),
palette_editor_edit_color_cmd_callback,
GIMP_HELP_PALETTE_EDITOR_EDIT },
{ "palette-editor-delete-color", GIMP_ICON_EDIT_DELETE,
NC_("palette-editor-action", "_Delete Color"), NULL,
NC_("palette-editor-action", "_Delete Color"), NULL, { NULL },
NC_("palette-editor-action", "Delete this entry"),
palette_editor_delete_color_cmd_callback,
GIMP_HELP_PALETTE_EDITOR_DELETE }
@@ -60,7 +56,7 @@ static const GimpActionEntry palette_editor_actions[] =
static const GimpToggleActionEntry palette_editor_toggle_actions[] =
{
{ "palette-editor-edit-active", GIMP_ICON_LINKED,
NC_("palette-editor-action", "Edit Active Palette"), NULL, NULL,
NC_("palette-editor-action", "Edit Active Palette"), NULL, { NULL }, NULL,
data_editor_edit_active_cmd_callback,
FALSE,
GIMP_HELP_PALETTE_EDITOR_EDIT_ACTIVE }
@@ -69,14 +65,14 @@ static const GimpToggleActionEntry palette_editor_toggle_actions[] =
static const GimpEnumActionEntry palette_editor_new_actions[] =
{
{ "palette-editor-new-color-fg", GIMP_ICON_DOCUMENT_NEW,
NC_("palette-editor-action", "New Color from _FG"), NULL,
NC_("palette-editor-action", "New Color from _FG"), NULL, { NULL },
NC_("palette-editor-action",
"Create a new entry from the foreground color"),
FALSE, FALSE,
GIMP_HELP_PALETTE_EDITOR_NEW },
{ "palette-editor-new-color-bg", GIMP_ICON_DOCUMENT_NEW,
NC_("palette-editor-action", "New Color from _BG"), NULL,
NC_("palette-editor-action", "New Color from _BG"), NULL, { NULL },
NC_("palette-editor-action",
"Create a new entry from the background color"),
TRUE, FALSE,
@@ -86,19 +82,19 @@ static const GimpEnumActionEntry palette_editor_new_actions[] =
static const GimpEnumActionEntry palette_editor_zoom_actions[] =
{
{ "palette-editor-zoom-in", GIMP_ICON_ZOOM_IN,
N_("Zoom _In"), NULL,
N_("Zoom _In"), NULL, { NULL },
N_("Zoom in"),
GIMP_ZOOM_IN, FALSE,
GIMP_HELP_PALETTE_EDITOR_ZOOM_IN },
{ "palette-editor-zoom-out", GIMP_ICON_ZOOM_OUT,
N_("Zoom _Out"), NULL,
N_("Zoom _Out"), NULL, { NULL },
N_("Zoom out"),
GIMP_ZOOM_OUT, FALSE,
GIMP_HELP_PALETTE_EDITOR_ZOOM_OUT },
{ "palette-editor-zoom-all", GIMP_ICON_ZOOM_FIT_BEST,
N_("Zoom _All"), NULL,
N_("Zoom _All"), NULL, { NULL },
N_("Zoom all"),
GIMP_ZOOM_OUT_MAX, FALSE,
GIMP_HELP_PALETTE_EDITOR_ZOOM_ALL }
@@ -135,8 +131,6 @@ palette_editor_actions_update (GimpActionGroup *group,
GimpDataEditor *data_editor = GIMP_DATA_EDITOR (user_data);
GimpData *data;
gboolean editable = FALSE;
GimpRGB fg;
GimpRGB bg;
gboolean edit_active = FALSE;
data = data_editor->data;
@@ -147,12 +141,6 @@ palette_editor_actions_update (GimpActionGroup *group,
editable = TRUE;
}
if (data_editor->context)
{
gimp_context_get_foreground (data_editor->context, &fg);
gimp_context_get_background (data_editor->context, &bg);
}
edit_active = gimp_data_editor_get_edit_active (data_editor);
#define SET_SENSITIVE(action,condition) \
@@ -168,8 +156,8 @@ palette_editor_actions_update (GimpActionGroup *group,
SET_SENSITIVE ("palette-editor-new-color-fg", editable);
SET_SENSITIVE ("palette-editor-new-color-bg", editable);
SET_COLOR ("palette-editor-new-color-fg", data_editor->context ? &fg : NULL);
SET_COLOR ("palette-editor-new-color-bg", data_editor->context ? &bg : NULL);
SET_COLOR ("palette-editor-new-color-fg", data_editor->context ? gimp_context_get_foreground (data_editor->context) : NULL);
SET_COLOR ("palette-editor-new-color-bg", data_editor->context ? gimp_context_get_background (data_editor->context) : NULL);
SET_SENSITIVE ("palette-editor-zoom-out", data);
SET_SENSITIVE ("palette-editor-zoom-in", data);

View File

@@ -56,14 +56,14 @@ palette_editor_new_color_cmd_callback (GimpAction *action,
{
GimpPalette *palette = GIMP_PALETTE (data_editor->data);
GimpPaletteEntry *entry;
GimpRGB color;
GeglColor *color;
if (background)
gimp_context_get_background (data_editor->context, &color);
color = gimp_context_get_background (data_editor->context);
else
gimp_context_get_foreground (data_editor->context, &color);
color = gimp_context_get_foreground (data_editor->context);
entry = gimp_palette_add_entry (palette, -1, NULL, &color);
entry = gimp_palette_add_entry (palette, -1, NULL, color);
gimp_palette_view_select_entry (GIMP_PALETTE_VIEW (editor->view), entry);
}
}

View File

@@ -40,54 +40,50 @@
static const GimpActionEntry palettes_actions[] =
{
{ "palettes-popup", GIMP_ICON_PALETTE,
NC_("palettes-action", "Palettes Menu"), NULL, NULL, NULL,
GIMP_HELP_PALETTE_DIALOG },
{ "palettes-new", GIMP_ICON_DOCUMENT_NEW,
NC_("palettes-action", "_New Palette"), NULL,
NC_("palettes-action", "_New Palette"), NULL, { NULL },
NC_("palettes-action", "Create a new palette"),
data_new_cmd_callback,
GIMP_HELP_PALETTE_NEW },
{ "palettes-import", "gtk-convert",
NC_("palettes-action", "_Import Palette..."), NULL,
NC_("palettes-action", "_Import Palette..."), NULL, { NULL },
NC_("palettes-action", "Import palette"),
palettes_import_cmd_callback,
GIMP_HELP_PALETTE_IMPORT },
{ "palettes-duplicate", GIMP_ICON_OBJECT_DUPLICATE,
NC_("palettes-action", "D_uplicate Palette"), NULL,
NC_("palettes-action", "D_uplicate Palette"), NULL, { NULL },
NC_("palettes-action", "Duplicate this palette"),
data_duplicate_cmd_callback,
GIMP_HELP_PALETTE_DUPLICATE },
{ "palettes-merge", NULL,
NC_("palettes-action", "_Merge Palettes..."), NULL,
NC_("palettes-action", "_Merge Palettes..."), NULL, { NULL },
NC_("palettes-action", "Merge palettes"),
palettes_merge_cmd_callback,
GIMP_HELP_PALETTE_MERGE },
{ "palettes-copy-location", GIMP_ICON_EDIT_COPY,
NC_("palettes-action", "Copy Palette _Location"), NULL,
NC_("palettes-action", "Copy Palette _Location"), NULL, { NULL },
NC_("palettes-action", "Copy palette file location to clipboard"),
data_copy_location_cmd_callback,
GIMP_HELP_PALETTE_COPY_LOCATION },
{ "palettes-show-in-file-manager", GIMP_ICON_FILE_MANAGER,
NC_("palettes-action", "Show in _File Manager"), NULL,
NC_("palettes-action", "Show in _File Manager"), NULL, { NULL },
NC_("palettes-action", "Show palette file location in the file manager"),
data_show_in_file_manager_cmd_callback,
GIMP_HELP_PALETTE_SHOW_IN_FILE_MANAGER },
{ "palettes-delete", GIMP_ICON_EDIT_DELETE,
NC_("palettes-action", "_Delete Palette"), NULL,
NC_("palettes-action", "_Delete Palette"), NULL, { NULL },
NC_("palettes-action", "Delete this palette"),
data_delete_cmd_callback,
GIMP_HELP_PALETTE_DELETE },
{ "palettes-refresh", GIMP_ICON_VIEW_REFRESH,
NC_("palettes-action", "_Refresh Palettes"), NULL,
NC_("palettes-action", "_Refresh Palettes"), NULL, { NULL },
NC_("palettes-action", "Refresh palettes"),
data_refresh_cmd_callback,
GIMP_HELP_PALETTE_REFRESH }
@@ -96,7 +92,7 @@ static const GimpActionEntry palettes_actions[] =
static const GimpStringActionEntry palettes_edit_actions[] =
{
{ "palettes-edit", GIMP_ICON_EDIT,
NC_("palettes-action", "_Edit Palette..."), NULL,
NC_("palettes-action", "_Edit Palette..."), NULL, { NULL },
NC_("palettes-action", "Edit this palette"),
"gimp-palette-editor",
GIMP_HELP_PALETTE_EDIT }

View File

@@ -145,7 +145,7 @@ palettes_merge_callback (GtkWidget *widget,
gimp_palette_add_entry (new_palette, -1,
entry->name,
&entry->color);
entry->color);
}
}

462
app/actions/paths-actions.c Normal file
View File

@@ -0,0 +1,462 @@
/* GIMP - The GNU Image Manipulation Program
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
#include "config.h"
#include <gegl.h>
#include <gtk/gtk.h>
#include "libgimpwidgets/gimpwidgets.h"
#include "actions-types.h"
#include "core/gimpchannel.h"
#include "core/gimpcontainer.h"
#include "core/gimpimage.h"
#include "widgets/gimpactiongroup.h"
#include "widgets/gimphelp-ids.h"
#include "widgets/gimpwidgets-utils.h"
#include "actions.h"
#include "items-actions.h"
#include "paths-actions.h"
#include "paths-commands.h"
#include "gimp-intl.h"
static const GimpActionEntry paths_actions[] =
{
{ "paths-edit", GIMP_ICON_TOOL_PATH,
NC_("paths-action", "Edit Pa_th"), NULL, { NULL },
NC_("paths-action", "Edit the active path"),
paths_edit_cmd_callback,
GIMP_HELP_TOOL_VECTORS },
{ "paths-edit-attributes", GIMP_ICON_EDIT,
NC_("paths-action", "_Edit Path Attributes..."), NULL, { NULL },
NC_("paths-action", "Edit path attributes"),
paths_edit_attributes_cmd_callback,
GIMP_HELP_PATH_EDIT },
{ "paths-new", GIMP_ICON_DOCUMENT_NEW,
NC_("paths-action", "_New Path..."), NULL, { NULL },
NC_("paths-action", "Create a new path..."),
paths_new_cmd_callback,
GIMP_HELP_PATH_NEW },
{ "paths-new-last-values", GIMP_ICON_DOCUMENT_NEW,
NC_("paths-action", "_New Path with last values"), NULL, { NULL },
NC_("paths-action", "Create a new path with last used values"),
paths_new_last_vals_cmd_callback,
GIMP_HELP_PATH_NEW },
{ "paths-duplicate", GIMP_ICON_OBJECT_DUPLICATE,
NC_("paths-action", "D_uplicate Paths"), NULL, { NULL },
NC_("paths-action", "Duplicate these paths"),
paths_duplicate_cmd_callback,
GIMP_HELP_PATH_DUPLICATE },
{ "paths-delete", GIMP_ICON_EDIT_DELETE,
NC_("paths-action", "_Delete Paths"), NULL, { NULL },
NC_("paths-action", "Delete the selected paths"),
paths_delete_cmd_callback,
GIMP_HELP_PATH_DELETE },
{ "paths-merge-visible", NULL,
NC_("paths-action", "Merge _Visible Paths"), NULL, { NULL }, NULL,
paths_merge_visible_cmd_callback,
GIMP_HELP_PATH_MERGE_VISIBLE },
{ "paths-raise", GIMP_ICON_GO_UP,
NC_("paths-action", "_Raise Paths"), NULL, { NULL },
NC_("paths-action", "Raise the selected paths"),
paths_raise_cmd_callback,
GIMP_HELP_PATH_RAISE },
{ "paths-raise-to-top", GIMP_ICON_GO_TOP,
NC_("paths-action", "Raise Paths to _Top"), NULL, { NULL },
NC_("paths-action", "Raise the selected paths to the top"),
paths_raise_to_top_cmd_callback,
GIMP_HELP_PATH_RAISE_TO_TOP },
{ "paths-lower", GIMP_ICON_GO_DOWN,
NC_("paths-action", "_Lower Paths"), NULL, { NULL },
NC_("paths-action", "Lower the selected paths"),
paths_lower_cmd_callback,
GIMP_HELP_PATH_LOWER },
{ "paths-lower-to-bottom", GIMP_ICON_GO_BOTTOM,
NC_("paths-action", "Lower Paths to _Bottom"), NULL, { NULL },
NC_("paths-action", "Lower the selected paths to the bottom"),
paths_lower_to_bottom_cmd_callback,
GIMP_HELP_PATH_LOWER_TO_BOTTOM },
{ "paths-fill", GIMP_ICON_TOOL_BUCKET_FILL,
NC_("paths-action", "Fill Pat_hs..."), NULL, { NULL },
NC_("paths-action", "Fill the paths"),
paths_fill_cmd_callback,
GIMP_HELP_PATH_FILL },
{ "paths-fill-last-values", GIMP_ICON_TOOL_BUCKET_FILL,
NC_("paths-action", "Fill Paths"), NULL, { NULL },
NC_("paths-action", "Fill the paths with last values"),
paths_fill_last_vals_cmd_callback,
GIMP_HELP_PATH_FILL },
{ "paths-stroke", GIMP_ICON_PATH_STROKE,
NC_("paths-action", "Stro_ke Paths..."), NULL, { NULL },
NC_("paths-action", "Paint along the paths"),
paths_stroke_cmd_callback,
GIMP_HELP_PATH_STROKE },
{ "paths-stroke-last-values", GIMP_ICON_PATH_STROKE,
NC_("paths-action", "Stro_ke Paths"), NULL, { NULL },
NC_("paths-action", "Paint along the paths with last values"),
paths_stroke_last_vals_cmd_callback,
GIMP_HELP_PATH_STROKE },
{ "paths-copy", GIMP_ICON_EDIT_COPY,
NC_("paths-action", "Co_py Paths"), NULL, { NULL }, NULL,
paths_copy_cmd_callback,
GIMP_HELP_PATH_COPY },
{ "paths-paste", GIMP_ICON_EDIT_PASTE,
NC_("paths-action", "Paste Pat_h"), NULL, { NULL }, NULL,
paths_paste_cmd_callback,
GIMP_HELP_PATH_PASTE },
{ "paths-export", GIMP_ICON_DOCUMENT_SAVE,
NC_("paths-action", "E_xport Paths..."), NULL, { NULL }, NULL,
paths_export_cmd_callback,
GIMP_HELP_PATH_EXPORT },
{ "paths-import", GIMP_ICON_DOCUMENT_OPEN,
NC_("paths-action", "I_mport Path..."), NULL, { NULL }, NULL,
paths_import_cmd_callback,
GIMP_HELP_PATH_IMPORT }
};
static const GimpToggleActionEntry paths_toggle_actions[] =
{
{ "paths-visible", GIMP_ICON_VISIBLE,
NC_("paths-action", "Toggle Path _Visibility"), NULL, { NULL }, NULL,
paths_visible_cmd_callback,
FALSE,
GIMP_HELP_PATH_VISIBLE },
{ "paths-lock-content", GIMP_ICON_LOCK_CONTENT,
NC_("paths-action", "L_ock Strokes of Path"), NULL, { NULL }, NULL,
paths_lock_content_cmd_callback,
FALSE,
GIMP_HELP_PATH_LOCK_STROKES },
{ "paths-lock-position", GIMP_ICON_LOCK_POSITION,
NC_("paths-action", "L_ock Position of Path"), NULL, { NULL }, NULL,
paths_lock_position_cmd_callback,
FALSE,
GIMP_HELP_PATH_LOCK_POSITION }
};
static const GimpEnumActionEntry paths_color_tag_actions[] =
{
{ "paths-color-tag-none", GIMP_ICON_EDIT_CLEAR,
NC_("paths-action", "None"), NULL, { NULL },
NC_("paths-action", "Path Color Tag: Clear"),
GIMP_COLOR_TAG_NONE, FALSE,
GIMP_HELP_PATH_COLOR_TAG },
{ "paths-color-tag-blue", NULL,
NC_("paths-action", "Blue"), NULL, { NULL },
NC_("paths-action", "Path Color Tag: Set to Blue"),
GIMP_COLOR_TAG_BLUE, FALSE,
GIMP_HELP_PATH_COLOR_TAG },
{ "paths-color-tag-green", NULL,
NC_("paths-action", "Green"), NULL, { NULL },
NC_("paths-action", "Path Color Tag: Set to Green"),
GIMP_COLOR_TAG_GREEN, FALSE,
GIMP_HELP_PATH_COLOR_TAG },
{ "paths-color-tag-yellow", NULL,
NC_("paths-action", "Yellow"), NULL, { NULL },
NC_("paths-action", "Path Color Tag: Set to Yellow"),
GIMP_COLOR_TAG_YELLOW, FALSE,
GIMP_HELP_PATH_COLOR_TAG },
{ "paths-color-tag-orange", NULL,
NC_("paths-action", "Orange"), NULL, { NULL },
NC_("paths-action", "Path Color Tag: Set to Orange"),
GIMP_COLOR_TAG_ORANGE, FALSE,
GIMP_HELP_PATH_COLOR_TAG },
{ "paths-color-tag-brown", NULL,
NC_("paths-action", "Brown"), NULL, { NULL },
NC_("paths-action", "Path Color Tag: Set to Brown"),
GIMP_COLOR_TAG_BROWN, FALSE,
GIMP_HELP_PATH_COLOR_TAG },
{ "paths-color-tag-red", NULL,
NC_("paths-action", "Red"), NULL, { NULL },
NC_("paths-action", "Path Color Tag: Set to Red"),
GIMP_COLOR_TAG_RED, FALSE,
GIMP_HELP_PATH_COLOR_TAG },
{ "paths-color-tag-violet", NULL,
NC_("paths-action", "Violet"), NULL, { NULL },
NC_("paths-action", "Path Color Tag: Set to Violet"),
GIMP_COLOR_TAG_VIOLET, FALSE,
GIMP_HELP_PATH_COLOR_TAG },
{ "paths-color-tag-gray", NULL,
NC_("paths-action", "Gray"), NULL, { NULL },
NC_("paths-action", "Path Color Tag: Set to Gray"),
GIMP_COLOR_TAG_GRAY, FALSE,
GIMP_HELP_PATH_COLOR_TAG }
};
static const GimpEnumActionEntry paths_to_selection_actions[] =
{
{ "paths-selection-replace", GIMP_ICON_SELECTION_REPLACE,
NC_("paths-action", "Paths to Sele_ction"), NULL, { NULL },
NC_("paths-action", "Path to selection"),
GIMP_CHANNEL_OP_REPLACE, FALSE,
GIMP_HELP_PATH_SELECTION_REPLACE },
{ "paths-selection-from-paths", GIMP_ICON_SELECTION_REPLACE,
NC_("paths-action", "Selection Fr_om Paths"), NULL, { "<shift>V", NULL },
NC_("paths-action", "Replace selection with paths"),
GIMP_CHANNEL_OP_REPLACE, FALSE,
GIMP_HELP_PATH_SELECTION_REPLACE },
{ "paths-selection-add", GIMP_ICON_SELECTION_ADD,
NC_("paths-action", "_Add Paths to Selection"), NULL, { NULL },
NC_("paths-action", "Add paths to selection"),
GIMP_CHANNEL_OP_ADD, FALSE,
GIMP_HELP_PATH_SELECTION_ADD },
{ "paths-selection-subtract", GIMP_ICON_SELECTION_SUBTRACT,
NC_("paths-action", "_Subtract Paths from Selection"), NULL, { NULL },
NC_("paths-action", "Subtract paths from selection"),
GIMP_CHANNEL_OP_SUBTRACT, FALSE,
GIMP_HELP_PATH_SELECTION_SUBTRACT },
{ "paths-selection-intersect", GIMP_ICON_SELECTION_INTERSECT,
NC_("paths-action", "_Intersect Paths with Selection"), NULL, { NULL },
NC_("paths-action", "Intersect paths with selection"),
GIMP_CHANNEL_OP_INTERSECT, FALSE,
GIMP_HELP_PATH_SELECTION_INTERSECT }
};
static const GimpEnumActionEntry paths_selection_to_paths_actions[] =
{
{ "paths-selection-to-path", GIMP_ICON_SELECTION_TO_PATH,
NC_("paths-action", "Selecti_on to Path"),
NC_("paths-action", "To _Path"), { NULL },
NC_("paths-action", "Selection to path"),
FALSE, FALSE,
GIMP_HELP_SELECTION_TO_PATH },
{ "paths-selection-to-path-advanced", GIMP_ICON_SELECTION_TO_PATH,
NC_("paths-action", "Selection to Path (_Advanced)"), NULL, { NULL },
NC_("paths-action", "Advanced options"),
TRUE, FALSE,
GIMP_HELP_SELECTION_TO_PATH }
};
static const GimpEnumActionEntry paths_select_actions[] =
{
{ "paths-select-top", NULL,
NC_("paths-action", "Select _Top Path"), NULL, { NULL },
NC_("paths-action", "Select the topmost path"),
GIMP_ACTION_SELECT_FIRST, FALSE,
GIMP_HELP_PATH_TOP },
{ "paths-select-bottom", NULL,
NC_("paths-action", "Select _Bottom Path"), NULL, { NULL },
NC_("paths-action", "Select the bottommost path"),
GIMP_ACTION_SELECT_LAST, FALSE,
GIMP_HELP_PATH_BOTTOM },
{ "paths-select-previous", NULL,
NC_("paths-action", "Select _Previous Path"), NULL, { NULL },
NC_("paths-action", "Select the path above the current path"),
GIMP_ACTION_SELECT_PREVIOUS, FALSE,
GIMP_HELP_PATH_PREVIOUS },
{ "paths-select-next", NULL,
NC_("paths-action", "Select _Next Path"), NULL, { NULL },
NC_("paths-action", "Select the path below the current path"),
GIMP_ACTION_SELECT_NEXT, FALSE,
GIMP_HELP_PATH_NEXT }
};
void
paths_actions_setup (GimpActionGroup *group)
{
gimp_action_group_add_actions (group, "paths-action",
paths_actions,
G_N_ELEMENTS (paths_actions));
gimp_action_group_add_toggle_actions (group, "paths-action",
paths_toggle_actions,
G_N_ELEMENTS (paths_toggle_actions));
gimp_action_group_add_enum_actions (group, "paths-action",
paths_color_tag_actions,
G_N_ELEMENTS (paths_color_tag_actions),
paths_color_tag_cmd_callback);
gimp_action_group_add_enum_actions (group, "paths-action",
paths_to_selection_actions,
G_N_ELEMENTS (paths_to_selection_actions),
paths_to_selection_cmd_callback);
gimp_action_group_add_enum_actions (group, "paths-action",
paths_selection_to_paths_actions,
G_N_ELEMENTS (paths_selection_to_paths_actions),
paths_selection_to_paths_cmd_callback);
gimp_action_group_add_enum_actions (group, "paths-action",
paths_select_actions,
G_N_ELEMENTS (paths_select_actions),
paths_select_cmd_callback);
items_actions_setup (group, "paths");
}
void
paths_actions_update (GimpActionGroup *group,
gpointer data)
{
GimpImage *image = action_data_get_image (data);
GList *selected_path = NULL;
gint n_selected_paths = 0;
gint n_paths = 0;
gboolean mask_empty = TRUE;
gboolean dr_writable = FALSE;
gboolean dr_children = FALSE;
gboolean have_prev = FALSE; /* At least 1 selected path has a previous sibling. */
gboolean have_next = FALSE; /* At least 1 selected path has a next sibling. */
gboolean first_selected = FALSE; /* First channel is selected */
gboolean last_selected = FALSE; /* Last channel is selected */
if (image)
{
GList *drawables;
GList *iter;
n_paths = gimp_image_get_n_paths (image);
mask_empty = gimp_channel_is_empty (gimp_image_get_mask (image));
selected_path = gimp_image_get_selected_paths (image);
n_selected_paths = g_list_length (selected_path);
for (iter = selected_path; iter; iter = iter->next)
{
GList *paths_list;
GList *iter2;
paths_list = gimp_item_get_container_iter (GIMP_ITEM (iter->data));
iter2 = g_list_find (paths_list, iter->data);
if (iter2)
{
if (gimp_item_get_index (iter2->data) == 0)
first_selected = TRUE;
if (gimp_item_get_index (iter2->data) == n_paths - 1)
last_selected = TRUE;
if (g_list_previous (iter2))
have_prev = TRUE;
if (g_list_next (iter2))
have_next = TRUE;
}
}
drawables = gimp_image_get_selected_drawables (image);
if (g_list_length (drawables) == 1)
{
dr_writable = ! gimp_item_is_content_locked (GIMP_ITEM (drawables->data), NULL);
if (gimp_viewable_get_children (GIMP_VIEWABLE (drawables->data)))
dr_children = TRUE;
}
g_list_free (drawables);
}
#define SET_SENSITIVE(action,condition) \
gimp_action_group_set_action_sensitive (group, action, (condition) != 0, NULL)
#define SET_ACTIVE(action,condition) \
gimp_action_group_set_action_active (group, action, (condition) != 0)
SET_SENSITIVE ("paths-edit", n_selected_paths == 1);
SET_SENSITIVE ("paths-edit-attributes", n_selected_paths == 1);
SET_SENSITIVE ("paths-new", image);
SET_SENSITIVE ("paths-new-last-values", image);
SET_SENSITIVE ("paths-duplicate", n_selected_paths > 0);
SET_SENSITIVE ("paths-delete", n_selected_paths > 0);
SET_SENSITIVE ("paths-merge-visible", n_paths > 1);
SET_SENSITIVE ("paths-raise", n_selected_paths > 0 && have_prev && !first_selected);
SET_SENSITIVE ("paths-raise-to-top", n_selected_paths > 0 && have_prev);
SET_SENSITIVE ("paths-lower", n_selected_paths > 0 && have_next && !last_selected);
SET_SENSITIVE ("paths-lower-to-bottom", n_selected_paths > 0 && have_next);
SET_SENSITIVE ("paths-copy", n_selected_paths > 0);
SET_SENSITIVE ("paths-paste", image);
SET_SENSITIVE ("paths-export", n_selected_paths > 0);
SET_SENSITIVE ("paths-import", image);
SET_SENSITIVE ("paths-selection-to-path", image && !mask_empty);
SET_SENSITIVE ("paths-selection-to-path-advanced", image && !mask_empty);
SET_SENSITIVE ("paths-fill", n_selected_paths > 0 &&
dr_writable &&
!dr_children);
SET_SENSITIVE ("paths-fill-last-values", n_selected_paths > 0 &&
dr_writable &&
!dr_children);
SET_SENSITIVE ("paths-stroke", n_selected_paths > 0 &&
dr_writable &&
!dr_children);
SET_SENSITIVE ("paths-stroke-last-values", n_selected_paths > 0 &&
dr_writable &&
!dr_children);
SET_SENSITIVE ("paths-selection-replace", n_selected_paths > 0);
SET_SENSITIVE ("paths-selection-from-paths", n_selected_paths > 0);
SET_SENSITIVE ("paths-selection-add", n_selected_paths > 0);
SET_SENSITIVE ("paths-selection-subtract", n_selected_paths > 0);
SET_SENSITIVE ("paths-selection-intersect", n_selected_paths > 0);
SET_SENSITIVE ("paths-select-top", n_selected_paths > 0 && have_prev);
SET_SENSITIVE ("paths-select-bottom", n_selected_paths > 0 && have_next);
SET_SENSITIVE ("paths-select-previous", n_selected_paths > 0 && have_prev);
SET_SENSITIVE ("paths-select-next", n_selected_paths > 0 && have_next);
#undef SET_SENSITIVE
#undef SET_ACTIVE
items_actions_update (group, "paths", selected_path);
}

View File

@@ -0,0 +1,27 @@
/* GIMP - The GNU Image Manipulation Program
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
#ifndef __PATHS_ACTIONS_H__
#define __PATHS_ACTIONS_H__
void paths_actions_setup (GimpActionGroup *group);
void paths_actions_update (GimpActionGroup *group,
gpointer data);
#endif /* __PATHS_ACTIONS_H__ */

1052
app/actions/paths-commands.c Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,109 @@
/* GIMP - The GNU Image Manipulation Program
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
#ifndef __PATHS_COMMANDS_H__
#define __PATHS_COMMANDS_H__
void paths_edit_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data);
void paths_edit_attributes_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data);
void paths_new_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data);
void paths_new_last_vals_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data);
void paths_raise_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data);
void paths_raise_to_top_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data);
void paths_lower_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data);
void paths_lower_to_bottom_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data);
void paths_duplicate_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data);
void paths_delete_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data);
void paths_merge_visible_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data);
void paths_to_selection_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data);
void paths_selection_to_paths_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data);
void paths_fill_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data);
void paths_fill_last_vals_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data);
void paths_stroke_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data);
void paths_stroke_last_vals_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data);
void paths_copy_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data);
void paths_paste_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data);
void paths_export_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data);
void paths_import_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data);
void paths_visible_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data);
void paths_lock_content_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data);
void paths_lock_position_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data);
void paths_color_tag_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data);
void paths_select_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data);
#endif /* __PATHS_COMMANDS_H__ */

View File

@@ -39,48 +39,44 @@
static const GimpActionEntry patterns_actions[] =
{
{ "patterns-popup", GIMP_ICON_PATTERN,
NC_("patterns-action", "Patterns Menu"), NULL, NULL, NULL,
GIMP_HELP_PATTERN_DIALOG },
{ "patterns-open-as-image", GIMP_ICON_DOCUMENT_OPEN,
NC_("patterns-action", "_Open Pattern as Image"), NULL,
NC_("patterns-action", "_Open Pattern as Image"), NULL, { NULL },
NC_("patterns-action", "Open this pattern as an image"),
data_open_as_image_cmd_callback,
GIMP_HELP_PATTERN_OPEN_AS_IMAGE },
{ "patterns-new", GIMP_ICON_DOCUMENT_NEW,
NC_("patterns-action", "_New Pattern"), NULL,
NC_("patterns-action", "_New Pattern"), NULL, { NULL },
NC_("patterns-action", "Create a new pattern"),
data_new_cmd_callback,
GIMP_HELP_PATTERN_NEW },
{ "patterns-duplicate", GIMP_ICON_OBJECT_DUPLICATE,
NC_("patterns-action", "D_uplicate Pattern"), NULL,
NC_("patterns-action", "D_uplicate Pattern"), NULL, { NULL },
NC_("patterns-action", "Duplicate this pattern"),
data_duplicate_cmd_callback,
GIMP_HELP_PATTERN_DUPLICATE },
{ "patterns-copy-location", GIMP_ICON_EDIT_COPY,
NC_("patterns-action", "Copy Pattern _Location"), NULL,
NC_("patterns-action", "Copy Pattern _Location"), NULL, { NULL },
NC_("patterns-action", "Copy pattern file location to clipboard"),
data_copy_location_cmd_callback,
GIMP_HELP_PATTERN_COPY_LOCATION },
{ "patterns-show-in-file-manager", GIMP_ICON_FILE_MANAGER,
NC_("patterns-action", "Show in _File Manager"), NULL,
NC_("patterns-action", "Show in _File Manager"), NULL, { NULL },
NC_("patterns-action", "Show pattern file location in the file manager"),
data_show_in_file_manager_cmd_callback,
GIMP_HELP_PATTERN_SHOW_IN_FILE_MANAGER },
{ "patterns-delete", GIMP_ICON_EDIT_DELETE,
NC_("patterns-action", "_Delete Pattern"), NULL,
NC_("patterns-action", "_Delete Pattern"), NULL, { NULL },
NC_("patterns-action", "Delete this pattern"),
data_delete_cmd_callback,
GIMP_HELP_PATTERN_DELETE },
{ "patterns-refresh", GIMP_ICON_VIEW_REFRESH,
NC_("patterns-action", "_Refresh Patterns"), NULL,
NC_("patterns-action", "_Refresh Patterns"), NULL, { NULL },
NC_("patterns-action", "Refresh patterns"),
data_refresh_cmd_callback,
GIMP_HELP_PATTERN_REFRESH }
@@ -89,7 +85,7 @@ static const GimpActionEntry patterns_actions[] =
static const GimpStringActionEntry patterns_edit_actions[] =
{
{ "patterns-edit", GIMP_ICON_EDIT,
NC_("patterns-action", "_Edit Pattern..."), NULL,
NC_("patterns-action", "_Edit Pattern..."), NULL, { NULL },
NC_("patterns-action", "Edit pattern"),
"gimp-pattern-editor",
GIMP_HELP_PATTERN_EDIT }

View File

@@ -34,7 +34,6 @@
#include "plug-in/gimppluginmanager.h"
#include "plug-in/gimppluginmanager-help-domain.h"
#include "plug-in/gimppluginmanager-locale-domain.h"
#include "plug-in/gimppluginmanager-menu-branch.h"
#include "plug-in/gimppluginprocedure.h"
@@ -52,36 +51,22 @@
/* local function prototypes */
static void plug_in_actions_menu_branch_added (GimpPlugInManager *manager,
GFile *file,
const gchar *menu_path,
const gchar *menu_label,
GimpActionGroup *group);
static void plug_in_actions_register_procedure (GimpPDB *pdb,
GimpProcedure *procedure,
GimpActionGroup *group);
static void plug_in_actions_unregister_procedure (GimpPDB *pdb,
GimpProcedure *procedure,
GimpActionGroup *group);
static void plug_in_actions_menu_path_added (GimpPlugInProcedure *proc,
const gchar *menu_path,
GimpActionGroup *group);
static void plug_in_actions_add_proc (GimpActionGroup *group,
GimpPlugInProcedure *proc);
static gboolean plug_in_actions_check_translation (const gchar *original,
const gchar *translated);
static void plug_in_actions_build_path (GimpActionGroup *group,
const gchar *original,
const gchar *translated);
/* private variables */
static const GimpActionEntry plug_in_actions[] =
{
{ "plug-in-reset-all", GIMP_ICON_RESET,
NC_("plug-in-action", "Reset all _Filters"), NULL,
NC_("plug-in-action", "Reset all _Filters"), NULL, { NULL },
NC_("plug-in-action", "Reset all plug-ins to their default settings"),
plug_in_reset_all_cmd_callback,
GIMP_HELP_FILTER_RESET_ALL }
@@ -100,24 +85,6 @@ plug_in_actions_setup (GimpActionGroup *group)
plug_in_actions,
G_N_ELEMENTS (plug_in_actions));
for (list = gimp_plug_in_manager_get_menu_branches (manager);
list;
list = g_slist_next (list))
{
GimpPlugInMenuBranch *branch = list->data;
plug_in_actions_menu_branch_added (manager,
branch->file,
branch->menu_path,
branch->menu_label,
group);
}
g_signal_connect_object (manager,
"menu-branch-added",
G_CALLBACK (plug_in_actions_menu_branch_added),
group, 0);
for (list = manager->plug_in_procedures;
list;
list = g_slist_next (list))
@@ -157,7 +124,7 @@ plug_in_actions_update (GimpActionGroup *group,
GimpProcedure *procedure = GIMP_PROCEDURE (proc);
gboolean sensitive;
const gchar *tooltip;
const gchar *reason;
const gchar *reason = NULL;
sensitive = gimp_procedure_get_sensitive (procedure,
GIMP_OBJECT (image),
@@ -179,36 +146,6 @@ plug_in_actions_update (GimpActionGroup *group,
/* private functions */
static void
plug_in_actions_menu_branch_added (GimpPlugInManager *manager,
GFile *file,
const gchar *menu_path,
const gchar *menu_label,
GimpActionGroup *group)
{
const gchar *locale_domain;
const gchar *path_translated;
const gchar *label_translated;
gchar *full;
gchar *full_translated;
locale_domain = gimp_plug_in_manager_get_locale_domain (manager, file, NULL);
path_translated = dgettext (locale_domain, menu_path);
label_translated = dgettext (locale_domain, menu_label);
full = g_strconcat (menu_path, "/", menu_label, NULL);
full_translated = g_strconcat (path_translated, "/", label_translated, NULL);
if (plug_in_actions_check_translation (full, full_translated))
plug_in_actions_build_path (group, full, full_translated);
else
plug_in_actions_build_path (group, full, full);
g_free (full_translated);
g_free (full);
}
static void
plug_in_actions_register_procedure (GimpPDB *pdb,
GimpProcedure *procedure,
@@ -218,10 +155,6 @@ plug_in_actions_register_procedure (GimpPDB *pdb,
{
GimpPlugInProcedure *plug_in_proc = GIMP_PLUG_IN_PROCEDURE (procedure);
g_signal_connect_object (plug_in_proc, "menu-path-added",
G_CALLBACK (plug_in_actions_menu_path_added),
group, 0);
if (plug_in_proc->menu_label &&
! plug_in_proc->file_proc)
{
@@ -244,10 +177,6 @@ plug_in_actions_unregister_procedure (GimpPDB *pdb,
{
GimpPlugInProcedure *plug_in_proc = GIMP_PLUG_IN_PROCEDURE (procedure);
g_signal_handlers_disconnect_by_func (plug_in_proc,
plug_in_actions_menu_path_added,
group);
if (plug_in_proc->menu_label &&
! plug_in_proc->file_proc)
{
@@ -267,38 +196,11 @@ plug_in_actions_unregister_procedure (GimpPDB *pdb,
}
}
static void
plug_in_actions_menu_path_added (GimpPlugInProcedure *plug_in_proc,
const gchar *menu_path,
GimpActionGroup *group)
{
const gchar *locale_domain;
const gchar *path_translated;
#if 0
g_print ("%s: %s (%s)\n", G_STRFUNC,
gimp_object_get_name (plug_in_proc), menu_path);
#endif
locale_domain = gimp_plug_in_procedure_get_locale_domain (plug_in_proc);
path_translated = dgettext (locale_domain, menu_path);
if (plug_in_actions_check_translation (menu_path, path_translated))
plug_in_actions_build_path (group, menu_path, path_translated);
else
plug_in_actions_build_path (group, menu_path, menu_path);
}
static void
plug_in_actions_add_proc (GimpActionGroup *group,
GimpPlugInProcedure *proc)
{
GimpProcedureActionEntry entry;
const gchar *locale_domain;
GList *list;
locale_domain = gimp_plug_in_procedure_get_locale_domain (proc);
entry.name = gimp_object_get_name (proc);
entry.icon_name = gimp_viewable_get_icon_name (GIMP_VIEWABLE (proc));
@@ -311,17 +213,6 @@ plug_in_actions_add_proc (GimpActionGroup *group,
gimp_action_group_add_procedure_actions (group, &entry, 1,
plug_in_run_cmd_callback);
for (list = proc->menu_paths; list; list = g_list_next (list))
{
const gchar *original = list->data;
const gchar *translated = dgettext (locale_domain, original);
if (plug_in_actions_check_translation (original, translated))
plug_in_actions_build_path (group, original, translated);
else
plug_in_actions_build_path (group, original, original);
}
if (proc->image_types_val)
{
GimpContext *context = gimp_get_user_context (group->gimp);
@@ -345,118 +236,3 @@ plug_in_actions_add_proc (GimpActionGroup *group,
tooltip);
}
}
static gboolean
plug_in_actions_check_translation (const gchar *original,
const gchar *translated)
{
const gchar *p1;
const gchar *p2;
/* first check if <Prefix> is present and identical in both strings */
p1 = strchr (original, '>');
p2 = strchr (translated, '>');
if (!p1 || !p2 ||
(p1 - original) != (p2 - translated) ||
strncmp (original, translated, p1 - original))
{
g_printerr ("bad translation \"%s\"\n"
"for menu path \"%s\"\n"
"(<Prefix> must not be translated)\n\n",
translated, original);
return FALSE;
}
p1++;
p2++;
/* then check if either a '/' or nothing follows in *both* strings */
if (! ((*p1 == '/' && *p2 == '/') ||
(*p1 == '\0' && *p2 == '\0')))
{
g_printerr ("bad translation \"%s\"\n"
"for menu path \"%s\"\n"
"(<Prefix> must be followed by either nothing or '/')\n\n",
translated, original);
return FALSE;
}
/* then check the number of slashes in the remaining string */
while (p1 && p2)
{
p1 = strchr (p1, '/');
p2 = strchr (p2, '/');
if (p1) p1++;
if (p2) p2++;
}
if (p1 || p2)
{
g_printerr ("bad translation \"%s\"\n"
"for menu path \"%s\"\n"
"(number of '/' must be the same)\n\n",
translated, original);
return FALSE;
}
return TRUE;
}
static void
plug_in_actions_build_path (GimpActionGroup *group,
const gchar *path_original,
const gchar *path_translated)
{
GHashTable *path_table;
gchar *copy_original;
gchar *copy_translated;
gchar *p1, *p2;
path_table = g_object_get_data (G_OBJECT (group), "plug-in-path-table");
if (! path_table)
{
path_table = g_hash_table_new_full (g_str_hash, g_str_equal,
g_free, NULL);
g_object_set_data_full (G_OBJECT (group), "plug-in-path-table",
path_table,
(GDestroyNotify) g_hash_table_destroy);
}
copy_original = gimp_strip_uline (path_original);
copy_translated = g_strdup (path_translated);
p1 = strrchr (copy_original, '/');
p2 = strrchr (copy_translated, '/');
if (p1 && p2 && ! g_hash_table_lookup (path_table, copy_original))
{
GimpAction *action;
gchar *label;
label = p2 + 1;
#if 0
g_print ("adding plug-in submenu '%s' (%s)\n",
copy_original, label);
#endif
action = gimp_action_impl_new (copy_original, label, NULL, NULL, NULL);
gimp_action_group_add_action (group, action);
g_object_unref (action);
g_hash_table_insert (path_table, g_strdup (copy_original), action);
*p1 = '\0';
*p2 = '\0';
/* recursively call ourselves with the last part of the path removed */
plug_in_actions_build_path (group, copy_original, copy_translated);
}
g_free (copy_original);
g_free (copy_translated);
}

View File

@@ -119,16 +119,16 @@ plug_in_run_cmd_callback (GimpAction *action,
{
GimpItemTreeView *view = GIMP_ITEM_TREE_VIEW (data);
GimpImage *image;
GimpItem *item;
GList *items;
image = gimp_item_tree_view_get_image (view);
if (image)
item = GIMP_ITEM_TREE_VIEW_GET_CLASS (view)->get_active_item (image);
items = GIMP_ITEM_TREE_VIEW_GET_CLASS (view)->get_selected_items (image);
else
item = NULL;
items = NULL;
args = procedure_commands_get_item_args (procedure, image, item);
args = procedure_commands_get_items_args (procedure, image, items);
}
else
{

View File

@@ -149,9 +149,9 @@ procedure_commands_get_image_args (GimpProcedure *procedure,
}
GimpValueArray *
procedure_commands_get_item_args (GimpProcedure *procedure,
GimpImage *image,
GimpItem *item)
procedure_commands_get_items_args (GimpProcedure *procedure,
GimpImage *image,
GList *items_list)
{
GimpValueArray *args;
gint n_args = 0;
@@ -178,21 +178,49 @@ procedure_commands_get_item_args (GimpProcedure *procedure,
if (gimp_value_array_length (args) > n_args &&
GIMP_IS_PARAM_SPEC_ITEM (procedure->args[n_args]))
{
if (item &&
g_type_is_a (G_TYPE_FROM_INSTANCE (item),
G_PARAM_SPEC_VALUE_TYPE (procedure->args[n_args])))
if (items_list)
{
g_printerr ("%s: plug-in procedures expecting a single item are deprecated!\n",
G_STRFUNC);
g_value_set_object (gimp_value_array_index (args, n_args),
item);
items_list->data);
n_args++;
}
else
{
g_warning ("Uh-oh, no active item for the plug-in!");
g_warning ("Uh-oh, no selected items for the plug-in!");
gimp_value_array_unref (args);
return NULL;
}
}
else if (gimp_value_array_length (args) > n_args + 1 &&
G_IS_PARAM_SPEC_INT (procedure->args[n_args]) &&
GIMP_IS_PARAM_SPEC_OBJECT_ARRAY (procedure->args[n_args + 1]))
{
GimpItem **items = NULL;
gint n_items;
n_items = g_list_length (items_list);
g_value_set_int (gimp_value_array_index (args, n_args++),
n_items);
if (items_list)
{
GList *iter;
gint i;
items = g_new (GimpItem *, n_items);
for (iter = items_list, i = 0; iter; iter = iter->next, i++)
items[i] = iter->data;
}
gimp_value_set_object_array (gimp_value_array_index (args, n_args++),
GIMP_TYPE_ITEM,
(GObject **) items, n_items);
g_free (items);
}
}
}
@@ -262,7 +290,7 @@ procedure_commands_get_display_args (GimpProcedure *procedure,
}
else
{
g_warning ("Uh-oh, no active drawable for the plug-in!");
g_warning ("Uh-oh, no selected drawables for the plug-in!");
gimp_value_array_unref (args);
g_list_free (drawables_list);

View File

@@ -24,9 +24,9 @@ GimpValueArray * procedure_commands_get_data_args (GimpProcedure *procedure,
GimpObject *object);
GimpValueArray * procedure_commands_get_image_args (GimpProcedure *procedure,
GimpImage *image);
GimpValueArray * procedure_commands_get_item_args (GimpProcedure *procedure,
GimpValueArray * procedure_commands_get_items_args (GimpProcedure *procedure,
GimpImage *image,
GimpItem *item);
GList *items);
GimpValueArray * procedure_commands_get_display_args (GimpProcedure *procedure,
GimpDisplay *display,
GimpObject *settings);

Some files were not shown because too many files have changed in this diff Show More