Commit Graph

53026 Commits

Author SHA1 Message Date
Jehan 75a50ce87b app, libgimp, pdb, plug-ins: add ability to default to context for all resource args.
Also fixes the passing of the resource param definitions through PDB.
There was some weird assumption, with a comment, in commit 73733335c8
that this was unneeded, which meant that we were not able to properly
recreate the right param spec over the wire.
2024-09-06 16:33:24 +02:00
Alx Sa 6f8231eee6 app/file-data: Remove GimpRGB from file-data-gbr.c
Composite code also simplified since we only need to operate on
grayscale rather than 3 channels for RGB.
2024-09-05 21:21:37 +00:00
Jehan 7f9b8e8dbf plug-ins: fix typo and install rules for test-dialog. 2024-09-05 22:44:10 +02:00
Jehan 5ad829c1dc Issue #11999: GFig, Lava and Stain assert.
After commit #a7bc5f07, these plug-ins assert in local_grad_data_refresh().
A comment is clearly stating that the widget must be allocated, so make
sure that the callback is only connected at allocation.
2024-09-05 22:29:18 +02:00
Alx Sa 753980e514 plug-ins: Replaced deprecated gdk_pointer_grab()...
...in plug-ins/common/animation-play.c
We use gtk_seat_grab/ungrab() elsewhere in the codebase,
so it makes sense to port to that.
2024-09-05 16:16:59 +00:00
Alx Sa 80ed0268e3 plug-ins, operation: Remove uses of GimpHSL
GimpOperationHueSaturation did not do
conversions since the source was already
HSL, so its GimpHSL object was replaced
with a float array.
Van-Gogh plug-in's RGB -> HSL
conversion was replaced with an
HSL float Babl format with gegl_buffer_sample ().
2024-09-05 12:15:29 +00:00
Marco Ciampa 7b66d661ed Update Italian translation 2024-09-05 06:55:07 +00:00
Marco Ciampa 143ff66ad3 Update Italian translation 2024-09-05 06:50:46 +00:00
Alx Sa 118ae3a3db plug-ins: Replace GimpRGB in Page Curl plug-in
Since no conversion operations are performed, just getting the
RGBA values from the gradient and then using them, this replaces
GimpRGB and GimpRGB * with gdouble * equivalents.
2024-09-05 03:55:28 +00:00
Alx Sa 77b3635401 themes: Remove unused grid color in System theme
Per Anders Jonsson, removing this fixes
the issue with the grid colors on System
themes. As it does not work anyway
(the grid would be red if it did) and the
theme code is much better than it was
six years ago, lets remove it.
2024-09-05 02:08:06 +00:00
Anders Jonsson 4c2ff66bdd python: rename Vectors to Path
spyro-plus ran into errors since it called old names
containing Vectors. Fix this by changing to Path to
follow the current API.
2024-09-04 22:29:14 +00:00
Jehan ba3da3d338 app, libgimp*, pdb: new GimpParamSpecObject abstract spec type.
This abstract spec type is basically a GParamSpecObject with a default
value. It will be used by various object spec with default values, such
as GimpParamSpecColor, GimpParamSpecUnit and all GimpParamSpecResource
subtypes. Also it has a duplicate() class method so that every spec type
can implement the proper way to duplicate itself.

This fixes the fact that in gimp_config_param_spec_duplicate(), all
unknown object spec types (because they are implemented in libgimp,
which is invisible to libgimpconfig) are just copied as
GParamSpecObject, hence losing default values and other parameters.

As a second enhancement, it also makes it easier to detect the object
spec types for which we have default value support in
gimp_config_reset_properties().

As a side fix, gimp_param_spec_color() now just always duplicates the
passed default color, making it hence much easier to avoid bugs when
reusing a GeglColor.
2024-09-04 22:34:49 +02:00
Jehan a7bc5f07f2 libgimp: fix updating GimpResourceChooser's GUI when update comes from…
… a change in the config object (in the propwidget case).
2024-09-04 21:32:28 +02:00
Jehan cb1f3b297c libgimp: various fixes for !10950 review.
- There is no reason whatsoever to make gimp_param_resource_value_set_default()
  a no-op on core side. Also remove the whole commenting on this basic
  function, especially as it's mostly wrong (why would core not use
  default values? Why would we not transfer ownership? That's the whole
  point of g_value_set_object() which increases the reference, hence
  transfer ownership to the new reference…)
- Also removes the comment on GimpParamResource which is just explaining
  basic GObject stuff and would only confuse contributors.
- Small indentation or coding-style fixes.
2024-09-04 21:32:28 +02:00
bootchk 73733335c8 libgimp: plugins: fix #10950 resource defaults not effective
Now you can declare a default value when declaring resource arguments to
a PDB procedure.

Add default behavior to GimpParamSpecResource.
Add field and override g_param_spec_value_set_default.

Fix the plugins that have resource arguments.
Some plugins temporarily use a hardcoded default instead of declared default.
ScriptFu plugins, TODO.

Misc fix to the test plugin for this case: test-dialog.py.
Dev>Demo>Test dialog...

TODO 10822 Lava plugin issue depends on this.

Note film.c fixed but still doesn't work.
2024-09-04 21:32:28 +02:00
Jehan 4dcf141739 libgimp: don't keep per-procedure proxies of ID objects.
As discussed in !1725, there is an init order issue, which is that you
cannot obtain any of these ID objects as long as the GimpProcedure is
not created. In particular, now that GimpResource arguments can have
defaults, we will want to query such resource in the create_procedure()
implementation of a plug-in (where the GimpProcedure is not running yet,
as we are defining it!).

Anyway I don't really see the point of these multiple-level hash tables
all storing a reference to the same object. Let's just store in the
GimpPlugIn's hash tables once and give the same reference to any
procedure (anyway we make it clear that these objects belong to libgimp
and must not be freed, so it's a bug all the same if someone frees
them). Then it also fixes the init order issue.
2024-09-04 21:32:13 +02:00
Kolbjørn Stuestøl 7fc7683cae Update Norwegian Nynorsk translation 2024-09-04 15:30:06 +00:00
Jehan 2f952932f3 libgimpconfig: fix leak.
As far as I understand, the created types are never "unregistered" and
will live in the process until it ends. It cannot even have a custom
class_finalize() (looking at g_type_register_static()'s code, a CRITICAL
is emitted if you try to provide a class_finalize() implementation).

So let's just free the allocated pspecs at the end of class_init()
instead.
2024-09-04 14:04:47 +02:00
Jehan d7fadf9fe6 Issue #11988: GEGL param specs are not serialized anymore.
This is a regression brought with commits 9b5463b5c5 and f7aaba9fc9.
Technically the bug already existed, but it was brought to light after
the reordering of our param bit flags, because GEGL_PARAM_PAD_INPUT
(which is set on all op properties) and GIMP_PARAM_DONT_SERIALIZE are
now the same value. It used to be same as GIMP_CONFIG_PARAM_AGGREGATE,
which, by chance only, didn't have unfortunate consequence on
serialization, yet that was also a bug. The real fix is that we should
not propagate GEGL bit flags in our operation config types.
2024-09-04 13:48:03 +02:00
Alx Sa 3a0fb282a4 app/tools: Don't merge filters on layer groups
Resolves #11993
In !1319, we added the ability to merge down filters destructively
in the Filter Tool GUI. This accidentally allowed you to merge down
a filter on a layer group. This patch adds checks to prevent this
option from being used, in the same way we hide the option when
editing an existing layer effect.
2024-09-04 01:34:56 +00:00
Jehan 455f6f0954 libgimp: fix some broken indentation. 2024-09-03 19:15:28 +02:00
Jehan e06cf3aee0 themes: fix the suggested-action and destructive-action classes.
We didn't have a "destructive-action" class anymore and the
"suggested-action" was hidden by further CSS rule, so it needed to be
moved down so that it gets precedence.

We used to have these as red and green buttons originally (e.g. pasting
as floating selection, the "New Layer" and "Anchor" were the suggested
actions, i.e. green, whereas "Delete Layer" was destructive, red). For
GIMP 3.0, we keep grayscale design. We'll see if this will change later,
but at least, now we have something again.
2024-09-03 19:14:38 +02:00
Sveinn í Felli 252d187dbc Update Icelandic translation 2024-09-03 11:44:20 +00:00
Alx Sa ece9929996 app/widgets: Remove GimpRGB from gimpwidgets-utils.c
The colors are assumed to be sRGB since they come from a
pre-defined array and are used for the item color tags in the
GUI. This replaces the call to gimp_rgb_composite () with the
direct implementation of the GIMP_RGB_COMPOSITE_NORMAL
code.
It also ensures that only one call is made to gegl_color_set_rgba (),
rather than two if the color is inherited.
2024-09-03 03:24:10 +00:00
Alx Sa fc7c3d0666 core: Update layer effect masks during conversion
We weren't updating the precision of layer effect masks when
converting the layer's precision. This patch updated with the
format from gimp_image_get_mask_format ().
Note that in the future, this code should be moved to
gimp_drawable_real_convert_type () once that function is used
in all the child classes of GimpDrawable.
2024-09-02 21:42:43 +00:00
Jordi Mas 5610ff3d0d Update Catalan translation 2024-09-02 17:29:50 +02:00
Alx Sa b44687eb2f libgimpcolor, plugin: Remove gimp_rgb_luminance ()
This patch removes the two instances of
gimp_rgb_luminance_uchar () and one
instance of gimp_rgb_luminance () from
the codebase.
* plug-ins/common/checkerboard.c:
 Use gegl_color_get_pixel () to get the
 luminance value at the same time we're
 getting the RGBA value from the GeglColor.
 * plug-ins/gradient-flare/gradient-flare.c:
 Replace with GIMP_RGB_LUMINANCE ()
 macro, which does not use GimpRGB.
2024-09-02 02:41:47 +00:00
Alx Sa fd091bc005 pdb: Check number of arguments for gimp_file_save ()
gimp_file_save () is used to save both XCF
and export formats like PNG. XCF does
not have a GimpExportOption parameter,
but we were unconditionally copying it.
This patch adds a check for this.
2024-09-01 18:29:04 +00:00
Yuri Chornoivan 7eec686585 Update Ukrainian translation 2024-09-01 18:26:05 +00:00
Luming Zh a6aea06116 Update Chinese (China) translation 2024-09-01 13:31:11 +00:00
Alx Sa 9b917b8dfb themes: Define top menubar menu backgrounds
Previously, the "menuitem menuitem" style was cascading down
to the top menubar's subitems. This patch explicitly defines the
CSS to match the 2.10 style and prevent cascading.
2024-09-01 12:53:22 +00:00
Martin 1c8a3f36bb Update Slovenian translation 2024-09-01 12:26:26 +00:00
Sabri Ünal f0ead675f3 Update Turkish translation 2024-09-01 11:56:52 +00:00
Sabri Ünal b452f810bd Update Turkish translation 2024-09-01 11:56:40 +00:00
Sabri Ünal e154a45919 Update Turkish translation 2024-09-01 11:56:30 +00:00
Sabri Ünal a4caa08fee Update Turkish translation 2024-09-01 11:55:21 +00:00
Sabri Ünal 679041a4c2 Update Turkish translation 2024-09-01 11:54:17 +00:00
Sabri Ünal f606ec151c Update Turkish translation 2024-09-01 11:44:32 +00:00
Cheng-Chia Tseng 291110f8e9 Update Chinese (Taiwan) translation 2024-09-01 09:55:45 +00:00
Cheng-Chia Tseng f8b02429ab Update Chinese (Taiwan) translation 2024-09-01 09:26:58 +00:00
Cheng-Chia Tseng 22dbdcf355 Update Chinese (Taiwan) translation 2024-09-01 08:05:32 +00:00
Jehan 49b68fbf38 Issue #11725: do not try to uninhibit when inhibiting was not done by GIMP.
As noted by bootchk, docs of gtk_application_is_inhibited() says:

> Determines if any of the actions specified in flags are currently inhibited (possibly by another application).

The last part, between parentheses imply that it's possible for another
application to inhibit GIMP. So we should not rely on this function to
verify we inhibited the logout. Just check of we have an inhibition
cookie.
2024-09-01 01:15:10 +02:00
Jehan 03398391e4 libgimp, plug-ins: add a "parent-handle" argument to the metadata-editor.
This handle is one of the opaque window handles as returned by
gimp_dialog_get_native_handle() or gimp_progress_get_window_handle() and
therefore it works even across processes. Now any export procedure using
the GimpExportProcedureDialog will call "plug-in-metadata-editor" as a
transient window of itself when clicking the "Metadata (edit)" button.
In particular, the Metadata editor won't be hidden by mistake when
appearing or similar issues.

Nevertheless it only works for systems where we have a transient window
implementation (so far, only X11 and Wayland, since the Windows
implementation is currently commented out because of #10229, and we have
no macOS implementation).

Note though that setting destroy-with-parent doesn't work, most likely
because the GimpExportProcedureDialog is still waiting for the Metadata
editor procedure to return (commit 54d01b5a0b), otherwise we end up with
a bad state in GIMP Protocol.
A proper solution to this will likely be to create a temp procedure from
metadata-editor to request it to close from another plug-in.
2024-09-01 00:12:27 +02:00
Jehan 9b5463b5c5 libgimpbase, libgimpconfig: new GIMP_PARAM_DONT_SERIALIZE flag.
The purpose of this flag is to have some procedure arguments for which
you wish to ignore last values, or restored values. This may be needed
for arguments which are really volatile and likely won't survive a
session (or even from a run to another).
This will be used in my next commit.

Note: this is very close to GIMP_CONFIG_PARAM_IGNORE, except that this
latter is used for obsolete properties instead, so I felt that it may
not have been the best idea to mix these semantically different flag.
Also GIMP_CONFIG_PARAM_IGNORE properties are not serialized but they are
deserialized, which is not exactly what we want (in most case, it would
work the same, but it also means that if last-used values were to
contain some deprecated value for a property for which we added this
flag, there would be at least one run where a buggy behavior would
happen).
2024-09-01 00:12:27 +02:00
Jehan f7aaba9fc9 app, libgimpbase, libgimpconfig: make our custom GParamFlags definitions…
… more robust.

GIMP_PARAM_NO_VALIDATE and GIMP_CONFIG_PARAM_DONT_COMPARE were the same
value, most likely because when GIMP_CONFIG_PARAM_DONT_COMPARE got added
(commit c5c807d191), the comment to keep in sync
libgimpbase/gimpparamspecs.h and libgimpconfig/gimpconfig-params.h was
missed.

Instead, since libgimpconfig can include libgimpbase, do the other way
around: first non-GLib param flags are in libgimpbase, then we add a
GIMP_PARAM_FLAG_SHIFT, then we increment from it in libgimpconfig, and
finally we increment from GIMP_CONFIG_PARAM_FLAG_SHIFT if ever we add
more flags in app/ (right now GIMP_SYMMETRY_PARAM_GUI is apparently the
only one, but this may change).
2024-09-01 00:12:27 +02:00
Jehan f4fb6db331 libgimp: new gimp_window_set_transient_for() function.
This allows to easily set a window transient to any other, even from one
plug-in to another.
2024-09-01 00:12:27 +02:00
Alx Sa ee81c82986 plug-ins: Fix double free crash in file-qoi
Same issue as cfcdb1e7
2024-08-31 20:07:34 +00:00
Alx Sa a7cb3cb586 libscriptfu: Fix long warning on Windows
Replaces a string format of %ld with G_GSIZE_FORMAT
so that the value is converted properly on different platforms.
2024-08-31 19:28:02 +00:00
Alx Sa cfcdb1e7bf plug-ins: Fix double free crash in file-heif
Resolves #11980
In 443947c6, the now unnecessary g_free (drawables) was
removed from heif_av1_export (). However, it was accidentally
left in heif_export (). This patch removes it to prevent a crash
from double freeing the drawables list.
2024-08-31 19:27:23 +00:00
Bruce Cowan 8beba7f5fc Update British English translation 2024-08-31 11:48:18 +00:00