Commit Graph

48724 Commits

Author SHA1 Message Date
Povilas Kanapickas 40743c90a2 widgets: Fix out of bounds zoom in gradient editor
When zooming using scroll events it is possible to zoom out of gradient
bounds because the check for out of bounds zoom happens with the zoom
value before the delta is applied. The correct way is to limit the zoom
value after the delta is applied.
2022-08-06 16:28:50 +00:00
Povilas Kanapickas ae3c4c3577 widgets: Implement zoom focus in gradient editor
Zoom focus centers the point that we're zooming into at the location of
the mouse pointer.

Default zoom focus value is 0.5 which results in previous behavior.
2022-08-06 16:28:50 +00:00
Povilas Kanapickas 8d0e6efa10 widgets: Reset view_last_x whevener gradient editor leaves focus 2022-08-06 16:28:50 +00:00
Povilas Kanapickas ecb2009960 widgets: Implement support for zoom by pitch in gradient editor 2022-08-06 16:28:50 +00:00
Povilas Kanapickas 62490218ee widgets: Fix support for smooth scrolling in gradient editor
Smooth scrolling requires that we keep the scroll (or zoom, as is in
this case) state as a floating-point number. The scroll deltas are often
less than one, thus storing scroll state as an integer will effectively
ignore most of the scroll events.
2022-08-06 16:28:50 +00:00
Povilas Kanapickas 86799f8762 app: Implement zooming via touchpad gestures on GimpContainerTreeView 2022-08-06 15:49:40 +00:00
Povilas Kanapickas 15ddae315c app: Implement zooming via mouse wheel on GimpContainerTreeView 2022-08-06 15:49:40 +00:00
Alx Sa ff1766be08 plug-ins: Fix Color XHTML export and GUI crash
Fixes some syntax and makes the plug-in aware of multi-layer selection,
so that the dialog actually appears when exporting as .html.
2022-08-06 15:10:41 +00:00
lloyd konneker 36521f5db2 Fix so that ScriptFu test scripts are not localized. 2022-08-06 14:37:56 +00:00
lloyd konneker ceddb0d369 Fix #8465 2022-08-06 10:02:17 -04:00
Martin 81391d82f1 Update Slovenian translation 2022-08-05 21:01:29 +00:00
Jehan fec1f53745 libgimp: don't run defcheck on macOS either.
Similar to commit f5751ec687.
See: https://gitlab.gnome.org/GNOME/gimp/-/issues/8274#note_1520297
2022-08-05 00:52:28 +02:00
Jacob Boerema 5fbd06629d plug-ins: fix #8411 crash when attempting to open PSD
Apparently some layers in PSD files can have extra channels which we
did not account for when computing destination offsets, causing crashes.

So let's make sure we don't include the "extra" channels when computing
the offsets by introducing base_channels. We also move the alpha channel
in the spot of the first extra channel (even though it seems, based on
the one example we have, that the extra channel might be the same as
the alpha channel).
2022-08-03 18:10:32 -04:00
lloyd konneker 031601a92a Fix 8452, crashing scripts.
Bugs in earlier enhancements re GFile, GEnum.
2022-08-03 15:51:15 -04:00
lloyd konneker 974f694cd2 ScriptFu: scripts use v3 API for multilayer gimp_image_get_selected_drawables etc.
Commit a6aba929 deleted the old functions.

Misc drive-by fixes for gtk_adjustment step not < pages

Issue #8155 discusses alternative fixes, convenience functions for compatibility in ScriptFu.
There is one compat function defined already in ScriptFu, temporarily: gimp-image-get-active-drawable
which was written so that testing clothify-v3.scm could proceed.
2022-08-03 12:48:07 +00:00
Hugo Carvalho c5e526f024 Update Portuguese translation 2022-08-03 09:33:05 +00:00
Luming Zh c2f9286cff Update Chinese (China) translation 2022-08-02 23:42:20 +00:00
Jehan f6f50ae1c7 meson: remove autotools-related data from the meson tarball. 2022-08-02 17:04:32 +02:00
Jehan dfd427d9db Remove old outdated data.
* gimp-zip.in was apparently a very old script to package GIMP for
  Windows into zip files. It has not been updated since 2007 and these
  days, we package GIMP as an installer for Windows. I guess the need of
  having just a compressed folder to move might be wanted for some, but
  anyway this script is so old, it's probably completely broken now. It
  would be much simpler to redo such a process from scratch (we have
  very close jobs in the CI which could be better bases to work from).
* config.h.win32 seems to be an old manually-maintained config.h and it
  has a big "WARNING! OUTDATED!" text at the top (also untouched since
  2007). I guess it might have been used some time long ago. But these
  days, we don't need a specific Windows-only config.h. The generated
  one works fine.
2022-08-02 16:33:09 +02:00
Jehan ef85c51a58 Issue #7907: work around possible outdated data in meson tarball.
`meson dist` don't imply a reconfigure or a rebuild which is actually
not great as it means a wrong order of commands may create tarballs with
outdated data (typically: build, then pull new code, then dist).

Of course for our official tarballs, it should be fine as we don't
generate tarballs manually anymore, but through the CI. Yet, just to be
on the safe side, force-trigger a reconfigure then a build (which would
likely be very fast anyway in the common use case where we just did a
build right before).

Additionally the INSTALL.in file is not copied anymore in the tarball
and INSTALL will only be generated in git repositories.
2022-08-02 16:06:51 +02:00
Anders Jonsson 3648e6d3be Update Swedish translation 2022-08-02 12:28:13 +00:00
Anders Jonsson 6469b75568 Update Swedish translation 2022-08-02 12:23:40 +00:00
Yuri Chornoivan ef88a2a2f6 Update Ukrainian translation 2022-08-02 11:14:31 +00:00
lloyd konneker 12c0c18036 ScriptFu: script-fu-register-filter for GimpImageProcedure.
Resolves #8382

Also v2 scripts infer and set sensitivity to drawables

Add two test plugins clothify-v3.scm and test-sphere-v3.scm.
Temporary, to be removed when 3.0 ships.

Some refactoring (extracting methods, moving functions to new files).

Some drive-by fixes to script-fu-arg.c revealed by using GimpProcedureDialog.
2022-08-02 07:45:35 +00:00
Anders Jonsson 25f8b332e9 Update Swedish translation 2022-08-01 23:27:03 +00:00
Alx Sa b99b7d779e display: Add soft-proof toggle to status bar
Adds a soft-proof toggle button to GimpStatusBar. It's only active when
a simulation profile is set on the current image. It stays in sync with
the View menu soft-proofing option as well.
2022-08-01 23:22:05 +00:00
Luming Zh 626bcbda48 Update Chinese (China) translation 2022-08-01 22:47:06 +00:00
Jehan 8d489b2ef3 gitlab-ci: make gimp-meson-debian more robust to source updates.
The `ninja dist` step fails with:

> ERROR: Repository has uncommitted changes that will not be included in the dist tarball
> Use --allow-dirty to ignore the warning and proceed anyway
> FAILED: meson-dist
> /usr/bin/meson dist

Astonishingly if I run a `git diff` (or git status) in the CI, I saw no
changes and the dist suddenly succeeded. When I remove it, it fails
again. And of course, locally it's alright. No way to diagnose!

Anyway it's not a bad idea to leave some diagnostic logs in the CI so
here we go, properly outputting the diff and exiting the job with an
error when there is a diff. Because anyway, there should be none. It
would mean that there is likely some issue in versionned generated
files.
2022-08-02 00:02:44 +02:00
Jehan f5751ec687 libgimp: don't run defcheck.py on Windows.
Ironically, it is a test for the Windows platform but it cannot run on
Windows. First, because it expects a .so (which could be easily fixed),
but even more because from web search, it looks like the nm tool may not
exist on Windows (though I haven't checked).

Anyway we only ever ran it from Linux machines and up to now, it worked
just fine and was useful anyway. So let's go with it.

Also clean a bit remnants from older attempts to run this script.
2022-08-01 23:34:50 +02:00
Jehan ccbf3c4bb0 app, libgimp*: add various stamp files to CLEANFILES.
Fixes:

> ERROR: files left in build directory after distclean:
2022-08-01 23:34:50 +02:00
Jehan e6ce33e2d1 gitlab-ci: distribute the meson-generated tarball as well.
Maybe let's try to distribute the meson tarball next to the autotools
tarball for our next dev release, and announce that packagers are
invited to test the meson build from tarball and report back.
2022-08-01 23:34:50 +02:00
Luming Zh 3d670e6d3b Update Chinese (China) translation 2022-08-01 21:23:44 +00:00
Jehan 83e465ec16 app, libgimp*: updating autotools script in sync with meson.
Generated *enums.c now have an additional stamp no-op header include
(see last 2 commits). Sync this change into the autotools generation
scripts to prevent back and forth useless generation of these files each
time we switch from one build system to another.
2022-08-01 20:00:01 +02:00
Jehan 979acaaae2 app, libgimp*: commit the newly generated *enums.c files.
They are nearly the same as initially, except that now they include an
intermediate stamp header which will be generated by the build system.

The only 2 enums which don't need these includes (and are not versioned)
are libgimp/gimpenums.c and libgimpthumb/gimpthumb-enums.c.
2022-08-01 20:00:01 +02:00
Jehan 106f2a061d Issue #8145: meson: generation of '*-enums.c' files.
Our meson build system was not properly building the enums.c file,
because they are versionned.

I did a similar trick as what I did for the pdbgen, which is that I used
a wrapper script around the existing perl script, which sets proper
options and generate a stamp file in the end (which is considered by
meson as the actual custom target, not the C file since it is generated
in the source dir).

The most important part is that the stamp file is a generated header
source (not just a random text file) which is **included** by the
generated C file. This is what will force meson to regenerate the C file
if the header is updated, **then** build using this new version, not use
an outdated versionned version (which would make for hard to diagnose
bugs), through the indirection of the intermediate stamp header.

See #4201.
See also: https://github.com/mesonbuild/meson/issues/10196#issuecomment-1080742592
2022-08-01 19:59:53 +02:00
Jehan f22b82f22f tools: only display "trouble reading […]" message when the script fails.
Displaying it all the time when we fail the first attempt is confusing
as it is expected to fail in the meson build (since build libraries are
in different folders). Instead only output the error message when both
known paths failed, i.e. when we fail the script (and write down both
attempted path in the error message).
2022-08-01 17:07:30 +02:00
Jehan e4cd2405a9 libgimpwidgets: do not export GResource generated functions.
This explains why the defcheck script never complained for the 2
*_get_resource() functions removed in my previous commit. These were
exported in the libgimpwidgets library on the autotools build (and not
on the meson build).

Fix the discrepancy by not exporting these symbols on autotools as well,
as I don't think this is needed on public API.

This should now fix the distcheck build for autotools.
2022-07-31 23:44:48 +02:00
Yuri Chornoivan 6957134a5b Update Ukrainian translation 2022-07-31 18:25:27 +00:00
Jehan 01e87819ce libgimpwidgets: fix def file.
The defcheck.py file finds these errors:

> Problem found in /home/jehan/dev/src/gimp/libgimpwidgets/gimpwidgets.def
>   the following symbols are listed in the .def-file,
>   but are not exported by the library.
>      - gimp_color_picker_cursors_get_resource
>      - gimp_icon_pixbufs_get_resource

Indeed these don't exist. Unsure why the autootols check failed to
report these until today.
2022-07-31 20:07:00 +02:00
Jehan 4c77c5acaf issue #8274: Port .def files check in meson.
The check script now takes into account both the autotools and meson
file hierarchy (in autotools, built libs are in .libs/ subdirs).

Also it now properly fails on missing lib.
2022-07-31 20:05:40 +02:00
Alx Sa 9f60d24581 core: Save/load soft-proofing profile in Image
Adds a parasite to .xcf that stores the soft-proofing profile.
Existing color profile saving/loading functions now take in a
parasite name parameter so they can be used for either profile.
2022-07-31 16:31:36 +00:00
Jehan 218c78e76a build: search only once for the addbom.sh script.
This avoids repeated "found: YES" output (one per installer language) on
the project configuration.
2022-07-31 18:25:33 +02:00
Jehan 2ac483f9e3 meson: make run_command() calls future-proof.
Some of our calls to run_command() would have failed with future
versions of meson if we didn't set the "check" parameter. In particular,
in various calls, we don't want to fail the whole build configuration
when the command does (as it's an optional feature check). In such a
case, it is important to be explicit as future will default to fail
then.

Fixes:

> WARNING: You should add the boolean check kwarg to the run_command call.
>          It currently defaults to false,
>          but it will default to true in future releases of meson.
>          See also: https://github.com/mesonbuild/meson/issues/9300
2022-07-31 18:23:00 +02:00
Jehan c857fc58a6 pdb, po-tips: fix meson warnings.
Meson is apparently able to show different warning depending on the
meson version tests we do in specific code paths.

Since our global required meson is 0.53.0 but on some code paths, we
test for 0.57.0, we must use meson.source_root() on older meson and
meson.project_source_root() on newer one.

Fixes:

> pdb/meson.build:141: WARNING: Project targets '>=0.57.0' but uses feature deprecated since '0.56.0': meson.source_root. use meson.project_source_root() or meson.global_source_root() instead.
> pdb/meson.build:141: WARNING: Project targets '>=0.57.0' but uses feature deprecated since '0.56.0': meson.build_root. use meson.project_build_root() or meson.global_build_root() instead.
> po-tips/meson.build:5: WARNING: Project targets '>=0.53.0' but uses feature introduced in '0.56.0': meson.project_source_root.
2022-07-31 18:16:00 +02:00
Jehan 47ba11056f Issue #7386: fix languages non-provided by InnoSetup showing as English.
The language files provided by the InnoSetup project (either the main
ones or the "Unofficial" ones, i.e. less maintained ones) at least
provides the name of the language, possibly in English, ideally
self-localized in its own language.

Unfortunately Kabyle didn't have any language file so we were using the
Default one, which ended up showing the lang as a duplicate (and very
wrong) "English".

With this commit, I add code to provide our own very basic base language
file, which would at least contain the language name. There is also a
concept of language ID to be verified in Windows-provided list.
Unfortunately it doesn't have any (actually it was id-ed 0x1000 like
many other languages, which looked therefore to be the code for an
unsupported lang). InnoSetup docs tells us to leave 0 then. We can add
the ability to set a specific code later in the template if we add other
un-provided languages and if they have their own lang id.

With this base infrastructure, we should be able to better support more
languages.
2022-07-31 15:10:04 +00:00
Alexander Shopov 26d0c2083f Update Bulgarian translation 2022-07-31 13:40:35 +00:00
Alexander Shopov b065c8a0f7 Update Bulgarian translation 2022-07-31 13:33:46 +00:00
Jehan 195ed374f4 Issue #8338: add BOM to ISL file as external script.
Unfortunately the weird encoding of a string to bytes to get the UTF-8
BOM worked on my local machine, but not on the Windows CI. I'm not going
to fight it and fallback to a shell script.

I am guessing it should work fine on all platform since we use basically
the same sed call in build/windows/gitlab-ci/installer-gimp-msys2.sh
already.
2022-07-31 01:43:05 +02:00
Jehan 4293d05dda Issue #8338: add a BOM to ISL files.
Inno-Setup absolutely requires it to recognize UTF-8 translation files.
This should hopefully be the final fix to #8338.

Note that this fix is full of workaround for meson bugs or limitations.
While it was a one-liner in autotools, added to the existing rule, here
I have to add an additional (non-relevant) target rule, then uglily work
around 2 bugs:
https://github.com/mesonbuild/meson/issues/1564
https://github.com/mesonbuild/meson/issues/7696

I can't say I'm so happy about the resulting change, even though it
seems to work. If anyone can propose a nicer build rule, it would be
welcome.
2022-07-30 23:28:39 +02:00
Niels De Graef 7186907c16 build: Fix windows installer i18n
Whenever we have an element without translation, we try to use the value
without a `xml:lang` attribute. That selector was wrong though, which
leads to https://gitlab.gnome.org/GNOME/gimp/-/issues/8338, which should
now be fixed.
2022-07-29 20:40:41 +02:00