Commit Graph

53407 Commits

Author SHA1 Message Date
abbbd3ad3a Update Swedish translation 2024-10-27 22:43:29 +00:00
008e756a34 Update Swedish translation 2024-10-27 22:42:17 +00:00
0b4d104c15 app: use gdk_seat_grab() instead of deprecated gdk_device_grab().
Additionally to fixing a deprecation, I also ensure that we don't limit
pointer source to what the system considers the "Core Pointer" on
Wayland.

It is another bug similar to #8016 and possibly what !924 was trying to
fix, even though it turned out this was not the same problem which I
initially reported. In this other variant, when you were hitting Space,
it would originate from the "Core Keyboard" which was associated to a
"Core Pointer". On a laptop, this Core Pointer could be the trackpoint
for instance (in my case) so you could pan with Space + trackpoint move.
Yet say you add a graphics tablet, which is a separate pointer: you
could not pan with Space + stylus move!

Now you can, because when we are pan-spacing, events from all pointer
sources are accepted. Only when the panning comes from a pointer source
(middle click) do we listen only events from this same pointer device.
2024-10-27 23:00:30 +01:00
3a8825cf06 Revert "app: Don't grab the pointer when doing scrolling"
This reverts commit 413cf9ad85.

As discussed with mitch during last Wilber Week, and commented in !924,
the fix was creating new problem and was not right. We definitely want
to grab pointer events when panning (or other similar interactions).

Also I think I had not tested under Wayland back then, only verified I
didn't see any huge issue on X11, but the commit did not in fact fix the
original issue #8016 (this time, I verified!). The problem I was
encountering seem to be more in how Wayland works + libinput, not giving
full control on input devices to applications and trying to be "smart"
with an option ("Disable Touchpad While Typing") which is often useful,
but other times counter-productive (e.g. in GIMP when we want to
space-panning — which should not be considered typing —, or again
shortcuts in video games, and so on).
2024-10-27 22:58:01 +01:00
d6f015a6df app: fix forgotten change after removal of num-drawables argument. 2024-10-27 22:55:51 +01:00
846a8f6e98 gimp-data: update the submodule to latest.
Apart from various structural or script improvements, we now have vector
icons for all tool icons in the Legacy icon theme (#887).
2024-10-27 22:55:51 +01:00
97fb23e5b3 plug-ins: python-fu-eval should correctly exit with error.
When the passed code had a bug, the plug-in was crashing along with the
code given in argument. Instead, we must catch all exceptions and pass
the error message raised by exec() to the core application.
2024-10-27 22:55:51 +01:00
8cf1aaf40f Issue #12216: fix crash on switch to MWM
Since commit 4e499810, GIMP could crash on switching to
multi-window mode on X11 Linux systems.

As suggested by Alx Sa it is enough to add a NULL check for
shell to avoid the crash.
2024-10-27 15:37:06 +00:00
2db868ab50 gitlab-ci: Do not forbid custom crossbuild pipelines
Manual pipelines can be useful. Blocking them was an error from b3b466dc.
2024-10-27 07:59:57 -03:00
9ab481647c build/windows: Port building scripts to use Windows native shell
From now, Windows contributors can use the default shell provided by the OS
(which is PS since Windows build 10.0.14971.0), like Linux and macOS users do.
We still use MSYS2 but not the POSIX shell. This change adds these features:

'1_build-deps-msys2.sh' is now '1_build-deps-msys2.ps1'
- Faster clonning by using 'git-scm' (the MSYS2 one had performance problems)
- Easier to use non-MSYS2 binaries, not only 'git-scm' but also official meson,
  deps from vckpg etc. This is a needed step towards the future use of MSVC.

'2_build-gimp-msys2.sh' is now '2_build-gimp-msys2.ps1'
- By default, vanilla builds (normally triggered on PS) will create a bundle,
  dropping the need of 'gimp.cmd' (that adressed .typelib and .interp limits),
  which is inline with other (Cmake-based) projects like Darktable and Inkscape.
  This change is important because even Windows devs more experienced than me
  get confused with the relocatibility stuff, which is the default on Windows.

'2_bundle-gimp-uni_base.sh'
- As a result of the change above, bundling code was changed to be a bit faster.
  It still is, however, painfully slow, since meson doesn't have a 'install()'
  function like Cmake to prepend targets in Ninja's 'install_manifest.txt'.

Since we are not using a POSIX shell (nor 'mintty') anymore:
- GIMP can be built from every path easily with R. Click "Open Terminal", with
  IDE integrations etc, without needing to manual tweak MSYS2 .ini files etc.
  We could tweak MSYS2 to get the features above but not top-tier integration.
- Developers can be more aware of Windows native vars, paths etc, and avoid bugs
  Some build files were improved to support the 'Windows way of doing things'.
- No need to close and reopen terminal anymore after running 'pacman -Suy'!

---

REGRESSION: Vala plug-ins are temporarely gone due to 'vapigen' bugs, a small
regression since this is a gnomeish language but I will investigate how to fix.
2024-10-26 22:26:48 -03:00
a01dc47983 dialogs: Use correct enum for Metadata Rotation Policy
In 41894be7, GIMP_COLOR_PROFILE_POLICY_KEEP was accidentally
used instead of GIMP_METADATA_ROTATION_POLICY_KEEP as the
possible output of gimp_image_metadata_rotate_dialog ().
Fortunately they are currently the same value, but it would be best to
return the right enum type.
2024-10-26 20:12:45 +00:00
428763591f widgets: Remove icon border on GimpControllerEditor dialog
GimpControllerEditor's "Select Controller Event Action" dialogue has
a border around the standard icon. This is because it uses a GimpViewableDialog,
which normally shows the current image or layer as the right side icon (and thus
needs a border to potentially distinguish).
Since this is a special case, this patch retrieves the GimpViewRenderer for the icon
and then sets the border color to transparent.
2024-10-26 14:40:35 +00:00
bdcf1ba22f ScriptFu: scripts: add Clothify v2 back as a test plugin
After we converted most scripts in the repo to use new registration functions,
there are no *filters* left from version 2.

But version 2 filters are still supported, with a warning
to the console like "image procedures ... only one drawable ... are deprecated."

A version 2 filter uses
the deprecated registration function script-fu-register
and declares args img and drawable (singular) explicitly
(contrary to encouraged multi-layer capable.)

Until we actually obsolete scripts of this ilk,
we need this test plugin for testing.
2024-10-26 07:08:44 -04:00
da98eabc8a Updated Greek translation 2024-10-26 08:37:17 +03:00
71d2a1415f actions: Load menu colors for Gradient Editor
Resolves #12226.
GimpGradientEditor's saved_color array was
converted to GeglColor as part of the color
space invasion. However, we were still
treating it as if it was a GimpRGB array, so
we'd use gegl_color_set_pixel () to convert
it for gimp_action_group_set_action_color ().
This resulted in the menu displaying empty colors.
This patch removes the unnecessary conversions
and passed the saved_color values directly so that
they show up in the menu.
2024-10-26 03:10:22 +00:00
d054a87d2c plug-ins: Fix naming conventions for Python plug-ins
Per Lloyd Konneker, all Python plug-ins except
histogram-export and gradients-save-as-css
have "python-fu-" in front of their name.
In fact, gradients-save-as-css does have
this prefix in some places already.
Since this is also how it was written in 2.10,
let's rename them now to be consistent.
2024-10-26 01:05:15 +00:00
b3f1cb47a3 NEWS: update. 2024-10-26 01:18:55 +02:00
f490a8eb63 app, libgimp: fix crash when selecting a gradient from plug-in.
As reported by Anders in !1919. This is because
gimp_pdb_execute_procedure_by_name() now expects a proper GimpArray for
float and int arrays, not a C array preceded by a size value.
2024-10-25 23:31:42 +02:00
e3bdce7c5d plug-ins: port script-fu scripts to the new array handling.
These are most (all?) of the broken scripts. At least I hope so! 😅
2024-10-25 23:31:42 +02:00
b992057b22 plug-ins: port script-fu PDB testing. 2024-10-25 23:31:41 +02:00
48cb7e76d3 app, libgimp, pdb: add g_return*_if_fail() test for array size args.
Generated libgimp functions' arguments are normally tested through the
PDB, so that you get proper error messages when trying to call a
function with invalid arguments.
This is not true anymore for array arguments since the size argument is
not a PDB arg, only in the C function. Therefore I'm adding an
infrastructure asserting on invalid size, using the same PDB type
annotations as other args. It is important to assert valid input on
plug-in side (i.e. libgimp) so that the core doesn't make any assumption
on having received valid input when it has not.

Also changing size argument of gimppainttools PDB-generated functions to
proper gsize.
2024-10-25 23:31:06 +02:00
253db343a6 plug-ins: fix calling gimp-plug-ins-query. 2024-10-25 23:28:42 +02:00
ac2bef4410 app, libgimp, pdb, plug-ins: array size's type should be gsize.
This changes the signature of generated functions in libgimp with array
arguments.
2024-10-25 23:28:42 +02:00
3a2cbb4162 app, libgimp, pdb: array length are not PDB arguments anymore.
Yet they still are generated libgimp functions' arguments.

For instance gimp_context_get_line_dash_pattern() still has a num_dashes
integer argument and a dashes C array, but when calling the PDB
procedure "gimp-context-get-line-dash-pattern", we only set the
GimpArray.

This will allow simpler direct PDB calls too, included in script-fu,
where the size argument is really redundant.
2024-10-25 23:28:42 +02:00
096c45599d app, libgimp*, pdb, plug-ins: float arrays don't need size arguments too. 2024-10-25 23:28:42 +02:00
f2b9babfb4 app, libgimp*, plug-ins: int32 array arguments don't need a size argument anymore.
GimpArray (and therefore the int32 array typedef) contains its own size.
We don't need to store the array size in a preceding argument.

Also adding gimp_int32_array_get_values() and gimp_int32_array_set_values()
to edit an existing GimpArray.
This comes with the fact we should start making the GimpArray type more
explicit, because clearly by trying to hide this type so much, it was
too much looking like the int32 array param spec was expecting a C array
(as was visible in the file-ico plug-in where we were getting a C array,
which was a bug only made invisible by the fact we were not setting the
C array back in the config object in the end).

Last but not least, I finally implemented int32 array (de)serialization.

As a side fix, the "images" arg in file-pdf-export-multi procedure is
now a proper image array (not an int32 array), and of course the "count"
arg was removed.
2024-10-25 23:28:42 +02:00
60eb27ab18 app, libgimp*, pdb, plug-ins: first step to make int32array PDB type aware of its length.
PDB code is now looking directly into the GimpArray length for
determining the data length.

Also adding a 'size' argument (number of elements, not bytes) to
gimp_value_(get|dup)_int32_array() to make it actually introspectable.
Until now, it was somehow introspected but was segfaulting on run.
I.e. that, e.g. in Python, calling Gimp.value_set_int32_array(v, [1, 2, 3])
followed by Gimp.value_get_int32_array(v) would actually make a
segmentation fault. Now the binding works flawlessly.

This will also make these functions much more usable in general.
2024-10-25 23:28:42 +02:00
87d3d921da libgimp, pdb: improve free function information on array types.
Core object arrays must also be freed with g_free() (since elements are
not ref-ed).

Also color arrays must be freed with gimp_color_array_free().
2024-10-25 23:28:42 +02:00
4137dce97b libgimp*: get rid of GimpObjectArray and GimpParamSpecObjectArray.
These have now been completely replace with the new GimpCoreObjectArray.
2024-10-25 23:28:42 +02:00
e97572af98 plug-ins: support the new NULL-terminated object arrays in script-fu. 2024-10-25 23:28:42 +02:00
e1e2941d9e app, libgimp*, plug-ins: move all GimpObjectArray procedure args to GimpCoreObjectArray. 2024-10-25 23:28:42 +02:00
08fd3a3f0d app, libgimp, pdb: imagearray PDB type as GimpCoreObjectArray. 2024-10-25 23:28:42 +02:00
64f9c71ad5 app, libgimp, pdb: all resource (and subtype) array PDB types as GimpCoreObjectArray. 2024-10-25 23:28:42 +02:00
59c040323c app, libgimp, pdb, plug-ins: patharray PDB type as GimpCoreObjectArray. 2024-10-25 23:28:42 +02:00
255cda73c1 app, libgimp, pdb: channelarray PDB type as GimpCoreObjectArray. 2024-10-25 23:28:42 +02:00
d484b591d9 app, libgimp, pdb, plug-ins: layerarray PDB type is now a GimpCoreObjectArray. 2024-10-25 23:28:42 +02:00
318f7451cd app, libgimp*, pdb, plug-ins: change itemarray PDB type to use GimpCoreObjectArray. 2024-10-25 23:28:42 +02:00
38c2cd3b15 app, libgimp, pdb, plug-ins: new GimpCoreObjectArray type and drawablearray…
… PDB type.

This is a first step for #7369. Clearly our GimpObjectArray was meant to
be used with C arrays, hence the wrapper function
gimp_value_set_object_array() which was taking a C array and actually
creating and setting a GimpObjectArray.

This is why our new type is actually a C array aliased as a boxed type
and containing its own size (thanks to NULL-termination).

Eventually GimpCoreObjectArray is meant to replace GimpObjectArray.

The only issue is that such a type does not allow NULL as a valid
element in such an array, but fact is that I don't think we currently
have any use case where this matters. If ever such a case arise in the
future, we may introduce back GimpObjectArray.

In this first commit, I replaced all itemarray PDB types with a new
drawablearray using this new boxed type when relevant.
2024-10-25 23:28:42 +02:00
cb4687633c devel-docs: delete ScriptFu docs
After moved to gimp-web-devel repo.
2024-10-25 10:07:49 -04:00
0db5f7dd72 ScriptFu: add compatibility scripts for third party scripts
For some symbols defined or deprecated in GIMP 2 and obsolete in GIMP 3.

ScriptFu automatically loaded these definitions
during development of GIMP 3 (from 2.99 to 3.0rc1).
That is no longer the case.

A third-party script CAN load them explicitly.
We discourage that, for scripts to be shared,
but it is convenient for private use.

PDB-compat-v2.scm is also an executable definition of renamings,
useful as a cross check of published documents re porting plugins
from v2 to v3.
2024-10-25 13:56:36 +00:00
b70fad8c94 ScriptFu: rename the init scripts to have suffix .scm
So an editor recognizes them.

Renames script-fu.init to init.scm since that is a Scheme convention.
Scheme interpreter maintainers expect that name.
The same name as upstream TinyScheme.
2024-10-25 13:56:36 +00:00
b4a67b661f ScriptFu: move init scripts to separate directory /scripts/scriptfu-init
When mingled with plugin scripts, they needed a non-standard suffix .init.
Which makes an editor not recognize them.
Which deviates from Scheme convention for the main init script: init.scm.

The separate directory is also a place for script authors
to put Scheme scripts they don't want loaded automatically,
but when a script calls Scheme load function.

No change to observable behavior in the app or ScriptFu tools.
2024-10-25 13:56:36 +00:00
ffa972f9a8 ScriptFu: libscriptfu: symbol for script-fu-sys-install-directory
and user-install.

Symbols not used yet.

Also improve function ts_load_init_and_compatibility_scripts,
so reader can understand what it does.
2024-10-25 13:56:36 +00:00
da84d3361d ScriptFu: libscriptfu: extract method that loads init and compat scripts
No functional change intended.

In preparation for loading from different dir, and different suffixes.
2024-10-25 13:56:36 +00:00
0e570f8db1 ScriptFu: libscriptfu: extract method ts_define_constant_string
No functional changes intended.

In preparation for defining another string constant.

Makes code more readable.
2024-10-25 13:56:36 +00:00
861f88ccf1 Updated greek translation 2024-10-24 21:11:02 +03:00
598fb4834b Updated Greek translation 2024-10-23 21:06:20 +03:00
c8740e8ab6 ScriptFu: obsolete the defined symbols abbreviating gimp paths
E.G. gimp-dir

Deprecated previously, obsolete for major version 3.0
2024-10-22 15:18:50 -04:00
fd7b029471 ScriptFu: tests: add test: scripts non-interactive call other script plugins
This is rarely done.
Most script plugins call PDB functions that are GIMP INTERNAL (gimp-foo)
or filter plugins that wrap Gegl filters (plug-in-foo).
But a Scheme script plugin can call other script plugins (script-fu-foo).

When a script does call another script,
it can be within the interpreter (purely in Scheme),
or to an interpreter in another process (via the PDB, with binding.)

It can get complicated using the optional v3 binding of return values.

This tests and illustrates different cases.
2024-10-22 15:18:50 -04:00
0c5a716fe8 ScriptFu: scripts: fix scripts that used now obsolete functions from the SIOD dialect
Mostly one word substitutions.

A few function definitions were moved to the scope of
a single script that used them.
Those functions won't be available to third party scripts
except now by cut and paste.

For major release 3.0.
2024-10-22 15:18:50 -04:00