Commit Graph

52961 Commits

Author SHA1 Message Date
Martin 442254f0ee Update Slovenian translation 2024-08-18 21:37:35 +00:00
Jehan ddcaa99264 app, libgimp*, pdb, plug-ins: review and enhance MR !1549.
- Fix annotations for gimp_export_options_get_image() to make it
  actually introspectable with the GimpImage being both input and
  output. Even though the logic doesn't change much (the input image may
  be overriden or not), it doesn't matter for introspection because
  images are handled centrally by libgimp and therefore must not be
  freed. Actually deleting the image from the central list of images
  though remains a manual action depending on code logic, not some
  automatic action to be handled by binding engines.
- Add G_GNUC_WARN_UNUSED_RESULT to gimp_export_options_get_image()
  because ignoring the returned value is rarely a good idea (as you
  usually want to delete the image).
- Remove gimp_export_options_new(): we don't need this constructor
  because at this point, the best is to tell plug-in developers to just
  pass NULL everywhere. This leaves us free to create a more useful
  default constructor if needed, in the future. Main description for
  GimpExportOptions has also been updated to say this.
- Add a data_destroy callback for the user data passed in
  gimp_export_procedure_set_capabilities().
- Fixing annotations of 'export_options' object from pdb/pdb.pl: input
  args would actually be (nullable) and would not transfer ownership
  (calling code must still free the object). Return value's ownership on
  the other hand is fully transfered.
- Add C and Python unit testing for GimpExportOptions and
  gimp_export_options_get_image() in particular.
- Fix or improve various details.

Note that I have also considered for a long time changing the signature
of gimp_export_options_get_image() to return a boolean indicating
whether `image` had been replaced (hence needed deletion) or not. This
also meant getting rid of the GimpExportReturn enum. Right now it would
work because there are no third case, but I was considering the future
possibility that for instance we got some impossible conversion for some
future capability. I'm not sure it would ever happen; and for sure, this
is not desirable because it implies an export failure a bit late in the
workflow. But just in case, let's keep the enum return value. It does
not even make the using code that much more complicated (well just a
value comparison instead of a simple boolean test).
2024-08-18 22:46:47 +02:00
Alx Sa bcdd4974bb core, pdb, plug-ins: Create GimpExportOptions class
This patch creates a GimpExportOptions class in both
libgimpbase and in libgimp. Currently it is a mostly empty
object, but it will be added to after 3.0 to allow for
additional export options (like resizing on export while
leaving the original image intact)

libgimp/gimpexport.c was removed, and most of its content
was copied into libgimp/gimpexportoptions.c. gimp_export_image ()
was replaced with gimp_export_options_get_image () in all
export plug-ins.

GimpExportProcedure has a new function to set the default
image capabilities for each plug-in on creation. It also sets up
a new callback function, which allows the options to respond to
user setting changes (such as toggling 'Save as Animation' in the
GIF or WEBP Plug-in).
2024-08-18 22:03:14 +02:00
Jehan 9a26d45793 app: fix leak.
Commit e0b778fe5a was not tested well enough. It was heavily leaking
objects passed through the PDB.
2024-08-18 22:01:08 +02:00
Kolbjørn Stuestøl bf294c51f6 Update Norwegian Nynorsk translation 2024-08-18 19:14:47 +00:00
Kolbjørn Stuestøl 4d6bdd8037 Update Norwegian Nynorsk translation 2024-08-18 19:04:57 +00:00
Kolbjørn Stuestøl 33445c38d1 Update Norwegian Nynorsk translation 2024-08-18 18:59:03 +00:00
Kolbjørn Stuestøl 1405acefcd Update Norwegian Nynorsk translation 2024-08-18 18:38:15 +00:00
Kolbjørn Stuestøl 3867d3d0c9 Update Norwegian Nynorsk translation 2024-08-18 18:21:41 +00:00
Kolbjørn Stuestøl 06918f39dd Update Norwegian Nynorsk translation 2024-08-18 18:07:40 +00:00
Martin a66d7064b8 Update Slovenian translation 2024-08-18 17:56:21 +00:00
Kolbjørn Stuestøl eb21b30251 Update Norwegian Nynorsk translation 2024-08-18 17:48:04 +00:00
Jehan 8eb910f934 app: "selection-feather-radius" max value is 5250.0.
This is a followup of previous commit. As well diagnosed by Anders, this
value relies on "gegl:gaussian-blur" operation's argument's range.

Also adding a comment to make it easier for future developers seeing
this value.
2024-08-18 17:40:02 +00:00
Anders Jonsson 16fc6093ee app: lower the upper limit for feather selection
The real upper limit was 1500 from the standard deviation of
gegl:gaussian blur multiplied with a magic number 3.5,
see 586bb73293
2024-08-18 17:40:02 +00:00
Yuri Chornoivan 9b15108b34 Update Ukrainian translation 2024-08-18 16:45:41 +00:00
Jehan 31cf749f31 libgimp: also add a unit test of gimp_text_layer_new() with pixel unit.
This would help preventing any future regression.
2024-08-18 18:19:23 +02:00
Jehan 518052a105 app, pdb: gimp_text_layer_new() allows pixel unit.
As reported by NikcDC: 624e3772e9 (note_2199852)
2024-08-18 17:44:06 +02:00
Jehan e0b778fe5a app: improve error message when passing out-of-range GimpUnit arguments. 2024-08-18 17:44:06 +02:00
bootchk b5a8f46b37 pdb, libgimp: Fix return type of gimp-buffer-get-image-type
gimp-buffer-get-image-type returns the output of
gimp_babl_format_get_image_type (), which itself returns
a GimpImageType enum. However, the PDB claims that
it's a GimpImageBaseType enum instead. This patch fixes
the documentation to match the actual output enum type.
2024-08-17 23:23:51 -04:00
Jehan d38362c9a0 meson, INSTALL: update optional packages list. 2024-08-17 21:16:00 +02:00
Jehan 59eeae66fd app, tools: fix build without iso-codes package. 2024-08-17 21:16:00 +02:00
Jehan 57d9f63ce4 plug-ins: fix mail crash when canceling the export.
Making sure that `g_free (mailcmd[0])` in the cleanup code does not
segfault on non-allocated memory.
2024-08-17 21:16:00 +02:00
Bruno 6840d70317
build/windows: Complete c95fe605cd 2024-08-17 14:49:57 -03:00
Bruno 8c99efd7a1
build/windows: Add pseudo REVISION support to MSIX dist script
Due to Partner Center restrictions, GIMP MSIX will have a special versioning:
{major}.{minor}.{micro}{revision}.0
2024-08-17 14:49:53 -03:00
Alx Sa 1f5a5812dd libgimpcolor: Remove unnecessary GimpRGB Cairo functions
gimp_cairo_set_source_rgb () and
gimp_cairo_set_source_rgba () are no longer
used in the code base, so let's remove them
as part of the move to GeglColor.
2024-08-17 14:37:10 +00:00
Jehan 70ef4bb507 Issue #10439: Recently Closed Docks shows empty submenu after reopening…
… closed docks.
2024-08-17 14:07:33 +02:00
Ekaterine Papava 9f74a79623 Update Georgian translation 2024-08-17 01:57:13 +00:00
Jehan 32d18f28e7 app: fix a crash when editing the shortcut not on an actual action.
Liam was hitting Backspace on "histogram" which is an action section and
would likely not return a proper GimpAction through
gimp_action_view_get_accel_action().

Therefore let's make sure we initialize properly the action to NULL.
2024-08-17 00:15:09 +02:00
Anders Jonsson 9807ea4834 po: update POTFILES.in 2024-08-16 19:51:08 +00:00
Alx Sa 4e0897f56d widgets: Fix bug loading tool presets in translated UIs
The submenu labels for tool-options-popup were
hardcoded as English in GimpToolOptionsEditor's calls
to the Save, Restore, and Delete Tool Presets buttons.
This meant that these menus always fail when called in
non-English UIs, since we compare the path name and
submenu labels to only load the correct submenu items.

This patch attaches the English labels to the submenu
object so that we can retrieve it for comparison in
gimp_menu_model_get_submodel ().
2024-08-16 15:15:20 -04:00
Jehan e31087a1f0 Issue #9757: radio button menu items not correctly updating (on macOS). 2024-08-16 20:03:29 +02:00
Jehan 9d837cc771 Revert "libgimpcolor: fix call to cmsCreateProofingTransform()."
This reverts commit f7e7f396aa.

See issue #8269.
For GIMP 2.10, I'll just revert this commit so that we get back to pre-2.10.32
situation. ~~For 3.0, we'll try to do something better.~~

-> Let's delay improving the situation even for GIMP 3.0, in which case
it's better to at least keep the same render as for the 2.10 series and
avoid confusion. I'll take more time after release to study better the
situation and see what we should actually do.

(cherry picked from commit 2fd738bb3e)
2024-08-16 15:23:09 +02:00
Jacob Boerema fd3d547338 app: fix #11612 CRITICAL no emission of signal "tool-changed"...
to stop for instance

When using the scale tool and the layer has a selection, then after
finishing the scaling we get a critical in the terminal like this:

(gimp-2.99.exe:31824): GLib-GObject-CRITICAL **: 18:22:05.689:
../glib-2.80.2/gobject/gsignal.c:1184: no emission of signal
 "tool-changed" to stop for instance '000002e8a0f91df0'

This commit moves the call to `g_signal_stop_emission_by_name` inside
the if active_tool != tool_type.
2024-08-16 11:05:53 +00:00
Jehan 5376c5f9d3 Issue #11908: unable to copy with no selection.
gimp_item_mask_bounds() does not actually return if there is intersected
contents between the item and the image's selection, but whether there
is a selection. So when it returns FALSE, it will also return the full
item's dimensions.
2024-08-16 12:53:44 +02:00
Bruno 706014eba4
gitlab-ci: Explain why we don't use 'matrix'
'matrix' would save a lot of code and facilitate maintenance but,
according to my tests in a branch that I already deleted, this
doesn't work for our needs considering GitLab CI limitations.
2024-08-15 21:56:32 -03:00
Alx Sa 816fb1c676 tools, libgimpwidgets: Connect SelectionOptions to icon size
This patch resizes the selection mode
icons based on the user's icon size
settings. It creates a new function in
gimpenumwidgets.c to update sizes,
then connects to GimpGuiConfig's icon
size update notifications in GimpSelectionOptions.
2024-08-15 19:07:14 +00:00
Jehan ee2f86105c app: move "System Language" out of GIMP_L10N_LANGS_SIZE.
This is the only "language" from the list whose name is special and
should be localized at runtime, yet before we set any Preferences
language. It needs to be localized as the System Language itself which
will be run-dependant.

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

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

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

Now it will say instead:

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

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

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