Commit Graph

52280 Commits

Author SHA1 Message Date
Jehan c65aca8b17 plug-ins: rename various '*-save.[ch]' files to '*-export.[ch]'.
Though it's not visible and could happily wait for after GIMP 3 release, this
was annoying when grepping. Just did a quick cleanup.

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

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

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

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

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

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

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

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

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

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

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

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

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

---

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

Uncomment failing tests whose issue was fixed.

Remove calls to deprecated functions.

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

Compare floats relatively by epsilon.

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

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

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

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

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

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

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

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

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

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

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

Fixes:

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

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

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

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

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

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

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

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

Similar to 403af188, we needed to update function calls
that assumed they were receiving a GimpRGB struct rather
than a GeglColor object. Future plans including adding Gegl
functions to retrieve HSV and HSL automatically, rather than
using gegl_color_get_bytes().
2024-04-18 15:42:27 +00:00
Jehan 2434c41a12 app, plug-ins: renaming the `file-*-save-internal` procs to `file-*-export-internal`. 2024-04-18 16:02:00 +02:00
Jehan 94853968b3 libgimp: also update unit testing for GimpColorArray.
Making sure not only that the PDB passes correctly the number of colors, but
taking one random color in the array and verifying it is correct.
2024-04-18 16:00:42 +02:00
Jehan 9f149ef3a2 app, libgimp*, plug-ins: get rid of GimpRGB arrays now that we have GeglColor arrays. 2024-04-18 16:00:42 +02:00
Anders Jonsson 2e536b6df1 plug-ins: change file-[gbr/gih/pat]-save to export
Fixes some scripts, followup to
c92cf7e8f2
2024-04-18 12:28:53 +00:00
megakite e961ff0fe2 app/menus: update tool options menu while initializing menus 2024-04-18 10:22:11 +00:00