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

Compare commits

...

810 Commits

Author SHA1 Message Date
Jehan
6e69dd3aaa meson: Post-release version bump to 3.0.7. 2025-10-05 23:22:23 +02:00
Bruno Lopes
8082e58981 build/linux: Fix Flatpak building after gexiv2 dep declaration
(cherry picked from commit ebd6e64dc8)
2025-10-05 14:54:43 -03:00
Jehan
a77e8fd05d gimp-data: fix by linking to gimp-data-3-0 again!
Argh that was a close one. We nearly made a 3.0 release with the
development branch splash image!
2025-10-05 19:14:02 +02:00
Bruno Lopes
4646a57a2d gitlab-ci: Add comment explaining Flatpak timeout
(cherry picked from commit 4768a4283d)
2025-10-05 13:48:12 -03:00
Bruno Lopes
99aea0682c gitlab-ci: Bump Flatpak timeout for 90min again for rebuilding purposes
When we bump some dependency (e.g. Poppler), even the ones which
don't link to it will be rebuild, so 30min is not enough even
with the ORAS caching.

(cherry picked from commit fe4a698928)
2025-10-05 13:48:08 -03:00
Jehan
6e4fd33341 Release GIMP 3.0.6.
gimp_interface_age resetted since we added a new API
(gimp_prop_toggle_new()) in this version.
2025-10-05 18:40:16 +02:00
Bruno Lopes
35311e3147 build/linux: Update poppler module to 25.10
Synced from
6d4124f7b8

(cherry picked from commit d8d73266bc)
2025-10-04 18:52:51 -03:00
Bruno Lopes
73b82cd306 gitlab-ci, build/windows: Remove forgotten comment about fixed #12284
(cherry picked from commit 356c2baec5)
2025-10-04 16:17:59 -03:00
Bruno Lopes
3d3b4dee1a meson: Support Windows native paths (aka backslashes) on -Dprefix
Closes: #12284
(cherry picked from commit aea7042aa1)
2025-10-04 16:12:54 -03:00
Jehan
5969c2bf99 desktop: update AppStream <release> listing. 2025-10-04 16:25:07 +02:00
Alan Mortensen
d81cfcc325 Update Danish translation 2025-10-04 12:47:45 +00:00
Anders Jonsson
24aef543eb Update Swedish translation 2025-10-04 12:07:32 +00:00
Alan Mortensen
cfeec87ee6 Update Danish translation 2025-10-04 12:01:38 +00:00
Bruno Lopes
25c9fcf382 build/linux: On 3.0 series only, bundle all random typelibs
Following 65d51a7e
2025-10-03 18:58:08 -03:00
Bruno Lopes
5edbb073e2 Declare gexiv2 dependency on many targets (due to gimpmetadata.h)
Our build files were relying 'sysroot' to find gexiv2.h but this is
not possible with Apple Clang om which sysroot points to macOS SDK.
So, exotic environments like Homebrew were failing. Let's fix this.

(cherry picked from commit f09007507f)
2025-10-03 18:42:25 -03:00
Bruno Lopes
65d51a7e22 build/windows: On 3.0 series only, bundle all random typelibs
See discussion on: #14910
2025-10-03 09:57:54 -03:00
Bruno Lopes
a105f91292 gitlab-ci: Complete cbe56ff3
(cherry picked from commit 2b91551f4e)
2025-10-03 09:04:43 -03:00
Bruno Lopes
52d95d3397 gitlab-ci: Remove dangling MSYSTEM_PREFIX on Win job names
It makes them consistent with other non-Windows jobs so
easier to read.

(cherry picked from commit cbe56ff388)
2025-10-02 21:38:46 -03:00
Bruno Lopes
e9bade2792 build/linux: Fix Snap manifest version to 3.0.5 2025-10-02 20:52:43 -03:00
Bruno Lopes
b5c70171b4 .gitlab: More templates backporting 2025-10-02 20:47:51 -03:00
Anders Jonsson
5e9cb28a92 .gitlab: Backport templates improvements
(cherry picked from commit 7cec3f52b9)
2025-10-02 20:44:53 -03:00
Jehan
14d65c8984 NEWS: update. 2025-10-03 01:38:00 +02:00
Bruno Lopes
b8fde036d4 tools: Drop bashism/gnushism in read command
(cherry picked from commit ad9dbf2c8b)
2025-10-03 01:34:09 +02:00
Bruno Lopes
1c178fb775 meson: Fix wrong debugging_format detection on clang-cl and msvc
(cherry picked from commit 2f0bfc569b)
2025-10-03 01:34:00 +02:00
Jehan
51d754c6d0 app: use the new release/ alias URLs for the "Learn more" link of…
… Release Notes tab.

(cherry picked from commit baa4825880)
2025-10-03 01:33:09 +02:00
Jehan
c9bb07858a tools: improve release stats.
- Interactively query the release version from standard input.
- Compute the logical previous version but also the previous release in
  time. For instance the logical previous release of GIMP 3.0.6 will be
  3.0.4 but the time-wise previous release will be 3.1.4.
- Some statistics will use the logical previous release whereas others
  the time-wise one.

(cherry picked from commit 8c910c2b6b)
2025-10-03 01:33:01 +02:00
Kolbjørn Stuestøl
f28ae86274 Update Norwegian Nynorsk translation 2025-10-02 11:33:28 +00:00
Jehan
e49458b07b desktop: add a <url> tag to our <release> tag.
I believe this is used in software listings (GNOME Software, KDE
Discovery, Flathub…) as a link to get more information. So it would be
quite useful to redirect people who want to know more towards our
website.

Up to now, we could not use this AppStream feature because we were never
completely sure of the final release news URL (because of the date part
in particular, since we were often publishing the news a day or 2 after
the tagging). With the new alias feature installed on gimp-web, we now
have an easy to remember and unchanging alias. Let's use this!
2025-10-01 13:27:42 +02:00
Jehan
f2c13d319e NEWS: move some items from master branch NEWS file. 2025-09-30 17:42:01 +02:00
Jehan
8d9b12acef app: minor indentation cleanup.
(cherry picked from commit 24c8f86c85)
2025-09-30 17:17:50 +02:00
Jehan
68235861da po: remove files which should not be in POTFILES.in.
This file is part of po-tags/ domain, and in fact, it's even in the
POTFILES.skip of the main po/ domain.

(cherry picked from commit f50145c155)
2025-09-30 17:17:11 +02:00
Jehan
865360ee8e app: fix rendering background of Colormap dockable.
The rgba variable would be used uninitialized. This needs to be moved
one loop level up so that the color extracted at each cell start
position is properly reused (and also so that the full transparent color
at no-entry position is properly set and reused too).

(cherry picked from commit 0af9261980)
2025-09-30 17:15:54 +02:00
Jehan
abaa5a5184 app: make sure we don't crash dereferencing a NULL GError.
I think most, if not all, failure cases of file_open_with_proc_and_display()
should allocate a GError by now. But just in case we missed some edge
case, better not crash.
For instance, we were crashing when opening a remote file because of
this line before the previous commit was pushed.

(cherry picked from commit 5a22a9b931)
2025-09-30 17:14:16 +02:00
Jehan
d89cee9d1b app, pdb: do not leak a GFile in gimp_temp_file() or any future…
… PDB API which will return a newly allocated GFile.

Though gimp_temp_file() was so far the only such case where a returned
GFile was being leaked, it may happen again. So the PDB must instead
assume that all returned GFile-s have their own reference and take over
said reference.

And therefore update all other functions to increase the internal
GFile-s reference counts.

(cherry picked from commit b121ddd6f8)
2025-09-30 17:11:00 +02:00
Bruno Lopes
c7c4c44f79 libgimp: Improve .gir and .vapi dependencies by using unified list
To avoid bugs like: #14902

(cherry picked from commit 0edf615333)
2025-09-30 11:50:47 -03:00
Jehan
fa3b9f897b Issue #13553: pop an error dialog up only for specific GIO error.
This fixes 46d9a09698. There was a reason why this was not implemented
as an assert-type error nor as a user-facing error: network problems
happen.

We cannot pop an error up every time:

* The computer is offline! 😱 GIMP is not made to be run as a connected
  software and working on GIMP with a non-connected computer is a
  perfectly valid way of using GIMP.
* gimp.org is down (it's rare, but it happens and it should not have any
  impact to creators with GIMP).
* You are behind some kind of proxy or other complicated network
  configuration which GIO is not able to pass through.
* And any other reason which could make your GIMP not able to read the
  remote json file…

Instead let's check the more particular domain and error code, though
even this I hesitated between doing this change or simply reverting
commit 46d9a09698.
Indeed it's still quite a generic G_IO_ERROR_NOT_SUPPORTED error, so I
do hope we cannot get it in other normal conditions where reading a
remote link may fail. The last thing we want is GIMP popping up errors
which are neither bugs in our code, nor environment issues for which
anyone can do anything about.

(cherry picked from commit eb0bfe7bdb)
2025-09-29 21:08:56 -03:00
Yuri Chornoivan
5c40ba81f6 Update Ukrainian translation 2025-09-29 20:07:25 +00:00
Asier Saratsua Garmendia
30baa23c65 Update Basque translation 2025-09-29 17:50:10 +00:00
Ekaterine Papava
5c5c692214 Update Georgian translation 2025-09-29 15:03:40 +00:00
Ekaterine Papava
00a181f885 Update Georgian translation 2025-09-29 14:44:17 +00:00
Martin
086bc2effc Update Slovenian translation 2025-09-29 13:35:37 +00:00
Martin
660ec0be61 Update Slovenian translation 2025-09-29 13:28:01 +00:00
luzpaz
de3aeddbf0 libgimpconfig: fix typo in gimpconfig-params.c
Fixes source comment typo and modifies whitespace for readability.

(cherry picked from commit 9daf5d2e5d)
2025-09-29 08:41:48 -03:00
Bruno Lopes
b0a197f826 app: Move "Documentation" link one line up over (community) "Tutorials"
Users were thinking the tutorials are some kind of official docs,
but they are not maintained as the official GIMP help website,
they are more like informal documentation about GIMP made public.

Let's clarify this reordering the buttons.

(cherry picked from commit 789af76a32)
2025-09-29 07:34:34 -03:00
Bruno Lopes
da2f91bc22 build/windows: Stay on Inno 6.5.4 to avoid (potentially) broken 6.6.0 Dark Mode
It was announced by the devs on Google Groups that they are on preview state.

I will need time to conform our scripts to the upcoming 6.6.0.
So, let's not risk creating installers with broken UI.

(cherry picked from commit f9ba343558)
2025-09-28 22:13:00 -03:00
Bruno Lopes
6596b97c96 po-plug-ins: Backport typo fix 2025-09-28 22:03:11 -03:00
Bruno Lopes
f31642a419 build/linux: Silence noisy warnings about GTK_MODULES
From GTK mouth:
https://gitlab.gnome.org/GNOME/gtk/-/blob/3.24.50/gtk/gtkmodules.c?ref_type=tags#L250

(cherry picked from commit 47eac319b1)
2025-09-28 21:42:04 -03:00
Bruno Lopes
a9ead55147 build/windows, gimp-data: Prepare to Inno Setup 6.6.0 2025-09-28 21:41:34 -03:00
Bruno Lopes
9d3baeff2b build/linux: Little improvement on libheif plugins bundling
(cherry picked from commit b0689f565b)
2025-09-28 08:31:30 -03:00
Bruno Lopes
50fda1d013 build/linux: Fix libproxy/libpxbackend errors on Snap
(cherry picked from commit 1e46438ced)
2025-09-28 08:31:26 -03:00
Bruno Lopes
38bacb232e build/linux: Remove some uneeded lines after move to Trixie
(cherry picked from commit 2b32496195)
2025-09-28 08:31:23 -03:00
Bruno Lopes
ab538eb732 build/linux: Fix GJS bundling on AppImage
It have an undeclared dependency on GioUnix typelib.

(cherry picked from commit de62139894)
2025-09-28 08:30:45 -03:00
Alx Sa
b5a4acdf43 pdb: Set choice args to default in gimp-file-load
This patch resolves the same issue as 8021b464,
but for `gimp-file-load`.

(cherry picked from commit 714e9041d8)
2025-09-27 21:00:24 -03:00
Bruno Lopes
a640adf781 Revert "Issue #13001: build/linux: Sandbox XDG_DATA_DIRS on AppImage"
This reverts commit bc095d5c83.

Sandboxing XDG_DATA_DIRS, while can fix the crash due to share/mime,
on the other hand makes impossible to call share/applications
associated with such mimes on host.

So, since we bumped the AppImage to Debian Trixie so the Glib
crash due to mime is gone, we can (and should) revert the
wrong sandboxing without problems.

(cherry picked from commit f774ad7f16)
2025-09-27 20:59:24 -03:00
Bruno Lopes
9227c02a2f gitlab-ci, build: Move to Debian Trixie on AppImage only
Fixes: #13001 #13106 #13492 #13647 #14779

AppImage jobs are now built with Trixie to adress #13001 and many others.

To have two Debian versions with less complexity possible, I needed to:
- Revert the prevalence of the AppImage CI (now nonreloc comes first);
- Revert the use of Clang on Debian (also to save 120MB from registry,
  since we now have 4 Docker images, each one with its own STEP cache!).
In short, .gitlab-ci.yml will look more like before I changing it a lot.

(cherry picked from commit f53a843c3d)
2025-09-27 20:59:12 -03:00
Bruno Lopes
3493f49292 app: Use 'g_message' (like the help plug-in) when GVFSd-HTTP is not present
Closes #13553

Such issue tends to affect only AppImage users (e.g. when running it in
KDE installations). This is because AppImage files are not ran by
any host helper (e.g. snapd or flatpak) to connect to GVFSd and is
not possible to bundle GVFSd due to its own nature (it is daemon).

Since GVFS is listed in the INSTALL file as a required dependency, it is
fair enough to be more clear when it is not present, otherwise users will
have outdated GIMP without knowing (like happened in macOS in the past).

We are already doing this with GIMP help plug-in by the way. The
difference is that, at GIMP start, such techinical error message can
be surprising, but even so it is needed as feedback for fail on the
update check button in the end of day. Let's follow GIMP help on this.

(cherry picked from commit 46d9a09698)
2025-09-27 12:36:04 -03:00
Kolbjørn Stuestøl
d1c6584cbb Update Norwegian Nynorsk translation 2025-09-27 12:08:21 +00:00
Kolbjørn Stuestøl
d572c4bd25 Update Norwegian Nynorsk translation 2025-09-27 12:01:20 +00:00
luming zh
f031436de1 Update Chinese (China) translation 2025-09-25 00:55:49 +00:00
Yuri Chornoivan
e3e1c491cb Update Ukrainian translation 2025-09-24 16:01:04 +00:00
Yuri Chornoivan
b250472f2e Update Ukrainian translation 2025-09-24 15:52:47 +00:00
Bruno Lopes
66cc2e2173 build: Move loose scripts in meson subdir to tools
The build dir looks "prettier" without the meson subdir.
With prettier I mean: just the OSes subdirs.

(cherry picked from commit c13bf1af19)
2025-09-24 09:10:10 -03:00
Bruno Lopes
95582ad439 build/linux: Sync with Beta manifest regarding whitespaces
(cherry picked from commit 4d97212cf9)
2025-09-23 21:11:37 -03:00
luming zh
ce26064aa2 Update Chinese (China) translation 2025-09-23 23:35:56 +00:00
luming zh
8eeebed5fb Update Chinese (China) translation 2025-09-23 23:29:05 +00:00
Asier Saratsua Garmendia
a2586af9e0 Update Basque translation 2025-09-23 19:50:15 +00:00
Asier Saratsua Garmendia
386b50fdf2 Update Basque translation 2025-09-23 19:50:04 +00:00
Asier Saratsua Garmendia
a69e8671dc Update Basque translation 2025-09-23 19:49:58 +00:00
Asier Saratsua Garmendia
543808b723 Update Basque translation 2025-09-23 19:49:50 +00:00
Asier Saratsua Garmendia
a8b7011577 Update Basque translation 2025-09-23 19:48:38 +00:00
Yuri Chornoivan
dfb1a7a06b Update Ukrainian translation 2025-09-23 19:06:21 +00:00
Bruno Lopes
26a9de0743 gitlab-ci: Unify build jobs timeout by bumping them to 30min
While 20min is being enough, the jobs are completing
too close of the due time (due to awful runners like
OSU or Win32 stuckness). Let's prevent failures, then.

(cherry picked from commit c79db4c15a)
2025-09-23 15:39:50 -03:00
Jehan
c02401b2a7 NEWS: adding a section for GIMP 3.0.6. 2025-09-23 19:11:36 +02:00
Anders Jonsson
2aa6214272 Update Swedish translation 2025-09-23 16:21:25 +00:00
Martin
a0cee0001a Update Slovenian translation 2025-09-23 16:21:14 +00:00
Martin
83b568db2c Update Slovenian translation 2025-09-23 16:09:48 +00:00
Martin
25791641fe Update Slovenian translation 2025-09-23 16:09:41 +00:00
Martin
aaf02143fd Update Slovenian translation 2025-09-23 16:03:13 +00:00
Anders Jonsson
f6db0b0c1d Update Swedish translation 2025-09-23 15:49:32 +00:00
Anders Jonsson
0c1015294b Update Swedish translation 2025-09-23 15:40:55 +00:00
Anders Jonsson
3e5c4341e1 Update Swedish translation 2025-09-23 15:34:12 +00:00
Bruno Lopes
2d075cac99 gitlab-ci: Reduce Flatpak timeout to 20min like AppImage and Snap, after ORAS
(cherry picked from commit cecb937a0b)
2025-09-23 12:22:59 -03:00
Bruno Lopes
3425bd852e build/linux: ORAS works! Let's do some cosmetical changes on Flatpak deps script
(cherry picked from commit fe4dbeb911)
2025-09-23 12:22:56 -03:00
Bruno Lopes
39546bae9b build/windows: Temporarely show flatpak deps building to see if ORAS caching is working
(cherry picked from commit fdb4111e3f)
2025-09-23 12:22:53 -03:00
Bruno Lopes
df8b16ddb4 build/linux: Do not cache babl and gegl builds binaries to ORAS image
They should be passed only at artifact level.

(cherry picked from commit 72533aaf8e)
2025-09-23 12:22:50 -03:00
Bruno Lopes
453ce7e31f build/linux: Test built packages binary caching on Flatpak with ORAS
If this works, our flatpak builds will behave like on AppImage,
Snap and Windows, I mean: with all precompiled binaries.

(cherry picked from commit 8e9b7bfce6)
2025-09-23 12:22:47 -03:00
Jehan
55b96b64df po-plug-ins: fix generating plug-ins POT file.
This new plug-in was not backported to gimp-3-0 branch.
2025-09-23 14:10:06 +02:00
Rico Tzschichholz
003a9fcbc7 libgimp: Additionally pass gio-[unix,windows]-2.0 to vapigen
Fixes https://gitlab.gnome.org/GNOME/gimp/issues/14902

(cherry picked from commit 6260590cf4)
2025-09-23 08:43:14 -03:00
Jehan
12aa79d695 po-windows-installer: fix building the pot file.
When running `ninja gimp30-windows-installer-pot`, we had this error:

```
[0/2] Running external command gimp30-windows-installer-pot
/usr/bin/xgettext: warning: ITS rule file 'gimp-ms-installer-config.its' does not exist; check your gettext installation
/usr/bin/xgettext: warning: file 'build/windows/installer/lang/setup.isl.xml.in' extension 'xml' is unknown; will try C
```

(cherry picked from commit c5e77fb8bb)
2025-09-23 12:16:33 +02:00
Bruno Lopes
fb6105a91f gitlab: Print filenames in meson_health
(cherry picked from commit 82cb3ae6fe)
2025-09-22 16:05:44 -03:00
Bruno Lopes
95c9121c69 gitlab: Check gimp-data submodule too on meson-health job
(cherry picked from commit 1a7f673b7d)
2025-09-22 11:24:06 -03:00
Jehan
eb691a9cdd tools: better logic for the splash image text.
Change of series must always have their own splash image (which will
stay the same within the whole series).
Development releases though will have a new splash image most of the
time (but it is not mandatory).

See rule edicted in commit Infrastructure/gimp-web-devel@061f544.

(cherry picked from commit aa9e437d42)
2025-09-22 10:06:38 -03:00
Jehan
99b236ccdb tools: use release news alias URL.
While we don't know the accurate URL of every release before
publication, we now know the alias it will have in the shape:
https://www.gimp.org/release/<version>

Cf. commit Infrastructure/gimp-web@bca40810

(cherry picked from commit ec4daa643e)
2025-09-22 10:06:34 -03:00
Bruno Lopes
d090c56b3c build/linux: Don't allow openjph update on Flatpak
It have broken includes starting with 0.23.0

(cherry picked from commit 308963c271)
2025-09-21 22:45:22 -03:00
Bruno Lopes
ba828074bc build/linux: Update graphviz module to 14.0.0
(cherry picked from commit 4d0fef9482)
2025-09-21 22:45:16 -03:00
Bruno Lopes
746a7d22fe build/linux: Improve bund_usr check added in 5bc2f26c
(cherry picked from commit d5f3fa77db)
2025-09-21 21:39:19 -03:00
Jehan
9d83052173 app: use more recent harfbuzz API.
hb_ft_font_lock_face() (and unlock) exists since harfbuzz 2.6.5 and our
current requirement for this dependency is 2.8.2.

Fixes this compilation warning:

> app/text/gimpfont.c:1196:3: warning: ‘hb_ft_font_get_face’ is deprecated: Use 'hb_ft_font_get_ft_face' instead [-Wdeprecated-declarations]
>  1196 |   face = hb_ft_font_get_face (hb_font);

(cherry picked from commit dbf0c39bb3)
2025-09-22 00:46:25 +02:00
Bruno Lopes
f7086295b2 build/windows: Add .pdb bundling condition after bundle() improvement
(cherry picked from commit 56f72c24ba)
2025-09-21 18:18:13 -03:00
Jehan
44b368ab15 desktop: add a release tag. 2025-09-21 23:02:39 +02:00
Jehan
db609889e7 app: fix build warning on Windows.
Fixes following warning, seen on CI:

> ./app/dialogs/about-dialog.c:549:7: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]

(cherry picked from commit a0676125a1)
2025-09-21 17:56:00 -03:00
Bruno Lopes
4fb7c882f2 build/windows: Do not build exiv2 on 32-bit since it uses ancient MSVCRT
(cherry picked from commit c472800eae)
2025-09-21 16:35:36 -03:00
Bruno Lopes
031e41d4b5 build/linux: Drop --permissive mode introduced in 5bc2f26c
It was an awful design of mine.

(cherry picked from commit 63b4d69e48)
2025-09-21 14:48:12 -03:00
Jehan
2cb2b0deda libgimp: avoiding a build warning on Windows.
Seen in the CI:

> ../libgimp/gimpui.c:406:1: warning: 'gimp_ui_get_foreign_window' defined but not used [-Wunused-function]

(cherry picked from commit 70bf795dfb)
2025-09-21 14:42:30 -03:00
Lukas Oberhuber
4ad758e41a macos plugins: Improves dock icon flashing from #12150
This means additional icons don't stick around. However, this is the easy workaround to turning everything into a proper plugin with .plist files.

(cherry picked from commit 06bcef3273)
2025-09-21 13:52:09 -03:00
Bruno Lopes
e9038b6c1b build/windows: Stop Windows script if bundle target do not exist
(cherry picked from commit a7c4320312)
2025-09-21 13:47:35 -03:00
Bruno Lopes
1a85761705 gitlab: Fix search-common-ancestor in gimp-3-0 2025-09-21 13:39:11 -03:00
Alx Sa
63704d59f8 plug-ins: Fix display lag in Small Tiles
In Small Tiles, we update the preview whenever
the number of segments slider is dragged. However,
while we reacted to the slider moving, we actually grab
the number from the GimpProcedureConfig object.
As a result, there's a lag between the signal firing and the
config object updating, so we don't grab the latest change.
This patch alters the signal to run when "notify::num-tiles"
is called, resulting in the update function having the updated
number.

(Cherry-picked from e2735321)
2025-09-21 16:33:08 +00:00
Lukas Oberhuber
20eac401a7 libgimpwidgets: Switch to application/x-geglcolor
This is the recommended fix from Gtk to use our own mime type
rather than depend on a mimetype that has a different expectation
of payload.

This means drag and drop of colors uses `application/x-geglcolor`
rather than `application/x-color` which expects an RGBA color
rather than a structure.

(cherry-picked from cacb8d20)
2025-09-21 11:30:30 -04:00
Jehan
faf0c82e59 gimp-data: bump to latest of new gimp-data-3-0 branch. 2025-09-21 17:13:02 +02:00
Bruno Lopes
d4c9d53ddd build/linux: Stop AppImage script if bund_usr target do not exist
(cherry picked from commit 5bc2f26cb0)
2025-09-20 20:39:21 -03:00
Bruno Lopes
87f97e043c build/windows: Fix submission info code after Microsoft guys feedback
Thanks to https://github.com/kswanny and https://github.com/knangunu.

(cherry picked from commit 17b23b6f26)
2025-09-20 14:42:01 -03:00
Bruno Lopes
4c5211aeaa gitlab: Print message when 'branches-check' job have no errors
(cherry picked from commit 413114f9d0)
2025-09-18 07:50:02 -03:00
Bruno Lopes
b0c2d15e28 gitlab: Fix master exception on branches check
(cherry picked from commit c2f0afb4bd)
2025-09-17 22:47:46 -03:00
Bruno Lopes
6998e09f12 gitlab: Do not check for master branch
(cherry picked from commit b945d77ed7)
2025-09-17 22:47:35 -03:00
Bruno Lopes
6886329ffc gitlab: Add job to warn about "dead" branches
It is quite common for we developers (me included) to forget to
delete already merged branches. Let's fix this mess with a job.

(cherry picked from commit 7c04605d14)
2025-09-17 22:47:19 -03:00
Jehan
39e7cb593e libgimp: Modernize setting "Exif.Image.DateTime"
Again, backporting commit 1a96fb55f9 by Jacob Boerema without the
conflicts.
2025-09-17 22:13:40 +02:00
Jehan
0c82d21473 libgimp: fix XMP modification date separators.
Again, backporting commit 922e409045 by Jacob Boerema, without
conflicts.
2025-09-17 22:10:39 +02:00
Jehan
819a9944de libgimp: fix #14644 Wrong comment synchronized with metadata
Backport commit 3211ab1408 by Jacob Boerema. The original commit
conflicted because we are not going to backport commit 877d5b0c1a,
adding a new Preferences setting, to the GIMP 3.0 series.
2025-09-17 22:07:47 +02:00
Bruno Lopes
e75970cd9f build/windows: Complete dirty 32-bit exiv2 workaround
(cherry picked from commit b773c3ac48)
2025-09-17 16:00:52 -03:00
Bruno Lopes
2170e57ac5 build/windows: Extremely dirty workaround for 32-bit sake
(cherry picked from commit 9551519f23)
2025-09-17 15:59:58 -03:00
Bruno Lopes
1b702c6cf9 build/windows: Manually backport neutral splash size on Installer 2025-09-17 15:29:15 -03:00
Bruno Lopes
ec27a8a335 build/windows: More self_build organization to support MINGW32
(cherry picked from commit a9d2700631)
2025-09-17 15:16:18 -03:00
Bruno Lopes
ceb44e7fab build/windows: Fix remaining Clang-oriented options of self_build on MINGW32
(cherry picked from commit 5375ca63d5)
2025-09-17 14:46:19 -03:00
Bruno Lopes
293f8dcc3b build/windows: Fix typo on Clang color check
(cherry picked from commit 78acdd8882)
2025-09-17 14:19:15 -03:00
Bruno Lopes
2aea04dccc build/windows: Fix failing build due to Clang color on MINGW32
(cherry picked from commit b5dda733dc)
2025-09-17 14:16:36 -03:00
Bruno Lopes
fd0f495392 build/windows: gimp-3.0 branch uses "share/mypaint-data/1.0" 2025-09-17 13:38:05 -03:00
Bruno Lopes
89c01638ca build/windows: Manually sync bundling script with master 2025-09-17 13:26:40 -03:00
Jehan
60d66a435b gimp-data: switch to using HEAD of gimp-data-3-0 branch. 2025-09-17 18:21:57 +02:00
Bruno Lopes
aed9cecd58 build/windows: Build exiv2 with Meson so make the .dll name expected by gexiv2
(cherry picked from commit e17567d001)
2025-09-17 18:00:15 +02:00
Bruno Lopes
6cfac3aab3 build/windows: Uncomment .pdb installing on Meson mode of self_build function
(cherry picked from commit 4a0ea33bc5)
2025-09-17 18:00:15 +02:00
Bruno Lopes
2c484d70e7 build/windows: Build exiv2 with setlocale patch
(cherry picked from commit a2d106e3fa)
2025-09-17 18:00:15 +02:00
Bruno Lopes
c9e52916e9 build/windows: Restore comments on 2_bundle-gimp-uni_sym.py
(cherry picked from commit 15f047f6c0)
2025-09-17 17:56:39 +02:00
Bruno Lopes
cf20027c42 build/linux: Fix PostScript support on Snap with proper env var
(cherry picked from commit 484d0fbcf4)
2025-09-17 17:56:39 +02:00
Bruno Lopes
1ee540e2b7 build/linux: Bundle needed files for PostScript support on AppImage
(cherry picked from commit b70186bc99)
2025-09-17 17:56:39 +02:00
Anders Jonsson
36f3e78e20 Issue #14878: fix missing spin boxes in Map to Object plug-in
Light position spin boxes in Map to Object could be missing
or shown when they shouldn't be due to reuse of a variable.

Fixes #14878

(cherry picked from commit cb565344e9)
2025-09-17 17:56:39 +02:00
Bruno Lopes
aa50232b48 build/windows: Try to fix failing .patch download on @creiter runners
(cherry picked from commit c8971ac2ae)
2025-09-17 17:56:39 +02:00
Bruno Lopes
19a4c5cc70 build/windows: Make possible to apply remote .patch on self builds
(cherry picked from commit 3ec63979d8)
2025-09-17 17:56:39 +02:00
Bruno Lopes
7df5b399ab gitlab-ci, build/windows: Fix broken env after 5ccc5252
(cherry picked from commit c72e36c6a2)
2025-09-17 17:56:39 +02:00
Bruno Lopes
00590cd9f1 build/windows: Add colored output and .pdb support for Cmake self builds
(cherry picked from commit 5ccc525281)
2025-09-17 17:56:39 +02:00
Jehan
a9efbd33ac plug-ins: align with __attribute__ keyword.
The bug in old Bugzilla #138357 report was happening on icc on ia64 with
-no-gcc option. It does look like after all these years, this is still a
GCC attribute, but we use the same attributes on babl and GEGL code. So
to be fair, it'd be useless to only forbid using it on GIMP code. And
that makes for much less ugly code.

Note that C11 has _Alignas() and C23 alignas() specifiers. These are
standard, but we are typically still more into C99 code. Let's see if we
move on to C11 some day… But for now, let's use __attribute__.

Also I am unsure how much this issue is still relevant nowadays. Maybe
even without specified alignment, it would now work fine with icc on
IA-64. 🤷
Or maybe it really doesn't matter that much because Itanium has been
discontinued in 2019, though I guess existing hardware will still be
around for a bit longer.

(cherry picked from commit 84eaa94842)
2025-09-17 17:56:39 +02:00
Alx Sa
2dc831542a path: Update SVG tag when exporting paths
Per Martin Owens of Inkscape and Jonathan Watt,
one of the SVG specification editors
(https://jwatt.org/svg/authoring/#doctype-declaration),
we should not export the DTD with the GimpPath SVG.
This patch also adds an explicit SVG version to the
<svg> tag.

(cherry picked from commit bc7cc0b698)
2025-09-17 17:56:39 +02:00
Bruno Lopes
547bd9f630 build/windows: Fix custom build options not being passed to Meson and Cmake
(cherry picked from commit 5fc3c29f5c)
2025-09-17 17:56:39 +02:00
Bruno Lopes
4480cd19aa build/linux: Update ghostscript module to 10.06.0
Synced from: 5ce8488408

(cherry picked from commit 527f4964fe)
2025-09-17 17:56:39 +02:00
Bruno Lopes
129c896183 build/windows: Forgot '-and' in previous commit
(cherry picked from commit be2e47114d)
2025-09-17 17:56:39 +02:00
Bruno Lopes
42f2f5b200 build/windows: Only use meson in pure Meson built dependencies
(cherry picked from commit 11b81e25a4)
2025-09-17 17:56:39 +02:00
Jehan
22c2d6b2f0 app: fix crash when json parsing fails.
The argument is already a URI, not a GFile.

(cherry picked from commit 4ca05cb38d)
2025-09-17 17:56:39 +02:00
Jehan
c63c4d5446 app: fix crash on invalid previously picked layer.
This happened to our artist in residency. She had a crash when
gimp_image_pick_layer() was apparently run with a non-NULL yet invalid
previously_picked layer. So let's make sure that we clear the stored
item pointer when the object gets finalized.

(cherry picked from commit bb9aad1e87)
2025-09-17 17:56:39 +02:00
Bruno Lopes
7d86007f8f libgimp: Only list gio_specific on Glib 2.86 and newer
Since GioUnix-2.0 namespaces were buggy in previous versions

(cherry picked from commit 4dceeb174a)
2025-09-17 17:56:39 +02:00
Jehan
3e00d8b051 meson: add deprecation warnings on GLib and GTK/GDK API usages.
I discover GLIB_VERSION_MIN_REQUIRED and GLIB_VERSION_MAX_ALLOWED. The
former will make so that we won't have deprecation warnings anymore if
ever we use a function which has been deprecated recently (as long as it
was not deprecated at the minimum required version). The latter will
make so that we get deprecation warnings for any function added after
the minimum required version.

Note that ideally both should be at the same version, but since we have
a bunch of GLIB_CHECK_VERSION() protected conditional code, we would get
compilation warnings even on correctly protected code. So just keep the
small discrepancy until we can finally bump our minimum requirement.

Also add the equivalent macros for GTK/GDK.

(cherry picked from commit 9819457f31)
2025-09-17 17:56:39 +02:00
Bruno Lopes
a604a8e4a6 libgimp: List gio_specific as dependency for .typelib
This is required starting with Glib 2.86.0.

(cherry picked from commit a7d867c8bc)
2025-09-17 17:54:48 +02:00
Estecka
fad0334dc2 Issue #14777: Fix bad axis centering on zoom-out.
This was simply caused by two variables having been swapped.

Gimp 2 used to work properly because there were two separate mix-ups that
cancelled each other: one in the function arguments, and one in the code
itself. Gimp 3 had fixed the error in the arguments, but not in the code,
thus enabling the bug.

(cherry picked from commit 0fd280db5c)
2025-09-17 17:54:48 +02:00
Bruno Lopes
56c495ec4b app: Make possible to append _NT_SYMBOL_PATH
(cherry picked from commit 9026d18039)
2025-09-17 17:54:48 +02:00
Cheesequake
f18a1d54e4 Issue #13746: change incorrect variable to check for changes in y-axis
(cherry picked from commit 71caf7eb05)
2025-09-17 17:54:48 +02:00
Alx Sa
cddfaef2a6 dialogs: Add palette format filters to import dialog
GIMP supports importing a number of palette formats
such as Adobe Swatch Exchange and SwatchBooker.
However, this is not immediately apparent from the import
palette dialogue.
This patch adds the currently supported palette formats as
filters in the dialogue, both to let users hide irrelevant files from
view and to highlight which formats we support.

(cherry picked from commit 3e96397770)
2025-09-17 17:54:48 +02:00
Alx Sa
2692ba9793 libgimpbase, libgimpwidgets, tools, app: Remove warnings
This patch fixes a few (mostly Windows-specific) warnings on build.
* Hides functions like gimp_get_foreign_window () and variables
like transient_set that aren't used in Windows.
* Changes hollow_g_shell_quote () to not return a const gchar *,
since the value it returns is actually not const.
* Cast update_interval to double to remove warning about mixing
enums and doubles in division.

(cherry picked from commit c8cf2219ce)
2025-09-17 17:54:48 +02:00
Bruno Lopes
6f9ad5adef build/windows: Fix prefixes priority in libraries bundling
(cherry picked from commit 013f9c7f0c)
2025-09-17 17:54:48 +02:00
Bruno Lopes
38eec6a0a6 build/windows: Add support to Cmake builds on self_build function
This can be useful in the future if we need to build some dependency that
does not use Meson (hope we will not need that but anyway)

(cherry picked from commit 8ea6e4031e)
2025-09-17 17:54:48 +02:00
Bruno Lopes
4d73d78c25 build/linux: Update openexr module to 3.4.0 and add openjph module
Synced from: 4318fbbef2

(cherry picked from commit 69359a16c1)
2025-09-17 17:54:48 +02:00
Alx Sa
8796816094 Issue #12012: Don't require GUI for C source and HTML export
(cherry picked from commit 4d84ac748b)
2025-09-17 17:54:48 +02:00
Bruno Lopes
62b2d78ce9 gitlab-ci: Move from unmaintained Kaniko to Buildah
Closes: #14796

There is no other doable option than Buildah. I also tested the
other Kaniko alternatives pointed by GitLab documentation which
were Docker-in-Docker and Buildkit but none worked unprivileged.

Regression: our logs will be a bit more noisy compared to Kaniko.
See: https://github.com/containers/buildah/issues/6362
(cherry picked from commit 1dcc8585ef)
2025-09-17 17:50:25 +02:00
Bruno Lopes
8b892f47b2 build/windows: Revert wrongly pushed change
(cherry picked from commit 4509ec92f5)
2025-09-17 17:50:25 +02:00
Bruno Lopes
923777d63f meson: Fix .pdb installation condition on Linux and macOS
(cherry picked from commit ee43316839)
2025-09-17 17:50:25 +02:00
Alx Sa
e91da8d63d display: Guard private->initial_monitor when NULL
On some systems, it is possible for gimp_image_window_switch_page ()
to be signaled when private->initial_monitor has been set to NULL but
we don't yet have a GtkWindow. This eventually produces a CRITICAL
when gimp_dialog_factory_add_foreign () is run with a NULL monitor.

This patch adds a condition so that gimp_image_window_session_update ()
is not run with a NULL monitor in those cases.

(cherry picked from commit 0782b9166b)
2025-09-17 17:50:25 +02:00
Gabriele Barbero
d07216de20 core: fix wrong if condition in gimp_drawable_duplicate
Probably a typo: the wrong control variable was used in the if statement.
This caused a segfault when duplicating a drawable if new_filter was NULL.

(cherry picked from commit 5a34856e38)
2025-09-17 17:50:25 +02:00
Bruno Lopes
e7ade9dd6f app: Fix stuck debug dialog on Xorg (X11) too
(cherry picked from commit 9ec28cec54)
2025-09-17 17:50:25 +02:00
Bruno Lopes
0cdcbab01b app: Add margin around buttons of gimpcriticaldialog
The dialog was inconsistent. Let's fix that.

(cherry picked from commit d6d959c6c9)
2025-09-17 17:50:25 +02:00
Jehan
851c1e2e1d app: fix dropping a dockable above/below the only dock in a dockbook.
There is no bug report that I know of as it was reported directly by
Aryeom. When a dock had only a single dockbook, if we tried to move one
of the dockable to the above or below target areas, it would fail.

The reason is that we were not counting the dockables correctly so the
code thought we were trying to move from a dockbook containing a single
dockable (single tab).

(cherry picked from commit 58efcf6312)
2025-09-17 17:50:25 +02:00
Alx Sa
fb529e56e7 core: Fix Lab & CMYK ACB palette import
Converts the babl formats for Adobe Color Book
Lab and CMYK formats to "float", to prevent a crash
when accessing u8 Lab colors that have negative values
and CMYK colors that are too dark.

(cherry picked from commit 599a6c7afe)
2025-09-17 17:50:25 +02:00
Bruno Lopes
16fc70d694 build/linux: Update poppler module to 25.09.1
(cherry picked from commit 65258d6183)
2025-09-17 17:50:25 +02:00
Gabriele Barbero
34a43d3c08 plug-ins: use a temporary image to get the buffer...
...with filters during Recompose

Previously, get_buffer_with_filters() inserted and removed a temporary
copy of a layer in the original image. This caused the image to appear
modified, adding entries in the undo history and prompting the user to save
changes, even though the image itself was not actually changed.

This patch modifies the function to create a temporary image and perform
the layer insert operation there. Filters are applied as before,
but the original image remains untouched, avoiding unwanted undo entries
and mark the image as modified.

(cherry picked from commit 6e80f98390)
2025-09-17 17:50:25 +02:00
Alx Sa
6c3c99d96a plug-ins: Fix ZDI-CAN-27793
GIMP ILBM File Parsing Stack-based Buffer Overflow
Remote Code Execution Vulnerability

Adds a check to file-iff.c to ensure the palette_size is
between 0 and 256.

(cherry picked from commit 002b22c150)
2025-09-17 17:50:25 +02:00
Bruno Lopes
d97514a743 tools: Drop bashisms on milestones info fetching
(cherry picked from commit 4738472fcd)
2025-09-17 17:50:25 +02:00
Jacob Boerema
5c3e2122d5 plug-ins: fix ZDI-CAN-27823
GIMP XWD File Parsing Heap-based Buffer Overflow Remote Code Execution
Vulnerability.

Check offset in colormap is valid before writing to it.

Closes #14814

(cherry picked from commit 4eb106f2bf)
2025-09-17 17:50:25 +02:00
Alx Sa
3385862d8b plug-ins: Fix ZDI-CAN-27836
ZDI-CAN-27836: GIMP FF File Parsing Integer Overflow
Remote Code Execution Vulnerability

This patch increases the row_size data type to gsize and checks if it
would overflow based on the width given. It also makes sure the image
size does not exceed GIMP's image size limits.

(cherry picked from commit 53b18653bc)
2025-09-17 17:50:25 +02:00
Anders Jonsson
7c24ee750d plug-ins: remove doubled word in dicom string
(cherry picked from commit 2012eef75c)
2025-09-17 17:50:25 +02:00
Jacob Boerema
2d2d39f3da plug-ins: fix ZDI-CAN-27878
GIMP WBMP File Parsing Integer Overflow Remote Code Execution
Vulnerability

We recently fixed one instance of not upgrading the size, but forgot
the other. Fix that here by casting to (gsize). While we're at it,
also add a warning, when reading more data fails unexpectedly.

Closes #14812

(cherry picked from commit fb31ddf322)
2025-09-17 17:50:25 +02:00
Jacob Boerema
3d90916646 plug-ins: fix dicom plug-in ZDI-CAN-27863
GIMP DCM File Parsing Heap-based Buffer Overflow Remote Code Execution
Vulnerability

This adds more safety checks and sets actual GError's instead of just
calling gimp_quit.

Closes #14811

(cherry picked from commit 0f309f9a8d)
2025-09-17 17:50:25 +02:00
Jehan
2884141dbb app: optimize the detection of filters with aux input.
As reported by Liam, apparently for someone with a lot of filters, these
node creations just to check the aux input may add up noticeable time on
boot (it may also depend on the OS too? I didn't have any noticeable
delay personally).

Unfortunately we cannot know the presence of an aux input just with
class introspection because they can be registered by the op at runtime.

This optimization is therefore twofold:

* Since we know which filters have an aux input among all the ones with
  hardcoded actions, we also hardcode this data. It means we only do the
  actual check on non-hardcoded operations (third-party filters but also
  GEGL operations which are not specifically listed in our code).
* I only do these checks once, stored by name in a hash table, because
  filters_actions_setup() is actually run several times (for different
  menus).

This should improve startup time a lot for people who experienced this
delay.

(cherry picked from commit 05e90b1cde)
2025-09-17 17:47:30 +02:00
Jehan
200397b5db Issue #14781: Moving link layers freezes GIMP.
Though I can't reproduce on Linux, the performance log seems to show we
spend too much time inside filters_actions_update(). Instead of creating
nodes at each update, let's just store the information about which
filter action has pad, since this should not change within the timespan
of a given session.

(cherry picked from commit a636aea98d)

Cherry-picking NOTE: though the commit message talks about link layers,
the code is generic and fixes a more global slowness issue on a recent
commit.
2025-09-17 17:46:49 +02:00
Jehan
29e1724501 tools: also parse milestone infos automatically.
(cherry picked from commit 03f7cf58b8)
2025-09-17 17:42:10 +02:00
Alx Sa
f520f4c268 plug-ins: Fix ZDI-CAN-27684
Prevent overflow attack by checking if
output >= max, not just output > max.

(cherry picked from commit 5f4329d324)
2025-09-17 17:42:10 +02:00
Bruno Lopes
7422e66a50 build/linux: Update Poppler to 25.09 and manually disable awful -DENABLE_GPGME
Ported from: a125318890

(cherry picked from commit 8287302b50)
2025-09-17 17:41:34 +02:00
Bruno Lopes
78486fd460 tools: Remove last bashisms in new release-stats.sh
'paste' is a bit opaque but at least more portable.

(cherry picked from commit 53a1d07ffd)
2025-09-17 17:41:34 +02:00
Bruno Lopes
cb96b02bdc tools: Drop bashisms on new release-stats.sh versioning evaluation
(cherry picked from commit 0191e0a485)
2025-09-17 17:41:34 +02:00
Bruno Lopes
d71e8ffa00 gitlab-ci: Use 'ref:' on flatpak_ci_initiative.yml for CI safety
Not making use of 'ref:' makes GitLab fetch the latest version of
the *initiative.yml with the latest fixes and such. That would
not be a problem and even desirable maintenance-wise but that
allows GNOME to add anything on our .gitlab-ci.yml at any time.

This is hard to debug and can break our CI. For example,
see: https://gitlab.gnome.org/GNOME/citemplates/-/issues/35.

(cherry picked from commit 459090836a)
2025-09-17 17:38:42 +02:00
Jehan
a31d0243f1 tools: tweak script so that it outputs statistics in release news format.
Though most of the stats we were pulling came from this, let's format it
exactly how we have done in many latest release news.
Also add automatic stats pulling too of our many side repositories.

(cherry picked from commit 81c844d2ca)
2025-09-17 17:31:48 +02:00
Bruno Lopes
69691a99fe build/windows: Remove last remnant of $GIMP_BASE on Installer script
This completes 87101276

(cherry picked from commit 0c5e5c0094)
2025-09-17 17:31:48 +02:00
Bruno Lopes
8f48d0b9aa gitlab-ci: Always use the Debian image of our Registry
Some jobs were using the Debian image from Docker Hub registry:
- meson-health
- clang-format
- cppcheck
- sources-debian
- dev-docs
- dist-appimage-weekly

The reason was that we don't need a bigger image suited for builds
($CI_REGISTRY_IMAGE:build-debian-${DEB_VERSION}-${RUNNER}), but
it relied entirely on luck. If we push too much commits in a day, it
could surpass the Docker Hub limit. So, let's use our own image always.

(cherry picked from commit cb4316d07a)
2025-09-17 17:31:48 +02:00
Bruno Lopes
cc02900d30 build/linux: Update exiv2 module to 0.28.7
(cherry picked from commit 27a89a0c8a)
2025-09-17 17:31:21 +02:00
Bruno Lopes
30debd889a build/windows: Always run 'pacman -Suy' on 'gimp-win' job
Runners do not remember the MSYS2 repo cache between jobs since
they are not relying on any Docker caching.

The problem is that GIMP could link to different lib versions than
babl and GEGL, but that is the way local shell executors work anyway.

(cherry picked from commit 62727a654c)
2025-09-17 17:31:21 +02:00
Alx Sa
3485ec68f9 plug-ins: Fix Recompose for YCbCr decomposed images
The strings used in decompose.c's "decompose-type" do not match
the values of compose_type for YCbCr values. This means that when
using non-interactive Recompose, there's no match and the Recompose
fails. We'll need to wait until the next API break to fix the strings.
For now, we will do additional checks if the normal compose_type check
fails and also compare the four YCbCr types from Decompose.

(cherry picked from commit cf9d39c3d7)
2025-09-17 17:30:37 +02:00
Ondřej Míchal
d255161d40 app: Align edit tool button with text entry
The button for opening the edit panel for editing a brush / gradient /
pressure curves looks misaligned because it is added to the end of the
horizontal box and its icon is aligned to the end of the button instead
of its center.

This adds puts the text entry and the edit button into the same
horizontal box and fixes the image alignment.

(cherry picked from commit d985b9b377)
2025-09-17 17:30:37 +02:00
Liam Quin (ankh/demib0y/barefootliam)
8a1f13d838 fix crash on build or startup if extensions file does not exist
(cherry picked from commit 760ef381fe)
2025-09-17 17:30:37 +02:00
Corentin Noël
43b3091756 plug-ins: Allow for more specific print settings with portals
In the case the "create-custom-widget" signal is not emitted (typically when
using the print portal), it is necessary to open a second dialog to fine-tune
the print settings.

(cherry picked from commit 19e230e9cb)
2025-09-17 17:30:37 +02:00
Bruno Lopes
5cf0f58b49 build/linux: Update exiv2 module to 0.28.6
Ported from 91e327ab7a

(cherry picked from commit 04622852fa)
2025-09-17 17:30:37 +02:00
Jehan
bfb5b9f22b app: generalize code for filter action sensitivity.
Remove most of the per-action special-casing. This won't scale, and in
fact it already doesn't work well with all generated actions from GEGL
operations. Considering that any third-party operation will generate an
action too, this just can't work.

Instead we know that:

- Filters on group, vector and link layers must always be run
  non-destructively.
- Non-interactive filters are always run destructively and therefore
  cannot be run on group, vector or link layers.
- GEGL graph as well, unless a specific environment is set.
- All operations with auxiliary inputs cannot be run non-destructively
  (yet) either and therefore must also be deactivated on these layer
  types.

A few more actions are still special-cased (in particular regarding
being used on grayscale drawable or on formats with an alpha channel),
though it would be nice if we could generalize these somehow eventually
too.

(cherry picked from commit 8e2a0381d7)

Cherry-picking NOTE: this commit was edited to remove mentions of link
and vector layers in code. The main logic was kept though as some
effects which should have been deactivated in some cases were still
callable.
2025-09-17 17:26:16 +02:00
Bruno Lopes
6f1c2e0609 build/windows: Make $store_changelog handle <li demo="">
(cherry picked from commit cc4821ffcb)
2025-09-17 17:17:05 +02:00
Jehan
e42e46d7d9 libgimp, plug-ins: implement loading SVG breaking aspect ratio.
Previous implementation was always keeping ratio. If the width/height
argument were of a different aspect, librsvg simply fits the image with
original aspect within the box. Now we will appropriately scale
differently on both dimensions to have the image fill the whole box.

Note that this doesn't work with librsvg before 2.46.0 (not that it's
not possible, just that I haven't looked at how it should be implemented
there (which would be a different implementation anyway since there is
no cairo step).

Finally I add a build warning for when we'll prepare for GIMP 4, as the
pixel density arg needs to be split in 2 (each dimension can have its
own PPI), even though this is not really needed right now.

(cherry picked from commit 9519901150)
2025-09-17 17:17:05 +02:00
Jehan
7b6150134c plug-ins: fix compilation with librsvg < 2.46.0.
Note that it's not actually tested with an old librsvg, but only forcing
this code path with a new librsvg and fixing the compilation
errors/warnings which are outputted.

(cherry picked from commit d8712a525b)
2025-09-17 17:17:05 +02:00
Jacob Boerema
b99b56cc44 libgimpbase: improve parasite API documentation
(cherry picked from commit 640fb89f13)
2025-09-17 17:17:05 +02:00
Bruno Lopes
e0fafcfda0 build/linux: Remove 'x-checker-data' while not on stable Ghostscript
Following faf0fd74

(cherry picked from commit 4ec1368af9)
2025-09-17 17:17:05 +02:00
Alx Sa
65fd742117 widgets: Follow theme mode on Critical Dialog (Win)
Following the improvement in fe4cbb65, the Critical Dialogue
uses the native titlebar in Windows. This means it no longer
adapts to dark and light mode automatically.
Since we don't want GimpCriticalDialog to be dependent on
internal GIMP code, this patch copies over the fallback code
in gimp_window_set_title_bar_theme () (which sets the title bar
based on the background color) when the dialogue is realized.

(cherry picked from commit 520aeacd8c)
2025-09-17 17:17:05 +02:00
Bruno Lopes
e73dfeb65c app/core: Declare libarchive dependency introduced by 6597dabe
Otherwise, the '-I' param will not be set and Apple Clang will
fail on exotic environments like Homebrew on
which not everything is in the common 'includedir'.

(cherry picked from commit be667ac007)
2025-09-17 17:17:05 +02:00
Jacob Boerema
f90d572bb0 plug-ins: add more file plug-in loading tests
Adds a few tga, j2k, wbmp and wmf tests.

(cherry picked from commit 55627934c5)
2025-09-17 17:17:05 +02:00
Alx Sa
ed36d91e47 plug-ins: Fix CRITICALs and GUI issues in file-ps
Resolves #14761 (and other issues)
* Clears out the selection on GimpPageSelector on load so
that it does not try to "redraw" areas when the dialogue is closed
* Fixes layout on load dialogue to better match 2.10 (and use less
vertical space)
* Now that we have a unit property, replace the call to
gimp_label_string_widget_get_widget () with a direct connection to
changes in the config's "unit". This both fixes a CRITICAL caused by
setting a signal on a non-existent object, and restores the function
that adjusts the dimensions when the unit is changed from inches to
millimeters and back.

(cherry picked from commit 61c67d012b)
2025-09-17 17:17:05 +02:00
Ondřej Míchal
8bec5e0910 build/linux: Re-add ghostscript using a new release candidate
This is not a full new release but we might as well test the new
release-candidate to see if it fixes the build issues with GCC 15.

Partially reverts 4ae861f5ac

(cherry picked from commit faf0fd7401)
2025-09-17 17:17:05 +02:00
Bruno Lopes
627eb7eac9 build/windows: Explain the purpose of the bundling script
(cherry picked from commit 5d308e9ed9)
2025-09-17 17:17:05 +02:00
Bruno Lopes
0b1836cbfc build/windows: Prevent *bundle*sym.py script from being called outside Meson
(cherry picked from commit e52b49e0a3)
2025-09-17 17:17:05 +02:00
Bruno Lopes
51336c251c meson: Complete fae39c79 regarding bug_report_url placement
(cherry picked from commit 565804f26e)
2025-09-17 17:17:05 +02:00
Bruno Lopes
dd370e5dd0 build/linux: Make bund_usr function more robust on AppImage script
(cherry picked from commit c734c0f33f)
2025-09-17 17:17:05 +02:00
Jacob Boerema
c52b339d93 libgimpbase: fix #14731 incorrect day/month separators in XMP metadata
In 6b10cce6 I introduced setting created date/time metadata for new
images. However, I made a mistake there by using : instead of - between
year, month and day for the XMP metadata tags.

This commit fixes that.

(cherry picked from commit f02910d00f)
2025-09-17 17:02:01 +02:00
Bruno Lopes
4256945b48 devel-docs: Add macOS versioning instructions too
And a bit of space because the file was getting hard to read

(cherry picked from commit 2346acbfc2)
2025-09-17 17:02:01 +02:00
Bruno Lopes
68ac609295 devel-docs: Mention min-support key of content/gimp_versions.json
(cherry picked from commit 7764eab3f6)
2025-09-17 17:02:01 +02:00
Bruno Lopes
e0ede3fea5 build/windows: Make "etc\ssl\" part of Python component on Installer
(cherry picked from commit ca43c6f20c)
2025-09-17 17:02:01 +02:00
Bruno Lopes
e1df31ce2e build/linux: 'xdg-email' works on Snap package
(cherry picked from commit 05cde48a3e)
2025-09-17 17:02:01 +02:00
Bruno Lopes
03986f8644 meson: Move '-Dbug-report-url' message to more visible place
The reasioning is at: 137bf019

(cherry picked from commit fae39c792d)
2025-09-17 17:01:18 +02:00
Bruno Lopes
75c89cc35d gitlab-ci, devel-docs: Add instructions on maintaining DEB_VERSION
(cherry picked from commit 8f895aaa8c)
2025-09-17 17:01:18 +02:00
Bruno Lopes
e15a2b360a gitlab-ci: Do not generate developer docs on AppImage
We already do not build them on Flatpak and Snap, since
the debian-nonreloc job is enough to test that on Linux.

(cherry picked from commit b4952addb9)
2025-09-17 17:01:17 +02:00
Bruno Lopes
c0f4a47d2a meson: Fix false positive in xdg-email check
And do not output a warning since it is never avaiable on Windows.

(cherry picked from commit 5856941814)
2025-09-17 17:01:17 +02:00
Bruno Lopes
f1bf235818 meson: Drop arbitrary libsocket check introduced since Meson port
It is present since 2.99.2 tag but nothing makes use of 'HAVE_LIBSOCKET'.

(cherry picked from commit 1e5639a47d)
2025-09-17 17:01:17 +02:00
Bruno Lopes
dd2dc14ebc gitlab-ci: Remove redundancy on Store job rules
(cherry picked from commit e8b6f05659)
2025-09-17 17:01:17 +02:00
Michael Natterer
71f88dc598 app: make GimpViewRenderer::border_type and ::border_color private
(cherry picked from commit 6eaf357af9)
2025-09-17 17:01:17 +02:00
Bruno Lopes
3d8dc28f81 build/windows: Fix 'ARM64' typo in TWAIN defines of Installer script
(cherry picked from commit da16988ee0)
2025-09-17 17:01:17 +02:00
Bruno Lopes
bb041398ec Issue #14716: app: Set PATH to prevent DLL Hell on Windows
Closes: #14716

This ports the macOS trick to avoid loading binaries from the host.

SetDllDirectory (and its modern counterpart AddDllDirectory) are
not enough since we do not have control about all processes.

(cherry picked from commit f9809354d5)
2025-09-17 17:01:17 +02:00
Bruno Lopes
1c50d3637c build/linux: Update imath module to 3.2.1
(cherry picked from commit ad03d6c94a)
2025-09-17 17:01:17 +02:00
Bruno Lopes
db481eff60 build/linux: Remove dangling .patch files after org.gimp.GIMP.HEIC drop
x265 is not being built anymore since eefc2bea

(cherry picked from commit f6704a84fa)
2025-09-17 17:01:17 +02:00
Bruno Lopes
27aed674aa .gitlab: Add comment telling how to generate packages on MRs
(cherry picked from commit 6245e4ee70)
2025-09-17 17:01:17 +02:00
Bruno Lopes
7df17bfff2 build/windows: Reorganize MSIX script messages to be consistent with Installer
(cherry picked from commit 0c6d7c15bc)
2025-09-17 17:01:17 +02:00
Michael Natterer
93f9f77cda app: remove gimp_view_renderer_set_border_color(). Instead, add values
STYLE_FG and STYLE_BG to enum GimpViewBorderType, where FG uses the
actual style FG, and BG is simply transparent. Default to STYLE_FG
instead of BLACK (which is BLACK's actual intention).  Also, don't
leak all GeglColors of all view renderers.

(cherry picked from commit 0d7cea41ad)
2025-09-17 17:01:17 +02:00
Bruno Lopes
76fe5fdb55 gitlab-ci: Drop -x86 suffix on Installer jobs in favor of -eol
This fixes the redundancy with [win32-ps, mingw32].

(cherry picked from commit 3d14a2652d)
2025-09-17 17:01:17 +02:00
Bruno Lopes
0810d21006 gitlab-ci: Make possible to create .exe installer and .msix outside GNOME/gimp
This fixes the windows-aarch64 runner blocking contributors (not devs) CI on,
for example, MRs. Now, a x64-only artifact can be created in such cases.

(cherry picked from commit 8993939008)
2025-09-17 17:01:17 +02:00
Bruno Lopes
065a2137e9 gitlab-ci: Explain why sources and dev-docs are not run in MRs
(cherry picked from commit f3a8e0c041)
2025-09-17 17:01:17 +02:00
Bruno Lopes
c34718ec1a gitlab-ci: Simplify a bit environment variables on Dockerfile
We aren't using them from ENVIRON so that is no need to replicate.

(cherry picked from commit 2b779c6a11)
2025-09-17 17:01:17 +02:00
Bruno Lopes
1b46f9919a gitlab-ci: Set WORKDIR on debian jobs Dockerfile
(cherry picked from commit 735ae9f123)
2025-09-17 17:01:17 +02:00
Michael Natterer
c85ed3a831 app: rename GIMP_VIEW_BG_USE_STYLE to GIMP_VIEW_BG_STYLE
(cherry picked from commit 09203bb93e)
2025-09-17 17:01:17 +02:00
Bruno Lopes
a301edcaa6 gitlab-ci: Remove some dangling GIMP_CI_* variables
They are never used, specially (by redundancy) the ones
of jobs which are already triggered on commits.

(cherry picked from commit 1d5a1c9972)
2025-09-17 17:01:17 +02:00
Michael Natterer
ff52288279 app: get rid of GimpViewRenderer's separate "icon_surface", and get
rid of implicit knowledge about the surface's scale factor.

- render everything to renderer->surface
- pass the widget scale factor around explicitely when rendering
  to the surface
- when drawing the surface to the widget, get the scale factor from
  the surface itself.

(cherry picked from commit fb04b7cb8f)
2025-09-17 17:01:17 +02:00
Bruno Lopes
6e9d42f6ed gitlab-ci: Drop debian -x64 suffix on non-Appimage jobs in favor of -nonreloc
It is a bit too long and not the ideal naming but with the new one we avoid
the -x64 arch suffix which feels redundant due to the [x86_64_v3] added by GL

(cherry picked from commit 6fe919c6e2)
2025-09-17 17:01:17 +02:00
Bruno Lopes
ea9a889560 gitlab-ci: Drop WORKSHOP_OPTION var in unstable series
It was introduced in 74a05bc9 but we are not stable anymore

(cherry picked from commit 1c7a43a021)
2025-09-17 17:01:17 +02:00
Bruno Lopes
dc105fced1 build/windows: Little improvement to config_clean.h comment
(cherry picked from commit baa5e0690e)
2025-09-17 17:01:17 +02:00
Bruno Lopes
0442aaba18 build/windows: Change $a64_bundle to $arm64_bundle on MSIX script
This new naming is consistent with the Installer script.

(cherry picked from commit ffa2946b18)
2025-09-17 17:01:17 +02:00
Bruno Lopes
6c3d75f2d2 build/windows: Add optional one-arch support to Windows installer
This removes the old custom DIR/DDIR code from the era of the
installer was built locally. Now, it will refer to bundles so
making the .exe installer based on the bundles available,
not enforcing the developer to download all bundles anymore.

We will not use such new facility on CI since we distribute an
universal installer with all arches since 2.8 for good reasons.
This will not change, we will continue to create multi-arch .exe.

The main advantage is locally. Now the .iss script can
recognize at ISCC build time the bundles on the machine,
to create, for example, an one-arch installer. This is very
fast and practival for local hacking the installer scripts.

Of course, this also makes the installer script powerful and
consistent with all other dist scripts which already can do
one-arch packages (appimage, flatpak, snap and msix).

(cherry picked from commit 8710127641)
2025-09-17 17:01:17 +02:00
Bruno Lopes
dbefff4066 build/windows: Organize tookit section of Installer script to be consistent
(cherry picked from commit cfb1b539f2)
2025-09-17 17:01:17 +02:00
Bruno Lopes
9206bd1eb0 build/windows: Add comment about parity with MSIX on Installer scripts
(cherry picked from commit 6ddb33135c)
2025-09-17 17:00:55 +02:00
Bruno Lopes
af4fb0c736 build/windows, devel-docs: The minimum Windows version is actually 10.0.18362.0
DWMWA_USE_IMMERSIVE_DARK_MODE and activeCodePage were introduced on "1903"
The Store version manifest was already using this as minimum version since
day 1, so the commit just extends that minimum version to the Installer.

While is unlikely that users will be affected, we can revert this commit if:
1) LTSC/LTSB users report on tracker that is not possible to install GIMP;
2) we confirm that GIMP works on this machine even with that incompatible API.

(cherry picked from commit 125e355c44)
2025-09-17 17:00:55 +02:00
Bruno Lopes
e5f24a9009 build/windows: Drop absurd custom translation of WindowsVersionNotSupported
This have nothing to do with the OS build version but mostly with the
OS arch. Yeah, the original Inno string is obscure but at least not false.

(cherry picked from commit 246d73de04)
2025-09-17 17:00:55 +02:00
Michael Natterer
ae69624488 app: redo preview backgrounds completely
While there is a style "background color", the idea of a "widget
background color" is completely bogus, the widget background can be a
gradient or whatever.

- Get rid of "background" in GimpViewable's preview API, only leave the
  "foreground color" there for things like brushes or fonts.
- In GimpViewRenderer, add the background types to be used to class and
  instance, so each renderer type can choose what it needs.
- Render all previews to alpha surfaces, and do the background
  for all renderers generically in gimp_view_renderer_real_draw(),
  then render the preview surface on top of it.

(cherry picked from commit c2195a24ca)
2025-09-17 16:52:52 +02:00
Bruno Lopes
519b2a21e0 build/windows: Make Inno source section more simple (again)
(cherry picked from commit 977bcae71e)
2025-09-17 16:51:21 +02:00
Bruno Lopes
b9627f313e build/windows: Clarify meson.build file of Installer lang files
(cherry picked from commit 42e72b29c1)
2025-09-17 16:51:21 +02:00
Bruno Lopes
d90852aa55 build/windows: Make self_build function work with every meson project
(cherry picked from commit 193cf720c6)
2025-09-17 16:51:21 +02:00
Alx Sa
7507df7923 text: Don't call size_changed when typing
This patch provides a temporary fix for issue
14442. Currently, gimp_drawable_size_changed ()
is called whenever a drawable's size changes (like by
scaling, rotating, resizing, etc). When called, it resizes
filters to the layer's new width and height.
Unfortunately, it is currently also called when typing new
text, as that changes the layer size too. This causes filters
like Drop Shadow to be cut-off because they originally
extended outside the bounds of the layer.

This patch checks if the layer has been rasterized - if it hasn't,
then size_changed () is not called. As stated, this is a temporary
fix for GIMP 3.1.4, and will likely be replaced with a more
permanent fix for GIMP 3.2

(cherry picked from commit 03443ffcc1)
2025-09-17 16:51:21 +02:00
Bruno Lopes
af3b5cba29 build/windows: Remove redundant error check on Windows deps script
(cherry picked from commit 4f6036e3e6)
2025-09-17 16:51:21 +02:00
Bruno Lopes
bd5c1abf62 build/windows: Improve native error catching on .ps1 scripts
(cherry picked from commit 20d37cbe45)
2025-09-17 16:51:21 +02:00
Bruno Lopes
dd8673bc79 gitlab-ci: Update Pipeline types summary with meson-health and appimage
This documents meson-health and appimage

Also, remove the speed comments because these pipelines will
run automatically regardless of the developer intention.

(cherry picked from commit 87f670b5d1)
2025-09-17 16:51:21 +02:00
Bruno Lopes
120098fd1f meson: Do not check for DirectX SDK in hardcoded MSVC dirs
MSYS2 provides the same needed library so let's just find it properly.

Note: even when we do have MSVC support we should never hardcode .build
files. Setting paths to be searched on MSVC is the job of LIB env var.

(cherry picked from commit 634dd304d7)
2025-09-17 16:51:21 +02:00
Bruno Lopes
f4629bae43 build/windows: Replace f333aa35 text regarding MSIX <> EXE parity
(cherry picked from commit 3b11006eed)
2025-09-17 16:51:12 +02:00
Bruno Lopes
868bd52608 build/windows: Make clearer that the MSIX should be identical to the Installer
(cherry picked from commit f333aa354b)
2025-09-17 16:51:12 +02:00
Bruno Lopes
05001a0963 build/windows: Remove some empty lines on Windows build scripts
(cherry picked from commit 9a118dd887)
2025-09-17 16:47:33 +02:00
Bruno Lopes
0b03537534 gitlab-ci: More ccache remnants cleanup on Windows builds
(cherry picked from commit 0570ea2b0b)
2025-09-17 16:47:33 +02:00
Bruno Lopes
fde94e3b6a gitlab-ci: Remove $UMFPACK var from crossbuilds era
(cherry picked from commit 891e55829c)
2025-09-17 16:47:33 +02:00
Bruno Lopes
23ee091011 meson: Add option to generate DWARF symbols on Windows
By default, it is evaluated to CodeView since this is the format we
use on .exe installer and .msix for many reasons (see git log).

However, some people may not use standard debugging tools for
Windows but, for example, GDB, so they need DWARF symbols since
GDB debugger (and the GCC toolchain) have limited Windows support.

(cherry picked from commit a6545f3511)
2025-09-17 16:47:33 +02:00
Anders Jonsson
f83d93f24b plug-ins: make JPEG 2000 codestream title translatable
(cherry picked from commit 3f13511015)
2025-09-17 16:47:33 +02:00
lillolollo
b3604bb864 app/core prevent memory leak
(cherry picked from commit d261d466e9)
2025-09-17 16:47:33 +02:00
Bruno Lopes
198b08dc2f build/linux: Take AppStream metadata for Snap package
Like the Flatpak and, at a lesser extent, AppImage.

(cherry picked from commit d8a264283b)
2025-09-17 16:47:15 +02:00
Bruno Lopes
70652c0a8f build/linux: Update Snap README regarding babl and GEGL tagging
(cherry picked from commit bb1d96528d)
2025-09-17 16:47:15 +02:00
Alx Sa
a20d8fa561 tools: Fix crash in passthrough composited preview
Resolves #13087
We use gimp_layer_get_effective_mode () to retrieve
a simplified layer mode for optimization purposes
(e.g. if it's effectively NORMAL, we can do less processing).
GimpTransformGridTool used this function when the user
requests Composited Preview to only apply transforms to
individual layers in a group if absolutely necessary.
This means that sometimes, it returns NORMAL instead of
PASS_THROUGH depending on the number and types of
layers in the group.

Since 71aff497, when we remove a filter we also update the
effective mode of the group layer. However, this leads to an
infinite loop scenario where the effective mode change causes
the TransformGridTool to repeatedly remove and add a filter
until GIMP crashes.

This patch changes the gimp_transform_grid_tool_add_filter ()
check to always get the actual mode rather than the effective mode.
This prevents the effective mode change from causing an infinite loop,
but does mean that we now always apply transforms to all layers of the
group even if the composite preview would work fine.

(cherry picked from commit ede124ff85)
2025-09-17 16:47:15 +02:00
Bruno Lopes
d57fb16c2d build/windows: Rely on output (not on error code) on 'msix_trust' check
(cherry picked from commit f890c5ab68)
2025-09-17 16:47:15 +02:00
Bruno Lopes
0079ca3db2 build/linux: appimagetool now supports specifying .appimage path on .zsync
See: https://github.com/AppImage/appimagetool/pull/111
(cherry picked from commit 9eee96328b)
2025-09-17 16:47:15 +02:00
Bruno Lopes
51ec493554 build/linux: Use $CRAFT_PART_INSTALL for libheif plugins detection on Snap
$CRAFT_STAGE was being used but that is wrong since nothing is staged yet.
$CRAFT_PART_INSTALL is the right place where the packages are available.

(cherry picked from commit 79a92ce439)
2025-09-17 16:44:50 +02:00
Bruno Lopes
c9bbeed48a build/linux: Drop org.gimp.*.HEIC in favor of org.freedesktop.*.codecs-extra
See: https://github.com/flathub/org.gimp.GIMP/issues/414
(cherry picked from commit eefc2bea1a)
2025-09-17 16:44:50 +02:00
Bruno Lopes
5d3049c29d gitlab-ci: Catch gimp-flatpak-builder.log artifact
Otherwise we don't know what happened in GIMP build. It
is too verbose to output on GitLab runner console due to
flatpak-builder awful messages about .debug stripping.

(cherry picked from commit f7cfd4ef39)
2025-09-17 16:44:50 +02:00
Bruno Lopes
eaa43858d3 build/linux: Only submit snaps to Snap Store on releases
(cherry picked from commit 0c1963ca7c)
2025-09-17 16:44:50 +02:00
Bruno Lopes
1cd9e8ca89 build/linux: More fixes to the README
(cherry picked from commit 0868cf3cd3)
2025-09-17 16:44:50 +02:00
Bruno Lopes
2c16fb989b build/linux: Fix some typos on Snap README
(cherry picked from commit bb26b9f81d)
2025-09-17 16:44:50 +02:00
Bruno Lopes
41689ef2e2 build/linux: Add Snap maintenance README like Flatpak and MSIX
But, right now, the "## Stable and Development releases"
section is not applicable due to the pass over being WIP:
https://github.com/snapcrafters/gimp/issues/447

(cherry picked from commit 052eb474cc)
2025-09-17 16:44:50 +02:00
Jehan
ff48f18f8a plug-ins: add a pygimp.interp on macOS too.
(cherry picked from commit abf026fc54)
2025-09-17 16:44:50 +02:00
Bruno Lopes
f6c1b2682e build/windows: Bump MaxVersionTested on AppxManifest to 10.0.26100.0 (24H2)
I have been using the MSIX on that version since some time without problems.

(cherry picked from commit 9bf03bc8f6)
2025-09-17 16:44:50 +02:00
Bruno Lopes
fc9014c0ed build/windows: WinSDK package name on winget don't have the revision digit
(cherry picked from commit 202ae26c80)
2025-09-17 16:44:50 +02:00
Bruno Lopes
65b354d1b7 build/windows: On WinSDK not found message, recommend to install MaxVersionTested
(cherry picked from commit 973ae3eef2)
2025-09-17 16:44:50 +02:00
Bruno Lopes
35e46412da build/windows: Print error message when WinSDK is not found by MSIX script
(cherry picked from commit b04841d993)
2025-09-17 16:44:50 +02:00
Bruno Lopes
364083a2b7 gitlab-ci: Remove redundancy on dist-flatpak-weekly rules
(cherry picked from commit 437ba0aa46)
2025-09-17 16:44:50 +02:00
Michael Natterer
08216b96c0 app: enable popup previews on GimpImagefile
(cherry picked from commit 5b765fc665)
2025-09-17 16:44:14 +02:00
Bruno Lopes
bf29ced257 gitlab-ci: Remove crossbuilds remnants on cppcheck
(cherry picked from commit f5fa753dc2)
2025-09-17 16:44:14 +02:00
Bruno Lopes
4aa9d4adb6 gitlab-ci: Remove bogus cache: comment on deps-flatpak
For the same reason of 3e958583 this will not work.
And even if we manage to have it configured for
containers in the future, it would be slow like b51f2b52.

(cherry picked from commit d59c230560)
2025-09-17 16:44:14 +02:00
Bruno Lopes
62ff5c1375 gitlab-ci: Remove bogus cache: key on file-plug-in-tests
GNOME Infra does not enable local caching and
we don't have distributed/remote caching either.

(cherry picked from commit 3e9585839e)
2025-09-17 16:44:14 +02:00
Bruno Lopes
00657b7efb gitlab-ci: Do not pull whole repo on Snap job (since we don't use Launchpad)
Following: 5da4b890
(cherry picked from commit a6b09d8029)
2025-09-17 16:44:14 +02:00
Bruno Lopes
70524615a3 gitlab-ci: Test reducing Snap builds timeout to 20min
Seems we not need more than that even in the deps stage.

(cherry picked from commit 56a5dea720)
2025-09-17 16:44:14 +02:00
Alx Sa
5efc38a22b plug-ins: Fix signed JPEG 2000 import
Our JPEG 2000 plug-in assumed all imported images
are unsigned - however, it's possible to store signed data
as well.
This patch adds a check to see if the image has the `sgnd`
flag set to TRUE. If so, we offset the signed data to get it
into the unsigned range before converting to an image.

(cherry picked from commit c35abbe090)
2025-09-17 16:44:14 +02:00
Bruno Lopes
92bf5af6d5 build/windows: Add comment inside *_sym.py script explaning its situation
While it is already explained on meson.build, it is desirable to
explain inside the script too in the case someone browse the files.

(cherry picked from commit 1730c62187)
2025-09-17 16:40:25 +02:00
Bruno Lopes
ae5774f9b0 build/windows: Put (not used) Lua below Python on bundling script
(cherry picked from commit 03172b7196)
2025-09-17 16:40:25 +02:00
Jehan
630b1a2e4b app: properly escape characters which need to be.
This fixes handling of text with for instance an ampersand (as in the
next AppStream release note listing).

(cherry picked from commit 048c86ffcf)
2025-09-17 16:40:25 +02:00
Bruno Lopes
370e79457f build/windows: Drop 'replacesameversion' in favor of 'ignoreversion' on Inno 6.5.0
They are now mutually exclusive.

(cherry picked from commit 632cbd9ed3)
2025-09-17 16:40:25 +02:00
Bruno Lopes
3c09a8fbf6 build/windows: From Inno 6.5.0, 'is' (Icelandic) language is unofficial
(cherry picked from commit 5b97d96349)
2025-09-17 16:40:25 +02:00
Bruno Lopes
6a0d699d91 build/windows: Go back to latest Inno since the Task Dialog is fixed on 6.5.0
Reverts: 8a6a6516

See: 9e493a15d9/whatsnew.htm (L243)
(cherry picked from commit b24fc1b74b)
2025-09-17 16:40:25 +02:00
Bruno Lopes
dcdaa47938 build/windows: Add comment about purpose of each list in all-deps-uni.txt
(cherry picked from commit ebec92aec7)
2025-09-17 16:40:25 +02:00
Bruno Lopes
2b06439488 build/linux: Change collapsible section ID to the more technical '*_submission'
We already use '*_submission' on the MSIX script.

Submission is the first act, the one which we trigger on CI.
The publishing is done by the store (Flathub or Snap Store).

(cherry picked from commit 2e12de6747)
2025-09-17 16:40:25 +02:00
Bruno Lopes
264bb8185e build, gitlab-ci: Drop last ccache shenanigans
Let's prioritize reproducibility over small performance gains,
specially when we have too many packages do deal with.

(cherry picked from commit 839064a6c6)
2025-09-17 16:40:25 +02:00
Bruno Lopes
b3aaae6b46 build/linux, gitlab-ci: Change .flatpak-builder artifact naming to be more consistent
(cherry picked from commit 56cc7e363b)
2025-09-17 16:40:25 +02:00
Bruno Lopes
c5b03588ad build/linux: Restore comment of '--destructive-mode'/host mode on Snap script
It was on the env section before the remote-build drop. Let's restore it and
move to the build section which is more appropriate.

(cherry picked from commit aee3bd23d6)
2025-09-17 16:40:25 +02:00
Bruno Lopes
06caf0f336 build/linux: Add check to ensure we use the right 'snapcraft-rocks' image
If the container image don't have the base snap required by
snapcraft.yaml, it will naturally fail.

(cherry picked from commit a87ee3c241)
2025-09-17 16:40:25 +02:00
Michael Natterer
33754b9732 app: GimpRow: don't ref the viewable, use a weak ref instead.
(cherry picked from commit 124993d770)
2025-09-17 16:40:25 +02:00
Michael Natterer
2f0fcbf0f7 app: fix gimp_viewable_has_preview() to look at both the get_preview()
*and* get_pixbuf() methods. Fixes #14657.

(cherry picked from commit ff9a14b7d0)
2025-09-17 16:40:25 +02:00
Michael Natterer
62734b98a5 app: add GimpRowFilter and GimpRowDrawableFilter and port the filters
popover to GimpContainerListView.

(cherry picked from commit f96a7192cd)
2025-09-17 16:40:25 +02:00
Bruno Lopes
b1397d782f build/linux: Rework deps installation message on Snap script
The new text is more alike to the flatpak one, which
should make easier to understand both scripts.

(cherry picked from commit d4aac4a3e5)
2025-09-17 16:40:25 +02:00
Bruno Lopes
14a90bc49d build/linux: Make Snap on GNOME runners (not on Launchpad)
Now can make snaps 3x faster on CI without snapcraft remote-build.

(cherry picked from commit 5da4b89002)
2025-09-17 16:40:25 +02:00
Bruno Lopes
8fc0bca456 build/linux: Remove redundant plugs: in favor of 'gnome' Snap extension
See: https://documentation.ubuntu.com/snapcraft/stable/reference/extensions/gnome-extension/
(cherry picked from commit b960be9735)
2025-09-17 16:40:25 +02:00
Michael Natterer
353e4e1b4b app: GimpRowSettings: forgot to remove some junk.
(cherry picked from commit 2d57b1764d)
2025-09-17 16:40:25 +02:00
Michael Natterer
750b25e89a app: GimpRow's icon always exists, no need for if (priv->icon).
(cherry picked from commit 6651d4eb7f)
2025-09-17 16:40:25 +02:00
Michael Natterer
42ece88151 app: use a GimpContainerListView in the layer options dialog.
(cherry picked from commit 795cf081cc)
2025-09-17 16:40:25 +02:00
Michael Natterer
344ff82a2d app: remove some #if 0'ed junk from GimpContainerListView, but leave
some there as a reminder.

(cherry picked from commit 7fad4ad323)
2025-09-17 16:40:25 +02:00
Michael Natterer
9d094a26f2 app: remove unused member from struct GimpContainerIconView
(cherry picked from commit 9e2b378414)
2025-09-17 16:40:25 +02:00
Michael Natterer
03ae50a4f6 app: set the container last in all GimpContainerView constructors, to
avoid traversing the just-filled view when "context" or "view-size"
changes.

(cherry picked from commit 92e68453df)
2025-09-17 16:40:25 +02:00
Michael Natterer
3594b6497e app: gimp_container_view_set_container(): standardize a g_return_if_fail()
(cherry picked from commit c114e96096)
2025-09-17 16:40:25 +02:00
Michael Natterer
22e725c129 app: create GimpRow with the view size of its GimpContainerView
(cherry picked from commit b4e27fbf83)
2025-09-17 16:40:25 +02:00
Michael Natterer
5bfca496fc app: add GimpRowSeparator and GimpRowSettings and port
GimpSettingsEditor to GimpContainerListView.

The separator currently doesn't draw anything, maybe it needs some
CSS.

(cherry picked from commit 33dfccde51)
2025-09-17 16:40:25 +02:00
Michael Natterer
e262f7f07f app: GimpRowDeviceInfo: add missing dot in comment
(cherry picked from commit 2f87f8e51e)
2025-09-17 16:40:25 +02:00
Gabriele Barbero
48548ab742 display: avoid critical on master devices
When the device is of type GDK_DEVICE_TYPE_MASTER, calling
gdk_device_get_vendor_id() and gdk_device_get_product_id() fails and
triggers a CRITICAL warning. This commit avoids invoking these functions
on master devices, where failure is guaranteed.
See #14219

(cherry picked from commit 6574f6ff30)
2025-09-17 16:40:24 +02:00
Alx Sa
75c036b6c1 core: Set alpha value for image palette imports
Resolves #14649
After the Color Space Invasion, we retrieve the color format
from the palette when creating palettes from images. However,
gimp_palette_import_create_image_palette () still only receives
RGB values. Thus, the palette can store RGBA values without the
alpha, thus defaulting it to a random alpha value. This can cause
issues when using the palette to make a gradient or other instances
where the alpha value is reintroduced.
This patch checks if the format has an alpha channel, and if so, sets
the alpha to 255. Future work can be done to make the image palette
conversion less RGB-specific.

(cherry picked from commit 3a2d9c477e)
2025-09-17 16:40:24 +02:00
Bruno Lopes
f4ab1beb55 gitlab-ci: Change forward slashes to backslashes on script: of Windows jobs
Merely cosmetical change to align with the OS design.

(cherry picked from commit c72fe4ef11)
2025-09-17 16:40:24 +02:00
Bruno Lopes
0d6175e2a5 build/linux: Update imath and graphviz flatpak modules
Synced from: e6c69021e3

(cherry picked from commit 3bf6aaa0fa)
2025-09-17 16:40:24 +02:00
Michael Natterer
30691c39f0 app: GimpContainerListView: preserve the selected items across
GimpContainer::reorder().

(cherry picked from commit 35383741f1)
2025-09-17 16:40:24 +02:00
Michael Natterer
97f473aa3f app: gimp_layer_stack_reorder(): use the passed old_index instead of
remembering it before chaining up.

(cherry picked from commit b49f4a3631)
2025-09-17 16:40:24 +02:00
Bruno Lopes
378f990fe9 build/linux: Add comment about why we don't use config.h on Snap dist
(cherry picked from commit d5d6b5e726)
2025-09-17 16:40:24 +02:00
Bruno Lopes
ff4e58b89c build/linux: Add some sub comments on flatpak dist tools section
(cherry picked from commit 771fcb576f)
2025-09-17 16:40:24 +02:00
Bruno Lopes
b2357ffe26 build/linux: Clarify files/repo section comment on Flatpak dist script
(cherry picked from commit 0f91efa3d5)
2025-09-17 16:40:24 +02:00
Bruno Lopes
862bbe0014 build/linux: Fix .snap path on 'snapcraft upload' command
(cherry picked from commit bf03d71ad2)
2025-09-17 16:40:24 +02:00
Bruno Lopes
f02ed53502 build/linux: Remove exit check on flatpak dist
Let's hope this fixes the bug.

(cherry picked from commit 855d07193b)
2025-09-17 16:40:24 +02:00
Alx Sa
64a23d0799 plug-ins: Reduce Raw Data load dialogue height
Currently, all Raw Data parameters are displayed in a column
when loading. This can cause the dialogue to go off-screen on
displays with smaller heights.
This patch adjusts the dialogue to be a two-column layout, similar
to some of our legacy plug-ins, to reduce the chance of the options
going off-screen.

(cherry picked from commit 3969c002ee)
2025-09-17 16:40:24 +02:00
Bruno Lopes
a8f194d6c1 build/linux: Hopefully bug of only aarch64 being distributed due to exit code
(cherry picked from commit 6645f245cb)
2025-09-17 16:40:24 +02:00
Bruno Lopes
251870ade6 build/linux: Fix wrong extraction of repo*.tar
(cherry picked from commit 19e83a0eb5)
2025-09-17 16:40:24 +02:00
Jacob Boerema
3b72778d76 libgimp: fix handling of "charset=" in comments
The charset=[ascii|InvalidCharsetId] comment originates from broken
handling in exiv2 of Exif.Photo.UserComment. However, due to the way
we (or possibly other programs) write comments, this could have
propagated to the generic image comment and to the
Exif.Image.ImageDescription metadata tag.

By adding a check for an existing comment first, the metadata tags
were not necessarily checked anymore.

To fix this in all cases we need to unconditionally read and interpret
the comment and both metadata tags.
We move handling of charset=InvalidCharsetId to the already existing
function gimp_image_metadata_interpret_comment by adding some
parameters and call this function for all three cases.

(cherry picked from commit 8e11b1bfb4)
2025-09-17 16:40:24 +02:00
Jacob Boerema
2d8e3a2523 libgimp: favor existing image comment instead of
always loading comment from metadata

I noticed that if there was text in one of the metadata tags that we
consider equivalent to the image comment, the first one of those
always took precedence over an actual image comment that an image
may have.

Let's change that to only use metadata comments if the image didn't
have a comment set. So, if present, load the gimp-comment parasite
and set that as comment. If not present, we try to load a comment
from metadata.

(cherry picked from commit 780e848120)
2025-09-17 16:40:24 +02:00
Michael Natterer
170d676a22 app: add "gint old_index" argument to GimpContainer::reorder()
(cherry picked from commit e9b2b1ad7b)
2025-09-17 16:40:24 +02:00
Michael Natterer
638b706371 app: G_DECLARE_DERIVABLE_TYPE(GimpContainerListView)
(cherry picked from commit 007e8e6615)
2025-09-17 16:40:24 +02:00
Michael Natterer
0b8b40fcda app: add dummy API gimp_container_list_view_set_search_entry() and
use it in GimpContainerPopup. Fixes #14613 but only the crash, the
feature is missing.

(cherry picked from commit d65d55d64a)
2025-09-17 16:40:24 +02:00
Michael Natterer
6fb6835412 app: GimpContainer: insert() was not emitting GListModel::items-changed.
Also add an empty default implementation of reorder() for unconditional
upchaining.

(cherry picked from commit b85f517c22)
2025-09-17 16:40:24 +02:00
Michael Natterer
f170eaa493 app: GimpRow: guard against the row being destroyed during a rename
(happens on sorted containers). Rename member variables involved in
renaming to "rename_...".

(cherry picked from commit 7f70656c05)
2025-09-17 16:40:24 +02:00
Michael Natterer
cd178cb6e0 app: GimpDeviceEditor: fix whitespace
(cherry picked from commit b89ae68d07)
2025-09-17 16:40:24 +02:00
Bruno Lopes
8a928fb48c build/linux: Fix typo in flatmanager_text variable evaluation
(cherry picked from commit e1b2b44f3b)
2025-09-17 16:40:24 +02:00
Bruno Lopes
343613c2e1 build/linux: Fix build-bundle on gimp job after
a6544047

(cherry picked from commit 34285d4459)
2025-09-17 16:40:24 +02:00
Bruno Lopes
cf8ccde824 build/linux: Fix lack of desktop icon when running Snap
(cherry picked from commit 0f09167e50)
2025-09-17 16:40:24 +02:00
Bruno Lopes
40a2ffc0ab build/linux: Add comment about 'dot' situation on snapcraft.yaml
(cherry picked from commit fa19794d74)
2025-09-17 16:40:24 +02:00
Bruno Lopes
0756e9eb29 build/linux: Fix for glib_networking_works test on Snap
(cherry picked from commit 1ec86c7d6a)
2025-09-17 16:40:24 +02:00
Michael Natterer
0d6332db4f app: switch GimpDeviceEditor to GimpContainerListView, and add a
GimpRow subclass for GimpDeviceInfo objects.

(cherry picked from commit bd33d8dd7e)
2025-09-17 16:40:24 +02:00
Michael Natterer
ccff32ce25 app: formatting in GimpDeviceInfo
(cherry picked from commit 170bd79572)
2025-09-17 16:40:24 +02:00
Michael Natterer
4cc43207bd app: GimpFilteredContainer: update sort_func when the src container's
sort_func changes.

(cherry picked from commit 1a9bea59f1)
2025-09-17 16:40:24 +02:00
Bruno Lopes
f322a862e2 build/linux: Remove bogus pygimp.interp creation on Snap
(cherry picked from commit 3c02c8bcb7)
2025-09-17 16:40:24 +02:00
Bruno Lopes
75a3035e9e build/linux: Fix local distribution of .flatpak
(cherry picked from commit a65440478c)
2025-09-17 16:40:24 +02:00
Michael Natterer
1a60da1540 app: prepare GimpRow for subclassing: add protected accessors for its
child widgets, and more virtual functions.

(cherry picked from commit 211d415f1c)
2025-09-17 16:40:24 +02:00
Bruno Lopes
62ebacbca3 gitlab-ci: Fix flatpak builds being interrupted
(cherry picked from commit a960e8f4d1)
2025-09-17 16:40:24 +02:00
Bruno Lopes
9a76ae6f22 build/linux: Add 'snapcraft pack' code on local snaps
(cherry picked from commit 56e8275690)
2025-09-17 16:40:24 +02:00
Bruno Lopes
8601b86229 build/linux: Fix 'if not can_import_heic and not can_import_avif' test on Snap
Similar to c860ffe2 but now for build-time.

(cherry picked from commit c25418f38a)
2025-09-17 16:40:24 +02:00
Bruno Lopes
e942a9889e build/linux: Print more debug info on Snap dist: name, track and gimp_version
That completes a3aca3c1 making the snap script just like the other ones but
it differs on the way to get GIMP_UNSTABLE since we don't have access to
the GIMP's config.h file after building with snapcraft remote-build.

(cherry picked from commit effedb9248)
2025-09-17 16:40:24 +02:00
Bruno Lopes
f3f5545b64 build/linux: License snapcraft.yaml under GPL-3.0+
Like all other build files in this repo

(cherry picked from commit f157206146)
2025-09-17 16:40:24 +02:00
Bruno Lopes
204c45a24b build/linux: Fix libheif comment on Snapcraft (it is HEJ2 not J2K)
So, in commits c860ffe2 and 2e5ac18d you should read HEJ2

(cherry picked from commit 59ab053ab9)
2025-09-17 16:40:24 +02:00
Michael Natterer
bce3c8a91d app: move part of the freeze/thaw logic back from cruft to
GimpContainerView to the "refresh" logic of selecting the same item
works again.

(cherry picked from commit 04fa596dd1)
2025-09-17 16:40:24 +02:00
Michael Natterer
adf3ec5b3a app: in gimp_container_thaw(), emit GimpContainer::thaw after
GListModel::items-changed so views are refilled before running their
"thaw" logic.

(cherry picked from commit f767cdb771)
2025-09-17 16:40:24 +02:00
Michael Natterer
7eb3b86a6f app: move more API to gimpcontainerview-cruft.[ch] and make
gimpcontainerview.c cruft-free.

(cherry picked from commit 8766a228af)
2025-09-17 16:40:24 +02:00
Alx Sa
52e4751ed8 libgimpwidgets: No decimal for u8 RGB color selector
This patch uses the is_u8 variable in GimpColorScales's
create_group () function to conditionally set decimals to
0 when creating u8 RGB color selectors.
This change will help further distinguish between the 0...00
and 0..255 views in the Color Selectors. It will also better
convey to users that u8 is an integer value rather than a
floating point.

(cherry picked from commit d58b17cb10)
2025-09-17 16:40:24 +02:00
Bruno Lopes
8b151b07b6 build/linux: Do not plug with useless ffmpeg content snap
libheif from GNOME SDK Snap can't directly use codecs from ffmpeg due
to the use of plugin system (plugins on LIBHEIF_PLUGIN_PATH) at build time.

Also, even if it could (by custom building, which I don't plan to do),
codecs like libde265/x265 are always present in GNOME runtime Snap
(unlike GNOME runtime flatpak) so there is no way of not installing them.

(cherry picked from commit 2e5ac18d78)
2025-09-17 16:40:24 +02:00
Bruno Lopes
0765b43dc5 build/linux: Fix AVIF, HEIC and J2K support on Snap package
The GNOME SDK Snap have only AVIF and HEIC decoding plugins,
no AVIF or HEIC encoding plugins and no J2K at all. So,
let's complete the support with 'build-packages:'.

(cherry picked from commit c860ffe2a8)
2025-09-17 16:40:24 +02:00
Alx Sa
e5d39aca31 libgimpwidgets: Use arrows for GimpSpinScale cursors
The "grabbing" cursor currently used is quite large on
newer versions of GTK3, and makes it difficult for users
to see where they're grabbing. This patch switches to
using "pointer" cursor for hovering over the slider area,
and "col-resize" when actually moving the slider.
It also reverts padding changes in CSS so that the progress
bar aligns with the place the user clicks. Padding is added
in Cairo for the label, though the number entry is now
flush against the input buttons.

(cherry picked from commit 9a1984a707)
2025-09-17 16:40:24 +02:00
Bruno Lopes
a1662b354e build/linux: Add comment about wreid libexpat1-dev situation on Snap
(cherry picked from commit 863152f1af)
2025-09-17 16:40:24 +02:00
Bruno Lopes
ab32b16854 build/linux: Update libheif Flatpak module to 1.20.2
Synced from 93db928805

(cherry picked from commit d6766cc374)
2025-09-17 16:40:24 +02:00
Bruno Lopes
7d72a31431 build/linux: Move build-bundle code back to 3_dist-gimp-flatpakbuilder.sh
This makes more clear that making .flatpak is a dist stuff while
maintaining the multiarch support introduced in caf46017.

(cherry picked from commit 687382b98d)
2025-09-17 16:40:24 +02:00
Bruno Lopes
634a983d3c build/linux: Add comment about libaa1-dev too on snapcraft.yaml
Following cdcdda4060

This one of the packages that it is on SDK snap but incompletely.

(cherry picked from commit f989b4f50c)
2025-09-17 16:40:24 +02:00
Bruno Lopes
1dd58f6084 build/linux: Better support for local Snap builds
(cherry picked from commit a65d7a64a2)
2025-09-17 16:40:24 +02:00
Bruno Lopes
fb4a3c6f9a build/linux: Remove redundant libopenexr
It is already provided at runtime by GNOME 46 snap

(cherry picked from commit ba31ef35d4)
2025-09-17 16:40:24 +02:00
Bruno Lopes
55f890976c build/linux: Remove redundant libappstream-dev
It is already provided by the GNOME 46 SDK snap

(cherry picked from commit 778f81984f)
2025-09-17 16:40:24 +02:00
Bruno Lopes
368a9dd9b0 build/linux: Set -Dlibdir on Snap building
On my tests, this is needed locally.

(cherry picked from commit ba60cab0a6)
2025-09-17 16:40:24 +02:00
Bruno Lopes
3975bc4f76 build/linux: Add comments on packages that are also on GNOME SDK Snap
(cherry picked from commit cdcdda4060)
2025-09-17 16:40:24 +02:00
Bruno Lopes
860c1e1b3d build/linux: Reduce redundancy of 'build-environment' on snapcraft.yaml
(cherry picked from commit 98a1009c4a)
2025-09-17 16:40:24 +02:00
Michael Natterer
8ff11234f5 app: add gimp_viewable_has_preview() and use it in GimpRow, instead of
peeking around in GimpViewableClass manually.

(cherry picked from commit 3b6bb46d36)
2025-09-17 16:40:23 +02:00
Michael Natterer
aea5e7ec9e app: implement GimpContainerListView, using a GtkListBox
It completely relies on GListModel and doesn't manage any list items
itself. The port should be pretty much feature-complete.

Add a ton of stuff to GimpRow in order to look and behave like a
GimpContainerTreeView row.

Add a playground switch to use the new widgets in all views that can
be switched between list and grid view (brushes, patterns etc.)

Please test!

(cherry picked from commit 33bfd5a12b)
2025-09-17 16:40:23 +02:00
Jehan
2a1b2050bb extensions: update in the GEX format
Our custom keys are now listed under <custom/> instead of <metadata/>,
with the same format otherwise.

This change was initially triggered by using as_component_get_custom()
in libappstream instead of as_app_get_metadata() in appstream-glib (cf.
MR !2326). It seems that libappstream doesn't have any API to get the
<metadata/> keys, and that this tag is not officially in the spec
anyway.

The custom tag on the other hand is officially in the specs (and has
been added in 2018 apparently, cf. commit 1b1ba1f61 in the appstream
repository).

See also commit Infrastructure/gimp-extensions-web@f9f497b.

Without this, all extensions were broken with MR !2326. They were parsed
and correctly listed, but no entry point to plug-ins or data were
registered.

(cherry picked from commit 6c6253223d)
2025-09-17 16:40:23 +02:00
Jehan
226e79ee26 app, build: fix MR !2326 (porting to libappstream).
The following things were broken:

* Remove gdk-pixbuf-2.0/ from gdk-pixbuf include (this is part of the -I
  directory in the pkg-config data).
* Properly free the allocated AsMetadata which were leaked (while the
  AsComponent was freed mistakenly since it belongs to the AsMetadata).
* Properly free GFile as a GObject (it must not be freed with g_free()!).
* Fix various coding style bugs.
* Fix installing a .gex file by dropping it in GIMP. The code in
  file_gex_validate() was completely broken as it was not parsing the
  AppStream metadata anymore.
* Mininum libappstream requirement moved down to 0.16.1 so that GIMP can
  be built on Debian bookworm (our dependency baseline).
* Fix Snap build (hopefully, untested).

(cherry picked from commit 40adbff456)
2025-09-17 16:40:23 +02:00
Joey Riches
c27096db9e app: Port from appstream-glib to appstream
From the horse's mouth:
"WARNING: appstream-glib is heavy maintenance mode, use appstream
instead"

Additionally, appstream-glib no longer conforms fully to the
appstream specification.

Some care is taken to taken to support both libappstream 1.0 as well
as libappstream 0.16.x to support stable distros.

(cherry picked from commit 8277817b62)
2025-09-17 16:40:23 +02:00
Bruno Lopes
5367af70ca build/linux: Remove empty line on Flatpak gimp script for consistency with Win
(cherry picked from commit 3d9e95a2f4)
2025-09-17 16:40:23 +02:00
Bruno Lopes
c871ae4e22 build/linux: Add missing submodule init on local mode of Snap script
(cherry picked from commit a269410d6b)
2025-09-17 16:40:23 +02:00
Bruno Lopes
8ac7a0737c build/linux: Make flatpak env section more consistent with Snap script
(cherry picked from commit 6ab5402195)
2025-09-17 16:40:23 +02:00
Michael Natterer
23e083b03d app: GimpRow: implement GtkWidget::style_updated() and ::query_tooltip().
Also add API gimp_row_monitor_changed() to be called from a future
container, because we don't want the logic of gimp_widget_track_monitor()
on each row.

(cherry picked from commit 4a9b772689)
2025-09-17 16:40:23 +02:00
Michael Natterer
160e78061a app: don't chain up to parent->constructed() in
gimp_container_box_finalize() /o\... it's a minor miracle that it just
warned and leaked instead of exploding completely. Fixes #14596.

(cherry picked from commit 78186c7a16)
2025-09-17 16:40:23 +02:00
Bruno Lopes
7d5c644e67 build/linux: Bump qoi module commit
The recent commit promisses slighty better performance.

(cherry picked from commit 05f85e79d1)
2025-09-17 16:40:23 +02:00
Bruno Lopes
075a57c9f4 build/linux: Update poppler module to 25.08
(cherry picked from commit 7f7ee96717)
2025-09-17 16:40:23 +02:00
Michael Natterer
9ab2174138 app: add "context", "view-size" and "view-border-width" to GimpRow.
Add a GimpView widget and virtual functions to prepare for subclasses.
The controller page of prefs looks a bit funny now, but it's a nice
temporary test case without disturbing general user experience.

(cherry picked from commit a9f5694906)
2025-09-17 16:40:23 +02:00
Bruno Lopes
a6669446ab build/linux: Complete a3aca3c1
(cherry picked from commit 893f268e60)
2025-09-17 16:40:23 +02:00
Bruno Lopes
a1faa99245 build/linux: Print info message about which archs will be distributed
All our Linux dist scripts are multi-arch aware so
we need to be clear like on windows scripts.

(cherry picked from commit a3aca3c171)
2025-09-17 16:40:23 +02:00
Jehan
c838b0c869 app, libgimp, pdb: have GimpTrcType into public libgimp.
It is being used as filter arguments in 2 GIMP filters (curves and
levels) so we want to be able to send this enum type through the wire.

(cherry picked from commit 09e8e45d07)
2025-09-17 16:40:23 +02:00
Jehan
bebb00b5d9 pdb: properly handle enum types with acronyms and sort case-insensitively.
This will be used in particular for adding GimpTRCType to libgimp.
Otherwise it generates some broken gimp_TRCtype_get_type() function
name.

For this use case, we need to look-ahead a bit in the regular
expression.

(cherry picked from commit bbe5c16862)
2025-09-17 16:40:23 +02:00
Ondřej Míchal
c72644797a libgimp: Add support for GeglParamFilePath to the wire
(cherry picked from commit 4022a123e9)
2025-09-17 16:40:23 +02:00
Bruno Lopes
69d3170bb9 build/linux: Add info about Flatpak toolkit for debugging purposes
(cherry picked from commit 88d6c95ef4)
2025-09-17 16:40:23 +02:00
Bruno Lopes
f48b81560e build/linux: Add info about Snap toolkit for debugging purposes
(cherry picked from commit 27f0594ef6)
2025-09-17 16:40:23 +02:00
Bruno Lopes
2349b7fe05 gitlab-ci: Bump Flatpak timeout to 90min
This is needed by the awful aarch64 runner.

(cherry picked from commit df880e3da9)
2025-09-17 16:40:23 +02:00
Bruno Lopes
c88a3895ae gitlab-ci, build: Add infrastructure to distribute nightly aarch64 flatpak
(cherry picked from commit caf460177a)
2025-09-17 16:40:23 +02:00
Bruno Lopes
c69fccd7eb build/linux: Remove bogus cleanup on cfitisio module after move to CMake
(cherry picked from commit 6b69fca88d)
2025-09-17 16:40:23 +02:00
Bruno Lopes
de44a35e2d gitlab-ci: Complete db10cdab
(cherry picked from commit 4985991552)
2025-09-17 16:40:23 +02:00
Bruno Lopes
be00573373 gitlab-ci: Ensure we use runners with longer timeouts on Snap jobs
Some x86_64_v3 runners provided by Cannonical have a 60m limit which
makes impossible to maintain connection in snapcraft remote-build, so
let's ensure we use gimp x86_64_v2 runner which have longer limit.

On the other hand, let's use the x86_64_v3 ones on AppImage to
avoid the AppImage jobs delaying the Snap ones and vice versa.

(cherry picked from commit db10cdab26)
2025-09-17 16:40:23 +02:00
Bruno Lopes
df4cab222e build/linux: Fix Nightly flatpak after GCC 15 + CMake 4 bombastic combo
These updates brokened badly json-c, x265, cfitsio and maxflow modules.
Let's workaround them with proper patches and build options.

By the way, cfitsio was updated and is now built with CMake.

ghostscript was temporarely dropped since it is impossible to
build right now even with Archlinux patches. Let's wait a release.

(cherry picked from commit 4ae861f5ac)
2025-09-17 16:40:23 +02:00
Bruno Lopes
4fdecfa6e3 build/windows: Delete some dubious empty lines on msix script
(cherry picked from commit 84186a932b)
2025-09-17 16:40:23 +02:00
Bruno Lopes
ac2d3abd8f build/windows: Make all deps for MSIX making less confusing
Following 2e390fee

(cherry picked from commit e1184f8d58)
2025-09-17 16:40:23 +02:00
Bruno Lopes
7271f5dd79 build/windows: Try to make msstore-cli section less confusing
(cherry picked from commit 2e390fee01)
2025-09-17 16:40:23 +02:00
Bruno Lopes
e9460c2953 build/windows: Move WACK message to before appcert run
This way, if some error like lack of sudo is throw, the context is clear.

(cherry picked from commit c1c5c82683)
2025-09-17 16:40:23 +02:00
Bruno Lopes
c7da856096 build/windows: Group commands about Partner Center credentials
(cherry picked from commit d0455ffda3)
2025-09-17 16:40:23 +02:00
Bruno Lopes
a108153fb2 build/windows: Make .gitignore logic on MSIX script less convoluted
It is not consistent with other scripts like 3_dist-gimp-goappimage.sh

(cherry picked from commit e9ea400eee)
2025-09-17 16:40:23 +02:00
Bruno Lopes
ea038ba54f build/windows: Make assets test more premature on MSIX script
This fixes the "surprise" of not being able to make a .msix without
previously built assets. That surprise existed because the test was
running quite late (after the successful AppxManifest.xml creation).
Even me, the script author, was feeling like the script was trolling me.

(cherry picked from commit 34ab2099bb)
2025-09-17 16:40:23 +02:00
Bruno Lopes
b31e1ce1f9 gitlab-ci: Add references to variables from gimp-web-devel
This should make more clear that the variables on
gitlab-ci and gimp-web-devel should be synced.

(cherry picked from commit a221a7006c)
2025-09-17 16:40:23 +02:00
Bruno Lopes
d575dda062 gitlab-ci: Improve LIB_DIR and LIB_SUBDIR universal variables
Ported from Infrastructure/gimp-web-devel!115

(cherry picked from commit dbdc9bc43c)
2025-09-17 16:40:23 +02:00
Bruno Lopes
7f89dc042d build/windows: Add conf_manifest function on MSIX script to reduce redundancy
(cherry picked from commit 3b6a2138a7)
2025-09-17 16:40:23 +02:00
Bruno Lopes
7d924ab1d0 build/windows: Update comments of source section on MSIX script
(cherry picked from commit bcad28a5d1)
2025-09-17 16:40:23 +02:00
Bruno Lopes
ad0dd37e61 build/windows: Reduce nesting on MSIX script
(cherry picked from commit 374c94434b)
2025-09-17 16:40:23 +02:00
Michael Natterer
16a9c521a4 app: move the entire zoom logic from GimpContainerTreeView to
GimpContainerBox so both grid and list views can zoom via scroll and
zoom gestures.

(cherry picked from commit 0794087a67)
2025-09-17 16:40:23 +02:00
Bruno Lopes
c40e0509b1 build/linux: Some cosmetic changes to AppRun vars
(cherry picked from commit bd6218a12f)
2025-09-17 16:40:23 +02:00
Bruno Lopes
ebc2715cb7 Issue #13001: build/linux: Sandbox XDG_DATA_DIRS on AppImage
Closes #13001

XDG_DATA_DIRS is a variable used by many deps (e.g. glib) to
find runtime data. So, let's point XDG_DATA_DIRS to the
appimage bundle so prevent unexpected data from the host.

(cherry picked from commit bc095d5c83)
2025-09-17 16:40:23 +02:00
Bruno Lopes
c519df8efd build: Make scripts CWD check run on CI too
(cherry picked from commit d731a8fc0d)
2025-09-17 16:40:23 +02:00
Michael Natterer
6667ae9614 app: make GimpContainerView behave like a normal widget
The old API to select stuff and its signals was doing unexpected
stuff and was very confusing. Change things to be "normal":

The selection API is now set_selected() and get_selected(), with no
internal data exposed, and set_selected() emitting the expected
signal.

The signals are now "selection-changed" and "item-activated".
"selection-changed" is always emitted in response to changing the
selection, be it via the API, or by changes in the model (the internal
callbacks in from e.g. GimpContext or GimpImage simply call set_selected()
and don't do any unxpected magic).

(cherry picked from commit b416994ed0)
2025-09-17 16:40:23 +02:00
Bruno Lopes
b046c86891 build/linux: Correct typo in APP_ID
(cherry picked from commit a7be8ec6cd)
2025-09-17 16:40:23 +02:00
Bruno Lopes
acfc1d4c59 build/linux: Take flatpak app ID and branch dybamically from the manifest
This is more future proof.

(cherry picked from commit c5427bec21)
2025-09-17 16:40:23 +02:00
Bruno Lopes
7304dde26f build/linux: Add CLI message explaining how to test .flatpak artifact
We can't guarantee that every DE or package manager have
support to install .flatpak files by double click.

(cherry picked from commit 8a2dd28082)
2025-09-17 16:40:23 +02:00
Bruno Lopes
c06b863036 build/linux: Delete empty line on env block of Snap script
(cherry picked from commit 4faa5a6153)
2025-09-17 16:40:23 +02:00
Bruno Lopes
4e54e65615 build: Reorder shasums output on AppImage and Installer scripts
The output being before the release-only file generation is more logical

(cherry picked from commit 70eb95bff8)
2025-09-17 16:40:23 +02:00
Bruno Lopes
d0afcb2513 build/linux: Some cosmetic changes and comments to AppImage script
(cherry picked from commit e0b2bcba27)
2025-09-17 16:40:23 +02:00
Alx Sa
74588ed328 tools: Update Seamless Clone paste check
The experimental Seamless Clone tool assumes
that all pasted objects are GimpBuffers. With multi-select,
it's now likely that the pasted object is an image containing
layers instead. Thus, the tool would report there was no pasted
data to work with, even though there was.
This patch updates the check so that it retrieves the first selected
layer from the pasted image if it's not a GimpBuffer, allowing the
tool to function again.

Note that this patch does not improve the speed of the Seamless Clone
GEGL operation, just enables the tool to work again in GIMP.

(cherry picked from commit f7ef01f44a)
2025-09-17 16:40:23 +02:00
Bruno Lopes
bb49cb4244 build/linux: Update openexr and suitesparse Flatpak modules
(cherry picked from commit 79374e0bc1)
2025-09-17 16:40:23 +02:00
Bruno Lopes
9167ba0801 build/linux: Add (nightly) Snap package distribution
(cherry picked from commit 75aa40f3cb)
2025-09-17 16:40:22 +02:00
Michael Natterer
dd4e1c9bcb app: remove the gimplayertreeview.h include from GimpDrawableTreeView
(cherry picked from commit fc68405c45)
2025-09-17 16:40:22 +02:00
Alx Sa
ff80f51cca actions: Use layer for lock check when mask is active
Resolves #9287
In GIMP 2.10, before checking if the drawable was locked,
we checked if it was a layer mask and switched to its
layer if so. This is because the lock status is saved in the
layer.
In GIMP 3.0, we accidentally moved that check to the bottom
during the conversion to multi-select. As a result, when
switching to a layer mask, the lock content and lock position
would always be turned off since we checked the wrong
drawable.
This patch restores the 2.10 order of checks so that
we compare the lock status with the layer and not the mask.

(cherry picked from commit ea61460c6f)
2025-09-17 16:40:22 +02:00
Bruno Lopes
e3a016621f build/linux: Complete 2aee80b7
(cherry picked from commit d7687ee7e6)
2025-09-17 16:40:22 +02:00
Bruno Lopes
be4286878f build/linux: Rename suffix of flatpak scripts to flatpakbuilder
Since the praxis in all other scripts is to
name the suffix with the toolkit name

(cherry picked from commit 9e1c1e314a)
2025-09-17 16:40:22 +02:00
Bruno Lopes
221f9cde04 build/linux: Drop support to unreproducible builds on Flatpak
We had a way of building gimp without calling flatpak-builder but
"thanks" to Glycin sandboxing in pixbuf we can't anymore...

(cherry picked from commit 2aee80b77f)
2025-09-17 16:40:22 +02:00
Bruno Lopes
62d806a2a5 gitlab-ci: Rename 'gimp' stage to 'build'
This is how we call in other gimp repos, where there is no 'gimp' building.

(cherry picked from commit 215fcc9652)
2025-09-17 16:40:22 +02:00
Alx Sa
73e4246c80 widgets: Don't freeze progress box on image load
To prevent people from making changes to setting while
in the middle of loading images, we turn off sensitivity to all
widgets in GimpFileDialog (except for the cancel button).
However, the progress box no longer shows the load percentage
when it is not sensitive. Therefore, this patch conditionally leaves
it enabled so we can see progress while loading large images.

(cherry picked from commit 7c949960a4)
2025-09-17 16:40:22 +02:00
Alx Sa
fea9cc2a0f tools: Make transform boundary multi-select aware
Resolves #13589
When selecting multiple layers to transform, the boundaries
would only consider the first layer selected - leaving the other
items invisible.
This patch reuses code from gimp_edit_paste_get_viewport_offset ()
to loop through all selected layers and update the transform
boundaries to consider the total offset and dimensions of the selected
layers.

(cherry picked from commit df8063c861)
2025-09-17 16:40:22 +02:00
Alx Sa
3635a7cba1 plug-ins: Give unique IDs to file-svg choice parameter
Resolves #14557
Per Kamil Burda, all three choices for the "paths" parameter
in file-svg had an ID of 0. This patch makes them unique.

(cherry picked from commit f99415c281)
2025-09-17 16:40:22 +02:00
Alx Sa
e64b528cd4 po-python: Make OpenRaster text translatable
(cherry picked from commit a066a27f86)
2025-09-17 16:40:22 +02:00
Gabriele Barbero
40a3b28895 dialogs: respect time/date system format on Windows
Fetch date and time via GetDateFormatEx/GetTimeFormatEx to respect
the user's custom formats from Windows Region settings instead of
falling back to C locale defaults.

(cherry picked from commit 83dcd00794)
2025-09-17 16:40:22 +02:00
Gabriele Barbero
b24bc16230 dialogs: respect time/date system format on macOS
When the time or date format is changed from macOS system settings,
these changes do not affect the locale but the user preferences.
This commit ensures that the date and time are retrieved directly from
those settings, respecting the selected format.

(cherry picked from commit 180736f772)
2025-09-17 16:40:22 +02:00
Bruno Lopes
8746cc20d8 gitlab-ci, build: Remove old Xorg-testing deps and GEGL optional deps
(cherry picked from commit 7b03ca6fd1)
2025-09-17 16:40:22 +02:00
Bruno Lopes
f4184fb9a1 build/linux: Update gexiv2 and graphviz modules
(cherry picked from commit b3d7d9b8df)
2025-09-17 16:40:22 +02:00
Alx Sa
450ffa522f themes: Define minimum height of progress bar
On some system themes, the progress bar on the
status bar was less visible due to the minimum height
being set too low. This patch defines a CSS rule to make
sure the progress bar is at least 10px tall.

(cherry picked from commit 963dde2b08)
2025-09-17 16:40:22 +02:00
Bruno Lopes
68253fbcd6 Issue #14515: Fix stiff GIMP Debug Dialog
Closes: #14515

Also, make the dialog centered since it isn't modal to
the, for example, crashed GIMP, it is independent.

(cherry picked from commit fe4cbb6512)
2025-09-17 16:40:22 +02:00
Alx Sa
59d9736ae7 widgets: Fix crosshair hotspot on Windows
On Windows, the crosshair cursor for brushes is
offset from the brush outline if you have a display
scale of 200% or more. This is because
gdk_cursor_new_from_surface () does not contain code
to scale the hotspot X/Y coordinates to match the surface
on Windows - so it expects you pass those values in
already scaled to the surface.
This patch adds conditional code to scale the hotspots on
Windows the same way we currently do on macOS (though
for opposite reasons).

(cherry picked from commit 0f79d3e850)
2025-09-17 16:40:22 +02:00
Alx Sa
684355e776 operations: Guard against missing config in...
...GimpCageCoefficientCalculation.
Resolves #8297
The custom filter "gimp:cage-coef-calc" is used
in the Cage Transform tool, which always sends in
a GimpCageConfig parameter. However, it's possible
to call this filter from GEGL Graph without the config.
This causes GIMP to crash, as it tries to access
members of a non-existent config in
gimp_cage_config_get_n_points ().
This patch adds safeguard checks to make sure there's
a config object before trying to use it. The resulting
filter's output in these cases is blank, which is not ideal
but better than a crash.

(cherry picked from commit daea3c2298)
2025-09-17 16:40:22 +02:00
Alx Sa
7f25157cbd plug-ins: Fix bug with RGB FITS export
Resolves #13842
fits_write_img () was incorrectly used, since we
were writing one channel of RRR...GGG...BBB... data
at a time. This patch switches to fits_write_pix (), and
increments the first pixel's 3rd index after writing
each channel so that the next channel is written from
the correct starting point.

(cherry picked from commit 1376d25453)
2025-09-17 16:40:22 +02:00
Jehan
0ad20e9978 plug-ins: get rid of useless code.
Fixes build warning:

> plug-ins/map-object/map-object-ui.c:309:18: warning: variable ‘combo’ set but not used [-Wunused-but-set-variable]

(cherry picked from commit 65949e731c)
2025-09-17 16:40:22 +02:00
Michael Natterer
31d48d5a6c app: split up GimpContainerView so the code to manually connect to the
GimpContainer is in a separate file, and called conditionally. We
don't need any of this when using GListModel-based views soon.

(cherry picked from commit 3a2ca2b6ff)
2025-09-17 16:40:22 +02:00
Michael Natterer
fef770abc3 app, pdb: rename gimp_container_get_children_type() to get_child_type()
(cherry picked from commit 6eae69d2a4)
2025-09-17 16:40:22 +02:00
Michael Natterer
3a7d5b1502 app: rename GimpContainer's "children-type" property to "child-type"
(cherry picked from commit d4e8ab0234)
2025-09-17 16:40:22 +02:00
Michael Natterer
2b4b5ebec0 app: rename all "children_type" members and variables to "child_type"
(cherry picked from commit 77bb857046)
2025-09-17 16:40:22 +02:00
Michael Natterer
f7167bfad7 app: rename gimp_data_factory_view_get_children_type() to _get_child_type()
(cherry picked from commit e00afd9d54)
2025-09-17 16:40:22 +02:00
Alx Sa
8818507dd2 dialogs, widgets: Check if animations are enabled...
...when setting animations for GtkStack.

Adds a check if gimp_widget_animation_enabled ()
is TRUE before setting an animation type in
gtk_stack_set_transition_type (). If it's FALSE,
then we turn off animations with
GTK_STACK_TRANSITION_TYPE_NONE.
This affects the Input Controller dialogue,
Preferences dialogue, and the Welcome
dialogue.

(cherry picked from commit bb9d36d8ae)
2025-09-17 16:40:22 +02:00
Alx Sa
45ab5b7396 themes: Reduce scope of 2bbe1958 changes
2bbe1958 also added outlines to labels in
the color selector, which was not intended. This patch
reduces the scope of the style change to prevent this.

(cherry picked from commit 1b72774969)
2025-09-17 16:40:22 +02:00
Anders Jonsson
44ca94a234 po: update POTFILES.in
(cherry picked from commit f99610cc85)
2025-09-17 16:40:22 +02:00
Michael Natterer
dba32330ad app: in GimpRow, say e.g. "Rename Brush" instead of a generic
"Rename Item", using GimpViewableClass::default_name

(cherry picked from commit f1373373e6)
2025-09-17 16:40:22 +02:00
Michael Natterer
d428b513a4 app: move "default_name" from GimpItemClass to GimpViewableClass and
set default names for a lot of stuff. To be used by GimpRow soon.

(cherry picked from commit df497b5ca6)
2025-09-17 16:40:22 +02:00
Michael Natterer
7f9a7b26b7 app: use G_DECLARE_DERIVABLE_TYPE() in GimpResource
(cherry picked from commit b32ab62822)
2025-09-17 16:40:22 +02:00
Alx Sa
ee7ef712ac plug-ins: Fix various warnings in Map Object
Resolves #12873
This patch fixes a few warnings and bugs in Map Object.
* Since GimpChoice parameters with only a few options
become RadioFrames rather than ComboBoxes, the
"value-changed" signal no longer worked for Light Type.
This was replaced with a "notify::light-type" signal.

* After the GimpProcedureDialog port, xadj, yadj, and zadj
were no longer created. Calls to block signals on these were
removed, and replaced with updating the GimpProcedureConfig
object directly.

* The step increment for adjusting the Light position was lowered
to match how they work in GIMP 2.10 (and because the current step
size sends the light off-screen in one click).

(cherry picked from commit c31b2a31cf)
2025-09-17 16:40:22 +02:00
Michael Natterer
cbe63bb8ca app: use g_set_object() in more set_property() implementations
(cherry picked from commit 03b9292d59)
2025-09-17 16:40:22 +02:00
Michael Natterer
2010ded65e app: fix typo in GimpViewable: it's "pending" not "prending"
(cherry picked from commit bfaf6c5ce0)
2025-09-17 16:40:22 +02:00
Michael Natterer
56d4da4860 app: implement object renaming in GimpRow, using either F2 or long press
(cherry picked from commit 0682a19213)
2025-09-17 16:40:22 +02:00
Michael Natterer
cf18bb04ae app: set GimpViewableClass::name-editable to TRUE in GimpControllerInfo
(cherry picked from commit a91cfe07ac)
2025-09-17 16:40:22 +02:00
Ondřej Míchal
e0798f7d13 app: Change container pop-up view size predictably
Instead of a blind multiplication/division use known and well defined
increments that also have no chance of overflowing the minimum/maximum
allowed sizes.

Closes https://gitlab.gnome.org/Teams/GIMP/Design/gimp-ux/-/issues/509

(cherry picked from commit dabe921ba1)
2025-09-17 16:40:22 +02:00
Ondřej Míchal
7c6a666403 app: Use correct maximum size for button viewables
Pop-up widgets tied to button viewables can have their previews go over
the original max value which officially is 192 ("gigantic"). When they
do and update their property with the number, a critical gets fired
regarding the maximum value being crossed over.

Closes #14337

(cherry picked from commit 3dd6272a1d)
2025-09-17 16:40:22 +02:00
Jehan
2d1f64c21e plug-ins: fix "no previous declaration" warnings.
(cherry picked from commit 46143342b4)
2025-09-17 16:40:22 +02:00
Michael Natterer
bfc1f6c828 app: port GimpCircle and its subclasses to G_DECLARE_DERIVABLE_TYPE()
(cherry picked from commit 5a66ceda13)
2025-09-17 16:40:22 +02:00
Michael Natterer
6129ad10cb app: G_DECLARE_DERIVABLE_TYPE() in GimpFilter, GimpItem, GimpViewable,
plus somewhat related cleanup in the .c files

(cherry picked from commit d2ca61d5e2)
2025-09-17 16:40:22 +02:00
Michael Natterer
fd4d87e2c5 app, pdb: get rid of const object pointer in generated PDB code, and
adapt some core functions accordingly. Const object pointer make no
sense at all.

(cherry picked from commit 9359839e84)
2025-09-17 16:40:22 +02:00
Michael Natterer
cabb091b91 app: remove GimpAdd,RemoveItemFunc from GimpItemTreeView and use
gimp_image_add,remove_item() instead

(cherry picked from commit 453e3a1004)
2025-09-17 16:40:21 +02:00
Michael Natterer
97e044c1da app: add gimp_image_add,remove_item() which dispatches to the correct
layer, channel, path functions

(cherry picked from commit 7e43c448ae)
2025-09-17 16:40:21 +02:00
Michael Natterer
917a6a1fd6 app: remove GimpGetContainerFunc from GimpItemTreeView and use
gimp_image_get_items() instead

(cherry picked from commit a7881b6708)
2025-09-17 16:40:21 +02:00
Michael Natterer
e3d5999dc1 app: add gimp_image_get_items() which returns a GimpContainer based on
an item GType

(cherry picked from commit 42e070521c)
2025-09-17 16:40:21 +02:00
Michael Natterer
a7e473095c app: reorder functions in GimpImage so the item sets API is in the
middle of an unrelated function group

(cherry picked from commit 4220657930)
2025-09-17 16:40:21 +02:00
Michael Natterer
0e517c4d0a app: remove GimpGet,SetItemsFunc from GimpItemTreeView and use the
newly added gimp_image_set,get_items()

(cherry picked from commit 4e1c6e918b)
2025-09-17 16:40:21 +02:00
Michael Natterer
4d434a8e94 app: port GimpEditor to G_DECLARE_DERIVABLE_TYPE() and some other
cleanups

(cherry picked from commit 7887862b29)
2025-09-17 16:40:21 +02:00
Alx Sa
be388e755f plug-in: Fix image-map map format type change
Resolves #14456
Similar to bbbf6df5, GTK3 uses GTK_STATE_FLAG_ACTIVE to
indicate a radio button is selected, rather than GTK2's
GTK_STATE_FLAG_SELECTED. This patch fixes the check to use
it when updating _map_format after toggling the format.

While investigating this bug, the code format was also fixed to match
current standards.

(cherry picked from commit bd6cf4a58e)
2025-09-17 16:40:21 +02:00
Michael Natterer
00199fe4a2 app: listen to icon-name changes in GimpRow
(cherry picked from commit c880e5ac17)
2025-09-17 16:40:21 +02:00
Michael Natterer
8396636b98 app: add GimpRow, a GtkListBoxRow subclass, that is going to be the
parent of all our future row widgets, Use it in GimpControllerList.

(cherry picked from commit 529db388c2)
2025-09-17 16:40:21 +02:00
Michael Natterer
3d30184897 app: derive GimpControllerManager from GimpList and remove its own
GListModel implementation.

(cherry picked from commit c5c503cd59)
2025-09-17 16:40:21 +02:00
Michael Natterer
ab4bb47e25 app: implement GListModel in GimpContainer, and add
G_DEFINE_AUTOPTR_CLEANUP_FUNC to GimpContainer and GimpList

(cherry picked from commit af20371f6b)
2025-09-17 16:40:21 +02:00
Niels De Graef
f2af098ef7 app: Fix adding devices in gimpcontrollerlist
(cherry picked from commit b690e59dca)
2025-09-17 16:40:21 +02:00
Michael Natterer
9c1548bb44 app: forgot an #include /o\
(cherry picked from commit 71bb54cb9a)
2025-09-17 16:40:21 +02:00
Michael Natterer
8df143b112 app: forgot to commit the changes in app/display
(cherry picked from commit e85d696cd9)
2025-09-17 16:40:21 +02:00
Michael Natterer
d172f61651 app: move GimpControllerManager to its own files
(cherry picked from commit af95e96963)
2025-09-17 16:40:21 +02:00
Michael Natterer
d2dfe35e68 app: move GimpControllerCategory to its own files
(cherry picked from commit 905ccf2ea9)
2025-09-17 16:40:21 +02:00
Niels De Graef
4d949bf907 plug-ins: Use GtkListBox in metadata viewer
This commit changes the metadata viewer to use `GtkListBox`es instead of
`GtkTreeView`s for displaying the tags and their values. The main
advantages is that the latter isn't available in GTK4 (making the
eventual port to it smaller), that they have a11y problems, and that
list boxes allow more advanced UIs than just showing a simple string.
One thing for example that this commit introduces, is to make the labels
selectable, so they can be easily copy-pasted for lookup.

Since we wanted to use `GListModel`, this commit also introduces a
helper object `GimpMetadataTagObject` which holds both a tag's name and
its value. In the future, we could use this to move the string
formatting logic to that helper object, which we could then in turn use
for more advanced UIs.

(cherry picked from commit af3007afbf)
2025-09-17 16:40:21 +02:00
Niels De Graef
97cd0a547e plug-ins: Use G_DECLARE_FINAL_TYPE in metadata plugin
Use the opportunity also to rename the plug-in to a more
self-explanatory `GimpMetadataViewer` (rather than a `Metadata` struct
which can be easily confused with `GimpMetadata`).

(cherry picked from commit 3eb129c73a)
2025-09-17 16:40:21 +02:00
Jacob Boerema
2f90972e62 plug-ins, psp: fix #14182 Invalid UTF-8 in PSP comment
PSP creator comments are supposed to be ASCII according to the psp8
specs.
Since we expect utf-8, text with characters that have their high bit
set (e.g. Copyright character) fail to be read as utf-8.

We fix this by first converting the creator keywords to utf-8, and as
extra security also test if the result is valid utf-8.

(cherry picked from commit 8c86b2ba58)
2025-09-17 16:40:21 +02:00
Jacob Boerema
541291ad6f plug-ins, psp: fix warnings: result of comparison of unsigned...
enum expression >= 0 is always true

(cherry picked from commit 03427c4600)
2025-09-17 16:40:21 +02:00
Alx Sa
98eda40dcc widgets: Reconnect style_updated() in DrawableTreeView
Resolves #14447
In addition to defining a style_updated () function, we also need
to attach it to signals whenever the theme or icon size changes.

(cherry picked from commit 24e6aaea30)
2025-09-17 16:40:21 +02:00
Alx Sa
490ef967e8 core: Stop error in gimp_image_set_selected_items ()
Unlike gimp_image_get_selected_items (), we don't return
anything after calling the appropriate function inside
gimp_image_set_selected_items (). Thus, even if we match
the GType for the item, the g_return_if_reached () will always
run at the end of the function and throw an error.
This patch puts that statement in an else {} condition so it
only runs if the GType doesn't match a layer, channel, or path.

(cherry picked from commit 270a834598)
2025-09-17 16:40:21 +02:00
Michael Natterer
4f1a42dc67 app: move the g_set_str() hack to config-types.h
(cherry picked from commit 5060cc06dd)
2025-09-17 16:40:21 +02:00
Jehan
fff2650d0e app: (temporarily) redefine g_set_str() to avoid bumping GLib requirement.
(cherry picked from commit a4a5b2e300)
2025-09-17 16:40:21 +02:00
Michael Natterer
744b46a460 app: fix wrong propery identifier of GimpFillEditor::use-custom-style
and fix some coding style issues

(cherry picked from commit b61b3362ff)
2025-09-17 16:40:21 +02:00
Michael Natterer
6669c8de07 libgimp*: revert using g_set_str() outside app/
(cherry picked from commit 50ce759eca)
2025-09-17 16:40:21 +02:00
Niels De Graef
c360b6e7f0 app: Don't use g_type_class_get() yet
It's not available yet in Debian.

(cherry picked from commit b144929476)
2025-09-17 16:40:21 +02:00
Niels De Graef
03e048fdbd app: Port controllers dialog to GtkListBox
This shouldn't be a real change in design, just moving away from
`GtkTreeView`.

Since we stopped relying on the underlying `GimpContainer` API, we can
now stop exposing it in the `GimpControllerManager` too.

(cherry picked from commit 8013d1c013)
2025-09-17 16:40:21 +02:00
Niels De Graef
28a3a2d5e3 app: Extend GimpControllerManager API
... and fix a bug related connecting to the wrong signal.

(cherry picked from commit b410dcdc03)
2025-09-17 16:40:21 +02:00
Anders Jonsson
88091b3796 plug-ins: add name label for brush pipe selection modes
Previously selection mode variables were shown as-is with
their name in a drop-down in the brush pipe export dialog.
Add a label so we can have nicer strings for the GUI and
also make them translatable.

(cherry picked from commit 3e781dde6b)
2025-09-17 16:40:21 +02:00
Niels De Graef
a4e722e831 app: Expose Controller types as GListModel
(cherry picked from commit fcca547dd6)
2025-09-17 16:40:21 +02:00
Jacob Boerema
37db40df0a plug-ins, tiff: fix crash with clang when querying TIFFTAG_SUBIFD
The TIFFTAG_SUBIFD has a 16-bit length parameter, but we were using a
32-bit int that was not initialized to 0.
Apparently on clang when returning this value the high bits are not
set to 0.
This caused an incorrect high value which caused a stack overflow.
To fix this we change the type to gint16.

See issue #14432.

(cherry picked from commit 4dd729ba42)
2025-09-17 16:40:21 +02:00
Alx Sa
7eff9e5d6c pdb: Set image file when using gimp-file-save
gimp_file_save () lets you save an image to
any supported file format, but it did not
update the GimpImage's file or exported
file accordingly. This patch adds code to
do just that, patterned after /app/file/file-save.c's
file_save ().

(cherry picked from commit 5f65133e20)
2025-09-17 16:40:21 +02:00
Niels De Graef
ea8e4ee902 app: Make sure GimpControllerManager emits changes
(cherry picked from commit 53750e2699)
2025-09-17 16:40:21 +02:00
Niels De Graef
f79f9cd015 app: Implement GListModel in GimpControllerManager
This'll help us later on to migrate `GimpControllerList` to more modern
widgetry.

(cherry picked from commit 441590ade1)
2025-09-17 16:40:21 +02:00
Niels De Graef
466b6f8a39 app: Split off GimpControllerManager
Transform the `GimpControllerManager` so it encapsulates all the logic
related to managing all `GimpControllerInfo` objects, so we can pass
that object around, rather than dealing with the `Gimp` struct
everywhere and pretty hackishly retrieving the manager struct using
`g_object_get_data()`. By also making it a proper `GObject`, we can
later put even more logic onto it.

(cherry picked from commit fcdbd74071)
2025-09-17 16:40:21 +02:00
Michael Natterer
a02a9adc74 meson.build: remove stuff about G_DISABLE_DEPRECATED, it's gone
(cherry picked from commit 5559a1d487)
2025-09-17 16:40:21 +02:00
Michael Natterer
2e4f1f1beb app, libgimp*: more g_set_str() and some other stuff in the same
spirit

(cherry picked from commit 89ea91df96)
2025-09-17 16:40:21 +02:00
Michael Natterer
a0af5873b2 app: use g_set_str() in some places, it's hell yeah!
(cherry picked from commit 199eecfb66)
2025-09-17 16:40:21 +02:00
Alx Sa
f8748991cf themes: Prevent system theme leak in dialogue frames
Resolves #14421
This patch provides a CSS rule for GtkFrame borders inside of
a dialogue (see Filmstrip plug-in GUI for an example) to prevent
a system theme leak from altering the color.

(cherry picked from commit 2bbe19589d)
2025-09-17 16:40:21 +02:00
Michael Natterer
79f68e2ba4 app: quote the font name in the previous commit, and some cleanup
(cherry picked from commit 74271cd834)
2025-09-17 16:40:20 +02:00
Michael Natterer
acc89a47d1 app: fix warnings about deprecated gtk_widget_override_font() by using
a GtkCssProvider. Thanks Carlos!

(cherry picked from commit 082a88d02d)
2025-09-17 16:40:20 +02:00
Michael Natterer
4cd077b848 app: use gimp_image_set_selected_items() in gimpitemtreeview-search.c
so it's prepared for all kinds of items.

(cherry picked from commit 1e5792449c)
2025-09-17 16:40:20 +02:00
Michael Natterer
a97024be42 app: add gimp_image_set,get_selected_items() which take a GType
(cherry picked from commit 5378402d69)
2025-09-17 16:40:20 +02:00
Niels De Graef
c8c1b71451 extensions: Ignore all C warnings in Vala
Vala is being silly again and emitting code that is generating a ton of
C warnings that we can't really do anything about. Just ignore all C
warnings (while keeping the Vala warnings of course).

(cherry picked from commit 337c2bbde0)
2025-09-17 16:40:20 +02:00
Michael Natterer
2ab734cf78 libgimp, libgimpwidgets: fix (closure) annotations.
(cherry picked from commit 76caac9481)
2025-09-17 16:40:20 +02:00
Jehan
8ed3889f24 app: remove a bunch of useless, disabled tests.
We just agreed that there is no point in keeping these forever if they
have not been fixed for years. They only produce warnings and also they
likely won't work in Wayland anyway so they probably *can't* be fixed
without heavy updates.

(cherry picked from commit 8a55eec2a9)
2025-09-17 16:40:20 +02:00
Yuri Chornoivan
1bc9190a60 Update Ukrainian translation
(cherry picked from commit 97dfa4ea65)
2025-09-17 16:40:20 +02:00
Michael Natterer
85e9b4e80e app: more vectors -> path, mostly in GimpToolPath
(cherry picked from commit f5900020d3)
2025-09-17 16:40:20 +02:00
Michael Natterer
89cc277fed app: GimpToolPath: rename "path" to "tool_path" and private->path to
private->canvas_path

(cherry picked from commit 6d2c71591d)
2025-09-17 16:40:20 +02:00
Michael Natterer
685d230a09 app, pdb: a lot of vectors -> path renaming
(cherry picked from commit bee7b8713b)
2025-09-17 16:40:20 +02:00
Alx Sa
b394428d5c plug-ins: Initialize UI for too-large SVG imports
Resolves #14417
As a security measure, if the user tries to load an SVG
that's larger than the specified limit, we show a warning dialog
that informs them of the possible security risk and lets them
decide if they actually want to open it. However, we did not call
gimp_ui_init () before trying to show this dialogue - resulting in
a crash. This patch adds a call to initialize the UI before creating
gimp_dialog_new ().

(cherry picked from commit aff70406c0)
2025-09-17 16:40:20 +02:00
Michael Natterer
b1e5e4166d app: make sure the search popup is never shown without and image,
and don't update it when there is no image

(cherry picked from commit 12716a9377)
2025-09-17 16:40:20 +02:00
Michael Natterer
dd3333260f app: never create a new linked group when the search popup is closed
with "Escape".

(cherry picked from commit 5360264ca8)
2025-09-17 16:40:20 +02:00
Ekaterine Papava
b78dfda746 Update Georgian translation
(cherry picked from commit 6074587094)
2025-09-17 16:40:20 +02:00
Luming Zh
d8dacb36ed Update Chinese (China) translation
(cherry picked from commit 72ea198032)
2025-09-17 16:40:20 +02:00
Michael Natterer
bddeb457e2 po: update POTFILES.in
(cherry picked from commit 1e9979349a)
2025-09-17 16:40:20 +02:00
Alx Sa
f90b934f15 libgimp: Make comment text sensitive based on...
...if Save Comment option is enabled.
Currently, it's possible to unknowingly export an image
without a comment, even if it exists, if the "Save Comment"
option is left unchecked. This patch adds a signal whenever
the "Save Comment" checkbox is clicked (and when the dialogue
is first opened) that uses its active status to set the sensitive
status of the comment text area. If unchecked, the text area will
be marked as insensitive so it can't be edited.

(cherry picked from commit 96fb97d3fa)
2025-09-17 16:40:20 +02:00
Michael Natterer
e9f5ff23ec app: move the layer search and link code to its own file
(cherry picked from commit 853b0ece14)
2025-09-17 16:40:20 +02:00
Marco Ciampa
12f06fd84d Small fix in Italian translation
(cherry picked from commit bc25103e89)
2025-09-17 16:40:20 +02:00
Yuri Chornoivan
25c8fe150e Update Ukrainian translation
(cherry picked from commit 8a08fd1c12)
2025-09-17 16:40:20 +02:00
Jehan
006e9a1871 app: get rid of build warning.
Fixes:

> app/main.c:1094:3: warning: format not a string literal and no format arguments [-Wformat-security]

(cherry picked from commit 8a6e9a4a3b)
2025-09-17 16:40:20 +02:00
Bruno Lopes
a9bc3f68ba build/linux: Update poppler, libheif and graphviz modules
poppler: Update poppler-25.06.0.tar.xz to 25.07.0
libheif: Update libheif-1.19.8.tar.gz to 1.20.1
graphviz: Update graphviz-13.0.1.tar.gz to 13.1.0
(cherry picked from commit 7f527d8c72)
2025-09-17 16:40:20 +02:00
Alx Sa
3130c4f527 libgimpbase: Add mnemonics to Convert Indexed options
(cherry picked from commit 06915ec881)
2025-09-17 16:40:20 +02:00
Michael Natterer
689b7ab191 pdb: remove -private suffixes
from gimp-drawable-append-filter and -merge-filters. They are not
needed any longer, and it's not an API change because they are
private.

(cherry picked from commit fd3852af31)
2025-09-17 16:40:20 +02:00
Michael Natterer
3dec3da781 app, libgimp: minor whitespace and formatting cleanup
(cherry picked from commit 6221bdb503)
2025-09-17 16:40:20 +02:00
Michael Natterer
fd3d4a900c app: add gimp_set,get_last_template() and use is from gimpimage-new.c
instead of using gimp->image_new_last_template directly.
The first call to gimp_get_last_template() will create
gimp->image_new_last_template on demand and thus make sure the first
new image is always matching what is set in preferences. All later
images will still default to the last image created in this
session. Fixes #14378.

(cherry picked from commit 7eac33fba3)
2025-09-17 16:40:20 +02:00
Kolbjørn Stuestøl
29d8994a06 Update Norwegian Nynorsk translation
(cherry picked from commit 2c767fdb51)
2025-09-17 16:40:20 +02:00
Kolbjørn Stuestøl
26813b0700 Update Norwegian Nynorsk translation
(cherry picked from commit b6fee8dc1b)
2025-09-17 16:40:20 +02:00
Alx Sa
67c50a87d1 plug-ins: Show frames in Playback progress bar
In GTK3, GtkProgressBar does not show the frame numbers
by default. This is a regression from GIMP 2.10, so we need
to call gtk_progress_bar_set_show_text () after creating it
to restore the text display.

(cherry picked from commit 47f94bc6a3)
2025-09-17 16:40:20 +02:00
Alx Sa
0205a29603 core: Fix Alpha to Selection on single no-alpha layer
Resolves #14392
When using Alpha to Selection on a single layer with no
transparency, we were not cropping the selection channel
from the image size to the the layer size. As a result, we were
essentially performing Select All instead of only selecting the
area of the layer itself.
This patch refactors gimp_channel_combine_items () in its
single layer check, to create a mask for single layers with no
alpha that is the size of the layer. It's then used to crop the
image channel the same way the alpha channel does for layers
that have transparency.

(cherry picked from commit dbe5bc7d5d)
2025-09-17 16:40:20 +02:00
Ekaterine Papava
af4591f409 Update Georgian translation
(cherry picked from commit d54e2749eb)
2025-09-17 16:40:20 +02:00
Bruno Lopes
a5be286f1c build/windows: Make deps installation command work on PowerShell 7
See: #14376
(cherry picked from commit a989cec59c)
2025-09-17 16:40:19 +02:00
Jacob Boerema
c31176da28 ci: increase timeout for file-plug-in-tests
The file-plug-in-tests sometimes fail due to timeout on slower runners.
Let's see if increasing it from the default 20 to 30 minutes helps.

(cherry picked from commit d4581baf25)
2025-09-17 16:40:19 +02:00
Marco Ciampa
ad0e1a2e2b Small fix in Italian translation
(cherry picked from commit 7d8ff8eb48)
2025-09-17 16:40:19 +02:00
Jacob Boerema
0c863016f3 app: silence warning about unused install_flatpak_gimpdir
This function is only used on Unix, so encapsulate it in a define.

(cherry picked from commit 6f36667ab8)
2025-09-17 16:40:19 +02:00
Jacob Boerema
fa2d998b6f app: fix #14312 on first run copies settings from 2.10 instead of 3.0
I noticed when running 3.1.2 for the first time it copied settings
from 2.10 instead of 3.0 as I would expect.

Investigation shows that the major version number is hardcoded to 2,
so let's change that to major.
In addition to that, the outer loop continues running even when we
found a migration path if there is a lower major version number
available. Let's change this so we stop when migrate is TRUE.

Also fix some issues that could hit us in the future:
- Change the value of `major` in the for loop from a hardcoded value
to using `GIMP_MAJOR_VERSION`.
- The flatpak specific testing is for version 2.10 but only tested
the minor version. Change that to make sure major is 2.

(cherry picked from commit 204ddaae56)
2025-09-17 16:40:19 +02:00
Bruno Lopes
d702705aa1 build/linux: Restrict Gexiv2 module version to the API we support
See the explanation in: #14361

(cherry picked from commit 4b549c61f2)
2025-09-17 16:40:19 +02:00
Martin
bc1ee83a9c Update Slovenian translation
(cherry picked from commit 428d76962b)
2025-09-17 16:40:19 +02:00
Luming Zh
0028c81db1 Update Chinese (China) translation
(cherry picked from commit 488a3180a4)
2025-09-17 16:40:19 +02:00
Bruno Lopes
bf4ae28ac0 gitlab-ci, INSTALL: Install flex and bison for .map support on AppImage
See: #14145
(cherry picked from commit 1de46ae757)
2025-09-17 16:40:19 +02:00
Yuri Chornoivan
e6e669d28a Update Ukrainian translation
(cherry picked from commit adc9e7cfd3)
2025-09-17 16:40:19 +02:00
Gabriele Barbero
97455b62b6 dialogs: indicate when GIMP is up to date in About dialog
To make more clear to users that GIMP is up to date, the About dialog now
shows "Up to date" along with the timestamp of the last update check.
If there's a new update available, it will show only the timestamp
of the last update check.

(cherry picked from commit 0ebbfaa3c1)
2025-09-17 16:40:19 +02:00
Yuri Chornoivan
b97ca8aab4 Update Ukrainian translation
(cherry picked from commit 2a00ccf018)
2025-09-17 16:40:19 +02:00
Luming Zh
7295447e6b Update Chinese (China) translation
(cherry picked from commit d5e3aca09e)
2025-09-17 16:40:19 +02:00
Jehan
a932e1913e tools: fix my flatpak install script for Nightly.
The AppId for our nightly flatpak is now different.

(cherry picked from commit 83dca4d9be)
2025-09-17 16:40:19 +02:00
Bruno Lopes
654ad4d77b app: Do not create separate local data dir on macOS
Closes #13079

We don't know if ~/Library/Caches (NSCachesDirectory) is
the practical equivalent of $XDG_CACHE_HOME on Linux or
%LocalAppData% on Windows so let's just drop 3.00 for now.

(cherry picked from commit d055c0fbd1)
2025-09-17 16:40:19 +02:00
Alx Sa
d99bb22c95 core: Consistent naming pattern for symmetry options
Per Reju, the checkbox options for Symmetry should only have
the first word capitalized to match our style guide.

(cherry picked from commit 51547d427a)
2025-09-17 16:40:19 +02:00
Alx Sa
758d4852d5 widgets: Prevent icons shifting with layer selection
Showing and hiding the "%d selected items" text in the
ItemTreeView header causes the height of the header to
shift slightly. This is most noticeable on the layer dockable,
as it has a search icon which moves up and down.
To prevent this, we can switch to using gtk_widget_set_opacity ()
to hide and show the text, as the height stays consistent.

(cherry picked from commit 718487ee5d)
2025-09-17 16:40:19 +02:00
Bruno Lopes
abf32e2842 app: Set LIBTHAI_DICTDIR on macOS bundle
In preparation for Infrastructure/gimp-macos-build!333

Also, explain why we are setting env vars since
setting env vars is usually runtime-pervasive.

(cherry picked from commit f8d54fe65a)
2025-09-17 16:40:19 +02:00
Alexander Shopov
159d8b0fdf Update Bulgarian translation
(cherry picked from commit c0892fd7a5)
2025-09-17 16:40:19 +02:00
Luming Zh
2af072d247 Update Chinese (China) translation
(cherry picked from commit 283b6954e4)
2025-09-17 16:40:19 +02:00
Ekaterine Papava
f45742928c Update Georgian translation
(cherry picked from commit e896e15144)
2025-09-17 16:40:19 +02:00
Marco Ciampa
5094a5dbe9 Update Italian translation
(cherry picked from commit 013135505e)
2025-09-17 16:40:19 +02:00
Marco Ciampa
bb0198552d Update Italian translation
(cherry picked from commit ca38e4f7f8)
2025-09-17 16:40:19 +02:00
Marco Ciampa
93a9501797 Update Italian translation
(cherry picked from commit 54811fea34)
2025-09-17 16:40:19 +02:00
Marco Ciampa
ea98cea0b7 Update Italian translation
(cherry picked from commit 6e262db1c4)
2025-09-17 16:40:19 +02:00
Marco Ciampa
385a70016c Update Italian translation
(cherry picked from commit e8e845e6fa)
2025-09-17 16:40:19 +02:00
Yuri Chornoivan
b6f434d63f Update Ukrainian translation
(cherry picked from commit 1746f4e352)
2025-09-17 16:40:19 +02:00
Martin
5fb338865f Update Slovenian translation
(cherry picked from commit b4020be31c)
2025-09-17 16:40:19 +02:00
Ondřej Míchal
03703151a7 plug-ins/sphere-designer: Port GimpSpinEntry to GimpSpinScale
GimpSpinEntry is problematic to use when there's little horizontal space
because the slider becomes too small. GimpSpinScale does not suffer from
this because it uses the available space more efficiently. These days it
is also used more over GimpSpinEntry.

Related: https://gitlab.gnome.org/Teams/GIMP/Design/gimp-ux/-/issues/503
(cherry picked from commit 47f2a591f8)
2025-09-17 16:40:18 +02:00
Alx Sa
891ade751a widgets: Confirm image is indexed before setting entry
It is possible to have an indexed image open
in one tab, and RGB/grayscale images open
in others. If you have the color editor open
and swap between them, you'll receive a
CRITICAL because the ColorMapEditor will
always try to update a color entry even if
the active image is not indexed.

This patch adds checks to ensure you have
the indexed image open before trying to update
its color entry.

(cherry picked from commit 1c71e30cd0)
2025-09-17 16:40:18 +02:00
Jehan
c40c8a805e app: allow GIMP_DEV_VERSIONS_JSON to be empty for disabling it.
It makes it easier to have it set all the time and when I want to
disable it, I just prepend my command with GIMP_DEV_VERSIONS_JSON=.

(cherry picked from commit f1c781936c)
2025-09-17 16:40:18 +02:00
Bruno Lopes
1ed34ab5f5 build/linux: Fix OpenBLAS comment position
(cherry picked from commit fc06a435fa)
2025-09-17 16:40:18 +02:00
Alx Sa
e702c8adae core: Free drawables after use
In gimp_edit_copy (), there is a code path where
we iterate through drawables *after* we had freed it.
This patch moves the code that frees "drawables" until
after its final usage.

(cherry picked from commit f3b676f9cf)
2025-09-17 16:40:18 +02:00
Kolbjørn Stuestøl
f2f8cd6b51 Update Norwegian Nynorsk translation
(cherry picked from commit 14e44cf961)
2025-09-17 16:40:18 +02:00
Kolbjørn Stuestøl
4787c8c807 Update Norwegian Nynorsk translation
(cherry picked from commit 88aba102a7)
2025-09-17 16:40:18 +02:00
Ekaterine Papava
fe62c2c497 Update Georgian translation
(cherry picked from commit dc26f99521)
2025-09-17 16:40:18 +02:00
Luming Zh
7e0b321917 Update Chinese (China) translation
(cherry picked from commit 1656fdeaf6)
2025-09-17 16:40:18 +02:00
Luming Zh
395e65fff3 Update Chinese (China) translation
(cherry picked from commit ecfceffe6c)
2025-09-17 16:40:18 +02:00
Bruno Lopes
b11ad046b0 build: Only bundle the strictly needed .typelib files
Otherwise plug-in developers would rely on .typelib available only on
Linux OR macOS OR Windows so create unportable/broken .py plug-ins.

(cherry picked from commit 464b1fb32f)
2025-09-17 16:40:18 +02:00
Jehan
1e7b0a05b3 app: make color selector modules' names their identifier for demo scripts.
(cherry picked from commit 48934e4eb4)
2025-09-17 16:40:18 +02:00
Jehan
e37b0051d4 app: add ability to click any button in our Release Notes demo scripts.
(cherry picked from commit 1b012548c9)
2025-09-17 16:40:18 +02:00
Yuri Chornoivan
23d325f75e Update Ukrainian translation
(cherry picked from commit 9c49e276e0)
2025-09-17 16:40:18 +02:00
Yuri Chornoivan
0211b1d8ad Update Ukrainian translation
(cherry picked from commit afc904c5cc)
2025-09-17 16:40:18 +02:00
Martin
08514ea908 Update Slovenian translation
(cherry picked from commit 0b47045bb1)
2025-09-17 16:40:18 +02:00
Martin
cbd12eb252 Update Slovenian translation
(cherry picked from commit 365c4d4c6a)
2025-09-17 16:40:18 +02:00
Bruno Lopes
35aac2071a build/linux: Update graphviz module
(cherry picked from commit c1422a9008)
2025-09-17 16:40:18 +02:00
Bruno Lopes
6012696e92 plug-ins: Mark LNK and ICNS descriptions as per-process translatable
(cherry picked from commit ccf592d28b)
2025-09-17 16:40:18 +02:00
Bruno Lopes
f1c8146817 plug-ins: Mark FF, AVIF, LNK, QOI and ICNS names as per-process translatable
(cherry picked from commit d495994082)
2025-09-17 16:40:18 +02:00
Ekaterine Papava
8a539e995c Update Georgian translation
(cherry picked from commit b462371b2e)
2025-09-17 16:40:18 +02:00
Ekaterine Papava
0a5b3adce0 Update Georgian translation
(cherry picked from commit 0e35ebf282)
2025-09-17 16:40:18 +02:00
cheesequake
b717a7f040 Issue #14074: Resize image to layers irrespective to selections
By moving the block of code to resize the image to layer size outside
the has_selection condition, we ensure that a smaller layer without
selection also gets resized properly.

(cherry picked from commit afecf9f6c6)
2025-09-17 16:40:18 +02:00
Luming Zh
ae8167a661 Update Chinese (China) translation
(cherry picked from commit 63e3a2436d)
2025-09-17 16:40:18 +02:00
Bruno Lopes
6c7ec3a697 gitlab: Update coding style URL pointing to gimp-web-devel
(cherry picked from commit 35b3cdf31c)
2025-09-17 16:40:18 +02:00
Bruno Lopes
1f2187cfa4 gitlab: Don't allow clang-format to fail silently
It is not useful for code style debugging this way.

(cherry picked from commit c854ca5f45)
2025-09-17 16:40:18 +02:00
Martin
1e7a1fdae4 Update Slovenian translation
(cherry picked from commit 59fd0d02ee)
2025-09-17 16:40:18 +02:00
Bruno Lopes
96c448c9a5 data: Fix obscure environ files on Windows
Following 36b660e2b2

- PATH was being set due to the Installer and MSIX but
  on my tests on both relocatable and Unix-style builds it
  was bogus. C and Py plug-ins worked without problems
- Same aplies to GI_TYPELIB_PATH, it is obscure and useless

(cherry picked from commit ff1bd20577)
2025-09-17 16:40:17 +02:00
Sam James
2a43d1e195 meson: fix typo on GIMP_TESTING_ENVIRON_DIRS
This fixes some "illegal variable" noise in the build. There can't
be any dynamically created environment files in the *source* directory,
but there may be in the *build* directory we're modifying.

(cherry picked from commit 36b660e2b2)
2025-09-17 16:40:17 +02:00
Yuri Chornoivan
ada93d7e5a Update Ukrainian translation
(cherry picked from commit 9039e35b01)
2025-09-17 16:40:17 +02:00
Jacob Boerema
5f49716379 plug-ins/dds: fix #12790 for 32-bit
On 32-bit systems the computed linear size can overflow, causing a
crash.
Use a function that checks for overflow when multiplying and return
an error if that fails.
As extra security also update the loop to compute the base offset after
each line of data, and convert to gsize first when computing the
size for g_malloc and memset.

(cherry picked from commit c17b324910)
2025-09-17 16:40:17 +02:00
Martin
0a127bd895 Update Slovenian translation
(cherry picked from commit 693a6c5938)
2025-09-17 16:40:17 +02:00
Jehan
923d19fc15 app, pdb: allow rendering font previews with theme colors.
This also depends on the same settings to render brushes with theme
colors, because this is data, not user interface. Therefore following
theme colors is not necessarily what creators would expect.

(cherry picked from commit 7262faed16)
2025-09-17 16:40:17 +02:00
Jehan
65955e46c8 app: clean out unused functions.
(cherry picked from commit e41776ef39)
2025-09-17 16:40:17 +02:00
Kolbjørn Stuestøl
e99294f683 Update Norwegian Nynorsk translation
(cherry picked from commit 40845e1961)
2025-09-17 16:40:17 +02:00
Kolbjørn Stuestøl
2d558d8ea0 Update Norwegian Nynorsk translation
(cherry picked from commit cf817b96a3)
2025-09-17 16:40:17 +02:00
Kolbjørn Stuestøl
a32e01e738 Update Norwegian Nynorsk translation
(cherry picked from commit aac4e49a47)
2025-09-17 16:40:17 +02:00
Bruno Lopes
26e5e8f3df build/linux: Explain the purpose of $APPENDED_LIST
(cherry picked from commit 6c5401b9da)
2025-09-17 16:40:17 +02:00
Bruno Lopes
e6fe57371d build/linux: Reorganize a bit the files section of AppImage script
This makes it a bit more similar to the Windows bundling script so
easier to read and maintain in the future.

(cherry picked from commit f59b83ed6c)
2025-09-17 16:40:17 +02:00
Alx Sa
aa66ec06b3 actions: Select next palette entry after deletion
Unlike other dockables such as brush and patterns,
deleting a palette color does not automatically select
the next one. This makes it difficult to delete multiple
colors in a row. This patch gets the current index before
deleting the color, and then uses it to select the next entry
afterwards.

(cherry picked from commit a39355ca4d)
2025-09-17 16:40:17 +02:00
Bruno Lopes
218e7642be build/linux: Delete some whitespaces on Flatpak deps script
(cherry picked from commit 2defc3d07b)
2025-09-17 16:40:17 +02:00
Bruno Lopes
d4f6b77c14 gitlab: Add soft check against bashisms
Even .sh (Unix) scripts being "forbidden" by us on Meson to
allowing GIMP being 100% natively built on Windows, it is a
good pratice anyway .sh being portable even outside Meson.

(cherry picked from commit aa10583576)
2025-09-17 16:40:17 +02:00
Ondřej Míchal
1b1d905e65 app: Unref GtkFileFilter only when a file loader has extensions set
gimp_file_proc_view_process_procedure() can return NULL in case a file
loading procedure does not have any extensions set.

(cherry picked from commit 073a7a208f)
2025-09-17 16:40:17 +02:00
Alx Sa
20ce3f87fd tools: Don't alter merge filter status unexpectedly
Currently, some GEGL filters must always be merged because
we don't yet have a way to store GimpDrawables with filters.
When creating these filters as part of the Filter Tool, we were
changing the "merge-filter" property directly. This mean that
if you had previously set the Filter Tool to be non-destructive,
it would be destructive the next time you added a filter (even if
the filter supported NDE).

This patch creates a separate boolean variable (initialized to the
current state of "merge-filter") and uses that instead in the
gimp_filter_tool_create_filter () function. This allows us to still
force filters with aux pads to always merge, while not affecting
the user's preferences for other NDE filters.

(cherry picked from commit 58a0c1d31e)
2025-09-17 16:40:17 +02:00
Yago Raña
ac42bed7b2 Update Galician translation
(cherry picked from commit fe19572cd1)
2025-09-17 16:40:17 +02:00
Bruno Lopes
dfedd5875c gitlab: Refine meson-health failure catching
- Add backslash to avoid dots being treated as wildcards by grep
- Do not allow search-common-ancestor to fail silently anymore

(cherry picked from commit f4b2c99a5d)
2025-09-17 16:40:17 +02:00
Yuri Chornoivan
6400ff65d1 Update Ukrainian translation
(cherry picked from commit 879aa8e89f)
2025-09-17 16:40:17 +02:00
Bruno Lopes
055aae53f7 gitlab-ci: Use printf to fix Docker RUN of GL Collapsible Sections
This fixes some problems of output in the deps script and
makes everything more consistent.

(cherry picked from commit 078abb5f93)
2025-09-17 16:40:17 +02:00
Martin
f7cc3a78c1 Update Slovenian translation
(cherry picked from commit 877e500d0f)
2025-09-17 16:40:17 +02:00
Luming Zh
c776e02ef5 Update Chinese (China) translation
(cherry picked from commit 09720123d3)
2025-09-17 16:40:17 +02:00
Bruno Lopes
939d77c281 gitlab, build, tools: Port bashisms to POSIX-compliant code
Although these scripts are not called by Meson, portability outside the
build system is always welcome (specially on macOS or non-GNU OSes).

(cherry picked from commit fd47161215)
2025-09-17 16:40:17 +02:00
Ekaterine Papava
9baf9dbdca Update Georgian translation
(cherry picked from commit b9d30cb3a2)
2025-09-17 16:40:17 +02:00
Alexander Shopov
523f100656 Update Bulgarian translation
(cherry picked from commit 1352857579)
2025-09-17 16:40:17 +02:00
Jehan
4c17447abd app: move the follow-theme toggle to GimpDataFactoryView.
By being in GimpContainerIconView, the toggle was only being shown in
grid view, even though it also affected the list view. So we move it up
to the container, next to the query tag entry.

Also I am adding a function to make this toggle visible only when
requested. And so far, we only request it for the Brushes dockable,
because it doesn't do anything on other data dockables (we added some
code to follow theme, for instance in Palettes dockable, but it doesn't
depend on this setting, because it doesn't touch data render, only GUI
render where it's normal to follow theme).

The latter function fixes issue #14260.

(cherry picked from commit 1b9c78dc12)
2025-09-17 16:40:17 +02:00
Jehan
0133a0b811 app: make sure we invalidate brush renderers when "viewables-follow-theme" changes.
(cherry picked from commit 8628ad77c1)
2025-09-17 16:40:17 +02:00
Alx Sa
7a82e2d436 themes: Fix system theme leak on notebook header
Some system themes add a box shadow and change borders
for GtkNotebook headers. This patch adds rules defining these,
along with defining the outline for header buttons when hovered
over.

(cherry picked from commit bd79df9858)
2025-09-17 16:40:17 +02:00
Bruno Lopes
2188e05f59 build/windows: More metainfo cleanup
Following 088dd8aa9f

(cherry picked from commit 16cbcb828c)
2025-09-17 16:40:17 +02:00
Alexander Shopov
6409076d50 Update Bulgarian translation
(cherry picked from commit 05aeba9740)
2025-09-17 16:40:17 +02:00
Yuri Chornoivan
59a07dffb3 Update Ukrainian translation
(cherry picked from commit 0acc8ffba3)
2025-09-17 16:40:16 +02:00
Bruno Lopes
d89d471908 build/linux: Add comment about why libbacktrace is custom built
(cherry picked from commit 26c2fe9e3d)
2025-09-17 16:40:16 +02:00
Bruno Lopes
2c730a5517 build/windows: Add comment about glib schemas bundling
Otherwise, I and the future packagers will forget the reasoning behind
why glib schemas on Windows diverges from Linux bundling (e.g. AppImage).

(cherry picked from commit c10d5c1138)
2025-09-17 16:40:16 +02:00
Bruno Lopes
b8c8c9ac38 build/windows: Complete share/metainfo cleanup
Completes 47212318

I missed the .iss script so it would fail. Removing from it, then.

(cherry picked from commit 088dd8aa9f)
2025-09-17 16:40:16 +02:00
Bruno Lopes
059cf39ffa build/windows: Add explanation about .pdb Symbol Server
(cherry picked from commit c3bf6ae3ba)
2025-09-17 16:40:16 +02:00
Anders Jonsson
e16b928638 Update Swedish translation
(cherry picked from commit e44a6db7a5)
2025-09-17 16:40:16 +02:00
Anders Jonsson
20909283d8 Update Swedish translation
(cherry picked from commit 681e92ee7a)
2025-09-17 16:40:16 +02:00
Martin
b7701910df Update Slovenian translation
(cherry picked from commit ea69356e52)
2025-09-17 16:40:16 +02:00
Luming Zh
a499cf5635 Update Chinese (China) translation
(cherry picked from commit c0bc06f7ea)
2025-09-17 16:40:16 +02:00
Bruno Lopes
e22d1c4590 build/linux: Sync Flatpak nightly modules with Flathub branches
(cherry picked from commit d178d741b0)
2025-09-17 16:40:16 +02:00
Bruno Lopes
fb5dc5f119 build/linux: Enable dependency check on Nightly flatpak
Inspired by https://github.com/flathub/org.gimp.GIMP/pull/437

Now, in the weekly builds the job will fail if some module is old.
It is reasonable to make the job fail since nightly builds are
supposed to be blending edge so they should have the latest deps.

This makes way easier to spot when some module needs to be updated,
reducing a bit the continuous burden of syncing the 3 manifests.

(cherry picked from commit ac320fb6a6)
2025-09-17 16:40:16 +02:00
Ekaterine Papava
9c150a7a85 Update Georgian translation
(cherry picked from commit d028b96654)
2025-09-17 16:40:16 +02:00
Yuri Chornoivan
c289689659 Update Ukrainian translation
(cherry picked from commit 427904a636)
2025-09-17 16:40:16 +02:00
Jehan
972206d08c libgimp: different widget default for GimpChoice in GimpProcedureDialog…
… depending on the number of choices.

Enforcing a UX decision into code from GIMP/Design/gimp-ux#323.
Note that this is not a perfect automatization, since the right default
widget may still be a combo box even for limited choices arguments, when
the dialog is crowded.
It still improves the defaults, and it is still possible to override the
widget on case by case (just as of now).

(cherry picked from commit bcb736db61)
2025-09-17 16:40:16 +02:00
Bruno Lopes
38b5a53783 meson, desktop, plug-ins: Generate MIMEtypes var dynamically
This way, we avoid divergence with MIMEs declared on the
plug-ins .c and .py files and we eliminate duplicate work.

See also: 2ce3c604

(cherry picked from commit d56676a2fa)
2025-09-17 16:40:16 +02:00
Jacob Boerema
f36640f22e app: use GIMP_BRUSH_MAX_SIZE instead of a fixed number...
to check for the maximum allowed size of a Photoshop brush.

(cherry picked from commit a2bd03a471)
2025-09-17 16:40:16 +02:00
Jacob Boerema
08d81f2176 app: refactor Photoshop stream loading functions
Since these functions used in gimpbrush-load will also be used in
Photoshop pattern loading, move them to gimp-utils.

At the same time, change the signature to return a boolean which
indicates TRUE on success and make the returned value a parameter.
This makes it easier to check multiple read calls for success.

(cherry picked from commit 934c4a90cd)
2025-09-17 16:40:16 +02:00
Bruno Lopes
aa5c751542 desktop: Use GIMP_DESKTOP_NAME on appdata too
(cherry picked from commit 35fbb10d43)
2025-09-17 16:40:16 +02:00
Bruno Lopes
e2d5e56c8d build/linux: Fix AppImage StartupWMClass
This completes aede2709b0

(cherry picked from commit b57744ceba)
2025-09-17 16:40:16 +02:00
Martin
f0e8f72885 Update Slovenian translation
(cherry picked from commit 745bf31cd7)
2025-09-17 16:40:16 +02:00
Martin
4c179d5192 Update Slovenian translation
(cherry picked from commit fa8a12a29e)
2025-09-17 16:40:16 +02:00
Bruno Lopes
1bb8672d76 build/windows: Do not bundle unneeded share/metainfo on Windows
Seems it was used at runtime in the past but that is
not the case anymore. Indeed, it started to be bundled in
af79bbe028 due to an
error: before the Windows bundling unification the
crossbuilds "script" on .yml bundled all the 'share' dir.

(cherry picked from commit 472123181d)
2025-09-17 16:40:16 +02:00
Alx Sa
d4acc18911 core: Add alpha on merge if filter requires it
Some filters such as Color to Alpha require
an alpha channel. Now that we have NDE,
filters can exist separately from layers
until they're merged down. This means
the layer itself may not have an alpha
channel, causing distortions on merge.
This patch adds a method to check if
the filter requires an alpha channel, and
adds it to the layer on merge or export if
it has such a filter.

(cherry picked from commit c2b9c21b5b)
2025-09-17 16:40:16 +02:00
Yuri Chornoivan
1cf9950d4b Update Ukrainian translation
(cherry picked from commit 50df422969)
2025-09-17 16:40:16 +02:00
Alx Sa
b02d4f8619 app/tools: Use NDE filter's drawable for on-canvas widgets
Resolves #14240
This patch extends a9056419 to use the existing filter's
drawable (if it exists) on all other on-canvas widgets instead
of always using the selected layer.

(cherry picked from commit 9a349e812b)
2025-09-17 16:40:16 +02:00
Jehan
aac1224b03 pdb: also allow none_ok on PDB type 'guide'.
This would be theoretically useful for gimp-image-find-next-guide except
that this function was already using the int type, and allowing 0. I'm
not changing to 'guide' type with none_ok because it would break the
libgimp API (the signature would change, with the type changing from
gint to guint).

Since it already works like this, I just leave a TODO for further
update.

With this and previous commit, we now fully replaced commit 69894d8bbf
attempts for allowing 0 to some types. There was in fact also some
change on 'tattoo' type, but I went through all the PDB functions we
had, one by one, and I don't think we currently have a single case where
we need to allow 0 as a tattoo value. If this need ever arises then we
can always add none_ok support easily in the future.

(cherry picked from commit 80fe32dfc6)
2025-09-17 16:40:16 +02:00
Jehan
9e13a3e4ad Issue #14205: gimp-image-find-next-sample-point returns error when…
… passed "0" as argument.

Adding support of none_ok for arguments of type sample_point, allowing
to pass 0 as a special value and use it on this function.

(cherry picked from commit bf14d3db20)
2025-09-17 16:40:16 +02:00
Jehan
ddb1569d0e Revert "PDB: fix #14205 image-find-next-sample-point error"
This reverts commit 69894d8bbf.

Let's not randomly make our API less strict on types as a workaround for
a bug. If there are specific cases where it's needed to accept 0, then
these are the cases we have to handle.

Also unlike what the commit message was saying, it's not true that this
was only affecting Script-Fu. Any change to the PDB affects by
definition the whole PDB, as well as libgimp and all bindings (over PDB
or libgimp alike). And yes, this change **was** of "real consequence".

I'll do further commits for the proper fixes to #14205.

(cherry picked from commit 2d2f1d048d)
2025-09-17 16:40:16 +02:00
Luming Zh
54e9058e3a Update Chinese (China) translation
(cherry picked from commit d86b26dc4b)
2025-09-17 16:40:16 +02:00
Jehan
c01459af11 Issue #13183: use the renamed desktop filename in Flatpak.
Since MR !2158, we set the desktop name as prgname, because that's what
is expected for Wayland. But this doesn't work on Flatpak where the
desktop file is renamed (and even to different names for the stable/beta
vs. nightly flatpaks). This commit adds some special-casing when we
detect we are inside a flatpak environment.

Note that on X11 (whether or not we are in flatpak), we just always use
the original desktop name, because then it will be set as windows'
WM_CLASS which will also match the StartupWMClass key we set in the
desktop file (cf. previous commit).

(cherry picked from commit 2244d70a94)
2025-09-17 16:40:16 +02:00
Jehan
6ce9f6c90e Issue #14233: incorrect StartupWMClass in gimp.desktop.
The WM_CLASS X property is apparently set to windows throughout the
program by the g_set_prgname() call which we changed in commit
95e32ebb34 from being the executable name (being the fully qualified
program name with the version) to the desktop name.

(cherry picked from commit aede2709b0)
2025-09-17 16:40:15 +02:00
Alx Sa
204aa6685a tools: Don't run Foreground Selection without strokes
The Foreground Selection algorithm was being run when
users switched to a different tool, even if no strokes had been
painted. This caused an unnecessary delay, since no selection
will be generated.
This patch adds a check to verify we have at least one foreground
stroke made by the user before trying to create the selection.

(cherry picked from commit 0370aed02d)
2025-09-17 16:40:15 +02:00
Bruno Lopes
bafc6efb6e gimp-data: Bump to fix #14236
(cherry picked from commit 1f8f17cd9a)
2025-09-17 16:40:15 +02:00
Alx Sa
bc1f8cfd17 widgets, tools: Allow NDE filters on channels
This patch removes restrictions on applying
NDE filters to channels in the GUI. Note
that layer masks are still restricted, not for
technical reasons but because UX/UI needs
to be considered further.

(cherry picked from commit 54c95577df)
2025-09-17 16:40:15 +02:00
Ekaterine Papava
ee555b9e0c Update Georgian translation
(cherry picked from commit 7ba36e83a3)
2025-09-17 16:40:15 +02:00
Luming Zh
8787704034 Update Chinese (China) translation
(cherry picked from commit 679d9a8952)
2025-09-17 16:40:15 +02:00
Luming Zh
a31852237a Update Chinese (China) translation
(cherry picked from commit 78915f28f0)
2025-09-17 16:40:15 +02:00
Jehan
0be6e7a718 Revert "ScriptFu: scripts: remove obsolete script unsharp-mask"
This reverts commit fbee943213.

We must not remove any PDB function because we promise API stability
(not only in libgimp, but also in the PDB). Even if this was not used
anywhere in our own scripts/plug-ins, it may be used by third-party
scripts. At best, we can deprecate them so that people are properly warn
that we plan on removing a function. Then we'll remove it for GIMP 4.

Also I believe that various people were not perfectly happy with GEGL's
unsharp-mask operation, compared to the old one. And that was a reason
for keeping the legacy Script-fu version around. See gegl#122 or other
reports which mention such concerns.
At the very least, this should be discussed first with more specialized
developers to determine whether we consider GEGL's replacement operation
to be adequately replacing the historical script by now, so that we can
plan the removal for GIMP 4.

(cherry picked from commit fca4fd1bcc)
2025-09-17 16:40:15 +02:00
Danial Behzadi
9960603571 Update Persian translation
(cherry picked from commit 82eb34503f)
2025-09-17 16:40:15 +02:00
Ekaterine Papava
b43e5382cf Update Georgian translation
(cherry picked from commit c1a56ff0b3)
2025-09-17 16:40:15 +02:00
Ekaterine Papava
4004cae28c Update Georgian translation
(cherry picked from commit dd5379662b)
2025-09-17 16:40:15 +02:00
Anders Jonsson
3fdd3d385d po, po-plug-ins: update POTFILES.in
(cherry picked from commit 51a64babca)
2025-09-17 16:40:15 +02:00
lloyd konneker
7e6b319616 ScriptFu: scripts: remove obsolete script unsharp-mask
Was replaced by a GEGL filter, long ago.

See 18 year old commit 31282ecc by Sven that says this exists for backward compatibility.
Which means we should have removed it befoe GIMP 3.0 major release.

Provides nothing more than the GEGL filter, so just delete it,
and NOT move to gimp-data-extras repo.

Fix #13824 (or at least makes it moot.)

The obsolete script was not used by any code in the repo,
except for test scripts, which were changed to not use it.

(cherry picked from commit fbee943213)
2025-09-17 16:40:15 +02:00
lloyd konneker
dcf130df14 ScriptFu: fix #12837 i18n for independent scripts
See /scripts/test/test-i18n.scm,
which has tests and documents use cases.

Some incidental refactoring and editing of comments.

(cherry picked from commit ea238e4e5a)
2025-09-17 16:40:15 +02:00
Bruno Lopes
bf2a49e394 gimp-data: Bump commit
(cherry picked from commit 6dfd27b271)
2025-09-17 16:40:15 +02:00
Alexander Shopov
01f29debf2 Update Bulgarian translation
(cherry picked from commit 2d1ab85214)
2025-09-17 16:40:15 +02:00
Alexander Shopov
88fbc7be2f Update Bulgarian translation
(cherry picked from commit 529914250e)
2025-09-17 16:40:15 +02:00
Alexander Shopov
4d2b8b94da Update Bulgarian translation
(cherry picked from commit 6386cfe561)
2025-09-17 16:40:15 +02:00
Alexander Shopov
62703353e7 Update Bulgarian translation
(cherry picked from commit ffc5836e48)
2025-09-17 16:40:15 +02:00
Martin
9ccd191ab0 Update Slovenian translation
(cherry picked from commit 32404df8f6)
2025-09-17 16:40:15 +02:00
Alx Sa
c393e5ce7a widgets: Prevent filter container duplication
Resolves #14206
If the user clicks the Fx icon in the DrawableTreeView
repeatedly (and quickly enough), the "closed" signal
function that cleans up the Filter popover does not
run before the next creation code is started. This can
results in the previous view being left in editor->vbox,
leading to duplication.
This patch checks if the editor and view already exist when
the popover opens, and if so, it runs the clean-up code first.

(cherry picked from commit 6e58d05a56)
2025-09-17 16:40:15 +02:00
Martin
c45c03ffda Update Slovenian translation
(cherry picked from commit 9464e571ed)
2025-09-17 16:40:15 +02:00
Martin
a117810670 Update Slovenian translation
(cherry picked from commit 050a2094bc)
2025-09-17 16:40:15 +02:00
lloyd konneker
35d502edd2 PDB: fix #14205 image-find-next-sample-point error
Three types declared in pdbgen perl code,
for sample-point, guides, and tatto objects,
declare too restrictive a range of permissible values.
They should allow the value 0, which the API uses as a sentinel value,
to represent "invalid object ID".
The types are for object ID's, which are unsigned.

GObject checks the declared range when you chunk into a GValueArray,
to call the PDB.

Declaring the attribute in the perl .pdb "no-validate"
is not sufficient since GObject doesn't understand
GIMP_PARAM_NO_VALIDATE, that flag is distinct from G_PARAM_NO_VALIDATE.

Only affects the ScriptFu binding to PDB.
The GI binding to libgimp is not affected.

The declared range is no more restrictive than the underlying type
"unsigned int 32."
So of no real consequence.

The API could be changed to return a list which the caller
would iterate on.

(cherry picked from commit 69894d8bbf)
2025-09-17 16:40:15 +02:00
Bruno Lopes
cc2a306354 build/linux: Run gimp process without LD interpreter on AppImage
Closes: #12929

This normalizes argv0, making the AppImage debuggable by gdb etc.

From now, the AppImage can't be run in pre-Bookworm (glibc < 2.36)
distros, but that use case was never officialy supported anyway.

(cherry picked from commit 7fd2489985)
2025-09-17 16:40:15 +02:00
Bruno Lopes
a140c181d1 build/linux: Do not bundle daemons on AppImage
We weren't launching then (and not sure if
we should at all). Also, the proper fix to
some errors encountered is 330ebe90.

(cherry picked from commit f2bd9fcd7f)
2025-09-17 16:40:15 +02:00
Yuri Chornoivan
77c7124612 Update Ukrainian translation
(cherry picked from commit 0286ff4149)
2025-09-17 16:40:15 +02:00
Luming Zh
f9055788d2 Update Chinese (China) translation
(cherry picked from commit 38f8aec0df)
2025-09-17 16:40:15 +02:00
Alx Sa
abcd1c5cee script-fu: Respect no-validate flag in Script-fu
GIMP 3.0 enforces stricter parameter range checks
compared to GIMP 2.10. As a result, scripts that are the
right datatype but go outside the parameter range will
fail. In GimpProcedure, we have checks if a no-validate
flag is set to bypass these constraints.
This patch adds those checks to Script-fu so it also knows
to not check ranges if no-validate is set.

(cherry picked from commit 1f1404dc93)
2025-09-17 16:40:14 +02:00
Bruno Lopes
4f13a6c4a9 build/linux: Prevent loading host's GIO_EXTRA_MODULES on AppImage
We can't guarantee that the .so modules pointed by GIO_EXTRA_MODULES will
link properly to the bundled libc and other bundled deps in the AppImage.

So, by making our AppImage ignore that var we avoid errors on terminal due
to linking mismatch (e.g. on NixOS which sets that var by default).

(cherry picked from commit 330ebe90b6)
2025-09-17 16:40:14 +02:00
Luming Zh
f322f1d8fb Update Chinese (China) translation
(cherry picked from commit 1bfd5ebf20)
2025-09-17 16:40:14 +02:00
Bruno Lopes
7abafcc462 gitlab-ci: Make meson-health job less pervasive on merge requests
It fails silently sometimes, which shouldn't happen but
I don't have time right now to investigate and fix.
For now, allowing it to fail will free auto merge again.

(cherry picked from commit c49d7ab36f)
2025-09-17 16:40:14 +02:00
lloyd konneker
84614a3683 Tests: ScriptFu: test PDB API for gimp-image-sample-point
No changes except to tests

(cherry picked from commit eb5fe2325e)
2025-09-17 16:40:14 +02:00
Yuri Chornoivan
86a2fc685e Update Ukrainian translation
(cherry picked from commit ede910abce)
2025-09-17 16:40:14 +02:00
Yuri Chornoivan
b9af5f4868 Update Ukrainian translation
(cherry picked from commit 992b7c40c6)
2025-09-17 16:40:14 +02:00
Yuri Chornoivan
26862cea6e Update Ukrainian translation
(cherry picked from commit be9ad294bc)
2025-09-17 16:40:14 +02:00
Ondřej Míchal
045c23f982 build/linux: Sync dependencies with Flathub flatpak
Poppler - 25.05.0 -> 25.06.0

(cherry picked from commit c55f4b104c)
2025-09-17 16:40:14 +02:00
Luming Zh
187846f05a Update Chinese (China) translation
(cherry picked from commit b633658ccb)
2025-09-17 16:40:14 +02:00
Alx Sa
90b8991995 core: Add alpha channel for certain transforms
In 756fed0c, we removed code that automatically added an
alpha channel for transformed layers, as it relied on the user
setting interpolation to anything other than NONE.

This patch attempts to restore this behavior with a different
check. If gimp_matrix_is_simple () returns FALSE, it means that
the transformation requires some form of interpolation, and thus
requires an alpha channel. Flipping and translating do not trigger
a change in the alpha channel, but rotation, shearing, and perspective
transforms do (even if the tool's interpolation is set to NONE).

(cherry picked from commit 4e1967bf70)
2025-09-17 16:40:14 +02:00
Luming Zh
5f9b7370ff Update Chinese (China) translation
(cherry picked from commit 4ba74177ea)
2025-09-17 16:40:14 +02:00
Jehan
0741f7fc72 app: fix a build warning.
Fixes:

> app/core/gimp-user-install.c:762:1: warning: no previous declaration for ‘user_update_post_process_menurc_over20’ [-Wmissing-declarations]

(cherry picked from commit 2056fb1dd3)
2025-09-17 16:40:14 +02:00
Jehan
8774f46c3d app: remove GIMP_HELP_PREFS_VIEWABLES_FOLLOW_THEME help ID.
It is unused and setting it on the new toggle button doesn't seem to
work anyway as the dockable's help ID is called. Improving the help page
for this dockable, rather than adding a specific help page, seems a
better fit anyway.

(cherry picked from commit d45ff5b5cd)
2025-09-17 16:40:14 +02:00
Jehan
4e01949adb app: localize some strings now that we are out of string freeze.
(cherry picked from commit 2f19042feb)
2025-09-17 16:40:14 +02:00
Jehan
87c090e829 app: draw the palette grids with the theme's background color.
Commit 80fca449a4 had a few issues:

- It was using the theme's foreground or background colors as non-entry
  color, depending on whether we draw a grid or not. It should just be
  the background's color.
- It was still defaulting color to white/black in some places, instead
  of fg/bg colors (though I just removed these defaults because the code
  just always properly set these colors later on).
- It was using the foreground colors for vertical grid lines, instead of
  background color.
- It was coloring horizontal grid lines as black, instead of background
  color.

(cherry picked from commit 0f900d2946)
2025-09-17 16:40:14 +02:00
Nathan Follens
8f67090536 Update Dutch translation
(cherry picked from commit 7f0815a67a)
2025-09-17 16:40:14 +02:00
Nathan Follens
047b6dcadb Update Dutch translation
(cherry picked from commit ab9e63ebeb)
2025-09-17 16:40:14 +02:00
Nathan Follens
a38d25886b Update Dutch translation
(cherry picked from commit f579324696)
2025-09-17 16:40:14 +02:00
Nathan Follens
fa70c3e547 Update Dutch translation
(cherry picked from commit b16d427d75)
2025-09-17 16:40:14 +02:00
Alx Sa
ae3a3db048 actions: Fix missing argument length check
Resolves #14192
In procedure_commands_get_display_args (), one
section missed a check for the argument array length
before trying to access the index. This caused a crash
if there were not enough arguments sent in for a Script-fu
plug-in. This patch adds that array length check to prevent
the crash.

(cherry picked from commit 6192b79d89)
2025-09-17 16:40:14 +02:00
Ekaterine Papava
de06f2260e Update Georgian translation
(cherry picked from commit 20fb40f7d7)
2025-09-17 16:40:14 +02:00
Luming Zh
2e94d5228f Update Chinese (China) translation
(cherry picked from commit 1724e3cd9d)
2025-09-17 16:40:14 +02:00
Martin
2fb7e8afdc Update Slovenian translation
(cherry picked from commit a05b4a1d60)
2025-09-17 16:40:14 +02:00
Alx Sa
f73854a0ef core: Add Lock Content to undo history
In 2.10, we did not add a Undo History item for "Lock Content"
in the History dockable. In 3.0, we add the item, but Ctrl+Z
doesn't work because we don't actually push the undo item to
the stack.
Comments in fb1a6725 indicate this was intentionally left off
in 2.10. However, it's more consistent in 3.0 to have all locks
behave the same when it comes to undo history.

(cherry picked from commit e8c29f818e)
2025-09-17 16:40:14 +02:00
Yuri Chornoivan
1c10963a6e Update Ukrainian translation
(cherry picked from commit 979e0bfd0f)
2025-09-17 16:40:14 +02:00
Kolbjørn Stuestøl
f4013972fe Update Norwegian Nynorsk translation
(cherry picked from commit d1f002464a)
2025-09-17 16:40:13 +02:00
Kolbjørn Stuestøl
c78650b5c4 Update Norwegian Nynorsk translation
(cherry picked from commit 80fe0e541a)
2025-09-17 16:40:13 +02:00
Kolbjørn Stuestøl
5f379ff45b Update Norwegian Nynorsk translation
(cherry picked from commit adbed2c9e9)
2025-09-17 16:40:13 +02:00
Bruno Lopes
2e7782ae13 plug-ins: Fix file associations generated from .py plug-ins
Following 2ce3c604

(cherry picked from commit d6a961c2af)
2025-09-17 16:40:13 +02:00
Alx Sa
6069d81807 plug-ins: Check libtiff version for TIFF layers
The Photoshop and Sketchbook TIFF enums
were added in later versions of libtiff. Since we
do not enforce that version when compiling, we
add macros to verify TIFFTAG_IMAGESOURCEDATA
and TIFFTAG_ALIAS_LAYER_METADATA are defined
before trying to build with them.

(cherry picked from commit 348b86e2f7)
2025-09-17 16:40:13 +02:00
Michael Natterer
d67c859711 app: in gimp_drawable_merge_filters(), iterate the list of filters
with a while() loop and get list->next before removing the filter,
because removing deleted "list" under our feet.

(cherry picked from commit d896d60a5c)
2025-09-17 16:40:13 +02:00
Michael Natterer
3ad84e955f app: gimp_view_render_temp_buf_to_surface(): fix component extraction
The code was still assuming that GimpTempBuf is always 8 bit. Fixed
that, and optimized it to call babl_process() once per line instead of
per pixel. Fixes #13253.

(cherry picked from commit 6151deaff9)
2025-08-09 19:03:21 +02:00
Michael Natterer
ec1d626330 app: remove usless include in GimpLayerTreeView
(cherry picked from commit 7121109655)
2025-08-09 18:11:14 +02:00
Michael Natterer
96beda2ae5 app: make GimpItemList fully work on all item types
(cherry picked from commit f21aaf3416)
2025-08-09 18:11:14 +02:00
Michael Natterer
26c21c534f libgimp: there was an "else" missing in the commit below
(cherry picked from commit 76e82d5572)
2025-08-09 18:11:14 +02:00
Alx Sa
66d05121af libgimp: Create widgets for unsigned integer parameters
gimp_procedure_add_uint_argument () creates an unsigned integer
parameter. It's functionally equivalent for creating dialogue widgets,
but since we only checked for G_TYPE_PARAM_INT, these parameters
did not generate widgets in GimpProcedureDialog.
This patch adds a check for G_TYPE_PARAM_UINT in relevant sections
to resolve the issue.

(cherry picked from commit 0d08a3c532)
2025-08-09 18:11:14 +02:00
Michael Natterer
04e2d0016f app: the filters popover now seems smart enough to be shown when there
is a floating selection.

(cherry picked from commit 03366ae77c)
2025-08-09 18:11:14 +02:00
Michael Natterer
44bed73c6b app: gimp_drawable_update(): optimize a call to
gimp_drawable_get_bounding_box() away.

(cherry picked from commit 9e64535c22)
2025-08-09 18:11:14 +02:00
Michael Natterer
8993293996 app: GimpItemTreeView: show/hide the lock and search popovers
smoothly.

(cherry picked from commit 40ace1016d)
2025-08-09 18:11:14 +02:00
Michael Natterer
fd450f07f9 app: hide/destroy the filters popover properly when the view is
unmapped or the image is changed, don't run into hide/popdown
recursions, show/hide the popover smoothly.

(cherry picked from commit 8119591049)
2025-08-09 18:11:14 +02:00
Michael Natterer
e7f033ac67 app: fix my own confusion about gimp_drawable_update()
vs. gimp_drawable_update_bounding_box().

(cherry picked from commit fc0c089208)
2025-08-09 18:11:14 +02:00
Alx Sa
5ac4cc3a0e core: Don't merge floating selection as filter
Floating selections are added to the same stack as
non-destructive filters. While the GUI prevents merging
filters when there is a floating selection,
gimp_drawable_merge_filters () did not explicitly prevent
this. This patch replaces the while loop to merge filters with
a for loop, and explicitly checks if the item in the stack is a
drawable filter (and not a temporary one).

(cherry picked from commit ae02db90a3)
2025-08-09 18:11:14 +02:00
Michael Natterer
c480a66187 app: add accessors for GimpDrawableFilter::temporary and use them
instead of using the property dirtectly.  Also make sure temporary
filters don't go to the undo stack or to the XCF.

(cherry picked from commit 2baab5aa74)
2025-08-09 18:11:14 +02:00
Michael Natterer
eceef8dbc0 app: GimpDrawableFilter: move setters and getters together
(cherry picked from commit ac01289824)
2025-08-09 18:11:14 +02:00
Jordi Mas
832363c0f0 Update Catalan translation
(cherry picked from commit 4e2e1adce6)
2025-08-09 18:11:14 +02:00
Martin
cf129ed0a5 Update Slovenian translation
(cherry picked from commit 56083f3928)
2025-08-09 18:11:14 +02:00
Martin
08dd69d5f6 Update Slovenian translation
(cherry picked from commit 9210cf0be3)
2025-08-09 18:11:14 +02:00
Ekaterine Papava
47405bd97f Update Georgian translation
(cherry picked from commit ea5cd6a5f7)
2025-08-09 18:11:14 +02:00
Luming Zh
6eca9ebe51 Update Chinese (China) translation
(cherry picked from commit d60d9757a9)
2025-08-09 18:11:14 +02:00
Bruno Lopes
1e0879e0da build, plug-ins: Generate *associations.list automatically at build-time
This is way easier to maintain and creates a bigger list of
associations by following the libraries that GIMP links
(but does not work with more complex code like file-gegl).

Also helps with
https://gitlab.gnome.org/Infrastructure/gimp-macos-build/-/issues/3

(cherry picked from commit 2ce3c604e2)
2025-08-09 18:11:14 +02:00
Yuri Chornoivan
7d4d967972 Update Ukrainian translation
(cherry picked from commit 9e072b2ea0)
2025-08-09 18:11:14 +02:00
Yuri Chornoivan
e565a5594f Update Ukrainian translation
(cherry picked from commit c560c952b3)
2025-08-09 18:11:14 +02:00
Michael Natterer
647d3a0222 app: always show the filters popover if there are any potentially
editable filters, regardless of whether they are currently editable.
Also an ugly hack to make sure the popover resizes corrently with the
number of filters.

(cherry picked from commit 90db039270)
2025-08-09 18:11:14 +02:00
Michael Natterer
efcdcb7009 app: refactoring in filters and their UI
- move the filter popover to its own file
- centralize popover sensitivity settings
- get rid of gimp_item_refresh_filters()
- lots of minor filter fixes/changes

(cherry picked from commit 27b09025be)
2025-08-09 18:11:14 +02:00
Bruno Lopes
ba55fd716c plug-ins: Build 'file-desktop-link' only on Linux
(cherry picked from commit 6b4e346c24)
2025-08-09 18:11:14 +02:00
Luming Zh
9f5521b52a Update Chinese (China) translation
(cherry picked from commit f72b3f0a4d)
2025-08-09 18:11:14 +02:00
Bruno Lopes
129d499698 build/windows: Add observation about GIMP files on Installer script
(cherry picked from commit edb55421fb)
2025-08-09 18:11:14 +02:00
Michael Natterer
afa454398f app: GimpDrawableTreeView: rename functions to be consistent
and s/effects/filters/

(cherry picked from commit 18a9d267a0)
2025-08-09 18:11:14 +02:00
Michael Natterer
34dc46f892 app: GimpDrawableTreeView: rename "effect" to "filter"
(cherry picked from commit 9b2fc547ef)
2025-08-09 18:11:14 +02:00
Michael Natterer
8f078f45a9 app: minor cleanups in GimpDrawableTreeView
(cherry picked from commit 2b82907967)
2025-08-09 18:11:14 +02:00
Michael Natterer
efa673b796 app: some random cleanups in widgets
(cherry picked from commit 624a62d489)
2025-08-09 18:11:14 +02:00
Michael Natterer
6486f908c4 app: move the entire filter code from GimpItemTreeView to
GimpDrawableTreeView, because it's filters on drawables not items.

(cherry picked from commit 3b60a1e01d)
2025-08-09 18:11:14 +02:00
Bruno Lopes
6fb91fea86 build/windows: Fix XCF association name
Closes: #14149
(cherry picked from commit c49f5e3e2b)
2025-08-09 18:11:14 +02:00
Michael Natterer
c9788ceeb8 app: add gimp_drawable_raise,lower_filter()
and move code there from gimpitemtreeview.c

(cherry picked from commit a790dc3253)
2025-08-09 18:11:14 +02:00
Michael Natterer
a7cff72eaf app: micro cleanup in the filter undo code
(cherry picked from commit fb199fba34)
2025-08-09 18:11:14 +02:00
Michael Natterer
81f9026b16 app: move gimp_drawable_has_filter() around in its file
(cherry picked from commit 679c7a35c5)
2025-08-09 18:11:13 +02:00
Michael Natterer
fb12d2d1fe app: sanitize callback names of GimpItemTreeView drawable filter
callbacks, and remove unused variables.

(cherry picked from commit 2bf2f0e34f)
2025-08-09 18:11:13 +02:00
Estecka
5d261000a8 core,widgets: Fix filter manipulations on invisible layers
Many actions done on layers require refreshing its filters, by toggling
the layer off and on again. When done on an invisible layer, this would
turn it visible, which could not be undone.
Now, the layer remains invisible.

(cherry picked from commit a60c1097ab)
2025-08-09 18:11:13 +02:00
Bruno Lopes
cb11675766 app: Remove not-working GIMP_ICONS_LIKE_A_BOSS
'gtk-menu-images' simply does not
work on GTK3 (tested on AppImage, Flatpak
and Windows) and it is not present on GTK4.

(cherry picked from commit 65feecd32d)
2025-08-09 18:11:13 +02:00
Michael Natterer
3eca7cea89 app: move filter stack init/finalize to gimpdrawable-filters.c so we
can connect to signals and do other things right here for the entire
lifecycle of the drawable.

(cherry picked from commit 5805b96095)
2025-08-09 18:11:13 +02:00
Michael Natterer
6eaf61b86b app, pdb: move filter duplication to one place in
GimpItem::duplicate().

(cherry picked from commit bf877a8aa3)
2025-08-09 18:11:13 +02:00
Michael Natterer
00b59dbcc8 app: call gimp_drawable_filter_refresh_crop() in a
GimpItem::size_changed() implementation in GimpDrawable,
instead of having the same code multiple times.

(cherry picked from commit 4bb4811e77)
2025-08-09 18:11:13 +02:00
Michael Natterer
ecb25b5ba3 app: fix gimp_channel_is_full() to not lie:
- add channel->full the same way we have channel->empty
- never actually iterate the pixels to determine "full",
  only set it on simple stuff like "select all"
- optimize some code to take a fast path when the channel
  is full

Fixes #14081.

(cherry picked from commit 81a3c729d5)
2025-08-09 18:11:13 +02:00
Bruno Lopes
c937ff855f build/windows: Alternative approach to Inno reading of config*.h
Closes: #14101

Partially reverts: f69dd75a17

(cherry picked from commit c9f77c7228)
2025-08-09 18:11:13 +02:00
Michael Natterer
aaca92f96a app: make gimp_image_new_add_creation_metadata() static
(cherry picked from commit 868d566c7f)
2025-08-09 18:11:13 +02:00
Michael Natterer
e229a04170 app: fix menu states/callbacks for "Show Layer Masks" and "Disable
Layer Masks", Fixes #14055.

- change the logic to show the toggles in "on" state ONLY when ANY
  selected layer has the property enabled.
- adjust the action callbacks accordingly, and fix them to only push
  undo groups when multiple layers are changed.
- completely remove gimp_layer_tree_view_update_menu(), which did the
  same as the action update code, only more broken, was causing
  redundant undo steps beibng pushed, and was probably obsolete for 20
  years.

(cherry picked from commit c460450b4a)
2025-08-09 18:11:13 +02:00
Alx Sa
8fcb7ad303 plug-ins: Fixes to JPEG 2000 import
This patch fixes the following:
- The magic number for J2K codestreams was left off
when porting from GIMP 2.10, preventing GIMP from
recognizing those files automatically
- The "colorspace" parameter was added to JP2 loading
procedure as an aux argument, so that if a color space was
not defined, the pop-up dialogue will work correctly.
- Fixed a crash in sycc444_to_rgb (), similar to 127cd671,
when freeing parts of the OpenJPEG object that were still in
use.
- Minor spacing issues fixed.

(cherry picked from commit 1f37f92667)
2025-08-09 18:11:13 +02:00
Bruno Lopes
fb95bc93bc build/windows: Organize expired certificate detection code on MSIX script
This commit make things more linear.

(cherry picked from commit 2c0e7fdb76)
2025-08-09 18:11:13 +02:00
Bruno Lopes
48a5479232 build/windows: Fix .exe installer having the same mutex as gimp*.exe process
(cherry picked from commit 6ca8945d49)
2025-08-09 18:11:13 +02:00
Bruno Lopes
b89771ed27 build/windows: No need to double-define GIMP_MUTEX_VERSION on bundling script
We already take it from config.h

(cherry picked from commit b1eba99e46)
2025-08-09 18:11:13 +02:00
Sam James
98d123b3df meson: use boolean false, not string false
(cherry picked from commit db6e72e6a2)
2025-08-09 18:11:13 +02:00
Michael Natterer
d14c8d7f2b app: when creating a layer mask from the layer's alpha, but the layer
has no alpha, simply fill the mask with complete opacity instead of
leaving the user with a completely empty mask (and thus a completely
transparent layer).

(cherry picked from commit d63c4deb68)
2025-08-09 18:11:13 +02:00
Michael Natterer
17f3956343 app: make order of undo_group_end() and image_flush() consistent
in layers-commands.c, and some spacing cleanup.

(cherry picked from commit 1697e4575f)
2025-08-09 18:11:13 +02:00
Natanael Copa
9c76d5dee7 Issue #13657: fix build dependencies
We need the gir and plugins to be able to generate the splash image(s).
Add those as dependencies to gimp executable to ensure they are there
when needed.

Fixes: https://gitlab.gnome.org/GNOME/gimp/-/issues/13657
(cherry picked from commit 4cccc52622)
2025-08-09 18:11:13 +02:00
Danial Behzadi
eb55331c93 Update Persian translation
(cherry picked from commit 04e3bdc790)
2025-08-09 18:11:13 +02:00
Martin
3c3768586c Update Slovenian translation
(cherry picked from commit 60cb583a52)
2025-08-09 18:11:13 +02:00
Martin
71fb2fbe85 Update Slovenian translation
(cherry picked from commit ef142caec8)
2025-08-09 18:11:13 +02:00
Luming Zh
725e8367f7 Update Chinese (China) translation
(cherry picked from commit b383b86364)
2025-08-09 18:11:13 +02:00
Luming Zh
dd712a7ac6 Update Chinese (China) translation
(cherry picked from commit 7298e2b9d0)
2025-08-09 18:11:13 +02:00
Ekaterine Papava
f7224b0d35 Update Georgian translation
(cherry picked from commit 0fed482ae7)
2025-08-09 18:11:13 +02:00
Ekaterine Papava
caa9d8a799 Update Georgian translation
(cherry picked from commit 528b9b4d69)
2025-08-09 18:11:13 +02:00
Ekaterine Papava
25f7863bef Update Georgian translation
(cherry picked from commit 6e82489225)
2025-08-09 18:11:13 +02:00
Yuri Chornoivan
d202119b9b Update Ukrainian translation
(cherry picked from commit 2f4b8782fa)
2025-08-09 18:11:13 +02:00
Yuri Chornoivan
06de383c37 Update Ukrainian translation
(cherry picked from commit d5fb67f827)
2025-08-09 18:11:13 +02:00
Yuri Chornoivan
263b8e17c7 Update Ukrainian translation
(cherry picked from commit cd2a7b360d)
2025-08-09 18:11:13 +02:00
Ekaterine Papava
579f45e5ad Update Georgian translation
(cherry picked from commit 7d802efa27)
2025-08-09 18:11:13 +02:00
Luming Zh
8c0b6bf814 Update Chinese (China) translation
(cherry picked from commit 0790d1340d)
2025-08-09 18:11:13 +02:00
Martin
952cc59544 Update Slovenian translation
(cherry picked from commit 0108b6b415)
2025-08-09 18:11:12 +02:00
Emin Tufan Çetin
920278029e Update Turkish translation
(cherry picked from commit 2da8c80997)
2025-08-09 18:11:12 +02:00
Bruno Lopes
fa0a9f395c build/windows: Fix Start Menu and alias clashes with "GIMP (Insider)" MSIX
(cherry picked from commit e019f1cce3)
2025-08-09 18:11:12 +02:00
Alx Sa
dfe09f2e5d widgets: Prevent crash when changing indexed color
Similar logic to 4d8073a3 - the selection signal was not
being properly disconnected when the dialogue closed after
the color entry's color was changed via the HTML field.
This patch switches to using g_signal_connect_object ()
to automatically disconnect when the object is destroyed.

(cherry picked from commit 5918e2b4d3)
2025-08-09 18:11:12 +02:00
Bruno Lopes
3ecb537537 build/windows: Fix bezel being shown on Installer's Preparing page
(cherry picked from commit 073adebd0a)
2025-08-09 18:11:12 +02:00
Alx Sa
c8ab50fe57 plug-ins: Let Jigsaw draw on transparent layers
Currently, the Jigsaw plug-in only draws on RGB
channels. If the alpha channel is 0, then the Jigsaw
pattern will not show because it does not change the
alpha channel.
This patch adds a check if the format has an alpha
channel, and conditionally sets the alpha byte to 255
when drawing to ensure the pattern is always visible.

This patch also does some formatting clean-up, and
adds a check on the final progress update when previewing
to prevent it from showing 100% as soon as the GUI appears.

(cherry picked from commit 8168142c0c)
2025-08-09 18:11:12 +02:00
Luming Zh
d0bce08dc3 Update Chinese (China) translation
(cherry picked from commit 42e804f5f3)
2025-08-09 18:11:12 +02:00
Yuri Chornoivan
4feb016009 Update Ukrainian translation
(cherry picked from commit c1d14710e3)
2025-08-09 18:11:12 +02:00
Martin
b097f2baae Update Slovenian translation
(cherry picked from commit 0f1145253d)
2025-08-09 18:11:12 +02:00
Jehan
4742e81c67 app: add a toggle button in Brushes dockable for brush previews to…
… follow theme colors or not.

This is an update to MR !1370, as a result of testing and usability
meetings with Aryeom. While we understand that some people may want the
brush dockable to not display as some huge white "stain" in the middle
of an otherwise dark GUI (or other colors, depending on the chosen theme
and color scheme), brushes are not part of the GUI. When you look at
brush previews, you don't expect these to follow theme. And for sure,
painters more often paint over a white canvas than a gray or dark canvas
(or other colors), even though this is not an "always true" either. But
it's probably a better bet than following theme (which is closer to
"always false"!).

Therefore, what this additional commit does:

* By default, the brush previews still show as black on white;
* Nevertheless there is now a button (using the Preferences' theme icon)
  in the Brushes dockable which allow to switch to theme colors
  following brush previews.
* This setting is a GimpGuiConfig property, which means it will stick
  across sessions.

(cherry picked from commit b45cb600fe)
2025-08-09 18:11:12 +02:00
Jehan
55c41c7617 libgimpwidgets: new gimp_prop_toggle_new() property widget function.
(cherry picked from commit e8ffb8ff0e)
2025-08-09 18:11:12 +02:00
Jehan
0a12e66709 app, pdb: use the real theme background color for brushes with GIMP_VIEW_BG_USE_STYLE.
Previous code was using the correct background color from the theme, but
the foreground color was always either white or black (depending on GUI
config color scheme). Instead, just use the foreground color from theme.

Since core/ doesn't have access to GTK, hence the theme, we had to
update GimpViewable's get_preview() and get_pixbuf() abstract methods to
have a color argument for recoloring previews (when relevant, which for
most types of viewables is not).

(cherry picked from commit 3038c751bc)
2025-08-09 18:11:12 +02:00
Jehan
cabb14cdd4 app: invalidate and redraw the icons when the color scheme changes.
(cherry picked from commit 55658facb4)
2025-08-09 18:11:12 +02:00
Alx Sa
941ecc6c9e widgets, themes: Fix bug with selection...
background color. Resolves #9983.

We now check the parent widget's color
first to prevent issues with the selection
altering the background color of the
icon until the view is refreshed.
As a result, we can now define the
selected color of an icon, fixing a
regression from 2.10.

(cherry picked from commit 9bef3b2edd)
2025-08-09 18:11:12 +02:00
Alx Sa
70864ff1a1 widgets: Use theme colors of palette...
..background rendering. As with the
previous commit, this patch tries to
retrieve the background color and color
properties of the widget, then use them
to draw the background and grid of the
Palette and Colormap dockables.

(cherry picked from commit 80fca449a4)
2025-08-09 18:11:12 +02:00
Alx Sa
b3b111a3ab widgets: Adapt brush previews to theme
We now check the current theme and
draw the brush preview color and
background to match.

(cherry picked from commit 59685ce621)
2025-08-09 18:11:12 +02:00
Jacob Boerema
31a39392aa libgimpwidgets: gtk-fallback-icon-theme is deprecated...
since GTK 3.10 and according to the GTK3 documentation the setting
is ignored.

Remove the reference to it and thus setting a fallback. According to
the GTK docs `hicolor` is the fallback icon theme.
Since `gimp_icons_notify_system_icon_theme` was only used to add
the fallback, remove the function and setting it with
`g_signal_connect`.

(cherry picked from commit 7add94f868)
2025-08-09 18:11:12 +02:00
Alx Sa
abfd6cd6dc themes: Define menubar menuitem padding
Since we did not define the padding between menu items
in the menubar, some system themes caused them to
scrunch together. This patch sets the padding to match the
"default" GTK CSS to ensure there's distance between each
item in the menubar.
2025-05-22 13:54:24 +00:00
Alx Sa
06a0bafe79 plug-ins, operations: Fix warnings on Windows
This patch reduces three sets of warnings
when compiling on Windows:

* In gimp-layer-modes.c, we move the
g_return_val_if_reached () in
gimp_layer_mode_get_format () to the
default case in the last switch statement
to prevent a warning about an unhandled
switch case

* In spline.c, we initialize V[] to prevent
a warning about uninitialized values

* In flame.c, we unconditionally call
g_bytes_unref () to prevent a warning
about dangling pointers.
2025-05-22 02:10:08 +00:00
Emin Tufan Çetin
d74943b69e Update Turkish translation 2025-05-21 20:48:19 +00:00
Jehan
181b18f843 app: make transient factory dialogs follow the active display.
Right now, when you were setting your hints as KEEP_ABOVE, the dock
window would only keep above the image window from which you called it.
If you create a new image window, it could hide your toolbox and dock
windows.

Now we will reparent the dock windows when switching active display.

Note that this also applies to other types of dialogs we have, such as
the New Image dialog or the Search Actions, etc. But looking at all
these factory dialogs we have, it doesn't look like there is a single
case where the parenting pertains to a specific image. So it makes sense
that we always reparent when focusing a different image window.
2025-05-20 20:24:39 +00:00
Jehan
756700a02a Issue #13436: dock windows follow main window with all but NORMAL hint.
Per testing by Gabriele and discussions on IRC, it doesn't make sense
that UTILITY windows also keep all dockables above. Otherwise what's the
difference with KEEP_ABOVE?

Also it turns out that on macOS, setting a parent makes the transient
window follow the parent window (so it's close to the modal window
concept of GNOME). So that makes it even more important that our utility
windows don't have a parent.
2025-05-20 20:24:39 +00:00
Jehan
b8a39a4911 app: make sure KEEP_ABOVE windows are also set with UTILITY hint. 2025-05-20 20:24:39 +00:00
Alx Sa
3f9b05fb61 widgets: Only change text color when user confirms
Previously, we set text color to change when the "color-changed"
signal was sent out from GimpColorPanel. When all of the text is
the same color, this works fine. However, if we select text with
different colors on the canvas editor, the color defaults to black
since we can only hold a single color. If the user cancels, the
"color-changed" signal is still sent out, so we change all colors
to black.

This patch changes the code to use the "response" signal instead.
Then, we check if the user chose "OK" before calling the color
change function.
2025-05-20 16:11:26 +00:00
Alx Sa
bc887fbbb2 widgets: Prevent CRITICAL when toolbox has no child areas
To balance the child areas in the toolbox horizontally,
we dynamically set the maximum number of children in
the GtkFlowBox depending on the number of visible ones.
It is possible to hide all of them, giving us a max count of 0.
However, gtk_flow_box_set_max_children_per_line () requires
the max count to be at least 1 - this causes a CRITICAL.
This patch adds a check to make sure the count is at least 1
before calling that function.
2025-05-20 15:39:10 +00:00
Bruno Lopes
96d09108d5 build/windows: Distribute .pdb symbols on .msix too (not only on the .appxsym)
Despite what it looks like, the .pdb on .appxsym are
not stored on https://msdl.microsoft.com/download/symbols
I confirmed that on WinDBG and Visual Studio Debugger.
2025-05-20 07:39:06 -03:00
Alx Sa
b065425ee6 plug-ins: Don't draw PDF mask if turned off
In GIMP, if a layer mask is marked as disabled, it
does not show on the screen. However, we always
rendered the mask on PDF export. Since other image
formats like PNG don't render the mask, and since the
user likely does not expect an invisible mask to be drawn
on export, we add a check for gimp_layer_get_apply_mask ()
to be TRUE before rendering the mask image on PDF export.
2025-05-20 02:23:35 +00:00
Alx Sa
1685c86af5 widgets: Don't show palette name with no palette
Resolves #14047
The Color Dialog that appears when you select a
text outline color does not load a palette from context.
Since we then try to get the name from a NULL palette,
this causes a crash.
This patch resolves the issue by adding a check for the
palette's existence before trying to get its name.
2025-05-19 19:34:47 +00:00
Bruno Lopes
b25e489f6b build/windows: Only MSYS_ROOT env is needed for fix_msg.py
Fix regression introduced by c346731e, avoiding CYGWIN bins on PATH.
2025-05-19 14:07:34 -03:00
706 changed files with 107242 additions and 101012 deletions

View File

@@ -3,8 +3,9 @@ spec:
distribution_pipeline:
description: 'Pipelines that creates installable GIMP'
options:
- GIMP_CI_APPIMAGE #trigger the appimage making.
- GIMP_CI_APPIMAGE #trigger the appimage making (base & fast).
- GIMP_CI_FLATPAK #trigger the flatpak build and publishing (base but slow)
- GIMP_CI_SNAP #trigger the snap build (base but slow)
- GIMP_CI_WIN_INSTALLER #trigger all native MSYS2 builds then creates Inno Windows installer (base but slow)
- GIMP_CI_MS_STORE #trigger arm64 and x64 native MSYS2 builds then creates a .msixbundle (base but slow)
- none
@@ -12,7 +13,7 @@ spec:
test_pipeline:
description: 'Pipelines used only for testing'
options:
- GIMP_CI_MESON_GCC #trigger the Debian GCC build (rare usefulness)
- GIMP_CI_MESON_CLANG #trigger the Debian Clang build (rare usefulness)
- GIMP_CI_RASTER_ICONS #trigger the Debian Clang build without vector icons (rare usefulness)
- GIMP_CI_CPPCHECK #trigger cppcheck (static code analysis)
- none
@@ -29,7 +30,8 @@ workflow:
##################################################
## 1. On MERGE REQUESTS, the following are triggered:
## - Abbreviated Linux Clang build (base & fast)
## - Abbreviated Linux build
## - Building quality tests (static code analysis)
## - clang-format (static code analysis)
## - Execution tests (dynamic code analysis)
.pipeline_merge: &CI_MERGE
@@ -42,20 +44,22 @@ workflow:
# GitLab is quite sensitive about rules 'if' order so be careful
## 3. On COMMITS except tags.
## - Linux Clang build (base & fast)
## - Linux build
## - Building quality tests (static code analysis)
## - Execution tests (dynamic code analysis)
## - Source tarball (base & fast)
## - Developer documentation (base & fast)
## - Source tarball
## - Developer documentation
.pipeline_commit: &CI_COMMIT
if: '$CI_PIPELINE_SOURCE == "push" && $CI_OPEN_MERGE_REQUESTS == null && $CI_COMMIT_TAG == null'
interruptible: true
variables: {}
## 4. RELEASES.
## - Source tarball (base & fast)
## - Developer documentation (base & fast)
## - Inno Windows installer (base but slow)
## - MS Store .msixupload (base but slow)
## - Source tarball
## - Developer documentation
## - Linux .appimage
## - Inno Windows installer
## - MS Store .msixupload
.pipeline_release: &CI_RELEASE
if: '$CI_COMMIT_TAG != null'
interruptible: false
@@ -76,10 +80,12 @@ workflow:
- 'runner_system_failure'
- 'scheduler_failure'
needs: []
# Default Docker image (unless otherwise defined)
image: debian:${DEB_VERSION}
# Default Docker image (keep variables: DEB_VERSION: consistent with devel-docs/os-support.txt)
image: $CI_REGISTRY_IMAGE:build-debian-${DEB_VERSION}-${RUNNER}
variables:
DEB_VERSION: "bookworm"
UMFPACK: libumfpack5
RUNNER: "x86_64_v3"
# Common cloning procedure
GIT_DEPTH: "1"
GIT_SUBMODULE_STRATEGY: none
@@ -93,37 +99,40 @@ workflow:
stages:
- dependencies
- gimp
- build
- analysis
- distribution
## AppImage CI (Debian) ##
.debian:
## Common GNU/Linux 64-bit CI (Debian) ##
.debian-nonreloc:
extends: .default
rules:
- if: '$CI_MERGE_REQUEST_LABELS =~ /.*Package:AppImage.*/'
interruptible: true
- if: '$GIMP_CI_APPIMAGE != null || "$[[ inputs.distribution_pipeline ]]" =~ /.*GIMP_CI_APPIMAGE.*/'
- <<: *CI_MERGE
- <<: *CI_COMMIT
variables: {}
- if: '$GIMP_CI_MESON_CLANG != null || "$[[ inputs.test_pipeline ]]" =~ /.*GIMP_CI_MESON_CLANG.*/'
variables:
CC: clang
CXX: clang++
CC_LD: lld
CXX_LD: lld
TOOLCHAIN: "clang lld"
VARIANT: -clang
- if: '$GIMP_CI_RASTER_ICONS != null || "$[[ inputs.test_pipeline ]]" =~ /.*GIMP_CI_RASTER_ICONS.*/'
variables:
MESON_OPTIONS: "-Dvector-icons=false"
VARIANT: "-raster"
- <<: *CI_RELEASE
parallel:
matrix:
- RUNNER: [aarch64, x86_64_v2]
tags:
- $RUNNER
image: $CI_REGISTRY_IMAGE:build-debian-${DEB_VERSION}-${RUNNER}
variables:
CC: "clang"
CXX: "clang++"
CC_LD: lld
CXX_LD: lld
before_script:
- export GIMP_PREFIX="${CI_PROJECT_DIR}/_install-${RUNNER}"
timeout: 20m
timeout: 30m
.debian_environ: &ENVIRON
- echo -e "\e[0Ksection_start:`date +%s`:environ[collapsed=true]\r\e[0KPreparing build environment"
- gcc -print-multi-os-directory 2>/dev/null | grep ./ && export LIB_DIR=$(gcc -print-multi-os-directory | sed 's/\.\.\///g') || export LIB_DIR="lib"
- gcc -print-multiarch 2>/dev/null | grep . && export LIB_SUBDIR=$(echo $(gcc -print-multiarch)'/')
# See: https://testing.developer.gimp.org/core/setup/build/#preparing-for-building
- printf "\e[0Ksection_start:`date +%s`:environ[collapsed=true]\r\e[0KPreparing build environment\n"
- gcc -print-multi-os-directory 2>/dev/null | grep -q ./ && export LIB_DIR=$(gcc -print-multi-os-directory | sed 's/\.\.\///g') || export LIB_DIR="lib"
- gcc -print-multiarch 2>/dev/null | grep -q . && export LIB_SUBDIR=$(echo $(gcc -print-multiarch)'/') || export LIB_SUBDIR=
## Build-time vars
- export PKG_CONFIG_PATH="${GIMP_PREFIX}/${LIB_DIR}/${LIB_SUBDIR}pkgconfig${PKG_CONFIG_PATH:+:$PKG_CONFIG_PATH}"
- export XDG_DATA_DIRS="${GIMP_PREFIX}/share:/usr/share${XDG_DATA_DIRS:+:$XDG_DATA_DIRS}"
@@ -131,44 +140,39 @@ stages:
- export PATH="${GIMP_PREFIX}/bin:$PATH"
- export LD_LIBRARY_PATH="${GIMP_PREFIX}/${LIB_DIR}/${LIB_SUBDIR}${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}"
- export GI_TYPELIB_PATH="${GIMP_PREFIX}/${LIB_DIR}/${LIB_SUBDIR}girepository-1.0${GI_TYPELIB_PATH:+:$GI_TYPELIB_PATH}"
- echo -e "\e[0Ksection_end:`date +%s`:environ\r\e[0K"
- printf "\e[0Ksection_end:`date +%s`:environ\r\e[0K\n"
deps-debian:
extends: .debian
deps-debian-nonreloc:
extends: .debian-nonreloc
stage: dependencies
image:
name: gcr.io/kaniko-project/executor:debug
entrypoint: [""]
image: quay.io/buildah/stable
variables:
GIT_STRATEGY: none
UMFPACK: libumfpack5
PKGCONF_RELOCATABLE_OPTION: '-Dpkgconfig.relocatable=true'
script:
- export container=docker
- mkdir -p /kaniko/.docker
- echo "{\"auths\":{\"$CI_REGISTRY\":{\"username\":\"$CI_REGISTRY_USER\",\"password\":\"$CI_REGISTRY_PASSWORD\"}}}" > /kaniko/.docker/config.json
- export BUILDAH_FORMAT=docker
- export STORAGE_DRIVER=vfs
- echo "$CI_REGISTRY_PASSWORD" | buildah login -u "$CI_REGISTRY_USER" --password-stdin $CI_REGISTRY
# Install deps
- echo "FROM debian:${DEB_VERSION}" > Dockerfile
- echo "RUN echo -e \"\e[0Ksection_start:0000000001:deps_install[collapsed=true]\r\e[0KInstalling dependencies provided by Debian $DEB_VERSION\"" >> Dockerfile
- echo "WORKDIR $CI_PROJECT_DIR" >> Dockerfile
- echo "RUN printf \"\e[0Ksection_start:0000000001:deps_install[collapsed=true]\r\e[0KInstalling dependencies provided by Debian $DEB_VERSION\n\"" >> Dockerfile
- echo "RUN apt-get update -qq" >> Dockerfile
## 'ca-certificates' is NOT a gimp dep, it is installed only to our Docker image work
- echo "RUN apt-get install -qq -y --no-install-recommends ca-certificates" >> Dockerfile
## Build-time only dependencies
- echo "RUN apt-get install -qq -y --no-install-recommends \\" >> Dockerfile
- echo "appstream
ccache
clang
- echo "${TOOLCHAIN:-build-essential}
appstream
bison
desktop-file-utils
flex
gi-docgen
git
gobject-introspection
libgtk-3-bin
lld
meson
valac
xauth
xsltproc
xvfb" >> Dockerfile
xsltproc" >> Dockerfile
## Runtime dependencies
- echo "RUN apt-get install -qq -y --no-install-recommends \\" >> Dockerfile
- echo "at-spi2-core
@@ -178,9 +182,10 @@ deps-debian:
glib-networking
graphviz
graphviz-dev
gvfs
iso-codes
libaa1-dev
libappstream-glib-dev
libappstream-dev
libarchive-dev
libbz2-dev
libcfitsio-dev
@@ -191,6 +196,7 @@ deps-debian:
libgtk-3-dev
libgudev-1.0-dev
libheif-dev
$LIBHEIF_PLUGINS
libjson-glib-dev
libjxl-dev
liblcms2-dev
@@ -203,9 +209,7 @@ deps-debian:
libopenjp2-7-dev
libpoppler-glib-dev
libqoi-dev
libraw-dev
librsvg2-dev
libspiro-dev
libsuitesparse-dev
libtiff-dev
$UMFPACK
@@ -219,37 +223,38 @@ deps-debian:
python3
python3-gi
python3-gi-cairo" >> Dockerfile
- echo "RUN echo -e \"\e[0Ksection_end:0000000002:deps_install\r\e[0K\"" >> Dockerfile
- echo "RUN printf \"\e[0Ksection_end:0000000002:deps_install\r\e[0K\n\"" >> Dockerfile
# Prepare environ
- echo "FROM $CI_REGISTRY_IMAGE:build-debian-${DEB_VERSION}-${RUNNER}" > Dockerfile2;
- echo "RUN echo -e \"\e[0Ksection_start:`date +%s`:environ[collapsed=true]\r\e[0KPreparing build environment\"" >> Dockerfile2;
- export LIB_DIR="lib";
- export LIB_SUBDIR=$([ "$(uname -m)" = 'aarch64' ] && echo "aarch64-linux-gnu/" || echo "x86_64-linux-gnu/");
- echo "ENV PKG_CONFIG_PATH=\"${GIMP_PREFIX}/${LIB_DIR}/${LIB_SUBDIR}pkgconfig${PKG_CONFIG_PATH:+:$PKG_CONFIG_PATH}\"" >> Dockerfile2;
- echo "RUN printf \"\e[0Ksection_start:`date +%s`:environ[collapsed=true]\r\e[0KPreparing build environment\n\"" >> Dockerfile2;
- echo "ENV PKG_CONFIG_PATH=\"${GIMP_PREFIX}/lib/$([ "$(uname -m)" = 'aarch64' ] && echo "aarch64-linux-gnu/" || echo "x86_64-linux-gnu/")pkgconfig${PKG_CONFIG_PATH:+:$PKG_CONFIG_PATH}\"" >> Dockerfile2;
- echo "ENV XDG_DATA_DIRS=\"${GIMP_PREFIX}/share:/usr/share${XDG_DATA_DIRS:+:$XDG_DATA_DIRS}\"" >> Dockerfile2;
- echo "ENV CC=\"$CC\"" >> Dockerfile2;
- echo "ENV CXX=\"$CXX\"" >> Dockerfile2;
- echo "ENV CC_LD=\"$CC_LD\"" >> Dockerfile2;
- echo "ENV CXX_LD=\"$CXX_LD\"" >> Dockerfile2;
- if [ "$VARIANT" = "-clang" ]; then
echo "ENV CC=\"$CC\"" >> Dockerfile2;
echo "ENV CXX=\"$CXX\"" >> Dockerfile2;
echo "ENV CC_LD=\"$CC_LD\"" >> Dockerfile2;
echo "ENV CXX_LD=\"$CXX_LD\"" >> Dockerfile2;
fi
- echo "ENV CLICOLOR_FORCE=\"1\"" >> Dockerfile2;
- echo "RUN echo -e \"\e[0Ksection_end:`date +%s`:environ\r\e[0K\"" >> Dockerfile2;
- echo "RUN printf \"\e[0Ksection_end:`date +%s`:environ\r\e[0K\n\"" >> Dockerfile2;
# Build some dependencies
## Build babl
- echo "RUN echo -e \"\e[0Ksection_start:`date +%s`:babl_build[collapsed=true]\r\e[0KBuilding babl\"" >> Dockerfile2;
- echo "RUN git clone --branch \"\$([ \"$CI_COMMIT_TAG\" ] && echo \"\$(git ls-remote --tags --exit-code --refs https://gitlab.gnome.org/GNOME/babl.git | grep -oi \"BABL_[0-9]*_[0-9]*_[0-9]*\" | sort --version-sort | tail -1)\" || echo \"master\")\" --depth=${GIT_DEPTH} https://gitlab.gnome.org/GNOME/babl.git" $CI_PROJECT_DIR/babl >> Dockerfile2;
- echo "RUN meson setup $CI_PROJECT_DIR/babl/_build-${RUNNER} $CI_PROJECT_DIR/babl -Dprefix=\"${GIMP_PREFIX}\" $PKGCONF_RELOCATABLE_OPTION" >> Dockerfile2;
- echo "RUN ninja -C $CI_PROJECT_DIR/babl/_build-${RUNNER}" >> Dockerfile2;
- echo "RUN ninja -C $CI_PROJECT_DIR/babl/_build-${RUNNER} install" >> Dockerfile2;
- echo "RUN echo -e \"\e[0Ksection_end:`date +%s`:babl_build\r\e[0K\"" >> Dockerfile2;
- echo "RUN printf \"\e[0Ksection_start:`date +%s`:babl_build[collapsed=true]\r\e[0KBuilding babl\n\"" >> Dockerfile2;
- echo "RUN git clone --branch \"\$([ \"$CI_COMMIT_TAG\" ] && echo \"\$(git ls-remote --tags --exit-code --refs https://gitlab.gnome.org/GNOME/babl.git | grep -oi \"BABL_[0-9]*_[0-9]*_[0-9]*\" | sort --version-sort | tail -1)\" || echo \"master\")\" --depth=${GIT_DEPTH} https://gitlab.gnome.org/GNOME/babl.git" babl >> Dockerfile2;
- echo "RUN meson setup babl/_build-${RUNNER} babl -Dprefix=\"${GIMP_PREFIX}\" $PKGCONF_RELOCATABLE_OPTION" >> Dockerfile2;
- echo "RUN ninja -C babl/_build-${RUNNER}" >> Dockerfile2;
- echo "RUN ninja -C babl/_build-${RUNNER} install" >> Dockerfile2;
- echo "RUN printf \"\e[0Ksection_end:`date +%s`:babl_build\r\e[0K\n\"" >> Dockerfile2;
## Build GEGL
- echo "RUN echo -e \"\e[0Ksection_start:`date +%s`:gegl_build[collapsed=true]\r\e[0KBuilding gegl\"" >> Dockerfile2;
- echo "RUN git clone --branch \"\$([ \"$CI_COMMIT_TAG\" ] && echo \"\$(git ls-remote --tags --exit-code --refs https://gitlab.gnome.org/GNOME/gegl.git | grep -oi \"GEGL_[0-9]*_[0-9]*_[0-9]*\" | sort --version-sort | tail -1)\" || echo \"master\")\" --depth=${GIT_DEPTH} https://gitlab.gnome.org/GNOME/gegl.git" $CI_PROJECT_DIR/gegl >> Dockerfile2;
- echo "RUN meson setup $CI_PROJECT_DIR/gegl/_build-${RUNNER} $CI_PROJECT_DIR/gegl -Dprefix=\"${GIMP_PREFIX}\" $PKGCONF_RELOCATABLE_OPTION $WORKSHOP_OPTION" >> Dockerfile2;
- echo "RUN ninja -C $CI_PROJECT_DIR/gegl/_build-${RUNNER}" >> Dockerfile2;
- echo "RUN ninja -C $CI_PROJECT_DIR/gegl/_build-${RUNNER} install" >> Dockerfile2;
- echo "RUN echo -e \"\e[0Ksection_end:`date +%s`:gegl_build\r\e[0K\"" >> Dockerfile2;
- /kaniko/executor --context $CI_PROJECT_DIR --dockerfile $CI_PROJECT_DIR/Dockerfile --destination $CI_REGISTRY_IMAGE:build-debian-${DEB_VERSION}-${RUNNER} --cache=true --cache-ttl=120h --image-fs-extract-retry 1 --verbosity=warn
- if [ -f 'Dockerfile2' ]; then /kaniko/executor --context $CI_PROJECT_DIR --dockerfile $CI_PROJECT_DIR/Dockerfile2 --destination build-debian-${DEB_VERSION}-${RUNNER}-temp --cache=false --no-push --verbosity=warn; fi
- echo "RUN printf \"\e[0Ksection_start:`date +%s`:gegl_build[collapsed=true]\r\e[0KBuilding gegl\n\"" >> Dockerfile2;
- echo "RUN git clone --branch \"\$([ \"$CI_COMMIT_TAG\" ] && echo \"\$(git ls-remote --tags --exit-code --refs https://gitlab.gnome.org/GNOME/gegl.git | grep -oi \"GEGL_[0-9]*_[0-9]*_[0-9]*\" | sort --version-sort | tail -1)\" || echo \"master\")\" --depth=${GIT_DEPTH} https://gitlab.gnome.org/GNOME/gegl.git" gegl >> Dockerfile2;
- echo "RUN meson setup gegl/_build-${RUNNER} gegl -Dprefix=\"${GIMP_PREFIX}\" $PKGCONF_RELOCATABLE_OPTION -Dworkshop=true" >> Dockerfile2;
- echo "RUN ninja -C gegl/_build-${RUNNER}" >> Dockerfile2;
- echo "RUN ninja -C gegl/_build-${RUNNER} install" >> Dockerfile2;
- echo "RUN printf \"\e[0Ksection_end:`date +%s`:gegl_build\r\e[0K\n\"" >> Dockerfile2;
#FIXME: '2>&1 | grep -v STEP' since buildah is too verbose. See: https://github.com/containers/buildah/issues/6362
- buildah build --log-level error --volume $CI_PROJECT_DIR:$CI_PROJECT_DIR:Z --file $CI_PROJECT_DIR/Dockerfile --tag $CI_REGISTRY_IMAGE:build-debian-${DEB_VERSION}-${RUNNER} --layers --cache-from $CI_REGISTRY_IMAGE/cache --cache-to $CI_REGISTRY_IMAGE/cache --cache-ttl=120h 2>&1 | grep -v STEP && buildah push --log-level error $CI_REGISTRY_IMAGE:build-debian-${DEB_VERSION}-${RUNNER} 2>&1 | grep -v STEP
- buildah build --log-level error --volume $CI_PROJECT_DIR:$CI_PROJECT_DIR:Z --file $CI_PROJECT_DIR/Dockerfile2 --no-cache 2>&1 | grep -v STEP
artifacts:
paths:
- _install-${RUNNER}/
@@ -259,110 +264,41 @@ deps-debian:
- gegl/_build-${RUNNER}/config.h
expire_in: 2 hours
gimp-debian:
extends: .debian
needs: ["deps-debian"]
stage: gimp
gimp-debian-nonreloc:
extends: .debian-nonreloc
needs: ["deps-debian-nonreloc"]
stage: build
variables:
GIT_SUBMODULE_STRATEGY: recursive
script:
- *ENVIRON
# Build GIMP
- echo -e "\e[0Ksection_start:`date +%s`:gimp_build[collapsed=true]\r\e[0KBuilding GIMP"
- meson setup _build-${RUNNER} -Dprefix="${GIMP_PREFIX}"
-Dpkgconfig.relocatable=true
-Drelocatable-bundle=yes
-Dcheck-update=yes
-Dbuild-id=org.gimp.GIMP_official.AppImage.$(uname -m)
- cd _build-${RUNNER}
- ninja
- echo -e "\e[0Ksection_end:`date +%s`:gimp_build\r\e[0K"
# Create bundle
- echo -e "\e[0Ksection_start:`date +%s`:gimp_bundle[collapsed=true]\r\e[0KCreating bundle"
- ninja install &> ninja_install.log || cat ninja_install.log
- cd ..
- bash build/linux/appimage/3_dist-gimp-goappimage.sh --bundle-only &> goappimage.log || cat goappimage.log
- echo -e "\e[0Ksection_end:`date +%s`:gimp_bundle\r\e[0K"
artifacts:
paths:
- AppDir*/
- appimageignore*
- _build-${RUNNER}/meson-logs/meson-log.txt
- _build-${RUNNER}/config.h
expire_in: 2 days
## GNU/Linux 64-bit CIs (Debian) ##
.debian-x64:
extends: .debian
rules:
- <<: *CI_MERGE
- <<: *CI_COMMIT
- if: '$GIMP_CI_MESON_CLANG != null'
variables: {}
- if: '$GIMP_CI_MESON_GCC != null || "$[[ inputs.test_pipeline ]]" =~ /.*GIMP_CI_MESON_GCC.*/'
variables:
CC: "cc"
CXX: "c++"
CC_LD: bfd
CXX_LD: bfd
VARIANT: "-gcc"
- if: '$GIMP_CI_RASTER_ICONS != null || "$[[ inputs.test_pipeline ]]" =~ /.*GIMP_CI_RASTER_ICONS.*/'
variables:
MESON_OPTIONS: "-Dvector-icons=false"
VARIANT: "-raster"
- if: '$GIMP_CI_SOURCES != null'
- <<: *CI_RELEASE
parallel:
matrix:
- RUNNER: x86_64_v2
tags: []
deps-debian-x64:
extends: .debian-x64
stage: !reference [deps-debian, stage]
image: !reference [deps-debian, image]
variables:
GIT_STRATEGY: none
WORKSHOP_OPTION: '-Dworkshop=true'
script:
- !reference [deps-debian, script]
artifacts: !reference [deps-debian, artifacts]
gimp-debian-x64:
extends: .debian-x64
needs: ["deps-debian-x64"]
stage: !reference [gimp-debian, stage]
variables: !reference [gimp-debian, variables]
script:
- *ENVIRON
# Check building
- echo -e "\e[0Ksection_start:`date +%s`:gimp_build[collapsed=true]\r\e[0KBuilding GIMP"
- printf "\e[0Ksection_start:`date +%s`:gimp_build[collapsed=true]\r\e[0KBuilding GIMP\n"
- meson setup _build-${RUNNER} -Dprefix="${GIMP_PREFIX}"
-Dfile-plug-ins-test=true
$MESON_OPTIONS
- cd _build-${RUNNER}
- ninja
- echo -e "\e[0Ksection_end:`date +%s`:gimp_build\r\e[0K"
- printf "\e[0Ksection_end:`date +%s`:gimp_build\r\e[0K\n"
# Check execution
- echo -e "\e[0Ksection_start:`date +%s`:gimp_test[collapsed=true]\r\e[0KTesting GIMP execution"
- printf "\e[0Ksection_start:`date +%s`:gimp_test[collapsed=true]\r\e[0KTesting GIMP execution\n"
- ninja test
- echo -e "\e[0Ksection_end:`date +%s`:gimp_test\r\e[0K"
- printf "\e[0Ksection_end:`date +%s`:gimp_test\r\e[0K\n"
# Check source
- echo -e "\e[0Ksection_start:`date +%s`:gimp_tar[collapsed=true]\r\e[0KChecking GIMP source"
- printf "\e[0Ksection_start:`date +%s`:gimp_tar[collapsed=true]\r\e[0KChecking GIMP source\n"
- if [ $(git diff |wc -l) -ne 0 ]; then
echo "ERROR. A generated file was updated without the source:";
printf "ERROR. A generated file was updated without the source:\n";
git diff;
exit 1;
fi
- if [ "$VARIANT" != "-gcc" ] && [ "$VARIANT" != "-raster" ] && [ "$CI_PIPELINE_SOURCE" != "merge_request_event" ]; then
ninja dist &> ninja_dist.txt || cat ninja_dist.txt;
- if [ "$VARIANT" != "-clang" ] && [ "$VARIANT" != "-raster" ] && [ "$CI_PIPELINE_SOURCE" != "merge_request_event" ]; then
ninja dist > ninja_dist.log 2>&1 || { cat ninja_dist.log; exit 1; };
fi
- echo -e "\e[0Ksection_end:`date +%s`:gimp_tar\r\e[0K"
- printf "\e[0Ksection_end:`date +%s`:gimp_tar\r\e[0K\n"
# Check install
- echo -e "\e[0Ksection_start:`date +%s`:gimp_install[collapsed=true]\r\e[0KChecking GIMP installation"
- ninja install &> ninja_install.txt || cat ninja_install.txt;
- echo -e "\e[0Ksection_end:`date +%s`:gimp_install\r\e[0K"
- printf "\e[0Ksection_start:`date +%s`:gimp_install[collapsed=true]\r\e[0KChecking GIMP installation\n"
- ninja install > ninja_install.log 2>&1 || { cat ninja_install.log; exit 1; };
- printf "\e[0Ksection_end:`date +%s`:gimp_install\r\e[0K\n"
artifacts:
paths:
- _install-${RUNNER}/
@@ -374,49 +310,188 @@ gimp-debian-x64:
expire_in: 2 days
## Flatpak CI ##
.flatpak-x64:
## AppImage CI (Debian) ##
.debian:
extends: .debian-nonreloc
rules:
- if: '$CI_MERGE_REQUEST_LABELS =~ /.*Package:AppImage.*/'
interruptible: true
- if: '$GIMP_CI_APPIMAGE != null || "$[[ inputs.distribution_pipeline ]]" =~ /.*GIMP_CI_APPIMAGE.*/'
- <<: *CI_RELEASE
parallel:
matrix:
- RUNNER: [aarch64, x86_64_v3]
tags:
- $RUNNER
variables:
#FIXME: remove this variables: key and go back to relying on .default DEB_VERSION on GIMP 3.3/3.4
DEB_VERSION: "trixie"
UMFPACK: libumfpack6
LIBHEIF_PLUGINS: "libheif-plugin-dav1d libheif-plugin-aomenc libheif-plugin-libde265 libheif-plugin-x265 libheif-plugin-j2kdec libheif-plugin-j2kenc"
deps-debian:
extends: .debian
stage: !reference [deps-debian-nonreloc, stage]
image: !reference [deps-debian-nonreloc, image]
variables:
GIT_STRATEGY: none
PKGCONF_RELOCATABLE_OPTION: '-Dpkgconfig.relocatable=true'
script:
- !reference [deps-debian-nonreloc, script]
artifacts: !reference [deps-debian-nonreloc, artifacts]
gimp-debian:
extends: .debian
needs: ["deps-debian"]
stage: !reference [gimp-debian-nonreloc, stage]
variables:
#FIXME: remove this variables: key and go back to relying on gimp-debian-nonreloc variables: on GIMP 3.3/3.4
GIT_SUBMODULE_STRATEGY: recursive
script:
- *ENVIRON
# Build GIMP
- printf "\e[0Ksection_start:`date +%s`:gimp_build[collapsed=true]\r\e[0KBuilding GIMP\n"
- meson setup _build-${RUNNER} -Dprefix="${GIMP_PREFIX}"
-Dgi-docgen=disabled
-Dpkgconfig.relocatable=true
-Drelocatable-bundle=yes
-Dcheck-update=yes
-Dbuild-id=org.gimp.GIMP_official.AppImage.$(uname -m)
- cd _build-${RUNNER}
- ninja
- printf "\e[0Ksection_end:`date +%s`:gimp_build\r\e[0K\n"
# Create bundle
- printf "\e[0Ksection_start:`date +%s`:gimp_bundle[collapsed=true]\r\e[0KCreating bundle\n"
- ninja install > ninja_install.log 2>&1 || { cat ninja_install.log; exit 1; }
- cd ..
- sh build/linux/appimage/3_dist-gimp-goappimage.sh --bundle-only > goappimage.log 2>&1 || { cat goappimage.log; exit 1; }
- printf "\e[0Ksection_end:`date +%s`:gimp_bundle\r\e[0K\n"
artifacts:
paths:
- AppDir*/
- appimageignore*
- _build-${RUNNER}/meson-logs/meson-log.txt
- _build-${RUNNER}/config.h
expire_in: 2 days
## Flatpak CI (Fedora) ##
.flatpak:
extends: .default
#We need to specify this since .flatpak from flatpak_ci_initiative.yml sets to true
interruptible: false
rules:
- if: '$CI_MERGE_REQUEST_LABELS =~ /.*Package:Flatpak.*/'
interruptible: true
- if: '$GIMP_CI_FLATPAK != null || "$[[ inputs.distribution_pipeline ]]" =~ /.*GIMP_CI_FLATPAK.*/'
parallel:
matrix:
- RUNNER: [flatpak-aarch64, flatpak-x86_64]
tags:
- flatpak
image: 'quay.io/gnome_infrastructure/gnome-runtime-images:gnome-master'
- $RUNNER
image: quay.io/gnome_infrastructure/gnome-runtime-images:gnome-master
variables:
RUN_TESTS: 0
MESON_DIST: 0
before_script:
- export GIMP_PREFIX="${CI_PROJECT_DIR}/_install"
timeout: 40m
#30min is enough only if no module was updated/rebuilt, we need more time in case of module bumps
timeout: 90m
deps-flatpak-x64:
extends: .flatpak-x64
deps-flatpak:
extends: .flatpak
stage: dependencies
#https://gitlab.gnome.org/Infrastructure/Infrastructure/-/issues/1502
#cache:
#key: ${CI_JOB_NAME_SLUG}
#paths:
#- .flatpak-builder/
script:
- bash build/linux/flatpak/1_build-deps-flatpak.sh
- sh build/linux/flatpak/1_build-deps-flatpakbuilder.sh
artifacts:
paths:
- .flatpak-builder.tar
- flatpak-builder.log
- _build-$RUNNER.tar.zst
- babl-meson-log.tar
- gegl-meson-log.tar
expire_in: 2 hours
gimp-flatpak-x64:
extends: .flatpak-x64
needs: ["deps-flatpak-x64"]
stage: gimp
gimp-flatpak:
extends: .flatpak
needs: ["deps-flatpak"]
stage: build
variables:
GIT_SUBMODULE_STRATEGY: recursive
script:
- bash build/linux/flatpak/2_build-gimp-flatpak.sh
- sh build/linux/flatpak/2_build-gimp-flatpakbuilder.sh
artifacts:
paths:
- repo.tar
- temp*.flatpak
- repo*.tar
- gimp-flatpak-builder.log
- gimp-meson-log.tar
expire_in: 2 days
## Snap CI (Ubuntu) ##
.snap:
extends: .default
rules:
- if: '$CI_MERGE_REQUEST_LABELS =~ /.*Package:Snap.*/'
interruptible: true
- if: '$GIMP_CI_SNAP != null || "$[[ inputs.distribution_pipeline ]]" =~ /.*GIMP_CI_SNAP.*/'
parallel:
matrix:
- RUNNER: [aarch64, x86_64_v3]
tags:
- $RUNNER
image: $CI_REGISTRY_IMAGE:build-snap-${SNAPCRAFT_BASE_VERSION}-${RUNNER}
variables:
SNAPCRAFT_BASE_VERSION: "8_core24"
RUNNER: x86_64_v3
timeout: 30m
deps-snap:
extends: .snap
stage: dependencies
image: quay.io/buildah/stable
script:
- export BUILDAH_FORMAT=docker
- export STORAGE_DRIVER=vfs
- echo "$CI_REGISTRY_PASSWORD" | buildah login -u "$CI_REGISTRY_USER" --password-stdin $CI_REGISTRY
# Install deps
- echo "FROM ghcr.io/canonical/snapcraft:${SNAPCRAFT_BASE_VERSION}" > Dockerfile
- echo "ENTRYPOINT [\"\"]" >> Dockerfile
- echo "WORKDIR $CI_PROJECT_DIR" >> Dockerfile
- echo "ENV GITLAB_CI=1" >> Dockerfile
- echo "ENV RUNNER=$RUNNER" >> Dockerfile
- echo "RUN apt-get update -y" >> Dockerfile
- echo "RUN apt-get install -y curl jq squashfs-tools sudo" >> Dockerfile
# https://github.com/canonical/snapcraft-rocks/issues/37
- echo "RUN cp -r /usr/lib/python3.*/site-packages/extensions/* /usr/share/snapcraft/extensions/" >> Dockerfile
# https://github.com/canonical/snapcraft-rocks/issues/33
- echo "RUN ln -s /usr/libexec/snapcraft/craftctl /usr/bin/craftctl" >> Dockerfile
- echo "RUN sh build/linux/snap/1_build-deps-snapcraft.sh --install-snaps" >> Dockerfile;
# Build babl and GEGL
- echo "FROM $CI_REGISTRY_IMAGE:build-snap-${SNAPCRAFT_BASE_VERSION}-${RUNNER}" > Dockerfile2;
- echo "RUN sh build/linux/snap/1_build-deps-snapcraft.sh" >> Dockerfile2;
#FIXME: '2>&1 | grep -v STEP' since buildah is too verbose. See: https://github.com/containers/buildah/issues/6362
- buildah build --log-level error --volume $CI_PROJECT_DIR:$CI_PROJECT_DIR:Z --file $CI_PROJECT_DIR/Dockerfile --tag $CI_REGISTRY_IMAGE:build-snap-${SNAPCRAFT_BASE_VERSION}-${RUNNER} --layers --cache-from $CI_REGISTRY_IMAGE/cache --cache-to $CI_REGISTRY_IMAGE/cache --cache-ttl=120h 2>&1 | grep -v STEP && buildah push --log-level error $CI_REGISTRY_IMAGE:build-snap-${SNAPCRAFT_BASE_VERSION}-${RUNNER} 2>&1 | grep -v STEP
- buildah build --log-level error --volume $CI_PROJECT_DIR:$CI_PROJECT_DIR:Z --file $CI_PROJECT_DIR/Dockerfile2 --no-cache 2>&1 | grep -v STEP
artifacts:
paths:
- _install-$RUNNER.tar
- _build-$RUNNER.tar
- babl-meson-log.tar
- gegl-meson-log.tar
expire_in: 2 hours
gimp-snap:
extends: .snap
needs: ["deps-snap"]
stage: build
variables:
GIT_SUBMODULE_STRATEGY: recursive
script:
- sh build/linux/snap/2_build-gimp-snapcraft.sh
artifacts:
paths:
- temp*.snap
- gimp-snapcraft.log
- gimp-meson-log.tar
expire_in: 2 days
@@ -425,16 +500,20 @@ gimp-flatpak-x64:
.win:
extends: .default
rules:
#Developers (on GNOME/gimp namespace) can create multi-arch installers (.exe or .msixbundle)
#Non developers (e.g. on MRs), however, can create x64-only installers (.exe or .msix)
- if: '$RUNNER == "windows-aarch64" && $CI_PROJECT_NAMESPACE != "GNOME"'
when: never
- if: '$CI_MERGE_REQUEST_LABELS =~ /.*Package:Windows Installer.*/ && $CI_MERGE_REQUEST_LABELS =~ /.*Package:Microsoft Store.*/'
interruptible: true
variables:
INSTALLER_OPTION: '-Dwindows-installer=true'
STORE_OPTION: '-Dms-store=true'
- if: '$CI_MERGE_REQUEST_LABELS =~ /.*Package:Windows Installer.*/'
- if: '$CI_MERGE_REQUEST_LABELS =~ /.*Package:Windows Installer.*/ && $CI_JOB_NAME !~ /.*store.*/'
interruptible: true
variables:
INSTALLER_OPTION: '-Dwindows-installer=true'
- if: '$CI_MERGE_REQUEST_LABELS =~ /.*Package:Microsoft Store.*/ && $CI_JOB_NAME =~ /.*64.*/ && $CI_JOB_NAME !~ /.*installer.*/'
- if: '$CI_MERGE_REQUEST_LABELS =~ /.*Package:Microsoft Store.*/ && $CI_JOB_NAME !~ /.*mingw32.*/ && $CI_JOB_NAME !~ /.*installer.*/'
interruptible: true
variables:
STORE_OPTION: '-Dms-store=true'
@@ -442,10 +521,10 @@ gimp-flatpak-x64:
variables:
INSTALLER_OPTION: '-Dwindows-installer=true'
STORE_OPTION: '-Dms-store=true'
- if: '$GIMP_CI_WIN_INSTALLER != null || "$[[ inputs.distribution_pipeline ]]" =~ /.*GIMP_CI_WIN_INSTALLER.*/'
- if: '($GIMP_CI_WIN_INSTALLER != null || "$[[ inputs.distribution_pipeline ]]" =~ /.*GIMP_CI_WIN_INSTALLER.*/) && $CI_JOB_NAME !~ /.*store.*/'
variables:
INSTALLER_OPTION: '-Dwindows-installer=true'
- if: '$GIMP_CI_MS_STORE != null || "$[[ inputs.distribution_pipeline ]]" =~ /.*GIMP_CI_MS_STORE.*/ && $CI_JOB_NAME =~ /.*64.*/ && $CI_JOB_NAME !~ /.*installer.*/'
- if: '($GIMP_CI_MS_STORE != null || "$[[ inputs.distribution_pipeline ]]" =~ /.*GIMP_CI_MS_STORE.*/) && $CI_JOB_NAME !~ /.*mingw32.*/ && $CI_JOB_NAME !~ /.*installer.*/'
variables:
STORE_OPTION: '-Dms-store=true'
- <<: *CI_RELEASE
@@ -454,90 +533,85 @@ gimp-flatpak-x64:
STORE_OPTION: '-Dms-store=true'
parallel:
matrix:
- RUNNER: windows-aarch64
MSYSTEM_PREFIX: clangarm64
- RUNNER: win32-ps
MSYSTEM_PREFIX: clang64
- RUNNER: [windows-aarch64, win32-ps]
tags:
- $RUNNER
variables:
MSYS_ROOT: 'C:/msys64'
CC: cc
CXX: c++
#meson.build forces non-relocatable .pc. See: https://github.com/mesonbuild/meson/issues/14346
PKGCONF_RELOCATABLE_OPTION: '-Dpkgconfig.relocatable=true'
before_script:
# FIXME:'gimpenv' have buggy code about Windows paths. See: https://gitlab.gnome.org/GNOME/gimp/-/issues/12284
- $GIMP_PREFIX = "$PWD\_install-$MSYSTEM_PREFIX".Replace('\', '/')
timeout: 40m
- if (-not $env:MSYSTEM_PREFIX) { $env:MSYSTEM_PREFIX = if ((Get-WmiObject Win32_ComputerSystem).SystemType -like 'ARM64*') { 'clangarm64' } else { 'clang64' }}
- $GIMP_PREFIX = "$PWD\_install-$env:MSYSTEM_PREFIX"
timeout: 30m
.win_environ: &WIN_ENVIRON
# See: https://testing.developer.gimp.org/core/setup/build/windows/#prepare-for-building
- Write-Output "$([char]27)[0Ksection_start:$(Get-Date -UFormat %s -Millisecond 0):win_environ[collapsed=true]$([char]13)$([char]27)[0KPreparing build environment"
## Build-time vars
- $env:PKG_CONFIG_PATH = "$GIMP_PREFIX/lib/pkgconfig;$MSYS_ROOT/$MSYSTEM_PREFIX/lib/pkgconfig;$MSYS_ROOT/$MSYSTEM_PREFIX/share/pkgconfig"
- $env:XDG_DATA_DIRS = "$GIMP_PREFIX/share;$MSYS_ROOT/$MSYSTEM_PREFIX/share"
- $env:PKG_CONFIG_PATH = "$GIMP_PREFIX/lib/pkgconfig;$env:MSYS_ROOT/$env:MSYSTEM_PREFIX/lib/pkgconfig;$env:MSYS_ROOT/$env:MSYSTEM_PREFIX/share/pkgconfig"
- $env:XDG_DATA_DIRS = "$GIMP_PREFIX/share;$env:MSYS_ROOT/$env:MSYSTEM_PREFIX/share"
## Runtime vars
- $env:PATH = "$GIMP_PREFIX/bin;$MSYS_ROOT/$MSYSTEM_PREFIX/bin;" + $env:PATH
- $env:GI_TYPELIB_PATH = "$GIMP_PREFIX/lib/girepository-1.0;$MSYS_ROOT/$MSYSTEM_PREFIX/lib/girepository-1.0"
- $env:PATH = "$GIMP_PREFIX/bin;$env:MSYS_ROOT/$env:MSYSTEM_PREFIX/bin;$env:PATH"
- $env:GI_TYPELIB_PATH = "$GIMP_PREFIX/lib/girepository-1.0;$env:MSYS_ROOT/$env:MSYSTEM_PREFIX/lib/girepository-1.0"
- Write-Output "$([char]27)[0Ksection_end:$(Get-Date -UFormat %s -Millisecond 0):win_environ$([char]13)$([char]27)[0K"
deps-win:
extends: .win
stage: dependencies
script:
- build/windows/1_build-deps-msys2.ps1
- build\windows\1_build-deps-msys2.ps1
artifacts:
paths:
- _install-$MSYSTEM_PREFIX/
- babl/_build-$MSYSTEM_PREFIX/meson-logs/meson-log.txt
- gegl/_build-$MSYSTEM_PREFIX/meson-logs/meson-log.txt
- _install-*/
- babl/_build-*/meson-logs/meson-log.txt
- gegl/_build-*/meson-logs/meson-log.txt
expire_in: 2 hours
gimp-win:
extends: .win
needs: ["deps-win"]
stage: gimp
needs:
- job: deps-win
#to allow running outside 'GNOME/gimp' namespace (on MRs)
optional: true
stage: build
variables:
GIT_SUBMODULE_STRATEGY: recursive
script:
- build/windows/2_build-gimp-msys2.ps1
- build\windows\2_build-gimp-msys2.ps1
artifacts:
paths:
- gimp-$MSYSTEM_PREFIX/
- _build-$MSYSTEM_PREFIX/meson-logs/meson-log.txt
- _build-$MSYSTEM_PREFIX/done-dll.list
- gimp-*/
- _build-*/meson-logs/meson-log.txt
- _build-*/done-dll.list
# Needed by dist-installer-weekly and dist-store-weekly
- _build-$MSYSTEM_PREFIX/config.h
- _build-$MSYSTEM_PREFIX/build/windows/installer/
- _build-$MSYSTEM_PREFIX/build/windows/store/
- _build-*/config.h
- _build-*/plug-ins/file_associations.list
- _build-*/build/windows/installer/
- _build-*/build/windows/store/
expire_in: 2 days
## WINDOWS x86 legacy CI (native MSYS2) ##
.win-x86:
.win-eol:
extends: .win
rules:
- !reference [.win, rules]
- if: '$GIMP_CI_MSYS2_WIN32 != null'
parallel:
matrix:
- RUNNER: win32-ps
MSYSTEM_PREFIX: mingw32
- RUNNER: [win32-ps]
variables:
MSYSTEM_PREFIX: mingw32
MINGW_PACKAGE_PREFIX: mingw-w64-i686
CC: cc
CXX: c++
deps-win-x86:
extends: .win-x86
deps-win-eol:
extends: .win-eol
stage: !reference [deps-win, stage]
script:
- !reference [deps-win, script]
artifacts: !reference [deps-win, artifacts]
gimp-win-x86:
extends: .win-x86
needs: ["deps-win-x86"]
gimp-win-eol:
extends: .win-eol
needs: ["deps-win-eol"]
stage: !reference [gimp-win, stage]
variables:
GIT_SUBMODULE_STRATEGY: recursive
@@ -552,22 +626,18 @@ gimp-win-x86:
file-plug-in-tests:
# FIXME: Do we need another job testing this under Windows? MSYS2 usually has
# the latest deps. It might be a good idea to test that too, maybe weekly?
extends: .debian-x64
extends: .debian-nonreloc
rules:
# Don't run on release since the plug-in doesn't get installed in releases
- <<: *CI_MERGE
- <<: *CI_COMMIT
needs: ["gimp-debian-x64"]
needs: ["gimp-debian-nonreloc"]
stage: analysis
variables:
GIT_STRATEGY: none
GIMP_TESTS_DATA_FOLDER: "$CI_PROJECT_DIR/_data/gimp-test-images/"
GIMP_TESTS_LOG_FILE: "$CI_PROJECT_DIR/_log/import-tests.log"
REGRESSION_STRING: "Total number of regressions: 0"
cache:
key: $CI_JOB_NAME
paths:
- _data
script:
- API_VER=$(grep GIMP_PKGCONFIG_VERSION _build*/config.h | head -1 | sed 's/^.*"\([^"]*\)"$/\1/')
- APP_VER=$(grep GIMP_APP_VERSION _build*/config.h | head -1 | sed 's/^.*"\([^"]*\)"$/\1/')
@@ -581,7 +651,7 @@ file-plug-in-tests:
- cd ..
- cat ${PLUG_IN_DIR}test-file-plug-ins/batch-import-tests.py | gimp-console-${APP_VER} -idf --batch-interpreter python-fu-eval -b - --quit
- if [ $(grep -c "${REGRESSION_STRING}" "${GIMP_TESTS_LOG_FILE}") -ne 1 ]; then
echo "There are file import regressions. Check the log at ${GIMP_TESTS_LOG_FILE}!";
printf "There are file import regressions. Check the log at ${GIMP_TESTS_LOG_FILE}!\n";
exit 1;
fi
# FIXME No export testing for now until it's more developed. A limited test
@@ -592,6 +662,7 @@ file-plug-in-tests:
reports:
junit: "_log/import-tests.xml"
expire_in: 2 days
timeout: 30m
meson-health:
extends: .default
@@ -599,10 +670,13 @@ meson-health:
- <<: *CI_MERGE
- <<: *CI_COMMIT
stage: analysis
variables:
GIT_SUBMODULE_STRATEGY: recursive
script:
- apt-get update
- apt-get install -y git
- bash .gitlab/run_meson_health_diff.sh
- apt-get update -qq
- apt-get install -qq -y --no-install-recommends git shellcheck devscripts
- sh .gitlab/run_meson_health_diff.sh
allow_failure: true
clang-format:
extends: .default
@@ -613,7 +687,7 @@ clang-format:
- apt-get update
- apt-get install -y clang-format
git
- .gitlab/run_style_check_diff.sh
- sh .gitlab/run_style_check_diff.sh
allow_failure: true
artifacts:
when: on_failure
@@ -622,6 +696,19 @@ clang-format:
- fetch_origin.log
expire_in: 2 days
branches-check:
extends: .default
rules:
- if: '$CI_PIPELINE_SOURCE == "push" && $CI_OPEN_MERGE_REQUESTS == null && $CI_COMMIT_REF_NAME == $CI_DEFAULT_BRANCH'
stage: analysis
variables:
GIT_DEPTH: "0"
script:
- apt-get update -qq
- apt-get install -qq -y --no-install-recommends git
- sh .gitlab/check_dead_branches.sh
allow_failure: true
cppcheck:
extends: .default
rules:
@@ -631,7 +718,7 @@ cppcheck:
- apt-get update
- apt-get install -y cppcheck
- cppcheck -q -j8 --enable=all --force --output-file=cppcheck.xml --xml --xml-version=2
-i _build -i babl -i gegl -i _install -i .local -i .cache -i gimp-x64 .
-i _build -i babl -i gegl -i _install .
- mkdir report
- cppcheck-htmlreport --source-dir=. --title=gimp --file=cppcheck.xml --report-dir=report
artifacts:
@@ -645,10 +732,10 @@ cppcheck:
sources-debian:
extends: .default
rules:
# Don't run on MRs since non-merged/non-upstream code can't be distributed by us
- <<: *CI_COMMIT
- if: '$GIMP_CI_SOURCES != null'
- <<: *CI_RELEASE
needs: ["gimp-debian-x64"]
needs: ["gimp-debian-nonreloc"]
stage: distribution
variables:
GIT_STRATEGY: none
@@ -667,10 +754,10 @@ sources-debian:
dev-docs:
extends: .default
rules:
# Don't run on MRs since non-merged/non-upstream code can't be distributed by us
- <<: *CI_COMMIT
- if: '$GIMP_CI_SOURCES != null'
- <<: *CI_RELEASE
needs: ["deps-debian-x64", "gimp-debian-x64"]
needs: ["deps-debian-nonreloc", "gimp-debian-nonreloc"]
stage: distribution
variables:
GIT_STRATEGY: none
@@ -728,7 +815,7 @@ dist-appimage-weekly:
needs: ["gimp-debian"]
stage: distribution
script:
- bash build/linux/appimage/3_dist-gimp-goappimage.sh
- sh build/linux/appimage/3_dist-gimp-goappimage.sh
artifacts:
expose_as: 'Linux appimage'
paths:
@@ -736,39 +823,58 @@ dist-appimage-weekly:
expire_in: 8 days
include:
project: 'GNOME/citemplates'
file: 'flatpak/flatpak_ci_initiative.yml'
project: GNOME/citemplates
file: flatpak/flatpak_ci_initiative.yml
ref: 42fbc2526a7680b6a4f284a210e63e3973ea6dae
dist-flatpak-weekly:
extends:
- .default
- .publish_nightly
rules:
- if: '$CI_MERGE_REQUEST_LABELS =~ /.*Package:Flatpak.*/'
interruptible: true
- if: '$GIMP_CI_FLATPAK != null || "$[[ inputs.distribution_pipeline ]]" =~ /.*GIMP_CI_FLATPAK.*/'
needs: ["gimp-flatpak-x64"]
- !reference [.flatpak, rules]
needs: ["gimp-flatpak"]
stage: distribution
script:
- bash build/linux/flatpak/3_dist-gimp-flatpak.sh
- sh build/linux/flatpak/3_dist-gimp-flatpakbuilder.sh
artifacts:
expose_as: 'Linux flatpak'
paths:
- build/linux/flatpak/_Output/
expire_in: 8 days
dist-snap-weekly:
extends: .default
rules:
- !reference [.snap, rules]
needs: ["gimp-snap"]
stage: distribution
image: !reference [.snap, image]
variables: !reference [.snap, variables]
script:
- sh build/linux/snap/3_dist-gimp-snapcraft.sh
artifacts:
expose_as: 'Linux snap'
paths:
- build/linux/snap/_Output/
expire_in: 8 days
dist-installer-weekly:
extends: .default
rules:
- !reference [.win, rules]
needs: ["gimp-win", "gimp-win-x86"]
needs:
- job: gimp-win
#to allow running outside 'GNOME/gimp' namespace (on MRs)
optional: true
- job: gimp-win-eol
stage: distribution
tags:
- windows-aarch64
- win32-ps
variables:
MSYS_ROOT: 'C:/msys64'
script:
- build/windows/installer/3_dist-gimp-inno.ps1
- build\windows\installer\3_dist-gimp-inno.ps1
artifacts:
expose_as: 'Windows exe'
paths:
@@ -779,11 +885,11 @@ dist-installer-weekly:
dist-store-weekly:
extends: .default
rules:
- if: '$CI_MERGE_REQUEST_LABELS =~ /.*Package:Microsoft Store.*/'
interruptible: true
- if: '$GIMP_CI_MS_STORE != null || "$[[ inputs.distribution_pipeline ]]" =~ /.*GIMP_CI_MS_STORE.*/'
- <<: *CI_RELEASE
needs: ["gimp-win"]
- !reference [.win, rules]
needs:
- job: gimp-win
#to allow running outside 'GNOME/gimp' namespace (on MRs)
optional: true
stage: distribution
tags:
- win32-ps

View File

@@ -0,0 +1,42 @@
#!/bin/sh
printf "\e[0Ksection_start:`date +%s`:branch_check[collapsed=false]\r\e[0KChecking for dead branches\n"
git branch -r | grep -v 'origin/HEAD' | grep -v "origin/$CI_DEFAULT_BRANCH" | while IFS= read remote_branch; do
remote_branch=$(printf "%s\n" "$remote_branch" | sed 's/^ *//;s/ *$//')
branch_name=$(printf "%s\n" "$remote_branch" | sed 's|origin/||')
# NOT CHECKING
## Skip old stable branches
if echo "$branch_name" | grep -q "^gimp-[0-9]-" || [ "$branch_name" = "gnome-2-2" ] || [ "$branch_name" = "gnome-2-4" ]; then
printf "\033[33m(SKIP)\033[0m: $branch_name is a snapshot of $CI_DEFAULT_BRANCH but no problem\n"
continue
fi
## Skip recently created branches
if [ "$(git rev-parse "$remote_branch")" = "$(git rev-parse "$CI_COMMIT_SHA")" ]; then
printf "\033[33m(SKIP)\033[0m: $branch_name is identical to $CI_DEFAULT_BRANCH but no problem\n"
continue
fi
# CHECKING
## Check: merge-base
if git merge-base --is-ancestor "$remote_branch" "$CI_COMMIT_SHA"; then
printf "\033[31m(ERROR)\033[0m: $branch_name is fully merged into $CI_DEFAULT_BRANCH (via git merge-base)\n"
touch 'dead_branch'
continue
fi
## Fallback check: cherry
cherry_output=$(git cherry "$CI_COMMIT_SHA" "$remote_branch")
if [ -z "$(printf "%s\n" "$cherry_output" | grep '^+')" ]; then
printf "\033[31m(ERROR)\033[0m: $branch_name is fully merged into $CI_DEFAULT_BRANCH (via git cherry)\n"
touch 'dead_branch'
continue
fi
done
if [ -f "dead_branch" ]; then
printf " Please delete the merged branches\n"
exit 1
else
printf '(INFO): All branches are organized.\n'
fi
printf "\e[0Ksection_end:`date +%s`:branch_check\r\e[0K\n"

View File

@@ -1,16 +1,8 @@
<!-- ⚠️ 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.
For feature requests, performance issues and security reports, 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
**Code of Conduct**: "Be considerate and respectful" is our main rule.
E.g. avoid negative emotional writing which only generates more upsetting
interactions. Thanks!
-->
It is important that you fill all the fields of the template. -->
### Environment/Versions
@@ -19,14 +11,21 @@ interactions. Thanks!
- Operating System: <!--[Windows? macOS? Linux? All? Add OS versions too] (write it after the > symbol) -->
- (if Linux) Display system: <!--[X11? Wayland? Which compositor and version?] (write it after the > symbol) -->
<!--Note: bug reporters are expected to have verified the bug still exists
<!-- Note: you are expected to have verified the bug still exists
either in the last stable version of GIMP or on updated development code
(master branch).-->
(master branch).
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 -->
### Description of the bug
<!--Please describe your issue with details.
Add full (not cropped) screenshots or other files if needed.(write it after the > symbol)-->
<!-- Please describe your issue with details. By "details" we mean:
- "Be considerate and respectful". This is our main rule.
E.g. avoid negative emotional writing which only generates more upsetting
interactions.
- Stay on topic by writing only one bug per report created.
- Add full (not cropped) screenshots or other files using the clip button on GitLab. -->
### Reproduction

View File

@@ -1,4 +1,8 @@
**Operating System:** <!--[Windows? macOS? Linux? All?] (write it after the > symbol) -->
<!-- ⚠️ IMPORTANT: READ ME! ⚠️
This is the template for feature requests.
For bug reports, performance issues and security reports, 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. -->
### Description of the feature
@@ -15,3 +19,5 @@
<!-- 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 -->
/label ~"1. Feature"

View File

@@ -1,14 +1,21 @@
<!-- ⚠️ IMPORTANT: READ ME! ⚠️
This is the template for performance issues.
For bug reports, feature requests and security reports, 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. -->
### Environment/Versions
- GIMP Version:
- GIMP version number:
- 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) -->
- Operating System: <!--[Windows? macOS? Linux? All? Add OS versions too] (write it after the > symbol) -->
- (if Linux) Display system: <!--[X11? Wayland? Which compositor and version?] (write it after the > symbol) -->
<!-- Note: bug reporters are expected to have verified the bug still exists
<!-- Note: you are expected to have verified the performance issue still exists
either in the last stable version of GIMP or on updated development code
(master branch). -->
### Issue Description
### Description of the performance issue
<!-- Please provide a general description of the issue. -->
@@ -25,9 +32,9 @@ For more information, see
<!-- Please describe in detail the actions performed in the performance log.
If you added empty event markers to the log, please provide a description for them here.
If you recorded a screencast while recording the log, please attach it here. -->
If you recorded a screencast while recording the log, please attach it here. -->
### Additional Information
### Additional information
<!-- If there is any additional information, please provide it here. -->

View File

@@ -0,0 +1,31 @@
<!-- ⚠️ IMPORTANT: READ ME! ⚠️
This is the template for security reports.
For bug reports, feature requests and 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. -->
### Environment/Versions
- GIMP version number:
- Package: <!--[flatpak? Installer from gimp.org? If another installer, tell us where from] (write it after the > symbol)-->
- Operating System: <!--[Windows? macOS? Linux? All? Add OS versions too] (write it after the > symbol) -->
- (if Linux) Display system: <!--[X11? Wayland? Which compositor and version?] (write it after the > symbol) -->
<!-- Note: you are expected to have verified the security issue still exists
either in the last stable version of GIMP or on updated development code
(master branch). -->
### Description of the security report
<!-- Please provide a general description of the security issue (with CVE code if possible). -->
### Antivirus Log
<!-- Please attach a antivirus log or other file detailing the issue, and attach it to the report.
If you have none, at least report GIMP as false positive to the antivirus before continuing. -->
### Additional information
<!-- If there you know the culprit code, please link it here. -->
/label ~"1. Security"

View File

@@ -9,4 +9,7 @@
"*Allow commits from members who can merge to the target branch.*"
- No AI-generated contents allowed (neither code nor text, images…).
Only human created works please! -->
Only human created works please!
- You can request the devs to allow installable packages to be
generated from this MR by writing ~Package: in the comments -->

View File

@@ -1,167 +1,218 @@
#!/bin/bash
#!/bin/sh
source .gitlab/search-common-ancestor.sh
diff=$(git diff -U0 --no-color "${newest_common_ancestor_sha}" -- '*.build' '*.py' | grep -E '^\+[^+]' | sed 's/^+//')
. .gitlab/search-common-ancestor.sh
#List of commonly used utilities on Unix world
#See the context: https://gitlab.gnome.org/GNOME/gimp/-/issues/11385
coreutils_array=(
".sh"
"'sh'"
"'bash'"
"'\['"
"'arch'"
"'awk'"
"'b2sum'"
"'base32'"
"'base64'"
"'basename'"
"'basenc'"
"'cat'"
"'chcon'"
"'chgrp'"
"'chmod'"
"'chown'"
"'chroot'"
"'cksum'"
"'cmp'"
"'comm'"
"'cp'"
"'csplit'"
"'cut'"
"'date'"
"'dd'"
"'df'"
"'diff'"
"'dir'"
"'dircolors'"
"'dirname'"
"'du'"
"'echo'"
"'env'"
"'expand'"
"'expr'"
"'factor'"
"'false'"
"'find'"
"'fmt'"
"'fold'"
"'gkill'"
"'grep'"
"'groups'"
"'head'"
"'hostid'"
"'hostname'"
"'id'"
"'install'"
"'join'"
"'link'"
"'ln'"
"'logname'"
"'ls'"
"'md5sum'"
"'mkdir'"
"'mkfifo'"
"'mknod'"
"'mktemp'"
"'mv'"
"'nice'"
"'nl'"
"'nohup'"
"'nproc'"
"'numfmt'"
"'od'"
"'paste'"
"'pathchk'"
"'pinky'"
"'pr'"
"'printenv'"
"'printf'"
"'ptx'"
"'pwd'"
"'readlink'"
"'realpath'"
"'rm'"
"'rmdir'"
"'runcon'"
"'sed'"
"'seq'"
"'sha1sum'"
"'sha224sum'"
"'sha256sum'"
"'sha384sum'"
"'sha512sum'"
"'shred'"
"'shuf'"
"'sleep'"
"'sort'"
"'split'"
"'stat'"
"'stdbuf'"
"'stty'"
"'sum'"
"'sync'"
"'tac'"
"'tail'"
"'tee'"
"'test'"
"'timeout'"
"'touch'"
"'tr'"
"'true'"
"'truncate'"
"'tsort'"
"'tty'"
"'uname'"
"'unexpand'"
"'uniq'"
"'unlink'"
"'users'"
"'vdir'"
"'wc'"
"'who'"
"'whoami'"
"'yes'"
)
# CHECK SCRIPTS RUNNED BY MESON (ALL OSes)
printf "\e[0Ksection_start:`date +%s`:nonunix_test[collapsed=false]\r\e[0KChecking for non-Unix compatibility\n"
diff=$(git diff -U0 --no-color --submodule=diff "${newest_common_ancestor_sha}" \
| awk '
/^diff --git a\/.*\.(build|py)/ {
sub(/^diff --git a\//, "", $0)
sub(/ b\/.*$/, "", $0)
file = $0
next
}
/^\+[^+]/ && file != "" {
print file ":" substr($0, 2)
}
')
for coreutil in "${coreutils_array[@]}"; do
## List of commonly used utilities on Unix world
## See the context: https://gitlab.gnome.org/GNOME/gimp/-/issues/11385
coreutils_list="
\.sh \
'sh' \
'bash' \
'\[' \
'arch' \
'awk' \
'b2sum' \
'base32' \
'base64' \
'basename' \
'basenc' \
'cat' \
'chcon' \
'chgrp' \
'chmod' \
'chown' \
'chroot' \
'cksum' \
'cmp' \
'comm' \
'cp' \
'csplit' \
'cut' \
'date' \
'dd' \
'df' \
'diff' \
'dir' \
'dircolors' \
'dirname' \
'du' \
'echo' \
'env' \
'expand' \
'expr' \
'factor' \
'false' \
'find' \
'fmt' \
'fold' \
'gkill' \
'grep' \
'groups' \
'head' \
'hostid' \
'hostname' \
'id' \
'install' \
'join' \
'link' \
'ln' \
'logname' \
'ls' \
'md5sum' \
'mkdir' \
'mkfifo' \
'mknod' \
'mktemp' \
'mv' \
'nice' \
'nl' \
'nohup' \
'nproc' \
'numfmt' \
'od' \
'paste' \
'pathchk' \
'pinky' \
'pr' \
'printenv' \
'printf' \
'ptx' \
'pwd' \
'readlink' \
'realpath' \
'rm' \
'rmdir' \
'runcon' \
'sed' \
'seq' \
'sha1sum' \
'sha224sum' \
'sha256sum' \
'sha384sum' \
'sha512sum' \
'shred' \
'shuf' \
'sleep' \
'sort' \
'split' \
'stat' \
'stdbuf' \
'stty' \
'sum' \
'sync' \
'tac' \
'tail' \
'tee' \
'test' \
'timeout' \
'touch' \
'tr' \
'true' \
'truncate' \
'tsort' \
'tty' \
'uname' \
'unexpand' \
'uniq' \
'unlink' \
'users' \
'vdir' \
'wc' \
'who' \
'whoami' \
'yes'
"
for coreutil in $coreutils_list; do
if echo "$diff" | grep -q "$coreutil"; then
found_coreutils+=" $coreutil"
found_coreutils="$(echo "$found_coreutils $coreutil" | sed 's|\\||g')"
fi
done
if [ "$found_coreutils" ]; then
echo -e '\033[31m(ERROR)\033[0m: Seems that you are trying to add an Unix-specific dependency to be called by Meson.'
echo " Please, port to Python (which is crossplatform), your use of:${found_coreutils}."
printf "$diff\n"
printf '\033[31m(ERROR)\033[0m: Seems that you are trying to add an Unix-specific dependency to be called by Meson.\n'
printf " Please, port to Python (which is crossplatform), your use of:${found_coreutils}.\n"
fi
#Limited list of commonly used utilities on Windows world
ntutils_array=(
".bat"
".cmd"
".ps1"
"'cmd'"
"'powershell'"
)
for ntutil in "${ntutils_array[@]}"; do
## Limited list of commonly used utilities on Windows world
ntutils_list="
\.bat \
\.cmd \
\.ps1 \
'cmd' \
'powershell'
"
for ntutil in $ntutils_list; do
if echo "$diff" | grep -q "$ntutil"; then
found_ntutils+=" $ntutil"
found_ntutils="$(echo "$found_ntutils $ntutil" | sed 's|\\||g')"
fi
done
if [ "$found_ntutils" ]; then
echo -e '\033[31m(ERROR)\033[0m: Seems that you are trying to add a NT-specific dependency to be called by Meson.'
echo " Please, port to Python (which is crossplatform), your use of:${found_ntutils}."
printf "$diff\n"
printf '\033[31m(ERROR)\033[0m: Seems that you are trying to add a NT-specific dependency to be called by Meson.\n'
printf " Please, port to Python (which is crossplatform), your use of:${found_ntutils}.\n"
fi
if [ -z "$found_coreutils" ] && [ -z "$found_ntutils" ]; then
printf '(INFO): Meson .build and .py files are alright regarding being crossplatform.\n'
fi
printf "\e[0Ksection_end:`date +%s`:nonunix_test\r\e[0K\n"
if [ "$found_coreutils" ] || [ "$found_ntutils" ]; then
# CHECK SCRIPTS NOT RUN BY MESON (UNIX ONLY)
# Shell scripts have potential portability issues if:
# 1) contain bash shebang or are called by bash;
# 2) contain bashisms.
printf "\e[0Ksection_start:`date +%s`:unix_test[collapsed=false]\r\e[0KChecking for Unix portability (optional)\n"
diff=$(git diff -U0 --no-color --submodule=diff "${newest_common_ancestor_sha}" \
| awk '
/^diff --git a\// {
sub(/^diff --git a\//, "", $0)
sub(/ b\/.*$/, "", $0)
file = $0
next
}
/^\+[^+]/ && file != "" {
print file ":" substr($0, 2)
}
')
## Check shebang and external call (1)
echo "$diff" | grep -E '#!\s*/usr/bin/env\s+bash|#!\s*/(usr/bin|bin)/bash(\s|$)' && found_bashism='extrinsic_bashism'
echo "$diff" | grep -E "bash\s+.*\.sh" && found_bashism='extrinsic_bashism'
## Check content with shellcheck and checkbashisms (2)
for sh_script in $(find "$CI_PROJECT_DIR" -type d -name .git -prune -o -type f \( ! -name '*.ps1' ! -name '*.c' -exec grep -lE '^#!\s*/usr/bin/env\s+(sh|bash)|^#!\s*/(usr/bin|bin)/(sh|bash)(\s|$)' {} \; -o -name '*.sh' ! -exec grep -q '^#!' {} \; -print \)); do
shellcheck --severity=warning --shell=sh -x "$sh_script" | grep -v 'set option posix is' | grep -vE '.*http.*SC[0-9]+.*POSIX' | grep --color=always -B 2 -E 'SC[0-9]+.*POSIX' && found_bashism='intrinsic_bashism'
checkbashisms -f $sh_script || found_bashism='intrinsic_bashism'
done
if [ "$found_bashism" ]; then
printf '\033[33m(WARNING)\033[0m: Seems that you added a Bash-specific code (aka "bashism").\n'
printf " It is recommended to make it POSIX-compliant (which is portable).\n"
else
printf '(INFO): Shell .sh files are alright regarding being portable.\n'
fi
printf "\e[0Ksection_end:`date +%s`:unix_test\r\e[0K\n"
if [ "$found_coreutils" ] || [ "$found_ntutils" ] || [ "$found_bashism" ]; then
exit 1
fi
echo 'Meson .build files are alright regarding crossplatform.'
exit 0

View File

@@ -1,27 +1,25 @@
#!/bin/bash
set -e
#!/bin/sh
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"
echo "https://developer.gimp.org/core/coding_style/"
clang-format --version
# Wrap everything in a subshell so we can propagate the exit status.
(
source .gitlab/search-common-ancestor.sh
. .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}
[ ${exit_status} = 0 ] || exit ${exit_status}
format_diff="$(<format-diff.log)"
format_diff="$(cat format-diff.log)"
if [ -n "${format_diff}" ]; then
cat format-diff.log

View File

@@ -1,6 +1,4 @@
#!/bin/bash
set -e
#!/bin/sh
ancestor_horizon=28 # days (4 weeks)
@@ -14,7 +12,7 @@ ancestor_horizon=28 # days (4 weeks)
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
git fetch --shallow-since="$(date --date="${ancestor_horizon} days ago" +%Y-%m-%d)" upstream > ./fetch_upstream.log 2>&1
# 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
@@ -28,10 +26,12 @@ git fetch --shallow-since="$(date --date="${ancestor_horizon} days ago" +%Y-%m-%
git remote add patch-origin ${CI_MERGE_REQUEST_SOURCE_PROJECT_URL:-${CI_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)" patch-origin "${source_branch}" &> ./fetch_origin.log
git fetch --shallow-since="$(date --date="${ancestor_horizon} days ago" +%Y-%m-%d)" patch-origin "${source_branch}" > ./fetch_origin.log 2>&1
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 "patch-origin/${source_branch}") | head -1)
if [ -z "${newest_common_ancestor_sha}" ]; then
git rev-list --first-parent "upstream/${CI_MERGE_REQUEST_TARGET_BRANCH_NAME:-gimp-3-0}" > "temp_upstream" 2>&1
git rev-list --first-parent "patch-origin/${source_branch}" > "temp_patch-origin" 2>&1
newest_common_ancestor_sha=$(diff --old-line-format='' --new-line-format='' "temp_upstream" "temp_patch-origin" | head -n 1)
if [ -z "${newest_common_ancestor_sha}" ] || [ "${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."

View File

@@ -244,7 +244,7 @@ help in that regard:
Package Name Version
appstream-glib @APPSTREAM_GLIB_REQUIRED_VERSION@
appstream @APPSTREAM_REQUIRED_VERSION@
ATK @ATK_REQUIRED_VERSION@
babl @BABL_REQUIRED_VERSION@
cairo @CAIRO_REQUIRED_VERSION@
@@ -281,10 +281,12 @@ help in that regard:
Package Name Version Feature
bison - Image Map plug-in
cairo-pdf @CAIRO_PDF_REQUIRED_VERSION@ PDF export
cfitsio - FITS
iso-codes - Language selection
ExcHndl - Crash logs on Windows with Dr. MinGW
flex - Image Map plug-in
gs - ghostscript
libaa - ASCII art
libheif @LIBHEIF_REQUIRED_VERSION@ HEIF (HEIC, AVIF)

233
NEWS
View File

@@ -6,6 +6,239 @@
This is the development branch of GIMP.
Overview of Changes from GIMP 3.0.4 to GIMP 3.0.6
=================================================
This is a mostly bug-fix release.
Core:
- Many false-positive build warnings have been cleaned out (and proper
issues fixed).
- Various crashes fixed.
- When creating a layer mask from the layer's alpha, but the layer has
no alpha, simply fill the mask with complete opacity instead of
a completely transparent layer.
- Various core infrastructure code reviewed, cleaned up, refactored
and improved, in drawable, layer and filter handling code, tree view
code, and more.
- GIMP_ICONS_LIKE_A_BOSS environment variable is not working anymore
(because "gtk-menu-images" and "gtk-button-images" have been
deprecated in GTK3 and removed in GTK4) and was therefore removed.
- Lock Content now shows as an undo step.
- Add alpha channel for certain transforms.
- Add alpha channel on filter merge, when necessary.
- Filters can now be applied non-destructively on channels.
- Improved Photoshop brush support.
- After deleting a palette entry, the next entry is automatically
selected. This allows easily deleting several entries in a row,
among other usage.
- Resize image to layers irrespective to selections.
- Improved in-GUI release notes' demo script language:
* We can now set a button value to click it:
"toolbox:text,
tool-options:outline=1,
tool-options:outline-direction"
* Color selector's module names can be used as identifiers:
"color-editor,color-editor:CMYK=1,color-editor:total-ink-coverage"
- Fixed Alpha to Selection on single layers with no transparency.
- Various code is slowly ported to newer code, preparing for GTK4 port
(in an unplanned future step):
* Using g_set_str() (optionally redefining it in our core code to
avoid bumping the GLib minimum requirement).
* Start using GListModel in various pieces of code, in particular
getting rid of more and more usage of GtkTreeView when possible
(as it will be deprecated with GTK4).
* New GimpRow class for all future row widgets.
* Use more of G_DECLARE_DERIVABLE_TYPE and G_DECLARE_FINAL_TYPE
where relevant.
* New GimpContainerListView using a GtkListBox.
* New GimpRowSeparator, GimpRowSettings, GimpRowFilter and
GimpRowDrawableFilter widgets.
- (Experimental) GEX Format was updated.
- Palette import:
* Set alpha value for image palette imports.
* Fix Lab & CMYK ACB palette import.
* Add palette format filters to import dialog, making it more
apparent what palette formats are supported, and giving the
ability to hide irrelevant files.
- Improved filter actions' sensitivity to make sure they are set
insensitive when relevant. In particular filters which cannot be run
non-destructively (e.g. filters with aux inputs, non-interactive
filters and GEGL Graph) must be insensitive when trying to run them
on group layers.
- Fix bad axis centering on zoom out.
- Export better SVG when exporting paths.
Tools:
- Text tool: make sure the default color is only changed when the user
confirms the color change.
- Foreground Selection tool: do not create a selection when no strokes
has been made. In particular this removes the unnecessary delay
which happened when switching to another tool without actually
stroking anything.
- All Transform tools: transform boundaries for preview is now
multi-layers aware.
- (Experimental) Seamless Clone tool: made to work again, though it is
still too slow to get out of Playground.
Graphical User Interface:
- Various improvements to window management:
* Keep-Above windows are set with the Utility hint.
* Utility windows are not made transient to a parent.
* Transient factory dialogs follow the active display, ensuring that
new image windows would not hide your toolbox and dock windows.
- Various CSS improvements for styling of the interface. Some theme
leaks were also fixed.
- New toggle button in Brushes and Fonts dockable, allowing brush and
font previews to optionally follow the color theme. For instance,
when using a dark theme, the brush and font previews could be drawn
on the theme background, using the theme foreground colors. By
default, these data previews are still drawn as black on white.
- Palette grid is now drawn with the theme's background color.
- Consistent naming patterns on human-facing options (first word only
capitalized).
- About dialog:
* We will now display the date and time of the last
check in a "Up to date as of <date> at <time>" string, differing
from the "Last checked on <date> at <time>" string. The former
will be used to indicate that GIMP is indeed up-to-date whereas
the latter when a new version was released and that you should
update.
* We now respect the system time/date format on macOS and Windows.
- The search popup won't pop up without an image.
- Better zoom step algorithm for data previews in container popup
(e.g. the brush popup in paint Tool Options).
- Disable animation in the Input Controller, Preferences and Welcome
dialogs for stack transition when animation are disabled in system
settings.
- Fixed crosshair hotspot on Windows (crosshair cursor for brushes was
offset with a non-100% display scale factor).
- Debug/CRITICAL dialog:
* Make sure it is non-modal.
* Follow the theme mode under Windows.
- While loading images, all widgets in the file dialog are made
insensitive, except for the Cancel button and the progress bar.
- Both grid and list views can now zoom via scroll and zoom gestures
(it used to only work in list views).
- Pop an error message up on startup when GIO modules to read HTTPS
links are not found and that we therefore fail to load the remote
gimp_versions.json file. With the AppImage package in particular, we
depend on an environment daemon which cannot be shipped in the
package. So the next best thing is to warn people and tell them what
they should install to get version checks.
- Welcome dialog:
* The "Community Tutorials" link is now shown after the
"Documentation" link.
* The "Learn more" link in Release Notes tab leads to the actual
release news for this version.
Plug-ins:
- PDF export: do not draw disabled layer masks.
- Jigsaw: the plug-in can now draw on transparent layers.
- Various file format fixes and improvements: JPEG 2000 import, TIFF
import, DDS import, SVG import, PSP import, FITS export, ICNS
import, Dicom import, WBMP import, Farbfeld import, XWD import, ILBM
import.
- Sphere Designer: use spin scale instead of spin entries (the latter
is unusable with little horizontal space).
- Animation Play: frames are shown again in the playback progress bar.
- Vala Goat Exercise: ignoring C warning in this Vala plug-in as it is
generated code and we cannot control it.
- file-gih: brush pipe selection modes now have nice, translatable
names.
- Metadata viewer: port from GtkTreeView to GtkListBox.
- File Raw Data: reduce Raw Data load dialogue height by moving to a
2-column layout.
- SVG import: it is now possible to break aspect ratio with specific
width/height arguments, when calling the PDB procedure
non-interactively (from other plug-ins).
- Print: when run through a portal print dialog, the "Image Settings"
will be exposed as a secondary dialog, outputted after the portal
dialog, instead of a tab on the main print dialog (because it is not
possible to tweak the print dialog when it is created by a portal).
This will bring back usable workflow of printing with GIMP when run
in a sandbox (e.g. Flatpak or Snap).
- Recompose: fixed for YCbCr decomposed images.
- Fixed vulnerabilities: ZDI-CAN-27684, ZDI-CAN-27863, ZDI-CAN-27878,
ZDI-CAN-27836, ZDI-CAN-27823, ZDI-CAN-27793.
- C Source and HTML export can now be run non-interactively too (e.g.
from other plug-ins).
- Map Object: fix missing spin boxes.
- Small Tiles: fix display lag.
API:
- libgimpui:
* new function: gimp_prop_toggle_new()
* updated widget default for GimpChoice in GimpProcedureDialog: when
the number of choices is below 3, a radio frame is used, and a
combo box otherwise (it used to always be a combo box).
* GimpExportProcedureDialog: comment text area will be made
(in)sensitive depending on the checked state of "Save Comment"
option.
* Use arrows for GimpSpinScale cursors.
* GimpColorScales: no decimal for u8 RGB color selector. This change
will help further distinguish between the 0...100 and 0..255 views
in the Color Selectors.
* Internal color drags now use a "application/x-geglcolor" target
since "application/x-color" is standard and should not be used for
our more powerful color formats.
- libgimp:
* new enum type: GimpTRCType
* gimp_file_save() sets the XCF or exported files accordingly.
* Metadata:
+ Favor existing image comment instead of always loading comment
from metadata.
+ Fix handling of "charset=" in comments.
+ Better heuristic to choose the comment to export, especially
when it has been edited in the export dialog comment field.
+ XMP modification date format fix and Exif.Image.DateTime
metadata has been modernized, also adding the timezone.
- PDB/libgimp:
* Allow nullable sample points and guide types for some
functions.
* GeglParamFilePath can now be passed across the wire.
- macOS: improve dock icon flashing issue.
Build:
- CI scripts synced to latest `master` state.
- Windows file format association list is now generated at build time,
avoiding discrepancies.
- Build scripts are made POSIX-compliant for better portability across
platforms.
- New nightly Snap package.
- New nightly Aarch64 flatpak.
- Core code ported from appstream-glib to libappstream.
- Windows installer now uses the latest InnoSetup again.
- New option -Dwin-debugging=dwarf to generate DWARF symbols on
Windows (defaults to CodeView symbols).
- Compilation should work again fine with older librsvg (before the
Rust port).
- release-stats.sh script updated to generate text directly pastable
into our release news.
- CI:
* Linux builds ported from unmaintained Kaniko to Buildah.
* Colored output and .pdb support for builds of dependency using
CMake.
* Ability to apply remote patches on dependency builds.
* New job "branches-check" to warn about dead branches.
* Our Debian jobs are now built with GCC again (the CLang builds are
switched to weekly scheduled jobs).
- Clean out deprecation warnings on GLib and GTK/GDK based on our
minimum requirement of these dependencies thanks to
GLIB_VERSION_MIN_REQUIRED() and GLIB_VERSION_MAX_ALLOWED() macros
(and equivalent GDK macros).
- We now build Exiv2 ourselves on Windows as a temporary workaround to
issue #12626.
- Improved packages binary caching with ORAS for Flatpak.
- AppImage: we now depend on Debian Trixie.
Overview of Changes from GIMP 3.0.2 to GIMP 3.0.4
=================================================

View File

@@ -104,6 +104,7 @@
/* global variables */
GimpActionFactory *global_action_factory = NULL;
GHashTable *aux_filter_hash_table = NULL;
/* private variables */
@@ -270,6 +271,8 @@ actions_init (Gimp *gimp)
action_groups[i].icon_name,
action_groups[i].setup_func,
action_groups[i].update_func);
aux_filter_hash_table = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, NULL);
}
void
@@ -280,6 +283,23 @@ actions_exit (Gimp *gimp)
g_return_if_fail (global_action_factory->gimp == gimp);
g_clear_object (&global_action_factory);
g_hash_table_unref (aux_filter_hash_table);
}
/* XXX Temporary code to store the list of filter operations with an
* "aux" input. This won't be necessary anymore once these filters can
* be applied non-destructively too in the future.
*/
void
actions_filter_set_aux (const gchar *action_name)
{
g_hash_table_add (aux_filter_hash_table, (gpointer) g_strdup (action_name));
}
gboolean
actions_filter_get_aux (const gchar *action_name)
{
return g_hash_table_lookup (aux_filter_hash_table, action_name) != NULL;
}
Gimp *
@@ -490,10 +510,9 @@ action_data_sel_count (gpointer data)
{
if (GIMP_IS_CONTAINER_EDITOR (data))
{
GimpContainerEditor *editor;
GimpContainerEditor *editor = GIMP_CONTAINER_EDITOR (data);
editor = GIMP_CONTAINER_EDITOR (data);
return gimp_container_view_get_selected (editor->view, NULL, NULL);
return gimp_container_view_get_selected (editor->view, NULL);
}
else
{

View File

@@ -25,6 +25,9 @@ extern GimpActionFactory *global_action_factory;
void actions_init (Gimp *gimp);
void actions_exit (Gimp *gimp);
void actions_filter_set_aux (const gchar *action_name);
gboolean actions_filter_get_aux (const gchar *action_name);
Gimp * action_data_get_gimp (gpointer data);
GimpContext * action_data_get_context (gpointer data);
GimpImage * action_data_get_image (gpointer data);

View File

@@ -895,17 +895,16 @@ context_select_object (GimpActionSelectType select_type,
GimpContainer *container)
{
GimpObject *current;
GType child_type;
current =
gimp_context_get_by_type (context,
gimp_container_get_children_type (container));
child_type = gimp_container_get_child_type (container);
current = gimp_context_get_by_type (context, child_type);
current = action_select_object (select_type, container, current);
if (current)
gimp_context_set_by_type (context,
gimp_container_get_children_type (container),
current);
gimp_context_set_by_type (context, child_type, current);
}
static gint

View File

@@ -68,7 +68,7 @@ data_open_as_image_cmd_callback (GimpAction *action,
data = (GimpData *)
gimp_context_get_by_type (context,
gimp_data_factory_view_get_children_type (view));
gimp_data_factory_view_get_child_type (view));
if (data && gimp_data_get_file (data))
{
@@ -119,7 +119,7 @@ data_new_cmd_callback (GimpAction *action,
GtkWidget *edit_button;
gimp_context_set_by_type (context,
gimp_data_factory_view_get_children_type (view),
gimp_data_factory_view_get_child_type (view),
GIMP_OBJECT (data));
edit_button = gimp_data_factory_view_get_edit_button (view);
@@ -142,7 +142,7 @@ data_duplicate_cmd_callback (GimpAction *action,
data = (GimpData *)
gimp_context_get_by_type (context,
gimp_data_factory_view_get_children_type (view));
gimp_data_factory_view_get_child_type (view));
if (data && gimp_data_factory_view_have (view, GIMP_OBJECT (data)))
{
@@ -155,7 +155,7 @@ data_duplicate_cmd_callback (GimpAction *action,
GtkWidget *edit_button;
gimp_context_set_by_type (context,
gimp_data_factory_view_get_children_type (view),
gimp_data_factory_view_get_child_type (view),
GIMP_OBJECT (new_data));
edit_button = gimp_data_factory_view_get_edit_button (view);
@@ -178,7 +178,7 @@ data_copy_location_cmd_callback (GimpAction *action,
data = (GimpData *)
gimp_context_get_by_type (context,
gimp_data_factory_view_get_children_type (view));
gimp_data_factory_view_get_child_type (view));
if (data)
{
@@ -207,7 +207,7 @@ data_show_in_file_manager_cmd_callback (GimpAction *action,
data = (GimpData *)
gimp_context_get_by_type (context,
gimp_data_factory_view_get_children_type (view));
gimp_data_factory_view_get_child_type (view));
if (data)
{
@@ -243,7 +243,7 @@ data_delete_cmd_callback (GimpAction *action,
data = (GimpData *)
gimp_context_get_by_type (context,
gimp_data_factory_view_get_children_type (view));
gimp_data_factory_view_get_child_type (view));
if (data &&
gimp_data_is_deletable (data) &&
@@ -288,7 +288,7 @@ data_edit_cmd_callback (GimpAction *action,
data = (GimpData *)
gimp_context_get_by_type (context,
gimp_data_factory_view_get_children_type (view));
gimp_data_factory_view_get_child_type (view));
if (data && gimp_data_factory_view_have (view, GIMP_OBJECT (data)))
{

View File

@@ -174,34 +174,34 @@ drawable_actions_update (GimpActionGroup *group,
{
GimpItem *item;
if (gimp_item_get_visible (iter->data))
has_visible = TRUE;
if (gimp_item_can_lock_content (iter->data))
{
if (! gimp_item_get_lock_content (iter->data))
locked = FALSE;
can_lock = TRUE;
}
if (gimp_item_can_lock_position (iter->data))
{
if (! gimp_item_get_lock_position (iter->data))
locked_pos = FALSE;
can_lock_pos = TRUE;
}
if (gimp_viewable_get_children (GIMP_VIEWABLE (iter->data)))
none_children = FALSE;
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 (iter->data);
if (gimp_item_get_visible (item))
has_visible = TRUE;
if (gimp_item_can_lock_content (item))
{
if (! gimp_item_get_lock_content (item))
locked = FALSE;
can_lock = TRUE;
}
if (gimp_item_can_lock_position (item))
{
if (! gimp_item_get_lock_position (item))
locked_pos = FALSE;
can_lock_pos = TRUE;
}
if (gimp_viewable_get_children (GIMP_VIEWABLE (item)))
none_children = FALSE;
if (! gimp_drawable_is_rgb (iter->data))
all_rgb = FALSE;
if (gimp_item_is_content_locked (item, NULL))
all_writable = FALSE;

View File

@@ -59,6 +59,7 @@ static void file_actions_last_opened_update (GimpContainer *container,
static void file_actions_last_opened_reorder (GimpContainer *container,
GimpImagefile *unused1,
gint unused2,
gint unused3,
GimpActionGroup *group);
static void file_actions_close_all_update (GimpContainer *images,
GimpObject *unused,
@@ -434,6 +435,7 @@ static void
file_actions_last_opened_reorder (GimpContainer *container,
GimpImagefile *unused1,
gint unused2,
gint unused3,
GimpActionGroup *group)
{
file_actions_last_opened_update (container, unused1, group);

View File

@@ -29,6 +29,7 @@
#include "core/gimp-filter-history.h"
#include "core/gimpimage.h"
#include "core/gimpgrouplayer.h"
#include "core/gimplayermask.h"
#include "pdb/gimpprocedure.h"
@@ -36,6 +37,7 @@
#include "widgets/gimpaction.h"
#include "widgets/gimpactiongroup.h"
#include "widgets/gimphelp-ids.h"
#include "widgets/gimpstringaction.h"
#include "widgets/gimpuimanager.h"
#include "widgets/gimpwidgets-utils.h"
@@ -48,11 +50,12 @@
/* local function prototypes */
static void filters_actions_set_tooltips (GimpActionGroup *group,
const GimpStringActionEntry *entries,
gint n_entries);
static void filters_actions_history_changed (Gimp *gimp,
GimpActionGroup *group);
static void filters_actions_set_tooltips (GimpActionGroup *group,
const GimpStringActionEntry *entries,
gint n_entries);
static void filters_actions_history_changed (Gimp *gimp,
GimpActionGroup *group);
static gboolean filters_is_non_interactive (const gchar *action_name);
/* private variables */
@@ -748,6 +751,7 @@ static const GimpEnumActionEntry filters_repeat_actions[] =
void
filters_actions_setup (GimpActionGroup *group)
{
static gboolean first_setup = TRUE;
GimpProcedureActionEntry *entries;
gint n_entries;
gint i;
@@ -776,6 +780,21 @@ filters_actions_setup (GimpActionGroup *group)
filters_actions_set_tooltips (group, filters_interactive_actions,
G_N_ELEMENTS (filters_interactive_actions));
/* XXX Hardcoded list to prevent expensive node/graph creation of a
* well-known list of operations.
* This whole code will disappear when we'll support filters with aux
* input non-destructively anyway.
*/
if (first_setup)
{
actions_filter_set_aux ("filters-variable-blur");
actions_filter_set_aux ("filters-oilify");
actions_filter_set_aux ("filters-lens-blur");
actions_filter_set_aux ("filters-gaussian-blur-selective");
actions_filter_set_aux ("filters-displace");
actions_filter_set_aux ("filters-bump-map");
}
gegl_actions = g_strv_builder_new ();
op_classes = gimp_gegl_get_op_classes ();
@@ -858,6 +877,23 @@ filters_actions_setup (GimpActionGroup *group)
g_free (short_label);
}
/* Identify third-party filters based on operations with an
* auxiliary pad in first setup because of slowness on Windows.
* See #14781.
*/
if (first_setup)
{
GeglNode *node = gegl_node_new ();
gegl_node_set (node,
"operation", op_class->name,
NULL);
if (gegl_node_has_pad (node, "aux"))
actions_filter_set_aux (action_name);
g_clear_object (&node);
}
g_strv_builder_add (gegl_actions, action_name);
g_free (label);
@@ -907,6 +943,8 @@ filters_actions_setup (GimpActionGroup *group)
group, 0);
filters_actions_history_changed (group->gimp, group);
first_setup = FALSE;
}
void
@@ -914,11 +952,14 @@ filters_actions_update (GimpActionGroup *group,
gpointer data)
{
GimpImage *image;
GList *actions;
GList *iter;
gboolean writable = FALSE;
gboolean gray = FALSE;
gboolean alpha = FALSE;
gboolean supports_alpha = FALSE;
gboolean is_group = FALSE;
gboolean force_nde = FALSE;
image = action_data_get_image (data);
@@ -946,6 +987,9 @@ filters_actions_update (GimpActionGroup *group,
if (gimp_viewable_get_children (GIMP_VIEWABLE (drawable)))
is_group = TRUE;
if (GIMP_IS_GROUP_LAYER (drawable))
force_nde = TRUE;
}
g_list_free (drawables);
@@ -954,134 +998,82 @@ filters_actions_update (GimpActionGroup *group,
#define SET_SENSITIVE(action,condition) \
gimp_action_group_set_action_sensitive (group, action, (condition) != 0, NULL)
SET_SENSITIVE ("filters-alien-map", writable);
SET_SENSITIVE ("filters-antialias", writable && !is_group);
SET_SENSITIVE ("filters-apply-canvas", writable);
SET_SENSITIVE ("filters-apply-lens", writable);
SET_SENSITIVE ("filters-bayer-matrix", writable);
SET_SENSITIVE ("filters-bloom", writable);
SET_SENSITIVE ("filters-brightness-contrast", writable);
SET_SENSITIVE ("filters-bump-map", writable && !is_group);
actions = gimp_action_group_list_actions (group);
for (iter = actions; iter; iter = iter->next)
{
GimpAction *action = iter->data;
const gchar *action_name;
action_name = gimp_action_get_name (action);
if (filters_is_non_interactive (action_name))
{
/* Even I'm not sure they should, right now non-interactive
* actions are always applied destructively. So these filters
* are incompatible with layers where non-destructivity is
* mandatory.
*/
SET_SENSITIVE (action_name, writable && ! force_nde);
}
else if (GIMP_IS_STRING_ACTION (action))
{
const gchar *opname;
opname = GIMP_STRING_ACTION (action)->value;
if (opname == NULL)
/* These are the filters-recent-*, repeat and reshow handled
* below.
*/
continue;
if (g_strcmp0 (opname, "gegl:gegl") == 0)
{
/* GEGL graph filter can only be run destructively, unless
* the GIMP_ALLOW_GEGL_GRAPH_LAYER_EFFECT environment
* variable is set.
*/
SET_SENSITIVE (gimp_action_get_name (action), writable &&
(g_getenv ("GIMP_ALLOW_GEGL_GRAPH_LAYER_EFFECT") != NULL || ! force_nde));
}
else if (gegl_has_operation (opname))
{
gboolean sensitive = writable;
if (sensitive && force_nde)
/* Operations with auxiliary inputs can only be applied
* destructively. Therefore they must be deactivated on
* types of layers where filters can only be applied
* non-destructively.
*/
sensitive = ! actions_filter_get_aux (action_name);
SET_SENSITIVE (gimp_action_get_name (action), sensitive);
}
}
}
g_list_free (actions);
/* Special-cased filters */
SET_SENSITIVE ("filters-c2g", writable && !gray);
SET_SENSITIVE ("filters-cartoon", writable);
SET_SENSITIVE ("filters-channel-mixer", writable);
SET_SENSITIVE ("filters-checkerboard", writable);
SET_SENSITIVE ("filters-color-balance", writable && !gray);
SET_SENSITIVE ("filters-color-enhance", writable && !gray);
SET_SENSITIVE ("filters-color-exchange", writable);
SET_SENSITIVE ("filters-color-enhance", writable && !force_nde && !gray);
SET_SENSITIVE ("filters-colorize", writable && !gray);
SET_SENSITIVE ("filters-dither", writable);
SET_SENSITIVE ("filters-color-rotate", writable);
SET_SENSITIVE ("filters-color-temperature", writable && !gray);
SET_SENSITIVE ("filters-color-to-alpha", writable && supports_alpha);
SET_SENSITIVE ("filters-component-extract", writable);
SET_SENSITIVE ("filters-convolution-matrix", writable);
SET_SENSITIVE ("filters-cubism", writable);
SET_SENSITIVE ("filters-curves", writable);
SET_SENSITIVE ("filters-deinterlace", writable);
SET_SENSITIVE ("filters-desaturate", writable && !gray);
SET_SENSITIVE ("filters-difference-of-gaussians", writable);
SET_SENSITIVE ("filters-diffraction-patterns", writable);
SET_SENSITIVE ("filters-dilate", writable && !is_group);
SET_SENSITIVE ("filters-displace", writable && !is_group);
SET_SENSITIVE ("filters-distance-map", writable);
SET_SENSITIVE ("filters-dropshadow", writable && alpha);
SET_SENSITIVE ("filters-edge", writable && !is_group);
SET_SENSITIVE ("filters-edge-laplace", writable);
SET_SENSITIVE ("filters-edge-neon", writable);
SET_SENSITIVE ("filters-edge-sobel", writable);
SET_SENSITIVE ("filters-emboss", writable);
SET_SENSITIVE ("filters-engrave", writable);
SET_SENSITIVE ("filters-erode", writable);
SET_SENSITIVE ("filters-exposure", writable);
SET_SENSITIVE ("filters-fattal-2002", writable);
SET_SENSITIVE ("filters-focus-blur", writable);
SET_SENSITIVE ("filters-fractal-trace", writable);
SET_SENSITIVE ("filters-gaussian-blur", writable);
SET_SENSITIVE ("filters-gaussian-blur-selective", writable && !is_group);
SET_SENSITIVE ("filters-gegl-graph", writable && !is_group);
SET_SENSITIVE ("filters-grid", writable);
SET_SENSITIVE ("filters-high-pass", writable);
SET_SENSITIVE ("filters-hue-chroma", writable);
SET_SENSITIVE ("filters-hue-saturation", writable && !gray);
SET_SENSITIVE ("filters-illusion", writable);
SET_SENSITIVE ("filters-invert-linear", writable && !is_group);
SET_SENSITIVE ("filters-invert-perceptual", writable && !is_group);
SET_SENSITIVE ("filters-invert-value", writable && !is_group);
SET_SENSITIVE ("filters-image-gradient", writable);
SET_SENSITIVE ("filters-kaleidoscope", writable);
SET_SENSITIVE ("filters-lens-blur", writable && !is_group);
SET_SENSITIVE ("filters-lens-distortion", writable);
SET_SENSITIVE ("filters-lens-flare", writable);
SET_SENSITIVE ("filters-levels", writable);
SET_SENSITIVE ("filters-linear-sinusoid", writable);
SET_SENSITIVE ("filters-little-planet", writable);
SET_SENSITIVE ("filters-long-shadow", writable && alpha);
SET_SENSITIVE ("filters-mantiuk-2006", writable);
SET_SENSITIVE ("filters-maze", writable);
SET_SENSITIVE ("filters-mean-curvature-blur", writable);
SET_SENSITIVE ("filters-median-blur", writable);
SET_SENSITIVE ("filters-mono-mixer", writable && !gray);
SET_SENSITIVE ("filters-mosaic", writable);
SET_SENSITIVE ("filters-motion-blur-circular", writable);
SET_SENSITIVE ("filters-motion-blur-linear", writable);
SET_SENSITIVE ("filters-motion-blur-zoom", writable);
SET_SENSITIVE ("filters-newsprint", writable);
SET_SENSITIVE ("filters-noise-cell", writable);
SET_SENSITIVE ("filters-noise-cie-lch", writable);
SET_SENSITIVE ("filters-noise-hsv", writable && !gray);
SET_SENSITIVE ("filters-noise-hurl", writable);
SET_SENSITIVE ("filters-noise-perlin", writable);
SET_SENSITIVE ("filters-noise-pick", writable);
SET_SENSITIVE ("filters-noise-reduction", writable);
SET_SENSITIVE ("filters-noise-rgb", writable);
SET_SENSITIVE ("filters-noise-simplex", writable);
SET_SENSITIVE ("filters-noise-slur", writable);
SET_SENSITIVE ("filters-noise-solid", writable);
SET_SENSITIVE ("filters-noise-spread", writable);
SET_SENSITIVE ("filters-normal-map", writable);
SET_SENSITIVE ("filters-offset", writable);
SET_SENSITIVE ("filters-oilify", writable && !is_group);
SET_SENSITIVE ("filters-panorama-projection", writable);
SET_SENSITIVE ("filters-photocopy", writable);
SET_SENSITIVE ("filters-pixelize", writable);
SET_SENSITIVE ("filters-plasma", writable);
SET_SENSITIVE ("filters-polar-coordinates", writable);
SET_SENSITIVE ("filters-posterize", writable);
SET_SENSITIVE ("filters-recursive-transform", writable);
SET_SENSITIVE ("filters-red-eye-removal", writable && !gray);
SET_SENSITIVE ("filters-reinhard-2005", writable);
SET_SENSITIVE ("filters-rgb-clip", writable);
SET_SENSITIVE ("filters-ripple", writable);
SET_SENSITIVE ("filters-saturation", writable && !gray);
SET_SENSITIVE ("filters-semi-flatten", writable && alpha);
SET_SENSITIVE ("filters-sepia", writable && !gray);
SET_SENSITIVE ("filters-shadows-highlights", writable);
SET_SENSITIVE ("filters-shift", writable);
SET_SENSITIVE ("filters-sinus", writable);
SET_SENSITIVE ("filters-slic", writable);
SET_SENSITIVE ("filters-snn-mean", writable);
SET_SENSITIVE ("filters-softglow", writable);
SET_SENSITIVE ("filters-spherize", writable);
SET_SENSITIVE ("filters-spiral", writable);
SET_SENSITIVE ("filters-stretch-contrast", writable);
SET_SENSITIVE ("filters-stretch-contrast-hsv", writable);
SET_SENSITIVE ("filters-stress", writable);
SET_SENSITIVE ("filters-supernova", writable);
SET_SENSITIVE ("filters-threshold", writable);
SET_SENSITIVE ("filters-threshold-alpha", writable && alpha);
SET_SENSITIVE ("filters-tile-glass", writable);
SET_SENSITIVE ("filters-tile-paper", writable);
SET_SENSITIVE ("filters-tile-seamless", writable);
SET_SENSITIVE ("filters-unsharp-mask", writable);
SET_SENSITIVE ("filters-value-propagate", writable);
SET_SENSITIVE ("filters-variable-blur", writable && !is_group);
SET_SENSITIVE ("filters-video-degradation", writable);
SET_SENSITIVE ("filters-vignette", writable);
SET_SENSITIVE ("filters-waterpixels", writable);
SET_SENSITIVE ("filters-waves", writable);
SET_SENSITIVE ("filters-whirl-pinch", writable);
SET_SENSITIVE ("filters-wind", writable);
#undef SET_SENSITIVE
@@ -1303,3 +1295,19 @@ filters_actions_history_changed (Gimp *gimp,
NULL);
}
}
static gboolean
filters_is_non_interactive (const gchar *action_name)
{
gint i;
for (i = 0; i < G_N_ELEMENTS (filters_actions); i++)
if (g_strcmp0 (filters_actions[i].name, action_name) == 0)
return TRUE;
for (i = 0; i < G_N_ELEMENTS (filters_settings_actions); i++)
if (g_strcmp0 (filters_settings_actions[i].name, action_name) == 0)
return TRUE;
return FALSE;
}

View File

@@ -182,13 +182,13 @@ static const GimpActionEntry layers_actions[] =
{ "layers-text-to-vectors", GIMP_ICON_TOOL_TEXT,
NC_("layers-action", "Text to _Path"), NULL, { NULL },
NC_("layers-action", "Create paths from text layers"),
layers_text_to_vectors_cmd_callback,
layers_text_to_path_cmd_callback,
GIMP_HELP_LAYER_TEXT_TO_PATH },
{ "layers-text-along-vectors", GIMP_ICON_TOOL_TEXT,
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,
layers_text_along_path_cmd_callback,
GIMP_HELP_LAYER_TEXT_ALONG_PATH },
{ "layers-resize", GIMP_ICON_OBJECT_RESIZE,
@@ -780,8 +780,8 @@ layers_actions_update (GimpActionGroup *group,
gboolean all_visible = TRUE;
gboolean all_next_visible = TRUE;
gboolean all_masks_shown = TRUE;
gboolean all_masks_disabled = TRUE;
gboolean any_mask_shown = FALSE;
gboolean any_mask_disabled = FALSE;
gboolean all_writable = TRUE;
gboolean all_movable = TRUE;
@@ -816,10 +816,11 @@ layers_actions_update (GimpActionGroup *group,
if (gimp_layer_get_mask (iter->data))
{
have_masks = TRUE;
if (! gimp_layer_get_show_mask (iter->data))
all_masks_shown = FALSE;
if (gimp_layer_get_apply_mask (iter->data))
all_masks_disabled = FALSE;
if (gimp_layer_get_show_mask (iter->data))
any_mask_shown = TRUE;
if (! gimp_layer_get_apply_mask (iter->data))
any_mask_disabled = TRUE;
}
else
{
@@ -1082,8 +1083,8 @@ layers_actions_update (GimpActionGroup *group,
SET_SENSITIVE ("layers-mask-disable", n_selected_layers > 0 && !fs && !ac && have_masks);
SET_ACTIVE ("layers-mask-edit", n_selected_layers == 1 && have_masks && gimp_layer_get_edit_mask (layers->data));
SET_ACTIVE ("layers-mask-show", all_masks_shown);
SET_ACTIVE ("layers-mask-disable", all_masks_disabled);
SET_ACTIVE ("layers-mask-show", any_mask_shown);
SET_ACTIVE ("layers-mask-disable", any_mask_disabled);
SET_SENSITIVE ("layers-mask-selection-replace", n_selected_layers && !fs && !ac && have_masks);
SET_SENSITIVE ("layers-mask-selection-add", n_selected_layers && !fs && !ac && have_masks);

View File

@@ -39,8 +39,6 @@
#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"
@@ -447,6 +445,7 @@ layers_new_last_vals_cmd_callback (GimpAction *action,
ngettext ("New layer",
"New layers",
n_layers > 0 ? n_layers : 1));
for (iter = layers; iter || run_once ; iter = iter ? iter->next : NULL)
{
GimpLayer *parent;
@@ -492,11 +491,13 @@ layers_new_last_vals_cmd_callback (GimpAction *action,
gimp_image_add_layer (image, layer, parent, position, TRUE);
new_layers = g_list_prepend (new_layers, layer);
}
gimp_image_set_selected_layers (image, new_layers);
gimp_image_undo_group_end (image);
g_list_free (layers);
g_list_free (new_layers);
gimp_image_undo_group_end (image);
gimp_image_flush (image);
}
@@ -550,6 +551,7 @@ layers_new_group_cmd_callback (GimpAction *action,
layers = g_list_copy (layers);
n_layers = g_list_length (layers);
run_once = (n_layers == 0);
gimp_image_undo_group_start (image,
GIMP_UNDO_GROUP_LAYER_ADD,
ngettext ("New layer group",
@@ -588,11 +590,13 @@ layers_new_group_cmd_callback (GimpAction *action,
}
gimp_image_set_selected_layers (image, new_layers);
gimp_image_undo_group_end (image);
gimp_image_flush (image);
g_list_free (layers);
g_list_free (new_layers);
gimp_image_undo_group_end (image);
gimp_image_flush (image);
}
void
@@ -665,7 +669,6 @@ layers_raise_cmd_callback (GimpAction *action,
}
else
{
gimp_image_flush (image);
g_list_free (raised_layers);
return;
}
@@ -680,11 +683,10 @@ layers_raise_cmd_callback (GimpAction *action,
raised_layers = g_list_reverse (raised_layers);
for (iter = raised_layers; iter; iter = iter->next)
gimp_image_raise_item (image, iter->data, NULL);
gimp_image_flush (image);
gimp_image_undo_group_end (image);
g_list_free (raised_layers);
gimp_image_undo_group_end (image);
gimp_image_flush (image);
}
void
@@ -716,10 +718,10 @@ layers_raise_to_top_cmd_callback (GimpAction *action,
for (iter = raised_layers; iter; iter = iter->next)
gimp_image_raise_item_to_top (image, iter->data);
gimp_image_flush (image);
gimp_image_undo_group_end (image);
g_list_free (raised_layers);
gimp_image_undo_group_end (image);
gimp_image_flush (image);
}
void
@@ -746,7 +748,6 @@ layers_lower_cmd_callback (GimpAction *action,
}
else
{
gimp_image_flush (image);
g_list_free (lowered_layers);
return;
}
@@ -761,10 +762,10 @@ layers_lower_cmd_callback (GimpAction *action,
for (iter = lowered_layers; iter; iter = iter->next)
gimp_image_lower_item (image, iter->data, NULL);
gimp_image_flush (image);
gimp_image_undo_group_end (image);
g_list_free (lowered_layers);
gimp_image_undo_group_end (image);
gimp_image_flush (image);
}
void
@@ -798,10 +799,10 @@ layers_lower_to_bottom_cmd_callback (GimpAction *action,
for (iter = lowered_layers; iter; iter = iter->next)
gimp_image_lower_item_to_bottom (image, iter->data);
gimp_image_flush (image);
gimp_image_undo_group_end (image);
g_list_free (lowered_layers);
gimp_image_undo_group_end (image);
gimp_image_flush (image);
}
void
@@ -821,8 +822,7 @@ layers_duplicate_cmd_callback (GimpAction *action,
_("Duplicate layers"));
for (iter = layers; iter; iter = iter->next)
{
GimpLayer *new_layer;
GimpContainer *filters;
GimpLayer *new_layer;
new_layer = GIMP_LAYER (gimp_item_duplicate (GIMP_ITEM (iter->data),
G_TYPE_FROM_INSTANCE (iter->data)));
@@ -837,39 +837,6 @@ layers_duplicate_cmd_callback (GimpAction *action,
TRUE);
gimp_drawable_enable_resize_undo (GIMP_DRAWABLE (new_layer));
new_layers = g_list_prepend (new_layers, new_layer);
/* Import any attached layer effects */
filters = gimp_drawable_get_filters (GIMP_DRAWABLE (iter->data));
if (gimp_container_get_n_children (filters) > 0)
{
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);
@@ -922,6 +889,7 @@ layers_merge_down_cmd_callback (GimpAction *action,
g_clear_error (&error);
return;
}
gimp_image_set_selected_layers (image, layers);
g_list_free (layers);
@@ -1013,6 +981,7 @@ layers_merge_group_cmd_callback (GimpAction *action,
gimp_image_undo_group_end (image);
g_list_free (merge_layers);
gimp_image_flush (image);
}
@@ -1072,6 +1041,7 @@ layers_delete_cmd_callback (GimpAction *action,
gimp_image_undo_group_end (image);
g_list_free (removed_layers);
gimp_image_flush (image);
}
@@ -1094,18 +1064,20 @@ layers_text_discard_cmd_callback (GimpAction *action,
}
void
layers_text_to_vectors_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data)
layers_text_to_path_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data)
{
GimpImage *image;
GList *layers;
GList *iter;
gboolean path_added = FALSE;
return_if_no_layers (image, layers, data);
/* 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)
{
GimpLayer *layer = iter->data;
@@ -1122,16 +1094,20 @@ layers_text_to_vectors_cmd_callback (GimpAction *action,
gimp_image_add_path (image, path,
GIMP_IMAGE_ACTIVE_PARENT, -1, TRUE);
gimp_image_flush (image);
path_added = TRUE;
}
}
gimp_image_undo_group_end (image);
if (path_added)
gimp_image_flush (image);
}
void
layers_text_along_vectors_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data)
layers_text_along_path_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data)
{
GimpImage *image;
GList *layers;
@@ -1260,6 +1236,7 @@ layers_resize_to_image_cmd_callback (GimpAction *action,
if (g_list_length (layers) > 1)
gimp_image_undo_group_start (image, GIMP_UNDO_GROUP_ITEM_RESIZE,
_("Layers to Image Size"));
for (iter = layers; iter; iter = iter->next)
gimp_layer_resize_to_image (iter->data,
action_data_get_context (data),
@@ -1445,8 +1422,9 @@ layers_crop_to_content_cmd_callback (GimpAction *action,
break;
}
}
gimp_image_flush (image);
gimp_image_undo_group_end (image);
gimp_image_flush (image);
}
void
@@ -1574,7 +1552,6 @@ layers_mask_add_last_vals_cmd_callback (GimpAction *action,
}
gimp_image_undo_group_end (image);
gimp_image_flush (image);
}
@@ -1601,6 +1578,7 @@ layers_mask_apply_cmd_callback (GimpAction *action,
! gimp_item_is_content_locked (GIMP_ITEM (iter->data), NULL))))
break;
}
if (iter == NULL)
/* No layers or none have applicable masks. */
return;
@@ -1675,43 +1653,47 @@ layers_mask_show_cmd_callback (GimpAction *action,
GimpImage *image;
GList *layers;
GList *iter;
gboolean active = g_variant_get_boolean (value);
gboolean have_masks = FALSE;
gboolean active = g_variant_get_boolean (value);
gint n_masks = 0;
return_if_no_layers (image, layers, data);
for (iter = layers; iter; iter = iter->next)
{
if (gimp_layer_get_mask (iter->data))
{
have_masks = TRUE;
/* A bit of tricky to handle multiple and diverse layers with
* a toggle action (with only binary state).
* In non-active state, we will consider sets of both shown
* and hidden masks as ok and exits. This allows us to switch
* the action "active" state without actually changing
* individual masks state without explicit user request.
*/
if (! active && ! gimp_layer_get_show_mask (iter->data))
return;
if (active && gimp_layer_get_show_mask (iter->data))
{
/* if switching "show mask" on, and any selected layer's
* mask is already visible, bail out because that's
* exactly the logic we use in the ui for multile
* visible layer masks.
*/
return;
}
if (gimp_layer_get_show_mask (iter->data) != active)
n_masks++;
}
}
if (! have_masks)
if (n_masks == 0)
return;
gimp_image_undo_group_start (image,
GIMP_UNDO_GROUP_LAYER_ADD,
_("Show Layer Masks"));
if (n_masks > 1)
gimp_image_undo_group_start (image,
GIMP_UNDO_GROUP_LAYER_ADD,
_("Show Layer Masks"));
for (iter = layers; iter; iter = iter->next)
{
if (gimp_layer_get_mask (iter->data))
{
gimp_layer_set_show_mask (iter->data, active, TRUE);
}
gimp_layer_set_show_mask (iter->data, active, TRUE);
}
if (n_masks > 1)
gimp_image_undo_group_end (image);
gimp_image_flush (image);
gimp_image_undo_group_end (image);
}
void
@@ -1722,43 +1704,47 @@ layers_mask_disable_cmd_callback (GimpAction *action,
GimpImage *image;
GList *layers;
GList *iter;
gboolean active = g_variant_get_boolean (value);
gboolean have_masks = FALSE;
gboolean active = g_variant_get_boolean (value);
gint n_masks = 0;
return_if_no_layers (image, layers, data);
for (iter = layers; iter; iter = iter->next)
{
if (gimp_layer_get_mask (iter->data))
{
have_masks = TRUE;
/* A bit of tricky to handle multiple and diverse layers with
* a toggle action (with only binary state).
* In non-active state, we will consider sets of both enabled
* and disabled masks as ok and exits. This allows us to
* switch the action "active" state without actually changing
* individual masks state without explicit user request.
*/
if (! active && gimp_layer_get_apply_mask (iter->data))
return;
if (active && ! gimp_layer_get_apply_mask (iter->data))
{
/* if switching "disable mask" on, and any selected
* layer's mask is already disabled, bail out because
* that's exactly the logic we use in the ui for multile
* disabled layer masks.
*/
return;
}
if ((! gimp_layer_get_apply_mask (iter->data)) != active)
n_masks++;
}
}
if (! have_masks)
if (n_masks == 0)
return;
gimp_image_undo_group_start (image,
GIMP_UNDO_GROUP_LAYER_ADD,
_("Disable Layer Masks"));
if (n_masks > 1)
gimp_image_undo_group_start (image,
GIMP_UNDO_GROUP_LAYER_ADD,
_("Disable Layer Masks"));
for (iter = layers; iter; iter = iter->next)
{
if (gimp_layer_get_mask (iter->data))
{
gimp_layer_set_apply_mask (iter->data, ! active, TRUE);
}
gimp_layer_set_apply_mask (iter->data, ! active, TRUE);
}
if (n_masks > 1)
gimp_image_undo_group_end (image);
gimp_image_flush (image);
gimp_image_undo_group_end (image);
}
void
@@ -1801,10 +1787,12 @@ layers_mask_to_selection_cmd_callback (GimpAction *action,
C_("undo-type", "Intersect Masks with Selection"));
break;
}
gimp_channel_combine_items (gimp_image_get_mask (image),
masks, operation);
gimp_image_flush (image);
g_list_free (masks);
gimp_image_flush (image);
}
}
@@ -1883,8 +1871,10 @@ layers_alpha_to_selection_cmd_callback (GimpAction *action,
C_("undo-type", "Intersect Alpha with Selection"));
break;
}
gimp_channel_combine_items (gimp_image_get_mask (image),
layers, operation);
gimp_image_flush (image);
if (gimp_channel_is_empty (gimp_image_get_mask (image)))
@@ -2044,6 +2034,7 @@ layers_blend_space_cmd_callback (GimpAction *action,
gimp_image_undo_group_end (image);
g_list_free (update_layers);
gimp_image_flush (image);
}
}
@@ -2097,6 +2088,7 @@ layers_composite_space_cmd_callback (GimpAction *action,
gimp_image_undo_group_end (image);
g_list_free (update_layers);
gimp_image_flush (image);
}
}
@@ -2150,6 +2142,7 @@ layers_composite_mode_cmd_callback (GimpAction *action,
gimp_image_undo_group_end (image);
g_list_free (update_layers);
gimp_image_flush (image);
}
}
@@ -2226,6 +2219,7 @@ layers_lock_alpha_cmd_callback (GimpAction *action,
gimp_image_undo_group_start (image,
GIMP_UNDO_GROUP_LAYER_LOCK_ALPHA,
lock_alpha ? _("Lock alpha channels") : _("Unlock alpha channels"));
for (iter = layers; iter; iter = iter->next)
{
if (gimp_layer_can_lock_alpha (iter->data))
@@ -2234,6 +2228,7 @@ layers_lock_alpha_cmd_callback (GimpAction *action,
gimp_layer_set_lock_alpha (iter->data, lock_alpha, TRUE);
}
}
gimp_image_undo_group_end (image);
gimp_image_flush (image);
}
@@ -2474,7 +2469,6 @@ layers_edit_attributes_callback (GtkWidget *dialog,
gimp_layer_set_lock_alpha (layer, layer_lock_alpha, TRUE);
gimp_image_undo_group_end (image);
gimp_image_flush (image);
}
@@ -2510,6 +2504,7 @@ layers_add_mask_callback (GtkWidget *dialog,
gimp_image_undo_group_start (image,
GIMP_UNDO_GROUP_LAYER_ADD,
_("Add Layer Masks"));
for (iter = layers; iter; iter = iter->next)
{
mask = gimp_layer_create_mask (iter->data,
@@ -2532,6 +2527,7 @@ layers_add_mask_callback (GtkWidget *dialog,
gimp_image_undo_group_end (image);
gimp_image_flush (image);
gtk_widget_destroy (dialog);
}

View File

@@ -78,10 +78,10 @@ void layers_delete_cmd_callback (GimpAction *action,
void layers_text_discard_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data);
void layers_text_to_vectors_cmd_callback (GimpAction *action,
void layers_text_to_path_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data);
void layers_text_along_vectors_cmd_callback (GimpAction *action,
void layers_text_along_path_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data);

View File

@@ -101,6 +101,6 @@ libappactions = static_library('appactions',
include_directories: [ rootInclude, rootAppInclude, ],
c_args: '-DG_LOG_DOMAIN="Gimp-Actions"',
dependencies: [
gegl, gdk_pixbuf, gtk3,
gegl, gdk_pixbuf, gtk3, gexiv2,
],
)

View File

@@ -79,8 +79,17 @@ palette_editor_delete_color_cmd_callback (GimpAction *action,
if (data_editor->data_editable && editor->color)
{
GimpPalette *palette = GIMP_PALETTE (data_editor->data);
gint index;
index = gimp_palette_get_entry_position (palette, editor->color);
gimp_palette_delete_entry (palette, editor->color);
if (index >= gimp_palette_get_n_colors (palette))
index = gimp_palette_get_n_colors (palette) - 1;
gimp_palette_view_select_entry (GIMP_PALETTE_VIEW (editor->view),
gimp_palette_get_entry (palette, index));
}
}

View File

@@ -117,9 +117,7 @@ palettes_merge_callback (GtkWidget *widget,
context = gimp_container_view_get_context (editor->view);
factory = gimp_data_factory_view_get_data_factory (view);
gimp_container_view_get_selected (editor->view, &selected, NULL);
if (g_list_length (selected) < 2)
if (gimp_container_view_get_selected (editor->view, &selected) < 2)
{
gimp_message_literal (context->gimp,
G_OBJECT (editor), GIMP_MESSAGE_WARNING,

View File

@@ -46,7 +46,7 @@ static const GimpActionEntry paths_actions[] =
NC_("paths-action", "Edit Pa_th"), NULL, { NULL },
NC_("paths-action", "Edit the active path"),
paths_edit_cmd_callback,
GIMP_HELP_TOOL_VECTORS },
GIMP_HELP_TOOL_PATH },
{ "paths-edit-attributes", GIMP_ICON_EDIT,
NC_("paths-action", "_Edit Path Attributes..."), NULL, { NULL },

View File

@@ -138,7 +138,7 @@ paths_edit_cmd_callback (GimpAction *action,
}
if (GIMP_IS_VECTOR_TOOL (active_tool))
gimp_vector_tool_set_vectors (GIMP_VECTOR_TOOL (active_tool), paths->data);
gimp_vector_tool_set_path (GIMP_VECTOR_TOOL (active_tool), paths->data);
}
void
@@ -924,8 +924,8 @@ paths_import_callback (GtkWidget *dialog,
GimpImage *image,
GFile *file,
GFile *import_folder,
gboolean merge_vectors,
gboolean scale_vectors,
gboolean merge_paths,
gboolean scale_paths,
gpointer user_data)
{
GimpDialogConfig *config = GIMP_DIALOG_CONFIG (image->gimp->config);
@@ -937,8 +937,8 @@ paths_import_callback (GtkWidget *dialog,
g_object_set (config,
"path-import-path", path,
"path-import-merge", merge_vectors,
"path-import-scale", scale_vectors,
"path-import-merge", merge_paths,
"path-import-scale", scale_paths,
NULL);
if (path)

View File

@@ -57,9 +57,9 @@ void paths_merge_visible_cmd_callback (GimpAction *action,
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_selection_to_paths_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data);
void paths_fill_cmd_callback (GimpAction *action,
GVariant *value,

View File

@@ -102,7 +102,7 @@ plug_in_run_cmd_callback (GimpAction *action,
context = gimp_container_view_get_context (editor->view);
object = gimp_context_get_by_type (context,
gimp_container_get_children_type (container));
gimp_container_get_child_type (container));
args = procedure_commands_get_data_args (procedure, object);
}
@@ -119,14 +119,16 @@ plug_in_run_cmd_callback (GimpAction *action,
{
GimpItemTreeView *view = GIMP_ITEM_TREE_VIEW (data);
GimpImage *image;
GList *items;
GList *items = NULL;
image = gimp_item_tree_view_get_image (view);
if (image)
items = GIMP_ITEM_TREE_VIEW_GET_CLASS (view)->get_selected_items (image);
else
items = NULL;
{
GType item_type = GIMP_ITEM_TREE_VIEW_GET_CLASS (view)->item_type;
items = gimp_image_get_selected_items (image, item_type);
}
args = procedure_commands_get_items_args (procedure, image, items);
}

View File

@@ -289,14 +289,14 @@ procedure_commands_get_display_args (GimpProcedure *procedure,
return NULL;
}
}
else if (GIMP_IS_PARAM_SPEC_CORE_OBJECT_ARRAY (procedure->args[n_args]))
else if (gimp_value_array_length (args) > n_args &&
GIMP_IS_PARAM_SPEC_CORE_OBJECT_ARRAY (procedure->args[n_args]))
{
GimpDrawable **drawables = NULL;
gint n_drawables;
GList *iter;
gint i;
n_drawables = g_list_length (drawables_list);
drawables = g_new0 (GimpDrawable *, n_drawables + 1);

View File

@@ -166,7 +166,7 @@ templates_duplicate_cmd_callback (GimpAction *action,
gimp_container_add (container, GIMP_OBJECT (new_template));
gimp_context_set_by_type (context,
gimp_container_get_children_type (container),
gimp_container_get_child_type (container),
GIMP_OBJECT (new_template));
g_object_unref (new_template);
@@ -326,7 +326,7 @@ templates_delete_response (GtkWidget *dialog,
{
if (new_active)
gimp_context_set_by_type (delete_data->context,
gimp_container_get_children_type (delete_data->container),
gimp_container_get_child_type (delete_data->container),
new_active);
gimp_container_remove (delete_data->container,

View File

@@ -170,7 +170,7 @@ text_tool_text_to_path_cmd_callback (GimpAction *action,
{
GimpTextTool *text_tool = GIMP_TEXT_TOOL (data);
gimp_text_tool_create_vectors (text_tool);
gimp_text_tool_create_path (text_tool);
}
void
@@ -181,7 +181,7 @@ text_tool_text_along_path_cmd_callback (GimpAction *action,
GimpTextTool *text_tool = GIMP_TEXT_TOOL (data);
GError *error = NULL;
if (! gimp_text_tool_create_vectors_warped (text_tool, &error))
if (! gimp_text_tool_create_path_warped (text_tool, &error))
{
gimp_message (text_tool->image->gimp, G_OBJECT (text_tool),
GIMP_MESSAGE_ERROR,

View File

@@ -87,7 +87,8 @@ vector_toolpath_actions_update (GimpActionGroup *group,
gpointer data)
{
GimpToolPath *toolpath = GIMP_TOOL_PATH (data);
gboolean on_handle, on_curve;
gboolean on_handle;
gboolean on_curve;
gimp_tool_path_get_popup_state (toolpath, &on_handle, &on_curve);

View File

@@ -36,4 +36,5 @@ void vector_toolpath_reverse_stroke_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data);
#endif /* __VECTOR_TOOLPATH_COMMANDS_H__ */

View File

@@ -273,9 +273,9 @@ static const GimpToggleActionEntry view_toggle_actions[] =
{ "view-snap-to-vectors", NULL,
NC_("view-action", "Snap t_o Active Path"), NULL, { NULL },
NC_("view-action", "Tool operations snap to the active path"),
view_snap_to_vectors_cmd_callback,
view_snap_to_path_cmd_callback,
FALSE,
GIMP_HELP_VIEW_SNAP_TO_VECTORS },
GIMP_HELP_VIEW_SNAP_TO_PATH },
{ "view-snap-to-bbox", NULL,
NC_("view-action", "Snap to _Bounding Boxes"), NULL, { NULL },

View File

@@ -963,9 +963,9 @@ view_snap_to_canvas_cmd_callback (GimpAction *action,
}
void
view_snap_to_vectors_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data)
view_snap_to_path_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data)
{
GimpDisplayShell *shell;
gboolean active;
@@ -973,9 +973,9 @@ view_snap_to_vectors_cmd_callback (GimpAction *action,
active = g_variant_get_boolean (value);
if (active != gimp_display_shell_get_snap_to_vectors (shell))
if (active != gimp_display_shell_get_snap_to_path (shell))
{
gimp_display_shell_set_snap_to_vectors (shell, active);
gimp_display_shell_set_snap_to_path (shell, active);
}
}

View File

@@ -154,7 +154,7 @@ void view_snap_to_grid_cmd_callback (GimpAction *action,
void view_snap_to_canvas_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data);
void view_snap_to_vectors_cmd_callback (GimpAction *action,
void view_snap_to_path_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data);
void view_snap_to_bbox_cmd_callback (GimpAction *action,

View File

@@ -59,7 +59,8 @@ static void windows_actions_display_remove (GimpContainer *conta
GimpActionGroup *group);
static void windows_actions_display_reorder (GimpContainer *container,
GimpDisplay *display,
gint position,
gint old_index,
gint new_index,
GimpActionGroup *group);
static void windows_actions_image_notify (GimpDisplay *display,
const GParamSpec *unused,
@@ -336,6 +337,7 @@ windows_actions_display_remove (GimpContainer *container,
static void
windows_actions_display_reorder (GimpContainer *container,
GimpDisplay *display,
gint old_index,
gint new_index,
GimpActionGroup *group)
{

View File

@@ -530,11 +530,13 @@ app_activate_callback (GimpCoreApp *app,
gimp_signal_private (SIGINT, app_quit_on_ctrl_c, 0);
#endif
g_printf ("\n== %s ==\n%s\n\n%s\n",
/* TODO: localize when string freeze is over. */
"INFO",
"GIMP is now running as a background process. "
"You can quit anytime with Ctrl-C (SIGINT).",
"If you wanted to quit immediately instead, call GIMP with --quit.");
/* TRANSLATORS: title for info message in terminal window */
_("INFO"),
/* TRANSLATORS: info message displayed in terminal window. */
_("GIMP is now running as a background process. "
"You can quit anytime with Ctrl-C (SIGINT)."),
/* TRANSLATORS: info message displayed in terminal window. */
_("If you wanted to quit immediately instead, call GIMP with --quit."));
g_application_hold (G_APPLICATION (app));
}
}

View File

@@ -56,4 +56,32 @@ typedef struct _GimpTemplate GimpTemplate;
#define gimp_assert_not_reached g_assert_not_reached
#if ! GLIB_CHECK_VERSION(2, 76, 0)
/* Function copied from GLib 2.76.0 and made available privately so that
* we don't have to bump our dependency requirement.
*
* TODO: remove this when GLib requirement moves over 2.76.
*/
static inline gboolean g_set_str (char **str_pointer,
const char *new_str);
static inline gboolean
g_set_str (char **str_pointer,
const char *new_str)
{
char *copy;
if (*str_pointer == new_str ||
(*str_pointer && new_str && strcmp (*str_pointer, new_str) == 0))
return FALSE;
copy = g_strdup (new_str);
g_free (*str_pointer);
*str_pointer = copy;
return TRUE;
}
#endif
#endif /* __CONFIG_TYPES_H__ */

View File

@@ -909,9 +909,9 @@ gimp_core_config_finalize (GObject *object)
g_free (core_config->plug_in_rc_path);
g_free (core_config->import_raw_plug_in);
g_clear_pointer (&core_config->last_known_release, g_free);
g_clear_pointer (&core_config->last_known_release, g_free);
g_clear_pointer (&core_config->last_release_comment, g_free);
g_clear_pointer (&core_config->config_version, g_free);
g_clear_pointer (&core_config->config_version, g_free);
g_clear_object (&core_config->default_image);
g_clear_object (&core_config->default_grid);
@@ -932,12 +932,12 @@ gimp_core_config_set_property (GObject *object,
switch (property_id)
{
case PROP_LANGUAGE:
g_free (core_config->language);
core_config->language = g_value_dup_string (value);
g_set_str (&core_config->language,
g_value_get_string (value));
break;
case PROP_PREV_LANGUAGE:
g_free (core_config->prev_language);
core_config->prev_language = g_value_dup_string (value);
g_set_str (&core_config->prev_language,
g_value_get_string (value));
break;
case PROP_INTERPOLATION_TYPE:
core_config->interpolation_type = g_value_get_enum (value);
@@ -946,116 +946,116 @@ gimp_core_config_set_property (GObject *object,
core_config->default_threshold = g_value_get_int (value);
break;
case PROP_PLUG_IN_PATH:
g_free (core_config->plug_in_path);
core_config->plug_in_path = g_value_dup_string (value);
g_set_str (&core_config->plug_in_path,
g_value_get_string (value));
break;
case PROP_MODULE_PATH:
g_free (core_config->module_path);
core_config->module_path = g_value_dup_string (value);
g_set_str (&core_config->module_path,
g_value_get_string (value));
break;
case PROP_INTERPRETER_PATH:
g_free (core_config->interpreter_path);
core_config->interpreter_path = g_value_dup_string (value);
g_set_str (&core_config->interpreter_path,
g_value_get_string (value));
break;
case PROP_ENVIRON_PATH:
g_free (core_config->environ_path);
core_config->environ_path = g_value_dup_string (value);
g_set_str (&core_config->environ_path,
g_value_get_string (value));
break;
case PROP_BRUSH_PATH:
g_free (core_config->brush_path);
core_config->brush_path = g_value_dup_string (value);
g_set_str (&core_config->brush_path,
g_value_get_string (value));
break;
case PROP_BRUSH_PATH_WRITABLE:
g_free (core_config->brush_path_writable);
core_config->brush_path_writable = g_value_dup_string (value);
g_set_str (&core_config->brush_path_writable,
g_value_get_string (value));
break;
case PROP_DYNAMICS_PATH:
g_free (core_config->dynamics_path);
core_config->dynamics_path = g_value_dup_string (value);
g_set_str (&core_config->dynamics_path,
g_value_get_string (value));
break;
case PROP_DYNAMICS_PATH_WRITABLE:
g_free (core_config->dynamics_path_writable);
core_config->dynamics_path_writable = g_value_dup_string (value);
g_set_str (&core_config->dynamics_path_writable,
g_value_get_string (value));
break;
case PROP_MYPAINT_BRUSH_PATH:
g_free (core_config->mypaint_brush_path);
core_config->mypaint_brush_path = g_value_dup_string (value);
g_set_str (&core_config->mypaint_brush_path,
g_value_get_string (value));
break;
case PROP_MYPAINT_BRUSH_PATH_WRITABLE:
g_free (core_config->mypaint_brush_path_writable);
core_config->mypaint_brush_path_writable = g_value_dup_string (value);
g_set_str (&core_config->mypaint_brush_path_writable,
g_value_get_string (value));
break;
case PROP_PATTERN_PATH:
g_free (core_config->pattern_path);
core_config->pattern_path = g_value_dup_string (value);
g_set_str (&core_config->pattern_path,
g_value_get_string (value));
break;
case PROP_PATTERN_PATH_WRITABLE:
g_free (core_config->pattern_path_writable);
core_config->pattern_path_writable = g_value_dup_string (value);
g_set_str (&core_config->pattern_path_writable,
g_value_get_string (value));
break;
case PROP_PALETTE_PATH:
g_free (core_config->palette_path);
core_config->palette_path = g_value_dup_string (value);
g_set_str (&core_config->palette_path,
g_value_get_string (value));
break;
case PROP_PALETTE_PATH_WRITABLE:
g_free (core_config->palette_path_writable);
core_config->palette_path_writable = g_value_dup_string (value);
g_set_str (&core_config->palette_path_writable,
g_value_get_string (value));
break;
case PROP_GRADIENT_PATH:
g_free (core_config->gradient_path);
core_config->gradient_path = g_value_dup_string (value);
g_set_str (&core_config->gradient_path,
g_value_get_string (value));
break;
case PROP_GRADIENT_PATH_WRITABLE:
g_free (core_config->gradient_path_writable);
core_config->gradient_path_writable = g_value_dup_string (value);
g_set_str (&core_config->gradient_path_writable,
g_value_get_string (value));
break;
case PROP_TOOL_PRESET_PATH:
g_free (core_config->tool_preset_path);
core_config->tool_preset_path = g_value_dup_string (value);
g_set_str (&core_config->tool_preset_path,
g_value_get_string (value));
break;
case PROP_TOOL_PRESET_PATH_WRITABLE:
g_free (core_config->tool_preset_path_writable);
core_config->tool_preset_path_writable = g_value_dup_string (value);
g_set_str (&core_config->tool_preset_path_writable,
g_value_get_string (value));
break;
case PROP_FONT_PATH:
g_free (core_config->font_path);
core_config->font_path = g_value_dup_string (value);
g_set_str (&core_config->font_path,
g_value_get_string (value));
break;
case PROP_FONT_PATH_WRITABLE:
g_free (core_config->font_path_writable);
core_config->font_path_writable = g_value_dup_string (value);
g_set_str (&core_config->font_path_writable,
g_value_get_string (value));
break;
case PROP_DEFAULT_BRUSH:
g_free (core_config->default_brush);
core_config->default_brush = g_value_dup_string (value);
g_set_str (&core_config->default_brush,
g_value_get_string (value));
break;
case PROP_DEFAULT_DYNAMICS:
g_free (core_config->default_dynamics);
core_config->default_dynamics = g_value_dup_string (value);
g_set_str (&core_config->default_dynamics,
g_value_get_string (value));
break;
case PROP_DEFAULT_MYPAINT_BRUSH:
g_free (core_config->default_mypaint_brush);
core_config->default_mypaint_brush = g_value_dup_string (value);
g_set_str (&core_config->default_mypaint_brush,
g_value_get_string (value));
break;
case PROP_DEFAULT_PATTERN:
g_free (core_config->default_pattern);
core_config->default_pattern = g_value_dup_string (value);
g_set_str (&core_config->default_pattern,
g_value_get_string (value));
break;
case PROP_DEFAULT_PALETTE:
g_free (core_config->default_palette);
core_config->default_palette = g_value_dup_string (value);
g_set_str (&core_config->default_palette,
g_value_get_string (value));
break;
case PROP_DEFAULT_GRADIENT:
g_free (core_config->default_gradient);
core_config->default_gradient = g_value_dup_string (value);
g_set_str (&core_config->default_gradient,
g_value_get_string (value));
break;
case PROP_DEFAULT_TOOL_PRESET:
g_free (core_config->default_tool_preset);
core_config->default_tool_preset = g_value_dup_string (value);
g_set_str (&core_config->default_tool_preset,
g_value_get_string (value));
break;
case PROP_DEFAULT_FONT:
g_free (core_config->default_font);
core_config->default_font = g_value_dup_string (value);
g_set_str (&core_config->default_font,
g_value_get_string (value));
break;
case PROP_GLOBAL_BRUSH:
core_config->global_brush = g_value_get_boolean (value);
@@ -1101,8 +1101,8 @@ gimp_core_config_set_property (GObject *object,
core_config->undo_preview_size = g_value_get_enum (value);
break;
case PROP_PLUGINRC_PATH:
g_free (core_config->plug_in_rc_path);
core_config->plug_in_rc_path = g_value_dup_string (value);
g_set_str (&core_config->plug_in_rc_path,
g_value_get_string (value));
break;
case PROP_LAYER_PREVIEWS:
core_config->layer_previews = g_value_get_boolean (value);
@@ -1134,8 +1134,8 @@ gimp_core_config_set_property (GObject *object,
core_config->last_release_timestamp = g_value_get_int64 (value);
break;
case PROP_LAST_RELEASE_COMMENT:
g_clear_pointer (&core_config->last_release_comment, g_free);
core_config->last_release_comment = g_value_dup_string (value);
g_set_str (&core_config->last_release_comment,
g_value_get_string (value));
break;
case PROP_LAST_REVISION:
core_config->last_revision = g_value_get_int (value);
@@ -1143,13 +1143,13 @@ gimp_core_config_set_property (GObject *object,
case PROP_LAST_KNOWN_RELEASE:
if (core_config->last_known_release != g_value_get_string (value))
{
g_clear_pointer (&core_config->last_known_release, g_free);
core_config->last_known_release = g_value_dup_string (value);
g_set_str (&core_config->last_known_release,
g_value_get_string (value));
}
break;
case PROP_CONFIG_VERSION:
g_clear_pointer (&core_config->config_version, g_free);
core_config->config_version = g_value_dup_string (value);
g_set_str (&core_config->config_version,
g_value_get_string (value));
break;
case PROP_SAVE_DOCUMENT_HISTORY:
core_config->save_document_history = g_value_get_boolean (value);
@@ -1168,8 +1168,8 @@ gimp_core_config_set_property (GObject *object,
core_config->import_add_alpha = g_value_get_boolean (value);
break;
case PROP_IMPORT_RAW_PLUG_IN:
g_free (core_config->import_raw_plug_in);
core_config->import_raw_plug_in = g_value_dup_string (value);
g_set_str (&core_config->import_raw_plug_in,
g_value_get_string (value));
break;
case PROP_EXPORT_FILE_TYPE:
core_config->export_file_type = g_value_get_enum (value);

View File

@@ -89,14 +89,14 @@ enum
PROP_CHANNEL_NEW_NAME,
PROP_CHANNEL_NEW_COLOR,
PROP_VECTORS_NEW_NAME,
PROP_PATH_NEW_NAME,
PROP_VECTORS_EXPORT_PATH,
PROP_VECTORS_EXPORT_ACTIVE_ONLY,
PROP_PATH_EXPORT_PATH,
PROP_PATH_EXPORT_ACTIVE_ONLY,
PROP_VECTORS_IMPORT_PATH,
PROP_VECTORS_IMPORT_MERGE,
PROP_VECTORS_IMPORT_SCALE,
PROP_PATH_IMPORT_PATH,
PROP_PATH_IMPORT_MERGE,
PROP_PATH_IMPORT_SCALE,
PROP_SELECTION_FEATHER_RADIUS,
PROP_SELECTION_FEATHER_EDGE_LOCK,
@@ -425,47 +425,47 @@ gimp_dialog_config_class_init (GimpDialogConfigClass *klass)
TRUE, half_transparent,
GIMP_PARAM_STATIC_STRINGS);
GIMP_CONFIG_PROP_STRING (object_class, PROP_VECTORS_NEW_NAME,
GIMP_CONFIG_PROP_STRING (object_class, PROP_PATH_NEW_NAME,
"path-new-name",
"Default new path name",
VECTORS_NEW_NAME_BLURB,
PATH_NEW_NAME_BLURB,
_("Path"),
GIMP_PARAM_STATIC_STRINGS);
GIMP_CONFIG_PROP_PATH (object_class, PROP_VECTORS_EXPORT_PATH,
GIMP_CONFIG_PROP_PATH (object_class, PROP_PATH_EXPORT_PATH,
"path-export-path",
"Default path export folder path",
VECTORS_EXPORT_PATH_BLURB,
PATH_EXPORT_PATH_BLURB,
GIMP_CONFIG_PATH_FILE,
NULL,
GIMP_PARAM_STATIC_STRINGS);
GIMP_CONFIG_PROP_BOOLEAN (object_class, PROP_VECTORS_EXPORT_ACTIVE_ONLY,
GIMP_CONFIG_PROP_BOOLEAN (object_class, PROP_PATH_EXPORT_ACTIVE_ONLY,
"path-export-active-only",
"Default export only the selected paths",
VECTORS_EXPORT_ACTIVE_ONLY_BLURB,
PATH_EXPORT_ACTIVE_ONLY_BLURB,
TRUE,
GIMP_PARAM_STATIC_STRINGS);
GIMP_CONFIG_PROP_PATH (object_class, PROP_VECTORS_IMPORT_PATH,
GIMP_CONFIG_PROP_PATH (object_class, PROP_PATH_IMPORT_PATH,
"path-import-path",
"Default path import folder path",
VECTORS_IMPORT_PATH_BLURB,
PATH_IMPORT_PATH_BLURB,
GIMP_CONFIG_PATH_FILE,
NULL,
GIMP_PARAM_STATIC_STRINGS);
GIMP_CONFIG_PROP_BOOLEAN (object_class, PROP_VECTORS_IMPORT_MERGE,
GIMP_CONFIG_PROP_BOOLEAN (object_class, PROP_PATH_IMPORT_MERGE,
"path-import-merge",
"Default merge imported path",
VECTORS_IMPORT_MERGE_BLURB,
PATH_IMPORT_MERGE_BLURB,
FALSE,
GIMP_PARAM_STATIC_STRINGS);
GIMP_CONFIG_PROP_BOOLEAN (object_class, PROP_VECTORS_IMPORT_SCALE,
GIMP_CONFIG_PROP_BOOLEAN (object_class, PROP_PATH_IMPORT_SCALE,
"path-import-scale",
"Default scale imported path",
VECTORS_IMPORT_SCALE_BLURB,
PATH_IMPORT_SCALE_BLURB,
FALSE,
GIMP_PARAM_STATIC_STRINGS);
@@ -598,9 +598,9 @@ gimp_dialog_config_finalize (GObject *object)
g_clear_pointer (&config->color_profile_path, g_free);
g_clear_pointer (&config->layer_new_name, g_free);
g_clear_pointer (&config->channel_new_name, g_free);
g_clear_pointer (&config->path_new_name, g_free);
g_clear_pointer (&config->path_export_path, g_free);
g_clear_pointer (&config->path_import_path, g_free);
g_clear_pointer (&config->path_new_name, g_free);
g_clear_pointer (&config->path_export_path, g_free);
g_clear_pointer (&config->path_import_path, g_free);
g_clear_object (&config->fill_options);
g_clear_object (&config->stroke_options);
@@ -632,9 +632,7 @@ gimp_dialog_config_set_property (GObject *object,
break;
case PROP_COLOR_PROFILE_PATH:
if (config->color_profile_path)
g_free (config->color_profile_path);
config->color_profile_path = g_value_dup_string (value);
g_set_str (&config->color_profile_path, g_value_get_string (value));
break;
case PROP_IMAGE_CONVERT_PROFILE_INTENT:
@@ -687,9 +685,7 @@ gimp_dialog_config_set_property (GObject *object,
break;
case PROP_LAYER_NEW_NAME:
if (config->layer_new_name)
g_free (config->layer_new_name);
config->layer_new_name = g_value_dup_string (value);
g_set_str (&config->layer_new_name, g_value_get_string (value));
break;
case PROP_LAYER_NEW_MODE:
config->layer_new_mode = g_value_get_enum (value);
@@ -732,39 +728,31 @@ gimp_dialog_config_set_property (GObject *object,
break;
case PROP_CHANNEL_NEW_NAME:
if (config->channel_new_name)
g_free (config->channel_new_name);
config->channel_new_name = g_value_dup_string (value);
g_set_str (&config->channel_new_name, g_value_get_string (value));
break;
case PROP_CHANNEL_NEW_COLOR:
g_clear_object (&config->channel_new_color);
config->channel_new_color = gegl_color_duplicate (g_value_get_object (value));
break;
case PROP_VECTORS_NEW_NAME:
if (config->path_new_name)
g_free (config->path_new_name);
config->path_new_name = g_value_dup_string (value);
case PROP_PATH_NEW_NAME:
g_set_str (&config->path_new_name, g_value_get_string (value));
break;
case PROP_VECTORS_EXPORT_PATH:
if (config->path_export_path)
g_free (config->path_export_path);
config->path_export_path = g_value_dup_string (value);
case PROP_PATH_EXPORT_PATH:
g_set_str (&config->path_export_path, g_value_get_string (value));
break;
case PROP_VECTORS_EXPORT_ACTIVE_ONLY:
case PROP_PATH_EXPORT_ACTIVE_ONLY:
config->path_export_active_only = g_value_get_boolean (value);
break;
case PROP_VECTORS_IMPORT_PATH:
if (config->path_import_path)
g_free (config->path_import_path);
config->path_import_path = g_value_dup_string (value);
case PROP_PATH_IMPORT_PATH:
g_set_str (&config->path_import_path, g_value_get_string (value));
break;
case PROP_VECTORS_IMPORT_MERGE:
case PROP_PATH_IMPORT_MERGE:
config->path_import_merge = g_value_get_boolean (value);
break;
case PROP_VECTORS_IMPORT_SCALE:
case PROP_PATH_IMPORT_SCALE:
config->path_import_scale = g_value_get_boolean (value);
break;
@@ -938,24 +926,24 @@ gimp_dialog_config_get_property (GObject *object,
g_value_set_object (value, config->channel_new_color);
break;
case PROP_VECTORS_NEW_NAME:
case PROP_PATH_NEW_NAME:
g_value_set_string (value, config->path_new_name);
break;
case PROP_VECTORS_EXPORT_PATH:
case PROP_PATH_EXPORT_PATH:
g_value_set_string (value, config->path_export_path);
break;
case PROP_VECTORS_EXPORT_ACTIVE_ONLY:
case PROP_PATH_EXPORT_ACTIVE_ONLY:
g_value_set_boolean (value, config->path_export_active_only);
break;
case PROP_VECTORS_IMPORT_PATH:
case PROP_PATH_IMPORT_PATH:
g_value_set_string (value, config->path_import_path);
break;
case PROP_VECTORS_IMPORT_MERGE:
case PROP_PATH_IMPORT_MERGE:
g_value_set_boolean (value, config->path_import_merge);
break;
case PROP_VECTORS_IMPORT_SCALE:
case PROP_PATH_IMPORT_SCALE:
g_value_set_boolean (value, config->path_import_scale);
break;

View File

@@ -439,8 +439,8 @@ gimp_display_config_finalize (GObject *object)
{
GimpDisplayConfig *display_config = GIMP_DISPLAY_CONFIG (object);
g_free (display_config->image_title_format);
g_free (display_config->image_status_format);
g_clear_pointer (&display_config->image_title_format, g_free);
g_clear_pointer (&display_config->image_status_format, g_free);
g_clear_object (&display_config->default_view);
g_clear_object (&display_config->default_fullscreen_view);
@@ -518,12 +518,10 @@ gimp_display_config_set_property (GObject *object,
display_config->show_paint_tool_cursor = g_value_get_boolean (value);
break;
case PROP_IMAGE_TITLE_FORMAT:
g_free (display_config->image_title_format);
display_config->image_title_format = g_value_dup_string (value);
g_set_str (&display_config->image_title_format, g_value_get_string (value));
break;
case PROP_IMAGE_STATUS_FORMAT:
g_free (display_config->image_status_format);
display_config->image_status_format = g_value_dup_string (value);
g_set_str (&display_config->image_status_format, g_value_get_string (value));
break;
case PROP_MONITOR_XRESOLUTION:
display_config->monitor_xres = g_value_get_double (value);

View File

@@ -47,16 +47,16 @@ enum
};
static void gimp_early_rc_constructed (GObject *object);
static void gimp_early_rc_finalize (GObject *object);
static void gimp_early_rc_set_property (GObject *object,
guint property_id,
const GValue *value,
GParamSpec *pspec);
static void gimp_early_rc_get_property (GObject *object,
guint property_id,
GValue *value,
GParamSpec *pspec);
static void gimp_early_rc_constructed (GObject *object);
static void gimp_early_rc_finalize (GObject *object);
static void gimp_early_rc_set_property (GObject *object,
guint property_id,
const GValue *value,
GParamSpec *pspec);
static void gimp_early_rc_get_property (GObject *object,
guint property_id,
GValue *value,
GParamSpec *pspec);
/* Just use GimpConfig interface's default implementation which will
@@ -206,9 +206,7 @@ gimp_early_rc_set_property (GObject *object,
break;
case PROP_LANGUAGE:
if (rc->language)
g_free (rc->language);
rc->language = g_value_dup_string (value);
g_set_str (&rc->language, g_value_get_string (value));
break;
#ifdef G_OS_WIN32
@@ -255,12 +253,15 @@ gimp_early_rc_get_property (GObject *object,
case PROP_VERBOSE:
g_value_set_boolean (value, rc->verbose);
break;
case PROP_SYSTEM_GIMPRC:
g_value_set_object (value, rc->system_gimprc);
break;
case PROP_USER_GIMPRC:
g_value_set_object (value, rc->user_gimprc);
break;
case PROP_LANGUAGE:
g_value_set_string (value, rc->language);
break;

View File

@@ -182,9 +182,9 @@ gimp_gegl_config_finalize (GObject *object)
{
GimpGeglConfig *gegl_config = GIMP_GEGL_CONFIG (object);
g_free (gegl_config->temp_path);
g_free (gegl_config->swap_path);
g_free (gegl_config->swap_compression);
g_clear_pointer (&gegl_config->temp_path, g_free);
g_clear_pointer (&gegl_config->swap_path, g_free);
g_clear_pointer (&gegl_config->swap_compression, g_free);
gimp_debug_remove_instance (object);
@@ -202,23 +202,25 @@ gimp_gegl_config_set_property (GObject *object,
switch (property_id)
{
case PROP_TEMP_PATH:
g_free (gegl_config->temp_path);
gegl_config->temp_path = g_value_dup_string (value);
g_set_str (&gegl_config->temp_path, g_value_get_string (value));
break;
case PROP_SWAP_PATH:
g_free (gegl_config->swap_path);
gegl_config->swap_path = g_value_dup_string (value);
g_set_str (&gegl_config->swap_path, g_value_get_string (value));
break;
case PROP_SWAP_COMPRESSION:
g_free (gegl_config->swap_compression);
gegl_config->swap_compression = g_value_dup_string (value);
g_set_str (&gegl_config->swap_compression, g_value_get_string (value));
break;
case PROP_NUM_PROCESSORS:
gegl_config->num_processors = g_value_get_int (value);
break;
case PROP_TILE_CACHE_SIZE:
gegl_config->tile_cache_size = g_value_get_uint64 (value);
break;
case PROP_USE_OPENCL:
gegl_config->use_opencl = g_value_get_boolean (value);
break;
@@ -246,18 +248,23 @@ gimp_gegl_config_get_property (GObject *object,
case PROP_TEMP_PATH:
g_value_set_string (value, gegl_config->temp_path);
break;
case PROP_SWAP_PATH:
g_value_set_string (value, gegl_config->swap_path);
break;
case PROP_SWAP_COMPRESSION:
g_value_set_string (value, gegl_config->swap_compression);
break;
case PROP_NUM_PROCESSORS:
g_value_set_int (value, gegl_config->num_processors);
break;
case PROP_TILE_CACHE_SIZE:
g_value_set_uint64 (value, gegl_config->tile_cache_size);
break;
case PROP_USE_OPENCL:
g_value_set_boolean (value, gegl_config->use_opencl);
break;

View File

@@ -73,6 +73,7 @@ enum
PROP_THEME_SCHEME,
PROP_OVERRIDE_THEME_ICON_SIZE,
PROP_CUSTOM_ICON_SIZE,
PROP_VIEWABLES_FOLLOW_THEME,
PROP_ICON_THEME_PATH,
PROP_ICON_THEME,
PROP_PREFER_SYMBOLIC_ICONS,
@@ -91,6 +92,7 @@ enum
PROP_PLAYGROUND_NPD_TOOL,
PROP_PLAYGROUND_SEAMLESS_CLONE_TOOL,
PROP_PLAYGROUND_PAINT_SELECT_TOOL,
PROP_PLAYGROUND_USE_LIST_BOX,
PROP_HIDE_DOCKS,
PROP_SINGLE_WINDOW_MODE,
@@ -329,6 +331,13 @@ gimp_gui_config_class_init (GimpGuiConfigClass *klass)
GIMP_TYPE_ICON_SIZE,
GIMP_ICON_SIZE_MEDIUM,
GIMP_PARAM_STATIC_STRINGS);
GIMP_CONFIG_PROP_BOOLEAN (object_class, PROP_VIEWABLES_FOLLOW_THEME,
"viewables-follow-theme",
"Preview of viewables follow the theme style when relevant",
VIEWABLES_FOLLOW_THEME_BLURB,
FALSE,
GIMP_PARAM_STATIC_STRINGS);
path = gimp_config_build_data_path ("icons");
GIMP_CONFIG_PROP_PATH (object_class, PROP_ICON_THEME_PATH,
@@ -462,6 +471,14 @@ gimp_gui_config_class_init (GimpGuiConfigClass *klass)
GIMP_PARAM_STATIC_STRINGS |
GIMP_CONFIG_PARAM_RESTART);
GIMP_CONFIG_PROP_BOOLEAN (object_class,
PROP_PLAYGROUND_USE_LIST_BOX,
"playground-use-list-box",
"Playground Use List Box",
PLAYGROUND_USE_LIST_BOX_BLURB,
FALSE,
GIMP_PARAM_STATIC_STRINGS);
g_object_class_install_property (object_class, PROP_HIDE_DOCKS,
g_param_spec_boolean ("hide-docks",
NULL,
@@ -591,12 +608,12 @@ gimp_gui_config_finalize (GObject *object)
{
GimpGuiConfig *gui_config = GIMP_GUI_CONFIG (object);
g_free (gui_config->theme_path);
g_free (gui_config->theme);
g_free (gui_config->icon_theme_path);
g_free (gui_config->icon_theme);
g_free (gui_config->help_locales);
g_free (gui_config->user_manual_online_uri);
g_clear_pointer (&gui_config->theme_path, g_free);
g_clear_pointer (&gui_config->theme, g_free);
g_clear_pointer (&gui_config->icon_theme_path, g_free);
g_clear_pointer (&gui_config->icon_theme, g_free);
g_clear_pointer (&gui_config->help_locales, g_free);
g_clear_pointer (&gui_config->user_manual_online_uri, g_free);
G_OBJECT_CLASS (parent_class)->finalize (object);
}
@@ -675,13 +692,11 @@ gimp_gui_config_set_property (GObject *object,
case PROP_TOOLBOX_GROUPS:
gui_config->toolbox_groups = g_value_get_boolean (value);
break;
case PROP_THEME_PATH:
g_free (gui_config->theme_path);
gui_config->theme_path = g_value_dup_string (value);
case PROP_THEME_PATH:
g_set_str (&gui_config->theme_path, g_value_get_string (value));
break;
case PROP_THEME:
g_free (gui_config->theme);
gui_config->theme = g_value_dup_string (value);
g_set_str (&gui_config->theme, g_value_get_string (value));
break;
case PROP_THEME_SCHEME:
gui_config->theme_scheme = g_value_get_enum (value);
@@ -692,13 +707,14 @@ gimp_gui_config_set_property (GObject *object,
case PROP_CUSTOM_ICON_SIZE:
gui_config->custom_icon_size = g_value_get_enum (value);
break;
case PROP_ICON_THEME_PATH:
g_free (gui_config->icon_theme_path);
gui_config->icon_theme_path = g_value_dup_string (value);
case PROP_VIEWABLES_FOLLOW_THEME:
gui_config->viewables_follow_theme = g_value_get_boolean (value);
break;
case PROP_ICON_THEME_PATH:
g_set_str (&gui_config->icon_theme_path, g_value_get_string (value));
break;
case PROP_ICON_THEME:
g_free (gui_config->icon_theme);
gui_config->icon_theme = g_value_dup_string (value);
g_set_str (&gui_config->icon_theme, g_value_get_string (value));
break;
case PROP_PREFER_SYMBOLIC_ICONS:
gui_config->prefer_symbolic_icons = g_value_get_boolean (value);
@@ -713,8 +729,7 @@ gimp_gui_config_set_property (GObject *object,
gui_config->show_help_button = g_value_get_boolean (value);
break;
case PROP_HELP_LOCALES:
g_free (gui_config->help_locales);
gui_config->help_locales = g_value_dup_string (value);
g_set_str (&gui_config->help_locales, g_value_get_string (value));
break;
case PROP_HELP_BROWSER:
gui_config->help_browser = g_value_get_enum (value);
@@ -723,8 +738,7 @@ gimp_gui_config_set_property (GObject *object,
gui_config->user_manual_online = g_value_get_boolean (value);
break;
case PROP_USER_MANUAL_ONLINE_URI:
g_free (gui_config->user_manual_online_uri);
gui_config->user_manual_online_uri = g_value_dup_string (value);
g_set_str (&gui_config->user_manual_online_uri, g_value_get_string (value));
break;
case PROP_ACTION_HISTORY_SIZE:
gui_config->action_history_size = g_value_get_int (value);
@@ -748,6 +762,9 @@ gimp_gui_config_set_property (GObject *object,
case PROP_PLAYGROUND_PAINT_SELECT_TOOL:
gui_config->playground_paint_select_tool = g_value_get_boolean (value);
break;
case PROP_PLAYGROUND_USE_LIST_BOX:
gui_config->playground_use_list_box = g_value_get_boolean (value);
break;
case PROP_HIDE_DOCKS:
gui_config->hide_docks = g_value_get_boolean (value);
@@ -874,6 +891,9 @@ gimp_gui_config_get_property (GObject *object,
case PROP_CUSTOM_ICON_SIZE:
g_value_set_enum (value, gui_config->custom_icon_size);
break;
case PROP_VIEWABLES_FOLLOW_THEME:
g_value_set_boolean (value, gui_config->viewables_follow_theme);
break;
case PROP_ICON_THEME_PATH:
g_value_set_string (value, gui_config->icon_theme_path);
break;
@@ -926,6 +946,9 @@ gimp_gui_config_get_property (GObject *object,
case PROP_PLAYGROUND_PAINT_SELECT_TOOL:
g_value_set_boolean (value, gui_config->playground_paint_select_tool);
break;
case PROP_PLAYGROUND_USE_LIST_BOX:
g_value_set_boolean (value, gui_config->playground_use_list_box);
break;
case PROP_HIDE_DOCKS:
g_value_set_boolean (value, gui_config->hide_docks);

View File

@@ -70,6 +70,7 @@ struct _GimpGuiConfig
gdouble font_relative_size;
gboolean override_icon_size;
GimpIconSize custom_icon_size;
gboolean viewables_follow_theme;
gboolean use_help;
gboolean show_help_button;
gchar *help_locales;
@@ -86,6 +87,7 @@ struct _GimpGuiConfig
gboolean playground_npd_tool;
gboolean playground_seamless_clone_tool;
gboolean playground_paint_select_tool;
gboolean playground_use_list_box;
/* saved in sessionrc */
gboolean hide_docks;

View File

@@ -130,11 +130,11 @@ gimp_plugin_config_finalize (GObject *object)
{
GimpPluginConfig *plugin_config = GIMP_PLUGIN_CONFIG (object);
g_free (plugin_config->fractalexplorer_path);
g_free (plugin_config->gfig_path);
g_free (plugin_config->gflare_path);
g_free (plugin_config->gimpressionist_path);
g_free (plugin_config->script_fu_path);
g_clear_pointer (&plugin_config->fractalexplorer_path, g_free);
g_clear_pointer (&plugin_config->gfig_path, g_free);
g_clear_pointer (&plugin_config->gflare_path, g_free);
g_clear_pointer (&plugin_config->gimpressionist_path, g_free);
g_clear_pointer (&plugin_config->script_fu_path, g_free);
G_OBJECT_CLASS (parent_class)->finalize (object);
}
@@ -150,28 +150,19 @@ gimp_plugin_config_set_property (GObject *object,
switch (property_id)
{
case PROP_FRACTALEXPLORER_PATH:
g_free (plugin_config->fractalexplorer_path);
plugin_config->fractalexplorer_path = g_value_dup_string (value);
g_set_str (&plugin_config->fractalexplorer_path, g_value_get_string (value));
break;
case PROP_GFIG_PATH:
g_free (plugin_config->gfig_path);
plugin_config->gfig_path = g_value_dup_string (value);
g_set_str (&plugin_config->gfig_path, g_value_get_string (value));
break;
case PROP_GFLARE_PATH:
g_free (plugin_config->gflare_path);
plugin_config->gflare_path = g_value_dup_string (value);
g_set_str (&plugin_config->gflare_path, g_value_get_string (value));
break;
case PROP_GIMPRESSIONIST_PATH:
g_free (plugin_config->gimpressionist_path);
plugin_config->gimpressionist_path = g_value_dup_string (value);
g_set_str (&plugin_config->gimpressionist_path, g_value_get_string (value));
break;
case PROP_SCRIPT_FU_PATH:
g_free (plugin_config->script_fu_path);
plugin_config->script_fu_path = g_value_dup_string (value);
g_set_str (&plugin_config->script_fu_path, g_value_get_string (value));
break;
default:
@@ -193,19 +184,15 @@ gimp_plugin_config_get_property (GObject *object,
case PROP_FRACTALEXPLORER_PATH:
g_value_set_string (value, plugin_config->fractalexplorer_path);
break;
case PROP_GFIG_PATH:
g_value_set_string (value, plugin_config->gfig_path);
break;
case PROP_GFLARE_PATH:
g_value_set_string (value, plugin_config->gflare_path);
break;
case PROP_GIMPRESSIONIST_PATH:
g_value_set_string (value, plugin_config->gimpressionist_path);
break;
case PROP_SCRIPT_FU_PATH:
g_value_set_string (value, plugin_config->script_fu_path);
break;

View File

@@ -512,6 +512,9 @@ _("Enable the Seamless Clone tool.")
#define PLAYGROUND_PAINT_SELECT_TOOL_BLURB \
_("Enable the Paint Select tool.")
#define PLAYGROUND_USE_LIST_BOX_BLURB \
_("Use the new GtkListBox widget for simple lists.")
#define SPACE_BAR_ACTION_BLURB \
_("What to do when the space bar is pressed in the image window.")
@@ -558,6 +561,9 @@ _("The name of the icon theme to use.")
#define OVERRIDE_THEME_ICON_SIZE_BLURB \
_("Override theme-set icon sizes.")
#define VIEWABLES_FOLLOW_THEME_BLURB \
_("Use theme colors for preview")
#define ICON_SIZE_BLURB \
_("The size of the icons to use.")
@@ -661,22 +667,22 @@ _("Sets the default channel name for the 'New Channel' dialog.")
#define CHANNEL_NEW_COLOR_BLURB \
_("Sets the default color and opacity for the 'New Channel' dialog.")
#define VECTORS_NEW_NAME_BLURB \
#define PATH_NEW_NAME_BLURB \
_("Sets the default path name for the 'New Path' dialog.")
#define VECTORS_EXPORT_PATH_BLURB \
#define PATH_EXPORT_PATH_BLURB \
_("Sets the default folder path for the 'Export Path' dialog.")
#define VECTORS_EXPORT_ACTIVE_ONLY_BLURB \
#define PATH_EXPORT_ACTIVE_ONLY_BLURB \
_("Sets the default 'Export the selected paths' state for the 'Export Path' dialog.")
#define VECTORS_IMPORT_PATH_BLURB \
#define PATH_IMPORT_PATH_BLURB \
_("Sets the default folder path for the 'Import Path' dialog.")
#define VECTORS_IMPORT_MERGE_BLURB \
#define PATH_IMPORT_MERGE_BLURB \
_("Sets the default 'Merge imported paths' state for the 'Import Path' dialog.")
#define VECTORS_IMPORT_SCALE_BLURB \
#define PATH_IMPORT_SCALE_BLURB \
_("Sets the default 'Scale imported paths to fit size' state for the 'Import Path' dialog.")
#define SELECTION_FEATHER_RADIUS_BLURB \

View File

@@ -44,7 +44,7 @@ libappconfig = static_library('appconfig',
include_directories: [ rootInclude, rootAppInclude, ],
c_args: '-DG_LOG_DOMAIN="Gimp-Config"',
dependencies: [
cairo, gegl, gdk_pixbuf, gio, gio_specific, libmypaint,
cairo, gegl, gdk_pixbuf, gexiv2, gio, gio_specific, libmypaint,
],
)
@@ -53,7 +53,7 @@ test('app-config',
[ 'test-config.c', app_debug_files, ],
dependencies: [
appstream_glib,
appstream,
libapp_dep,
],
link_with: [

View File

@@ -482,7 +482,7 @@ typedef enum /*< pdb-skip >*/
GType gimp_trc_type_get_type (void) G_GNUC_CONST;
typedef enum /*< pdb-skip >*/
typedef enum
{
GIMP_TRC_LINEAR, /*< desc="Linear" >*/
GIMP_TRC_NON_LINEAR, /*< desc="Non-Linear" >*/

View File

@@ -31,8 +31,6 @@
#include "gimpbuffer.h"
#include "gimpcontext.h"
#include "gimpdrawable-edit.h"
#include "gimpdrawable-filters.h"
#include "gimpdrawablefilter.h"
#include "gimperror.h"
#include "gimpgrouplayer.h"
#include "gimpimage.h"
@@ -286,7 +284,6 @@ gimp_edit_copy (GimpImage *image,
clip_image = gimp_image_new_from_drawables (image->gimp, drawables, TRUE, TRUE);
gimp_container_remove (image->gimp->images, GIMP_OBJECT (clip_image));
gimp_set_clipboard_image (image->gimp, clip_image);
g_list_free (drawables);
clip_selection = gimp_image_get_mask (clip_image);
if (! gimp_channel_is_empty (clip_selection))
@@ -339,11 +336,6 @@ gimp_edit_copy (GimpImage *image,
}
g_list_free (all_items);
gimp_image_undo_disable (clip_image);
gimp_image_resize_to_layers (clip_image, context, NULL, NULL, NULL,
NULL, NULL);
gimp_image_undo_enable (clip_image);
/* We need to store the original offsets before the image was
* resized, in order to move it into the correct location for
* in-place pasting.
@@ -355,6 +347,42 @@ gimp_edit_copy (GimpImage *image,
"gimp-edit-new-image-y",
GINT_TO_POINTER (selection_bounds.y));
}
else
{
gint offset_x;
gint offset_y;
/* We need to store the minimum offset from the selected layers
* in order to move it into the correct location for
* in-place pasting.
*/
gimp_item_get_offset (GIMP_ITEM (drawables->data), &offset_x, &offset_y);
for (iter = g_list_next (drawables); iter; iter = iter->next)
{
gint item_x;
gint item_y;
gimp_item_get_offset (GIMP_ITEM (iter->data), &item_x, &item_y);
offset_x = MIN (item_x, offset_x);
offset_y = MIN (item_y, offset_y);
}
g_object_set_data (G_OBJECT (clip_image),
"gimp-edit-new-image-x",
GINT_TO_POINTER (offset_x));
g_object_set_data (G_OBJECT (clip_image),
"gimp-edit-new-image-y",
GINT_TO_POINTER (offset_y));
}
g_list_free (drawables);
gimp_image_undo_disable (clip_image);
gimp_image_resize_to_layers (clip_image, context, NULL, NULL, NULL,
NULL, NULL);
gimp_image_undo_enable (clip_image);
/* Remove selection from the clipboard image. */
gimp_channel_clear (clip_selection, NULL, FALSE);
g_object_unref (clip_image);
@@ -506,38 +534,9 @@ gimp_edit_paste_get_tagged_layers (GimpImage *image,
"gimp-image-copied-layer"));
if (copied)
{
GimpContainer *filters;
layer = GIMP_LAYER (gimp_item_convert (GIMP_ITEM (iter->data),
image, layer_type));
filters = gimp_drawable_get_filters (GIMP_DRAWABLE (iter->data));
if (gimp_container_get_n_children (filters) > 0)
{
GList *filter_list;
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 (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);
}
}
}
}
returned_layers = g_list_prepend (returned_layers, layer);
switch (paste_type)

View File

@@ -121,7 +121,10 @@ gimp_user_install_items[] =
static gboolean user_install_detect_old (GimpUserInstall *install,
const gchar *gimp_dir);
static gchar * user_install_old_style_gimpdir (void);
#ifdef G_OS_UNIX
static gchar * user_install_flatpak_gimpdir (gint minor);
#endif
static void user_install_log (GimpUserInstall *install,
const gchar *format,
@@ -297,7 +300,7 @@ user_install_detect_old (GimpUserInstall *install,
gint major;
gint minor;
for (major = 3; major >= 2; major--)
for (major = GIMP_MAJOR_VERSION; major >= 2; major--)
{
gint max_minor;
@@ -324,14 +327,14 @@ user_install_detect_old (GimpUserInstall *install,
if (migrate)
{
install->old_major = 2;
install->old_major = major;
install->old_minor = minor;
break;
}
#ifdef G_OS_UNIX
if (minor == 10)
if (major == 2 && minor == 10)
{
/* This is special-casing for GIMP 2.10 as flatpak where
* we had this weird inconsistency: depending on whether a
@@ -381,6 +384,8 @@ user_install_detect_old (GimpUserInstall *install,
}
#endif
}
if (migrate)
break;
}
}
@@ -446,6 +451,7 @@ user_install_old_style_gimpdir (void)
return gimp_dir;
}
#ifdef G_OS_UNIX
static gchar *
user_install_flatpak_gimpdir (gint minor)
{
@@ -466,6 +472,7 @@ user_install_flatpak_gimpdir (gint minor)
return gimp_dir;
}
#endif
static void
user_install_log (GimpUserInstall *install,
@@ -758,7 +765,7 @@ user_update_menurc_over20 (const GMatchInfo *matched_value,
return FALSE;
}
gchar *
static gchar *
user_update_post_process_menurc_over20 (gpointer user_data)
{
GString *string = g_string_new (NULL);

View File

@@ -53,6 +53,7 @@
#include "gimp-utils.h"
#include "gimpasync.h"
#include "gimpcontext.h"
#include "gimpdata.h"
#include "gimperror.h"
#include "gimpimage.h"
@@ -933,6 +934,195 @@ gimp_data_input_stream_read_line_always (GDataInputStream *stream,
return result;
}
gboolean
gimp_data_input_stream_read_char (GDataInputStream *input,
gchar *value,
GError **error)
{
gchar result;
result = g_data_input_stream_read_byte (input, NULL, error);
if (error && *error)
return FALSE;
*value = result;
return TRUE;
}
gboolean
gimp_data_input_stream_read_short (GDataInputStream *input,
gint16 *value,
GError **error)
{
gint16 result;
result = g_data_input_stream_read_int16 (input, NULL, error);
if (error && *error)
return FALSE;
*value = result;
return TRUE;
}
gboolean
gimp_data_input_stream_read_long (GDataInputStream *input,
gint32 *value,
GError **error)
{
gint32 result;
result = g_data_input_stream_read_int32 (input, NULL, error);
if (error && *error)
return FALSE;
*value = result;
return TRUE;
}
gboolean
gimp_data_input_stream_read_ucs2_text (GDataInputStream *input,
gchar **value,
GError **error)
{
gchar *name_ucs2;
gint32 pslen = 0;
gint len;
gint i;
/* two-bytes characters encoded (UCS-2)
* format:
* long : number of characters in string
* data : zero terminated UCS-2 string
*/
if (! gimp_data_input_stream_read_long (input, &pslen, error) || pslen <= 0)
return FALSE;
len = 2 * pslen;
name_ucs2 = g_new (gchar, len);
for (i = 0; i < len; i++)
{
gchar mychar;
if (! gimp_data_input_stream_read_char (input, &mychar, error))
{
g_free (name_ucs2);
return FALSE;
}
name_ucs2[i] = mychar;
}
*value = g_convert (name_ucs2, len,
"UTF-8", "UCS-2BE",
NULL, NULL, NULL);
g_free (name_ucs2);
return (*value != NULL);
}
/* Photoshop resource (brush, pattern) rle decode */
gboolean
gimp_data_input_stream_rle_decode (GDataInputStream *input,
gchar *buffer,
gsize buffer_size,
gint32 height,
GError **error)
{
gint i, j;
gshort *cscanline_len = NULL;
gchar *cdata = NULL;
gchar *data = buffer;
gboolean result;
/* read compressed size foreach scanline */
cscanline_len = gegl_scratch_new (gshort, height);
for (i = 0; i < height; i++)
{
result = gimp_data_input_stream_read_short (input, &cscanline_len[i], error);
if (! result || cscanline_len[i] <= 0)
goto err;
}
/* unpack each scanline data */
for (i = 0; i < height; i++)
{
gint len;
gsize bytes_read;
len = cscanline_len[i];
cdata = gegl_scratch_alloc (len);
if (! g_input_stream_read_all (G_INPUT_STREAM (input),
cdata, len,
&bytes_read, NULL, error) ||
bytes_read != len)
{
goto err;
}
for (j = 0; j < len;)
{
gint32 n = cdata[j++];
if (n >= 128) /* force sign */
n -= 256;
if (n < 0)
{
/* copy the following char -n + 1 times */
if (n == -128) /* it's a nop */
continue;
n = -n + 1;
if (j + 1 > len || (data - buffer) + n > buffer_size)
goto err;
memset (data, cdata[j], n);
j += 1;
data += n;
}
else
{
/* read the following n + 1 chars (no compr) */
n = n + 1;
if (j + n > len || (data - buffer) + n > buffer_size)
goto err;
memcpy (data, &cdata[j], n);
j += n;
data += n;
}
}
g_clear_pointer (&cdata, gegl_scratch_free);
}
g_clear_pointer (&cscanline_len, gegl_scratch_free);
return TRUE;
err:
g_clear_pointer (&cdata, gegl_scratch_free);
g_clear_pointer (&cscanline_len, gegl_scratch_free);
if (error && ! *error)
{
g_set_error (error, GIMP_DATA_ERROR, GIMP_DATA_ERROR_READ,
_("Fatal parse error in Photoshop resource file: "
"RLE compressed data is corrupt."));
}
return FALSE;
}
gboolean
gimp_ascii_strtoi (const gchar *nptr,
gchar **endptr,

View File

@@ -98,6 +98,24 @@ gchar * gimp_data_input_stream_read_line_always
GCancellable *cancellable,
GError **error);
gboolean gimp_data_input_stream_read_char (GDataInputStream *input,
gchar *value,
GError **error);
gboolean gimp_data_input_stream_read_short (GDataInputStream *input,
gint16 *value,
GError **error);
gboolean gimp_data_input_stream_read_long (GDataInputStream *input,
gint32 *value,
GError **error);
gboolean gimp_data_input_stream_read_ucs2_text (GDataInputStream *input,
gchar **value,
GError **error);
gboolean gimp_data_input_stream_rle_decode (GDataInputStream *input,
gchar *buffer,
gsize buffer_size,
gint32 height,
GError **error);
gboolean gimp_ascii_strtoi (const gchar *nptr,
gchar **endptr,
gint base,

View File

@@ -254,9 +254,9 @@ gimp_init (Gimp *gimp)
gimp->drawable_filter_table = gimp_id_table_new ();
gimp->displays = g_object_new (GIMP_TYPE_LIST,
"children-type", GIMP_TYPE_OBJECT,
"policy", GIMP_CONTAINER_POLICY_WEAK,
"append", TRUE,
"child-type", GIMP_TYPE_OBJECT,
"policy", GIMP_CONTAINER_POLICY_WEAK,
"append", TRUE,
NULL);
gimp_object_set_static_name (GIMP_OBJECT (gimp->displays), "displays");
gimp->next_display_id = 1;
@@ -268,15 +268,15 @@ gimp_init (Gimp *gimp)
gimp_data_factories_init (gimp);
gimp->tool_info_list = g_object_new (GIMP_TYPE_LIST,
"children-type", GIMP_TYPE_TOOL_INFO,
"append", TRUE,
"child-type", GIMP_TYPE_TOOL_INFO,
"append", TRUE,
NULL);
gimp_object_set_static_name (GIMP_OBJECT (gimp->tool_info_list),
"tool infos");
gimp->tool_item_list = g_object_new (GIMP_TYPE_LIST,
"children-type", GIMP_TYPE_TOOL_ITEM,
"append", TRUE,
"child-type", GIMP_TYPE_TOOL_ITEM,
"append", TRUE,
NULL);
gimp_object_set_static_name (GIMP_OBJECT (gimp->tool_item_list),
"tool items");
@@ -540,10 +540,6 @@ gimp_real_initialize (Gimp *gimp,
status_callback (_("Initialization"), NULL, 0.0);
/* set the last values used to default values */
gimp->image_new_last_template =
gimp_config_duplicate (GIMP_CONFIG (gimp->config->default_image));
/* add data objects that need the user context */
gimp_data_factories_add_builtin (gimp);
@@ -1118,6 +1114,37 @@ gimp_get_tool_info (Gimp *gimp,
return (GimpToolInfo *) info;
}
void
gimp_set_last_template (Gimp *gimp,
GimpTemplate *template)
{
GimpTemplate *last_template;
g_return_if_fail (GIMP_IS_GIMP (gimp));
g_return_if_fail (GIMP_IS_TEMPLATE (template));
last_template = gimp_get_last_template (gimp);
gimp_config_sync (G_OBJECT (template),
G_OBJECT (last_template), 0);
}
GimpTemplate *
gimp_get_last_template (Gimp *gimp)
{
g_return_val_if_fail (GIMP_IS_GIMP (gimp), NULL);
if (! gimp->image_new_last_template)
{
/* set the last values used to default values */
gimp->image_new_last_template =
gimp_config_duplicate (GIMP_CONFIG (gimp->config->default_image));
}
return gimp->image_new_last_template;
}
/**
* gimp_message:
* @gimp: a pointer to the %Gimp object

View File

@@ -95,6 +95,8 @@ struct _Gimp
GList *image_windows;
GObject *controller_manager;
GimpImage *clipboard_image;
GimpBuffer *clipboard_buffer;
GimpContainer *named_buffers;
@@ -225,6 +227,10 @@ GimpContext * gimp_get_user_context (Gimp *gimp);
GimpToolInfo * gimp_get_tool_info (Gimp *gimp,
const gchar *tool_name);
void gimp_set_last_template (Gimp *gimp,
GimpTemplate *_template);
GimpTemplate * gimp_get_last_template (Gimp *gimp);
void gimp_message (Gimp *gimp,
GObject *handler,
GimpMessageSeverity severity,

View File

@@ -32,6 +32,7 @@
#include "gimpbrush-private.h"
#include "gimppattern-header.h"
#include "gimptempbuf.h"
#include "gimp-utils.h"
#include "gimp-intl.h"
@@ -87,26 +88,11 @@ static GimpBrush * gimp_brush_load_abr_brush_v6 (GDataInputStream *input,
gint index,
GFile *file,
GError **error);
static gchar abr_read_char (GDataInputStream *input,
GError **error);
static gint16 abr_read_short (GDataInputStream *input,
GError **error);
static gint32 abr_read_long (GDataInputStream *input,
GError **error);
static gchar * abr_read_ucs2_text (GDataInputStream *input,
GError **error);
static gboolean abr_supported (AbrHeader *abr_hdr,
GError **error);
static gboolean abr_reach_8bim_section (GDataInputStream *input,
const gchar *name,
GError **error);
static gboolean abr_rle_decode (GDataInputStream *input,
gchar *buffer,
gsize buffer_size,
gint32 height,
GError **error);
/* public functions */
@@ -481,13 +467,11 @@ gimp_brush_load_abr (GimpContext *context,
g_data_input_stream_set_byte_order (data_input,
G_DATA_STREAM_BYTE_ORDER_BIG_ENDIAN);
abr_hdr.version = abr_read_short (data_input, &my_error);
if (my_error)
if (! gimp_data_input_stream_read_short (data_input, &abr_hdr.version, &my_error))
goto done;
/* sub-version for ABR v6 */
abr_hdr.count = abr_read_short (data_input, &my_error);
if (my_error)
if (! gimp_data_input_stream_read_short (data_input, &abr_hdr.count, &my_error))
goto done;
if (abr_supported (&abr_hdr, &my_error))
@@ -578,8 +562,7 @@ gimp_brush_load_abr_v6 (GDataInputStream *input,
if (! abr_reach_8bim_section (input, "samp", error))
return brush_list;
sample_section_size = abr_read_long (input, error);
if (error && *error)
if (! gimp_data_input_stream_read_long (input, &sample_section_size, error))
return brush_list;
sample_section_end = (sample_section_size +
@@ -623,12 +606,10 @@ gimp_brush_load_abr_brush_v12 (GDataInputStream *input,
GimpBrush *brush = NULL;
AbrBrushHeader abr_brush_hdr;
abr_brush_hdr.type = abr_read_short (input, error);
if (error && *error)
if (! gimp_data_input_stream_read_short (input, &abr_brush_hdr.type, error))
return NULL;
abr_brush_hdr.size = abr_read_long (input, error);
if (error && *error)
if (! gimp_data_input_stream_read_long (input, &abr_brush_hdr.size, error))
return NULL;
if (abr_brush_hdr.size < 0)
@@ -668,43 +649,34 @@ gimp_brush_load_abr_brush_v12 (GDataInputStream *input,
gchar *name;
gchar *sample_name = NULL;
gchar *tmp;
gshort compress;
gchar compress;
abr_sampled_brush_hdr.misc = abr_read_long (input, error);
if (error && *error)
break;
abr_sampled_brush_hdr.spacing = abr_read_short (input, error);
if (error && *error)
if (! gimp_data_input_stream_read_long (input, &abr_sampled_brush_hdr.misc, error) ||
! gimp_data_input_stream_read_short (input, &abr_sampled_brush_hdr.spacing, error))
break;
if (abr_hdr->version == 2)
{
sample_name = abr_read_ucs2_text (input, error);
if (error && *error)
if (! gimp_data_input_stream_read_ucs2_text (input, &sample_name, error))
break;
}
abr_sampled_brush_hdr.antialiasing = abr_read_char (input, error);
if (error && *error)
if (! gimp_data_input_stream_read_char (input, &abr_sampled_brush_hdr.antialiasing, error))
break;
for (i = 0; i < 4; i++)
{
abr_sampled_brush_hdr.bounds[i] = abr_read_short (input, error);
if (error && *error)
if (! gimp_data_input_stream_read_short (input, &abr_sampled_brush_hdr.bounds[i], error))
break;
}
for (i = 0; i < 4; i++)
{
abr_sampled_brush_hdr.bounds_long[i] = abr_read_long (input, error);
if (error && *error)
if (! gimp_data_input_stream_read_long (input, &abr_sampled_brush_hdr.bounds_long[i], error))
break;
}
abr_sampled_brush_hdr.depth = abr_read_short (input, error);
if (error && *error)
if (! gimp_data_input_stream_read_short (input, &abr_sampled_brush_hdr.depth, error))
break;
height = (abr_sampled_brush_hdr.bounds_long[2] -
@@ -715,9 +687,9 @@ gimp_brush_load_abr_brush_v12 (GDataInputStream *input,
/* g_print ("width %i height %i bytes %i\n", width, height, bytes); */
if (width < 1 || width > 10000 ||
height < 1 || height > 10000 ||
bytes < 1 || bytes > 1 ||
if (width < 1 || width > GIMP_BRUSH_MAX_SIZE ||
height < 1 || height > GIMP_BRUSH_MAX_SIZE ||
bytes < 1 || bytes > 1 ||
G_MAXSIZE / width / height / bytes < 1)
{
g_set_error (error, GIMP_DATA_ERROR, GIMP_DATA_ERROR_READ,
@@ -771,8 +743,7 @@ gimp_brush_load_abr_brush_v12 (GDataInputStream *input,
mask = gimp_temp_buf_get_data (brush->priv->mask);
size = width * height * bytes;
compress = abr_read_char (input, error);
if (error && *error)
if (! gimp_data_input_stream_read_char (input, &compress, error))
{
g_object_unref (brush);
brush = NULL;
@@ -800,7 +771,7 @@ gimp_brush_load_abr_brush_v12 (GDataInputStream *input,
}
else
{
if (! abr_rle_decode (input, (gchar *) mask, size, height, error))
if (! gimp_data_input_stream_rle_decode (input, (gchar *) mask, size, height, error))
{
g_object_unref (brush);
brush = NULL;
@@ -846,8 +817,7 @@ gimp_brush_load_abr_brush_v6 (GDataInputStream *input,
gchar *name;
gboolean r;
brush_size = abr_read_long (input, error);
if (error && *error)
if (! gimp_data_input_stream_read_long (input, &brush_size, error))
return NULL;
if (brush_size < 0)
@@ -887,12 +857,13 @@ gimp_brush_load_abr_brush_v6 (GDataInputStream *input,
return NULL;
}
top = abr_read_long (input, error); if (error && *error) return NULL;
left = abr_read_long (input, error); if (error && *error) return NULL;
bottom = abr_read_long (input, error); if (error && *error) return NULL;
right = abr_read_long (input, error); if (error && *error) return NULL;
depth = abr_read_short (input, error); if (error && *error) return NULL;
compress = abr_read_char (input, error); if (error && *error) return NULL;
if (! gimp_data_input_stream_read_long (input, &top, error) ||
! gimp_data_input_stream_read_long (input, &left, error) ||
! gimp_data_input_stream_read_long (input, &bottom, error) ||
! gimp_data_input_stream_read_long (input, &right, error) ||
! gimp_data_input_stream_read_short (input, &depth, error) ||
! gimp_data_input_stream_read_char (input, &compress, error))
return NULL;
depth = depth >> 3;
@@ -905,10 +876,10 @@ gimp_brush_load_abr_brush_v6 (GDataInputStream *input,
width, height, depth, compress);
#endif
if (width < 1 || width > 10000 ||
height < 1 || height > 10000 ||
(compress && depth != 1) ||
(! compress && (depth < 1 || depth > 2)) ||
if (width < 1 || width > GIMP_BRUSH_MAX_SIZE ||
height < 1 || height > GIMP_BRUSH_MAX_SIZE ||
(compress && depth != 1) ||
(! compress && (depth < 1 || depth > 2)) ||
G_MAXSIZE / width / height / depth < 1)
{
g_set_error (error, GIMP_DATA_ERROR, GIMP_DATA_ERROR_READ,
@@ -994,7 +965,7 @@ gimp_brush_load_abr_brush_v6 (GDataInputStream *input,
}
else
{
if (! abr_rle_decode (input, (gchar *) mask, size, height, error))
if (! gimp_data_input_stream_rle_decode (input, (gchar *) mask, size, height, error))
{
g_object_unref (brush);
return NULL;
@@ -1008,67 +979,6 @@ gimp_brush_load_abr_brush_v6 (GDataInputStream *input,
return brush;
}
static gchar
abr_read_char (GDataInputStream *input,
GError **error)
{
return g_data_input_stream_read_byte (input, NULL, error);
}
static gint16
abr_read_short (GDataInputStream *input,
GError **error)
{
return g_data_input_stream_read_int16 (input, NULL, error);
}
static gint32
abr_read_long (GDataInputStream *input,
GError **error)
{
return g_data_input_stream_read_int32 (input, NULL, error);
}
static gchar *
abr_read_ucs2_text (GDataInputStream *input,
GError **error)
{
gchar *name_ucs2;
gchar *name_utf8;
gint len;
gint i;
/* two-bytes characters encoded (UCS-2)
* format:
* long : number of characters in string
* data : zero terminated UCS-2 string
*/
len = 2 * abr_read_long (input, error);
if (len <= 0)
return NULL;
name_ucs2 = g_new (gchar, len);
for (i = 0; i < len; i++)
{
name_ucs2[i] = abr_read_char (input, error);
if (error && *error)
{
g_free (name_ucs2);
return NULL;
}
}
name_utf8 = g_convert (name_ucs2, len,
"UTF-8", "UCS-2BE",
NULL, NULL, NULL);
g_free (name_ucs2);
return name_utf8;
}
static gboolean
abr_supported (AbrHeader *abr_hdr,
GError **error)
@@ -1110,7 +1020,7 @@ abr_reach_8bim_section (GDataInputStream *input,
{
gchar tag[4];
gchar tagname[5];
guint32 section_size;
gint32 section_size;
gsize bytes_read;
if (! g_input_stream_read_all (G_INPUT_STREAM (input),
@@ -1133,8 +1043,7 @@ abr_reach_8bim_section (GDataInputStream *input,
if (! strncmp (tagname, name, 4))
return TRUE;
section_size = abr_read_long (input, error);
if (error && *error)
if (! gimp_data_input_stream_read_long (input, &section_size, error))
return FALSE;
if (! g_seekable_seek (G_SEEKABLE (input), section_size, G_SEEK_CUR,
@@ -1144,101 +1053,3 @@ abr_reach_8bim_section (GDataInputStream *input,
return FALSE;
}
static gboolean
abr_rle_decode (GDataInputStream *input,
gchar *buffer,
gsize buffer_size,
gint32 height,
GError **error)
{
gint i, j;
gshort *cscanline_len = NULL;
gchar *cdata = NULL;
gchar *data = buffer;
/* read compressed size foreach scanline */
cscanline_len = gegl_scratch_new (gshort, height);
for (i = 0; i < height; i++)
{
cscanline_len[i] = abr_read_short (input, error);
if ((error && *error) || cscanline_len[i] <= 0)
goto err;
}
/* unpack each scanline data */
for (i = 0; i < height; i++)
{
gint len;
gsize bytes_read;
len = cscanline_len[i];
cdata = gegl_scratch_alloc (len);
if (! g_input_stream_read_all (G_INPUT_STREAM (input),
cdata, len,
&bytes_read, NULL, error) ||
bytes_read != len)
{
goto err;
}
for (j = 0; j < len;)
{
gint32 n = cdata[j++];
if (n >= 128) /* force sign */
n -= 256;
if (n < 0)
{
/* copy the following char -n + 1 times */
if (n == -128) /* it's a nop */
continue;
n = -n + 1;
if (j + 1 > len || (data - buffer) + n > buffer_size)
goto err;
memset (data, cdata[j], n);
j += 1;
data += n;
}
else
{
/* read the following n + 1 chars (no compr) */
n = n + 1;
if (j + n > len || (data - buffer) + n > buffer_size)
goto err;
memcpy (data, &cdata[j], n);
j += n;
data += n;
}
}
g_clear_pointer (&cdata, gegl_scratch_free);
}
g_clear_pointer (&cscanline_len, gegl_scratch_free);
return TRUE;
err:
g_clear_pointer (&cdata, gegl_scratch_free);
g_clear_pointer (&cscanline_len, gegl_scratch_free);
if (error && ! *error)
{
g_set_error (error, GIMP_DATA_ERROR, GIMP_DATA_ERROR_READ,
_("Fatal parse error in brush file: "
"RLE compressed brush data corrupt."));
}
return FALSE;
}

View File

@@ -26,6 +26,7 @@
#include "core-types.h"
#include "gimp.h"
#include "gimpbezierdesc.h"
#include "gimpbrush.h"
#include "gimpbrush-boundary.h"
@@ -37,6 +38,7 @@
#include "gimpbrushcache.h"
#include "gimpbrushgenerated.h"
#include "gimpbrushpipe.h"
#include "gimpcontext.h"
#include "gimptagged.h"
#include "gimptempbuf.h"
@@ -77,7 +79,8 @@ static gboolean gimp_brush_get_size (GimpViewable *vie
static GimpTempBuf * gimp_brush_get_new_preview (GimpViewable *viewable,
GimpContext *context,
gint width,
gint height);
gint height,
GeglColor *fg_color);
static gchar * gimp_brush_get_description (GimpViewable *viewable,
gchar **tooltip);
@@ -131,6 +134,7 @@ gimp_brush_class_init (GimpBrushClass *klass)
gimp_object_class->get_memsize = gimp_brush_get_memsize;
viewable_class->default_icon_name = "gimp-tool-paintbrush";
viewable_class->default_name = _("Brush");
viewable_class->get_size = gimp_brush_get_size;
viewable_class->get_new_preview = gimp_brush_get_new_preview;
viewable_class->get_description = gimp_brush_get_description;
@@ -270,7 +274,8 @@ static GimpTempBuf *
gimp_brush_get_new_preview (GimpViewable *viewable,
GimpContext *context,
gint width,
gint height)
gint height,
GeglColor *fg_color)
{
GimpBrush *brush = GIMP_BRUSH (viewable);
const GimpTempBuf *mask_buf = brush->priv->mask;
@@ -366,13 +371,18 @@ gimp_brush_get_new_preview (GimpViewable *viewable,
}
else
{
guint8 rgb[3] = { 0, 0, 0 };
if (fg_color)
gegl_color_get_pixel (fg_color, babl_format ("R'G'B' u8"), rgb);
for (y = 0; y < mask_height; y++)
{
for (x = 0; x < mask_width ; x++)
{
*buf++ = 0;
*buf++ = 0;
*buf++ = 0;
*buf++ = rgb[0];
*buf++ = rgb[1];
*buf++ = rgb[2];
*buf++ = *mask++;
}
}

View File

@@ -35,6 +35,8 @@
#include "gimpimage.h"
#include "gimptempbuf.h"
#include "gimp-intl.h"
static void gimp_color_managed_iface_init (GimpColorManagedInterface *iface);
@@ -61,11 +63,13 @@ static gboolean gimp_buffer_get_popup_size (GimpViewable *viewable,
static GimpTempBuf * gimp_buffer_get_new_preview (GimpViewable *viewable,
GimpContext *context,
gint width,
gint height);
gint height,
GeglColor *fg_color);
static GdkPixbuf * gimp_buffer_get_new_pixbuf (GimpViewable *viewable,
GimpContext *context,
gint width,
gint height);
gint height,
GeglColor *fg_color);
static gchar * gimp_buffer_get_description (GimpViewable *viewable,
gchar **tooltip);
@@ -97,6 +101,7 @@ gimp_buffer_class_init (GimpBufferClass *klass)
gimp_object_class->get_memsize = gimp_buffer_get_memsize;
viewable_class->default_icon_name = "edit-paste";
viewable_class->default_name = _("Buffer");
viewable_class->name_editable = TRUE;
viewable_class->get_size = gimp_buffer_get_size;
viewable_class->get_preview_size = gimp_buffer_get_preview_size;
@@ -224,7 +229,8 @@ static GimpTempBuf *
gimp_buffer_get_new_preview (GimpViewable *viewable,
GimpContext *context,
gint width,
gint height)
gint height,
GeglColor *fg_color G_GNUC_UNUSED)
{
GimpBuffer *buffer = GIMP_BUFFER (viewable);
const Babl *format = gimp_buffer_get_format (buffer);
@@ -258,7 +264,8 @@ static GdkPixbuf *
gimp_buffer_get_new_pixbuf (GimpViewable *viewable,
GimpContext *context,
gint width,
gint height)
gint height,
GeglColor *fg_color G_GNUC_UNUSED)
{
GimpBuffer *buffer = GIMP_BUFFER (viewable);
GdkPixbuf *pixbuf;

View File

@@ -556,24 +556,28 @@ gimp_channel_combine_items (GimpChannel *mask,
if (g_list_length (layers) == 1)
{
GimpChannel *alpha;
gint offset_x;
gint offset_y;
if (gimp_drawable_has_alpha (layers->data))
{
GimpChannel *alpha;
gint offset_x;
gint offset_y;
alpha = gimp_channel_new_from_alpha (image,
layers->data, NULL, NULL);
gimp_item_get_offset (layers->data, &offset_x, &offset_y);
gimp_channel_combine_mask (channel, alpha,
GIMP_CHANNEL_OP_REPLACE,
offset_x, offset_y);
g_object_unref (alpha);
}
else
{
gimp_channel_all (channel, FALSE);
alpha = gimp_channel_new (image,
gimp_item_get_width (layers->data),
gimp_item_get_height (layers->data),
NULL, NULL);
gimp_channel_all (alpha, FALSE);
}
gimp_item_get_offset (layers->data, &offset_x, &offset_y);
gimp_channel_combine_mask (channel, alpha,
GIMP_CHANNEL_OP_REPLACE,
offset_x, offset_y);
g_object_unref (alpha);
}
}

View File

@@ -281,7 +281,7 @@ gimp_channel_select_polygon (GimpChannel *channel,
void
gimp_channel_select_path (GimpChannel *channel,
const gchar *undo_desc,
GimpPath *vectors,
GimpPath *path,
GimpChannelOps op,
gboolean antialias,
gboolean feather,
@@ -294,9 +294,9 @@ gimp_channel_select_path (GimpChannel *channel,
g_return_if_fail (GIMP_IS_CHANNEL (channel));
g_return_if_fail (gimp_item_is_attached (GIMP_ITEM (channel)));
g_return_if_fail (undo_desc != NULL);
g_return_if_fail (GIMP_IS_PATH (vectors));
g_return_if_fail (GIMP_IS_PATH (path));
bezier = gimp_path_get_bezier (vectors);
bezier = gimp_path_get_bezier (path);
if (bezier && bezier->num_data > 4)
{

View File

@@ -81,7 +81,7 @@ void gimp_channel_select_polygon (GimpChannel *channel,
gboolean push_undo);
void gimp_channel_select_path (GimpChannel *channel,
const gchar *undo_desc,
GimpPath *vectors,
GimpPath *path,
GimpChannelOps op,
gboolean antialias,
gboolean feather,

View File

@@ -236,8 +236,9 @@ gimp_channel_class_init (GimpChannelClass *klass)
gimp_object_class->get_memsize = gimp_channel_get_memsize;
viewable_class->get_description = gimp_channel_get_description;
viewable_class->default_icon_name = "gimp-channel";
viewable_class->default_name = _("Channel");
viewable_class->get_description = gimp_channel_get_description;
filter_class->get_node = gimp_channel_get_node;
@@ -253,7 +254,6 @@ gimp_channel_class_init (GimpChannelClass *klass)
item_class->fill = gimp_channel_fill;
item_class->stroke = gimp_channel_stroke;
item_class->to_selection = gimp_channel_to_selection;
item_class->default_name = _("Channel");
item_class->rename_desc = C_("undo-type", "Rename Channel");
item_class->translate_desc = C_("undo-type", "Move Channel");
item_class->scale_desc = C_("undo-type", "Scale Channel");
@@ -315,6 +315,7 @@ gimp_channel_init (GimpChannel *channel)
channel->num_segs_in = 0;
channel->num_segs_out = 0;
channel->empty = FALSE;
channel->full = FALSE;
channel->bounds_known = FALSE;
channel->x1 = 0;
channel->y1 = 0;
@@ -469,7 +470,7 @@ gimp_channel_bounds (GimpItem *item,
&channel->y1,
&channel->x2,
&channel->y2);
channel->full = FALSE;
channel->bounds_known = TRUE;
}
@@ -503,6 +504,7 @@ gimp_channel_duplicate (GimpItem *item,
/* selection mask variables */
new_channel->bounds_known = channel->bounds_known;
new_channel->empty = channel->empty;
new_channel->full = channel->full;
new_channel->x1 = channel->x1;
new_channel->y1 = channel->y1;
new_channel->x2 = channel->x2;
@@ -706,8 +708,8 @@ gimp_channel_scale (GimpItem *item,
new_offset_y = 0;
}
/* don't waste CPU cycles scaling an empty channel */
if (channel->bounds_known && channel->empty)
/* don't waste CPU cycles scaling an empty or full channel */
if (channel->bounds_known && (channel->empty || channel->full))
{
GimpDrawable *drawable = GIMP_DRAWABLE (item);
GeglBuffer *new_buffer;
@@ -724,7 +726,10 @@ gimp_channel_scale (GimpItem *item,
TRUE);
g_object_unref (new_buffer);
gimp_channel_clear (GIMP_CHANNEL (item), NULL, FALSE);
if (channel->empty)
gimp_channel_clear (GIMP_CHANNEL (item), NULL, FALSE);
else
gimp_channel_all (GIMP_CHANNEL (item), FALSE);
}
else
{
@@ -1105,6 +1110,7 @@ gimp_channel_real_is_empty (GimpChannel *channel)
g_clear_pointer (&channel->segs_out, g_free);
channel->empty = TRUE;
channel->full = FALSE;
channel->num_segs_in = 0;
channel->num_segs_out = 0;
channel->bounds_known = TRUE;
@@ -1120,11 +1126,10 @@ gimp_channel_real_is_empty (GimpChannel *channel)
static gboolean
gimp_channel_real_is_full (GimpChannel *channel)
{
return ! gimp_channel_is_empty (channel) &&
channel->x1 == 0 &&
channel->y1 == 0 &&
channel->x2 == gimp_item_get_width (GIMP_ITEM (channel)) &&
channel->y2 == gimp_item_get_height (GIMP_ITEM (channel));
if (channel->bounds_known)
return channel->full;
return FALSE;
}
static void
@@ -1232,6 +1237,7 @@ gimp_channel_real_clear (GimpChannel *channel,
/* we know the bounds */
channel->bounds_known = TRUE;
channel->empty = TRUE;
channel->full = FALSE;
channel->x1 = 0;
channel->y1 = 0;
channel->x2 = gimp_item_get_width (GIMP_ITEM (channel));
@@ -1260,6 +1266,7 @@ gimp_channel_real_all (GimpChannel *channel,
/* we know the bounds */
channel->bounds_known = TRUE;
channel->empty = FALSE;
channel->full = TRUE;
channel->x1 = 0;
channel->y1 = 0;
channel->x2 = gimp_item_get_width (GIMP_ITEM (channel));
@@ -1282,6 +1289,10 @@ gimp_channel_real_invert (GimpChannel *channel,
{
gimp_channel_all (channel, FALSE);
}
else if (channel->bounds_known && channel->full)
{
gimp_channel_clear (channel, NULL, FALSE);
}
else
{
gimp_gegl_apply_invert_linear (gimp_drawable_get_buffer (drawable),
@@ -1389,7 +1400,8 @@ gimp_channel_real_grow (GimpChannel *channel,
x2 += x1;
y2 += y1;
if (gimp_channel_is_empty (channel))
if (gimp_channel_is_empty (channel) ||
gimp_channel_is_full (channel))
return;
if (x1 - radius_x > 0)
@@ -1486,7 +1498,8 @@ gimp_channel_real_flood (GimpChannel *channel,
if (! gimp_item_bounds (GIMP_ITEM (channel), &x, &y, &width, &height))
return;
if (gimp_channel_is_empty (channel))
if (gimp_channel_is_empty (channel) ||
gimp_channel_is_full (channel))
return;
if (push_undo)

View File

@@ -50,6 +50,7 @@ struct _GimpChannel
gint num_segs_in; /* number of lines in boundary */
gint num_segs_out; /* number of lines in boundary */
gboolean empty; /* is the region empty? */
gboolean full; /* is the region completely full? */
gboolean bounds_known; /* recalculate the bounds? */
gint x1, y1; /* coordinates for bounding box */
gint x2, y2; /* lower right hand coordinate */

View File

@@ -71,8 +71,8 @@ gimp_container_filter (GimpContainer *container,
result =
g_object_new (G_TYPE_FROM_INSTANCE (container),
"children-type", gimp_container_get_children_type (container),
"policy", GIMP_CONTAINER_POLICY_WEAK,
"child-type", gimp_container_get_child_type (container),
"policy", GIMP_CONTAINER_POLICY_WEAK,
NULL);
context.filter = filter;

View File

@@ -56,7 +56,7 @@ enum
enum
{
PROP_0,
PROP_CHILDREN_TYPE,
PROP_CHILD_TYPE,
PROP_POLICY
};
@@ -72,18 +72,21 @@ typedef struct
struct _GimpContainerPrivate
{
GType children_type;
GType child_type;
GimpContainerPolicy policy;
gint n_children;
GList *handlers;
gint freeze_count;
gint n_children_before_freeze;
gint suspend_items_changed;
};
/* local function prototypes */
static void gimp_container_config_iface_init (GimpConfigInterface *iface);
static void gimp_container_list_model_iface_init (GListModelInterface *iface);
static void gimp_container_config_iface_init (GimpConfigInterface *iface);
static void gimp_container_dispose (GObject *object);
@@ -103,6 +106,15 @@ static void gimp_container_real_add (GimpContainer *container,
GimpObject *object);
static void gimp_container_real_remove (GimpContainer *container,
GimpObject *object);
static void gimp_container_real_reorder (GimpContainer *container,
GimpObject *object,
gint old_index,
gint new_index);
static GType gimp_container_get_item_type (GListModel *list);
static guint gimp_container_get_n_items (GListModel *list);
static gpointer gimp_container_get_item (GListModel *list,
guint index);
static gboolean gimp_container_serialize (GimpConfig *config,
GimpConfigWriter *writer,
@@ -121,6 +133,8 @@ static void gimp_container_free_handler (GimpContainer *container,
G_DEFINE_TYPE_WITH_CODE (GimpContainer, gimp_container, GIMP_TYPE_OBJECT,
G_ADD_PRIVATE (GimpContainer)
G_IMPLEMENT_INTERFACE (G_TYPE_LIST_MODEL,
gimp_container_list_model_iface_init)
G_IMPLEMENT_INTERFACE (GIMP_TYPE_CONFIG,
gimp_container_config_iface_init))
@@ -159,9 +173,10 @@ gimp_container_class_init (GimpContainerClass *klass)
G_SIGNAL_RUN_FIRST,
G_STRUCT_OFFSET (GimpContainerClass, reorder),
NULL, NULL,
gimp_marshal_VOID__OBJECT_INT,
G_TYPE_NONE, 2,
gimp_marshal_VOID__OBJECT_INT_INT,
G_TYPE_NONE, 3,
GIMP_TYPE_OBJECT,
G_TYPE_INT,
G_TYPE_INT);
container_signals[FREEZE] =
@@ -188,7 +203,7 @@ gimp_container_class_init (GimpContainerClass *klass)
klass->add = gimp_container_real_add;
klass->remove = gimp_container_real_remove;
klass->reorder = NULL;
klass->reorder = gimp_container_real_reorder;
klass->freeze = NULL;
klass->thaw = NULL;
@@ -202,8 +217,8 @@ gimp_container_class_init (GimpContainerClass *klass)
klass->get_child_by_index = NULL;
klass->get_child_index = NULL;
g_object_class_install_property (object_class, PROP_CHILDREN_TYPE,
g_param_spec_gtype ("children-type",
g_object_class_install_property (object_class, PROP_CHILD_TYPE,
g_param_spec_gtype ("child-type",
NULL, NULL,
GIMP_TYPE_OBJECT,
GIMP_PARAM_READWRITE |
@@ -218,6 +233,14 @@ gimp_container_class_init (GimpContainerClass *klass)
G_PARAM_CONSTRUCT_ONLY));
}
static void
gimp_container_list_model_iface_init (GListModelInterface *iface)
{
iface->get_item_type = gimp_container_get_item_type;
iface->get_n_items = gimp_container_get_n_items;
iface->get_item = gimp_container_get_item;
}
static void
gimp_container_config_iface_init (GimpConfigInterface *iface)
{
@@ -229,12 +252,13 @@ static void
gimp_container_init (GimpContainer *container)
{
container->priv = gimp_container_get_instance_private (container);
container->priv->handlers = NULL;
container->priv->freeze_count = 0;
container->priv->children_type = G_TYPE_NONE;
container->priv->policy = GIMP_CONTAINER_POLICY_STRONG;
container->priv->n_children = 0;
container->priv->handlers = NULL;
container->priv->freeze_count = 0;
container->priv->child_type = G_TYPE_NONE;
container->priv->policy = GIMP_CONTAINER_POLICY_STRONG;
container->priv->n_children = 0;
}
static void
@@ -249,10 +273,10 @@ gimp_container_dispose (GObject *object)
((GimpContainerHandler *)
container->priv->handlers->data)->quark);
if (container->priv->children_type != G_TYPE_NONE)
if (container->priv->child_type != G_TYPE_NONE)
{
g_type_class_unref (g_type_class_peek (container->priv->children_type));
container->priv->children_type = G_TYPE_NONE;
g_type_class_unref (g_type_class_peek (container->priv->child_type));
container->priv->child_type = G_TYPE_NONE;
}
G_OBJECT_CLASS (parent_class)->dispose (object);
@@ -268,9 +292,9 @@ gimp_container_set_property (GObject *object,
switch (property_id)
{
case PROP_CHILDREN_TYPE:
container->priv->children_type = g_value_get_gtype (value);
g_type_class_ref (container->priv->children_type);
case PROP_CHILD_TYPE:
container->priv->child_type = g_value_get_gtype (value);
g_type_class_ref (container->priv->child_type);
break;
case PROP_POLICY:
container->priv->policy = g_value_get_enum (value);
@@ -291,8 +315,8 @@ gimp_container_get_property (GObject *object,
switch (property_id)
{
case PROP_CHILDREN_TYPE:
g_value_set_gtype (value, container->priv->children_type);
case PROP_CHILD_TYPE:
g_value_set_gtype (value, container->priv->child_type);
break;
case PROP_POLICY:
g_value_set_enum (value, container->priv->policy);
@@ -338,6 +362,43 @@ gimp_container_real_remove (GimpContainer *container,
container->priv->n_children--;
}
static void
gimp_container_real_reorder (GimpContainer *container,
GimpObject *object,
gint old_index,
gint new_index)
{
}
/* GListModel functions */
static GType
gimp_container_get_item_type (GListModel *list)
{
return gimp_container_get_child_type (GIMP_CONTAINER (list));
}
static guint
gimp_container_get_n_items (GListModel *list)
{
return gimp_container_get_n_children (GIMP_CONTAINER (list));
}
static void *
gimp_container_get_item (GListModel *list,
guint index)
{
GimpContainer *self = GIMP_CONTAINER (list);
if (index >= gimp_container_get_n_children (self))
return NULL;
return g_object_ref (gimp_container_get_child_by_index (self, index));
}
/* GimpConfig functions */
typedef struct
{
@@ -434,12 +495,12 @@ gimp_container_deserialize (GimpConfig *config,
return FALSE;
}
if (! g_type_is_a (type, container->priv->children_type))
if (! g_type_is_a (type, container->priv->child_type))
{
g_scanner_error (scanner,
"'%s' is not a subclass of '%s'",
scanner->value.v_identifier,
g_type_name (container->priv->children_type));
g_type_name (container->priv->child_type));
return FALSE;
}
@@ -555,11 +616,11 @@ gimp_container_free_handler (GimpContainer *container,
}
GType
gimp_container_get_children_type (GimpContainer *container)
gimp_container_get_child_type (GimpContainer *container)
{
g_return_val_if_fail (GIMP_IS_CONTAINER (container), G_TYPE_NONE);
return container->priv->children_type;
return container->priv->child_type;
}
GimpContainerPolicy
@@ -588,7 +649,7 @@ gimp_container_add (GimpContainer *container,
g_return_val_if_fail (GIMP_IS_CONTAINER (container), FALSE);
g_return_val_if_fail (object != NULL, FALSE);
g_return_val_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (object,
container->priv->children_type),
container->priv->child_type),
FALSE);
if (gimp_container_have (container, object))
@@ -638,6 +699,14 @@ gimp_container_add (GimpContainer *container,
container->priv->n_children++;
}
if (container->priv->freeze_count == 0 &&
container->priv->suspend_items_changed == 0)
{
gint index = gimp_container_get_child_index (container, object);
g_list_model_items_changed (G_LIST_MODEL (container), index, 0, 1);
}
return TRUE;
}
@@ -647,11 +716,12 @@ gimp_container_remove (GimpContainer *container,
{
GList *list;
gint n_children;
gint index;
g_return_val_if_fail (GIMP_IS_CONTAINER (container), FALSE);
g_return_val_if_fail (object != NULL, FALSE);
g_return_val_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (object,
container->priv->children_type),
container->priv->child_type),
FALSE);
if (! gimp_container_have (container, object))
@@ -678,6 +748,7 @@ gimp_container_remove (GimpContainer *container,
}
n_children = container->priv->n_children;
index = gimp_container_get_child_index (container, object);
g_signal_emit (container, container_signals[REMOVE], 0, object);
@@ -703,6 +774,12 @@ gimp_container_remove (GimpContainer *container,
break;
}
if (container->priv->freeze_count == 0 &&
container->priv->suspend_items_changed == 0)
{
g_list_model_items_changed (G_LIST_MODEL (container), index, 1, 0);
}
return TRUE;
}
@@ -711,10 +788,12 @@ gimp_container_insert (GimpContainer *container,
GimpObject *object,
gint index)
{
gboolean success = FALSE;
g_return_val_if_fail (GIMP_IS_CONTAINER (container), FALSE);
g_return_val_if_fail (object != NULL, FALSE);
g_return_val_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (object,
container->priv->children_type),
container->priv->child_type),
FALSE);
g_return_val_if_fail (index >= -1 &&
@@ -727,12 +806,30 @@ gimp_container_insert (GimpContainer *container,
return FALSE;
}
container->priv->suspend_items_changed++;
if (gimp_container_add (container, object))
{
return gimp_container_reorder (container, object, index);
/* set success to TRUE even if reorder() fails, because the
* object has in fact been added
*/
success = TRUE;
gimp_container_reorder (container, object, index);
}
return FALSE;
container->priv->suspend_items_changed--;
if (success &&
container->priv->freeze_count == 0 &&
container->priv->suspend_items_changed == 0)
{
gint index = gimp_container_get_child_index (container, object);
g_list_model_items_changed (G_LIST_MODEL (container), index, 0, 1);
}
return success;
}
gboolean
@@ -740,12 +837,12 @@ gimp_container_reorder (GimpContainer *container,
GimpObject *object,
gint new_index)
{
gint index;
gint old_index;
g_return_val_if_fail (GIMP_IS_CONTAINER (container), FALSE);
g_return_val_if_fail (object != NULL, FALSE);
g_return_val_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (object,
container->priv->children_type),
container->priv->child_type),
FALSE);
g_return_val_if_fail (new_index >= -1 &&
@@ -754,18 +851,31 @@ gimp_container_reorder (GimpContainer *container,
if (new_index == -1)
new_index = container->priv->n_children - 1;
index = gimp_container_get_child_index (container, object);
old_index = gimp_container_get_child_index (container, object);
if (index == -1)
if (old_index == -1)
{
g_warning ("%s: container %p does not contain object %p",
G_STRFUNC, container, object);
return FALSE;
}
if (index != new_index)
g_signal_emit (container, container_signals[REORDER], 0,
object, new_index);
if (old_index != new_index)
{
g_signal_emit (container, container_signals[REORDER], 0,
object, old_index, new_index);
if (container->priv->freeze_count == 0 &&
container->priv->suspend_items_changed == 0)
{
gint new_index = gimp_container_get_child_index (container, object);
g_list_model_items_changed (G_LIST_MODEL (container),
MIN (old_index, new_index),
ABS (old_index - new_index) + 1,
ABS (old_index - new_index) + 1);
}
}
return TRUE;
}
@@ -778,19 +888,30 @@ gimp_container_freeze (GimpContainer *container)
container->priv->freeze_count++;
if (container->priv->freeze_count == 1)
g_signal_emit (container, container_signals[FREEZE], 0);
{
container->priv->n_children_before_freeze = container->priv->n_children;
g_signal_emit (container, container_signals[FREEZE], 0);
}
}
void
gimp_container_thaw (GimpContainer *container)
{
g_return_if_fail (GIMP_IS_CONTAINER (container));
g_return_if_fail (container->priv->freeze_count > 0);
if (container->priv->freeze_count > 0)
container->priv->freeze_count--;
container->priv->freeze_count--;
if (container->priv->freeze_count == 0)
g_signal_emit (container, container_signals[THAW], 0);
{
g_list_model_items_changed (G_LIST_MODEL (container), 0,
container->priv->n_children_before_freeze,
container->priv->n_children);
container->priv->n_children_before_freeze = 0;
g_signal_emit (container, container_signals[THAW], 0);
}
}
gboolean
@@ -981,7 +1102,7 @@ gimp_container_get_child_index (GimpContainer *container,
g_return_val_if_fail (GIMP_IS_CONTAINER (container), -1);
g_return_val_if_fail (object != NULL, -1);
g_return_val_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (object,
container->priv->children_type),
container->priv->child_type),
-1);
return GIMP_CONTAINER_GET_CLASS (container)->get_child_index (container,
@@ -1076,7 +1197,7 @@ gimp_container_add_handler (GimpContainer *container,
if (! g_str_has_prefix (signame, "notify::"))
g_return_val_if_fail (g_signal_lookup (signame,
container->priv->children_type), 0);
container->priv->child_type), 0);
handler = g_slice_new0 (GimpContainerHandler);
@@ -1154,8 +1275,8 @@ gimp_container_remove_handlers_by_func (GimpContainer *container,
{
gimp_container_free_handler (container, handler);
container->priv->handlers = g_list_delete_link (
container->priv->handlers, list);
container->priv->handlers =
g_list_delete_link (container->priv->handlers, list);
}
list = next;
@@ -1181,8 +1302,8 @@ gimp_container_remove_handlers_by_data (GimpContainer *container,
{
gimp_container_free_handler (container, handler);
container->priv->handlers = g_list_delete_link (
container->priv->handlers, list);
container->priv->handlers =
g_list_delete_link (container->priv->handlers, list);
}
list = next;

View File

@@ -58,6 +58,7 @@ struct _GimpContainerClass
GimpObject *object);
void (* reorder) (GimpContainer *container,
GimpObject *object,
gint old_index,
gint new_index);
void (* freeze) (GimpContainer *container);
void (* thaw) (GimpContainer *container);
@@ -86,7 +87,7 @@ struct _GimpContainerClass
GType gimp_container_get_type (void) G_GNUC_CONST;
GType gimp_container_get_children_type (GimpContainer *container);
GType gimp_container_get_child_type (GimpContainer *container);
GimpContainerPolicy gimp_container_get_policy (GimpContainer *container);
gint gimp_container_get_n_children (GimpContainer *container);
@@ -149,5 +150,7 @@ void gimp_container_remove_handlers_by_data
(GimpContainer *container,
gpointer callback_data);
G_DEFINE_AUTOPTR_CLEANUP_FUNC (GimpContainer, g_object_unref);
#endif /* __GIMP_CONTAINER_H__ */

View File

@@ -2296,8 +2296,7 @@ static void
gimp_context_paint_info_dirty (GimpPaintInfo *paint_info,
GimpContext *context)
{
g_free (context->paint_name);
context->paint_name = g_strdup (gimp_object_get_name (paint_info));
g_set_str (&context->paint_name, gimp_object_get_name (paint_info));
g_signal_emit (context, gimp_context_signals[PROP_NAME_CHANGED], 0,
GIMP_CONTEXT_PROP_PAINT_INFO);
@@ -2646,8 +2645,7 @@ static void
gimp_context_brush_dirty (GimpBrush *brush,
GimpContext *context)
{
g_free (context->brush_name);
context->brush_name = g_strdup (gimp_object_get_name (brush));
g_set_str (&context->brush_name, gimp_object_get_name (brush));
g_signal_emit (context, gimp_context_signals[PROP_NAME_CHANGED], 0,
GIMP_CONTEXT_PROP_BRUSH);
@@ -2760,8 +2758,7 @@ static void
gimp_context_dynamics_dirty (GimpDynamics *dynamics,
GimpContext *context)
{
g_free (context->dynamics_name);
context->dynamics_name = g_strdup (gimp_object_get_name (dynamics));
g_set_str (&context->dynamics_name, gimp_object_get_name (dynamics));
g_signal_emit (context, gimp_context_signals[PROP_NAME_CHANGED], 0,
GIMP_CONTEXT_PROP_DYNAMICS);
@@ -2873,8 +2870,7 @@ static void
gimp_context_mybrush_dirty (GimpMybrush *brush,
GimpContext *context)
{
g_free (context->mybrush_name);
context->mybrush_name = g_strdup (gimp_object_get_name (brush));
g_set_str (&context->mybrush_name, gimp_object_get_name (brush));
g_signal_emit (context, gimp_context_signals[PROP_NAME_CHANGED], 0,
GIMP_CONTEXT_PROP_MYBRUSH);
@@ -2986,8 +2982,7 @@ static void
gimp_context_pattern_dirty (GimpPattern *pattern,
GimpContext *context)
{
g_free (context->pattern_name);
context->pattern_name = g_strdup (gimp_object_get_name (pattern));
g_set_str (&context->pattern_name, gimp_object_get_name (pattern));
g_signal_emit (context, gimp_context_signals[PROP_NAME_CHANGED], 0,
GIMP_CONTEXT_PROP_PATTERN);
@@ -3099,8 +3094,7 @@ static void
gimp_context_gradient_dirty (GimpGradient *gradient,
GimpContext *context)
{
g_free (context->gradient_name);
context->gradient_name = g_strdup (gimp_object_get_name (gradient));
g_set_str (&context->gradient_name, gimp_object_get_name (gradient));
g_signal_emit (context, gimp_context_signals[PROP_NAME_CHANGED], 0,
GIMP_CONTEXT_PROP_GRADIENT);
@@ -3212,8 +3206,7 @@ static void
gimp_context_palette_dirty (GimpPalette *palette,
GimpContext *context)
{
g_free (context->palette_name);
context->palette_name = g_strdup (gimp_object_get_name (palette));
g_set_str (&context->palette_name, gimp_object_get_name (palette));
g_signal_emit (context, gimp_context_signals[PROP_NAME_CHANGED], 0,
GIMP_CONTEXT_PROP_PALETTE);
@@ -3344,8 +3337,7 @@ gimp_context_set_font_name (GimpContext *context,
*/
gimp_context_set_font (context, GIMP_FONT (gimp_font_get_standard ()));
g_free (context->font_name);
context->font_name = g_strdup (name);
g_set_str (&context->font_name, name);
}
}
@@ -3363,8 +3355,8 @@ static void
gimp_context_font_dirty (GimpFont *font,
GimpContext *context)
{
g_free (context->font_name);
context->font_name = g_strdup (gimp_object_get_name (font));
g_set_str (&context->font_name,
gimp_object_get_name (font));
g_signal_emit (context, gimp_context_signals[PROP_NAME_CHANGED], 0,
GIMP_CONTEXT_PROP_FONT);
@@ -3476,8 +3468,7 @@ static void
gimp_context_tool_preset_dirty (GimpToolPreset *tool_preset,
GimpContext *context)
{
g_free (context->tool_preset_name);
context->tool_preset_name = g_strdup (gimp_object_get_name (tool_preset));
g_set_str (&context->tool_preset_name, gimp_object_get_name (tool_preset));
g_signal_emit (context, gimp_context_signals[PROP_NAME_CHANGED], 0,
GIMP_CONTEXT_PROP_TOOL_PRESET);
@@ -3584,8 +3575,7 @@ static void
gimp_context_buffer_dirty (GimpBuffer *buffer,
GimpContext *context)
{
g_free (context->buffer_name);
context->buffer_name = g_strdup (gimp_object_get_name (buffer));
g_set_str (&context->buffer_name, gimp_object_get_name (buffer));
g_signal_emit (context, gimp_context_signals[PROP_NAME_CHANGED], 0,
GIMP_CONTEXT_PROP_BUFFER);
@@ -3700,8 +3690,7 @@ static void
gimp_context_imagefile_dirty (GimpImagefile *imagefile,
GimpContext *context)
{
g_free (context->imagefile_name);
context->imagefile_name = g_strdup (gimp_object_get_name (imagefile));
g_set_str (&context->imagefile_name, gimp_object_get_name (imagefile));
g_signal_emit (context, gimp_context_signals[PROP_NAME_CHANGED], 0,
GIMP_CONTEXT_PROP_IMAGEFILE);
@@ -3816,8 +3805,7 @@ static void
gimp_context_template_dirty (GimpTemplate *template,
GimpContext *context)
{
g_free (context->template_name);
context->template_name = g_strdup (gimp_object_get_name (template));
g_set_str (&context->template_name, gimp_object_get_name (template));
g_signal_emit (context, gimp_context_signals[PROP_NAME_CHANGED], 0,
GIMP_CONTEXT_PROP_TEMPLATE);

View File

@@ -86,7 +86,8 @@ static gboolean gimp_curve_get_popup_size (GimpViewable *viewable,
static GimpTempBuf * gimp_curve_get_new_preview (GimpViewable *viewable,
GimpContext *context,
gint width,
gint height);
gint height,
GeglColor *fg_color);
static gchar * gimp_curve_get_description (GimpViewable *viewable,
gchar **tooltip);
@@ -521,7 +522,8 @@ static GimpTempBuf *
gimp_curve_get_new_preview (GimpViewable *viewable,
GimpContext *context,
gint width,
gint height)
gint height,
GeglColor *fg_color G_GNUC_UNUSED)
{
return NULL;
}

View File

@@ -850,7 +850,7 @@ gimp_data_factory_get_data_type (GimpDataFactory *factory)
{
g_return_val_if_fail (GIMP_IS_DATA_FACTORY (factory), G_TYPE_NONE);
return gimp_container_get_children_type (factory->priv->container);
return gimp_container_get_child_type (factory->priv->container);
}
GimpContainer *

View File

@@ -52,9 +52,9 @@ gimp_document_list_new (Gimp *gimp)
g_return_val_if_fail (GIMP_IS_GIMP (gimp), NULL);
document_list = g_object_new (GIMP_TYPE_DOCUMENT_LIST,
"name", "document-list",
"children-type", GIMP_TYPE_IMAGEFILE,
"policy", GIMP_CONTAINER_POLICY_STRONG,
"name", "document-list",
"child-type", GIMP_TYPE_IMAGEFILE,
"policy", GIMP_CONTAINER_POLICY_STRONG,
NULL);
document_list->gimp = gimp;

View File

@@ -179,7 +179,7 @@ gimp_drawable_fill_boundary (GimpDrawable *drawable,
gboolean
gimp_drawable_fill_path (GimpDrawable *drawable,
GimpFillOptions *options,
GimpPath *vectors,
GimpPath *path,
gboolean push_undo,
GError **error)
{
@@ -188,14 +188,14 @@ gimp_drawable_fill_path (GimpDrawable *drawable,
g_return_val_if_fail (GIMP_IS_DRAWABLE (drawable), FALSE);
g_return_val_if_fail (gimp_item_is_attached (GIMP_ITEM (drawable)), FALSE);
g_return_val_if_fail (GIMP_IS_FILL_OPTIONS (options), FALSE);
g_return_val_if_fail (GIMP_IS_PATH (vectors), FALSE);
g_return_val_if_fail (GIMP_IS_PATH (path), FALSE);
g_return_val_if_fail (gimp_fill_options_get_style (options) !=
GIMP_FILL_STYLE_PATTERN ||
gimp_context_get_pattern (GIMP_CONTEXT (options)) != NULL,
FALSE);
g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
bezier = gimp_path_get_bezier (vectors);
bezier = gimp_path_get_bezier (path);
if (bezier && bezier->num_data > 4)
{

View File

@@ -47,7 +47,7 @@ void gimp_drawable_fill_boundary (GimpDrawable *drawable,
gboolean gimp_drawable_fill_path (GimpDrawable *drawable,
GimpFillOptions *options,
GimpPath *vectors,
GimpPath *path,
gboolean push_undo,
GError **error);

View File

@@ -49,6 +49,19 @@
#include "gimp-intl.h"
void
_gimp_drawable_filters_init (GimpDrawable *drawable)
{
drawable->private->filter_stack = gimp_filter_stack_new (GIMP_TYPE_FILTER);
}
void
_gimp_drawable_filters_finalize (GimpDrawable *drawable)
{
g_clear_object (&drawable->private->filter_stack);
}
GimpContainer *
gimp_drawable_get_filters (GimpDrawable *drawable)
{
@@ -77,6 +90,58 @@ gimp_drawable_has_visible_filters (GimpDrawable *drawable)
return FALSE;
}
gboolean
gimp_drawable_n_editable_filters (GimpDrawable *drawable,
gint *n_editable,
gint *first,
gint *last)
{
GList *list;
gboolean editing_blocked = FALSE;
gint index = 0;
gint n = 0;
gint first_editable = -1;
gint last_editable = -1;
g_return_val_if_fail (GIMP_IS_DRAWABLE (drawable), FALSE);
for (list = GIMP_LIST (drawable->private->filter_stack)->queue->head;
list;
list = g_list_next (list), index++)
{
GimpFilter *filter = list->data;
gboolean editable = FALSE;
if (GIMP_IS_DRAWABLE_FILTER (filter))
{
if (gimp_drawable_filter_get_temporary (GIMP_DRAWABLE_FILTER (filter)))
{
editing_blocked = TRUE;
}
else
{
editable = TRUE;
}
}
if (editable)
{
n++;
if (first_editable == -1)
first_editable = index;
last_editable = index;
}
}
if (n_editable) *n_editable = n;
if (first) *first = first_editable;
if (last) *last = last_editable;
return ! editing_blocked;
}
void
gimp_drawable_add_filter (GimpDrawable *drawable,
GimpFilter *filter)
@@ -115,16 +180,105 @@ gimp_drawable_clear_filters (GimpDrawable *drawable)
gimp_drawable_filters_changed (drawable);
}
gboolean
gimp_drawable_has_filter (GimpDrawable *drawable,
GimpFilter *filter)
{
gboolean filter_exists = FALSE;
g_return_val_if_fail (GIMP_IS_DRAWABLE (drawable), FALSE);
g_return_val_if_fail (GIMP_IS_FILTER (filter), FALSE);
filter_exists = gimp_container_have (drawable->private->filter_stack,
GIMP_OBJECT (filter));
return filter_exists;
}
gboolean
gimp_drawable_raise_filter (GimpDrawable *drawable,
GimpFilter *filter)
{
gint index;
g_return_val_if_fail (GIMP_IS_DRAWABLE (drawable), FALSE);
g_return_val_if_fail (GIMP_IS_DRAWABLE_FILTER (filter), FALSE);
g_return_val_if_fail (gimp_drawable_has_filter (drawable, filter), FALSE);
if (gimp_drawable_filter_get_mask (GIMP_DRAWABLE_FILTER (filter)) == NULL)
return FALSE;
index = gimp_container_get_child_index (drawable->private->filter_stack,
GIMP_OBJECT (filter));
index--;
if (index >= 0)
{
gimp_image_undo_push_filter_reorder (gimp_item_get_image (GIMP_ITEM (drawable)),
_("Reorder filter"),
drawable,
GIMP_DRAWABLE_FILTER (filter));
gimp_container_reorder (drawable->private->filter_stack,
GIMP_OBJECT (filter), index);
gimp_drawable_update (drawable, 0, 0, -1, -1);
return TRUE;
}
return FALSE;
}
gboolean
gimp_drawable_lower_filter (GimpDrawable *drawable,
GimpFilter *filter)
{
gint index;
g_return_val_if_fail (GIMP_IS_DRAWABLE (drawable), FALSE);
g_return_val_if_fail (GIMP_IS_DRAWABLE_FILTER (filter), FALSE);
g_return_val_if_fail (gimp_drawable_has_filter (drawable, filter), FALSE);
if (gimp_drawable_filter_get_mask (GIMP_DRAWABLE_FILTER (filter)) == NULL)
return FALSE;
index = gimp_container_get_child_index (drawable->private->filter_stack,
GIMP_OBJECT (filter));
index++;
if (index < gimp_container_get_n_children (drawable->private->filter_stack))
{
/* Don't rearrange filters with floating selection */
if (! GIMP_IS_DRAWABLE_FILTER (gimp_container_get_child_by_index (drawable->private->filter_stack,
index)))
return FALSE;
gimp_image_undo_push_filter_reorder (gimp_item_get_image (GIMP_ITEM (drawable)),
_("Reorder filter"),
drawable,
GIMP_DRAWABLE_FILTER (filter));
gimp_container_reorder (drawable->private->filter_stack,
GIMP_OBJECT (filter), index);
gimp_drawable_update (drawable, 0, 0, -1, -1);
return TRUE;
}
return FALSE;
}
void
gimp_drawable_merge_filters (GimpDrawable *drawable)
{
GList *list;
GimpImage *image;
GimpChannel *selection = NULL;
GeglBuffer *buffer = NULL;
GimpChannel *selection;
GeglBuffer *buffer;
GList *list;
if (! GIMP_IS_DRAWABLE (drawable))
return;
g_return_if_fail (GIMP_IS_DRAWABLE (drawable));
image = gimp_item_get_image (GIMP_ITEM (drawable));
@@ -145,7 +299,8 @@ gimp_drawable_merge_filters (GimpDrawable *drawable)
*/
if (GIMP_LIST (drawable->private->filter_stack)->queue->head)
{
GimpDrawableFilter *top_filter = NULL;
GimpDrawableFilter *filter = NULL;
gboolean add_alpha = FALSE;
for (list = GIMP_LIST (drawable->private->filter_stack)->queue->tail;
list;
@@ -153,34 +308,55 @@ gimp_drawable_merge_filters (GimpDrawable *drawable)
{
if (GIMP_IS_DRAWABLE_FILTER (list->data) &&
gimp_filter_get_active (GIMP_FILTER (list->data)))
top_filter = list->data;
{
filter = list->data;
if (! add_alpha)
add_alpha = gimp_drawable_filter_get_add_alpha (filter);
}
}
if (top_filter)
if (filter)
{
GimpApplicator *applicator;
GeglNode *graph;
GeglNode *output;
GeglRectangle output_rect;
if (GIMP_IS_LAYER (drawable) && add_alpha)
gimp_layer_add_alpha (GIMP_LAYER (drawable));
graph = gimp_filter_stack_get_graph (GIMP_FILTER_STACK (drawable->private->filter_stack));
output = gegl_node_get_output_proxy (graph, "output");
output_rect = gegl_node_get_bounding_box (output);
buffer = gegl_buffer_new (&output_rect, gimp_drawable_get_format (drawable));
applicator = gimp_filter_get_applicator (GIMP_FILTER (top_filter));
applicator = gimp_filter_get_applicator (GIMP_FILTER (filter));
gimp_applicator_set_dest_buffer (applicator, buffer);
gimp_applicator_blit (applicator, gegl_buffer_get_extent (buffer));
gimp_drawable_set_buffer (drawable, TRUE, NULL, buffer);
g_clear_object (&buffer);
}
while ((list = GIMP_LIST (drawable->private->filter_stack)->queue->tail))
/* don't use a for() loop because we are deleting the list
* under our feet
*/
list = GIMP_LIST (drawable->private->filter_stack)->queue->head;
while (list)
{
gimp_image_undo_push_filter_remove (gimp_item_get_image (GIMP_ITEM (drawable)),
_("Merge filter"), drawable, list->data);
filter = list->data;
gimp_drawable_remove_filter (drawable, GIMP_FILTER (list->data));
list = list->next;
if (GIMP_IS_DRAWABLE_FILTER (filter) &&
! gimp_drawable_filter_get_temporary (filter))
{
gimp_image_undo_push_filter_remove (gimp_item_get_image (GIMP_ITEM (drawable)),
_("Merge filter"),
drawable, filter);
gimp_drawable_remove_filter (drawable, GIMP_FILTER (filter));
}
}
}
@@ -197,21 +373,6 @@ gimp_drawable_merge_filters (GimpDrawable *drawable)
gimp_drawable_filters_changed (drawable);
}
gboolean
gimp_drawable_has_filter (GimpDrawable *drawable,
GimpFilter *filter)
{
gboolean filter_exists = FALSE;
g_return_val_if_fail (GIMP_IS_DRAWABLE (drawable), FALSE);
g_return_val_if_fail (GIMP_IS_FILTER (filter), FALSE);
filter_exists = gimp_container_have (drawable->private->filter_stack,
GIMP_OBJECT (filter));
return filter_exists;
}
gboolean
gimp_drawable_merge_filter (GimpDrawable *drawable,
GimpFilter *filter,

View File

@@ -21,21 +21,38 @@
#define __GIMP_DRAWABLE_FILTERS_H__
/* internal functions */
void _gimp_drawable_filters_init (GimpDrawable *drawable);
void _gimp_drawable_filters_finalize (GimpDrawable *drawable);
/* public functions */
GimpContainer * gimp_drawable_get_filters (GimpDrawable *drawable);
gboolean gimp_drawable_has_visible_filters (GimpDrawable *drawable);
gboolean gimp_drawable_n_editable_filters (GimpDrawable *drawable,
gint *n_editable,
gint *first,
gint *last);
void gimp_drawable_add_filter (GimpDrawable *drawable,
GimpFilter *filter);
void gimp_drawable_remove_filter (GimpDrawable *drawable,
GimpFilter *filter);
void gimp_drawable_clear_filters (GimpDrawable *drawable);
void gimp_drawable_merge_filters (GimpDrawable *drawable);
gboolean gimp_drawable_has_filter (GimpDrawable *drawable,
GimpFilter *filter);
gboolean gimp_drawable_raise_filter (GimpDrawable *drawable,
GimpFilter *filter);
gboolean gimp_drawable_lower_filter (GimpDrawable *drawable,
GimpFilter *filter);
void gimp_drawable_merge_filters (GimpDrawable *drawable);
gboolean gimp_drawable_merge_filter (GimpDrawable *drawable,
GimpFilter *filter,
GimpProgress *progress,

View File

@@ -112,7 +112,8 @@ GimpTempBuf *
gimp_drawable_get_new_preview (GimpViewable *viewable,
GimpContext *context,
gint width,
gint height)
gint height,
GeglColor *fg_color G_GNUC_UNUSED)
{
GimpItem *item = GIMP_ITEM (viewable);
GimpImage *image = gimp_item_get_image (item);
@@ -132,7 +133,8 @@ GdkPixbuf *
gimp_drawable_get_new_pixbuf (GimpViewable *viewable,
GimpContext *context,
gint width,
gint height)
gint height,
GeglColor *fg_color G_GNUC_UNUSED)
{
GimpItem *item = GIMP_ITEM (viewable);
GimpImage *image = gimp_item_get_image (item);

View File

@@ -25,11 +25,13 @@
GimpTempBuf * gimp_drawable_get_new_preview (GimpViewable *viewable,
GimpContext *context,
gint width,
gint height);
gint height,
GeglColor *fg_color);
GdkPixbuf * gimp_drawable_get_new_pixbuf (GimpViewable *viewable,
GimpContext *context,
gint width,
gint height);
gint height,
GeglColor *fg_color);
/*
* normal functions (no virtuals)

View File

@@ -76,7 +76,7 @@ gimp_drawable_stroke_boundary (GimpDrawable *drawable,
gboolean
gimp_drawable_stroke_path (GimpDrawable *drawable,
GimpStrokeOptions *options,
GimpPath *vectors,
GimpPath *path,
gboolean push_undo,
GError **error)
{
@@ -85,14 +85,14 @@ gimp_drawable_stroke_path (GimpDrawable *drawable,
g_return_val_if_fail (GIMP_IS_DRAWABLE (drawable), FALSE);
g_return_val_if_fail (gimp_item_is_attached (GIMP_ITEM (drawable)), FALSE);
g_return_val_if_fail (GIMP_IS_STROKE_OPTIONS (options), FALSE);
g_return_val_if_fail (GIMP_IS_PATH (vectors), FALSE);
g_return_val_if_fail (GIMP_IS_PATH (path), FALSE);
g_return_val_if_fail (gimp_fill_options_get_style (GIMP_FILL_OPTIONS (options)) !=
GIMP_FILL_STYLE_PATTERN ||
gimp_context_get_pattern (GIMP_CONTEXT (options)) != NULL,
FALSE);
g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
bezier = gimp_path_get_bezier (vectors);
bezier = gimp_path_get_bezier (path);
if (bezier && bezier->num_data >= 2)
{

View File

@@ -32,7 +32,7 @@ void gimp_drawable_stroke_boundary (GimpDrawable *drawable,
gboolean gimp_drawable_stroke_path (GimpDrawable *drawable,
GimpStrokeOptions *options,
GimpPath *vectors,
GimpPath *path,
gboolean push_undo,
GError **error);

View File

@@ -50,7 +50,6 @@
#include "gimpimage.h"
#include "gimpimage-colormap.h"
#include "gimpimage-undo-push.h"
#include "gimplayer.h"
#include "gimpmarshal.h"
#include "gimppickable.h"
#include "gimpprogress.h"
@@ -100,6 +99,7 @@ static void gimp_drawable_get_property (GObject *object,
static gint64 gimp_drawable_get_memsize (GimpObject *object,
gint64 *gui_size);
static void gimp_drawable_size_changed (GimpViewable *viewable);
static gboolean gimp_drawable_get_size (GimpViewable *viewable,
gint *width,
gint *height);
@@ -291,6 +291,7 @@ gimp_drawable_class_init (GimpDrawableClass *klass)
gimp_object_class->get_memsize = gimp_drawable_get_memsize;
viewable_class->size_changed = gimp_drawable_size_changed;
viewable_class->get_size = gimp_drawable_get_size;
viewable_class->get_new_preview = gimp_drawable_get_new_preview;
viewable_class->get_new_pixbuf = gimp_drawable_get_new_pixbuf;
@@ -335,7 +336,7 @@ gimp_drawable_init (GimpDrawable *drawable)
{
drawable->private = gimp_drawable_get_instance_private (drawable);
drawable->private->filter_stack = gimp_filter_stack_new (GIMP_TYPE_FILTER);
_gimp_drawable_filters_init (drawable);
}
/* sorry for the evil casts */
@@ -386,7 +387,8 @@ gimp_drawable_finalize (GObject *object)
g_clear_object (&drawable->private->source_node);
g_clear_object (&drawable->private->buffer_source_node);
g_clear_object (&drawable->private->filter_stack);
_gimp_drawable_filters_finalize (drawable);
G_OBJECT_CLASS (parent_class)->finalize (object);
}
@@ -440,6 +442,36 @@ gimp_drawable_get_memsize (GimpObject *object,
gui_size);
}
static void
gimp_drawable_size_changed (GimpViewable *viewable)
{
GList *list;
gint width;
gint height;
if (GIMP_VIEWABLE_CLASS (parent_class)->size_changed)
GIMP_VIEWABLE_CLASS (parent_class)->size_changed (viewable);
width = gimp_item_get_width (GIMP_ITEM (viewable));
height = gimp_item_get_height (GIMP_ITEM (viewable));
for (list = GIMP_LIST (GIMP_DRAWABLE (viewable)->private->filter_stack)->queue->tail;
list;
list = g_list_previous (list))
{
if (GIMP_IS_DRAWABLE_FILTER (list->data))
{
GimpDrawableFilter *filter = list->data;
GimpChannel *mask = GIMP_CHANNEL (gimp_drawable_filter_get_mask (filter));
GeglRectangle rect = { 0, 0, width, height };
/* Don't resize partial layer effects */
if (gimp_channel_is_empty (mask))
gimp_drawable_filter_refresh_crop (filter, &rect);
}
}
}
static gboolean
gimp_drawable_get_size (GimpViewable *viewable,
gint *width,
@@ -529,11 +561,38 @@ gimp_drawable_duplicate (GimpItem *item,
GimpDrawable *drawable = GIMP_DRAWABLE (item);
GimpDrawable *new_drawable = GIMP_DRAWABLE (new_item);
GeglBuffer *new_buffer;
GimpContainer *filters;
GList *list;
new_buffer = gimp_gegl_buffer_dup (gimp_drawable_get_buffer (drawable));
gimp_drawable_set_buffer (new_drawable, FALSE, NULL, new_buffer);
g_object_unref (new_buffer);
filters = gimp_drawable_get_filters (drawable);
for (list = GIMP_LIST (filters)->queue->tail;
list;
list = g_list_previous (list))
{
GimpDrawableFilter *filter = list->data;
if (GIMP_IS_DRAWABLE_FILTER (filter))
{
GimpDrawableFilter *new_filter;
new_filter = gimp_drawable_filter_duplicate (new_drawable,
filter);
if (new_filter)
{
gimp_drawable_filter_apply (new_filter, NULL);
gimp_drawable_filter_commit (new_filter, TRUE, NULL, FALSE);
gimp_drawable_filter_layer_mask_freeze (new_filter);
g_object_unref (new_filter);
}
}
}
}
return new_item;
@@ -570,30 +629,6 @@ gimp_drawable_scale (GimpItem *item,
0, 0),
TRUE);
g_object_unref (new_buffer);
if (GIMP_IS_LAYER (drawable))
{
GList *list;
for (list = GIMP_LIST (drawable->private->filter_stack)->queue->tail;
list; list = g_list_previous (list))
{
if (GIMP_IS_DRAWABLE_FILTER (list->data))
{
GimpDrawableFilter *filter = list->data;
GimpChannel *mask = GIMP_CHANNEL (gimp_drawable_filter_get_mask (filter));
GeglRectangle *rect = GEGL_RECTANGLE (0, 0,
new_width,
new_height);
/* Don't resize partial layer effects */
if (gimp_channel_is_empty (mask))
gimp_drawable_filter_refresh_crop (filter, rect);
}
}
if (list)
g_list_free (list);
}
}
static void
@@ -679,28 +714,6 @@ gimp_drawable_resize (GimpItem *item,
0, 0),
TRUE);
g_object_unref (new_buffer);
if (GIMP_IS_LAYER (drawable))
{
GList *list;
for (list = GIMP_LIST (drawable->private->filter_stack)->queue->tail;
list; list = g_list_previous (list))
{
if (GIMP_IS_DRAWABLE_FILTER (list->data))
{
GimpDrawableFilter *filter = list->data;
GimpChannel *mask = GIMP_CHANNEL (gimp_drawable_filter_get_mask (filter));
GeglRectangle rect = {0, 0, new_width, new_height};
/* Don't resize partial layer effects */
if (gimp_channel_is_empty (mask))
gimp_drawable_filter_refresh_crop (filter, &rect);
}
}
if (list)
g_list_free (list);
}
}
static void
@@ -764,30 +777,6 @@ gimp_drawable_rotate (GimpItem *item,
new_off_x, new_off_y, FALSE);
g_object_unref (buffer);
}
if (GIMP_IS_LAYER (drawable))
{
GList *list;
gint width = gimp_item_get_width (GIMP_ITEM (drawable));
gint height = gimp_item_get_height (GIMP_ITEM (drawable));
for (list = GIMP_LIST (drawable->private->filter_stack)->queue->tail;
list; list = g_list_previous (list))
{
if (GIMP_IS_DRAWABLE_FILTER (list->data))
{
GimpDrawableFilter *filter = list->data;
GimpChannel *mask = GIMP_CHANNEL (gimp_drawable_filter_get_mask (filter));
GeglRectangle rect = {0, 0, width, height};
/* Don't resize partial layer effects */
if (gimp_channel_is_empty (mask))
gimp_drawable_filter_refresh_crop (filter, &rect);
}
}
if (list)
g_list_free (list);
}
}
static void
@@ -1200,24 +1189,23 @@ gimp_drawable_update (GimpDrawable *drawable,
{
g_return_if_fail (GIMP_IS_DRAWABLE (drawable));
if (width < 0)
if (width < 0 || height < 0)
{
GeglRectangle bounding_box;
bounding_box = gimp_drawable_get_bounding_box (drawable);
x = bounding_box.x;
width = bounding_box.width;
}
if (width < 0)
{
x = bounding_box.x;
width = bounding_box.width;
}
if (height < 0)
{
GeglRectangle bounding_box;
bounding_box = gimp_drawable_get_bounding_box (drawable);
y = bounding_box.y;
height = bounding_box.height;
if (height < 0)
{
y = bounding_box.y;
height = bounding_box.height;
}
}
if (drawable->private->paint_count == 0)
@@ -1285,6 +1273,14 @@ gimp_drawable_update_all (GimpDrawable *drawable)
GIMP_DRAWABLE_GET_CLASS (drawable)->update_all (drawable);
}
void
gimp_drawable_filters_changed (GimpDrawable *drawable)
{
g_return_if_fail (GIMP_IS_DRAWABLE (drawable));
g_signal_emit (drawable, gimp_drawable_signals[FILTERS_CHANGED], 0);
}
void
gimp_drawable_invalidate_boundary (GimpDrawable *drawable)
{
@@ -2110,10 +2106,7 @@ gimp_drawable_end_paint (GimpDrawable *drawable)
if (gimp_drawable_has_visible_filters (drawable) &&
drawable->private->paint_count == 0)
{
gimp_item_set_visible (GIMP_ITEM (drawable), FALSE, FALSE);
gimp_image_flush (gimp_item_get_image (GIMP_ITEM (drawable)));
gimp_item_set_visible (GIMP_ITEM (drawable),TRUE, FALSE);
gimp_image_flush (gimp_item_get_image (GIMP_ITEM (drawable)));
gimp_drawable_update (drawable, 0, 0, -1, -1);
}
return result;
@@ -2184,9 +2177,3 @@ gimp_drawable_is_painting (GimpDrawable *drawable)
return drawable->private->paint_count > 0;
}
void
gimp_drawable_filters_changed (GimpDrawable *drawable)
{
g_signal_emit (drawable, gimp_drawable_signals[FILTERS_CHANGED], 0);
}

View File

@@ -134,6 +134,8 @@ void gimp_drawable_update (GimpDrawable *drawa
gint height);
void gimp_drawable_update_all (GimpDrawable *drawable);
void gimp_drawable_filters_changed (GimpDrawable *drawable);
void gimp_drawable_invalidate_boundary (GimpDrawable *drawable);
void gimp_drawable_get_active_components (GimpDrawable *drawable,
gboolean *active);
@@ -235,7 +237,5 @@ gboolean gimp_drawable_end_paint (GimpDrawable *drawable)
gboolean gimp_drawable_flush_paint (GimpDrawable *drawable);
gboolean gimp_drawable_is_painting (GimpDrawable *drawable);
void gimp_drawable_filters_changed (GimpDrawable *drawable);
#endif /* __GIMP_DRAWABLE_H__ */

View File

@@ -115,7 +115,7 @@ struct _GimpDrawableFilter
GeglNode *crop_after;
GimpApplicator *applicator;
gboolean is_temporary;
gboolean temporary;
/* This is mirroring merge_filter option of GimpFilterOptions. */
gboolean to_be_merged;
};
@@ -173,6 +173,7 @@ static void gimp_drawable_filter_lock_alpha_changed (GimpLayer
static void gimp_drawable_filter_reorder (GimpFilterStack *stack,
GimpDrawableFilter *reordered_filter,
gint old_index,
gint new_index,
GimpDrawableFilter *filter);
@@ -291,7 +292,7 @@ gimp_drawable_filter_set_property (GObject *object,
break;
case PROP_TEMPORARY:
filter->is_temporary = g_value_get_boolean (value);
filter->temporary = g_value_get_boolean (value);
break;
case PROP_TO_BE_MERGED:
@@ -325,7 +326,7 @@ gimp_drawable_filter_get_property (GObject *object,
g_value_set_boolean (value, filter->has_custom_name);
break;
case PROP_TEMPORARY:
g_value_set_boolean (value, filter->is_temporary);
g_value_set_boolean (value, filter->temporary);
break;
case PROP_TO_BE_MERGED:
g_value_set_boolean (value, filter->to_be_merged);
@@ -530,6 +531,8 @@ gimp_drawable_filter_duplicate (GimpDrawable *drawable,
prior_filter->composite_mode);
gimp_drawable_filter_set_region (filter,
prior_filter->region);
gimp_drawable_filter_set_add_alpha (filter,
prior_filter->add_alpha);
gimp_filter_set_active (GIMP_FILTER (filter),
gimp_filter_get_active (GIMP_FILTER (prior_filter)));
gimp_filter_set_is_last_node (GIMP_FILTER (filter),
@@ -590,6 +593,47 @@ gimp_drawable_filter_get_mask (GimpDrawableFilter *filter)
return filter->mask;
}
void
gimp_drawable_filter_set_temporary (GimpDrawableFilter *filter,
gboolean temporary)
{
g_return_if_fail (GIMP_IS_DRAWABLE_FILTER (filter));
temporary = temporary ? TRUE : FALSE;
if (temporary != filter->temporary)
{
g_object_set (filter,
"temporary", temporary,
NULL);
}
}
gboolean
gimp_drawable_filter_get_temporary (GimpDrawableFilter *filter)
{
g_return_val_if_fail (GIMP_IS_DRAWABLE_FILTER (filter), FALSE);
return filter->temporary;
}
void
gimp_drawable_filter_set_opacity (GimpDrawableFilter *filter,
gdouble opacity)
{
g_return_if_fail (GIMP_IS_DRAWABLE_FILTER (filter));
if (opacity != filter->opacity)
{
filter->opacity = opacity;
gimp_drawable_filter_sync_opacity (filter);
if (gimp_drawable_filter_is_active (filter))
gimp_drawable_filter_update_drawable (filter, NULL);
}
}
gdouble
gimp_drawable_filter_get_opacity (GimpDrawableFilter *filter)
{
@@ -598,6 +642,32 @@ gimp_drawable_filter_get_opacity (GimpDrawableFilter *filter)
return filter->opacity;
}
void
gimp_drawable_filter_set_mode (GimpDrawableFilter *filter,
GimpLayerMode paint_mode,
GimpLayerColorSpace blend_space,
GimpLayerColorSpace composite_space,
GimpLayerCompositeMode composite_mode)
{
g_return_if_fail (GIMP_IS_DRAWABLE_FILTER (filter));
if (paint_mode != filter->paint_mode ||
blend_space != filter->blend_space ||
composite_space != filter->composite_space ||
composite_mode != filter->composite_mode)
{
filter->paint_mode = paint_mode;
filter->blend_space = blend_space;
filter->composite_space = composite_space;
filter->composite_mode = composite_mode;
gimp_drawable_filter_sync_mode (filter);
if (gimp_drawable_filter_is_active (filter))
gimp_drawable_filter_update_drawable (filter, NULL);
}
}
GimpLayerMode
gimp_drawable_filter_get_paint_mode (GimpDrawableFilter *filter)
{
@@ -630,22 +700,6 @@ gimp_drawable_filter_get_composite_mode (GimpDrawableFilter *filter)
return filter->composite_mode;
}
gboolean
gimp_drawable_filter_get_clip (GimpDrawableFilter *filter)
{
g_return_val_if_fail (GIMP_IS_DRAWABLE_FILTER (filter), FALSE);
return filter->clip;
}
GimpFilterRegion
gimp_drawable_filter_get_region (GimpDrawableFilter *filter)
{
g_return_val_if_fail (GIMP_IS_DRAWABLE_FILTER (filter), 0);
return filter->region;
}
void
gimp_drawable_filter_set_clip (GimpDrawableFilter *filter,
gboolean clip)
@@ -661,6 +715,14 @@ gimp_drawable_filter_set_clip (GimpDrawableFilter *filter,
}
}
gboolean
gimp_drawable_filter_get_clip (GimpDrawableFilter *filter)
{
g_return_val_if_fail (GIMP_IS_DRAWABLE_FILTER (filter), FALSE);
return filter->clip;
}
void
gimp_drawable_filter_set_region (GimpDrawableFilter *filter,
GimpFilterRegion region)
@@ -678,6 +740,14 @@ gimp_drawable_filter_set_region (GimpDrawableFilter *filter,
}
}
GimpFilterRegion
gimp_drawable_filter_get_region (GimpDrawableFilter *filter)
{
g_return_val_if_fail (GIMP_IS_DRAWABLE_FILTER (filter), 0);
return filter->region;
}
void
gimp_drawable_filter_set_crop (GimpDrawableFilter *filter,
const GeglRectangle *rect,
@@ -803,7 +873,7 @@ gimp_drawable_filter_update (GimpDrawableFilter *filter,
GimpLayerColorSpace composite_space,
GimpLayerCompositeMode composite_mode,
const gchar **auxinputnames,
const GimpDrawable **auxinputs,
GimpDrawable **auxinputs,
GError **error)
{
GimpImage *image;
@@ -1060,47 +1130,12 @@ gimp_drawable_filter_update (GimpDrawableFilter *filter,
return (*error != NULL);
}
void
gimp_drawable_filter_set_opacity (GimpDrawableFilter *filter,
gdouble opacity)
gboolean
gimp_drawable_filter_get_add_alpha (GimpDrawableFilter *filter)
{
g_return_if_fail (GIMP_IS_DRAWABLE_FILTER (filter));
g_return_val_if_fail (GIMP_IS_DRAWABLE_FILTER (filter), FALSE);
if (opacity != filter->opacity)
{
filter->opacity = opacity;
gimp_drawable_filter_sync_opacity (filter);
if (gimp_drawable_filter_is_active (filter))
gimp_drawable_filter_update_drawable (filter, NULL);
}
}
void
gimp_drawable_filter_set_mode (GimpDrawableFilter *filter,
GimpLayerMode paint_mode,
GimpLayerColorSpace blend_space,
GimpLayerColorSpace composite_space,
GimpLayerCompositeMode composite_mode)
{
g_return_if_fail (GIMP_IS_DRAWABLE_FILTER (filter));
if (paint_mode != filter->paint_mode ||
blend_space != filter->blend_space ||
composite_space != filter->composite_space ||
composite_mode != filter->composite_mode)
{
filter->paint_mode = paint_mode;
filter->blend_space = blend_space;
filter->composite_space = composite_space;
filter->composite_mode = composite_mode;
gimp_drawable_filter_sync_mode (filter);
if (gimp_drawable_filter_is_active (filter))
gimp_drawable_filter_update_drawable (filter, NULL);
}
return filter->add_alpha;
}
void
@@ -1981,6 +2016,7 @@ gimp_drawable_filter_lock_alpha_changed (GimpLayer *layer,
static void
gimp_drawable_filter_reorder (GimpFilterStack *stack,
GimpDrawableFilter *reordered_filter,
gint old_index,
gint new_index,
GimpDrawableFilter *filter)
{
@@ -1998,6 +2034,8 @@ gimp_drawable_filter_reorder (GimpFilterStack *stack,
* it's organized.
*/
GIMP_IS_DRAWABLE_FILTER (GIMP_LIST (stack)->queue->head->data))
gimp_drawable_filter_sync_format (GIMP_LIST (stack)->queue->head->data);
{
gimp_drawable_filter_sync_format (GIMP_LIST (stack)->queue->head->data);
}
}
}

View File

@@ -68,7 +68,20 @@ GimpDrawable *
GeglNode * gimp_drawable_filter_get_operation (GimpDrawableFilter *filter);
GimpDrawableFilterMask *
gimp_drawable_filter_get_mask (GimpDrawableFilter *filter);
void gimp_drawable_filter_set_temporary (GimpDrawableFilter *filter,
gboolean temporary);
gboolean gimp_drawable_filter_get_temporary (GimpDrawableFilter *filter);
void gimp_drawable_filter_set_opacity (GimpDrawableFilter *filter,
gdouble opacity);
gdouble gimp_drawable_filter_get_opacity (GimpDrawableFilter *filter);
void gimp_drawable_filter_set_mode (GimpDrawableFilter *filter,
GimpLayerMode paint_mode,
GimpLayerColorSpace blend_space,
GimpLayerColorSpace composite_space,
GimpLayerCompositeMode composite_mode);
GimpLayerMode
gimp_drawable_filter_get_paint_mode (GimpDrawableFilter *filter);
GimpLayerColorSpace
@@ -80,17 +93,20 @@ GimpLayerColorSpace
GimpLayerCompositeMode
gimp_drawable_filter_get_composite_mode
(GimpDrawableFilter *filter);
gboolean gimp_drawable_filter_get_clip (GimpDrawableFilter *filter);
GimpFilterRegion
gimp_drawable_filter_get_region (GimpDrawableFilter *filter);
void gimp_drawable_filter_set_clip (GimpDrawableFilter *filter,
gboolean clip);
gboolean gimp_drawable_filter_get_clip (GimpDrawableFilter *filter);
void gimp_drawable_filter_set_region (GimpDrawableFilter *filter,
GimpFilterRegion region);
GimpFilterRegion
gimp_drawable_filter_get_region (GimpDrawableFilter *filter);
void gimp_drawable_filter_set_crop (GimpDrawableFilter *filter,
const GeglRectangle *rect,
gboolean update);
void gimp_drawable_filter_set_preview (GimpDrawableFilter *filter,
gboolean enabled);
void gimp_drawable_filter_set_preview_split
@@ -108,15 +124,9 @@ gboolean gimp_drawable_filter_update (GimpDrawableFilter *filter,
GimpLayerColorSpace composite_space,
GimpLayerCompositeMode composite_mode,
const gchar **auxinputnames,
const GimpDrawable **auxinputs,
GimpDrawable **auxinputs,
GError **error);
void gimp_drawable_filter_set_opacity (GimpDrawableFilter *filter,
gdouble opacity);
void gimp_drawable_filter_set_mode (GimpDrawableFilter *filter,
GimpLayerMode paint_mode,
GimpLayerColorSpace blend_space,
GimpLayerColorSpace composite_space,
GimpLayerCompositeMode composite_mode);
gboolean gimp_drawable_filter_get_add_alpha (GimpDrawableFilter *filter);
void gimp_drawable_filter_set_add_alpha (GimpDrawableFilter *filter,
gboolean add_alpha);

View File

@@ -106,7 +106,8 @@ gimp_drawable_filter_undo_constructed (GObject *object)
G_OBJECT_CLASS (parent_class)->constructed (object);
gimp_assert (GIMP_IS_DRAWABLE_FILTER (df_undo->filter));
gimp_assert (GIMP_IS_DRAWABLE_FILTER (df_undo->filter) &&
! gimp_drawable_filter_get_temporary (df_undo->filter));
drawable = gimp_drawable_filter_get_drawable (df_undo->filter);
if (drawable)
@@ -242,10 +243,7 @@ gimp_drawable_filter_undo_pop (GimpUndo *undo,
{
gimp_drawable_remove_filter (drawable, GIMP_FILTER (filter));
gimp_item_set_visible (GIMP_ITEM (drawable), FALSE, FALSE);
gimp_image_flush (undo->image);
gimp_item_set_visible (GIMP_ITEM (drawable), TRUE, FALSE);
gimp_image_flush (undo->image);
gimp_drawable_update (drawable, 0, 0, -1, -1);
}
}
if ((undo_mode == GIMP_UNDO_MODE_UNDO &&
@@ -267,7 +265,7 @@ gimp_drawable_filter_undo_pop (GimpUndo *undo,
{
gimp_container_reorder (filter_stack, GIMP_OBJECT (filter),
df_undo->row_index);
gimp_drawable_filter_apply (filter, NULL);
gimp_drawable_update (drawable, 0, 0, -1, -1);
}
else if (undo->undo_type == GIMP_UNDO_FILTER_MODIFIED)
{
@@ -354,11 +352,8 @@ gimp_drawable_filter_undo_free (GimpUndo *undo,
{
GimpDrawableFilterUndo *drawable_filter_undo = GIMP_DRAWABLE_FILTER_UNDO (undo);
if (drawable_filter_undo->filter)
g_clear_object (&drawable_filter_undo->filter);
if (drawable_filter_undo->node)
g_object_unref (drawable_filter_undo->node);
g_clear_object (&drawable_filter_undo->filter);
g_clear_object (&drawable_filter_undo->node);
GIMP_UNDO_CLASS (parent_class)->free (undo, undo_mode);
}

View File

@@ -38,7 +38,7 @@ struct _GimpDrawableFilterUndo
GimpUndo parent_instance;
GimpDrawableFilter *filter;
guint32 row_index;
gint row_index;
GeglNode *node;
gdouble opacity;

View File

@@ -47,6 +47,7 @@ static void gimp_drawable_stack_remove (GimpContainer *container
GimpObject *object);
static void gimp_drawable_stack_reorder (GimpContainer *container,
GimpObject *object,
gint old_index,
gint new_index);
static void gimp_drawable_stack_drawable_update (GimpItem *item,
@@ -104,7 +105,7 @@ gimp_drawable_stack_constructed (GObject *object)
G_OBJECT_CLASS (parent_class)->constructed (object);
gimp_assert (g_type_is_a (gimp_container_get_children_type (container),
gimp_assert (g_type_is_a (gimp_container_get_child_type (container),
GIMP_TYPE_DRAWABLE));
gimp_container_add_handler (container, "update",
@@ -142,11 +143,13 @@ gimp_drawable_stack_remove (GimpContainer *container,
static void
gimp_drawable_stack_reorder (GimpContainer *container,
GimpObject *object,
gint old_index,
gint new_index)
{
GimpDrawableStack *stack = GIMP_DRAWABLE_STACK (container);
GIMP_CONTAINER_CLASS (parent_class)->reorder (container, object, new_index);
GIMP_CONTAINER_CLASS (parent_class)->reorder (container, object,
old_index, new_index);
if (gimp_filter_get_active (GIMP_FILTER (object)))
gimp_drawable_stack_drawable_active (GIMP_ITEM (object), stack);
@@ -161,9 +164,9 @@ gimp_drawable_stack_new (GType drawable_type)
g_return_val_if_fail (g_type_is_a (drawable_type, GIMP_TYPE_DRAWABLE), NULL);
return g_object_new (GIMP_TYPE_DRAWABLE_STACK,
"name", g_type_name (drawable_type),
"children-type", drawable_type,
"policy", GIMP_CONTAINER_POLICY_STRONG,
"name", g_type_name (drawable_type),
"child-type", drawable_type,
"policy", GIMP_CONTAINER_POLICY_STRONG,
NULL);
}

View File

@@ -20,7 +20,8 @@
#include "config.h"
#include <appstream-glib.h>
#include <appstream.h>
#include <gdk-pixbuf/gdk-pixbuf.h>
#include <gegl.h>
#include "libgimpbase/gimpbase.h"
@@ -45,11 +46,12 @@ enum
struct _GimpExtensionPrivate
{
gchar *path;
gchar *path;
AsApp *app;
gboolean writable;
gboolean running;
AsMetadata *metadata;
AsComponent *component;
gboolean writable;
gboolean running;
/* Extension metadata: directories. */
GList *brush_paths;
@@ -144,8 +146,7 @@ gimp_extension_finalize (GObject *object)
gimp_extension_clean (extension);
g_free (extension->p->path);
if (extension->p->app)
g_object_unref (extension->p->app);
g_clear_object (&extension->p->metadata);
G_OBJECT_CLASS (parent_class)->finalize (object);
}
@@ -222,31 +223,26 @@ gimp_extension_new (const gchar *dir,
const gchar *
gimp_extension_get_name (GimpExtension *extension)
{
g_return_val_if_fail (extension->p->app != NULL, NULL);
g_return_val_if_fail (extension->p->component != NULL, NULL);
return as_app_get_name (extension->p->app, g_getenv ("LANGUAGE")) ?
as_app_get_name (extension->p->app, g_getenv ("LANGUAGE")) :
as_app_get_name (extension->p->app, NULL);
return as_component_get_name (extension->p->component);
}
const gchar *
gimp_extension_get_comment (GimpExtension *extension)
{
g_return_val_if_fail (extension->p->app != NULL, NULL);
return as_app_get_comment (extension->p->app, g_getenv ("LANGUAGE")) ?
as_app_get_comment (extension->p->app, g_getenv ("LANGUAGE")) :
as_app_get_comment (extension->p->app, NULL);
g_return_val_if_fail (extension->p->component != NULL, NULL);
return as_component_get_summary (extension->p->component);
}
const gchar *
gimp_extension_get_description (GimpExtension *extension)
{
g_return_val_if_fail (extension->p->app != NULL, NULL);
g_return_val_if_fail (extension->p->component != NULL, NULL);
return as_app_get_description (extension->p->app, g_getenv ("LANGUAGE")) ?
as_app_get_description (extension->p->app, g_getenv ("LANGUAGE")) :
as_app_get_description (extension->p->app, NULL);
return as_component_get_description (extension->p->component);
}
GdkPixbuf *
@@ -255,30 +251,74 @@ gimp_extension_get_screenshot (GimpExtension *extension,
gint height,
const gchar **caption)
{
GdkPixbuf *pixbuf = NULL;
AsScreenshot *screenshot;
GdkPixbuf *pixbuf = NULL;
AsScreenshot *screenshot = NULL;
const GPtrArray *screenshots;
g_return_val_if_fail (extension->p->app != NULL, NULL);
g_return_val_if_fail (extension->p->component != NULL, NULL);
#if AS_CHECK_VERSION(1, 0, 0)
screenshots = as_component_get_screenshots_all (extension->p->component);
#else
screenshots = as_component_get_screenshots (extension->p->component);
#endif
if (screenshots == NULL || screenshots->len == 0)
{
return pixbuf;
}
/* Look for the screenshot marked as default */
for (guint i = 0; i < screenshots->len; i++)
{
AsScreenshot *ss = g_ptr_array_index (screenshots, i);
if (as_screenshot_get_kind (ss) == AS_SCREENSHOT_KIND_DEFAULT)
{
screenshot = ss;
break;
}
}
if (screenshot == NULL)
{
g_printerr (_("Invalid AppStream metadata: failed to find default screenshot for extension \"%s\""),
as_component_get_id (extension->p->component));
}
screenshot = as_app_get_screenshot_default (extension->p->app);
if (screenshot)
{
AsImage *image;
AsImage *image = NULL;
GFile *file = NULL;
GFileInputStream *istream = NULL;
GError *error = NULL;
image = as_screenshot_get_image_for_locale (screenshot, g_getenv ("LANGUAGE"), width, height);
if (! image)
image = as_screenshot_get_image_for_locale (screenshot, NULL, width, height);
#if AS_CHECK_VERSION(1, 0, 0)
image = as_screenshot_get_image (screenshot, width, height, 1);
#else
image = as_screenshot_get_image (screenshot, width, height);
#endif
file = g_file_new_for_uri (as_image_get_url (image));
istream = g_file_read (file, NULL, &error);
if (istream != NULL)
{
pixbuf = gdk_pixbuf_new_from_stream (G_INPUT_STREAM (istream), NULL, &error);
}
if (error != NULL)
{
g_printerr (_("Invalid AppStream metadata: Error loading image: \"%s\""), error->message);
}
pixbuf = as_image_get_pixbuf (image);
if (pixbuf)
{
g_object_ref (pixbuf);
}
else
{
GFile *file;
GFileInputStream *istream;
GError *error = NULL;
GFile *file = NULL;
GFileInputStream *istream = NULL;
GError *error = NULL;
file = g_file_new_for_uri (as_image_get_url (image));
istream = g_file_read (file, NULL, &error);
@@ -298,9 +338,7 @@ gimp_extension_get_screenshot (GimpExtension *extension,
if (caption)
{
*caption = as_screenshot_get_caption (screenshot, g_getenv ("LANGUAGE"));
if (*caption == NULL)
*caption = as_screenshot_get_caption (screenshot, NULL);
*caption = as_screenshot_get_caption (screenshot);
}
}
@@ -331,16 +369,29 @@ gboolean
gimp_extension_load (GimpExtension *extension,
GError **error)
{
AsApp *app;
GPtrArray *extends;
GPtrArray *requires;
AsRelease *release;
gchar *appdata_name;
gchar *path;
gboolean success = FALSE;
gboolean has_require = FALSE;
AsMetadata *metadata;
AsComponent *component;
#if AS_CHECK_VERSION(1, 0, 0)
AsComponentBox *components = NULL;
#else
GPtrArray *components = NULL;
#endif
GPtrArray *extends;
GPtrArray *relations;
AsRelease *release = NULL;
#if AS_CHECK_VERSION(1, 0, 0)
AsReleaseList *rlist = NULL;
#else
GPtrArray *rlist = NULL;
#endif
gchar *appdata_name;
gchar *path;
GFile *file;
gboolean success = FALSE;
gboolean has_require = FALSE;
g_clear_object (&extension->p->app);
g_clear_object (&extension->p->metadata);
extension->p->component = NULL;
/* Search in subdirectory if a file with the same name as
* directory and ending with ".metainfo.xml" exists.
@@ -350,12 +401,32 @@ gimp_extension_load (GimpExtension *extension,
path = g_build_filename (extension->p->path, appdata_name, NULL);
g_free (appdata_name);
app = as_app_new ();
success = as_app_parse_file (app, path,
AS_APP_PARSE_FLAG_USE_HEURISTICS,
error);
file = g_file_new_for_path (path);
metadata = as_metadata_new ();
success = as_metadata_parse_file (metadata, file, AS_FORMAT_KIND_XML, error);
if (success)
{
#if AS_CHECK_VERSION(1, 0, 0)
components = as_metadata_get_components (metadata);
component = as_component_box_index (components, 0);
#else
components = as_metadata_get_components (metadata);
component = g_ptr_array_index (components, 0);
#endif
}
g_object_unref (file);
g_free (path);
if (success && as_app_get_kind (app) != AS_APP_KIND_ADDON)
if (!success)
{
return success;
}
if (success && as_component_get_kind (component) != AS_COMPONENT_KIND_ADDON)
{
/* Properly setting the type will allow extensions to be
* distributed appropriately through other means.
@@ -364,11 +435,11 @@ gimp_extension_load (GimpExtension *extension,
*error = g_error_new (GIMP_EXTENSION_ERROR,
GIMP_EXTENSION_BAD_APPDATA,
_("Extension AppData must be of type \"addon\", found \"%s\" instead."),
as_app_kind_to_string (as_app_get_kind (app)));
as_component_kind_to_string (as_component_get_kind (component)));
success = FALSE;
}
extends = as_app_get_extends (app);
extends = as_component_get_extends (component);
if (success &&
! g_ptr_array_find_with_equal_func (extends, "org.gimp.GIMP",
g_str_equal, NULL))
@@ -384,7 +455,7 @@ gimp_extension_load (GimpExtension *extension,
}
if (success &&
g_strcmp0 (as_app_get_id (app),
g_strcmp0 (as_component_get_id (component),
gimp_object_get_name (extension)) != 0)
{
/* Extension IDs will be unique and we want therefore the
@@ -394,11 +465,24 @@ gimp_extension_load (GimpExtension *extension,
*error = g_error_new (GIMP_EXTENSION_ERROR,
GIMP_EXTENSION_FAILED,
_("Extension AppData id (\"%s\") and directory (\"%s\") must be the same."),
as_app_get_id (app), gimp_object_get_name (extension));
as_component_get_id (component), gimp_object_get_name (extension));
success = FALSE;
}
release = as_app_get_release_default (app);
#if AS_CHECK_VERSION(1, 0, 0)
rlist = as_component_get_releases_plain (component);
if (rlist != NULL && !as_release_list_is_empty (rlist))
{
release = as_release_list_index (rlist, 0);
}
#else
rlist = as_component_get_releases (component);
if (rlist != NULL && rlist->len > 0)
{
release = g_ptr_array_index (rlist, 0);
}
#endif
if (success && (! release || ! as_release_get_version (release)))
{
/* We don't need the detail, just to know that the extension has a
@@ -412,24 +496,19 @@ gimp_extension_load (GimpExtension *extension,
success = FALSE;
}
requires = as_app_get_requires (app);
if (success && requires)
relations = as_component_get_requires (component);
if (success && relations != NULL)
{
gint i;
/* An extension could set requirements, in particular a range of
* supported version of GIMP, but also other extensions.
*/
for (i = 0; i < requires->len; i++)
for (guint i = 0; i < relations->len; i++)
{
AsRequire *require = g_ptr_array_index (requires, i);
AsRelation *relation = g_ptr_array_index(relations, i);
if (as_require_get_kind (require) == AS_REQUIRE_KIND_ID &&
g_strcmp0 (as_require_get_value (require), "org.gimp.GIMP") == 0)
if (as_relation_get_item_kind(relation) == AS_RELATION_ITEM_KIND_ID &&
g_strcmp0(as_relation_get_value_str(relation), "org.gimp.GIMP") == 0)
{
has_require = TRUE;
if (! as_require_version_compare (require, GIMP_VERSION, error))
if (! as_relation_version_compare (relation, GIMP_VERSION, error))
{
success = FALSE;
break;
@@ -437,14 +516,11 @@ gimp_extension_load (GimpExtension *extension,
}
else if (error && *error == NULL)
{
/* Right now we only support requirement relative to GIMP
* version.
*/
*error = g_error_new (GIMP_EXTENSION_ERROR,
GIMP_EXTENSION_FAILED,
_("Unsupported <requires> \"%s\" (type %s)."),
as_require_get_value (require),
as_require_kind_to_string (as_require_get_kind (require)));
_("Unsupported <relation> \"%s\" (type %s)."),
as_relation_get_value_str(relation),
as_relation_item_kind_to_string(as_relation_get_item_kind(relation)));
success = FALSE;
break;
}
@@ -462,9 +538,14 @@ gimp_extension_load (GimpExtension *extension,
}
if (success)
extension->p->app = app;
{
extension->p->metadata = metadata;
extension->p->component = component;
}
else
g_object_unref (app);
{
g_clear_object (&metadata);
}
return success;
}
@@ -476,11 +557,11 @@ gimp_extension_run (GimpExtension *extension,
GHashTable *metadata;
gchar *value;
g_return_val_if_fail (extension->p->app != NULL, FALSE);
g_return_val_if_fail (extension->p->component != NULL, FALSE);
g_return_val_if_fail (error && *error == NULL, FALSE);
gimp_extension_clean (extension);
metadata = as_app_get_metadata (extension->p->app);
metadata = as_component_get_custom (extension->p->component);
value = g_hash_table_lookup (metadata, "GIMP::brush-path");
extension->p->brush_paths = gimp_extension_validate_paths (extension,
@@ -738,7 +819,7 @@ gimp_extension_validate_paths (GimpExtension *extension,
for (i = 0; patharray[i]; i++)
{
/* Note: appstream-glib is supposed to return everything as UTF-8,
/* Note: appstream is supposed to return everything as UTF-8,
* so we should not have to bother about this. */
gchar *path;
GFile *file;

View File

@@ -56,8 +56,7 @@ GimpFillStyle gimp_fill_options_get_style (GimpFillOptions *optio
void gimp_fill_options_set_style (GimpFillOptions *options,
GimpFillStyle style);
GimpCustomStyle gimp_fill_options_get_custom_style
(GimpFillOptions *options);
GimpCustomStyle gimp_fill_options_get_custom_style (GimpFillOptions *options);
void gimp_fill_options_set_custom_style (GimpFillOptions *options,
GimpCustomStyle custom_style);

View File

@@ -57,7 +57,8 @@ struct _GimpFilterPrivate
GimpApplicator *applicator;
};
#define GET_PRIVATE(filter) ((GimpFilterPrivate *) gimp_filter_get_instance_private ((GimpFilter *) (filter)))
#define GET_PRIVATE(filter) \
((GimpFilterPrivate *) gimp_filter_get_instance_private ((GimpFilter *) (filter)))
/* local function prototypes */
@@ -223,12 +224,10 @@ gimp_filter_new (const gchar *name)
GeglNode *
gimp_filter_get_node (GimpFilter *filter)
{
GimpFilterPrivate *private;
GimpFilterPrivate *private = GET_PRIVATE (filter);
g_return_val_if_fail (GIMP_IS_FILTER (filter), NULL);
private = GET_PRIVATE (filter);
if (private->node)
return private->node;
@@ -297,12 +296,10 @@ void
gimp_filter_set_applicator (GimpFilter *filter,
GimpApplicator *applicator)
{
GimpFilterPrivate *private;
GimpFilterPrivate *private = GET_PRIVATE (filter);
g_return_if_fail (GIMP_IS_FILTER (filter));
private = GET_PRIVATE (filter);
private->applicator = applicator;
}

View File

@@ -24,21 +24,13 @@
#include "gimpviewable.h"
#define GIMP_TYPE_FILTER (gimp_filter_get_type ())
#define GIMP_FILTER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GIMP_TYPE_FILTER, GimpFilter))
#define GIMP_FILTER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GIMP_TYPE_FILTER, GimpFilterClass))
#define GIMP_IS_FILTER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GIMP_TYPE_FILTER))
#define GIMP_IS_FILTER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GIMP_TYPE_FILTER))
#define GIMP_FILTER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GIMP_TYPE_FILTER, GimpFilterClass))
#define GIMP_TYPE_FILTER (gimp_filter_get_type ())
G_DECLARE_DERIVABLE_TYPE (GimpFilter,
gimp_filter,
GIMP, FILTER,
GimpViewable)
typedef struct _GimpFilterClass GimpFilterClass;
struct _GimpFilter
{
GimpViewable parent_instance;
};
struct _GimpFilterClass
{
GimpViewableClass parent_class;

View File

@@ -60,6 +60,9 @@ static void gimp_filtered_container_real_src_thaw (GimpFilteredContainer *
static gboolean gimp_filtered_container_object_matches (GimpFilteredContainer *filtered_container,
GimpObject *object);
static void gimp_filtered_container_src_sort_func (GimpContainer *src,
GParamSpec *pspec,
GimpFilteredContainer *filtered_container);
static void gimp_filtered_container_src_add (GimpContainer *src_container,
GimpObject *obj,
GimpFilteredContainer *filtered_container);
@@ -148,6 +151,9 @@ gimp_filtered_container_dispose (GObject *object)
if (filtered_container->src_container)
{
g_signal_handlers_disconnect_by_func (filtered_container->src_container,
gimp_filtered_container_src_sort_func,
filtered_container);
g_signal_handlers_disconnect_by_func (filtered_container->src_container,
gimp_filtered_container_src_add,
filtered_container);
@@ -188,6 +194,9 @@ gimp_filtered_container_set_property (GObject *object,
case PROP_SRC_CONTAINER:
filtered_container->src_container = g_value_dup_object (value);
g_signal_connect (filtered_container->src_container, "notify::sort-func",
G_CALLBACK (gimp_filtered_container_src_sort_func),
filtered_container);
g_signal_connect (filtered_container->src_container, "add",
G_CALLBACK (gimp_filtered_container_src_add),
filtered_container);
@@ -304,17 +313,17 @@ gimp_filtered_container_new (GimpContainer *src_container,
GimpObjectFilterFunc filter_func,
gpointer filter_data)
{
GType children_type;
GType child_type;
GCompareFunc sort_func;
g_return_val_if_fail (GIMP_IS_LIST (src_container), NULL);
children_type = gimp_container_get_children_type (src_container);
sort_func = gimp_list_get_sort_func (GIMP_LIST (src_container));
child_type = gimp_container_get_child_type (src_container);
sort_func = gimp_list_get_sort_func (GIMP_LIST (src_container));
return g_object_new (GIMP_TYPE_FILTERED_CONTAINER,
"sort-func", sort_func,
"children-type", children_type,
"child-type", child_type,
"policy", GIMP_CONTAINER_POLICY_WEAK,
"unique-names", FALSE,
"src-container", src_container,
@@ -332,6 +341,16 @@ gimp_filtered_container_object_matches (GimpFilteredContainer *filtered_containe
filtered_container->filter_data));
}
static void
gimp_filtered_container_src_sort_func (GimpContainer *src,
GParamSpec *pspec,
GimpFilteredContainer *filtered_container)
{
GCompareFunc sort_func = gimp_list_get_sort_func (GIMP_LIST (src));
gimp_list_set_sort_func (GIMP_LIST (filtered_container), sort_func);
}
static void
gimp_filtered_container_src_add (GimpContainer *src_container,
GimpObject *object,

View File

@@ -40,6 +40,7 @@ static void gimp_filter_stack_remove (GimpContainer *container,
GimpObject *object);
static void gimp_filter_stack_reorder (GimpContainer *container,
GimpObject *object,
gint old_index,
gint new_index);
static void gimp_filter_stack_add_node (GimpFilterStack *stack,
@@ -83,7 +84,7 @@ gimp_filter_stack_constructed (GObject *object)
G_OBJECT_CLASS (parent_class)->constructed (object);
gimp_assert (g_type_is_a (gimp_container_get_children_type (container),
gimp_assert (g_type_is_a (gimp_container_get_child_type (container),
GIMP_TYPE_FILTER));
gimp_container_add_handler (container, "active-changed",
@@ -147,6 +148,7 @@ gimp_filter_stack_remove (GimpContainer *container,
static void
gimp_filter_stack_reorder (GimpContainer *container,
GimpObject *object,
gint old_index,
gint new_index)
{
GimpFilterStack *stack = GIMP_FILTER_STACK (container);
@@ -155,7 +157,8 @@ gimp_filter_stack_reorder (GimpContainer *container,
if (stack->graph && gimp_filter_get_active (filter))
gimp_filter_stack_remove_node (stack, filter);
GIMP_CONTAINER_CLASS (parent_class)->reorder (container, object, new_index);
GIMP_CONTAINER_CLASS (parent_class)->reorder (container, object,
old_index, new_index);
if (gimp_filter_get_active (filter))
{
@@ -175,9 +178,9 @@ gimp_filter_stack_new (GType filter_type)
g_return_val_if_fail (g_type_is_a (filter_type, GIMP_TYPE_FILTER), NULL);
return g_object_new (GIMP_TYPE_FILTER_STACK,
"name", g_type_name (filter_type),
"children-type", filter_type,
"policy", GIMP_CONTAINER_POLICY_STRONG,
"name", g_type_name (filter_type),
"child-type", filter_type,
"policy", GIMP_CONTAINER_POLICY_STRONG,
NULL);
}

View File

@@ -35,6 +35,8 @@
#include "gimptagged.h"
#include "gimptempbuf.h"
#include "gimp-intl.h"
#define EPSILON 1e-10
@@ -60,7 +62,8 @@ static gboolean gimp_gradient_get_popup_size (GimpViewable *viewa
static GimpTempBuf * gimp_gradient_get_new_preview (GimpViewable *viewable,
GimpContext *context,
gint width,
gint height);
gint height,
GeglColor *fg_color);
static const gchar * gimp_gradient_get_extension (GimpData *data);
static void gimp_gradient_copy (GimpData *data,
@@ -118,6 +121,7 @@ gimp_gradient_class_init (GimpGradientClass *klass)
gimp_object_class->get_memsize = gimp_gradient_get_memsize;
viewable_class->default_icon_name = "gimp-tool-gradient";
viewable_class->default_name = _("Gradient");
viewable_class->get_preview_size = gimp_gradient_get_preview_size;
viewable_class->get_popup_size = gimp_gradient_get_popup_size;
viewable_class->get_new_preview = gimp_gradient_get_new_preview;
@@ -213,7 +217,8 @@ static GimpTempBuf *
gimp_gradient_get_new_preview (GimpViewable *viewable,
GimpContext *context,
gint width,
gint height)
gint height,
GeglColor *fg_color G_GNUC_UNUSED)
{
GimpGradient *gradient = GIMP_GRADIENT (viewable);
GimpGradientSegment *seg = NULL;

View File

@@ -33,9 +33,7 @@
#include "gegl/gimp-babl.h"
#include "gegl/gimp-gegl-loops.h"
#include "gimpchannel.h"
#include "gimpdrawable-filters.h"
#include "gimpdrawablefilter.h"
#include "gimpgrouplayer.h"
#include "gimpgrouplayerundo.h"
#include "gimpimage.h"
@@ -277,6 +275,7 @@ gimp_group_layer_class_init (GimpGroupLayerClass *klass)
gimp_object_class->get_memsize = gimp_group_layer_get_memsize;
viewable_class->default_icon_name = "gimp-group-layer";
viewable_class->default_name = _("Layer Group");
viewable_class->ancestry_changed = gimp_group_layer_ancestry_changed;
viewable_class->get_size = gimp_group_layer_get_size;
viewable_class->get_children = gimp_group_layer_get_children;
@@ -291,7 +290,6 @@ gimp_group_layer_class_init (GimpGroupLayerClass *klass)
item_class->resize = gimp_group_layer_resize;
item_class->get_clip = gimp_group_layer_get_clip;
item_class->default_name = _("Layer Group");
item_class->rename_desc = C_("undo-type", "Rename Layer Group");
item_class->translate_desc = C_("undo-type", "Move Layer Group");
item_class->scale_desc = C_("undo-type", "Scale Layer Group");
@@ -594,7 +592,6 @@ gimp_group_layer_duplicate (GimpItem *item,
GimpItem *child = list->data;
GimpItem *new_child;
GimpLayerMask *mask;
GimpContainer *filters;
new_child = gimp_item_duplicate (child, G_TYPE_FROM_INSTANCE (child));
@@ -619,36 +616,6 @@ gimp_group_layer_duplicate (GimpItem *item,
gimp_container_insert (new_private->children,
GIMP_OBJECT (new_child),
position++);
/* Copy any attached layer effects */
filters = gimp_drawable_get_filters (GIMP_DRAWABLE (child));
if (gimp_container_get_n_children (filters) > 0)
{
GList *filter_list;
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_child),
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);
}
}
}
}
}
/* force the projection to reallocate itself */
@@ -2002,7 +1969,6 @@ gimp_group_layer_update_size (GimpGroupLayer *group)
gboolean size_changed;
gboolean resize_mask;
GList *list;
GimpContainer *filters;
old_bounds.x = gimp_item_get_offset_x (item);
old_bounds.y = gimp_item_get_offset_y (item);
@@ -2137,29 +2103,6 @@ gimp_group_layer_update_size (GimpGroupLayer *group)
if (resize_mask && ! private->transforming)
gimp_group_layer_update_mask_size (group);
/* Update the crop of any filters */
if (size_changed)
{
filters = gimp_drawable_get_filters (GIMP_DRAWABLE (group));
for (list = GIMP_LIST (filters)->queue->tail;
list; list = g_list_previous (list))
{
if (GIMP_IS_DRAWABLE_FILTER (list->data))
{
GimpDrawableFilter *filter = list->data;
GimpChannel *filter_mask;
filter_mask = GIMP_CHANNEL (gimp_drawable_filter_get_mask (filter));
/* Don't resize partial layer effects */
if (gimp_channel_is_empty (filter_mask))
gimp_drawable_filter_refresh_crop (filter, &bounding_box);
}
}
if (list)
g_list_free (list);
}
/* if we show the mask, invalidate the new mask area */
if (resize_mask && gimp_layer_get_show_mask (layer))
{

View File

@@ -2361,6 +2361,8 @@ select_colors_gray (QuantizeObj *quantobj,
/* Compute the representative color for each box, fill colormap */
for (i = 0; i < numboxes; i++)
compute_color_gray (quantobj, histogram, boxlist + i, i);
g_free (boxlist);
}

View File

@@ -95,7 +95,7 @@ gimp_image_crop (GimpImage *image,
width, height, -x, -y);
}
/* Resize all vectors */
/* Resize all paths */
for (list = gimp_image_get_path_iter (image);
list;
list = g_list_next (list))

View File

@@ -30,8 +30,6 @@
#include "gimp.h"
#include "gimpchannel.h"
#include "gimpdrawable-filters.h"
#include "gimpdrawablefilter.h"
#include "gimpguide.h"
#include "gimpimage.h"
#include "gimpimage-color-profile.h"
@@ -259,9 +257,8 @@ gimp_image_duplicate_layers (GimpImage *image,
list;
list = g_list_next (list))
{
GimpLayer *layer = list->data;
GimpLayer *new_layer;
GimpContainer *filters;
GimpLayer *layer = list->data;
GimpLayer *new_layer;
if (gimp_layer_is_floating_sel (layer))
continue;
@@ -278,36 +275,6 @@ gimp_image_duplicate_layers (GimpImage *image,
gimp_image_add_layer (new_image, new_layer,
NULL, count++, FALSE);
/* Import any attached layer effects */
filters = gimp_drawable_get_filters (GIMP_DRAWABLE (layer));
if (gimp_container_get_n_children (filters) > 0)
{
GList *filter_list;
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);
}
}
}
}
}
new_item_stack = GIMP_ITEM_STACK (gimp_image_get_layers (new_image));

View File

@@ -230,7 +230,7 @@ gimp_image_flip_full (GimpImage *image,
gimp_image_undo_group_start (image, GIMP_UNDO_GROUP_IMAGE_FLIP, NULL);
/* Flip all layers, channels (including selection mask), and vectors */
/* Flip all layers, channels (including selection mask), and paths */
while ((item = gimp_object_queue_pop (queue)))
{
gboolean clip = FALSE;

View File

@@ -361,8 +361,8 @@ gimp_image_item_list_get_list (GimpImage *image,
}
static GList *
gimp_image_item_list_remove_children (GList *list,
const GimpItem *parent)
gimp_image_item_list_remove_children (GList *list,
GimpItem *parent)
{
GList *l = list;

Some files were not shown because too many files have changed in this diff Show More