1
1
mirror of https://gitlab.gnome.org/GNOME/gimp.git synced 2025-10-06 05:22:40 +02:00

Compare commits

...

2999 Commits

Author SHA1 Message Date
Michael Henning
9e1c6aa02b app: Save maximize state of image window in...
...multi-window-mode too.
2024-03-24 03:08:12 +00:00
Alx Sa
f12687e9f5 plug-ins: Port file-pdf-save-multi to GimpProcedureDialog
In addition to the port, mnemonics were added to both file-pdf-save-multi
and file-pdf-save's GUI parameters.
Some runtime warnings were also fixed, such as trying to use a NULL string
parameters to make a file and trying to access properties from file-pdf-save
that don't exist in file-pdf-save-multi.
2024-03-24 02:20:05 +00:00
Bruno Lopes
5de967aae9 gitlab-ci: Drop Windows resource .patch since MSYS2 now have LLVM 18 2024-03-23 20:07:54 -03:00
Alx Sa
ed1e8a62aa xcf: Set NDE filter visibility on load
The filter visibility setting was being loaded but
not actually used to set a filter invisible.
2024-03-23 21:31:20 +00:00
Jordi Mas
027a52bcae Update Catalan translation 2024-03-23 16:53:52 +01:00
Alx Sa
2e0d31b17e modules, core, pdb, plug-ins: GeglColor ports
More minor ports from GimpRGB to
GeglColor.
Note that file-mng's GimpRGB code was
already dummied out.
2024-03-23 07:16:02 -04:00
Alx Sa
db88383abb themes: Define no box-shadow on unselected tabs
As shown in a video for issue 11087, some system themes
may add a white box-shadow on the side of unselected
tabs. This patch forces box-shadow to "none" to prevent
this.
2024-03-22 16:27:55 +00:00
Rodrigo Lledó
9e0e56be95 Update Spanish translation 2024-03-22 15:10:31 +00:00
Marco Ciampa
b4895b0ff5 Updated Italian translation 2024-03-22 11:28:47 +01:00
Marco Ciampa
e0ee27f66f Updated Italian translation 2024-03-22 11:00:42 +01:00
Marco Ciampa
71c7d36009 Updated Italian translation 2024-03-22 10:06:14 +01:00
Alx Sa
fef2120dd3 xcf: Fix filter color saving bug
Resolves #11057
Per Idriss Fekir's research, data from GBytes
should be written before the GByte is freed.
Perhaps due to luck, the data persisted on
Windows but was freed too early on Linux.
This patch should resolve the issue.
2024-03-22 02:01:57 +00:00
Marco Ciampa
ec88bc40cc Updated Italian translation 2024-03-22 01:50:28 +01:00
Marco Ciampa
515f353737 Updated Italian translation 2024-03-22 01:47:09 +01:00
Ekaterine Papava
6f03b6934f Update Georgian translation 2024-03-21 23:33:27 +00:00
Ekaterine Papava
ba0646bdf3 Update Georgian translation 2024-03-21 23:27:36 +00:00
Alx Sa
3233aed0dc plug-ins: Fix Palette and Gradient functions
Resolves #11083

Per bootchk, changes in function calls to
palette_entry_get_color () and 
gradient_segment_get_left_color () were
broken in Python scripts due to GelColor
being used post Color Space Invasion.
This patch fixes the calls and returns.
2024-03-21 13:06:39 +00:00
bootchk
59b6c8fc8f ScriptFu: fix 11077: call gimp_ui_init in every run_func
More descriptive name for script-fu-interface-dialog

Delete SF flag for gimp_ui_init already called: gimp_ui_init can be called often.

FUTURE: might be faster to call just gegl_init when mode is non-interactive.
2024-03-20 11:35:48 +00:00
bootchk
fc310e0bed libgimpui: annotation of gimp_ui_init say it can be called often. 2024-03-20 11:35:48 +00:00
lillolollo
c72f91d69a remove extraneous parentheses 2024-03-20 10:27:07 +00:00
Yuri Chornoivan
d207fcde4a Update Ukrainian translation 2024-03-20 10:11:35 +00:00
Alx Sa
ef548fff65 widgets,modules,plug-ins: GeglColor ports
After the color space invasion, the
Clip Warning filter no longer had color
areas for its shadow, highlights, and
bogus color properties. This patch ports
them to GeglColor so the widget can be
created correctly.
GimpRGB structs are also converted to
GeglColor in GimpPanedBox and two
plug-ins.
2024-03-20 02:53:41 +00:00
Anders Jonsson
0bc99a29e1 Update Swedish translation 2024-03-19 22:02:36 +00:00
Anders Jonsson
188d00193a Update Swedish translation 2024-03-19 22:01:07 +00:00
Jehan
1158fc2119 app: make sure we just seek past unknown effect properties.
Otherwise we are not in a valid position anymore and further loading the XCF
fails. This may happen when updating a GEGL operation (in particular removing
effect properties, or renaming them).
2024-03-19 18:03:25 +01:00
Alx Sa
2b62976260 propgui: Port Color-To-Alpha GUI to GeglColor
The two threshold color pick buttons needed to have
a GeglColor parameter for their GimpPickerCallback
rather than a const GimpRGB.
This also fixes a crash caused by trying to free the GeglColor
rather than unreferencing it.
2024-03-19 14:32:14 +00:00
bootchk
2c664fac72 API PDB: resource-get-by-name return NULL instead of error
Without this, there is no easy way to quietly check for existence of a resource by name.
Needed when plugin authors can name defaults for resource args by name.

Add tests to script-fu/test/tests
2024-03-19 12:05:28 +00:00
Alx Sa
05af8c91c1 widgets: Minor GimpRGB to GeglColor ports
Mainly fixing GimpRGB comments and
parameters that are unused (or in unused
functions).
GimpCircle and GimpGradientChooser
have color conversions ported to use
GeglColor exclusively.
2024-03-19 04:40:14 +00:00
Jehan
f46c536ebb app: fix GEGL buffer leaks.
Since commit 10b96b1025, we had buffer leaks as soon as we ran filters.
gimp_drawable_get_buffer_with_effects() was either creating a new buffer (when a
drawable had filters) or not. And calling code couldn't know which is which.

Code needs to be consistent. Either we return a new reference to take ownership
to, or not. So let's change to add a new reference to the drawable' buffers so
that it always returns a new reference to free.
2024-03-18 22:08:03 +01:00
Martin
6e1cc909ce Update Slovenian translation 2024-03-18 17:23:46 +00:00
Marco Ciampa
256c795a10 Updated Italian translation 2024-03-18 12:52:50 +01:00
Jacob Boerema
0faa8f5460 plug-ins: fix #8453 Wrong order of layers in certain PSD files
So far, we did not consider that group layers could also be part of
a set of layers that have clipping set. This means that clipping groups
can be nested.

To support this we have completely rewritten the layer parser to detect
all clipping groups and mark them in a first pass. We now go through
the layers from the last (top) layer to the first (bottom) in this
first pass, because that makes it easier to detect the start/end
pairs of a clipping group.

In the second pass we handle the clipping groups first before adding
layers, except when a regular group is also the start of a clipping
group. In that case we need to handle the clipping after creating the
regular group, or we get an incorrect order.
2024-03-17 17:59:17 -04:00
Jacob Boerema
8a958d1568 plug-ins: refactor psd clipping group conversion into a ...
separate function
2024-03-17 17:59:17 -04:00
Jacob Boerema
f8b8ffa10e plug-ins: do not drop unsupported psd layers
Unsupported psd layers were dropped when loading psd images. This
causes problems when handling psd clipping groups, see issue #8453.

PSP also does not drop unsupported layers, so let's keep the layers
and accept that they will usually show up empty. This will help in
fixing clipping groups in a next step.

While we are at it, also remove the warnings that are only shown when
define CONVERSION_WARNINGS is TRUE (defaults to FALSE). We already
have a better way to show unsupported features, so at least for the
unsupported layers it is not needed anymore.
There are still some CONVERSION_WARNINGS warnings left over in the
blend modes conversion, which do not have a similar warning in our
unsupported features dialog.
2024-03-17 17:59:17 -04:00
Andi Chandler
f7c42b3bbf Update British English translation
(cherry picked from commit 4733819167)
2024-03-17 20:35:33 +00:00
Alx Sa
28b236b578 libgimpbase: Replace GimpRGB in gimpchecks
Converted to gdouble[] and updated in all 
calls to the enums in gegl_color_set_pixel()
2024-03-17 16:19:25 +00:00
Bruno Lopes
c2d8d6c45c .gitlab: Improve Feature request template
* Makes the wording more concise and "first contributor-friendly"
+ Adds info about submitting patches
* Makes the explanation of use cases implicitly mandatory
+ Adds discuss info to facilitate the redation of use cases
2024-03-16 20:25:03 +00:00
Bruno Lopes
9691665d52 gitlab-ci: Update jobs order
Following 5542748779
2024-03-16 15:38:51 -03:00
Rodrigo Lledó
5581b0b8b8 Update Spanish translation 2024-03-16 16:25:43 +00:00
Rodrigo Lledó
c0e7aebc8d Update Spanish translation 2024-03-16 16:22:49 +00:00
Rodrigo Lledó
cf97007ba8 Update Spanish translation 2024-03-16 16:15:08 +00:00
Rodrigo Lledó
1abcc8100c Update Spanish translation 2024-03-16 16:05:27 +00:00
Rodrigo Lledó
24062b9e50 Update Spanish translation 2024-03-16 16:01:18 +00:00
Bruno Lopes
e61b7e05ed build/windows: Port Installer script to .ps1
This commit unites two scripts (.sh + .bat) in one .ps1. PS was choosed, since:
1) We don't need MSYS2 to distribute with Inno at first. Now, who wants to
   just distribute GIMP can do it easier natively without a separate environ.
2) PS is actually pretty solid and have a good number of cmdlets, unlike the
   ancient CMD, which barely supported more than 9 parameters in .bat files.
   Consequently, some redundant variable checks have been removed from the .ISS.

Also, changes the name of the job and script for better consistency with the
upcoming MS Store job.
2024-03-16 15:24:45 +00:00
Rodrigo Lledó
d92ed3e496 Update Spanish translation 2024-03-16 14:48:24 +00:00
Bruno Lopes
a4e94d86ea Issue #8209: Don't install unselected components 2024-03-16 00:13:44 +00:00
Jürgen Benvenuti
5af2607525 Update German translation 2024-03-15 23:28:43 +00:00
Andi Chandler
3acedc30cf Update British English translation 2024-03-15 18:28:24 +00:00
Bruno Lopes
e89bca35c7 gitlab-ci, build: Move to Clang in Windows (native)
This makes possible to use the Universal C library provided by Microsoft.
2024-03-15 17:08:31 +00:00
Bruno Lopes
5542748779 gitlab-ci: Move to Clang in Debian
This makes the GEGL code execution a bit faster in Linux.
2024-03-15 17:08:31 +00:00
Jehan
c4d5f67388 Issue #11048: simplify the previous fix.
Though commit a14caafa8c was not wrong per-se, it's a bit too much. ;-)

Functions like g_ascii_dtostr() already exists for this very purpose of
converting a double/float to string in a locale-independent format.
2024-03-15 15:33:21 +01:00
Sabri Ünal
b8a9a1e9e9 Update Turkish translation 2024-03-15 13:38:40 +00:00
Sabri Ünal
f51c340c97 Update Turkish translation 2024-03-15 13:13:16 +00:00
Sabri Ünal
4bf425e188 Update Turkish translation 2024-03-15 13:12:11 +00:00
Sabri Ünal
1ca303132d Update Turkish translation 2024-03-15 13:12:05 +00:00
Sabri Ünal
14fc21d192 Update Turkish translation 2024-03-15 13:11:05 +00:00
Alx Sa
a14caafa8c gui: Prevent localization issues with font-size
CSS breaks when given a number with a comma as the radix
instead of a decimal. Depending on the system localization,
printf () may return numbers in this format when resizing
the font. This causes the theme to break unless font size is
set to 100.
To prevent this issue, we create the font size string manually
using integer division and mod operations.
2024-03-15 12:40:01 +00:00
Martin
7e58a00a74 Update Slovenian translation 2024-03-15 08:44:22 +00:00
Martin
3f6e3021da Update Slovenian translation 2024-03-15 08:36:08 +00:00
Jehan
11539e6d74 NEWS: update. 2024-03-15 02:48:51 +01:00
Yuri Chornoivan
4718645a0a Update Ukrainian translation 2024-03-14 18:30:15 +00:00
Yuri Chornoivan
02649e3d65 Update Ukrainian translation 2024-03-14 18:26:51 +00:00
Alx Sa
3767e1032d libgimpwidgets: Port GimpCellRendererColor...
...to use GeglColor rather than GimpRGB.
Also update the ColorHexEntry,
DynamicsOutputEditor, and the
colormap-remap plug-in which uses this
widget.
2024-03-14 00:40:02 -04:00
Alx Sa
917506d16e libgimp, dialogs, plug-ins: Minor fixes
- Replaces GimpRGB in Channel Dialog
with gdouble array, as was done in
channel_options_color_changed ()
- Replace %ld with G_GSIZE_FORMAT
in libgimp checkboard color message to
fix warning in Windows build
- Set file-gih documentation text as
translatable.
2024-03-14 01:41:31 +00:00
Jehan
4f14e89ed9 app: move the "Show on Start" checkbox inside "Create" tab.
I think I may even have been the one who suggested to make this checkbox always
visible, but after more thought and usage, I just realize that this option is
not about showing the Welcome dialog, but about showing the Create tab of the
Welcome dialog. So I move it to the Create tab.

A very obvious case where the previous option location could have been
considered wrong is that we will always show the dialog (on the "Welcome" tab)
for updates, even if this checkbox had been unchecked. So if we left it as a
global option of the dialog, this could be considered a bug (the option is
disabled, but the dialog still opens on updates), whereas the new position and
shortened label make it clearer that this settings only apply to whether or not
we show specifically the Create dialog on start.
2024-03-14 00:39:14 +01:00
Jehan
3b261e3b31 app: render the splash in Welcome dialog with no window background showing on the sides.
I think it's much prettier with no part of the window showing up on the left and
right sides.
2024-03-14 00:39:14 +01:00
Jehan
e93f35a521 app: do not waste that much space in the welcome dialog.
The splash image had a lot of empty space around it. From what I understood,
this is because we want to avoid it to be too big because it makes the dialog
overgrow the display size on small screens. But I don't think that was a very
good idea. We should find better ways to save space.
2024-03-14 00:39:14 +01:00
Anders Jonsson
c6cbb100d9 Update Swedish translation 2024-03-13 20:34:58 +00:00
Yuri Chornoivan
8952bf0e1d Update Ukrainian translation 2024-03-13 19:56:19 +00:00
Yuri Chornoivan
8b707e7271 Update Ukrainian translation 2024-03-13 19:48:44 +00:00
Alx Sa
234fa0e820 xcf: Save color profile for NDE filters
In d055564d, a pointer to the color profile
for NDE filter color properties was being
saved rather than the actual ICC profile.
This patch fixes the issue.
It also allows colors to load even if the
color profile is corrupted, with a warning.
2024-03-13 01:44:23 +00:00
lillolollo
dde1e5a054 App/core; Fix Critical floating object 2024-03-12 21:02:33 +00:00
Ekaterine Papava
33eca64697 Update Georgian translation 2024-03-12 17:54:16 +00:00
Alx Sa
86f62e8330 plug-ins: Replace GimpHSV in colormap-remap
Per bbb30eac, the GimpHSV object is replaced with
gegl_color_get_pixel () in "HSV double" color format.
GimpCellRendererColor still needs to be updated to
accept GeglColor rather than GimpRGB.
2024-03-12 16:01:52 +00:00
Stanislav Grinkov
bbb30eacfb plug-ins: Rewrite colormap-remap plugin
This commit fixes several issues with the plugin.

* Move plug-in to GimpProcedureDialog framework (see #9250)
* Use GimpPalette instead of (soon to be deprecated) Colormap (see #9477)
* Make plugin UI height, make it resizeable, update font sizes,
  paddings, etc (see #10533)

Further improvements most likely are needed because plugin still uses
GimpRGB and GimpHSV (former is used by GimpCellRendererColor, latter for
H, S, and V values)

Resolves: https://gitlab.gnome.org/GNOME/gimp/-/issues/10533
Resolves: https://gitlab.gnome.org/GNOME/gimp/-/issues/10749
2024-03-12 20:13:09 +05:00
Alx Sa
f39af05a48 devel-docs: Replace Gimp.RGB with Gegl.Color
Updating Python plug-in developer
instructions to use Gegl.Color instead of
Gimp.RGB.
2024-03-12 14:51:20 +00:00
Alx Sa
85bb1790b7 plug-ins: Restore GIH parameters from file
During the GimpProcedureConfigDialog port,
the "gimp-brush-pipe-parameters" parasite loading
code was unintentionally removed. This parasite
was used to restore the GIH parameters if it was
loaded as an image.
This patch restores that code on initial export as
GIH, then removes the parasite since the parameters
will be saved as part of the GimpProcedureConfig
going forward.
2024-03-11 18:37:28 +00:00
Jehan
7f35729c1e Issue #5342: Export to 16-bit PNG incorrectly sets background color to 8-bit. 2024-03-11 18:31:06 +01:00
bootchk
7a48cdccb4 ScriptFu: translations: Skip translating test script test-v3.scm 2024-03-11 11:14:36 -04:00
Sabri Ünal
98ef0c7adb Update Turkish translation 2024-03-11 14:41:25 +00:00
Sabri Ünal
e8b963a14b Update Turkish translation 2024-03-11 14:41:15 +00:00
Sabri Ünal
a34cf018ab Update Turkish translation 2024-03-11 14:39:40 +00:00
Jehan
9816d9a0bd build: sync with beta flatpak.
Update various dependencies.
2024-03-11 03:45:02 +01:00
Anders Jonsson
d4db1aa42c Update POTFILES.in
Followup to 0d512085f3
2024-03-10 21:19:22 +01:00
Rūdolfs Mazurs
4401ddfc20 Update Latvian translation 2024-03-10 15:48:06 +00:00
Ekaterine Papava
9d515f24e7 Update Georgian translation 2024-03-10 14:53:12 +00:00
Ekaterine Papava
6e4d78f91f Update Georgian translation 2024-03-10 14:51:00 +00:00
Ekaterine Papava
9203ff336c Update Georgian translation 2024-03-10 14:49:31 +00:00
Andre Klapper
f59f8a3df2 Save gradient as CSS: Remove outdated vendor-prefixed CSS extensions 2024-03-09 22:10:30 +00:00
bootchk
98bf051e7a Fix #10044 more natural binding of PDB return values
Allow (script-fu-use-v3) in script, or in SF Console.

Definitive description is in script-fu/docs/using-v3-binding.md

Makes SF interpret v3 of SF dialect.
  - marshals single return value from PDB without wrapping in list
  - marshals boolean return value from PDB as #t #f instead of integers
  - marshals boolean to PDB from #t and #f or TRUE and FALSE
  - marshals void return from PDB as () instead of (#t), but that is moot.

The version of SF dialect is distinct from the version of the PDB API.

Dialect v3 is opt-in: the initial dialect of all SF tools remains v2.

Commit also allows #t,#f for defaults of SF-TOGGLE instead of TRUE, FALSE
but that is an independent enhancement (but closely related.)

Affects interpreter state of the current process.
Not an attribute per se of a plugin.
While in this state, a plugin should not call PDB procedures
which are themselves v2 script plugins,
or a few utility scripts in script-fu-util.scm,
but that is rarely needed.

Does not remove symbols TRUE and FALSE from dialect.

A script can also call (script-fu-use-v2) to revert.
That is also discouraged but useful e.g. for testing.
2024-03-09 07:21:50 -05:00
Alx Sa
d4af93b256 libgimpcolor: Fix CAIRO_FORMAT_RGB96F babl format
As noted by Idriss, this should most likely be R'G'B' instead.
2024-03-08 20:56:32 +00:00
Anders Jonsson
b0cec7c771 Update Swedish translation 2024-03-08 19:53:48 +00:00
Anders Jonsson
0d512085f3 menus: move menus to submenus of tab menu
Fixes #9883

    There were menus that put their entries
    directly in the tab menu rather than in a submenu.

    This moves them to submenus to bring back GIMP 2.10 behavior.

    Stray entries added by scripts are also moved to the right
    submenu.
2024-03-08 17:48:38 +00:00
Kamil Burda
08c1fdc719 plug-ins: Replace guchar PDB parameters with more appropriate types
For improved readability, int or boolean types are used in place of
guchar for PDB parameters where the parameter description better fits
one or the other type.

This change affects `plug-in-alienmap2` and `plug-in-maze`.

Also, the problem with `guchar` parameters is that they currently cannot
 be modified via `GimpProcedureConfig` due to the type not being
supported.
2024-03-08 14:08:05 +00:00
cheesequake
905e8777a7 Fixes #11000: Cut now clears out the selection properly 2024-03-08 14:01:07 +00:00
bootchk
b854db9666 ScriptFu: fix #11013 ts-hello-world.scm crashes at query time
Call gimp_ui_init during query phase as well as run phase.

Maybe gimp_main() should do this.

Since space invasion from GimpRGB to GeglColor,
plugins that declare defaults for formal args of type GeglColor
need babl and gegl at plugin registration time.
2024-03-08 08:16:20 -05:00
bootchk
a2f01ff5f1 Test: add color/pixel related tests
Add more tests of selection by shape

Add test! statement to the test framework.
2024-03-08 11:49:38 +00:00
Bruno Lopes
3c129a79d5 build: Drop 'docker' draft folder
The 'Docker' draft of GIMP was introduced in 09/04/2017 and then died ONE day
after, mostly because of "bad" timing (few years later we moved to GitLab CI).

Similar (in fact, even worse) than 'jhbuild' folder, update it to keep the
current development status is so hard that it is equal to do it from scratch.
So it is reasonable to delete it anyway.
2024-03-08 10:15:29 +00:00
Yuri Chornoivan
d3e37fa538 Update Ukrainian translation 2024-03-07 21:39:09 +00:00
Philipp Kiemle
5460687766 Update German translation 2024-03-07 21:24:22 +00:00
Martin
aef14ef721 Update Slovenian translation 2024-03-07 18:41:09 +00:00
Martin
7d46e0c6b4 Update Slovenian translation 2024-03-07 18:31:24 +00:00
Martin
52c5869cae Update Slovenian translation 2024-03-07 18:30:11 +00:00
Martin
9fd37c82b3 Update Slovenian translation 2024-03-07 18:27:52 +00:00
Martin
4065f3fba4 Update Slovenian translation 2024-03-07 18:25:10 +00:00
Jacob Boerema
4bf2c1e1ba plug-ins: fix #10903 Missing metadata in OpenEXR images from darktable
Due to changes in our metadata handling API for plug-ins, the exif and
xmp metadata read from exr images was being overwritten by empty
metadata.

Fix this by following the new API and also add messages when loading
metadata fails. That way it will be easier to catch in the future if
metadata loading gets broken again.
2024-03-07 13:12:08 -05:00
Jacob Boerema
0585bc11d4 plug-ins: fix incorrect size when comparing jpeg exif marker in EXR loader
When defining jpeg_exr a closing \0 is automatically added by the
compiler. So when we compare it using sizeof, we do not compare
6 bytes but 7. Since there won't be three 0's, this will fail.

Fix this by reducing the size by 1 and also update the comment to
make this clear and further to add that this was changed after
darktable 4.0.0.
2024-03-07 13:12:08 -05:00
Jacob Boerema
f00ad15b7b libgimpbase: fix loading exif data from buffer
gimp_metadata_set_from_exif has special code for handling old-style
GIMP exif parasite data, but didn't check for the more common case
of loading exif data from image formats that can't be handled by exiv2.

The exif data in these formats usually start with the TIFF endian
markers instead of "Exif", which caused a failure to read this
metadata for e.g. EXR images, see issue #10903.

We change this function to check for "Exif" at the start of the data,
in which case we assume it to be the old-style exif parasite and in
that case add extra metadata as was previously always done.

In all other cases, we do not add extra metadata.
2024-03-07 13:12:08 -05:00
Kolbjørn Stuestøl
0c6c3d5347 Update Norwegian Nynorsk translation 2024-03-07 15:51:52 +00:00
Kolbjørn Stuestøl
7a5fd3120f Update Norwegian Nynorsk translation 2024-03-07 15:30:50 +00:00
Yuri Chornoivan
06fa6bad89 Update Ukrainian translation 2024-03-07 14:20:26 +00:00
Bruno Lopes
b51e0bc464 build/windows: Update some Installer strings
- Remove obsolete GtkWimp and Compat strings
* Update 32-bit string
2024-03-07 10:42:34 +00:00
Bruno Lopes
a0512f5aae build/windows: Clean *gimp3264.iss regarding 2.0 series InstallDelete
These files are not deleted when the Unstable (GIMP 2.99) or Stable (GIMP 3)
version are installed because the root is different. So, they can be removed.
2024-03-07 10:08:34 +00:00
Sabri Ünal
bc6252dcdf Update Turkish translation 2024-03-07 09:24:32 +00:00
Sabri Ünal
e0853f9141 Update Turkish translation 2024-03-07 09:24:28 +00:00
Alx Sa
63ea1e2b5f plug-ins: Get monitor after screenshot dialogue
Resolves #11004

During the port to GimpProcedureDialog, the code
that assigned the current monitor object for
Windows and MacOS was accidentally removed.
This patch restores this code in the proper place.
2024-03-07 03:14:48 +00:00
Alx Sa
69314ba087 tools: Add NDE support for group layers
This patch allows NDE filters to be
applied to group layers as well.
The "merge down" function is disabled.
2024-03-06 22:04:28 +00:00
bootchk
71b41c68c2 ScriptFu: fix #11010 unhandled return type GimpColorArray
Add a case to the marshalling of return types from the PDB,
for the new type GimpColorArray.

test case is gimp-palette-get-colors in tests palette.scm
2024-03-06 14:48:41 -05:00
bootchk
4c16b20d69 2.99 Tests: add more tests
Add tests of Drawable.
2024-03-06 10:45:44 -05:00
bootchk
279341a237 ScriptFu: fix #11001
At script create time, create a GimpRGB i.e. pixel from the declared name of default color.

At plugin procedure registration time, convert that pixel to GeglColor,
and use that color to declare the color arg using GeglParamSpecColor(default=color)

Fixes a faulty fix a few commits back where we lost the declared color name.
The proper dataflow is  name->color->paramspec-with-default-color.
2024-03-06 09:55:38 -05:00
bootchk
f7c876dfd3 2.99 ScriptFu: refactor, extract methods of color and resource
Extract methods related to color into new file.
So method names document what is being done.
So related code is together.

Ditto for resource.

No functional change.

Preparing for changes to reset/default and changes to representation of pixels
in lists of differing lengths rgb vs rgba.
2024-03-06 08:07:11 -05:00
Idriss Fekir
0f32312e26 widgets: Fix error on text color selection
Resolves #11003

GeglColor defaults to NULL rather than black like
GimpRGB. When selecting text with two or more colors
in the total selection, this causes NULL to be passed
to gimp_color_button_set_color () which throws an error.
This patch resolves the issue by setting GeglColor to
black if it's NULL before the call.
2024-03-06 06:37:13 -05:00
Yuri Chornoivan
a905208873 Update Ukrainian translation 2024-03-05 20:09:50 +00:00
Alx Sa
0c26cd442a operations: Port semi-flatten to GeglColor
After the color space invasion, the
Semi-Flatten GUI was broken since it still
used GimpRGB as its color property.
This patch fixes this by porting to
GeglColor. The GimpRGB conversion was
also removed from the PDB interface
since the GeglColor comes directly from
GimpContext.
2024-03-05 18:30:53 +00:00
Rodrigo Lledó
29cac9eaef Update Spanish translation 2024-03-05 12:35:40 +00:00
Rodrigo Lledó
98894383dd Update Spanish translation 2024-03-05 12:06:13 +00:00
Luming Zh
c7b6444543 Update Chinese (China) translation 2024-03-05 08:52:42 +00:00
Alx Sa
625b74ea00 pdb: Update text-layer-set-color to GeglColor
Resolves #10992.

GimpTextLayer's color attribute was
updated from GimpRGB to GeglColor,
but gimp-text-layer-set-color still passed
in GimpRGB. This patch updates the PDB
call to match the property type.
2024-03-05 01:42:22 +00:00
cheesequake
1a76346ed5 Fixes:#10933 context swatch crash issue 2024-03-04 21:10:36 +00:00
Jacob Boerema
a22a2a5b15 plug-ins: fix overwriting a GError in PCX loader
In the previous commit I overlooked one other case where the GError
can be overwritten. Fix this by using g_prefix_error.
2024-03-04 15:53:06 -05:00
bootchk
b2af8b6c2c ScriptFu fix #10982 broken build, and spurious CRITICAL
Fixes errors introduced by my prior commit c0ca0b74

1. SF is storing colors in GimpRGB, not GeglColor.
Storing using wrong pointer type seemed to work, but would not build on newer compilers.

2. spurious error message "CRITICAL....Two different plugins tried to register..."
Due to calling gimp_ui_init too early, in the class instance init.
2024-03-04 17:21:17 +00:00
Jacob Boerema
4cb6ee45a1 plug-ins: fix double free when loading invalid PCX image
When testing on Debian with acertain invalid PCX imagea that return
"Invalid number of bytes per line in PCX header", we get an error:
free(): double free detected in tcache 2
On Windows this doesn't cause an error, most likely due to a different
implementation of fclose.

The problem is that in case of errors fclose was called twice. Since
the file is opened outside the load_image functions, let's handle
closing also only outside that function.

In addition to that, change all g_message error notices to use
g_set_error instead, that way we always return a GError in case of an
error.

Further we also fix a possible error case of overwriting an existing
error by using g_prefix_error when the error is already set.
2024-03-04 11:32:42 -05:00
Alx Sa
2f94edfe8c tools: Switch to GeglColorButton for mask-color
Resolves #10990.

Since the "mask-color" property is now a GeglColor,
we need to use gimp_prop_gegl_color_button_new ()
rather than gimp_prop_color_button_new () to
display it in the options panel.
2024-03-04 12:17:26 +00:00
Emin Tufan Çetin
fa5373d99a Update Turkish translation 2024-03-04 01:11:02 +00:00
Alx Sa
d055564d26 xcf: Save/Load color property for NDE filters 2024-03-03 21:07:37 +00:00
Yuri Chornoivan
387503507c Update Ukrainian translation 2024-03-03 19:10:28 +00:00
Martin
d9c33636a3 Update Slovenian translation 2024-03-03 16:25:45 +00:00
Anders Jonsson
97e19ff931 plug-ins: mark xmc tooltips as translatable 2024-03-03 11:25:19 +01:00
Luming Zh
e0dab4172f Update Chinese (China) translation 2024-03-03 08:48:31 +00:00
Alx Sa
3b37ab4fb2 plug-ins: Convert GIFs to 8 bit on export
During the sanity_check (), we verify an image is 8 bit
before exporting as a GIF. If it isn't, we try to convert
and notify the user.
2024-03-02 20:41:14 -05:00
Martin
b639c05a05 Update Slovenian translation 2024-03-02 21:29:23 +00:00
Martin
d7a783823c Update Slovenian translation 2024-03-02 21:25:06 +00:00
Martin
80a0d76933 Update Slovenian translation 2024-03-02 21:22:47 +00:00
Martin
51d1a4f1cc Update Slovenian translation 2024-03-02 21:15:25 +00:00
Martin
753c7ba2c5 Update Slovenian translation 2024-03-02 21:12:37 +00:00
Balázs Úr
967e352d7a Update Hungarian translation 2024-03-02 19:44:42 +00:00
Bruno Lopes
683c6a3063 Issue #10960: Make disabled checkboxes less confusing 2024-03-02 12:59:33 -03:00
Balázs Meskó
6d7a67fb45 Update Hungarian translation 2024-03-02 10:06:00 +00:00
Alx Sa
a16219bf4b dialogs: Fix buttons missing their style class
Per @brunolopesdsilv, the About and Quit
dialogues had custom buttons which did
not receive the text-button CSS style.
This patch adds those back so the buttons
match the styling of the others in the
dialogue.
2024-03-02 03:55:08 +00:00
Yuri Chornoivan
823ab560c6 Update Ukrainian translation 2024-03-01 21:42:23 +00:00
Jacob Boerema
9626ad6803 plug-ins: fix crash when loading pcx image where bytesperline is 0
Previous pcx commit da217088d0 fixed
loading pcx images that had an off by one value for bytesperline.
However, it did not take into account that a value of 0 would be
invalid, causing a crash.

We fix this by adding a check for 0 and also failing in that case.
2024-03-01 13:24:49 -05:00
bootchk
c0ca0b74a9 2.99 ScriptFu: #10958 Missing color widgets in v3 dialogs
Since PDB now traffics in GeglColor instead of GimpRGB.

Change GimpParamSpecRGB to GeglParamSpecColor when declaring args to procedure.
Declared default is temporarily "black".

Change conversion of gvalue to scheme representation, now from GeglColor.

Incidental change to interpreter to init gegl early,
since now needed during registration phase.
2024-03-01 09:54:06 -05:00
Luming Zh
b4110ec3b2 Update Chinese (China) translation 2024-03-01 10:46:48 +00:00
Jehan
0b87030928 Issue #10776: Hide "Edit > Manage Extensions" for the release.
The extension format's official release is pushed for after GIMP 3 release.
Let's not leave this dialog around as it would confuse people.
2024-03-01 00:51:22 +01:00
Jehan
978a16d2e5 Issue #573: rename "Truncate" repeat type to "None (truncate)" and reorder the enum.
This commit is based on a patch submitted by Kiyotaka NISHIBORI many years ago.
2024-03-01 00:33:28 +01:00
Jordi Mas
e7575f63e2 Update Catalan translation 2024-02-29 20:18:47 +01:00
Jehan
4e7cc4afea Issue #10795: "(null)" tooltip on some tab menu items. 2024-02-29 19:07:48 +01:00
Jehan
baae7287be libgimp: allow to run gimp_procedure_run_config() with no config object.
This is the equivalent to run the procedure with its defaults.
2024-02-29 16:33:32 +01:00
Jehan
01cdf777a6 libgimp: add C tests to the libgimp testing infrastructure.
Most of the C boiler-plate code is generated so that all you have to do is
implement the run() function with test code in it.

Also adding a README to make it all very clear and easy to add new tests.
2024-02-29 16:19:49 +01:00
Jehan
bf0b774261 libgimp: gimp_pdb_lookup_procedure() returns NULL if procedure doesn't exist.
Right now, it was always returning a GimpProcedure even if the PDB procedure
didn't exist (the GimpProcedure was therefore invalid).
2024-02-29 14:13:21 +01:00
Jehan
237015dc69 libgimpbase: workaround needed to write ampersand in g-ir-docs.
Fixes:

> [2636/2644] Generating devel-docs/g-ir-docs/g-ir-Gimp-python-cache with a custom command
> file:///builds/GNOME/gimp/_build-x64/meson-private/dist-build/devel-docs/g-ir-docs/pages/python/Gimp-3.0/Gimp.ColorArray.page:22: parser error : EntityRef: expecting ';'
> NULL);</p>  <p>GeglColors **colors;</p>  <p>g_object_get (obj, "colors", &colors
>                                                                                ^
2024-02-29 12:52:26 +01:00
Jehan
7b43a7492f libgimp: new unit testing framework for libgimp.
With Python binding, it gets very easy to test new functions. I've been
wondering if we need C counterparts, but really since it's a GObject
Introspection binding, if a function succeeds there, it should also succeed in C
code.

For now, I'm testing a few of GimpPalette API. Not all of it yet. Also I test
both the direct C binding and PDB procedure since in some cases, one or the
other may not properly working. See #10885.
2024-02-28 22:55:58 +01:00
Jehan
3f79f3589d Issue #10885: gimp-palette-get-colors warning and critical when…
… accessed from Python.

Creating a new function gimp_value_array_get_color_array(). This should normally
not be needed (it isn't in C), but because of GObject Introspection limitation
and the fact that pygobject will automatically try to convert GValue to the
embedded value, we get this weird situation where the result is unusable in
Python for certain types. One of these types is GimpColorArray.

I suggest an annotation request to GObject Introspection:
https://gitlab.gnome.org/GNOME/gobject-introspection/-/issues/492

I think that with such annotation, followed as a second step by pygobject
support, correctly handling NULL terminated C arrays generically should be
feasible by bindings.
2024-02-28 22:55:58 +01:00
Jehan
d6a134e6c1 plug-ins: import Babl and Gegl modules in python-eval plug-in.
This makes it easier to run babl and GEGL code directly through the command line
or script files.
2024-02-28 22:55:58 +01:00
Jordi Mas
84c0584aea Update Catalan translation 2024-02-28 22:15:11 +01:00
Alx Sa
10b96b1025 core: Show preview with NDE filters
Resolves #10762.

Updates gimpdrawable-preview.c to use
gimp_drawable_get_buffer_with_effects (),
which includes any NDE Filters applied to
the layer in the preview.
The preview is also set to update when a
filter is applied non-destructively.
2024-02-28 11:34:31 +00:00
Alfred Wingate
46a1580018 libgimpbase libgimpwidgets: install needed headers
* These headers weren't installed despite being included by other
  installed headers.

Bug: https://gitlab.gnome.org/GNOME/gimp/-/issues/10132
Bug: https://bugs.gentoo.org/920535
Signed-off-by: Alfred Wingate <parona@protonmail.com>
2024-02-28 05:53:54 +00:00
Ekaterine Papava
71329f106b Update Georgian translation 2024-02-28 04:56:58 +00:00
Ekaterine Papava
ba0dc0474b Update Georgian translation 2024-02-28 04:52:47 +00:00
Jehan
71d03d5828 Issue #10885: gimp-palette-get-colors warning and critical.
We were missing GimpColorArray support in one function. Note that the specific
example in Python in #10885 still doesn't work, but for a second reason:
gimp_value_array_index() returns a GValue which pygobject automatically tries to
transform to the contained data. And unfortunately it doesn't know about our
GimpColorArray type so we end with unusable boxed type generic data.
2024-02-27 22:46:48 +01:00
Jehan
d9c440614b Issue #10899: Image Recovery and Welcome dialog conflicting with each other.
Since the Image Recovery dialog is blocking the main process (and requires an
answer to be done first), let's simply move down the Welcome dialog to after
this answer was given. This way, we simply won't have both dialogs in the same
time.
2024-02-27 18:06:50 +01:00
Jordi Mas
920efa45b2 Update Catalan translation 2024-02-27 16:31:55 +01:00
Jehan
eacb3ebf82 app, libgimp, pdb: gimp_layer_new() allows a NULL name.
Our core code allows a NULL name, so there is no reason not to. We just have to
explain the rules (basically: you don't choose the name!).
2024-02-26 23:19:55 +01:00
Jehan
a1b7b4dedd plug-ins: "file-ico-save" procedure doesn't care about hot spots.
Hot spot coordinates are only for cursors.
2024-02-26 23:19:42 +01:00
Asier Sarasua Garmendia
ba686fcd17 Update Basque translation 2024-02-26 20:30:24 +00:00
Asier Sarasua Garmendia
34ce526b07 Update Basque translation 2024-02-26 20:30:19 +00:00
Asier Sarasua Garmendia
87109d19fa Update Basque translation 2024-02-26 20:29:38 +00:00
Asier Sarasua Garmendia
abe97ecf20 Update Basque translation 2024-02-26 20:29:27 +00:00
Jordi Mas
a866f27cf3 Update Catalan translation 2024-02-26 21:23:52 +01:00
Jehan
341ab7212b build: remove a LLVM patch.
It was only used for the gimp-win-a64 job and was coming from MSYS2 repository
which already dropped it:
a98352b2ba

The first patch is still needed as the upstream fix is meant to appear in clang
18 according to bug report, yet our CI still uses clang 17.0.6. See:
https://github.com/llvm/llvm-project/issues/51286
2024-02-26 19:56:53 +00:00
Christian Kirbach
4338f0026c Update German translation 2024-02-26 19:56:18 +00:00
Alx Sa
8686e3f542 themes: Remove deprecated GtkPaned style
Resolves #10934.

GtkPaned's handle-size attribute has been deprecated.
Since we have our own custom paned separator, it is not
needed anyway.
2024-02-26 18:08:46 +00:00
Luming Zh
ac0333d8ec Update Chinese (China) translation 2024-02-25 22:39:38 +00:00
Luming Zh
7f41cdc599 Update Chinese (China) translation 2024-02-25 22:38:20 +00:00
Luming Zh
aabb1a4031 Update Chinese (China) translation 2024-02-25 22:38:11 +00:00
Alx Sa
7e6dc23ac1 plug-ins: Fix Foggify color property
Since the color space invasion, GimpRGB
properties do not create widgets anymore.
For Python plug-ins, we need to add
GeglColor properties as GObjects with
GeglColor value types as a workaround.
This patch does this and updates the
Foggify plug-in with the new datatype.
2024-02-25 20:14:13 +00:00
Asier Sarasua Garmendia
705fbebc55 Update Basque translation 2024-02-25 20:10:32 +00:00
Asier Sarasua Garmendia
a97a047cbd Update Basque translation 2024-02-25 20:09:20 +00:00
Bruno Lopes
98d6542745 build/windows: Fix iso-codes correctly
This fix only applies to local builds. iso-codes warning was fixed again
with proper option indicated by Jehan.
2024-02-25 15:15:16 +00:00
Jehan
d1508cdebe data: remove various historical images.
It is quite obvious that these were all kept around for the fun historical
background. And even though we can always get these back anytime through git
archeology, if these images disappear from our sight, we will just eventually
forget they even existed.

We now have a `gimp-data` repository for all data used and installed by GIMP. I
am not going to add these over there since it would go against the whole purpose
of splitting the source repository (we have too much data so we will want to
clone `gimp-data` as shallow so that it will only contain the necessary data to
install GIMP).
Yet I have created a page to reference and display all these original images
(and more! I spent quite some time researching old splashes and logos in our dev
log) for the pleasure of keeping the history of GIMP alive. It also reference
commit links for easy retrieval and further researches.

The only left images now are:

- gimp-logo.png and gimp-devel-logo.png: these are used in the About dialog or
  API reference. Ideally they should be generated from the SVG source.
- gimp-splash.png: used as splash image, in the Welcome dialog and in the
  Windows installer.
- wilber.png: only used in some Script-fu test scripts as far as I can see. This
  should also be generated from the same source SVG as gimp-logo.png, or maybe
  simply gimp-logo.png should be used instead.

Logos: https://gitlab.gnome.org/GNOME/gimp-data/-/blob/main/images/logo-log.md
Splashes: https://gitlab.gnome.org/GNOME/gimp-data/-/blob/main/images/splash-log.md
2024-02-25 16:11:58 +01:00
Sabri Ünal
0d83d2008d Update Turkish translation 2024-02-25 13:10:20 +00:00
Sabri Ünal
f59fb2f8d3 Update Turkish translation 2024-02-25 13:10:06 +00:00
Sabri Ünal
0e2f016425 Update Turkish translation 2024-02-25 08:08:08 +00:00
Sabri Ünal
74ad9f2ff4 Update Turkish translation 2024-02-25 08:06:14 +00:00
Yuri Chornoivan
9750c77abc Update Ukrainian translation 2024-02-24 20:37:53 +00:00
Yuri Chornoivan
acab21a586 Update Ukrainian translation 2024-02-24 20:36:52 +00:00
Yuri Chornoivan
abff9fe036 Update Ukrainian translation 2024-02-24 20:31:18 +00:00
Øyvind Kolås
a93fbc682e app,libgimpcolor: drop babl if guards that no longer apply 2024-02-24 18:14:36 +01:00
Øyvind Kolås
da289b9c50 meson,app: depend on babl-0.1.108 2024-02-24 18:08:31 +01:00
Alx Sa
e927b6c42b dialogs: Open multiple recent images...
...with the Enter key. Combines the single image
and multi-image opening methods so that no matter
how you open recent images (single click, button, or
multi-select and pressing Enter), it opens all selected
images in the Welcome Dialog.
2024-02-24 15:42:53 +00:00
Anders Jonsson
f2cfda17fb plug-ins: fix wording in fractal-explorer string 2024-02-24 14:52:22 +00:00
Anders Jonsson
34eac1996e plug-ins: remove unneeded accelerator 2024-02-24 14:52:22 +00:00
Anders Jonsson
58f6d86b09 scripts: GIMP Online accelerator and link fixes
* 'Use selection' entry was missing due to wrong name
* Write Table of contents without brackets, fixes #9903
* Avoid accelerator clashes
2024-02-24 14:52:22 +00:00
Vasil Pupkin
861583a3d7 Update Belarusian translation 2024-02-24 01:12:49 +00:00
Vasil Pupkin
24cd97d761 Update Belarusian translation 2024-02-24 01:06:14 +00:00
Vasil Pupkin
a0f2b2d8fa Update Belarusian translation 2024-02-23 23:26:18 +00:00
Jehan
a3c0b515f9 data: the build system should not ever move system files.
AFAIU the issue which it tried to fix only happens on custom builds and it looks
to me that it's just about multi-prefixes developer builds which were not
configured with -Drelocatable-bundle=no as they should.

When you compile GIMP yourself and intend to run it in a multi-prefix
environment, without ever relocating the build, like on Unix-like systems, then
disable this feature.

In any case, we should never do this kind of system file moving hacks in our
build system. The MSYS2 project even had to patch this out:
https://gitlab.gnome.org/GNOME/gimp/-/merge_requests/1171#note_2022406
2024-02-22 18:41:04 +01:00
Luming Zh
ce08be14d3 Update Chinese (China) translation 2024-02-22 15:39:56 +00:00
Balázs Úr
748b2b5767 Update Hungarian translation 2024-02-22 00:50:15 +00:00
Øyvind Kolås
4463c1e0b1 app: make hue-saturation op use HSLA float as processing space
This should be quite a bit quicker than the per pixel overhead of
function call converting rgb<->hsl.
2024-02-21 19:41:11 +00:00
Joachim Priesner
2680057b96 .clang-format: Remove duplicate option
This is an error starting with LLVM commit 388d679c (LLVM 17).
2024-02-21 15:44:48 +00:00
Øyvind Kolås
992cd783ac app: do processing with non-linear RGB in threshold op 2024-02-21 15:54:20 +01:00
Joachim Priesner
6731761944 .clang-format: Enable PenaltyBreakOpenParenthesis option
The CI uses clang-format 14 at least since commit 01e56545,
since that is the version available in Debian bookworm.
2024-02-21 11:27:27 +00:00
Jehan
11892f1d83 Issue #10900: install missing gimpchoice.h.
Argh how this could pass without anyone noticing?!
2024-02-21 11:08:23 +01:00
Øyvind Kolås
bc7f0f5fc2 app: make posterize op operate with a perceptual gamma 2024-02-21 09:03:08 +01:00
Yuri Chornoivan
df0a445fbd Update Ukrainian translation 2024-02-21 06:26:11 +00:00
Alx Sa
903d697091 plug-ins: Port decompose to GimpProcedureDialog widgets
Also changed decompose-type argument from string to
GimpChoice.
2024-02-20 14:42:41 +00:00
Luming Zh
745a142b09 Update Chinese (China) translation 2024-02-20 14:12:53 +00:00
Yuri Chornoivan
a7cec65868 Update Ukrainian translation 2024-02-20 13:43:04 +00:00
Øyvind Kolås
7e39d2badd app: conversion to indexed, do error diffusion in linear RGB
Do error diffusion in linear RGB while keeping palette generation as
CIE Lab.
2024-02-20 12:26:38 +01:00
Øyvind Kolås
5311cbec84 app: increase color precision in indexed conversion
The indexed conversion code was originally written for very low-memory systems,
this makes the mapping it does quantized and noisy, for examples see issue
 #5159 this commit removes quality/memory use trade-offs, modern machines can
take a 2-300mb temporary table allocation.
2024-02-20 11:58:58 +01:00
Alx Sa
e97f8693d0 plug-ins: Port warp.c to GimpProcedureDialog widgets
Also make widgets translatable and added mnemonics.
Note that the UI could still be improved -
the GimpDrawableChoosers are larger than the old ones.
2024-02-19 20:51:06 +00:00
Balázs Úr
38fbf19b50 Update Hungarian translation 2024-02-19 19:43:50 +00:00
Balázs Úr
210c7d3850 Update Hungarian translation 2024-02-19 19:41:03 +00:00
Balázs Úr
76f71ba903 Update Hungarian translation 2024-02-19 19:36:37 +00:00
Jacob Boerema
2a52d91a52 libgimpbase: fix endless loop in gimpprotocol
Coverity warned here for endless loops. Looking at it, it's clear that
we should increase k and not j.
2024-02-19 11:49:54 -05:00
Marco Ciampa
cad8c6739c Updated Italian translation 2024-02-19 14:27:14 +01:00
Alexandre Prokoudine
67c92e12c0 Update Russian translation 2024-02-19 14:26:22 +01:00
Jehan
d63a94dedc gitlab-ci: use the last tagged releases of babl and GEGL for deps-debian-x64 too.
This is similar code to what I added for the Windows builds, except that here
it's because deps-debian-x64 will also end up feeding dev-docs job too.

Right now our tagged build of GIMP produces docs for unstable versions of babl
and GEGL.
2024-02-19 12:28:53 +01:00
Bruno Lopes
368bee2d64 build/windows: Rework scripts local compatibility layer
Since !1171 we can use the CI scripts locally, but the initial implementation,
after some commits, revealed to be troublesome. So, now reworked to be simple.
2024-02-18 19:28:47 +00:00
Bruno Lopes
43c0fdcbba build/windows: Follow meson defined versions
As noted by Jehan, the way of defining the (many) GIMP versions can change.
So, let's take the GIMP version directly from the generated config.h file.

Also, changes the declaration of some variables to conform with "best pratices".
2024-02-18 19:28:47 +00:00
Bruno Lopes
3db6639375 build/windows: Make unified deps list more conventional
This list is referenced in the gimp-web-devel site, and my initial
implementation, in terms of ease to use, was a throwback.

Also, make the CI code more simple without changing the list file.
2024-02-18 19:28:47 +00:00
Bruno Lopes
265fb09ce6 build/windows: Make deps install "modular"
Since almost the same code is used in the 3 stages, let's reuse it.
2024-02-18 19:28:47 +00:00
Bruno Lopes
09a26ddb72 build/windows: Conform scripts to Coding Style
Self-explanatory. Also, make the structure a little more cohesive.
2024-02-18 19:28:47 +00:00
Alx Sa
cf73a28145 python: Fix Spyro-Gimp Long Gradient option
Resolves #10873.

We needed to update a Gimp.RGB object to Gegl.Color
in order for the Long Gradient option to work properly.
2024-02-18 19:21:31 +00:00
Alx Sa
dfad2a3028 python: Fix Spyro-Gimp Selection option
As noted in a comment on issue 10873,
choosing Selection for Fixed Gear throws
a TypeError. This is because with the change
from GimpRGB to GeglColor, we can no longer
directly access the red component with an index.

Instead, we need to call Gegl.Color.get_rgba() to get
that value, which is what this patch does.
2024-02-18 18:41:04 +00:00
Alx Sa
8f18ea6e7d widgets: Fix critical in Dynamics Dockable
Resolves #10882.

Before the color space invasion, INPUT_COLOR () returned
either a GimpRGB or NULL (if alpha == 0) that was used
directly in functions.
Now it's used to set a GeglColor in gegl_color_set_pixel (),
and calling that with a NULL color resulted in a Gegl-Critical.

This patch checks if INPUT_COLOR () returned NULL before
trying gegl_color_set_pixel () to prevent the issue.
2024-02-18 14:00:23 +00:00
Jehan
4755f0e805 meson.build: post-release version bump to 2.99.19.
On the way to the RC1!
2024-02-18 11:11:24 +01:00
Sabri Ünal
d39137b9a0 Update Turkish translation 2024-02-18 09:41:02 +00:00
Sabri Ünal
e9140fff49 Update Turkish translation 2024-02-18 09:40:51 +00:00
Sabri Ünal
cfd50c4818 Update Turkish translation 2024-02-18 09:39:31 +00:00
Jehan
f94c4cb5db Release development version GIMP 2.99.18. 2024-02-17 18:01:20 +01:00
Jehan
cb81d5224b Issue #10872: welcome dialog does not behave like the usual "new image" action.
The alternative solution would be to call:

> image_new_dialog_set (dialog, NULL, NULL);

This would have reset to default template. But it's still not exactly like the
"new image" action which defaults to the active image's size if there is an
opened image.

In order to avoid complicating the code further, as well as code duplication,
hence code divergence, let's call the "image-new" action, making sure that this
button will always behave exactly like the "File > New" menu item.

Then since we need to process the return value of this dialog (either re-showing
the welcome dialog in case of new image creation cancelation, or destroying the
hidden welcome dialog otherwise), I check for the singleton pointer and connect
the handlers to it.

Moreover I made the "response" signal of ImageNewDialog be handled as
G_CONNECT_AFTER otherwise we nearly never had the possibility to handle its
responses properly (because the base handler was doing it first, then often
destroying the dialog).
2024-02-17 18:01:20 +01:00
Luming Zh
ff459a5f4b Update Chinese (China) translation 2024-02-17 14:42:53 +00:00
Luming Zh
e24cda1998 Update Chinese (China) translation 2024-02-17 14:41:06 +00:00
Luming Zh
d656bd42ce Update Chinese (China) translation 2024-02-17 14:39:17 +00:00
Jehan
70d681f6fb desktop: release GIMP 2.99.18 today. 2024-02-17 11:33:32 +01:00
Jehan
7f6e666afc libgimpwidgets: make sure we update everything when changing the format. 2024-02-17 11:27:29 +01:00
Jehan
18d68d9e7c Issue #10850: [Color Space Invasion] Possible profile mis-match between color selectors.
It was simply not implemented yet, but it's true that it's such a visible and
used feature that it's worth adding it in time for GIMP 2.99.18!
2024-02-17 11:24:00 +01:00
Øyvind Kolås
2d1a02298d app: gimpoperationhuesaturation, do processing in non-linear
Address a regression of hue-sector sizes. The HSL model math in gimp_rgb_to_hsl
and gimp_hsl_to_rgb uses R'G'B' values rather than RGB.

Fixes #10756.
2024-02-17 06:03:40 +00:00
Alx Sa
a0990e324d python: Fix spyro-gimp Preview tool
Gimp.context_get_foreground() no longer returns a Boolean
as a first output, so we need to remove it from the assignment
line.
2024-02-17 00:02:25 +00:00
Jehan
017b82b0d5 build: use tagged releases of babl/GEGL dependencies when building releases.
The rest of the time, we want to use HEAD of their main branches.

The last ctx update seem to have broken the CI build on Windows. While we'll
have to fix this, let's do this after we release GIMP.

Anyway we obviously don't want to use unstable code for actual point releases,
so it's a good thing that this made me think of adding such rules.
2024-02-16 22:31:33 +00:00
Øyvind Kolås
597c52b92e app: gimpoperationgradient keep achromatic colors under dither
Use the same amount of dithering on R,G and B if they initially were all equal.
This allows us to keep achromatic gradients achromatic, while providing the
same amount of dither as before for colored gradients. Discrepancy uncovered in
issue #10756.
2024-02-16 22:25:25 +00:00
Jehan
8e63ef91f5 Issue #10858: [Color Space Invasion] Alpha ColorScale has corrupted values.
While the buffer used by Cairo may have a rowstride bigger than 3 * width, our
internally stored buffer has the exact size required for drawing the scale.
2024-02-16 22:05:23 +01:00
Jehan
4915689948 app: gradient not properly updated when canceling the color dialog. 2024-02-16 20:47:15 +01:00
Jehan
067abee9b2 Issue #10851: [Color Space Invasion] Crash when editing Gradient.
We were not properly duplicating the left and right colors when duplicating the
existing segments in gradient_editor_save_selection(). Therefore we ended up
freeing original GeglColor on exiting the GimpColorDialog.

Additionally to the reported crash, I add a few GeglColor freeing which were
leaked and some safeguard in gimp_gradient_get_flat_color() to ensure it always
returns a color (or raise a CRITICAL to be investigated easily).

Finally a few signals in GimpColorDialog had to be ensured disconnected when the
dialog is destroyed.
2024-02-16 19:58:11 +01:00
Jehan
793d6e7dac app: properly initialize property colors.
Our code expects that these GeglColor properties are always non-NULL in various
places, which may lead to crashes.

The property defaults should take care of this, and I am actually unsure why we
need to set it in the init(). Maybe the set_default() method for the GParamSpec
kicks in a bit late, while we have code syncing objects already running. I'm not
sure. It might need to be investigated later. But for now, let's simply make
sure we initialize the objects manually so that it's never NULL.
2024-02-16 17:28:51 +01:00
Idriss Fekir
1437e3fa99 GimpFont: Crash loading XCF with text in an unavailable font 2024-02-16 12:09:58 +00:00
Ekaterine Papava
039a3671bc Update Georgian translation 2024-02-16 11:43:58 +00:00
Ekaterine Papava
0606b986f5 Update Georgian translation 2024-02-16 11:25:59 +00:00
Øyvind Kolås
5a0a3a1263 app: special-case achromatic pixels in hue-saturation
Issue #10756, without this grayscale pixels are affected by
the red part of the manipulation configuration, after this
change pixels with original saturation == 0.0 are only
changed by the master adjustment.
2024-02-16 00:16:08 +00:00
Bruno Lopes
96e7673348 build/windows: (Finally) Drop lua5.1 in ARM
This become unnoticed in !1171 and was breaking .lua plug-ins use in
ARM installs. See: https://gitlab.gnome.org/GNOME/gimp/-/issues/10554#note_2014768
2024-02-16 00:08:02 +00:00
Jehan
8bb79dc671 app: port Colorize to GeglColor property.
While doing this, I could find a lot of problems in the algorithm:

1. It looks like the original intent (from GUI and code) is that you set hue and
   saturation but not really the intended lightness, rather its increase or
   decrease, relatively to every pixel current lightness. I.e. that every pixel
   will be set to the selected hue and saturation, and only the lightness will
   change. The "lightness" field is therefore a relative value (pixel per
   pixel). The first problem is that instead of lightness, we compute the
   luminance, which is related but different and set this in the lightness
   field.
2. The second issue is that we were using gimp_hsl_to_rgb() which after testing
   (because its documentation doesn't give any TRC/space info at all) looks like
   it computes a color from HSL to non-linear RGB of the same space. Yet we were
   outputting to a linear RGB space. So we compute the wrong values. On the
   other hand, because of the first problem, I realize (after testing) that it
   makes our render closer to the intended render by chance (at least when the
   TRC is sRGB's). It's still wrong, but if we were to change the output to
   "R'G'B'A float" instead, the render would be much darker. In both cases, it's
   wrong anyway.
   I would not say that the 2 problems are canceling each others, but they are
   making the final result somewhat OK.
3. Ideally we should be using babl to convert colors, and this is the best way
   to actually implement the original filter intent. Unfortunately so far, doing
   this is much slower (though I save a lot of time by moving out of the samples
   loop and processing data in chunks, it's still slower than the current,
   nearly instant, implementation).
4. Because of all previous implementation irregularities, the render is
   different depending on the actual image space. I.e. that the exact same image
   filtered through Colorize with the exact same operation parameters will
   render differently. I would need to test further, and maybe it's normal since
   HSL is also space-dependant (and that's where we work on in this operation),
   but I'm wondering if the result should not be independant of the working
   space.
5. I implemented our own prepare() method because the one in
   GimpOperationPointFilter parent seems to allow other input or output models.
   Even though in all my tests, it was always linear RGB (which is what we want
   here), let's make sure by having a custom prepare() method explicitly setting
   these. It's also the opportunity to create some babl fishes.

In any case, I'm leaving the code as-is for now, because it's how this operation
has been since forever (at least for as long as I was around) and I don't think
it's the right idea to change it on a whim.

This raises even more the concern of versionning GEGL operation, which we have
been discussing with pippin on IRC lately, because if ever we want to change
this one, now that operations are not just applied, but possibly
non-destructively recreated at load, we need to make sure that we recreate the
render expected at the time of creation of a XCF while allowing us to have the
filters improving when needed.
2024-02-15 23:55:06 +01:00
Anders Jonsson
99f20a916d Update Swedish translation 2024-02-15 20:20:24 +00:00
Alx Sa
629c7eee9e widgets: Close NDE popover when merging filters
Resolves the main part of 10835. As nothing else can
be done in the GUI once all the filters are merged down
(and the GUI itself will be unavailable once closed until
a new filter is added), it makes sense to auto-close it.
gtk_widget_set_visible () was used rather than
gtk_popover_popdown () due to notes in the code about
buggy animations.

There is the possibility that users may want the GUI left
open to quickly undo the merge, so this should be
re-examined after feedback from the 2.99.18 release.
2024-02-15 18:30:12 +00:00
Yuri Chornoivan
1139df0167 Update Ukrainian translation 2024-02-15 16:40:57 +00:00
bootchk
df57b28469 2.99 ScriptFu: change wording of "Coffee Stain" filter
To reflect increased generality, its not just "coffee" but any gradient.

Delete "realistic looking": subjective and adds no content.

Better tooltips for the arguments.
2024-02-15 15:40:20 +00:00
bootchk
e6957e2b0d ScriptFu: port script "Coffee Stain" to new-style
Call new-style script-fu-register-filter so
choice of gradient is saved in settings.
2024-02-15 15:40:20 +00:00
bootchk
45f56ce44c Fix #10832 ScriptFu: script "Coffee Stain" expects int for gradient
Fix it by also enhancing, making the gradient an argument with a default
instead of a fixed choice of the gradient named "Coffee".
Instead of fixing by looking up the gradient ID in the body of the script.
2024-02-15 15:40:20 +00:00
Alx Sa
de8f7fd4b8 plug-ins: port lighting to GeglColor procedure arguments
Also fixed parameter formating.
Note that it still converts to GimpRGB
internally.
2024-02-15 13:47:04 +00:00
Alx Sa
e559c23c00 plug-ins: port map-object to GeglColor procedure arguments
Note that it still converts to GimpRGB
internally.
2024-02-15 13:10:23 +00:00
Jehan
9955c00076 Issue #10853: support GeglColor return type in script-fu.
Right now, I just transform any GeglColor return value into a RGB u8 triplet,
because that's also how we were supporting GimpRGB anyway, though it's seriously
limited.

Ideally we'd add some real concept of generic color abstraction in Script-fu
too, which could support any color model, space and precision.
2024-02-15 13:25:50 +01:00
Alx Sa
5ad18094db actions: Load opacity/mode/region properties in NDE
Resolves #10848.

In cc62f2b0, we moved the filter property loading code
earlier in the process. However, the opacity, mode, and
region options for GimpFilterTool were not included in
this move, so they reset back to defaults each time.
This fixes that problem so settings are retained when
editing.
2024-02-15 05:31:36 +00:00
Alx Sa
ad73df43fd plug-ins: port grid (legacy) to GeglColor procedure arguments 2024-02-15 03:39:52 +00:00
Alx Sa
ea14231921 scripts: Fix calls to gimp-drawable-edit-gradient-fill
Resolves #10830

The supersample-max-depth parameter
of gimp-drawable-edit-gradient-fill
required a value between 1 and 9.
Previously this wasn't enforced, so several
scripts called it with a value of 0.

Now that it's enforced, those scripts were
broken. This fixes the calls in weave,
gradient-example, test-sphere, burn-in,
and coffee (although it has other issues)
2024-02-14 23:52:18 +00:00
Jehan
fc08b78436 plug-ins: port film to GeglColor procedure arguments.
It was a bit sad that we'd release GIMP 2.99.18 with no plug-in using
GeglColor argument yet, so at least with this, we'll have one as a demo
of what needs to be done.
2024-02-14 23:58:32 +01:00
Jehan
700d0c7c91 libgimp: add macros for GeglColor arguments for GimpProcedure. 2024-02-14 23:46:03 +01:00
Jehan
19be79178d app: fix reading GeglColor arguments in pluginrc.
A GeglColor may be without profile (when the space doesn't require one
or if the default profile is used for the model).
2024-02-14 23:43:26 +01:00
Jehan
7db648195c libgimpwidgets: fix initializing a GimpLabelColor. 2024-02-14 23:36:39 +01:00
Jehan
40158b431d Issue #10838: fix dashboard crash.
- Make sure the led color is set at init().
- Unlike old GimpRGB code, values' colors must be set explicitly first.
- Make the Gimp object into a property (this one is not a problem right now, but
  it's better this way).
- Don't assume the Gimp object is non-NULL. In current code, it is set to NULL.
  The only consequence is that we don't use color management settings to draw
  with Cairo. For this widget anyway, it feels unnecessary.
2024-02-14 22:48:59 +01:00
Anders Jonsson
0f2e916b64 Update Swedish translation 2024-02-14 21:02:25 +00:00
Yuri Chornoivan
fda9df670c Update Ukrainian translation 2024-02-14 18:42:44 +00:00
Alx Sa
167e35b048 Issue #10843: Prevent raising/lower Warp NDE filter
Altering the Warp tool's GEGL filter while it's being actively edited
causing a crash. More work will be needed to make these effects
work non-destructively - for now, we'll prevent users from raising or
lowering them from the NDE UI.
2024-02-14 17:49:51 +00:00
Jehan
7e95211e35 Issue #10834: [Color Space Invasion] Filter Presets not loading deserialized GeglColors. 2024-02-14 18:00:25 +01:00
Jehan
30d6b88c95 Issue #10841: rename "Insane Options" to "Experimental". 2024-02-14 17:03:35 +01:00
Jehan
5c81f05804 app, desktop: add demo scenarios for 2 release note items. 2024-02-14 16:50:26 +01:00
Jehan
d52d57eb45 app: add ability to blink item tree view's header widget. 2024-02-14 16:49:39 +01:00
Jehan
fbb14c8c49 NEWS: update. 2024-02-14 16:48:51 +01:00
Jehan
df7cc3d377 app: simplify and fix the welcome dialog and update check algorithm.
To simplify the logic, I created an `is_update` variable. This makes the code
much more understandable (and also simplify the redundant or over-complicated
imbricated `if` blocks).

The fix part is that the update check would have never happened for anyone
leaving the "Show Welcome Dialog" option checked, whereas we only want to bypass
the update check for new installations or updates.
2024-02-14 15:20:10 +00:00
Alx Sa
9a745738b4 dialogs: Add configurations to Welcome Dialogue
Allows users to quickly configure themes and other
"controversial" options when first installed.
Also allows the welcome dialogue to appear on start,
depending on user preference.
2024-02-14 15:20:10 +00:00
Bruno Lopes
c435184735 build/windows: Update manifest to conform with 5c96851431 2024-02-14 11:20:31 +00:00
Yuri Chornoivan
862a785d8f Update Ukrainian translation 2024-02-14 11:06:49 +00:00
Ekaterine Papava
4d113f86b7 Update Georgian translation 2024-02-14 04:35:16 +00:00
Jehan
6d14ca0554 Issue #10815: [Color Space Invasion] GimpColorFrame crashes when RGB (%), RGB…
… (u8), or CMYK is selected.

We always need a final NUL indicator in a GStrv. In these 2 cases, we might fill
all 6 first indexes, so we must have an array of size 7.
2024-02-13 23:47:49 +01:00
Jehan
d945e12ccc Issue #10814: [Color Space Invasion] crash in channel_get_color_invoker. 2024-02-13 23:25:41 +01:00
Jehan
aaa75e3674 Issue #10385: fix CRITICAL when importing palettes via the Palette dockable.
Since resources must now either belong to an image, or be tied to a file, or be
marked as internal, we must immediately save imported palettes, so that they are
tied to their file.
2024-02-13 22:42:04 +01:00
Jehan
e2b2f1fb04 Issue #10811: script-fu can now create GeglColor params.
For the time being, only the same format as GimpRGB params is supported, which
means creating a color either as CSS strings or as RGBA list values, which means
that we can only input sRGB values right now in ScriptFu (even when calling
GeglColor-using API).

This is the second part to fix issue #10811.
2024-02-13 21:58:40 +01:00
Jehan
0b6b76a419 Issue #10811: implement GeglParamColor missing in some places.
Though I had already implemented passing GeglColor through the PDB, it was not
complete. In particular, the protocol was not able to pass GeglParamColor specs.

Fixes:

> LibGimp-WARNING **: 16:06:09.451: _gimp_gp_param_def_to_param_spec: GParamSpec type unsupported 'GeglParamColor'

This is part of the fix to issue #10811, though it's not complete yet.
2024-02-13 21:58:40 +01:00
Jehan
4f8793eaa7 app: the Quick Mask color must be duplicated with the image. 2024-02-13 21:58:40 +01:00
Rodrigo Lledó
43d3d24688 Update Spanish translation 2024-02-13 17:45:41 +00:00
Rodrigo Lledó
666d59b4ed Update Spanish translation 2024-02-13 17:44:07 +00:00
Rodrigo Lledó
f6c28fda22 Update Spanish translation 2024-02-13 17:39:51 +00:00
Kamil Burda
c7c1743dd0 plug-ins: Fix Save button in Python Console
Clicking on the Save button threw an exception as the wrong class was
used to invoke the `set_alternative_button_order_from_array()` method.

Since `Gtk.Dialog.set_alternative_button_order_from_array()` is
deprecated and the GIMP functions with the same name suppress
deprecation warnings in the C code, we suppress the warning here as
well. The `warnings.catch_warnings()` function is not thread-safe
according to the Python documentation, which should not pose a problem
here.

Also, the file chooser dialog now allows specifying a new file instead
of overwriting an existing file.
2024-02-12 21:49:28 +00:00
Jehan
57113323e2 Issue #10813: forgotten GimpRGB used on a GeglColor property. 2024-02-12 19:41:13 +01:00
Jehan
a7637bfb4a libgimpconfig: special-case GeglColor param comparison if one is NULL.
The current values_cmp() method will segfault if an object contains a NULL
GeglColor value. I fixed it in commit c0477bcb0 in GEGL, but since the GEGL
release is already done, I add this special-casing on GIMP side.

To be removed when we release and depend on GEGL 0.4.50.

The crash was happening when activating the text tool and raised in a comment of
another report: https://gitlab.gnome.org/GNOME/gimp/-/issues/10813#note_2009702
2024-02-12 19:33:29 +01:00
Yuri Chornoivan
458ccd9b2a Update Ukrainian translation 2024-02-12 18:28:39 +00:00
Yuri Chornoivan
5d6e8526fc Update Ukrainian translation 2024-02-12 18:23:41 +00:00
Ekaterine Papava
3a6d78871f Update Georgian translation 2024-02-12 17:55:48 +00:00
Ekaterine Papava
cbf406408e Update Georgian translation 2024-02-12 17:47:07 +00:00
Jehan
9e24ceda15 Issue #10809: Color Space Invasion: Curves Tool crashes on start. 2024-02-12 18:30:00 +01:00
Jehan
77420957d8 app: use GEGL/babl to convert to HSL in gimp_operation_hue_saturation_map(). 2024-02-12 18:30:00 +01:00
Alx Sa
fc0d21b91c Issue #10812: New layer colors tag buttons are only white
As in 6a905814, we need to use the gegl_color_set_pixel () function instead.
2024-02-12 16:28:45 +00:00
Jehan
6a90581423 Issue #10808: Hue-Saturation GUI not showing colors.
Small function mixup! We needed the set_pixel() function.
2024-02-12 16:21:28 +01:00
lillolollo
8934a50925 app, libgimpconfig: use G_GSIZE_FORMAT for printf-ing gsize values. 2024-02-12 12:03:03 +00:00
Anders Jonsson
e7e49abc99 Update Swedish translation 2024-02-12 09:22:35 +00:00
Jehan
1f85924e3c NEWS: update. 2024-02-12 00:19:40 +01:00
Jehan
dc66e99949 libgimpwidgets: fix XY rendering in GimpColorSelect for RGB color model. 2024-02-11 23:28:04 +01:00
Jehan
89b80b5b63 libgimpwidgets: don't unnecessarily redraw color previews.
When changing the selected color, we have no reason to redraw the Z preview.
This preview should only be redrawn if the allocation size changed, or if we
change the previewed model or the Z component.

As for the XY preview, it should only be redrawn if the Z value is changed (and
of course, similarly, if the allocation changed or if model or Z component
changed).
2024-02-11 23:28:04 +01:00
Jehan
3a787e8892 app: fix test-config.
Fixes broken unit test:

> stderr:
> ../babl/babl-internal.h:223 babl_fatal()
	babl_format("RGBA float"): you must call babl_init first
2024-02-11 23:28:04 +01:00
Jehan
e6e7fa8f8d libgimpcolor: work around babl_format_has_alpha() bug with some formats.
With "HSVA" and a few others, the function was not returning the right value (it
could not see it was encoding alpha channel.

I had fixed it on babl directly with commit a28309c yet I had forgotten to push
it! Let's just add some #ifdef and a comment.
2024-02-11 23:28:04 +01:00
Jehan
f8ddc94a8b build: fix splash2installer.py with updated API using GeglColor instead of GimpRGB.
Fixes:

> TypeError: argument background: Expected Gegl.Color, but got gi.repository.Gimp.RGB
2024-02-11 23:28:04 +01:00
Jehan
65f8afee68 app, libgimp, libgimpbase, pdb: GimpColorArray as a typedef to…
… NULL-terminated array of GeglColor is now a boxed type usable in PDB.
2024-02-11 23:28:04 +01:00
Jehan
cfd0389c37 app: no more GimpRGB in GimpDashboard and related. 2024-02-11 23:28:04 +01:00
Jehan
6a2aee1fce libgimpwidgets: render GimpColorSelect with babl conversion.
No custom conversion code anymore. This also fixes some bugs in HSV when
I was wrongfully multiplying the hue by 360 when mixing babl and custom
code paths.
2024-02-11 23:28:04 +01:00
Jehan
47c1cb8504 app: use GeglColor in GimpTextBuffer and GimpTextTag.
It's actually not enough to get proper colors for inner text tags. The
main color is correct, but color for subtext is currently not managed.
This must be fixed.
2024-02-11 23:28:04 +01:00
Jehan
cbd970a92d app: add memory size for GeglColor. 2024-02-11 23:28:04 +01:00
Jehan
bab9ed18c4 app: color drag'n drop is now space-invaded.
We can now drop any color model and encoding with any space. The exact
color information is passed with.
2024-02-11 23:28:04 +01:00
Jehan
ba26fc26e7 libgimpwidgets: direct binding between a GimpLabelColor and its color area. 2024-02-11 23:28:04 +01:00
Jehan
c13683a710 app: revert fg and bg colors stored as GeglColor-s. 2024-02-11 23:28:04 +01:00
Jehan
caaee9a174 app: test should have used GeglColor already. 2024-02-11 23:28:04 +01:00
Jehan
4960ed72c1 app: GimpFgBgEditor draw() method to use GeglColor directly too. 2024-02-11 23:28:04 +01:00
Jehan
02546da780 app: layer layer modes to use babl conversions directly. 2024-02-11 23:28:04 +01:00
Jehan
95ac889f6c app, pdb: this PDB function should have been using GeglColor already. 2024-02-11 23:28:04 +01:00
Jehan
57fda090df app: GimpFgBgView draw() methods uses GeglColor directly. 2024-02-11 23:28:04 +01:00
Jehan
6f408e9d48 app: GimpMenuModel uses GeglColor. 2024-02-11 23:28:04 +01:00
Jehan
924dbb44a8 app, libgimpconfig: GimpFilterTool color_picked() now uses GeglColor.
In particular, the Curves, Levels and Operation tools method implemented
are updated. Also GeglColor arguments in GEGL operations are not
transformed into GimpRGB arguments anymore in GIMP. GeglColor GParamSpec
stay GeglColor now.
2024-02-11 23:28:04 +01:00
Jehan
0239d05409 app: gimp_pickable_contiguous_region_by_line_art() now uses GeglColor. 2024-02-11 23:28:04 +01:00
Jehan
3ec13730c5 app: gimp_layer_mask_new() uses GeglColor. 2024-02-11 23:28:04 +01:00
Jehan
cf213d1051 app: some GimpAction color which was forgotten after the port. 2024-02-11 23:28:03 +01:00
Jehan
46121685b8 app: get rid of rgb_to_pixel() GimpPickable method and related functions.
We don't try anymore to convert early from a pickable color to another
format/space. Now we are able to get a GeglColor and move it around,
doing only last-second (when needed) conversions.
2024-02-11 23:28:03 +01:00
Jehan
d55325829f app: no more GimpRGB/GimpHSL/GimpHSV usage in paint code at all anymore.
I'm a bit unsure about the GimpMyBrushCore which doesn't have much
indication on which color space we are working in, but the new code
should not be worse than the old one (if wrong, color-wise, it should be
the same wrong as before).
2024-02-11 23:28:03 +01:00
Jehan
fcfb574715 app: get_paint_params() now uses GeglColor. 2024-02-11 23:28:03 +01:00
Jehan
c892de85df app: port some of the paint and fill code to GeglColor. 2024-02-11 23:28:03 +01:00
Jehan
ae31cf0b18 app: GimpCurveView using GeglColor. 2024-02-11 23:28:03 +01:00
Jehan
20b9f9bc06 app: GimpColorBar to use GeglColor.
It's still internally loading data as a sRGB buffer. More work will need
to be done.
2024-02-11 23:28:03 +01:00
Jehan
d1c3b104bf libgimpcolor: gimp_color_is_perceptually_identical() also checks transparency.
When I implemented CIEDE2000 distance for verifying perceptual identity,
I mistakenly lost checking the alpha channel.
2024-02-11 23:28:03 +01:00
Jehan
b53da69f3c app, libgimp, pdb, plug-ins: canvas grid now using GeglColor. 2024-02-11 23:28:03 +01:00
Jehan
f9c97aeb72 app: mask colors are GeglColor. 2024-02-11 23:28:03 +01:00
Jehan
636a33aed2 app: GimpColorDialog now fully uses GeglColor. 2024-02-11 23:28:03 +01:00
Jehan
4b3702bfc1 libgimpwidgets, libgimpcolor: RGB and HSV should also show out-of-gamut…
… in soft-proof space when soft-proofing is enabled.
2024-02-11 23:28:03 +01:00
Jehan
de83bca814 app, libgimpwidgets: make GimpColorSelector sync with soft-proofing.
Until now we only had the case of the CMYK color selector using the
soft-proofing profile. Yet this is also interesting for other color
selectors, in particular to show out-of-gamut colors. Indeed if we
enable soft-proofing on the active image, it is interesting to show the
intersection of the current RGB/Grayscale space gamut with the
soft-proofing gamut.

Right now, this is only used in GimpColorSelect when showing colors in
LCh color space.
2024-02-11 23:28:03 +01:00
Jehan
12b2abce7c libgimpcolor: implement CIEDE2000 distance algorithm to compare colors.
This is used for the gimp_color_is_perceptually_identical() function,
because the Euclidean distance in LCH is extremely limited, if not wrong
in many cases. Indeed LCH is not perfectly perceptually uniform, and for
this exact reason, the CIE defined the specific Delta E algorithms.
Later versions are also based on LCH values, so my intuition to use it
for distance was on a good start, yet these algorithms were refined a
few times to allow for corrections in perceptual uniformity
imperfections.

This was in particular needed to verify if a color is out of a CMYK
space gamut. The idea is to compare the distance of the RGB (or other)
and the CMYK version, since we cannot just check if the CMYK color is
out of the [0; 1] range (it never is). Instead if both colors are
perceptually identical, then we consider that the RGB color was inside
the CMYK space gamut.
The naive algorithm was giving any (or nearly) color as out-of-gamut.
Now using CIEDE2000, I get a much nicer results.
2024-02-11 23:28:03 +01:00
Jehan
4d2acac506 libgimpwidgets, modules: display the exact space/profile name for…
… relevant color selectors.
2024-02-11 23:28:03 +01:00
Jehan
3c3f3030f1 libgimpwidgets: GimpColorSelect is now also aware of active image space. 2024-02-11 23:28:03 +01:00
Jehan
ebb93a07a5 modules: the color wheel selector now displays and select in the active…
… image's space!
2024-02-11 23:28:03 +01:00
Jehan
1066229ba6 modules: Watercolor selector now shows the actual target gamut. 2024-02-11 23:28:03 +01:00
Jehan
69b7cbe111 libgimpcolor: add support for "CIE LCH(ab)" to gimp_babl_format_get_with_alpha().
It seems I had forgotten about this one!
2024-02-11 23:28:03 +01:00
Jehan
e104196cb7 app, libgimpwidgets: "Scales" color selection now space-aware.
This commit adds gimp_color_selector_set_format() which is meant to give
awareness of the target color format for which we are selecting colors.
Right now, I am only using this information on the Scales selection
method, which means that now colors you read and select are in the
target space. Even better, the out-of-gamut shown happens in the with
LCH scales is for the target space too. As tested, it already makes
quite a difference for an image in sRGB vs. say adobeRGB.

Note that right now, I only use the format information as a space, but
in fact, I made the API to be about a format because the actual format
can be used wisely too. First we may want to do different thing
depending on the color model itself (which the space may give away or
not, especially when using default spaces or when we'll have images
using models with no space in the future, such as CIE Lab). But also
whether the image is following the space TRC or is linear (or
perceptual) would change how we represent the data. If we were to show
non-linear values in the Colors dockable but when painting, the color
picker shows linear values for instance, it might be puzzling to people.
2024-02-11 23:28:03 +01:00
Jehan
881baba59b app: update the simulation profile in Colors dockable.
Only the color dialog was getting simulation updates when the active
image changed, or when the simulation profile changed (while the active
image stayed the same). Now the Colors dockable also get updates.
2024-02-11 23:28:03 +01:00
Jehan
b7610b1db7 app: re-run gtk_event_box_set_above_child() when showing the event box.
Somehow, in some cases, the event box is not getting button events. I
had the case when creating new images (though it was working fine when
loading images!). I could not yet understand the issue looking at both
GIMP and GTK code and could not even reproduce by creating simple code
sample reproducing a similar pattern (an inactive button inside an event
box placed above the button and meant to catch click events).
This works as a workaround for the time being.
2024-02-11 23:28:03 +01:00
Jehan
9833ebd0ee app, libgimpwidgets, modules: color selectors are now partly space-invaded.
What this commit does is keep the same code logic while moving to
GeglColor. Yet it's not **really** space-invaded yet. What we need to do
now:

1. Take into account the image space, and this is what we must navigate
   through, in particular for various representations of RGB or HSV.
   I.e. that if the active image is in anyRGB, the RGB values shown must
   be within anyRGB. Right now, everything is still shown/used as sRGB
   (even though it's properly retrieved and transformed to the target
   space thanks to GeglColor).
2. Show space info to make things clear and explicit, by adding some
   label somewhere.
3. Allow to switch between image and softproof spaces, regarding
   out-of-gamut display. I.e. that while RGB/HSV must be shown within
   the image space (assuming it's anyRGB), we may want to show
   out-of-gamut area (pink areas) within the softproof space. This may
   mean adding a checkbox. Or maybe simply taking into account whether
   we are in softproof mode or not?
4. We can likely move off gimp_widget_get_color_transform() into using
   gimp_widget_get_render_space() for display drawing. We don't need any
   soft-proofing or black point compensation for any of these widgets so
   pure babl is fine. Indeed we want to show any in-gamut color
   correctly (and not transformed according to specific intents or
   through soft-proofing). We will take care of the proofing case with
   out-of-gamut area showing only.
5. In the various drawing functions, we should move to
   CAIRO_FORMAT_RGBA128F. The color selection area might be wide enough
   that it makes sense to be more accurate, especially as we are
   essentially showing color gradients in 1 or 2 directions in these
   various widgets.
2024-02-11 23:28:03 +01:00
Jehan
4d798ecfed libgimpcolor: improve warning to help with debugging. 2024-02-11 23:28:03 +01:00
Jehan
ce887767e7 app, libgimpconfig: color history is now space-invaded.
I also changed a bit the new color serialization by adding a (color …)
symbol framing the contents, for cases where we don't have a specific
property name, e.g. for the color history list stored in colorrc, unlike
for GimpConfig GeglColor properties.

While doing this, I moved GeglColor property deserialization code into
gimp_scanner_parse_color() which is now able to recognize both older
(color-rgb|rgba|hsv|hsva with no color space) and newer serialization
formats ("color", color model agnostic and space aware).
2024-02-11 23:28:03 +01:00
Jehan
1a901e0bb9 libgimpcolor: get the proper alpha variant of a palette format. 2024-02-11 23:28:03 +01:00
Jehan
1be7892862 libgimpconfig: serialize indexed colors as RGB instead.
Serializing palette colors is not possible right now as far too much
additional data are required, and anyway we likely wouldn't be able to
associate back the color to the right palette on deserialization,
removing any interest of keeping the index data anyway.

With that context in mind, let's just serialize palette data as basic
RGB within the palette's space.
2024-02-11 23:28:03 +01:00
Jehan
91d3b51bf2 app: when creating a palette from an image, colors must be space-aware. 2024-02-11 23:28:03 +01:00
Jehan
b6c1b20737 app: colors generated when converting to indexed must be within the image space.
Colors must not be clamped to sRGB, which could lose colors on wide
gamut indexed images.
2024-02-11 23:28:03 +01:00
Jehan
093d00572a app, libgimpcolor: more move to GeglColor.
- New libgimpcolor functions: gimp_color_parse_hex() and gimp_color_parse_name().
- GimpColorHexEntry is now space-invaded. Though recognized color names
  and hexadecimal syntax are sRGB only (because CSS and SVG
  specifications explicitly say that this syntax is for sRGB values), it
  is possible to enter non-sRGB values with
  gimp_color_hex_entry_set_color().
- GimpColorSelection is now space-invaded.
2024-02-11 23:28:03 +01:00
Jehan
ee19ad54d6 app, libgimpcolor: 2 new libgimpcolor functions.
Adding gimp_color_is_out_of_gamut() and gimp_color_is_out_of_self_gamut() and
using them where relevant.
2024-02-11 23:28:03 +01:00
Jehan
4a30f431fd app: work with a GimpPalette rather than a colormap.
We historically have both the colormap and palette concept in core GIMP,
though they are actually kinda the same concept, except that with
"colormap" we work with an array of raw data and it's a lot less
color-aware. It is still much more efficient in some specific cases,
such as when converting the image (we can then convert the whole palette
as a single buffer, because the image palette is space-restricted
anyway), when storing undo data or when storing/loading in XCF.

But for all the rest, let's use gimp_image_get_colormap_palette() and
work with the GimpPalette API.
2024-02-11 23:28:03 +01:00
Jehan
5e8f4f5e00 app: add a concept of format restriction in GimpPalette.
By default a palette can contain any mix of color models and space. These new
internal API add a concept of format/space restriction. For now this will only
be used for indexed images whose palette should only contain colors for the
specific palette format and space (at least as currently implemented in GIMP).
2024-02-11 23:28:03 +01:00
Jehan
dc1f5ea227 app, libgimp, pdb, plug-ins: GimpPalette are now GeglColor based. 2024-02-11 23:28:03 +01:00
Jehan
b6856af9d8 app: GimpGradient now uses GeglColor.
I still see some limitations in GimpGradient, and in particular, they are still
always stored as RGB in GGR files. It would be nice if we could store the actual
color format. This way, if someone chooses a gradient stop as Lab or CMYK color,
that's what the gradient file would keep track of. But also even storing the
space of a color (instead of storing/loading always in sRGB, even though this
may still work fine as we store unbounded double values). This might warrant for
a v2 of GGR file format.

This commit also fixes loading of SVG gradient which was apparently broken
regarding hexadecimal color parsing.

Finally I improve gegl_color_set_alpha() by adding an alpha channel when the
initial format had none.
2024-02-11 23:28:03 +01:00
Jehan
916d032f67 app, libgimp*, plug-ins: GimpColorButton now space-invaded.
The invasion extended to some core widgets too, in particular GimpColorPanel (a
subclass of GimpColorButton). There was quite a lot of code depending on these
widgets.
2024-02-11 23:28:03 +01:00
Jehan
8eb56586aa app, libgimpwidgets, plug-ins: GimpColorArea is now space-invaded.
This includes improvements on the out-of-gamut colored corner being shown for
unbounded component types out of the [0; 1] range (with some small margin of
error to avoid e.g. a -0.0000001 value to show as out-of-gamut).

There are still improvements to be made on the color rendering. In particular,
it still draws as CAIRO_FORMAT_RGB24 cairo surface. We should probably move to
draw as CAIRO_FORMAT_RGBA128F eventually (more precision and even allowing to
draw unbounded colors with a possible option, instead of always clipping).

Also adding the libgimpwidgets API gimp_widget_get_render_space().
2024-02-11 23:28:03 +01:00
Jehan
5a0f88e053 app: fix signature of gimp_babl_is_bounded(). It returns a boolean. 2024-02-11 23:28:03 +01:00
Jehan
a5657e4d28 app: also display color profile in Pixel mode. 2024-02-11 23:28:03 +01:00
Jehan
86854ee66f app: GimpColorFrame is now much more space aware.
This one is kind of a huge deal, because the info returned by the color frame
was kind of messy (even though it improved lately, but space associated to color
data had to be kept in-sync by hand, which was bug-prone).

Now the color frame stores the data as a GeglColor, always aware of its space
and therefore able to do much nicer conversion. Also RGB and Grayscale options
now display the profile name of the color space (until now, we had only this for
the CMYK option using the proofing profile).

I still wish to get more options. Typically some people may want to get
RGB/Grayscale/CMYK values to other spaces (maybe sRGB, one of their favorite
profile as set in Preferences or just any random profile which they could load
from disk). Giving such ability to basically live-convert their pixel data to
various other color space would be very nice. We'll see if this will be
implemented for GIMP 3 or for after.
2024-02-11 23:28:03 +01:00
Jehan
559297a5cb app, libgimp*: more GeglColor's space invasion.
- New function gimp_cairo_set_source_color() which is meant to replace
  gimp_cairo_set_source_rgb(a?)() eventually. This new function sets the Cairo
  source color, using the target monitor's profile of the widget where the Cairo
  surface is meant to be drawn on. It also uses the color management settings
  (such as whether a custom profile was set, instead of using system profile, or
  also simply whether color management was disabled at all). It doesn't
  soft-proof the color yet.
- Padding and out-of-gamut colors drawing now use the new
  gimp_cairo_set_source_color(). These don't need any soft-proofing anyway.
- Out-of-gamut color property in GimpColorConfig is now a GeglColor property.
2024-02-11 23:28:02 +01:00
Jehan
b06fe36970 app, libgimp*, plug-ins, tools: settings custom check colors now space-invaded.
We pass 2 GeglColor through the wire now. Since it is passed very early
(when sharing the configuration), I had some issues with initialization
order of GEGL, and in particular when calling gegl_init() before
gegl_config() inside _gimp_config(), I had a bunch of such criticals:

> Plugin script-fu: GLib-GObject: CRITICAL: Two different plugins tried to register 'GeglOpPlugIn-transform-core'

Anyway in the end, I store the passed colors as raw bytes and strings in
the GPConfig object, and re-construct the GeglColor last minute in
_gimp_config().
2024-02-11 23:28:02 +01:00
Jehan
7d2d96a0da libgimpcolor: gimp_color_is_perceptually_identical() should also check transparency.
This fixes weird behavior when changing only the alpha value of a color, e.g. in
the channel color GUI. The before and after colors were considered the same. Now
they won't.
2024-02-11 23:28:02 +01:00
Jehan
4879ab7b7f app, libgimp, pdb, plug-ins: move more code to GeglColor.
In particular, I updated the channel and quick-mask colors, padding colors and
more.
2024-02-11 23:28:02 +01:00
Jehan
319150a3b1 app: get rid of gimp_pickable_pixel_to_rgb() and gimp_image_color_profile_pixel_to_rgb().
These are not used anywhere anymore.
2024-02-11 23:28:02 +01:00
Jehan
d4fd88a77c app: improve out-of-gamut tests in the GimpFgBgEditor.
In particular, let's accept small margin of errors to determine that a value is
out of the [0; 1] range of its color space.
The specific use case is about a component at -0.000001 (or at 1.000001) which
will even just show as 0 (respectively 1) in the GUI and will be marked as
out-of-gamut. We want to avoid such thing to happen.

I also took the opportunity to get rid of a bit more GimpRGB code.
2024-02-11 23:28:02 +01:00
Jehan
e992ca3e51 app, libgimp, pdb, plug-ins: GimpText* using GeglColor.
One of the big improvement in this commit is that text layers are now much
better at space accuracy. They were already space-aware, yet rendered as sRGB u8
only before being converted to the image's space. It means that text layers had
the following limitations:

* Any color out of sRGB gamut were trimmed.
* Precision was always 8-bit (even if the image was high-bit depth).

Now GimpTextLayout keeps track of its source space (for RGB and CMYK only, this
won't be as easy when we will support more backend, since Cairo has only RGB
support for image data) and the image TRC (in case it bypasses the color space's
TRB) and it draws within this gamut and space.
It means first that we are not limited to sRGB colors; we will draw text main
color in the full image gamut, with still 2 remaining limitations:

* Unbounded colors are impossible because Pango format (to color text) uses
  hexadecimal (so even with half/float images, you can't draw out-of-gamut text
  unfortunately).
* Main color precision is still 8-bit, yet a tiny bit better than before as we
  at least follow TRC (so we avoid some of the precision loss when converting,
  even though the bit-depth is still the biggest loss).

The outline color on the other hand is drawn through Cairo API entirely, in
float. This means that the outline color will now be without any precision loss.

Note that this depends on CAIRO_FORMAT_RGBA128F which is only available since
Cairo 1.17.2 which is not in Debian bookworm (our current baseline for GIMP
3.0). It means that the old precision will still happen with older Cairo
version, as determined by #if code at compilation.
2024-02-11 23:28:02 +01:00
Jehan
a60b16f497 app: grab HSV values directly from GeglColor.
Absolutely no need to use intermediate GimpRGB and GimpHSV now convert data
ourselves with gimp_rgb_to_hsv() and gimp_hsv_to_rgb().
2024-02-11 23:28:02 +01:00
Jehan
7de118051f app: the Device Status dockable now shows context-sensitive colors.
I moved the function to select a valid contextual RGBA format as a core API
gimp_context_get_rgba_format(). This same API is now used in context actions, as
well as in the GimpDeviceStatus widget.

The latter now shows per-device fg/bg colors relatively to the active image's
format. The tooltip will also display contextual information (i.e. either the
image's name whose space is used, or sRGB).
Of course, this all updates when switching images by connecting to the
image-changed signal.
2024-02-11 23:28:02 +01:00
Jehan
cd09634dc2 app: update fg/bg color action code modifying colors through RGB axes.
In space invasion world, we want color-related code to be contextual. When we
say "Increase/Decrease the red/green/blue channel by X%", it would actually mean
something different if you are working on a sRGB space or a wider gamut space.
Furthermore, it means also something different if you work on linear/perceptual,
overriding the space's actual TRC.

This is why this new code takes the active image into account and uses this as a
base for the space and TRC you are working on. In case you have no active image,
it defaults to the current GeglColor space (though really this case should not
matter too much). In case your image is not RGB to begin with, it uses sRGB
space.
2024-02-11 23:28:02 +01:00
Jehan
b1178c51a3 libgimpconfig: support the GimpRGB format for GeglColor.
Some old config files will contain (color-rgb) contents. Also some data, such as
historical tool presets (.gtp files) will have such values in their
(tool-options).
2024-02-11 23:28:02 +01:00
Jehan
cd32b3bffa libgimpconfig: add support for GeglColor config properties.
GeglColor properties are serialized this way:
(propname "encoding" bpp pixel-data profile-size profile-data)
2024-02-11 23:28:02 +01:00
Jehan
4d0df90e26 libgimpconfig: fix some memory leaks when deserializing raw data. 2024-02-11 23:28:02 +01:00
Jehan
dbbcfb16d5 app, libgimp*, pdb, plug-ins: GimpContext is now using only GeglColor.
- app: gimp_context_get_(foreground|background)() are now returning a GeglColor.
- libgimp: PDB functions named similarly in libgimp are returning a newly
  allocated GeglColor too.
- A few other PDB functions (the ones using these functions) were updated and
  their signature changed to use GeglColor too, when relevant. Plug-ins which
  use any of the changed libgimp functions were fixed.
- GimpContext: signals "(foreground|background)-changed" are now passing a
  GeglColor.
- libgimpconfig: new macro GIMP_CONFIG_PROP_COLOR using gegl_param_spec_color().
- GimpContext: properties "foreground" and "background" are now GeglParamColor
  properties.
- app: All code interacting with GimpContext objects were updated to receive a
  GeglColor (that they may still convert, or no, to GimpRGB for now).
- app: gimp_prop_gegl_color_button_new() was added as an alternative to
  gimp_prop_color_button_new() when the property is a GeglParamColor. Eventually
  the former should replace completely the latter.
- libgimpwidgets: gimp_prop_color_area_new() now works on GeglParamColor
  properties only.
- libgimp: gimp_procedure_dialog_get_widget() will generate a GimpColorArea for
  GeglTypeParamColor arguments.
2024-02-11 23:28:02 +01:00
Jehan
229994957c libgimpwidgets: improve a tiny bit the error message to help debugging. 2024-02-11 23:28:02 +01:00
Jehan
f18266cb04 app, libgimp, pdb, plug-ins: gimp_context_[gs]et_foreground() now using GeglColor.
Also the color is internally stored as GeglColor, though there are still get
APIs and signals using GimpRGB.

The equivalent PDB functions are also changed to use GeglColor, same as app/
functions.
2024-02-11 23:28:02 +01:00
Jehan
9602926012 libgimpcolor: new functions gimp_color_set_alpha() and…
… gimp_color_is_perceptually_identical().

gimp_color_is_perceptually_identical() is meant to replace gimp_rgb_distance()
which is anyway always used to decide whether 2 colors can be considered equal.
So rather than having a distance algorithm which we won't be able to change
later on (if people start relying on specific values), let's just give the
answer directly on what's a same color (perceptually) or not.

Also now the distance is computed through the intermediate color space LCh which
seems to be one of the most perceptually uniform space, therefore a good choice
for such an algorithm (comparing distances on a non-perceptual uniform space
doesn't make very much sense, since a same distance may be perceived differently
in different subspaces).
2024-02-11 23:28:02 +01:00
Jehan
39544f96b4 app: some more GimpRGB to GeglColor port.
The picked() signal of GimpColorTool now emit a GeglColor.
2024-02-11 23:28:02 +01:00
Jehan
ecf4cfb3c5 app, libgimp, pdb, plug-ins: getting rid of some GimpRGB usage.
This is a first commit to really getting rid of GimpRGB within core and
PDB/plug-in code. This will make color conversion reliability a lot better as
GeglColor will handle conversions for us. The goal is that we should keep origin
color space (for instance when picking colors in a GimpPickable, or when storing
in the FG/BG colors or in paletters) until the last second and convert at use
only.
It's still very much work-in-progress.
2024-02-11 23:28:02 +01:00
Jehan
75efbf77d3 Issue #9790: reimplement gimp_drawable_[gs]et_pixel().
These 2 functions were removed in commit 89c359ce. They were in fact used and
clearly this historical API seems interesting (though we can likely do the same
thing using the drawable GeglBuffer, but this way is much easier).

This is now reimplemented using GeglColor instead of raw data.
2024-02-11 23:28:02 +01:00
Jehan
7814f011d0 libgimp*, pdb: support of GeglColor in the PDB.
Eventually this is meant to fully replace GimpRGB (as well as GimpHSV, GimpHSL
and GimpCMYK), both in libgimp and in core code, as part of both the space
invasion and the API rework. For this first commit, I keep this new object side
by side to GimpRGB.
2024-02-11 23:28:02 +01:00
Alx Sa
f6ff73210d core: Ignore selection when merging NDE
gimp_drawable_filter_apply () is affected
by the active selection. This causes display
glitches when merging all filters or
undoing a merge while an active selection
is on the image.

This patch saves the current selection,
clears it, merges/unmerges the filters,
then reapplies the selection to avoid the
problem. In the future, this should be
re-examined (when filter masks can be
edited).
2024-02-11 22:14:15 +00:00
Øyvind Kolås
9e6f90d664 meson,app: depend on GEGL-0.4.48 2024-02-11 22:42:16 +01:00
programmer_ceds
3a6e2913ed Correct upper limit shown in console browser for SF-OPTION controls (fixes #10796) 2024-02-11 19:25:56 +00:00
Alx Sa
8285795367 plug-ins: Restore screenshot delay on Windows
Resolves #10802.
Since the GimpProcedureDialog port, the Windows version
of the Screenshot plug-in has been missing the
"Screenshot Delay" option. This is because Windows did not
have the SCREENSHOT_CAN_DELAY_WINDOW_SHOT enum
set. Adding that back in restores the option.
2024-02-11 17:11:45 +00:00
Ferry Jérémie
1a041b65d1 correction : keep <rec> node and put opacity to 0 2024-02-10 19:56:15 +00:00
Ferry Jérémie
06064a6e5a Issue #9282 : deleting a rect node => black squares instead of symbolic icons 2024-02-10 19:56:15 +00:00
Ferry Jérémie
e397fb512a Issue 9268 : a <rect> node cover the picture 2024-02-10 19:56:15 +00:00
Sabri Ünal
032d930e23 Update Turkish translation 2024-02-10 11:20:41 +00:00
Sabri Ünal
69bf2f1897 Update Turkish translation 2024-02-10 11:06:40 +00:00
Sabri Ünal
6ea9b2d40d Update Turkish translation 2024-02-10 11:04:07 +00:00
Sabri Ünal
ee5fc1d484 Update Turkish translation 2024-02-10 11:03:58 +00:00
Jordi Mas
abe25cd0c0 Update Catalan translation 2024-02-10 08:03:20 +01:00
Jordi Mas
a1a38cb933 Update Catalan translation 2024-02-10 07:59:28 +01:00
Alx Sa
a2b683e53c tools: Move tool effects under NDE effects
Applying the same reordering code
in cbb1e816 to the Gradient and Cage
tools.
2024-02-09 23:23:47 +00:00
Yuri Chornoivan
bca419f9da Update Ukrainian translation 2024-02-09 20:41:58 +00:00
Bruno Lopes
e977b1b03b build/flatpak: Move Build instructions to gimp-web-devel
Here, the instructions was hard to find in the middle of maintainer stuff.

Also, be able to build GIMP without dev-oriented distros is something very
desirable, and the gimp-web-devel is the suited place fot it.
2024-02-09 15:29:45 -03:00
Jehan
6e6239c882 NEWS: update. 2024-02-09 19:10:46 +01:00
Ekaterine Papava
9043eeb837 Update Georgian translation 2024-02-09 17:55:10 +00:00
Ekaterine Papava
94ed0c0fe5 Update Georgian translation 2024-02-09 17:52:31 +00:00
Alx Sa
cbb1e81686 tools: Apply Warp below NDE filters
Resolves #10736.

By default, any filter added with a drawable with
gimp_drawable_filter_new () will be added on top
of the filter stack. Now that we have NDE effects,
there can be multiple live filters when drawing.

The Warp tool applies a GEGL operation as well,
and now it draws on top of any existing effect.
This patch adds code to move the Warp's filter
below any other NDE effects so it operates on
the raw pixels only.

Note that a longer term solution might be to have
a separate stack for tool-based GEGL operations,
but that would be a post 3.0 discussion.
2024-02-09 17:48:53 +00:00
Jehan
25145b9684 Issue #10745: move the "item set" icon above layer list.
- The icon itself was changed to a "search" icon. Though it kinda made sense to
  keep the "link" reference when I first implemented this, as a reference to how
  we used to link items (whereas now we select them together), in the grand
  scheme of things, it's not such a good idea and many won't likely understand.
  But everyone will understand a "search" button. :-)
- It's now next to the label displaying the number of selected items, in the
  item tree view header. This makes much more sense there. Also it makes the
  long list of bottom buttons slighly shorter.
- Finally I make this feature accessible to the channels and paths, by actually
  moving it out of GimpLayerTreeView and into GimpItemTreeView.
2024-02-09 18:22:43 +01:00
Alx Sa
d6edd71c4f xcf: Save/load GEGL seed parameter
Certain filters like Supernova have a
random seed property. According to the
specifications it's an unsigned int, so we
can save and load it with existing
functions.
2024-02-09 11:20:42 +00:00
Jehan
979900fcdf gitlab-ci, build: BUILD_TYPE not set for packaging-win-a64 job.
Aaaargh! I think this was the main issue which would explain why the problem was
mostly happening on the packaging job. In this job, we were still consistently
calling `pacman --noconfirm -Suy` (i.e.g "Synchronizing package databases")
which we had stopped to do for the CI builds as that was highly increasing
chances of locking pacman's process.
2024-02-08 21:00:07 +00:00
Jehan
a3d8f65946 gitlab-ci: terminate all msys2 related processes before Windows/Aarch64 jobs.
This is the command suggest by MSYS2 developers here:
https://github.com/msys2/MSYS2-packages/issues/4340#issuecomment-1887695290

They also say to run it outside the MSYS2 environment, which is why it's in the
CI rules, not in the shell script.

Honestly at this point, it feels like we are just stacking weird workaround to
get it to fail not too often. ;-(
2024-02-08 21:00:07 +00:00
Jehan
effe39d688 build: add gettext-tools dependency from MSYS2 repo.
gettext was recently split into 2 packages. While we didn't have the issue on
hmartinez82's runner, because old packages are not wiped out (as they should),
this issue first appeared on our new Arm runners.

This fixes the following error in our Windows build:

> /usr/bin/msgfmt: cannot locate ITS rules for ../data/tips/gimp-tips.xml.in

See:
* https://gitlab.gnome.org/Infrastructure/gimp-web-devel/-/merge_requests/52
* https://github.com/msys2/MINGW-packages/pull/19913
2024-02-08 21:00:07 +00:00
Jehan
5040eb88fb build: break ninja && ninja install into 2 calls.
Fixing a case where the script continued after a failed `ninja`. After further
testing on how `set -e` works, it looks like a toplevel `false && true` command
will fail the script (which is what we want), but it won't when inside an `if`
block!

Breaking it down into 2 separate calls fail the script correctly though. So
let's do this.
2024-02-08 21:00:07 +00:00
Jehan
ea3ec94bfb build: work around repetitive pacman failures by retrying.
MSYS2 pacman gets randomly stuck on Windows/Aarch64. The actual issue is still
being investigated by upstream projects, though anyway it's bad for us right
now, to the point that there are discussions to remove Aarch64 support from the
Windows installer (whereas it just got added recently!) in #10729.

This is an attempt to a workaround. Instead of getting stuck forever and waiting
until the whole job times out (per Gitlab CI settings), I time-out (after 3
minutes) the pacman command within our script and try again, up to 2 more times.
Hopefully one of the calls would succeed.

I also send a SIGKILL through the timeout (though I have no idea how signals
translate to Windows processes) and run again taskkill after this, which may
seem overkill. Interestingly I get output for both, which seems to indicate that
the kill succeeds in both cases (because of several processes?).

Anyway clearly it's a bit of random code not completely understood, but the
inability to test this all locally clearly doesn't help so it's good enough for
the time being.

See: https://github.com/msys2/MSYS2-packages/issues/4340
2024-02-08 21:00:07 +00:00
Alx Sa
d8b1dd8a37 Core: Explicitly merge down NDE filters on flatten
Resolves #10769.

Flattening an image or merging down layers caused
us to lose NDE filters on undo, as we flattened with
gimp_gegl_create_flatten_node () which didn't create
an Undo/Redo object.
To fix this, we merge the filters down beforehand with
our API so that they will be restored when undoing.
2024-02-08 17:04:25 +00:00
Alx Sa
92aad54cca widgets: Fix crash and formatting from NDE
Resolves #10768.
During NDE development, the Show/Hide All
function name was changed. This was not fixed
in one location where we blocked it during popup
creation, so the signal was running on dead objects.
This patch fixes this. It also fixes a few formatting
errors made during NDE development.
2024-02-08 14:03:55 +00:00
Jehan
1bf506abc6 gitlab-ci: clarify multi-command shell block.
Two shell commands got merged as one line. This seems to work fine on
hmartinez82's runner, unlike on our new runners. Anyway it is likely good
practice to clearly separate the commands.

Fixing:

$ if ($stuck -eq "True") { Remove-Item -Force -Path "C:\msys64\var\lib\pacman\db.lck" Write-Output "Cleaned previous stuck pacman" }
Remove-Item : A positional parameter cannot be found that accepts argument 'Write-Output'.
At line:279 char:26
+ ... q "True") { Remove-Item -Force -Path "C:\msys64\var\lib\pacman\db.lck ...
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidArgument: (:) [Remove-Item], ParameterBindingException
    + FullyQualifiedErrorId : PositionalParameterNotFound,Microsoft.PowerShell.Commands.RemoveItemCommand
2024-02-07 22:48:37 +01:00
Sabri Ünal
48b3b7f2bd Update Turkish translation 2024-02-07 12:49:05 +00:00
Alx Sa
9860377871 widgets: Prevents NDE edits on pixel locked layers
Resolves #10766.
Currently, GIMP does not support applying or editing
filters when the layer is pixel locked. This patch
prevents users from attempting to edit filters via the
NDE popover UI, and notifies them of why.
2024-02-07 04:47:49 +00:00
Vasil Pupkin
be7f2964de Update Belarusian translation 2024-02-06 23:38:39 +00:00
Alx Sa
3e200c81d7 widgets: Don't merge filters on pixel locked layers
Resolves #10767
Since you can't merge other layers onto a pixel
locked layer, it makes sense to prevent that with
NDE filters as well.
2024-02-06 18:20:36 +00:00
Alx Sa
ba05730f78 core: Fix invisible filter merge bug
If any NDE filter is hidden when merged, the entire layer
is hidden. This patch changes the behavior so that the
invisible filter is removed instead of committed when
merged down.
2024-02-06 15:34:39 +00:00
Jehan
768b01fbf5 desktop: small grammar fix.
Just noticed this while reviewing the Welcome dialog. Since it's user-facing
text, let's avoid too many grammar errors.
2024-02-06 15:49:41 +01:00
Jehan
0e10dacc87 libgimpwidgets: properly set the icon theme even at initialization.
Without this, when creating the new config folder for the first time
(update from 2.10 to 2.99/3.0), if say "Legacy" icon theme was set, it
would not show on the first run, though it would show on the second run.

Now it shows directly on the first run.
2024-02-06 15:10:32 +01:00
Jehan
a5cc3759b3 Issue #10731: icons are broken at first run. 2024-02-06 15:04:52 +01:00
Vasil Pupkin
f2681ac49c Update Belarusian translation 2024-02-06 03:54:12 +00:00
Daniel Novomeský
d326e1350e plug-ins: clean-up HEIF plug-in
Plug-in now requires libheif >= 1.15.1, so many preprocessor
directives like LIBHEIF_HAVE_VERSION(1,13,0) are no longer needed.
2024-02-05 13:28:13 +01:00
Daniel Novomeský
63aa33f808 meson: require libheif >= 1.15.1 2024-02-05 13:28:13 +01:00
programmer_ceds
6d10bbf856 Guides scripts enabled when multiple drawables selected (fixes issue #7535) Take 2 2024-02-04 18:26:45 +00:00
Anders Jonsson
f13d007a95 Update Swedish translation 2024-02-04 18:21:22 +00:00
Anders Jonsson
0aa74267c6 Update Swedish translation 2024-02-04 14:07:29 +00:00
Yuri Chornoivan
fa0ab5ee1a Update Ukrainian translation 2024-02-03 20:32:29 +00:00
Alx Sa
0bca939daf scripts: Port scripts with SF-OPTION
After ab626e79, Script-Fu v3 now has the
SF-OPTION parameter again. This patch
ports a few scripts that use it or were
not otherwise covered by other merge
requests.
Note that further improvements are
necessary to allow these to work on
multiple layers simultaneously.
2024-02-03 18:39:10 +00:00
Sabri Ünal
3c264411ad Update Turkish translation 2024-02-03 18:05:15 +00:00
bootchk
ab626e79ec 2.99 ScriptFu: add custom widgets to GimpProcedureDialog
For version 3 scripts, using script-fu-register-filter

Widgets for SF-OPTION and SF-DIRNAME

Fixes #9992

Test case is Sphere v3.

Note that SF-VECTORS is still not supported,
until there is a VectorsChooser widget in libgimp.

A step towards deprecating old-style scripts using script-fu-register,
and deleting script-fu-interface, the duplicate dialog for SF.
But we still need to change or replace script-fu-register (for non-filter plugins)
to use GimpProcedureDialog.
2024-02-03 15:27:16 +00:00
Stanislav Grinkov
978a795eb7 plug-ins: replace manual creation of GimpDrawablePreview's...
... with the call to gimp_procedure_dialog_get_drawable_preview(...) function.
2024-02-03 21:02:40 +06:00
Stanislav Grinkov
31b4e8122b libgimp: new gimp_procedure_dialog_get_preview_from_drawable() function.
This allows plug-in developers to create GimpPreviewDrawable widgets
with the procedure dialog API.
2024-02-03 21:02:40 +06:00
bootchk
e9f24beb6b ScriptFu: no compiler warning converting float to int MIN_RESOLUTION 2024-02-03 09:34:58 -05:00
Alx Sa
cc62f2b037 actions: Load Gegl properties when editing filters
Some GIMP-custom GEGL operations do not use GimpConfig to
store their properties (for instance, Threshold). 
Previously, we weren't copying over their values when editing an
NDE filter.
This patch adds code to copy over the Gegl properties if there is
not a GimpConfig object attached to the filter.
2024-02-02 22:42:02 +00:00
Alexandre Prokoudine
26d8c971a1 Update Russian translation 2024-02-02 13:05:48 +01:00
Jordi Mas
21170ad2b7 Update Catalan translation 2024-02-01 18:29:51 +01:00
bootchk
68cc92f939 libgimp: fix #10730 gimp_procedure_dialog_get_file_chooser precondition wrong 2024-02-01 11:39:00 -05:00
Jehan
e7b85e3d67 Issue #10725: do not test for lua-lgi when lua can't be run.
In particular in a cross-compilation environment where you don't have an exe
wrapper or cross-host run ability, you still want to be able to configure GIMP.

It is also possible to install lua scripts anyway with -Dlua=enabled, bypassing
ability to test lua-lgi presence (a warning will be outputted at configuration
time, but no error).
2024-02-01 15:46:55 +00:00
Jehan
0902e45901 build: jobs must return in failure when a dependency build fails.
While this is the job of `set -e`, putting parts of the script in shell
functions hid error returns in the build-deps-msys2 script.
Cf. #10729.

For the build-gimp-crossroad script, let's just add `set -e`.
Cf. #10725.
2024-02-01 15:46:55 +00:00
Anders Jonsson
a07b3c803b NEWS: typo and grammar fixes 2024-02-01 16:17:32 +01:00
Ekaterine Papava
f2ffdfefa3 Update Georgian translation 2024-02-01 02:24:08 +00:00
Ekaterine Papava
4ba8721f12 Update Georgian translation 2024-02-01 02:19:29 +00:00
Jehan
b89d90de42 NEWS: update. 2024-01-31 15:37:02 +01:00
Jehan
495523db39 themes: removing "Darker" theme.
I believe there is a real use case for darker or lighter themes, but this
particular theme is not particularly maintained and has no light variant (or to
be accurate: the light variant is just a link to the "Default" one). If someone
is interested in such themes, we'll welcome contributions to revive a new theme
which should have at the very least both a light and dark version, and we could
name it "Contrast" (rather than "Darker" which focuses on a dark variant only).

I think it's better to do it this way rather than releasing with a half-done
job.
2024-01-31 15:27:50 +01:00
Jehan
87a3073b04 app, themes: get rid of Compact theme and move its logic into code.
The Compact theme code is nearly the same as the Default one, apart from setting
palette icon size to small (which is already something done by the "Override
icon sizes" setting in Preferences), setting font-size to small (which can be
independently set by our "Font Scaling" setting) and setting 3 paddings.

Rather than having this separate theme, it feels like just moving the padding
changes as part of the icon size makes sense. In particular since, when setting
icons to "Small" right now, the default padding really feels a bit huge and out
of place. So all-in-one seems a better choice.

At first, I wanted to set a padding proportional to the icon size, but it didn't
work well. For now, I'll just choose padding sizes manually.
2024-01-31 15:27:50 +01:00
Marco Ciampa
f9a75fbe80 Updated Italian translation 2024-01-31 13:46:14 +01:00
Alx Sa
5f561bfbca tools: Don't make nop effects non-destructive
If you run the GEGL Operation tool without choosing
a filter, it leaves a "gegl:nop" layer effect behind.
This is not useful, so we check and set such filters as
destructive to get rid of when applying an effect.
2024-01-31 11:38:40 +00:00
Anders Jonsson
3d721935eb Update Swedish translation 2024-01-30 21:19:28 +00:00
Yuri Chornoivan
e667cc48d3 Update Ukrainian translation 2024-01-30 20:40:24 +00:00
Jehan
961248528b Issue #9712: image finalization should be propagated through GimpContext.
This was provoking a CRITICAL in #9712, in the GimpFgBgEditor which was tracking
the active image, but even before this, I experienced a crash in
GimpLayerTreeView code with the same steps.

The problem is that in some cases, the image switch happens once the currently
active image is already disposed. In particular we had the case in multi-window
mode where closing a window would free a GimpImage yet without necessarily
setting another image as active, since it depends on window focus in MWM (and
the other image windows may not gain focus immediately; this depends on the
window management logic).

Therefore we had various handlers in Gimp*TreeView (or GimpFgBgEditor and
possibly other places) code which tried to disconnect or work on now freed
pointers. To handle such case, let's connect to image finalization and set the
context to NULL image.
2024-01-30 21:31:04 +01:00
Jehan
2294ad12fc app: fix crash when setting an action insensitive without setting reason.
When working on #9712, I encountered this crash first before the main issue
(with the same reproduction steps as listed by Wormnest): reason may not be set
by the method. It's better to always explicitly set this variable to NULL first.
2024-01-30 21:31:04 +01:00
Alx Sa
e5592f2adf actions, dialogs, widgets: Windows Dark Mode title bar fixes
Making more dialogues use the title bar
theme code from ad8b47bf on Windows.
2024-01-30 15:58:07 +00:00
Alx Sa
34d613f364 Fix regression caused by 2c9668cb
2c9668cb did not contain the updates to gimpicons.h
introduced in c4f5bae1, accidentally reverting back
two function signatures to before that commit.
2024-01-30 15:55:10 +00:00
Alx Sa
2c9668cbb4 widgets: Add Effects icon to layer dockable header
Also creates a GIMP_ICON_EFFECT
constant so that a new permanent
layer effects icon can be assigned to it
2024-01-30 04:06:39 +00:00
Jehan
d28a577a12 Issue #9410: override prefer-symbolic-icons for mono-style icon themes.
The current GTK algorithm for finding an icon seems to be:

  main icon theme in choosen style > fallback icon theme in choosen style >
  main icon theme in another style > fallback icon theme in another style

Where "style" is either color or symbolic variant of a given icon. The problem
is therefore if say your prefered style is "Symbolic" and you choose a
Color-only icon theme. In such a configuration, all icons which are also
available in the system theme with a symbolic variant will be used from the
system theme (even when they are actually available in the chosen icon theme
too, yet in a color variant) and you get a weird mix of part of the icons as
symbolic from system theme and another part as color from the chosen theme.

In order to avoid this weird situation, we only set -gtk-icon-style CSS value to
the prefer-symbolic-icons property if the chosen icon theme has both style
variants. Otherwise we force the only variant of the chosen icon theme.

The icon "gimp-wilber" is used to determine whether an icon theme has both
variants, which should be documented in the developer website for icon theme
makers.
2024-01-29 21:48:17 +01:00
Kolbjørn Stuestøl
6a06985064 Update Norwegian Nynorsk translation 2024-01-29 18:57:04 +00:00
Jehan
2102e58884 Issue #9752: actually check for lua-lgi at configuration.
The -Dlua option has 3 cases:

1. disabled: lua plug-ins aren't installed at all.
2. auto: lua plug-ins are only installed if we find a lua installation
   with access to the 'lgi' module. We now do the actual test at configuration
   (not only lua existence test, but also lua-lgi).
3. enabled: lua plug-ins are always installed but if no lua installation with
   'lgi' module is found, a warning is displayed at end of configuration step.
2024-01-29 18:42:45 +01:00
Jehan
224879db91 icons: delete unused meson.build ad fixup for commit c4f5bae14a.
These should have been deleted. This is an oversight.
2024-01-29 17:48:54 +01:00
bootchk
888adc5b96 2.99 Test: add more tests
Add tests of context stack ops.

Add test of paint methods.

Test convert to all precisions.

Test paint dynamics.

Test PDB as database.

Test PDBProcedure methods.

Test display methods.

Test drawable operations.
2024-01-29 09:24:07 -05:00
Alx Sa
cc1f1b5900 scripts: Port add-bevel to new API
While the script is made aware of multiple selected layers,
it still only works on the top selected layer.
Mnemonics were also added to the GUI fields,
and an unused "type" parameter was removed.
2024-01-29 13:36:37 +00:00
Bruno Lopes
95deb1dae3 Issue #10580: Package and Distribute 'gegl' on Windows
This helps more advanced users to using GEGL in different contexts.
2024-01-27 20:12:05 -03:00
Bruno Lopes
5f164ef913 build/windows: Extend unified list to Deps scripts
The list contains, in addition to the GIMP deps, all babl and GEGL deps.
So, let's use it.
Also, nothing new under the sun. We already use a unique list on the
Windows build instruction page (for stable branch) and do the same to
Debian image job.
2024-01-27 20:30:13 +00:00
Jehan
c4f5bae14a app, icons, libgimpwidgets: merge Color and Symbolic icon themes into one.
The merged icon theme is simply named "Default" and contains a color and
symbolic variant for all icons. While in 2.10, it made sense to have both icon
themes because a theme had no concept of a "symbolic" variant back then, icon
themes in 3.0 have this concept and we support this in GIMP through the "Use
symbolic icons if available" option in Preferences.

Until now, it was confusing to have both themes + this option, even more as you
could use the Color icons with the "Use symbolic icons" option, which meant that
if some icons were missing, you could end up with a mix of color and symbolic
icons (and oppositely using the Symbolic theme with the option unchecked).

The new state is much simpler and less confusing. Just 1 icon theme with both
color and symbolic variants (the latter being used by default).

Note that the identical meson.build in each size subfolder is still mandatory
because of the inability of meson (still!) to generate files with
custom_target() in a subfolder as output.
2024-01-27 16:02:37 +01:00
Jordi Mas
e0373fba91 Update Catalan translation 2024-01-27 09:35:32 +01:00
Jacob Boerema
2bb0e2a636 tests: fix typo in function name 2024-01-26 13:49:48 -05:00
Jacob Boerema
e1c9ec5a06 tests: mark tests skipped due to no display as skipped
We were skipping tests when there is no display, which is always the
case on Windows. However, these tests always showed as succeeded.
Unless you looked at the test log, you wouldn't noticed that most of
the tests weren't actually performed.

Exit these tests with the value GIMP_EXIT_TEST_SKIPPED instead of
EXIT_SUCCESS.
2024-01-26 13:47:20 -05:00
Jacob Boerema
064fd69f18 tests: fix #10694 test suite fails due to use of g_assert
You are not supposed to use g_assert in tests because g_assert can be
disabled using -DG_DISABLE_ASSERT, which makes tests fail.

Instead let's use the recommended replacement g_assert_true. At this
time we are not bothering using more specific g_assert_* functions,
since there are plans to change our test suite.
2024-01-26 13:44:30 -05:00
Daniel Novomeský
1148213825 build: Install QOI header manually 2024-01-26 14:47:00 +01:00
Yuri Chornoivan
7ff284c56f Update Ukrainian translation 2024-01-26 13:18:11 +00:00
Alx Sa
4a10b11e3e libgimpconfig: Fix cross-platform gsize warning
gimp_config_writer_printf () is used to print out a gsize variable, data_length.
gsize's actual size varies depending on platform, so using the format "%lu" throws
a warning on some platforms and switching to "%llu" throws a warning on others.
@Wormnest suggested ("%" G_GSIZE_FORMAT) as a universal format to resolve
this warning.
2024-01-26 12:08:18 +00:00
Jehan
c32e803679 app, themes: merge the Gray and Default themes and add theme color scheme concept.
Until now, we were following a similar concept of color schemes as what most OS
are doing. For instance, Freedesktop recently introduced a tri-state color
scheme of "Prefer Light", "Prefer Dark" and "Default", the latter being either
whatever the software prefers (e.g. we prefer either Dark or Gray for graphics
software usually) or what the system prefers. See #8675.

Until now, with GTK, we only had a boolean "prefer dark" setting through the
"gtk-application-prefer-dark-theme" settings. There is not even a "prefer
light".

Nevertheless for graphics application, there is clearly a third case (fourth if
we added a "follow system color preferences" which we don't implement for now):
gray mode and in particular middle gray. Having a middle gray UI is often
considered a necessity when working on colors in order to protect our perception
of color from being influenced by surrounding UI.
To fill this need, we were proposing a Default vs. a Gray theme in GIMP, but
this was a bit confusing and felt illogical, as discussed on IRC some time ago.
Also depending on whether you chose "prefer dark" or not for the gray theme,
this one was itself 2 themes, which made things odd and harder to work on.

Instead this commit:

- adds a color scheme concept in GIMP with 3 variants so far: light, gray and
  dark. A possible fourth (future) variant might be to follow the system
  preference (do all OS provide such a queriable option?).
- Our Gray theme is merged into Default (as the gray color scheme variant).
- Custom themes can add the following CSS files: gimp-light.css, gimp-gray.css,
  gimp-dark.css which are the base file for their respective scheme. gimp.css is
  still used as a fallback though it is not necessary (our own Default theme
  does not provide a gimp.css anymore). Custom themes don't have to provide all
  3 variants. A theme can just provide one or 2 variants if it only wants to
  support 1 or 2 use cases.
2024-01-25 18:56:13 +01:00
Sabri Ünal
e741920d8e Update Turkish translation 2024-01-25 14:42:40 +00:00
bootchk
69fedf6995 Fix #10475 double popup context menu on RMB in dockable chooser
Chooser return GDK_EVENT_STOP so parent manager does not also popup second menu.
Specifically, return the result of the call to gimp_editor_popup_menu_at_pointer.
When a menu does pop up (for a dockable), that result is GDK_EVENT_STOP
and the event does not propagate to the parent widget.

Added a comment about why we ignore the result of a call
to gimp_editor_popup_menu_at_pointer in another place,
since it is not obvious why that call is different.

All other current behavior retained.
Other current behavior might be separate issue:
LMB or RMB outside any item, or in the current selected item,
in the chooser that popups from the toolbox,
should probably close the popup chooser, or give an audible alert,
because it does nothing.
Note that a chooser is also used in a remote dialog for a plugin,
and it closes a different way, choosing an OK button.
2024-01-25 14:13:00 +00:00
Jehan
0ea48926aa NEWS: update. 2024-01-25 15:08:13 +01:00
Yuri Chornoivan
743230fbe6 Update Ukrainian translation 2024-01-25 13:56:14 +00:00
Marco Ciampa
ecfc90d202 Updated Italian translation (WIP) 2024-01-25 11:17:03 +01:00
bootchk
6aa9f97819 Fix #10690 build broken on GLib < 2.74
Use 0 instead of new symbol G_CONNECT_DEFAULT first defined in glib2.74
2024-01-24 13:30:10 -05:00
Jacob Boerema
f78186e03b Get rid of old Windows specific defines
MINGW64
- uses 0x601 as value for _WIN32_WINNT. No need for us to define
it to that value or even lower values in some places.
This also gets rid of:  warning: "_WIN32_WINNT" redefined
- has 0x0502 for WINVER, so get rid of us setting it to 0x0500 in
gimp-app-test-utils.h. It also seems that the need to use G_OS_WIN32
has disappeared here.
- DIRECTINPUT_VERSION is 0x0800, no need for us to set it to that value.
- AI_ADDRCONFIG was apparently missing from the MINGW headers in the
past, but not anymore.
2024-01-24 12:10:00 -05:00
Anders Jonsson
be1259de2b Update POTFILES.in 2024-01-24 09:18:47 +01:00
Ekaterine Papava
6c21b03631 Update Georgian translation 2024-01-23 21:30:33 +00:00
Ekaterine Papava
1c0c8ac38f Update Georgian translation 2024-01-23 21:24:51 +00:00
Jehan
d1ea2f35c3 desktop: update the <release> info in AppStream metadata. 2024-01-23 22:09:03 +01:00
Anders Jonsson
e3896352b9 app: fix test-ui typo 2024-01-23 20:46:01 +00:00
Yuri Chornoivan
65f99b66fa Update Ukrainian translation 2024-01-23 20:44:10 +00:00
Yuri Chornoivan
cdde3f220f Update Ukrainian translation 2024-01-23 19:36:48 +00:00
bootchk
25280ffdb1 test: add tests of paint ops. 2024-01-23 18:30:32 +00:00
Jehan
3f54d83bac app: do not maintain manually the list of core ops with custom config object.
The list of objects where the config object is a dedicated custom class (instead
of a runtime-registered class) is well known. These are the operations
registered inside gimp_operations_init().

The list inside gimp_gegl_procedure_execute_async() which the previous commit
was updating was not right: it was still missing "gimp:hue-saturation" and
"gimp:threshold" should not have been on the list (this was generating a
CRITICAL when trying to get the "config" property on this object).

Instead let's add some init/exit() functions in gimp-operation-config API to
distinguish the operations with custom config (registered during init) with all
the others. Then we add gimp_operation_config_is_custom() which can be used
everywhere where we want to verify if an operation is using a custom-made config
object or a generated class just mirroring the operation properties.

This way, we should not get out-of-sync anymore.
2024-01-23 15:39:09 +00:00
Alx Sa
7a05a8956f tools: Fix Color Balance editing crash
Adds gimp:color-balance to the list of
GIMP-specific GEGL operations we
retrieve the GimpConfig settings from.
Also prevents trying to set a GEGL
property when editing if it couldn't be
converted properly (e.g. GimpConfig)
2024-01-23 15:39:09 +00:00
Jehan
956f16e173 Issue #10566: support GimpConfig and enum arguments and a few more fixes.
Now that we save GEGL operation arguments ourselves (instead of relying on
GEGL-generated XML), we can serialize and deserialize GimpConfig arguments which
are used in various operations implemented within GIMP core code.

Additionally:

- Also support saving and loading all enum types.
- PROP_EFFECT_ARGUMENT renamed to PROP_FILTER_ARGUMENT for consistent naming.
- A bit more accurate handling on save and load errors with dedicated messages
  to various issues.
- Use PROP_FLOAT_OPACITY instead of the obsolete 8-bit PROP_OPACITY (actually
  32-bit but stored as 0-255 int).
- Fix a leaking string.
2024-01-23 15:39:09 +00:00
Alx Sa
8b2975e0e8 Additional minor fixes
*It's possible to have one layer selected but edit the filter of another layer.
The FilterTool code was updated to use the filter's drawable if editing.
*Prevents editing if multiple layers are selected.
This is a current limitation of the filter tool itself, but it was causing issues with NDE.
*If an XCF with a filter from a third-party plug-in is loaded, the filter won't be
created if the user doesn't have it installed.
Note that GEGL still throws a lot of warnings about missing properties - not sure how to resolve that.
*Refresh drawable when finished editing a filter to fix issue with lingering preview splits
*Fix issue with loading more than one filter after XCF format changes
2024-01-23 15:39:09 +00:00
Jehan
a489345e77 app: a few fixups to MR !958 (initial non-destructive editing).
- Do not leak allocated return value of gegl_node_to_xml_full().
- When merging layer effects, use gimp_drawable_filter_commit(), making
  sure we use the exact same code path as when applying layer effects
  destructively from the start. This also ensures that filters are
  properly removed from the filter stack (unlike
  gimp_drawable_merge_filter()), which was the reason why the rendering
  was wrong (hence getting the buffer without effects first, then
  reapplying it after was only a workaround to an actual bug).
- When removing a filter, verify the object still exists before doing
  anything with it. If this was the last reference, we don't want to
  call functions on this object. In gimp_drawable_filter_commit(), we
  set up a weak pointer. In gimp_drawable_filter_remove_filter() itself,
  we save the pointer to the filter's drawable before actual removal (as
  we don't want to dereference a freed object later on).
- export_merge_layer_effects() should merge filters recursively through
  layer groups.
- clean up the XCF code:
  * No need to wrap the effect pointers list into 2 zero offset. Only
    have one zero offset to indicate the list end.
  * Add the layer effect mask in the effect structure (not in the layer
    structure), similar as for layer masks.
  * Effect name and icon made as main data in the structure, not as
    properties.
2024-01-23 15:39:09 +00:00
Alx Sa
e678a20951 core: Initial non-destructive editing implementation
This patch implements an initial form of
non-destructive editing. Filters now stay active
instead of being immediately merged down.
A new column is added to the layer tree view, which
can be clicked to show a pop-over menu.
Filters can currently be hidden/shown, edited, reordered,
deleted, and merged down from this pop-over menu.

Currently, this works on layers and layer selections only.
Plenty of room for improvement!
2024-01-23 15:39:09 +00:00
bootchk
ec90cd1d9a Add more tests of PDB API in ScriptFu. 2024-01-23 07:19:09 -05:00
Jordi Mas
aab48a7c89 Fixes to Catalan translation 2024-01-22 21:36:30 +01:00
bootchk
784cde7f14 Fix #10496 crash on RMB in chooser item not the current selection
Use g_signal_connect_object to ensure object passed to handler
is not destroyed in the middle of the handler by knock-on signal handling.

Note there are comments about this in gimpcontainertreeview.c line 1592.
And similar code i.e. calls to gimp_container_view_get_container
that seem to be intended to solve but might actually also be susceptible.
Those calls in icon view throw CRITICALs during this issue.
But testing of the tree view (a list instead of a grid)
doesn't seem to crash, so leave well enough alone.
2024-01-22 18:29:20 +00:00
Vasil Pupkin
7d8495fdd2 Update Belarusian translation 2024-01-22 18:27:38 +00:00
Sabri Ünal
84c2b63212 Update Turkish translation 2024-01-22 12:40:07 +00:00
Sabri Ünal
dff4486ab9 Update Turkish translation 2024-01-22 12:28:47 +00:00
Jordi Mas
a90f731d11 Update Catalan translation 2024-01-21 20:34:21 +01:00
Bruno Lopes
c60604a535 Partially revert "build/flatpak: Drop 'gimp_app_version' hardcoding"
As suggested by Jehan, the manifest will be configured by meson.
Of course, for CI compliance, this pushes the job to a further stage:
'packaging', which is what Flatpak is about, after all.

The distribution job name has also been changed, because when Store job
is merged, this will be the new nomenclature of the distribution jobs,
which was not changed since !1171 by lack of time.
2024-01-21 14:04:35 +00:00
dimspingos
0445f0b9ed Updated Greek Translation 2024-01-21 15:14:30 +02:00
Alx Sa
1b5c6630c3 widgets: Add MacOS-compatible menu separator
Per @lukaso, the "rightwards triangle arrowhead" character
doesn't render on MacOS. This patch uses a different character
for MacOS only until a standard character can be decided on.
2024-01-20 18:48:45 +00:00
Jürgen Benvenuti
462b874ae8 Update German translation 2024-01-20 18:45:20 +00:00
Kolbjørn Stuestøl
9a586890cf Update Norwegian Nynorsk translation 2024-01-20 15:26:58 +00:00
Bruno Lopes
ddf6d6e513 build/windows: Remove GTK patches
There is no point in keeping .patches in our source since we aren't applying
them and there are "backup" MRs in GTK: GNOME/gtk!3275 and GNOME/gtk!4432.
2024-01-20 09:47:48 -03:00
Boyuan Yang
182d3cece6 Update Chinese (China) translation 2024-01-20 01:55:17 +00:00
Boyuan Yang
1bccd22595 Update Chinese (China) translation 2024-01-20 01:53:35 +00:00
Boyuan Yang
f81be6d5b3 Update Chinese (China) translation 2024-01-20 01:53:20 +00:00
Alx Sa
bfcc812623 core: Fix warning when pasting to a mask
Resolves #10657.
d120e592 fixed a crash when pasting into an empty image.
However, it created a new issue when pasting into a layer mask.
It caused a later call to gimp_drawable_convert_type () to fail, as
the pasted image would not need to be converted if the image's
settings were used rather than the drawable.
This patch fixes both issues by checking if the selection/image is empty,
and assigned the base type and precision values from either the selection
or the image accordingly.
2024-01-19 22:44:51 +00:00
Bruno Lopes
161d6e6932 Add .vscode/settings.json compliant with Coding Style
As recommended in the Coding Style "Code editor" section:
https://developer.gimp.org/core/coding_style/#code-editor--integrated-development-environment-ide
2024-01-19 16:06:06 -03:00
Bruno Lopes
e653535ed2 .gitignore: Delete unused exceptions
The '_build' and '.vscode' folders (this in particular makes impossible
to commit settings.json) are not welcome in this general file, according
to Jehan comment:
https://gitlab.gnome.org/GNOME/gimp/-/merge_requests/1021#note_1801018
2024-01-19 15:43:46 -03:00
Jordi Mas
5a4a58a728 Update Catalan translation 2024-01-19 16:07:11 +01:00
Alx Sa
21d24467ad scripts: Fix "Remove all Guides" script bug
Resolves #10651
The "Remove All Guides" script calls
gimp-image-find-next-guide, which per
its description can take in 0. However,
the parameter sets 1 as the minimum
value.
This patch fixes the range so that it can
accept 0, which enables the Remove All
Guides script to work again.
It also updates the script to the new
multi-layer aware API.
2024-01-19 11:17:36 +00:00
Jehan
14abb71c34 NEWS: update. 2024-01-19 11:26:08 +01:00
Anders Jonsson
7a66111b19 Update Swedish translation 2024-01-18 21:01:16 +00:00
Bruno Lopes
ca5b2cd7c7 devel-docs: Update content according to 'gimp-web-devel'
- Drops HACKING file (it is outdated and we have the "same thing",
  updated, in the devel site), but moved PDB content to the README
* Update various links now to the devel site
+ Added 'TODOs' to avoid confusion from titles with empty content
  and removed some that are already implemented
2024-01-18 19:05:04 +00:00
Yuri Chornoivan
71ceff9125 Update Ukrainian translation 2024-01-18 17:51:16 +00:00
Yuri Chornoivan
088a4d42be Update Ukrainian translation 2024-01-18 17:49:22 +00:00
programmer-ceds
0514a07616 scripts: Update Guides from Selection API
Updates script to v3 code, which allows for it to work
when multiple layers are selected.
2024-01-18 11:14:31 -05:00
Bruno Lopes
107887f929 build/flatpak: Drop 'gimp_app_version' hardcoding
Now, the script reads the major.minor version automatically from the main
meson.build file, reducing maintenance work, which is already especially
high regarding flatpak because of the natural hashes updates etc.

Also, a small organization made to make the code more humanly readable.
2024-01-18 15:59:45 +00:00
Anders Jonsson
ab9f8146da app: mark missing tool option as translatable 2024-01-18 13:20:21 +00:00
Anders Jonsson
e2843e40cf libgimpwidgets: mark tooltips as translatable 2024-01-18 13:20:21 +00:00
Martin
f07ad4b2d6 Update Slovenian translation 2024-01-18 07:23:15 +00:00
Martin
cf133337c2 Update Slovenian translation 2024-01-18 07:21:36 +00:00
Bruno Lopes
b887211934 Issue #9106: Create desktop shortcut by default with Inno installer
As consensus on Windows contributors, it is more useful for most users
the generation of the desktop shortcut by default.
Now, users who don't want it should uncheck the option in custom install
or manually delete the shortcut after a full install.
2024-01-17 17:30:35 +00:00
Jacob Boerema
e58afad043 app: fix #10641 API for adding to the local Layers menu is broken
It was not possible anymore for a plug-in to add a menu item to the
local Layers, Classes and Paths dialogs using <Layers>, <Classes> and
<Vectors> at the start of the menu path.
For the first two this was due to an extra length parameter and the
drawables now being inside a GimpObjectArray. To fix that we check
inside the object array for the correct type names.
I'm not sure if Vectors ever worked, but testing shows it only adds
runmode and image parameters. To fix that we do the same as for
ColorMap.
2024-01-17 12:20:00 -05:00
Sabri Ünal
174d9c5631 Update Turkish translation 2024-01-17 08:04:53 +00:00
Sabri Ünal
007484517f Update Turkish translation 2024-01-17 07:48:30 +00:00
Sabri Ünal
78d768037e Update Turkish translation 2024-01-17 07:46:50 +00:00
Ekaterine Papava
f3887e362c Update Georgian translation 2024-01-16 20:07:22 +00:00
Bruno Lopes
38f5fec491 build/windows: Drop 'jhbuild'
The 'jhbuild' build of GIMP (Windows only) was added in 2013 and then maintained
by only one contributor (it even offered unnoficial nightly builds) until 2017,
when it never received a new jhbuild-specific commit again.

After so long, update it to keep up with current development status is quite hard,
so it is reasonable to remove this already dead version of GIMP.
2024-01-16 20:06:10 +00:00
Ekaterine Papava
ea54f99ec0 Update Georgian translation 2024-01-16 20:05:05 +00:00
Ekaterine Papava
30bab1919e Update Georgian translation 2024-01-16 20:02:57 +00:00
Alx Sa
0286210539 widgets: Add checks if GdkDevice doesn't exist
Resolves #10643.

Prevent gimp_modifiers_editor_show_settings () from being called
when the user clicks the Modifier Reset button in Preferences if
there is no device connected to GIMP.
2024-01-16 14:17:53 +00:00
Bruno Lopes
c239d522c8 gitlab-ci: Tweak CI to avoid stuck win-a64 jobs
'clangarm64' pacman is getting stuck and killing it is the only "solution"
before any patch by the MSYS2 folks.
2024-01-16 13:11:56 +00:00
Marco Ciampa
cb63e4505e Updated Italian translation (WIP) 2024-01-16 13:59:58 +01:00
Anders Jonsson
cea5397a59 Update Swedish translation 2024-01-16 10:25:39 +00:00
dimspingos
d5771b21e2 Updated Greek Translation 2024-01-16 10:54:56 +02:00
Alx Sa
15929e83fd core: Fix crash when pattern can't be loaded
For certain small selections, the pattern preview can't be loaded.
Since e1e30c6f assumes the pattern loads, this could cause a
crash if a dialogue with the preview is visible.
This patch checks if the scaled pattern was loaded before using
it, and otherwise uses the default pattern.
2024-01-15 22:55:57 +00:00
Anders Jonsson
31d8ac70a1 Update Swedish translation 2024-01-15 21:39:26 +00:00
Aurimas Černius
4424bafd47 Update Lithuanian translation 2024-01-15 20:55:55 +00:00
Aurimas Černius
656bf8d1fb Update Lithuanian translation 2024-01-15 20:46:13 +00:00
Aurimas Černius
a0c111a53c Update Lithuanian translation 2024-01-15 20:41:15 +00:00
Aurimas Černius
ee3e49299b Update Lithuanian translation 2024-01-15 20:36:12 +00:00
Yuri Chornoivan
92f7903331 Update Ukrainian translation 2024-01-15 20:24:04 +00:00
Bruno Lopes
663b6636ab build/windows: Enable Norwegian translation for the Windows installer
Following ce3b6430d5
2024-01-15 16:37:08 -03:00
Bruno Lopes
6850232cdb build/windows: Organize Installer script
The order of the commands was very confusing and some useful comments
was lacking. Let's fix it.
2024-01-15 16:36:32 -03:00
Bruno Lopes
2c1c7aae03 gitlab-ci, build/windows: Fix .patch and improve a little pacman upgrade
* Fixes an ARM .patch that stop to working after !1171, causing job fail
* Changes the logic of system upgrade (pacman -Syyuu) to be less redundant
  This also improves consistency with the Debian jobs
2024-01-15 15:04:30 -03:00
Bruno Lopes
3a561d1c68 build/windows: Fix and update some Inno Installer files
These files (specially the script) were not properly updated in the
previous MR, which would make the Inno Installer Job fail.
2024-01-15 15:04:30 -03:00
Bruno Lopes
9c0cc6ab98 plug-ins: Don't build ScriptFu interpreter and server in crossbuilds
Since !1171, ScriptFu .scm and .interp files aren't available to prevent
errors caused by no instrospection support, but this binaries escaped.
2024-01-15 15:04:30 -03:00
Kolbjørn Stuestøl
96a0cf98ca Update Norwegian Nynorsk translation 2024-01-15 17:58:51 +00:00
Kolbjørn Stuestøl
a380886c03 Update Norwegian Nynorsk translation 2024-01-15 17:47:58 +00:00
Kolbjørn Stuestøl
8f9dd1fe6b Update Norwegian Nynorsk translation 2024-01-15 17:35:59 +00:00
Kolbjørn Stuestøl
ce3b6430d5 Add Norwegian Nynorsk translation 2024-01-15 17:08:37 +00:00
Kolbjørn Stuestøl
46a4fbaa45 Update Norwegian Nynorsk translation 2024-01-15 17:05:05 +00:00
Bruno Lopes
5dc8c267da build: remove obsolete 'patches'
They have already been released in Cairo and were not even being applied
by us anymore.
2024-01-15 11:53:42 -03:00
Bruno Lopes
f24432e632 build: drop 'buildbot'
This folder has become totally obsolete because we currently use Gitlab CI
and its content was not being maintained for over a decade.
2024-01-15 11:53:42 -03:00
Anders Jonsson
9838c9f65f plug-ins: fix crash on export to xmc
Fixes #10605.

Export to xmc when image width or height is 256 pixels
causes a crash. Add equality check to an assert to stop
the plug-in from crashing.
2024-01-15 14:50:58 +01:00
Alx Sa
bb588155fd plug-ins: Fix ImageMap resize bug in GTK3
Resolves #10530.

In GTK2, setting a window's scrollbar policy to GTK_POLICY_NEVER
hid the scrollbars. In GTK3, this also makes the window automatically
resize to fit the contents. Since ImageMap displays the full drawable
with no scaling, this caused the plug-in window to be very large for large
layers.
GTK_POLICY_EXTERNAL in GTK3 works the same as the GTK2 version of
GTK_POLICY_NEVER, so using it instead fixes the problem.
The default width and height magic numbers were also replaced with
constants.
2024-01-14 19:43:32 +00:00
Martin
428f08b785 Update Slovenian translation 2024-01-14 17:19:51 +00:00
sonia
9f762f5e4b plug-ins: Fix JPEG2000 warning
Removes duplicate parenthesis in the CMYK color space check.
2024-01-14 11:17:29 -05:00
Alx Sa
c01ffee74f plug-ins, libgimpconfig: Fix minor warnings
- file-psd, sig[4] and block_len variables are initialized to stop uninitialized warnings
- file-xpm, g_file_peek_path () is cast to (char *) to stop "discarded const" warnings
- gimpconfig-serialized.c, %llu is used instead of %lu to stop overflow warning
2024-01-14 14:30:32 +00:00
Bruno Lopes
28fc941c53 build, devel-docs, po-*, tools: remove Autotools remnants
- Remove files not used by meson
- Remove autotools references in texts
2024-01-14 10:38:12 -03:00
Bruno Lopes
874b199e61 build, docs, etc: drop hardcoding of GIMP version
In preparation for GIMP 3.0 and future releases.
2024-01-13 18:15:10 -03:00
Luming Zh
056e545215 Update Chinese (China) translation 2024-01-12 23:57:34 +00:00
dimspingos
9d0ad0061d Updated Greek Translation 2024-01-12 20:22:40 +02:00
Alx Sa
2aa0a9d42b themes: Prevent system theme leak on stacks and viewports
If a system theme sets the background-image property for stacks,
it recolors the main canvas when empty. It also adds a border to
the toolbox Wilber area.
Additionally, the Credits page of the GtkAboutDialog has odd colors
due to general viewport grid styles overriding the GTK default.
This patch fixes these problems, and adds a custom CSS class to
the GimpAboutDialog for current and future work.
2024-01-11 20:03:48 +00:00
Yuri Chornoivan
9eb7928b91 Update Ukrainian translation 2024-01-11 19:01:04 +00:00
Yuri Chornoivan
6fa6c4fc05 Update Ukrainian translation 2024-01-11 18:54:16 +00:00
Yuri Chornoivan
edd4085608 Update Ukrainian translation 2024-01-11 18:49:58 +00:00
Anders Jonsson
ad123bbbc4 plug-ins: mark svg, wmf dialogs as translatable 2024-01-11 18:45:40 +01:00
Alx Sa
2db73f82ac display: Fix titlebar regression after 7e7828e4
The previous commit did not fully convert the title/status bar
format string to be UTF8-clean, due to a misunderstanding
of the logic behind the symbol used to indicate an image
was dirty.

Rather than always grabbing the 2nd character in the format
string, this patch now grabs the next character in the format
string after the %D, %N, %C, and %E commands.
2024-01-11 04:06:40 +00:00
Alx Sa
1666f82b20 scripts: Partially fix spinning-globe.scm
During the API port, the Map Object
plugin had some parameters added and
others changed to GimpChoice strings.
This broke the Spinning Globe filter which
called on the map-object plugin.
This patch updates the procedure call and
fixes ranges in the map-object plugin so
spinning-globe works again,
but larger scope warnings persist.
2024-01-11 03:20:04 +00:00
dimspingos
9dfe17f150 Updated Greek Translation 2024-01-10 10:08:50 +02:00
bootchk
96afe1532d libgimp: Refactor fractal-explorer-dialogs.c: extract methods
No functional change.

I did this while chasing #10590 and #10591
The refactoring moves replicated code into functions.
So readers can understand better without having to compare sections
of replicated code.
The comments also highlight issue #10590.
2024-01-09 19:21:27 +00:00
bootchk
d26433036c Fix #10536 Plugins: Fractal Explorer fails
Use g_connect_signal_swapped for "resource-set" signal from Resource Choosers,
to match the signal handler expecting "callback data" in the first arg.
Otherwise the first arg is the object emitting the signal.
2024-01-09 19:21:27 +00:00
bootchk
0edf079d4e Fix wire contention for gradient data 2024-01-09 19:21:27 +00:00
Alx Sa
ca1b21c008 widgets: Add Windows titlebar theme to search popup
Extends the theme-matching code from ad8b47bf to the
GimpSearchpop on Windows
2024-01-09 15:08:10 +00:00
Alx Sa
bbbf6df52d plug-ins: Fix image-map grid type change
Resolves #10611.

In GTK3, GtkRadioButtons are set using the "active" property
rather than selected, so the callback needed to check the
GTK_STATE_FLAG_ACTIVE flag instead of GTK_STATE_FLAG_SELECTED
when changing grid types.
The code was also reformatted to match current coding style.
2024-01-09 02:54:09 +00:00
Jacob Boerema
45ea994e89 plug-ins: improve default color handling of foggify
- To set color values in the 0-255 range we now have to use set_uchar.
- Because setting a default color is not working, the color in config
  could be None, which if the color wasn't changed caused a CRITICAL.

Let's check for None and if that is the case then manually set our
default color.
2024-01-08 18:11:46 -05:00
Jacob Boerema
c44819f58b plug-ins: fix foggify AttributeError on Cancel
When cancelling foggify we get the following error:
AttributeError: 'GimpProcedureConfig-python-fu-foggify' object has no
attribute 'end_run'

The end_run function was removed a while ago, so just remove this line.
2024-01-08 18:11:46 -05:00
Aurimas Černius
bdac126fb1 Update Lithuanian translation 2024-01-08 21:21:17 +00:00
Jacob Boerema
129667423f plug-ins: fix #10587 image map crash in grid menu
The grid state was not correctly updated when changed from within the
grid settings dialog.

Instead of using g_simple_action_set_enabled we need to use
g_simple_action_set_state, since we don't want to change whether the
action is enabled or disabled, but the checked/unchecked state.
2024-01-07 17:52:44 -05:00
Alx Sa
7e7828e452 display: Make title format UTF8-clean
The current code assumes that one letter is one byte long.
This caused issues when using non-ASCII UTF8 characters in
the title and statusbar format strings.

This patch replaces the loop logic with g_utf8_next_char () and g_utf8_get_char ()
to get the next letter no matter how many bytes it takes up.
2024-01-07 18:22:37 +00:00
Alx Sa
b9fe1c64f0 Tools: Add Pickable check to Align Tool
As reported in issue 10604, if the Align Tool is set to align relative
to a reference object and 'use extents of layer contents' is enabled,
clicking on a path causes a CRITICAL.

This is due to gimp_pickable_auto_shrink () being called, when GimpVectors
are not GimpPickables. A datatype check is added before calling the function
to prevent the issue.
2024-01-07 14:13:49 +00:00
bootchk
1553f8b88c Fix #10589 CRTICAL on empty label on resource chooser widget 2024-01-07 10:47:54 +00:00
Marco Ciampa
9bc59ba543 Updated Italian translation (WIP) 2024-01-07 03:49:30 +01:00
Jacob Boerema
73d7b0dc96 Issue #10450 crash or critical using file open options dialog
When opening images like DDS or EPS that have an options dialog,
we either get a crash, or criticals.

The critical made clear that there is a problem dereferencing:
(gimp-2.99.exe:9900): GLib-CRITICAL **: 14:52:58.831:
g_atomic_ref_count_dec: assertion 'old_value > 0' failed

Looking at gimp_file_dialog_progress_get_window_id we see that the
handle doesn't get an extra reference, while in other similar places
the handle is duplicated.

Using g_bytes_ref on the handle fixes the criticals for me.
2024-01-06 14:53:53 -05:00
Anders Jonsson
078dafa847 Update Swedish translation 2024-01-06 12:11:00 +00:00
Jacob Boerema
7a8f465b2d Issue #10588: enumerations for RotationType can't be used in Python
Due to GObject Introspection we can't have the last part of an
identifier start with a digit, since that part will be used in Python
as the identifier, and Python doesn't allow that to start with a digit.
e.g. GIMP_ROTATE_90 would be used in Python as
image.rotate(Gimp.RotationType.90)

To fix this we add DEGREES in front of the number, without a '_',
even though that looks ugly.
2024-01-05 13:28:49 -05:00
Sveinn í Felli
7e2a34bab8 Update Icelandic translation 2024-01-05 12:04:29 +00:00
Marco Ciampa
f9203e19bf Updated Italian translation (WIP) 2024-01-05 00:40:31 +01:00
Jacob Boerema
aeb1c726b9 libgimpbase: fix #10557 missing XMP namespace "Item"
With the sample image that contains the XMP namespace Item with the
correct url included, it is not returning the url when we ask for it.
This seems to be an exiv2 issue, but needs more research.

What GIMP doesn't do, is report that the namespace url we were looking
for wasn't found, and make sure that this doesn't block us from
handling all XMP tags.

To improve this on our end, we check if there was an error getting the
url, and if yes:
- We generate a warning message
- We create a dummy namespace url, with a special check for the missing
Item namespace to give it the correct known namespace url.
2024-01-04 15:24:30 -05:00
Martin
c4cf0af1da Update Slovenian translation 2024-01-04 19:58:03 +00:00
Martin
89ec688ad2 Update Slovenian translation 2024-01-04 19:56:36 +00:00
Martin
6b58329f86 Update Slovenian translation 2024-01-04 19:54:21 +00:00
Luming Zh
09f9af9a05 Update Chinese (China) translation 2024-01-04 18:11:22 +00:00
Alx Sa
f66c6e9681 python: Use theme colors for console font color
Previously, the console's font color was hardcoded to #006000.
This did not stand out well on darker theme.
This patch pulls the widget's foreground color from GtkStyleContext
to ensure it contrasts sufficiently with the console background color.
2024-01-04 17:51:02 +00:00
Sveinn í Felli
605acaa5f7 Update Icelandic translation 2024-01-04 17:42:59 +00:00
Sveinn í Felli
fbde793231 Update Icelandic translation 2024-01-03 17:58:37 +00:00
Alexandre Prokoudine
91c216d4ed Update Russian translation, part 4 of N 2024-01-03 01:27:11 +01:00
Alexandre Prokoudine
767f310e8a Update Russian translation, part 3 of N 2024-01-03 00:57:20 +01:00
Anders Jonsson
426f30cd84 Update Swedish translation 2024-01-02 21:08:23 +00:00
Luming Zh
a66f0769ca Update Chinese (China) translation 2024-01-02 20:32:07 +00:00
Sveinn í Felli
9e066feaa9 Update Icelandic translation 2024-01-02 18:22:44 +00:00
Sveinn í Felli
8bd67a2165 Update Icelandic translation 2024-01-02 18:17:28 +00:00
Alexandre Prokoudine
42971b5ffc Update Russian translation, part 2 of N 2024-01-02 15:39:21 +01:00
Bruno Lopes
d5f41b296b build/windows, data, extensions, plug-ins: Fix Build omissions
- Fix "no icons" errors generating loaders.cache with .cmd (CI-Cross).
  ! This is a sub-optimal fix, but it's better than a useless build.

- Fix "no interpreter" errors generating .interp with Meson (CI-Native)
  and generating .interp and copying .typelib with .cmd (Local-Native).
  ! This is a sub-optimal fix to Local-Native, but plug-ins will work.

- Fix "no iso" error copying iso_639.xml with Meson (Local-Native).
2024-01-02 10:49:31 +00:00
Bruno Lopes
9af3579f63 build/windows, devel-docs: Make Installer stuff human readable and less hardcoded
The Inno installer scripts contents (only 3 files: files, gimp3264 and
32on64) and filenames have been organized, making them much easier to
read, and slightly less hardcoded so less prone to being misunderstood
and pervasively receiving packaging stuff.
Just to be clear, one more time: the Inno installer (or future MSIX)
scripts never should be the center of attention. This "installcentrism"
caused a domino effect of partially "abandoning" the packaging, build.sh
and the meson scripts, which explains the existence of this MR...

(Some things still hardcoded since wildcards in Inno are very limited.
Also, the rational ordering principles of this MR were not applied since
these scripts are heavily based on the x86 .zip package and changing the
order of things here, according to my tests, breaks things quite easily)
2024-01-02 10:49:31 +00:00
Bruno Lopes
af79bbe028 gitlab-ci, build/windows: Make Packaging scripts compatible with CI-Cross job
The CI crossbuild job now use the same main script (and the same
sub-scripts of linking and debug generation) of the native CI for
packaging. These unified scripts greatly facilitates maintenance.

The crossbuild deps script is now more consistent in relation to the
native one. As this is polished, the cross one is now polished too.

A crossroad gimp build script was created with a more clear code.

Also, finally make the script for packaging only, removing build step
stuff that shoudn't be here (glib-schemas generation) since this causes
disparity with the Local native build; and adding some packaging
decisions that shoudn't be in the installer scripts (eg. specific
folders of ghostscript, glib; no share/themes), which also facillitates
INNO (and future MSIX) maintenance.
2024-01-02 10:49:31 +00:00
Bruno Lopes
8b9aa1e7ca gitlab-ci, build/windows: Make Build script compatible with Local-Native build
The local builds now can use the same script of CI for sake of time.
The compatibility layer is very simple and makes the script more
used/tested, therefore more reliable.
2024-01-02 10:49:31 +00:00
Bruno Lopes
5ecf228019 gitlab-ci, build/windows: Make Deps script compatible with Local-Native build
The local builds now can use the same script of CI for sake of time.
The compatibility layer is very simple and makes the script more
used/tested, therefore more reliable.

Also, remove some redundacy on the code for better maintenance.
2024-01-02 10:49:31 +00:00
Bruno Lopes
637c49b30f build/windows: Add Dependencies list compatible with all jobs
Now, we have only ONE list applicable for build-deps-crossroad.sh,
build-gimp-msys2.sh and package-gimp-msys2.sh, instead of hardcoding
3 times. This unified list greatly facilitates maintenance.
2024-01-02 10:49:31 +00:00
Bruno Lopes
271ba85770 gitlab-ci, build/windows: Unify CI jobs wording
Debian changes:
- Since autotools has gone, we don't need to specify 'meson' in the
debian job and others.
- The "INSTALL_PREFIX" was renamed for the more usual "GIMP_PREFIX" and
the meson sintax of Debian jobs was also updated.

Windows changes:
- Then, clarify that the win64-nightly and win32-nightly jobs are, in
fact, in the 'packaging' step, since we don't really "distribute" GIMP
in .zip and the commands are almost the same of the packaging .SH
script, without scripted optimizations for Inno Installer (or future
.MSIX), crucial for distribution.
- We don't need to specify "native" sufix in any build since they are
the rule and cross builds are the exception.

General changes:
- The job names was changed to be more consistent and in accordance
with the folders present in the artifacts.
- The 'nightly' sufix was removed from the Inno Windows Installer job
and others, since this doesn't reflect the real build frequency.
- The scripts filenames are altered to stay "in order". This is not
essential but ultra convenient since it is easy to view and search.
(The -uni suffix is explained in a further commit)
- All artifacts names now have the commit to avoid apparently duplicate
files when downloading same step artifacts from different projects.
- Finally, rearrange the order of jobs rationally: first the OSes and
archs (from the most free and modern to the most closed and legacy),
then the stages (from 'prepare' to 'analysis'), ending with the
frequency of jobs (from the most frequent, called at each push, to
the least/weekly).

Overall, this changes, although difficult to review at the first
sight, will avoid in the future quite "dumb" issues like:
GNOME/gimp#10195
2024-01-02 10:49:31 +00:00
Yuri Chornoivan
5903426e81 Update Ukrainian translation 2024-01-02 07:30:23 +00:00
Yuri Chornoivan
8f11b02ac2 Update Ukrainian translation 2024-01-02 07:28:46 +00:00
Anders Jonsson
a4d309c7f7 plug-ins: more consistent ellipsis usage 2024-01-02 03:43:34 +00:00
Alexandre Prokoudine
829fa62163 Update Russian translation, part 1 oof N 2024-01-01 23:16:17 +01:00
Luca Bacci
0532e1b0ea GimpPopup: Ignore grabs from windows / menus shown by internal widgets
Fixes https://gitlab.gnome.org/GNOME/gimp/-/issues/6989
2023-12-31 18:07:25 +01:00
Anders Jonsson
e4e3dcca6b plug-ins: readd translation context for tag values
Originally added in 55aa462faa
2023-12-31 13:14:00 +00:00
Jehan
6fc468e7a4 desktop: prepare GIMP 2.99.18 AppStream release notes. 2023-12-31 17:08:31 +09:00
Anders Jonsson
06b638bdca Update Swedish translation 2023-12-30 14:17:17 +00:00
Jordi Mas
06df0fca10 Update Catalan translation 2023-12-30 14:12:01 +01:00
Anders Jonsson
e3b353f952 Update Swedish translation 2023-12-29 23:48:27 +00:00
Luming Zh
6838b05ac1 Update Chinese (China) translation 2023-12-29 21:07:39 +00:00
Alx Sa
d120e592d8 core: Fix crash when cutting/pasting single layer
When cutting and pasting a single layer,
drawables->data might be empty. This results in a
crash on Windows and a failure to paste on Linux.
Since this function is inside an IF statement that already
confirms it has a valid image, the base type and
precision are retrieved from there instead.
2023-12-29 10:27:27 -05:00
Alx Sa
a331e91309 plug-ins: Fix Fractal Explorer blue inversion
Resolves #10537.

During the port, the "green_invert" variable
was repeated twice rather than using the
"blue_invert" variable. This prevented the
fractal from updating when blue was changed.
2023-12-28 22:59:46 +00:00
Alx Sa
0351f48dfe themes: Defining menu, tab, and tooltip styles
This is intended to prevent system theme background-images
and borders from overriding those set by GIMP.
The minimum size of tabs is also explicitly defined.
2023-12-28 16:47:10 +00:00
Rodrigo Lledó
1f0b74d85f Update Spanish translation 2023-12-27 19:49:00 +00:00
Rodrigo Lledó
9c1e423c3f Update Spanish translation 2023-12-27 19:46:49 +00:00
Rodrigo Lledó
9d9371eede Update Spanish translation 2023-12-27 19:05:59 +00:00
Anders Jonsson
965b27fd81 Update Swedish translation 2023-12-27 16:17:46 +00:00
Anders Jonsson
9f842cbe99 Update Swedish translation 2023-12-27 16:15:08 +00:00
Yuri Chornoivan
6f84b6babc Update Ukrainian translation 2023-12-27 07:45:20 +00:00
Asier Sarasua Garmendia
7fa9d2de9b Update Basque translation 2023-12-27 07:34:57 +00:00
Alan Mortensen
6abdc0bbab Update Danish translation 2023-12-27 07:18:50 +00:00
Anders Jonsson
e762b49523 app: make colorbutton tooltips translatable 2023-12-26 22:07:37 +00:00
Martin
43cc6fc4c9 Update Slovenian translation 2023-12-26 17:13:04 +00:00
Jacob Boerema
ec2ee8fe91 plug-ins: fix #10498 Incorrect layer order when loading certain PSD's
Our handling of Photoshop's Blend Clipped Layers as Group is flawed
causing the order of layers to be messed up which may cause certain
parts of the image to become invisible or having the wrong colors.

This only fixes the incorrect layer ordering. Correct handling of
group layers with clipping needs a more extensive rewrite.
2023-12-26 11:39:49 -05:00
Jacob Boerema
2945fa6db2 plug-ins: more detailed PSD export compatibility notice
Follow up to the previous commit, we clarify the compatibility issue
between using legacy layer modes and Clip to Backdrop.
2023-12-26 11:39:48 -05:00
Jacob Boerema
f8bdca24aa Revert plug-ins: fix bad parsing of PSD blending modes
This is a manual revert of eac1df4b61
since other changes were made to the same lines.

Although using legacy layer modes for several blend modes improves
compatibility with Photoshop, we found out during testing of the
image from issue #10498, that it negatively impacts loading of PSD's
that use Blend Clipped Layers as Group.
We convert this specific PSD setting by adding a layer group and
setting Composite Mode to Blend to Background.
However, our legacy layer modes do not support Composite Mode, meaning
that PSD's using this can show up using smeared colors.

Since this hasn't been in a release yet, let's revert this and rethink
how we want to handle the combination of these PSD settings.
2023-12-26 11:39:48 -05:00
Asier Sarasua Garmendia
051f443f1f Update Basque translation 2023-12-24 09:22:22 +00:00
Ngọc Quân Trần
6dfc12ea36 Update Vietnamese translation 2023-12-24 08:29:30 +00:00
Ngọc Quân Trần
af6a1dd1db Update Vietnamese translation 2023-12-24 08:28:49 +00:00
Ngọc Quân Trần
ab33412f3e Update Vietnamese translation 2023-12-24 08:27:41 +00:00
Ngọc Quân Trần
f5f8dace6e Update Vietnamese translation 2023-12-24 08:25:21 +00:00
Alx Sa
dd10433c37 plug-ins: Fix indexed transparent PNG export
Resolves #9933.

We used png_get_valid (pp, info, PNG_INFO_tRNS) to check if
an indexed PNG had transparency when exporting.
However, this function does not return TRUE/FALSE but instead
the contents of that PNG chunk. Since we use index 0 for transparency,
this function always returns 0. The non-transparent indexed export code
ran regardless, creating incorrect PNGs.
We set pngg.has_trns earlier if the image has transparency, so it's safer
to use this variable instead.
2023-12-23 21:40:14 +00:00
bootchk
11b7e4cded Fix #10511 ScriptFu CRITICAL on scripts with no dialog, e.g. Reverse Layers
Magic number 1 changed to 2 in one place. Missed in earlier fix for #10127.

Changed magic number to a defined macro constant so it might not happen again,
should GimpConfig change again.
2023-12-22 09:43:01 -05:00
Jürgen Benvenuti
60f8e47176 Update German translation 2023-12-22 13:31:39 +00:00
Martin
73b571165f Update Slovenian translation 2023-12-21 22:33:02 +00:00
Martin
d16cdddbdd Update Slovenian translation 2023-12-21 22:14:46 +00:00
Yuri Chornoivan
fa631e76fb Update Ukrainian translation 2023-12-21 16:23:43 +00:00
Yuri Chornoivan
1236c10e4a Update Ukrainian translation 2023-12-21 15:54:51 +00:00
Luming Zh
c100b5313c Update Chinese (China) translation 2023-12-20 20:46:00 +00:00
Kolbjørn Stuestøl
e7b84bdc70 Update Norwegian Nynorsk translation
(cherry picked from commit 1be85b7fc9)
2023-12-20 20:25:09 +00:00
Kolbjørn Stuestøl
f57219b2d1 Update Norwegian Nynorsk translation 2023-12-20 20:23:34 +00:00
bootchk
507cbdc44a Fix #10508 ScriptFu CRITICAL on invalid resource ID
Add test case test/PDB/resource.scm
2023-12-20 12:50:02 +00:00
Alexander Shopov
990b0a2757 Update Bulgarian translation 2023-12-20 11:38:56 +00:00
Alexander Shopov
c40bedd1dd Update Bulgarian translation 2023-12-20 11:20:54 +00:00
Ekaterine Papava
3c46a0bb5e Update Georgian translation 2023-12-20 03:45:25 +00:00
Ekaterine Papava
f571eca749 Update Georgian translation 2023-12-20 03:41:53 +00:00
Ekaterine Papava
05d8ddfbb4 Update Georgian translation 2023-12-20 03:39:33 +00:00
bootchk
b1f2f71113 Fix #10465 ScriptFu marshal color strings correctly
Fix test case.
2023-12-19 18:40:48 +00:00
Anders Jonsson
37c971c08e app, plug-ins: make missing tooltips translatable 2023-12-19 17:56:30 +00:00
Anders Jonsson
02b970d6a9 app: make config labels translatable 2023-12-19 17:56:30 +00:00
Martin
0ae1b3dfc9 Update Slovenian translation 2023-12-19 17:10:43 +00:00
bootchk
555afe2058 Fix #10188 SF marshall array of super Item instead of subclass Drawable
Substantive change is call gimp_item_get_by_id instead of gimp_drawable...
And a few type changes from GimpDrawable* to GObject*.

Lots of renaming of functions, substituting "item" for "drawable."

Update comments.

Made one function static that was already private.

Fix the test case gimp_vectors_set_selected
2023-12-19 09:55:21 -05:00
bootchk
5486e4094a Enhance tests of PDB in ScriptFu
Add more tests

Enhance testing framework, add function assert-PDB-true

Enhance some tests: make test files order independent

Fix tests broken by recent changes to GIMP
2023-12-19 06:47:36 -05:00
Luming Zh
88b5269773 Update Chinese (China) translation 2023-12-18 17:34:07 +00:00
Luming Zh
b10b5a370d Update Chinese (China) translation 2023-12-18 17:31:35 +00:00
Luming Zh
f906f8274f Update Chinese (China) translation 2023-12-18 17:31:31 +00:00
Yuri Chornoivan
84a4d7eb13 Update Ukrainian translation 2023-12-17 10:21:32 +00:00
Yuri Chornoivan
5fb4b8496c Update Ukrainian translation 2023-12-17 10:10:46 +00:00
Ekaterine Papava
8dc3b774e6 Update Georgian translation 2023-12-17 08:51:17 +00:00
Anders Jonsson
88c7520451 ScriptFu: make default names translatable 2023-12-17 03:02:25 +00:00
Anders Jonsson
c64d59b80c plug-ins: make pdf export strings translatable 2023-12-17 03:02:25 +00:00
Yuri Chornoivan
9ee99db6a2 Update Ukrainian translation 2023-12-16 21:24:30 +00:00
Jehan
eb3b9aafec NEWS: update. 2023-12-16 20:59:51 +09:00
Jehan
7100851b5b Issue #10283: renaming generated "(Hardedge)" gradients as "(Hard Edge)".
There was the question on whether it needed an hyphen or not. The hyphen
naming was often used to describe the "Hard-edge painting" style, though
even for this, it was not an absolute case. Depending on English writing
style, we could also find "hard edge painting". Also Liam was noting
that when the term appears by itself, as a noun (rather than a
qualificative), it was likely best without hyphen. So we went for the
no-hyphen wording.

Then there was the capitalization question: should capitalization rules
of data labels apply to parts between parentheses? I went with the
answer that *yes*, since it's part of the title anyway. And without the
part between parentheses, we'd have several data named the same. So it's
just as important.

As a consequence, I also re-capitalized "FG to BG (HSV
Counter-Clockwise)" and "FG to BG (HSV Clockwise Hue)" gradients,
following this updated rule.
2023-12-16 20:40:46 +09:00
Jehan
d4f8f553b2 data: consistent capitalization in gradients' names.
See comment by Jacob about the lack of consistency in some of the names
of default data.
2023-12-16 20:20:39 +09:00
Ekaterine Papava
c2984e9005 Update Georgian translation 2023-12-15 04:30:40 +00:00
Ekaterine Papava
48b2f1bfa2 Update Georgian translation 2023-12-15 04:22:59 +00:00
Alx Sa
820e96c67b Themes: Fix button shadow on dark theme hover
Resolves #10477.

The dark theme box-shadow for buttons does not blend well
when hovering over it, compared to the light & gray themes.
This patch adds an additional CSS rule to make the box-shadow
no longer clash in dark theme.
2023-12-14 19:39:54 +00:00
Jordi Mas
d9a2b7c272 Update Catalan translation 2023-12-14 15:57:05 +01:00
Alan Mortensen
610bd7b7a2 Update Danish translation 2023-12-14 12:05:43 +00:00
Alan Mortensen
87a3618acd Update Danish translation 2023-12-14 12:04:14 +00:00
Alan Mortensen
8e5bbd3456 Update Danish translation 2023-12-14 12:01:53 +00:00
Alan Mortensen
3dd88b385c Update Danish translation 2023-12-14 08:27:39 +00:00
Alan Mortensen
d594fcf4cd Update Danish translation 2023-12-14 08:09:12 +00:00
Martin
2992a7ffed Update Slovenian translation 2023-12-13 22:11:19 +00:00
Martin
e1a2fbdb94 Update Slovenian translation 2023-12-13 22:04:20 +00:00
Luming Zh
076229e53a Update Chinese (China) translation 2023-12-13 19:30:25 +00:00
Yuri Chornoivan
dc2f7bf64c Update Ukrainian translation 2023-12-13 18:56:06 +00:00
programmer_ceds
ff219fb0e2 Resize Canvas Problems (fixes issue #10225) 2023-12-13 18:31:38 +00:00
Yuri Chornoivan
9a6a26e70f Update Ukrainian translation 2023-12-13 18:02:50 +00:00
Bruno Lopes
276754e9fe plug-ins: update Compatibility Notice wording
Since we now have documented certainty which modes are compatible, the
Compatibility Notice should convey more reassurance.
2023-12-13 17:58:37 +00:00
Bruno Lopes
e494c2ea71 plug-ins: update the PSD table of inaccurate/non-exact modes
Some 2.10 modes, even in perceptual space, don't produce the same
result as PS. Now, the mapping table takes this into account, which
avoids surprises for the user.
2023-12-13 17:58:37 +00:00
Bruno Lopes
eac1df4b61 plug-ins: fix bad parsing of PSD blending modes
The mapping table was generically indicating 2.10 modes as first choice,
which was resulting in terrible PSD compatibility in some cases. This
commit fixes this using legacy modes verified with latest PS version
(see attached files in MR).
2023-12-13 17:58:37 +00:00
Anders Jonsson
bdf0d88456 app, plug-ins: mark missing strings as translatable 2023-12-13 17:44:35 +00:00
Yuri Chornoivan
9fa31f467b Update Ukrainian translation 2023-12-13 17:44:06 +00:00
Alan Mortensen
c05b67c9aa Update Danish translation 2023-12-13 09:30:16 +00:00
Sabri Ünal
f43398c090 DOAP: Replace defunct mailing list
Corresponding URL seems to be redirected to a new URL.
2023-12-13 10:16:27 +03:00
Stayd
594afaf900 plug-ins: DDS import rewrite
Comprehensive rewrite of the DDS import routine, in the interest of
easier maintainability and readability. Adds formats.c/h, containing
tables and functions related to reading and parsing uncompressed files.
Importer now supports nearly all non-video uncompressed formats.

Includes a variety of minor-to-moderate fixes made along the way
which could not be pulled out into separate commits due to dependence
on other aspects of the rewrite.
2023-12-13 03:30:48 +00:00
Stayd
829a92d62e plug-ins: Update dds.h and add known format codes
Minor cleanup and updating of types to GIMP types.
Addition of more known DXGI format codes, and one flag used by NVTT.
2023-12-13 03:30:48 +00:00
Rodrigo Lledó
b2551d7ccf Update Spanish translation 2023-12-12 13:41:43 +00:00
Yuri Chornoivan
65893eb150 Update Ukrainian translation 2023-12-11 22:01:44 +00:00
Martin
6e6c81572a Update Slovenian translation 2023-12-11 19:16:57 +00:00
bootchk
77c12a205b Add tests of PDB procedures gimp-image-set-selected-layer etc. 2023-12-11 18:42:59 +00:00
bootchk
1ccceccb01 Fix #10460 2023-12-11 15:09:07 +00:00
Alexander Shopov
59e1f6dc4c Update Bulgarian translation 2023-12-11 09:53:40 +00:00
Anders Jonsson
dbfd506df4 plug-ins: string fixes for lighting plug-in 2023-12-10 21:39:13 +01:00
Alx Sa
e317166c98 plug-ins: Fix defaults of secondary light points
Resolves #10454.
When porting to GimpProcedureConfig, all
light types were set to "Point" when 2 - 6
should have been "None" by default.
This patch fixes the defaults.
2023-12-10 14:57:56 +00:00
bootchk
dd2d0c96bf Fix a test plugin.
1. Recent changes to arg validation reveal bug in call to gimp-drawable-edit-gradient-fill,
supersampling arg must be >0

2. Make easier for testers to invoke by reducing the declared drawable capability
to SF-ONE-OR-MORE-DRAWABLE
2023-12-10 06:03:15 -05:00
Alexander Shopov
80908bfd4f Update Bulgarian translation 2023-12-10 09:55:23 +00:00
Alexander Shopov
a3ff7e7f92 Update Bulgarian translation 2023-12-10 09:31:36 +00:00
Anders Jonsson
30db768764 Update Swedish translation 2023-12-10 00:40:14 +00:00
Martin
8234069f1a Update Slovenian translation 2023-12-09 21:16:20 +00:00
Ekaterine Papava
936dbbf947 Update Georgian translation 2023-12-09 20:06:35 +00:00
bootchk
4d4639b8f3 Fix scripts calling obsolete gimp-brush-delete
Now use gimp-resource-delete

Drive-by fix of bad call to gimp-context-set-pattern.

Fixes other calls to gimp-font-delete, etc. in a test script.

Partly fixes 9867.
2023-12-09 11:23:58 -05:00
Jacob Boerema
1add942fa6 app: fix #10349 Stroke Path on 2.99.16+ doesn't work reliably
Due to a bug in commit de5c805cbb, which
changed the choice widget between line and paint tool to a
GtkStackSwitcher, changing that choice did not work anymore.

The reason being that the stroke method wasn't being updated on clicking
stroke. We fix this by setting the stroke method when OK is clicked.

When creating the dialog we also set the stroke method, to reflect the
last used choice, since that was also missing.
2023-12-08 16:03:28 -05:00
Yuri Chornoivan
c649295f5b Update Ukrainian translation 2023-12-08 18:11:04 +00:00
Rodrigo Lledó
ecdda05905 Update Spanish translation 2023-12-08 17:55:06 +00:00
Jehan
6d2863eaf3 app: make the Pad Actions frame insensitive with tooltip on X11.
See discussion in !946: https://gitlab.gnome.org/GNOME/gimp/-/merge_requests/946#note_1768869

On Windows/macOS, the pad device is probably not even showing at all
right now, though I can't test. Also it could be eventually implemented
with pad actions support (see Luca Bacci comment in the same MR) using
WM_POINTER API on Windows.

On X11 though, the pad device is shown, except it is kind of pointless.
So I am disabling the frame (making it insensitive) and add a tooltip.
2023-12-08 22:46:32 +09:00
Carlos Garnacho
058c19e5ac widgets: Make GimpDoubleAction friendlier to GtkPadController
Handle some statefulness in actions taking a double parameter, in order
to make them friendly to GtkPadController and its pad ring/strip
integration.

The GtkPadController emits those actions with a double parameter
expressing the absolute value (e.g. 0-360 for rings, 0-1 for strips),
take care of converting these absolute values to relative changes
that increase/decrease the current GimpDoubleAction value.

Going for relative increments/decrements increases the genericity
of rings when mapped to actions, as going with the given absolute
values would mean means rings could be mainly mapped to angle-like
actions, reducing its usefulness.
2023-12-08 12:35:34 +00:00
Carlos Garnacho
0c3713b467 display: Hook pad controllers into GimpImageWindow
We have everything in place to create GtkPadControllers converting
events into actions as configured in settings, and the signaling
to trigger the (re)generation of those as device, window or configuration
changes appear.

Only the last bit attaching those controllers to actually handle
input was missing, now done in this commit.

Since there may be multiple configured tablets and pads, we need to
keep track of per-device controllers to handle the configuration for
those. This mapping is kept in GimpImageWindow as the "main" toplevel
(i.e. the one(s) typically considered "keyboard focus" and receiving pad
events) and ensured to be kept up-to-date through the ::configure-pad
signal.
2023-12-08 12:35:34 +00:00
Carlos Garnacho
02eea132c2 widgets: Add GimpDeviceInfo API to generate a GtkPadController
This API call will snapshot the current configuration of a device
into a GtkPadController, that is created and attached to a toplevel
(this event controller only acts on toplevels).

This controller will handle pad events, trigger actions, and update
compositor feedback (e.g. GNOME Shell pad OSD) as per the actions
mapped in the configuration dialog.
2023-12-08 12:35:34 +00:00
Carlos Garnacho
6ca6f87c16 widgets: Hook ::configure-pad signal emission to configuration changes
If a pad device configuration gets changed, or reset, we should trigger
the creation of new pad controllers for the existing toplevels.

Add the plumbing so that saving/resetting a device configuration will
result in the same ::configure-pad signal, and trigger it from the
relevant places.
2023-12-08 12:35:34 +00:00
Carlos Garnacho
46d38827dd widgets: Add GimpDeviceManager signal to reconfigure pad devices
In order to apply the pad configuration so it does something, we
need to create GtkPadController objects on each toplevel for each
configured pad device.

This signal will work as a hint that a new GtkPadController should
be generated for the given device and current configuration. At
the moment, emit it when pad devices are added or removed.
2023-12-08 12:35:34 +00:00
Carlos Garnacho
f66977beb5 widgets: Monitor all devices (not just pointing) in device manager
Since pads are not pointing devices, this is necessary to let pads
known to the configuration dialog.
2023-12-08 12:35:34 +00:00
Carlos Garnacho
224566bb84 widgets: Detect disconnected pads as pads in GimpDeviceInfo
Return a suitable GdkInputSource for those configured pads, so that
they show up as pads in configuration even if disconnected.
2023-12-08 12:35:34 +00:00
Carlos Garnacho
573d2f5380 widgets: Add UI for pad configuration
The UI is heavily inspired in the existing one for midi devices
and the such, as the restrictions are somewhat similar. Since there
is not enough information to introspect the device without the help
of libwacom (and the UI should work with tablets unsupported by
it, regardless) the list starts empty, and there exists a "grab
event" button to press pad buttons (or use rings/strips) and
create/focus a list item for the button/mode.

Double clicking on an action (or pressing the "edit" button) spawns
a different dialog with a GimpActionEditor to select an action.
And lastly, actions can be deleted with the "delete" button.

Pads may have different modes (e.g. leds in the tablet) that apply
to all pad features, the list will allow different actions to be
set on the same button in different modes. This basically multiplies
the amount of mappable actions by the number of available modes.
2023-12-08 12:35:34 +00:00
Carlos Garnacho
8182f7d683 widgets: Add pad configuration to GimpDeviceInfo
Add property/getters for the pad configuration, and hook it
up to the serialization mechanism, so pad configuration is part
of device configuration.
2023-12-08 12:35:34 +00:00
Carlos Garnacho
2cfca9e90e core: Add GimpPadActions object
This object holds the mapping of pad device features (buttons/rings/strips)
to actions, given the current mode (e.g. leds in the device), and can be
serialized/deserialized from configuration files.
2023-12-08 12:35:34 +00:00
Jehan
d42508534d NEWS: update. 2023-12-08 21:34:27 +09:00
Jehan
10f86c69d1 libgimp: fixing annotations. 2023-12-08 21:18:03 +09:00
Jehan
78108cc3c8 pdb: getting rid of some warnings in a perl script.
Fixing:

> Scalar value @inargs[...] better written as $inargs[...] at pdb/lib.pl line 247.
> Scalar value @outargs[...] better written as $outargs[...] at pdb/lib.pl line 386.
2023-12-08 20:58:59 +09:00
Idriss Fekir
e8ad8af0f7 Fix fonts when exporting to pdf 2023-12-08 11:09:22 +00:00
Martin
588c98eb3f Update Slovenian translation 2023-12-07 22:17:21 +00:00
Anders Jonsson
f388258c41 Update Swedish translation 2023-12-07 20:43:55 +00:00
Rodrigo Lledó
545ef24aa4 Update Spanish translation 2023-12-07 20:43:47 +00:00
Alan Mortensen
5df595ef33 Update Danish translation 2023-12-06 07:29:16 +00:00
Rodrigo Lledó
a5232405f0 Update Spanish translation 2023-12-05 15:30:48 +00:00
Víttor Paulo Vieira da Costa
9700d51c25 Update Brazilian Portuguese translation 2023-12-05 12:49:07 +00:00
Jacob Boerema
adb8f9dcbf plug-ins: fix #10429 Online help not opening
We were using an incorrect parameter name for calling the online help.
Instead of domain-names it is url.
2023-12-03 10:12:55 -05:00
Alan Mortensen
d04e4a0b74 Update Danish translation 2023-12-03 14:28:19 +00:00
Alx Sa
3c261a2334 themes: Define button and header edges
This continues the theme definition work from bd398d5c.
A new edge-border-color tag was created
to allow for defined widget edges in both
light and dark themes.
The box-shadow highlights for buttons
and header/menubars was defined to
reduce system theme leaks. Some CSS
attributes were rearranges as well.
2023-12-02 18:57:20 +00:00
Luming Zh
bd0dc645a5 Update Chinese (China) translation 2023-12-02 16:16:30 +00:00
Yuri Chornoivan
245e46f1cf Update Ukrainian translation 2023-12-02 15:31:51 +00:00
Martin
58001b93c8 Update Slovenian translation 2023-12-02 07:59:22 +00:00
Ekaterine Papava
4031b854c0 Update Georgian translation 2023-12-01 22:45:22 +00:00
bootchk
86921b45f4 Fix #9317
Also revise annotation 0=>%NULL and other wording changes.
2023-12-01 21:55:36 +00:00
bootchk
c2bdf418f6 libgimp API: vectors.pdb remove trailing whitespace
Since most editors do that on save anyway.

No functional change.
2023-12-01 21:55:36 +00:00
bootchk
5a2c725bbb app/vectors : fix annotations on gimp_vectors_export_foo
Better describe what the functions do.

Also rename a variable vectors->path_list,
since the variable is type list of path.

No functional changes!!!
2023-12-01 21:55:36 +00:00
Stayd
b8834a9596 Always interpret BC1 cutout pixels as black
Per the official format specification and hardware implementation,
BC1 cutout pixels are always black with 0 alpha, whereas previous
versions of the plugin interpreted them as white. Commit f97e718e
partially fixed this, but made the behavior an import option that
also ignored the alpha component. This commit reverts the addition
of this option in favor of consistently following the spec.
2023-12-01 20:42:16 +00:00
Stayd
eb5a9576c6 Updated save-type and mipmaps props to GimpChoice
The export properties "save-type" and "mipmaps" were left as ints
in Commit 427130be due to uncertainty on whether options could be
conditionally disabled on GimpChoice properties. From testing it
this functionality appears to work fine and is used in other plugins.
Now all combo props are GimpChoices and fully configurable from dds.c
2023-12-01 20:42:16 +00:00
Stayd
a5d1d96a38 Consolidate YCoCg/AlphaExp code, always decode
Moves most of the code relating to YCoCg and Alpha Exponent into
misc.c/h, in the interest of making the rest of the codebase cleaner.
Removes the decode option from the import menu, as encoded files are
always decoded now (there used to be a menu button for doing this
after import, but with it gone there's no reason ever to not decode).
Finally, the remaining functions in color.c were only ever called once,
so these were extracted and inlined, and the empty file deleted.
2023-12-01 20:42:16 +00:00
Stayd
30922cc266 Better handling of DX10+ files in ddsread
Partial refactor of parts of ddsread to better handle DX10+ files.
Though not included here, this is necessary to import formats that
have no DX9 equivalent, namely BC6H and BC7, as the current handling
simply downgrades DX10 files and imports them like DX9 ones.
2023-12-01 20:42:16 +00:00
Stayd
e9c301cb37 ddsread and ddswrite cleanup and commenting
Extensive formatting and cleanup in the read-write files, and addition
of some comments where they seemed appropriate. Renamed a couple of
single-letter variables to be more descriptive.
Also removed an unnecessary global variable in ddswrite.c, and made
the "config" variable in ddsread a GimpProcedureConfig type, as was
previously done for ddswrite.
2023-12-01 20:42:16 +00:00
Stayd
4eea8ab42e Mipmap generation fixes and cleanup
Fixes two major issues with mipmap generation, namely sRGB transforms
being applied both backwards and in 8-bit precision, causing severe
color degradation. sRGB transforms are now handled correctly and all
mipmap generation is done at 32-bit floating-point precision.
A new cubic filter has also been added (Catmull-Rom) which rounds-out
the existing lineup of cubic filters.

Also includes extensive code cleanup (sorry I couldn't separate this)
to mipmap.c/h and color.c/h
2023-12-01 20:42:16 +00:00
Jacob Boerema
c2ecf37923 script-fu: fix #10279 gimp-image-set-selected-layers is failing
Recently some extra input validation was added, which caused the
gimp-image-set-selected-layers command in script-fu to fail with an
invalid value for argument 2.

This is caused by the object array contents always being set as
GIMP_TYPE_DRAWABLE, while the actual type may be a layer, etc.

So, let's set the actual type of drawable being used here by using
G_OBJECT_TYPE on the first data element.
2023-12-01 15:28:57 -05:00
Alx Sa
bd398d5cff themes: Define some widget's border colors
Adds specific definitions for some widget borders that
are currently only defined by the system. This avoids
clashing colors depending on the system theme.
2023-12-01 17:09:35 +00:00
Víttor Paulo Vieira da Costa
3229ba3c3e Update Brazilian Portuguese translation 2023-12-01 14:52:03 +00:00
Andre Klapper
2eab9b31e5 Fix invalid markup in Belarusian translation 2023-12-01 13:56:55 +01:00
Vasil Pupkin
71a9f3f157 Update Belarusian translation 2023-11-30 00:41:24 +00:00
Alx Sa
75c78bf19c themes: Define border-radius for radio buttons
Resolves #10033

Not all system themes set a GtkRadioButton border-radius, so it
can default to 0. This creates a "box" around the radio button.
This patch defines the border-radius at 100% to make it universal.
2023-11-29 12:03:39 +00:00
Jacob Boerema
6cca73516a libgimpconfig: fix #10278 Script-Fu API display commands are failing
on input arguments

This is the same issue as #10194 but for GimpDisplay. We fix it in
the same manner.
2023-11-28 15:38:47 -05:00
Jacob Boerema
ec999ee193 plug-ins: make metadata-editor/viewer use gimp_image_procedure_new
These were using gimp_procedure_new, which was causing warnings like
LibGimpConfig-WARNING **: 13:56:33.270: couldn't serialize property
 GimpProcedureConfig-plug-in-metadata-editor::image of type GimpImage,
and
gimp_plug_in_destroy_proxies: ERROR: GimpImage proxy with ID 1 was
refed by plug-in, it MUST NOT do that!

This also saves us from having to define image and run-mode parameters
ourselves.
2023-11-27 14:08:26 -05:00
Jacob Boerema
cc3f4c45c5 plug-ins, libscriptfu: silence warnings
We remove two warnings:
1. warning: format '%ld' expects argument of type 'long int', but
   argument 5 has type 'GType' {aka 'long long unsigned int'}
Since GType is gsize, and this is not used in translations, use format
specifier G_GSIZE_FORMAT.

2. warning: enumeration value 'SF_IMAGE' not handled in switch (and more
   similar ones).
Add a default block to let the compiler know we handle all values.
2023-11-27 13:10:22 -05:00
Luming Zh
3ab6451ff3 Update Chinese (China) translation 2023-11-27 15:48:45 +00:00
Rodrigo Lledó
e4b2ab7ff9 Update Spanish translation 2023-11-26 23:10:30 +00:00
Rodrigo Lledó
3dc44d8e21 Update Spanish translation 2023-11-26 22:57:05 +00:00
Yuri Chornoivan
49d1160e78 Update Ukrainian translation 2023-11-26 19:50:36 +00:00
Martin
87bd568696 Update Slovenian translation 2023-11-26 09:53:48 +00:00
Ekaterine Papava
b243fdc10a Update Georgian translation 2023-11-26 08:32:08 +00:00
Jehan
ef8ddd7e30 app: rename the new gimp_drawable_*_undo() functions.
These are not generic undo function, but specific to the resize case (and even
more particularly when calling the GimpItem's resize() class method).

Also the variable was wrongly named no_undo when it actually was meant for the
opposite meaning, i.e. when we want to push an undo for a resize() call. This
made the call harder to understand. Furthermore the usage of double negation did
not help with understanding the code.
2023-11-25 21:43:08 +01:00
Jehan
aa7d7badc8 app: do not leave out-layer artefacts when canceling painting with layer expansion.
This is a fixup commit to MR !961, fixing a particular commit 5c2373a125 saying
that when canceling painting with layer expansion, strokes outside of the layer
remain visible.
2023-11-25 21:43:04 +01:00
Jehan
e495fe7ede app: fix 2 GeglBuffer leaks and a profile leak. 2023-11-25 21:38:10 +01:00
Shubham
2c00152ce2 app: Add pattern to context props for tools supporting auto-expand
When auto expanding layers, there is an option that allows user to fill
the newly expanded part with the pattern. But without this change, it
was not possible to change the active pattern without switching to some
other tool like bucket fill tool. This commit allows that.
2023-11-25 16:19:43 +00:00
Shubham
41e0151478 app: Make the layer auto expand options shared between tools
Also added option in Edit->Preferences->"Tool Options"->"Paint Options
Shared Between Tools" that decides weather the options should be shared
between different tools.
2023-11-25 16:19:43 +00:00
Shubham
5c2373a125 app: Cancel functionality works with dynamic layers
Canceling a paint stroke restores the layer and mask (if present) to the
original size if they were expanded during the stroke. The part of
stroke that is outside the layer remains visible though.
2023-11-25 16:19:43 +00:00
Shubham
d49fcf9495 app: Always separate blobs_to_render and last_blobs in ink tool
In ink tool, if last_blobs is empty, the copy of blobs present in
last_blobs and blobs_to_render was same. Due to this, when layer
boundary is expanded, we move same blobs twice. Due to this a straight
line was drawn when starting painting from outside layer boundary. Fixed
the issue by storing a duplicate version in blobs_to_render. Updated
free part accordingly.
2023-11-25 16:19:43 +00:00
Shubham
2a41fc7ee4 app: Blink lock when layer expansion is prevented by lock
In layer expansion if user is trying to draw outside the layer boundary
with expand option turned on but the "Lock position and size" enabled,
the lock square will be blinked. If user is painting on layer mask, the
corresponding layer's lock will be blinked. It will be blinked only
once per stroke.
2023-11-25 16:19:43 +00:00
Shubham
df9d1f54f8 app: Fix inefficient method of preventing pushing undo
When resizing drawable for dynamic layers, the resize drawable function
would push Modified Layer/Channel item to undo stack. Initially, I was
checking if the drawable is being painted upon and used it to disable
the undo, but this when using resizing layers with layer mask, even if
mask is being painted upon, we still want to resize the main layer and
vice versa. But the main layer is not being painted upon so it would
push the undo to stack. To prevent this, I was using
gimp_drawable_paint_start before resizing, but this method is very
inefficient, as this function duplicates buffers. So added a new member
to drawable->private that will store weather to push undo or not.
2023-11-25 16:19:43 +00:00
Shubham
6bfed5008f app: Add options to choose fill type of layer and mask when expanding
Added option to tool settings that will decide how newly created parts
of layer and layer mask should be filled. For layer, same options are
provided as present in "Set Layer Boundary Size" dialog. For layer mask,
first two options from "Add a Mask to the Layer" i.e. "White" and
"Black" are added.

This commit changes gimp_channel_resize function to actually use the
passed fill type instead of using hardcoded GIMP_FILL_TRANSPARENT.
Hardcoding this value if required should be done in function calling
this function (which is already the case with all the instances already
present afaik).
2023-11-25 16:19:43 +00:00
Shubham
8bfa22b663 app: gimp_gegl_buffer_resize function can accept pattern to fill buffer
Modified gimp_gegl_buffer_resize function to add three new parameters,
pattern, pattern_offset_x and pattern_offset_y. If pattern is not NULL,
then we set the pattern of buffet to this value. Like in
gimp_gegl_buffer_resize function, this logic is mostly copied from
gimp_drawable_fill_buffer function with minor changes.
2023-11-25 16:19:43 +00:00
Shubham
841a195bb5 app: Fix broken strokes with the ink tool 2023-11-25 16:19:43 +00:00
Shubham
9ccb027aaa app: Create gimp_gegl_buffer_resize function
This function returns resized version of the input buffer. It also takes
in a color argument. The layer background will be filled with this
color. Fill background logic is similar to gimp_drawable_fill_buffer.
2023-11-25 16:19:43 +00:00
Shubham
5ed04055f1 app: check for lock_position of layer when editing its mask
The lock in the layers tab only sets lock for the actual layer and not
for its mask, so also check the lock on the actual layer and not just on
the mask when editing layer mask.
2023-11-25 16:19:43 +00:00
Shubham
5b8f410342 app: Fix layer expansion using MyPaint Brush tool with symmetry enabled 2023-11-25 16:19:43 +00:00
Shubham
960eaf0bc9 app: Ensure undo everytime layer expands while painting
Everytime the layer expands, if the undo extents are empty, then make
them non zero. If the undo extents are zero, then user will not be able
to undo the expansion of the layer. This is perticularly required by
MyPaintBrush as just clicking the image without any motion does not draw
anything, but expands layer if required.
2023-11-25 16:19:43 +00:00
Shubham
b291a32a24 app: Layer expansion with MyPaintBrush now works.
Added tool option like other tools.
2023-11-25 16:19:43 +00:00
Shubham
5fdee7c5e7 app: gimp_paint_core_expand_drawable will return boolean
This function returns TRUE if the drawable is expanded. Otherwise, it
will return FALSE. This removes the need to check width and height of
the drawable to infer the same.
2023-11-25 16:19:43 +00:00
Shubham
95f795008f app: Make image flush related functions idle
Made `gimp_image_editor_image_flush` and
`gimp_image_editor_image_flush_idle` functions idle. For expanding
layers dynamically, we need to use gimp_image_flush funtion from the
paint therad. The gimp_image_flush eventually calls these functions.
2023-11-25 16:19:43 +00:00
Shubham
3ccec0b128 app: Layer expansion while painting now works with layers with mask
When painting the layers with a layer mask, if the layer need to be
expanded, the layer mask is also expanded with it. The same is done even
if layer mask is being painted upon.

Undo works with these layers by adding resizing of both the layer and
mask to the undo group if the layer is resized during painting.
2023-11-25 16:19:43 +00:00
Shubham
5191c17fb7 app: Fix layer expansion while painting with symmetry enabled 2023-11-25 16:19:43 +00:00
Shubham
e33618a650 app: Layer expansion while using ink tool
Now layers will expand when trying to draw beyond layer borders with ink tool.
Tool options similar to paint tools have been added (expand_use and
expand_amount).
2023-11-25 16:19:43 +00:00
Shubham
97a2627867 app: Do not expand beyond image borders while painting
When painting with "Expand Layers" option turned on but "show all"
turned off, layer will not expand beyond image borders.

Layer will not expand if "Lock size and postion" is turned on.
2023-11-25 16:19:43 +00:00
Shubham
4a953e5b59 app: Separate function for layer expansion while painting
Created a separate function gimp_paint_core_expand_drawable that handles
layer expansion while painting. The gimp_brush_core_get_buffer function
now uses this function to expand drawable. It has been separated so that
it can be reused for ink tool.
2023-11-25 16:19:43 +00:00
Shubham
9707a87488 app: Add options for tools which make layers expand
Added a checkbox that decides weather tool should expand layer when
crossing layer border and a scale that decides by what amount should
layer expand.
2023-11-25 16:19:43 +00:00
Shubham
becb23c926 app: Make undo work when layers are expanded during painting
Undo now restores layer to original size if it was expanded while
painting.
2023-11-25 16:19:43 +00:00
Shubham
ae7d37ebbd app: Make layers expand when painting with paintbrush tool
When painting with paintbrush tool, the borders of active layer will
automatically expand to accomodate the stroke. The undo does not work
with expanding layers.
2023-11-25 16:19:43 +00:00
Rodrigo Lledó
7201858d65 Update Spanish translation 2023-11-24 12:06:17 +00:00
Rodrigo Lledó
0fbab7f784 Update Spanish translation 2023-11-24 10:25:47 +00:00
Rodrigo Lledó
4510a830b0 Update Spanish translation 2023-11-24 09:19:11 +00:00
Alx Sa
62da36cd43 core: Better handle group endings in ASE palette import
This patch adds better handling for group begin and end markers
within ASE palettes. As a result, this fixes an issue where the last
color was not imported in some ASE files without groups.
Additionally, this guarantees that colors are imported using 4 bytes
per https://gitlab.gnome.org/GNOME/gimp/-/issues/10359#note_1921462
2023-11-24 06:08:09 +00:00
Vasil Pupkin
95d062d774 Update Belarusian translation 2023-11-23 23:46:28 +00:00
Sabri Ünal
333f1e1e5b Update Turkish translation 2023-11-23 17:08:40 +00:00
Anders Jonsson
7291a3553c Update Swedish translation 2023-11-23 14:52:23 +00:00
Martin
a8d589ec62 Update Slovenian translation 2023-11-23 08:07:19 +00:00
Ekaterine Papava
5794919aeb Update Georgian translation 2023-11-23 05:05:43 +00:00
Luming Zh
a5bace3513 Update Chinese (China) translation 2023-11-21 21:15:22 +00:00
Jehan
217fd3699f NEWS: update. 2023-11-21 14:28:57 +01:00
Yuri Chornoivan
f273cc93d4 Update Ukrainian translation 2023-11-21 07:11:17 +00:00
Daniel Novomeský
291208f4f9 build: associate hej2 extension in Windows installer 2023-11-20 20:18:37 +01:00
Daniel Novomeský
8bb34ac596 plug-ins: HEJ2 format loading
This image format is also called as JPEG-2000 in HEIF,
it is supported in recent versions of libheif.
Specification: https://www.itu.int/rec/T-REC-T.815-202106-I/en
2023-11-20 20:16:01 +01:00
Alx Sa
2c68021b54 core: Fix strict-aliasing error on ASE load
Resolves #10359

When compiled with -Werror=strict-aliasing, the build fails
on this line due to converting pointer datatypes.
This patch switches to using memcpy () instead.
2023-11-19 13:53:18 +00:00
Jordi Mas
ef65db052f Update Catalan translation 2023-11-19 09:53:17 +01:00
Alx Sa
b907e5efbe plug-ins: Import/export safe-to-copy PNG chunks
Currently we only use and retain "critical" PNG chunks,
discarding any safe-to-copy but non-image chunks.
This adds code to store them as parasites and then
include them on export, thus preventing loss of data.
2023-11-19 04:13:39 +00:00
Alx Sa
5e076c2803 plug-ins: Add loop count to GIF parasite
In ccd12318, the parasite to remember if the GIF was an animation
did not actually store the number of loops. This patch fixes that.
2023-11-17 21:07:05 +00:00
Martin
27e13924ea Update Slovenian translation 2023-11-17 09:29:14 +00:00
Jacob Boerema
10492830a8 plug-ins: fix GError set over the top of a previous GError ...
when loading a BMP image with an invalid compression value.

The invalid compression check was missing a goto out (error exit)
causing the GError to be overwritten, which caused a GLib warning.
We add the missing goto statement here.
2023-11-16 19:12:48 -05:00
Bruno Lopes
fd6d404698 Issue #8877: Package 'gdbus' on Windows to fix warnings 2023-11-14 08:19:49 -03:00
Martin
3bdeeb9739 Update Slovenian translation 2023-11-13 14:39:32 +00:00
Martin
bf381d7ad5 Update Slovenian translation 2023-11-13 14:27:35 +00:00
Luming Zh
104f4e272d Update Chinese (China) translation 2023-11-12 14:44:18 +00:00
Alx Sa
ccd1231869 plug-ins: Save GIF animation when overwriting
Overwriting a GIF animation results in loss of frames if a previous export turned off
animations.
This sets a parasite on import which we check for on overwrite. If it was an
animation originally, we overwrite as an animation as well.
2023-11-12 12:10:34 +00:00
Luming Zh
7efd6421ba Update Chinese (China) translation 2023-11-12 00:57:22 +00:00
Ekaterine Papava
89df8aab1d Update Georgian translation 2023-11-11 20:07:23 +00:00
Jehan
24b36379f0 app: migrate shortcut from select-float to select-cut-float.
See my previous commit.
2023-11-11 20:03:26 +01:00
Yuri Chornoivan
5f4b25c857 Update Ukrainian translation 2023-11-11 16:55:49 +00:00
Yuri Chornoivan
d6d66c03df Update Ukrainian translation 2023-11-11 16:47:22 +00:00
Jehan
05b2f93876 Issue #10153: introducing new floating data actions.
Though we mostly removed floating layers/masks (formerly floating
selections) in many interactions, at least for default behaviors for
basic pastes, there are still advanced usage attached to this concept
and some advanced users are willing to have easier access to such items.

For this reason, this commit:

- adds edit-paste-float and edit-paste-float-in-place for pasting the
  contents of the clipboard as floating data with default positionning
  algorithm or in-place respectively;
- renames select-float to select-cut-float which does a cut and paste as
  float in one action;
- adds select-copy-float which does a copy and paste as float in one
  action;
- reorganize a bit the `Edit > Paste as` submenu with sections for the
  floating data variants;
- add a "Float" submenu in "Select" root menu, containing the 2 variant
  actions select-cut-float and select-copy-float.
2023-11-11 16:40:44 +01:00
Jacob Boerema
f97e718e7a plug-ins: issue #5556 Interpret transparency as black on DDS DXT1 textures
This adds an import option for DDS DXT1/BC1 images to always use
transparency. This is the default behavior, since this was what always
happened until now and it seems that DDPF_ALPHAPIXELS is very rarely
set for these type of images.

However, as the mentioned issues explains, advanced compression
algorithms can use this transparency data instead to mean a black
pixel. There is however, no certain way to determine this.

For that reason, we add an option here, that, if disabled, will
interpret fully transparent values as a black pixel.
2023-11-10 18:30:42 -05:00
Jacob Boerema
dd45e3b462 plug-ins: add option to vertically flip dds image on import
Some games apparently need dds images to be vertically flipped.
We already have an option to flip dds images on export, so it makes
sense to also allow flipping on import.
2023-11-10 18:30:41 -05:00
Alx Sa
efa1267f13 actions: Fix layer buttons relative to floating selections
The anchor and merge down buttons are visible at the same time, which should not be the case.
Their visibility is now dependent on the existance of a floating selection.
The New Group and Search/Link buttons are also disabled when there's a floating section.
2023-11-10 20:33:26 +00:00
Jehan
f12a88bd65 build: sync nightly flatpak manifest with beta one. 2023-11-10 20:33:10 +01:00
Jehan
5f03859abf desktop: syncing the AppData with gimp-2-10 one. 2023-11-10 16:02:33 +01:00
Jehan
59116d37f8 Issue #10023: don't use the selected text styling to display the selected items label.
The idea initially came from some styling in Thunderbird. It's not that useful anyway.
2023-11-10 15:28:16 +01:00
Jacob Boerema
f516ed6935 plug-ins: fix #8942 add DDS support for reading R8G8, R16 and R16G16 formats
In addition to the requested DXGI variants we also load the older
D3DF versions, including handling of the signed versions.

We also set signed when the pixelformat flag DDPF_BUMPDUDV (added in
the previous commit) is set.
2023-11-09 18:40:50 -05:00
Jacob Boerema
4e6e3202c8 plug-ins: add more complete list of DDS flags and pixelformat flags 2023-11-09 18:40:50 -05:00
Jehan
7f15251d2e Issue #10281: layer locks popup is not appearing. 2023-11-09 15:39:21 +01:00
Alx Sa
a8369f57c1 themes: Define more GimpSpinButton styling
As shown in issue 10287, the system theme can create a
large white border around GimpSpinButton.
This patch fixes this, and also improves the border appearance
by assigning it to the background color rather than system default.
2023-11-09 13:26:55 +00:00
Jordi Mas
68b79dea0d Fixes to Catalan translation 2023-11-08 07:33:19 +01:00
Luming Zh
7f0b24b46e Update Chinese (China) translation 2023-11-07 18:24:38 +00:00
Yuri Chornoivan
71925dc0aa Update Ukrainian translation 2023-11-06 21:47:25 +00:00
Jacob Boerema
ef3f464ad7 plug-ins: add support for loading DDS 16- and 32-bit per channel RGBA
This adds support for loading RGBA DDS images with 16- and 32-bit per
channel. Loading is supported for 16-bit half float, 32-bit float,
16 and 32-bit unsigned and signed int.

This supports both the DX10 formats and the D3D FOURCC versions.

16- and 32-bit per channel images with less than 4 channels are not
yet supported.
2023-11-06 16:29:22 -05:00
Alx Sa
ea7a29af45 Issue #10250: Enable "Layers as Pages" for single layer group in PDF export
When saving a PDF, you have the option to export layers as pages.
This works for a single layer group that contains multiple layers.
However, the option is disabled because the plug-in only checks
"top level" layers.
This patch adds code to check if the single layer is a layer group,
then enables the option if there are more than one layer in that group.
2023-11-06 20:56:33 +00:00
Daniel Novomeský
183cb49b1e plug-ins: load metadata via libheif and disable rotation dialog 2023-11-06 16:03:28 +01:00
Jehan
6b86bb72f0 README: some updates.
A link to the online documentation website is definitely needed in
there.

Also get rid of mentions of mailing lists as still active discussion
media.
2023-11-05 22:25:09 +01:00
Jehan
abf66dd66a plug-ins: prevent explicit http scheme to be automatically changed to https.
This completes commit 685c8bde99 where the http:// scheme was automatically
transformed into https:// in some cases, in particular while typing (when
pasting for instance, it was still possible to add an http URL). So let's block
"toggled" signal handlers when the URL is explicitely edited to prevent this
annoying issue.

(cherry picked from commit b991f8b361)
2023-11-05 21:58:18 +01:00
Jehan
eb7337d5e4 Issue #3247: make consistent generated brush preview.
This is only a temporary solution meant to be backported to gimp-2-10 branch,
so that at least the preview now matches how angles always worked in at least
the 2.10 series: angles are measured clockwise.

Now there is the question that in the documentation of the Brush Editor, it is
written that angles are supposed to be counter-clockwise. A solution was
proposed to make them so, but only for generated brushes (whereas angles stayed
clockwise for other types of brush) which is a very bad inconsistency.
Furthermore I find the whole tool options vs. brush editor settings mess quite
confusing. Some decision should be made for GIMP 3.

For GIMP 2.10 though, this should be an OK fix: no behavior change on-canvas,
only making the preview actually match what happens on-canvas (even though it
goes against what the docs say but it's probably better than breaking workflows
relying on actual on-canvas behavior).

Note: this commit is based on an initial proposition by Alx Sa in MR !1119,
except that the patch was only working when the preview needed to be scaled.
Instead we must go through this brush transformation code path for generated
brushes, whatever the scale.
2023-11-05 19:13:11 +01:00
Daniel Novomeský
d3d13c71f5 plug-ins: force metadata loading via libjxl
While exiv2/gexiv2 could be able to load metadata from JXL files
directly, success is not guaranteed (depends on version and
configuration, for example support could be disabled or compressed
metadata could not work).
Loading metadata via libjxl should work all the time.
It is also important not to display dialog to rotate the image
according the orientation from EXIF, because in case of JXL,
the orientation is stored in codestream and it has priority.
2023-11-04 20:34:01 +01:00
Jehan
ee9be210eb libgimpwidgets: get rid of build warning.
This fixes this warning (as appeared with commit ad8b47bff7):

[1/235] Compiling C object libgimpwidgets/libgimpwidgets-3.0.so.0.9900.17.p/gimpdialog.c.o
../../../../../../../dev/src/gimp/libgimpwidgets/gimpdialog.c:774:1: warning: ‘gimp_dialog_set_title_bar_theme’ defined but not used [-Wunused-function]
  774 | gimp_dialog_set_title_bar_theme (GtkWidget *dialog)

We could either put the whole `gimp_dialog_set_title_bar_theme()` declaration,
definition and usage into #ifdef, or only the implementation (making the
function a no-op on non-Windows platforms). I chose the former. There was some
discussion that maybe some implementation may happen later for other platforms,
but until then, no need to call it needlessly (even more as we don't know when
any theoretical other implementation would happen).
2023-11-03 15:31:51 +01:00
Jacob Boerema
1b258729c9 ci: Korean translation for the Windows installer was moved to Official
Also remove special handling of Hungarian since it is now part of an
official release.
2023-11-02 21:40:04 -04:00
Jacob Boerema
8cd97b90dd plug-ins, dds: always compute pitch_or_linsize ourselves
Certain dds images can have non-zero unexpected pitch_or_linsize values.
Until now we were only computing this ourselves in case it was zero.
Let's just always compute it and print an error to the terminal if it
differs from the value in the file.

A sample can be found in Galactic Civilizations 3: Bokeh_Hex.dds.
This change also allows us to safely load the poc in security issue
ZDI-CAN-22093 as that issue was apparently only caused by an invalid
value of pitch_or_linsize.
2023-11-02 15:21:23 -04:00
Jacob Boerema
c8a8d06cd8 plug-ins: move unchanging code out of the loop in dds load_layer
Optimize dds loading a bit by moving code that doesn't change outside
the loop:
1. The number of bits to be shifted when the source isn't exactly 8 or
16 bits depends on bytes per sample and isn't changing inside the loop.
2. Use rowstride variable to compute width * d->bpp once.
3. The check for rowstride > hdr->pitch_or_linsize doesn't change
inside the loop so move it out.

Inside the loop we only check the DDSD_PITCH flag once and move both
the size check and the fread check inside it.
2023-11-02 15:21:23 -04:00
Jehan
cc5636388f NEWS: update.
Remove several features which have been backported, hence will be first
available in GIMP 2.10.36 (soon to be released).
2023-11-02 20:15:57 +01:00
Alx Sa
b68a86e486 paint: Don't paint with gradient if dynamics not enabled
Resolves #10262.

The gradient color was being used if Confetti or Color from Gradient
dynamics had been set, even if dynamics had been disabled.
This adds an additional check to make sure dynamics are enabled
first - otherwise, the brush's existing stamp or color is used to paint.
2023-11-02 11:19:16 +00:00
Alx Sa
41872a5426 plug-ins: Fix broken macro for van-gogh-lic 2023-11-01 23:31:06 +00:00
Jacob Boerema
74adec7656 plug-ins: fix #10240 DDS saved as RGB10A2 loads incorrectly
There were 2 issues here:
1. When more than 8 bits per sample are used, a previous commit changed
it so that we would be using 16-bit integer mode instead of 8-bit.
However, the actual code for this specific format was not updated to
reflect that.
We fix this by computing 16-bits per channel values and upshifting the
10 and 2-bit samples to 16 bit per channel.

2. The computation of masks was incorrect. It computed each channel
mask separately, based on whether it was <= 8 or not.
However, if any channel needs more than 8 bits, all masks should be
computed 16 bits since we will then 16-bit integer mode.
We fix this by checking all channel bits together, and if any is higher
than 8, but not more than 16,  we use 16-bit masks.
I also took this opportunity to add support for 32-bit masks if we
ever need those.
2023-11-01 15:24:34 -04:00
Luming Zh
e3b2f40ac2 Update Chinese (China) translation 2023-11-01 13:11:30 +00:00
Alx Sa
035510d1ad plug-ins: Set pixel aspect ratio for IFF images
Based off code for GIFs in 22963405.
Code was also rearranged to check if the image
is valid before trying to use some of its features.
2023-11-01 10:36:06 +00:00
Yuri Chornoivan
e62b4a3a7c Update Ukrainian translation 2023-10-31 19:20:57 +00:00
Jacob Boerema
905527ade1 plug-ins: fix typo in file-png 2023-10-31 11:37:28 -04:00
Alan Mortensen
dae82069f3 Update Danish translation 2023-10-31 13:18:40 +00:00
Alan Mortensen
9c49f73468 Update Danish translation 2023-10-31 13:14:25 +00:00
Anders Jonsson
611b3e7b1d Update Swedish translation 2023-10-30 08:17:13 +00:00
Rodrigo Lledó
79259f45cf Update Spanish translation 2023-10-28 22:54:26 +00:00
Rodrigo Lledó
267257532d Update Spanish translation 2023-10-28 22:46:03 +00:00
Rodrigo Lledó
ad537dc63f Update Spanish translation 2023-10-28 22:29:54 +00:00
Alx Sa
83d13c6004 plug-ins: Additional fixes for DDS Import
@Wormnest noted remaining regressions after 8faad92e.
The second fread() only runs if the DDSD_PITCH flag is set,
so the error handling check should also be conditional.
Additionally, the ZDI-CAN-22093 exploit no longer runs but
still could cause a plug-in crash. This patch adds an additional
check to ensure the buffer size was within bounds.
2023-10-28 19:54:58 +00:00
Martin
5ddad59921 Update Slovenian translation 2023-10-28 19:49:00 +00:00
Alx Sa
8faad92ee9 plug-ins: Fix DDS import regression from 6ad54ca3
@Wormnest pointed out that compressed files are likely smaller than
width * height * bps, so our check to prevent ZDI-CAN-22093
also caught valid files.
The size check is removed from load_image () and moved to load_layer ()
before the two fread() functions, as we know exactly how much we'll
try to read at that point.
2023-10-27 19:24:18 +00:00
Yuri Chornoivan
a5f077fb83 Update Ukrainian translation 2023-10-27 18:18:16 +00:00
Idriss Fekir
b503a3dc1d Fix bug when font is from a .ttc file
When loading an xcf file, if a a font has already
been used, its file's hash is compared against the hashes
from the xcf file (to speedup loading), but if the font is from a .ttc file (a font
collection), then all fonts from that file will have the same file
hash, so the wrong font might be selected. a simple solution is to not
use the hash except as a last resort if every other field is identical.
2023-10-27 15:48:58 +00:00
Jehan
28e94a6d8f NEWS: update. 2023-10-27 14:49:59 +02:00
Jehan
2dcc8eea93 app, libgimp, pdb: remove the internal PDB function _gimp_pdb_get_data_size().
We exchange GBytes structs which know their own data size already and is much
safer.
2023-10-27 10:16:45 +00:00
Jehan
7a03b3ea09 libgimp: gimp_pdb_get_data() and gimp_pdb_set_data() are made internal.
These are not usable by plug-ins anymore which should store their data between
runs as arguments or aux arguments (in case of values which should be stored
from one run to another but are not really usable for non-interactive scripts).
These are per-plug-in (not polluting the whole process space with just random
strings as identifiers which could be used by other plug-ins) and even survive
restarts of GIMP.

I still keep these functions, but only internally, as they are used to store
settings of GimpAspectPreview, GimpDrawablePreview and GimpZoomPreview across
plug-in runs. Still I changed their API to set and return a GBytes directly
(mimicking the private PDB functions' API).
Also I remove gimp_pdb_get_data_size() which is useless when exchanging GBytes
directly.

Note that the 2 functions are still exported in the library, and only not
advertized through headers (so they are not really internal, just hidden), on
purpose, because we need to call them in libgimpui. So it is still relatively
easy for a plug-in to use them. Nevertheless I made clear in the function
documentation that these must not be considered public and could end up deleted
at any time. Any plug-in still trying to call these takes the risk of having
their code relying on unreliable API.
2023-10-27 10:16:45 +00:00
Ekaterine Papava
0b0adfc627 Update Georgian translation 2023-10-27 04:38:09 +00:00
Alx Sa
0b83950ec4 plug-ins: Make van-gogh-lic scriptable...
...by adding parameters and porting to
GimpProcedureConfig/GimpProcedureDialog.
Code was also rearranged to match the ordering
of other plug-ins.
As a note, the help message is "Special effects that nobody understands".
It would be nice if someone with more familiarity with this plug-in could
update the help messages to explain the parameters.
2023-10-27 01:17:37 +00:00
Anders Jonsson
8055833d47 plug-ins: dds string fixes 2023-10-26 21:52:32 +00:00
Jehan
83a5998547 app: do not assume that a procedure is still registered after running.
I had the case when "Sphere" script crashed, bringing down the whole script-fu
plug-in (while trying to reproduce #10214). Then after being run, we get a
dangling pointer to a finalized action object.

Even in successful use cases, we will want to give the ability to unregister
normal plug-ins/procedures wrapped as GIMP extensions, and there is also the use
case of temporary procedures, so I'm sure this bug could be reproducible even in
normal non-problematic runs.
2023-10-26 22:44:07 +02:00
Yuri Chornoivan
fe8811c119 Update Ukrainian translation 2023-10-26 20:00:21 +00:00
Jehan
78aec68624 plug-ins: replace gimp_[gs]et_data() by AUX args in file-tiff. 2023-10-26 21:46:39 +02:00
Martin
374bc7f24b Update Slovenian translation 2023-10-26 19:19:31 +00:00
Martin
61793061db Update Slovenian translation 2023-10-26 19:10:58 +00:00
Jehan
4e9a077219 app: data tree views are in single selection mode.
I am pretty sure that this should be in single selection mode because we don't
even really have code to handle cases with multiple brushes or font selected.
Right now, we assume in many places that there is only one font or brush (or
other data) active at a given time.
Yet this code (or older versions of it) is old apparently and I realize that
even in 2.10, I can ctrl/shift click to select several data objects. This is the
weird part.

Anyway let's put this in single selection mode and see how it goes. If there
were actually use cases which I didn't know about, I'm sure we'll soon have
reports.
2023-10-26 20:59:48 +02:00
Jehan
40811be562 app: further improves the cursor choice heuristic with multi-selection.
I could still see annoying scrolling up/down happening when we are deselecting
an item (typically with ctrl-click). In such a case, the cursor is on a
deselected item. Just make it bump to a closest item, preferably a visible one.
2023-10-26 20:50:37 +02:00
Alx Sa
427130be25 plug-ins: port dds-write to GimpProcedureDialog.
Note that "save-type" and "mipmaps" were left as ints rather than GimpChoice,
as some options are conditionally disabled and I don't know if that 
is available in GimpChoice just yet.

A DDS loading bug related to 6ad54ca3 was also resolved. 
The correct header value to check for the pixel size was not "depth" but "bpp".
2023-10-26 17:16:49 +00:00
Jehan
195ac684a7 app: avoid scrolling up to top item of multi-selected items.
My first versions were commits 98f0c448 then 1d8782915e but the more I go, the
better I understand the implications of the selection vs. the cursor. In
particular, when setting a cursor, which also initializes the selection to this
item only, the tree view would also scroll to this item. The current
implementation, which sets the top item as cursor, is therefore particularly bad
for multi-selection which doesn't fit fully in the view, because we also end up
scrolling up. Say you have a long list of layers, you first select the top
layer, then scroll down to the bottom layer and ctrl-click it: the selection
(now 2 items) works but you end up scrolled back all the way up.

This alternate version is much better, by ensuring that your cursor is at least
within the selection (hence avoiding the discrepancy between keyboard navigation
and pointer navigation, and which was fixed with commit 98f0c448), so that we
don't try to change the cursor when possible.
2023-10-26 18:32:59 +02:00
Jehan
636b38be4f app: fix broken multi-selection.
This was broken in commit 3e101922. Setting a cursor basically resets to a
single selection, invalidating pointer-made multi-selection.

But then we got back the bug it fixes, which is that we must grab focus after
the selection is actually made. So we now grab at the end.

This also had a bad consequence for multi-selection (again): if the focus was
not already on the tree view, gimp_container_tree_view_selection_changed() was
not called. This function was where the actual selection-changing is meant to
happen. So we had to shift-click (or ctrl-click) twice. The first time, nothing
would happen (but focus was given to the tree view). The second time, we could
finally update the selection.

This is why we add 2 different cases of focus grab, which should hopefully
handle all cases correctly, though this code is really extra-complex. This
replaces MR !1128.
2023-10-26 17:19:08 +02:00
Alan Mortensen
05a1a9bbbc Update Danish translation 2023-10-26 14:22:00 +00:00
Ekaterine Papava
e8012ddcd2 Update Georgian translation 2023-10-25 21:23:55 +00:00
Jehan
f2734cec13 plug-ins: replace gimp_[sg]et_data() with an aux bytes argument in curve-bend.
I also remove (without replacement) 2 usages of gimp_get_data() without
associated gimp_set_data(). According to the comment, it looks like the
associated data was likely set by the GAP plug-in instead. Let's drop this.

Finally I see a lot of arguments, several of them being float arrays, so I
wondered if they were related to the curve and point arrays we are storing as
aux arg now. Apparently these arguments are not even used in the plug-in, right
now, which is explained in commit e318651c99. Maybe if these were actually
used/set and if we implement float array (de)serialization, would this aux
argument become useless?

Lastly, I deleted some code paths which were never used. For instance, stored
bval.total_steps was never set to anything else than 0 anywhere (so I removed
both the variable and the other code-path, which actually ended up being the
GAP-related data get). Additionally in p_bender_calculate_iter_curve(), there
was a big else block which was only happening when the GAP-related variables
were set. It got deleted too (as is a function only used in this block of code).
2023-10-25 22:47:45 +02:00
Jehan
8d6f281a72 plug-ins: replace gimp_[sg]et_data() with an aux str argument in ifs-compose.
The argument is the serialized description of the generated fractal. Actually it
may even be useful as a non-aux argument. A GFile argument could eventually be
interesting too, though one arg per setting would be better of course (it allows
more easily to generate animated frames for instance). In such a case, the GFile
would be used in priority, otherwise the other args.

Notes:

* I didn't port to GimpProcedureDialog though it looks like it would not be too
  hard (most of the GUI would still be custom GTK code, yet we could have the
  generic "reset to initial|factory values" buttons and load/save).
* The custom "Reset" button (identical to what "reset to factory values" would
  do) works fine anyway.
* The "run with last vals" works fine where there were indeed previous runs
  (which may be in previous sessions), but crashes when it's actually the first
  run ever. Some of the base structure data were not initialized. It should not
  be too hard yet would require a bit of code reorganization to fix this.
2023-10-25 19:01:02 +02:00
Jehan
0a0d66bda7 plug-ins: replace gimp_[sg]et_data() with an aux bytes argument in animation-play. 2023-10-25 19:01:02 +02:00
Alx Sa
f2bf2b7fe3 app: Fix initialization warnings
Initialized values in gimpruler.c and
gimptoolrectangle.c to remove warnings
about uninitialized variables.
2023-10-25 16:15:04 +00:00
Sabri Ünal
1ed8b20f02 Update Turkish translation 2023-10-25 13:44:23 +00:00
Sabri Ünal
b972bfdae9 Update Turkish translation 2023-10-25 13:44:15 +00:00
Sabri Ünal
179a084017 Update Turkish translation 2023-10-25 13:41:53 +00:00
Luming Zh
05703868bc Update Chinese (China) translation 2023-10-25 13:05:58 +00:00
Yuri Chornoivan
a3355a635d Update Ukrainian translation 2023-10-25 09:40:41 +00:00
Jehan
edc6232ae1 plug-ins: replace gimp_[sg]et_data() with an aux bytes argument. 2023-10-24 23:46:53 +02:00
Jacob Boerema
c2d76f38ff plug-ins: handle fill layers with negative height
As mentioned on Discourse here
https://discourse.gnome.org/t/error-opening-psd-image-height-no-support-or-invalid-1/17743
When opening a certain psd
(https://github.com/Squirtleiscool/Coalition-Technologies-Skill-Test/blob/master/CT_SkillTest_v1.psd)
We get a warning when creating a layer with a height of -1.
Apparently certain fill layers can have a negative height. Data on how
to handle this height is probably inside the 'SoCo' layer resource
that we don't handle yet.
For now, we will set the layer to empty and the height to 1.

To be on the safe side, let's also check the layer width to be non
negative.
2023-10-24 17:32:05 -04:00
Jehan
1caf6a8de4 plug-ins: remove useless gimp_[gs]et_data() calls.
This already uses GimpProcedureDialog and copy_from_config() is taking care at
filling the mapvals struct when an update is done.
2023-10-24 22:42:14 +02:00
Jehan
afef78b62c plug-ins: g_object_[gs]et_data() in help-browser replaced with aux bytes arg. 2023-10-24 22:28:37 +02:00
Jehan
56e5ed4559 plug-ins: various improvements to cml-explorer.
- Argument "parameter-uri" becomes "parameter-file" (GFile instead of URI
  string).
- Adding a "settings-data" auxiliary bytes argument to handle all settings for
  the time being, instead of using gimp_get_data() and gimp_set_data().
- "last_file_name" was also removed from the ValueType struct, using the
  "settings-data" arg instead.
- Fixing the non-interactive usage which was missing a gegl_init() call.
- Use GIO for various reading and writing to a CML parameter file.
- Better bubbling up of error messages.
- Fix the loading of the last section of CML parameters file.
- Also fixing deactived file dialog when clicking the open button a second time.
2023-10-24 22:28:37 +02:00
Jehan
04bcade9d7 plug-ins: current usage of gimp_[sg]et_data() in twain is bogus.
I don't even replace this one with an auxiliary bytes arg because this is
absolutely unused to start with.
2023-10-24 22:28:37 +02:00
Jehan
39409218a2 plug-ins: get rid of gimp_[sg]et_data() in gimpressionist.
We use a GBytes auxiliary argument (i.e. not visible in the public API) which
perfectly replace gimp_[gs]et_data() API, in even better (since it also works
across sessions).

The "Reset to initial values|factory defaults" still don't work. We could make
these work even with the AUX args, but I feel like this would be far too much
work for a non-optimal solution anyway. The real solution can be when we get
more public arguments to this PDB procedure to handle every setting
individually. This can happen after GIMP 3 release (especially now that
arguments number and order don't break the PDB API anymore).
2023-10-24 22:28:37 +02:00
Boyuan Yang
de10c0c309 Update Chinese (China) translation 2023-10-24 17:30:22 +00:00
Vasil Pupkin
65175d590e Update Belarusian translation 2023-10-24 16:20:56 +00:00
Yuri Chornoivan
032b786cb8 Update Ukrainian translation 2023-10-23 16:27:23 +00:00
Jehan
19b732a1da plug-ins: get rid of useless gimp_set_data() and gimp_get_data(). 2023-10-23 18:19:10 +02:00
Jehan
3352fb8639 plug-ins: port flame to GimpProcedureDialog.
I added a bunch of arguments, in particular nearly all the settings in the main
dialog, except for "Colormap" as I'm unsure yet how to handle it. It looks like
a mix of GimpChoice and GimpDrawable. I guess it could just be both (2 args,
using values from the GimpChoice if GimpDrawable arg is NULL).

And I didn't make the settings in the "Edit Flame" dialog into arguments as I'm
not sure if the "Speed" and "Variation" in particular should be args, or are
just temporary args only meant to construct a flame (in particular, it looks
like it builds data defining the flame?). These data should be their own args
probably?

Maybe we could also have the "file" as alternative way to init the flame data
(the "Open" button)?

For now, I'm just storing the whole settings struct as an aux argument, so that
"Load/Save Settings" work, as well as the initial values from previous run.

Also the whole code is still a bit of a mess. I feel like we could really
simplify a lot of the code, all these values stored globally or duplicated now
in both the GimpProcedureConfig and the control_point structure.
2023-10-23 17:07:09 +02:00
Alx Sa
0faaf7c379 themes: Define behavior for clicking already selected button
Resolves #9989

In 2.10/GTK2, clicking an already selected toolbutton caused the
background color to change to indicate this action.
This patch restores that behavior through CSS updates.
It also slightly rearranges the CSS to group related button styles.
2023-10-22 16:59:29 +00:00
Jordi Mas
6681fe7267 Update Catalan translation 2023-10-22 07:21:24 +02:00
Alan Mortensen
f5f1e05157 Update Danish translation 2023-10-21 09:09:55 +00:00
Alan Mortensen
c1b6756ee7 Update Danish translation 2023-10-21 09:09:49 +00:00
Alan Mortensen
488d154c44 Update Danish translation 2023-10-21 09:08:34 +00:00
Asier Sarasua Garmendia
0c5cb17d8a Update Basque translation 2023-10-21 07:00:51 +00:00
Jehan
0383ad350e Issue #9800: GimpAlignOptions' finalize() not properly chaining up.
Since we were not chaining up with parent's finalize(), we were not
removing the instance from the gimp-debug infrastructure which assumed
the object was leaked and would try to read its reference count for
debugging purpose, when GIMP_DEBUG=all was set.

In fact, the object was not leaked, therefore we got into a segfault
when dereferencing already freed memory.
2023-10-21 03:44:32 +02:00
Jehan
4fc9daedad Issue #10208: validate arguments for PDB calls run by script-fu.
I added a few specific validations for range types (int, double…), and a
generic validation at the end, meant to catch all yet uncaught invalid
argument cases (yet with less details on the what and why).
2023-10-21 02:46:58 +02:00
Massimo Valentini
3e101922d8 widgets: Prevent Toolbox autoscroll bug
In Preferences > Toolbox, clicking on an item below the
initial scroll window view causes it to jump to the top
automatically. This patch prevents this by setting the
clicked index in the GtkTreeView before grabbing focus.
2023-10-20 19:19:39 +00:00
Yuri Chornoivan
57a6386a3f Update Ukrainian translation 2023-10-20 18:41:56 +00:00
Jehan
a4b68c5244 app: don't call gimp_align_options_image_changed() on finalized options object.
I had this one crash upon exit, inside gimp_align_options_update_area() as a
consequence of gimp_align_options_image_changed() being called on an image
change. I could not reproduce after this one time and it's very likely a race
condition when everything is getting finalized, and the tool options object is
getting finalized earlier than the user context.

Anyway this should fix the potential crash.
2023-10-20 19:54:30 +02:00
Jehan
410ff342bc libgimp: fix double free crash.
gimp_procedure_new_return_values() takes ownership of the passed GError (it
allows, among other things, to call it directly as return value). So we must not
try and free it afterwards.
2023-10-20 19:01:38 +02:00
Jehan
3a0a400ad1 plug-ins: port forgotten uses of gimp_pdb_run_procedure*() removed API.
As often, we forgot to look in bindings. Thanks to Alx Sa for reminding me of
these.
2023-10-20 19:01:38 +02:00
Jehan
c3e59b071f libgimp: allowing NULL passed as value to a GimpObjectArray PDB argument.
A NULL will be transformed into an array of size 0.
2023-10-20 19:01:38 +02:00
Jehan
8ca6f1ac5b libgimp: gimp_procedure_new_arguments() can now be made static. 2023-10-20 19:01:38 +02:00
James Golden
22b28df391 app: save dialog now adjusts size up to monitor height
Fixes: #9373
2023-10-20 14:28:30 +00:00
bootchk
3646b86ce0 2.99 libgimpconfig: #10194 broken API GimpItem
And GimpTextLayer, GimpLayerMask
2023-10-20 09:04:42 -04:00
Ekaterine Papava
d8140cc2a1 Update Georgian translation 2023-10-20 04:03:45 +00:00
Alx Sa
208e22da3a themes: Define file dialog path buttons hover colors
Resolves #10039.

This keeps the highlight style consistent for the file
dialogues, no matter the underlying system theme.
2023-10-20 02:30:14 +00:00
Alx Sa
2c83d84d02 plug-ins: Load guides and grid info for PSP files
These are stored in the Extended Block. This block also holds metadata
in Exif, IPTC, and XMP formats, but those are not yet implemented in this
patch. A comment stating Exif was implemented in PSP 10 was corrected
to PSP 8 as well.
2023-10-19 19:36:52 +00:00
Rodrigo Lledó
f3d54b76b6 Update Spanish translation 2023-10-19 17:52:42 +00:00
bootchk
355f665403 Fix 10170
Changes only to ScriptFu.

The third term (the default) of a SF-FONT etc. spec is now ignored.

Test case is SF>Test>Sphere.  There are still crashing issues
related but separate.
2023-10-19 16:37:05 +00:00
Alx Sa
414f9f9abf build: Replace overlooked gimp_pdb_run_procedure_config () call
from 57ca3f48.
2023-10-19 14:55:59 +00:00
Alx Sa
85d8322c00 widgets: Restore layer/mask highlight on select
Changes were made to the click code for layers & masks
due to the introduction of multi-select, and this seems to
have caused the view highlight to be inconsistent.
This patch adds the gimp_layer_tree_view_update_borders ()
call after a click or selection to fix this.
2023-10-19 10:53:07 +00:00
Alx Sa
ad8b47bff7 gui: Change Windows title bar based on theme
On Windows, the title bar can be set to light or dark mode via DwmSetWindowAttribute ().
This adds code to update the main title bar and dialogue title bars based on the current theme.
The main title bar uses "prefer-dark-theme", while the dialogue title bars
uses the color of the widget background to assume the correct color.
2023-10-18 16:48:25 +00:00
Jehan
bf8ee69570 plug-ins: fix some broken macros with a massive search-and-replace.
If we leave a space between the macro name and opening parenthese for argument
lists, the args are not considered macro args (which will be discovered when
using it). I experienced this issue while testing code on some plug-in
yesterday, so thought I might as well fix all these broken macros for casting to
the specific GimpPlugIn subclass, so that we won't have a next time.
2023-10-18 18:29:37 +02:00
Jehan
57ca3f4807 libgimp, plug-ins: move gimp_pdb_run_procedure*() to gimp_procedure_run*().
The gimp_procedure_run() already existed, though it was with an ordered
GimpValueArray array of arguments. Its usage feels redundant to the series of
gimp_pdb_run_procedure*() functions (which is confusing), but
gimp_procedure_run() was actually a bit more generic, because it does not
necessarily calls GimpProcedure-s through the PDB! For instance, it can runs a
local GimpProcedure, such as the case of one procedure which would want to call
another procedure in the same plug-in, but without having to go through PDB. Of
course, for local code, you may as well run relevant functions directly, yet it
makes sense that if one of the redundant-looking function is removed, it should
be the more specific one. Also gimp_procedure_run() feels a lot simpler and
logical, API wise.

A main difference in usage is that now, plug-in developers have to first
explicitly look up the GimpPdbProcedure with gimp_pdb_lookup_procedure() when
they wish to call PDB procedures on the wire. This was done anyway in the
gimp_pdb_run_procedure*() code, now it's explicit (rather than calling by name
directly).

Concretely:

* gimp_pdb_run_procedure(), gimp_pdb_run_procedure_config() and
  gimp_pdb_run_procedure_valist() are removed.
* gimp_procedure_run() API is modified to use a variable args list instead of a
  GimpValueArray.
* gimp_procedure_run_config() and gimp_procedure_run_valist() are added.
* gimp_procedure_run_config() in particular will be the one used in bindings
  which don't have variable args support through a (rename-to
  gimp_procedure_run) annotation.
2023-10-18 17:11:20 +02:00
Jehan
701357c02f libgimp, plug-ins: no need for GType of argument in gimp_pdb_run_procedure().
Passing (name, type, value) triplets is actually useless because we can get the
type information from the procedure/config anyway. That only adds one more
verification to do. Let's just change the function so that we pass (name, value)
couples instead, pretty much like in `g_object_set()`.
2023-10-17 15:49:32 +02:00
Jehan
4693f1d824 Issue #10183: --iso-8601 is not a supported option by date CLI tool on macOS. 2023-10-17 15:23:30 +02:00
Luming Zh
aa8ab50a27 Update Chinese (China) translation 2023-10-16 20:38:01 +00:00
Jehan
475dafcee4 libgimp, pdb: make gimp_pdb_run_procedure_array() internal.
Apart from all regenerated PDB files, this commit fixes the few manual usages in
libgimp too.
2023-10-16 22:12:08 +02:00
Jehan
70438028aa libgimp: PDB procedure arguments are not order-based anymore (API-wise).
As far as plug-in API is concerned, at least the calling API, order of arguments
when calling PDB procedures doesn't matter anymore.

Order still matters for creating procedures with standard arguments (for
instance, "run-mode" is first, then image, or file, drawables or whatnot,
depending on the subtype of procedure), but not for calling with libgimp.

Concretely in this commit:

- gimp_pdb_run_procedure_argv() was removed as it's intrinsically order-based.
- gimp_pdb_run_procedure() and gimp_pdb_run_procedure_valist() stay but their
  semantic changes. Instead of an ordered list of (type, value) couple, it's now
  an unordered list of (name, type, value) triplets. This way, you can also
  ignore as many args as you want if you intend to keep them default. For
  instance, say you have a procedure with 20 args and you only want to change
  the last one and keep the 19 first with default values: while you used to have
  to write down all 20 args annoyingly, now you can just list the only arg you
  care about.

There are 2 important consequences here:

1. Calling PDB procedures becomes much more semantic, which means scripts with
   PDB calls are simpler (smaller list of arguments) and easier to read (when
   you had 5 int arguments in a row, you couldn't know what they refer to,
   except by always checking the PDB source; now you'll have associated names,
   such as "width", "height" and so on) hence maintain.
2. We will have the ability to add arguments and even order the new arguments in
   middle of existing arguments without breaking compatibility. The only thing
   which will matter will be that default values of new arguments will have to
   behave like when the arg didn't exist. This way, existing scripts will not be
   broken. This will avoid us having to always create variants of PDB procedure
   (like original "file-bla-save", then variant "file-bla-save-2" and so on)
   each time we add arguments.

Note: gimp_pdb_run_procedure_array() was not removed yet because it's currently
used by the PDB. To be followed.
2023-10-16 21:56:37 +02:00
Jehan
61e2faed1b app, plug-ins: port "file-gbr-save-internal" to multi-drawable API.
Similar to commit 6905b0bbef for "file-pat-save-internal". For interactive
usage, nothing is changed, but for non-interactive ones, we can now choose a
list of drawables to export.

Pending more changes, relative to the discussion in #7370.
2023-10-16 16:21:42 +02:00
Jehan
2728294063 app: rename "dummy-param" to "run-mode".
Since now the name of arguments will become more important, over order, let's
name the first parameter "run-mode" even in cases when this is a dummy argument
(most often the case when a procedure always acts the same, whether interactive
or not). I keep the mention of the parameter being useless in the nick and blurb
strings, as it's useful information. But let's keep using our "standard" arg
name "run-mode" for this first argument.
2023-10-16 14:49:17 +02:00
Jehan
8e66e5ae58 app: use "num-drawables" consistently for the array size argument of "drawables".
This is the naming we use everywhere else.
2023-10-16 14:45:04 +02:00
Jehan
a2c6a5ee72 NEWS: update. 2023-10-16 13:58:03 +02:00
Jehan
a101fd60eb libgimp: export again gimp_procedure_config_*_default() functions.
This partially revert some of the changes in commit 652a1b4388 because the
Windows CI suddenly failed because of this (my local build on Linux didn't have
any problem though) with:

> /usr/bin/x86_64-w64-mingw32-ld: libgimp/libgimpui-3.0-0.dll.p/gimpproceduredialog.c.obj: in function `gimp_procedure_dialog_save_defaults':
> /builds/GNOME/gimp/_build/../libgimp/gimpproceduredialog.c:2570:(.text+0x633): undefined reference to `_gimp_procedure_config_save_default'
> /usr/bin/x86_64-w64-mingw32-ld: /builds/GNOME/gimp/_build/../libgimp/gimpproceduredialog.c:2576:(.text+0x644): undefined reference to `_gimp_procedure_config_has_default'
> /usr/bin/x86_64-w64-mingw32-ld: libgimp/libgimpui-3.0-0.dll.p/gimpproceduredialog.c.obj: in function `gimp_procedure_dialog_load_defaults':
> /builds/GNOME/gimp/_build/../libgimp/gimpproceduredialog.c:2549:(.text+0xa2f): undefined reference to `_gimp_procedure_config_load_default'
> /usr/bin/x86_64-w64-mingw32-ld: libgimp/libgimpui-3.0-0.dll.p/gimpproceduredialog.c.obj: in function `gimp_procedure_dialog_constructed':
> /builds/GNOME/gimp/_build/../libgimp/gimpproceduredialog.c:368:(.text+0x11b1): undefined reference to `_gimp_procedure_config_has_default'

This is because these functions are used not only inside libgimp but also
across inside libgimpui. As a consequence, the build fails when linking
libgimpui.
2023-10-15 23:20:44 +02:00
Jehan
f25e0448b2 libgimp, plug-ins: gimp_procedure_config_[gs]et_values() not public anymore.
This goes with our planned change of not making GimpProcedure arguments order
relevant anymore regarding the PDB API. In particular, it means we don't want to
use GimpValueArray for various procedure arguments API, but directly
GimpProcedureConfig objects.

This change will allow to add or reorder arguments in the future, so that we
won't have to create new PDB procedures when adding new arguments, while still
keeping PDB API stability.
2023-10-15 22:10:38 +02:00
Asier Sarasua Garmendia
8881079d9d Update Basque translation 2023-10-15 18:51:34 +00:00
Alx Sa
65dd773163 plug-ins: Fix issue with RGBA 32BPP import
Resolves #10174.
The precision assignments for floating point versus integer options
were flipped by accident.
2023-10-15 15:37:13 +00:00
Jehan
652a1b4388 libgimp: do not export private GimpProcedureConfig functions in the lib.
Some of these should not even be visible by libgimp and were just fine as static
as well! For the rest, I make them really private (not only with a private
header).
2023-10-15 17:32:04 +02:00
Jehan
b2f633a26c libgimp: all _gimp_procedure_config_begin|end_*() functions made private.
Since now all GimpProcedure and subclasses run these before and after the
relevant run() functions, there is no need to keep these public.
2023-10-15 17:19:30 +02:00
Jehan
317be5f4ce Issue #3912: Object proxy management not happy with bindings.
We cannot be 100% sure generically (i.e. for all possible bindings available
with GObject Introspection) if bindings add their own reference to objects or
not. Clearly we have cases when they always do (Lua, Javascript), cases when
they do only in certain conditions (global Python variables) and cases when they
don't (Vala). What we know for sure is that in these script languages,
developers don't manually manage memory anyway. So the additional reference is
not their fact.

So let's just maintain a list of automatic memory managed binding languages,
among the few we officially support (i.e. the ones for which we have working
test plug-ins) and verify by executable extension if the plug-in is written in
one of these.
Both keeping a manually-updated list and verifying by extension are not so
pretty solution, but for now it will do.
2023-10-15 16:45:15 +02:00
Alx Sa
bd7423915c gui: Use "minimize" window hint on Windows
Resolves the second half of #300.

This adds conditional code to the gtk_window_present () call in gui.c
to prevent it from running if the user requested it stay minimized in the shortcut
or commandline call on Windows.
It also keeps the splashscreen minimized in that case.
2023-10-15 14:14:06 +00:00
Jehan
d1297b8c2b libgimp: do not unref the additional object reference hold by a plug-in.
As explained in the comment above, the reference might actually be owned by the
binding code (not by the plug-in code) and therefore can still be released
afterwards. Freeing it now while we don't own the reference exposes us to
double-free crashes.
2023-10-15 11:53:27 +00:00
Jehan
c9c372e77c build: missing dependencies at Windows build packaging stage.
This is unrelated to the Aarch64 changes. It was just already broken.
2023-10-15 11:53:27 +00:00
Jehan
fe465120be build: install lua5.1 instead of luajit on Windows/Aarch64. 2023-10-15 11:53:27 +00:00
Jehan
7f2b301d68 meson: search lua alternatively to luajit.
This will be needed in particular for GIMP on Windows/Aarch64. Also even on
other OSes, it is useful to support lua plug-ins not only with luajit but also
upstream lua.
2023-10-15 11:53:27 +00:00
Jehan
7a34282fa5 gitlab-ci, build: add Aarch64 build in our universal installer.
This is in part a port of commit 6f921b27bb from gimp-2-10 branch, except that I
could not easily cherry-pick because too much had changed already in the master
branch.
There are also a bunch of additional changes in some other glue scripts.

Also some rules which were in the 2.10 branch don't apply to the main one, such
as Python being copied from the x86 binaries, since clang-aarch64 has Python3
(unlike Python2).
2023-10-15 11:53:27 +00:00
Jehan
de126b0c32 build: split-debug-msys2.sh fails silently on Windows/Aarch64.
Fixes:

> $ C:\msys64\usr\bin\bash -lc "bash -x ../build/windows/gitlab-ci/split-debug-msys2.sh"
> + '[' -z '' ']'
> + find . '(' -iname '*.dll' -or -iname '*.exe' -or -iname '*.pyd' ')' -type f -exec objcopy -v --only-keep-debug '{}' '{}.debug' ';'
> C:/msys64/clangarm64/bin/objcopy.exe: error: unknown argument '-v'
2023-10-15 11:53:27 +00:00
U-YGGDRASIL\ender
050c56851b Installer: remove setup.ini (not used any more)
(cherry picked from commit 0793b2a796)
2023-10-15 11:53:27 +00:00
U-YGGDRASIL\ender
092be766e5 Installer: include file extension in association name
(cherry picked from commit 597e68a364)
2023-10-15 11:53:27 +00:00
Jehan
4426eef73a build: fix per-architecture directories and Vala plug-in build.
Thanks to Hernan Martinez for noticing this issue which should fix Vala building
both for i686 and Aarch64 builds.
2023-10-15 11:53:27 +00:00
Jehan
17688ffa3a build, gitlab-ci: taking one more patch from MSYS2 project.
This should hopefully fix this error in the CI:

> llvm-rc: Error in ICON statement (ID 1):

See: https://github.com/llvm/llvm-project/issues/51286
2023-10-15 11:53:27 +00:00
Jehan
823f24c401 build, gitlab-ci: temporary patch for the Windows/Aarch64 build.
See discussion in #9170 and !1091. It looks like this soon won't be a problem
with a recent llvm-windres (which is now patched). But until then, let's patch
upstream GIMP but only for this build.
2023-10-15 11:53:27 +00:00
Jehan
bb6ac317b8 build: luajit is currently not available in clangarm64 MSYS2 repository. 2023-10-15 11:53:27 +00:00
Jehan
b4a06737c0 build: testing a Windows/Aarch64 build.
Note: the additional `rm` call was done for this error:

> + mv _install-arm64 /home/SYSTEM
> mv: cannot move '_install-arm64' to '/home/SYSTEM/_install-arm64': Directory not empty

I guess the home directory is not properly wiped-out between runs, which is not
a huge problem as long as the runner is private to our project. Let's clean
things ourselves.
2023-10-15 11:53:27 +00:00
Anders Jonsson
5c28355d5e plug-ins: remove i18n for widget ID 2023-10-15 10:18:08 +00:00
Jehan
6d36e38018 app: fix a quite-random crash on exit with a race condition.
In some very hard-to-reproduce conditions, I experienced
tool_manager_selected_layers_changed() running on an invalid GimpToolManager
pointer (because tool_manager_exit() had already run) and therefore segfaulting
on quit. Let's make sure we disconnect the signal handler.
2023-10-15 11:45:16 +02:00
Martin
68928ac5ab Update Slovenian translation 2023-10-15 09:44:24 +00:00
Asier Sarasua Garmendia
d61b96cef1 Update Basque translation 2023-10-15 07:10:26 +00:00
Jehan
24a4b6bf65 plug-ins: mistakenly internationalized signal names and widget IDs.
Thanks to Anders Jonsson for noticing these.
2023-10-14 19:05:52 +02:00
Jehan
ccb8a7be2e meson: fix inserting generation date and time in authors.md. 2023-10-14 17:12:49 +02:00
Martin
8fcf4c44f9 Update Slovenian translation 2023-10-14 15:01:14 +00:00
Martin
56d415f10f Update Slovenian translation 2023-10-14 14:40:57 +00:00
Sabri Ünal
811ec0b908 Update Turkish translation 2023-10-14 12:53:51 +00:00
Sabri Ünal
6d9ab84781 Update Turkish translation 2023-10-14 12:52:46 +00:00
Sabri Ünal
1d17e114de Update Turkish translation 2023-10-14 12:52:18 +00:00
Sabri Ünal
202979b7d7 Update Turkish translation 2023-10-14 12:52:10 +00:00
Sabri Ünal
8b8a3ebd23 Update Turkish translation 2023-10-14 12:51:57 +00:00
Asier Sarasua Garmendia
220362bf05 Update Basque translation 2023-10-14 09:22:53 +00:00
Asier Sarasua Garmendia
02b5ed0a5c Update Basque translation 2023-10-14 09:22:12 +00:00
Asier Sarasua Garmendia
171a61e2ad Update Basque translation 2023-10-14 09:22:08 +00:00
Asier Sarasua Garmendia
d8791b28de Update Basque translation 2023-10-14 09:20:34 +00:00
Michael Schumacher
f8004c8167 Add a 'Allow resizing' toggle to Decor > Add Border
Add Border enlarges an image by twice the specified border size and creates the border in this
additional space. If an image already has the intended final size, this behaviour is not desired.
This change adds a toggle to (dis)allow resizing, similar to the drop shadow script.

This came up in a reddit thread by /u/rapidexchange
https://www.reddit.com/r/GIMP/comments/6csofx/im_new_to_gimp_so_sorry_if_this_is_a_stupid/
2023-10-13 13:17:11 -04:00
bootchk
24d3e94e2a Fix scripts after changes to text PDB API
Some scripts still broken until fixes re default font in ScriptFu.

Test scripts restored to working.
2023-10-13 09:38:21 -04:00
Ekaterine Papava
f76f6dc88e Update Georgian translation 2023-10-12 14:04:58 +00:00
Ekaterine Papava
7cf7393928 Update Georgian translation 2023-10-12 13:42:16 +00:00
Martin
08e77c8fbd Update Slovenian translation 2023-10-12 09:22:45 +00:00
Yuri Chornoivan
7bc554f42a Update Ukrainian translation 2023-10-12 06:46:38 +00:00
Martin
c7f46d9ec1 Update Slovenian translation 2023-10-11 15:52:00 +00:00
bootchk
b3cd0f2539 Fix #10162 critical on null brush to prop chooser widget 2023-10-11 08:59:27 -04:00
bootchk
039b25eb6e Fix clang build error void function should not return value 2023-10-11 08:09:54 -04:00
Alx Sa
968cf06a1c plug-ins: Load PSP selection block
Adds code to read in PSP_SELECTION_BLOCK.
If there was an active selection in the PSP file when it was
saved, that selection will now be active in GIMP as well on load.
2023-10-10 20:56:23 +00:00
Yuri Chornoivan
2de5d5d3e0 Update Ukrainian translation 2023-10-10 19:34:55 +00:00
Luming Zh
e8d879ba16 Update Chinese (China) translation 2023-10-10 18:52:38 +00:00
Martin
88505ac57c Update Slovenian translation 2023-10-10 07:12:06 +00:00
Martin
599963d3bb Update Slovenian translation 2023-10-10 07:05:31 +00:00
Martin
71763f0a48 Update Slovenian translation 2023-10-10 07:03:21 +00:00
Anders Jonsson
0389e50569 plug-ins: string fixes 2023-10-09 21:18:39 +00:00
Ekaterine Papava
322f17c7a0 Update Georgian translation 2023-10-09 20:48:30 +00:00
Yuri Chornoivan
744c173e7a Update Ukrainian translation 2023-10-09 18:31:42 +00:00
Yuri Chornoivan
4ad7e9fe83 Update Ukrainian translation 2023-10-09 18:28:31 +00:00
Jehan
1d8782915e Issue #10143: shift selecting is failing to highlight selected layers.
This is a consequence of commit 98f0c448. Apparently setting the tree view
cursor also reset visually the selection. So I make sure I only set the cursor
on the first path in the list of selected items.
2023-10-09 15:59:13 +02:00
Jehan
8f06421781 app: fix gimp-gegl-loops algorithm from commit dbaa8b6a1c.
Using gegl_parallel_distribute_area() for gimp_gegl_is_index_used() is just far
too slow by 2 order of magnitudes compared to a threaded implementation where I
process each buffer at once (but each in their own thread from a pool).
I guess the basic value check is too basic to warrant being done in threads
(note: even growing the distributed area by bumping the thread cost a lot was
not enough).

I didn't fixup commit dbaa8b6a1c directly so that we keep a trace of the
gegl_parallel_distribute_area() implementation in case we can do better later.

Additionally I fixed gimp_gegl_shift_index() to use the full drawable format,
including the possible alpha channel. Otherwise shifting indexes may result in
dropping the alpha value.
2023-10-09 15:44:31 +02:00
Jehan
c8de818349 app, menus: Colormap dockable now shows a delete button.
This comes with a "colormap-delete-color" into the "colormap" action group. The
action/button will be insensitive when the selected color is used in the image,
since it is only possible to delete unused colors.
2023-10-09 15:28:20 +02:00
Jehan
dbaa8b6a1c app, pdb: make it possible to delete a color from a colormap if unused.
Until now, it was not really possible to delete a colormap color, but since we
now use GimpPalette, people would definitely try to do so. It just makes sense
to allow doing this, but only if the color is unused.

Additionally when we do this, all the pixels refering to bigger indexes will be
edited so that they continue to refer to the same color (bigger indexes are
shifted by -1). Therefore removing an unused color does not change the image
render.

I wondered if we might want more options, e.g. the ability to delete a color
without fixing indexes (i.e. that colors over the deleted color index would
shift to the next color). This would even allow to delete used colors (though
now the last index would have to be unused one, unless we cycle colors).
Yet I don't think this should belong to this basic API. The most expected
behavior when deleting a color from an image colormap is to fix all indexes
stored in pixels so that the image still shows the same. So that's what this
function will do in this generic usage.
2023-10-09 15:28:20 +02:00
Jehan
c3c0a70dd5 app: reset the selected index when active palette changes.
This fixes some CRITICAL when switching active image while an item is selected.
2023-10-09 15:28:20 +02:00
Yuri Chornoivan
2a0f3b6340 Update Ukrainian translation 2023-10-09 06:30:10 +00:00
Jehan
4d03f7b04b app: also generate filename and save file of duplicate data immediately.
This fixes a CRITICAL when duplicating a resource data.
2023-10-08 23:22:58 +02:00
Martin
ab11569bfc Update Slovenian translation 2023-10-08 14:40:20 +00:00
Luming Zh
1864cbf3e2 Update Chinese (China) translation 2023-10-07 18:09:21 +00:00
Ekaterine Papava
e7b703bbaa Update Georgian translation 2023-10-07 17:51:06 +00:00
Jehan
378c3c525a po: missing new source file from POTFILES.in. 2023-10-07 18:32:26 +02:00
Alx Sa
33b88d2d3b po-plug-ins: Remove reference to selection-to-path-dialog.c
This file was removed in the port to GimpProcedureConfig.
Thanks to @piotrdrag for pointing that out!
2023-10-07 14:49:36 +00:00
Alx Sa
b641cec7d1 plug-ins: Remove reference to gimp_procedure_config_end_run
Missed an non-interactive call to gimp_procedure_config_end_run()
during the GimpProcedureConfig port.
2023-10-07 13:53:20 +00:00
bootchk
e029a96d50 Fix #10127
Improper counting of args declared by scripts versus pspecs in a ProcedureConfig.
Scripts don't declare run_mode, while pspecs have run_mode and an extra internal pspec
that is not an argument.
2023-10-07 06:04:00 -04:00
Sabri Ünal
e54ab26426 Update Turkish translation 2023-10-07 06:45:19 +00:00
Sabri Ünal
e99ac4dc8c Update Turkish translation 2023-10-07 06:42:59 +00:00
Ekaterine Papava
06be26938c Update Georgian translation 2023-10-06 20:41:53 +00:00
Jehan
d931098d36 app, libgimp, pdb: new gimp_image_get_palette().
This is meant to replace gimp_image_get_colormap() (see also #9477).

We likely won't need a gimp_image_set_palette() because we can simply edit the
image's colormap/palette with GimpPalette API now and it is directly updated.

For instance, the following code changes the first entry in the image palette to
red, immediately:

```python
i = Gimp.list_images()[0]
p = i.get_palette()
c = Gimp.RGB()
c.r = 1.0
p.entry_set_color(0, c)
```

For this to work fine, I added a new concept to GimpData, which is that they can
be tied to a GimpImage (instead of a GFile). Image palettes are not considered
internals, they are just tied to their image, therefore they can be edited by
scripts/plug-ins.

Additionally with this commit, editing an image's colormap from libgimp API also
generates undo steps now.
2023-10-06 22:04:34 +02:00
Alx Sa
c54a33f0ff config: Clarify color profile policy (@ellestone)
Original patch by @ellestone.
The current tooltip is somewhat confusing for two reasons: It doesn't 
mention the word "ICC", leaving room for doubt as to what a "color 
profile" might be. And as @TheTooleMan suggested, it's easier to read
and understand if the action (opening a file . . .) is in front of the 
modifier (. . . with an embedded ICC profile) instead of vice versa.
2023-10-06 19:08:40 +00:00
Jehan
dfe803e882 Issue #9478: gimp_image_get_thumbnail_data() is not introspectable. 2023-10-05 22:58:29 +02:00
Jehan
bdcd9cd38a libgimp, plug-ins: let's just call gegl_init() in gimp_ui_init().
bootchk had the case in commit 6781a35668. I again had it with gfig. I think it
just makes sense to init GEGL, especially as the errors are not that explicit
and that the plug-in code may not even call GEGL code directly (so it makes it
harder to guess).
2023-10-05 22:36:40 +02:00
Jehan
192c043d7b Issue #10120: CRITICAL in gimp_progress_bar_init().
This hightlighted a slightly more complicated use case when setting the handle
on a widget without its own GdkWindow.
2023-10-05 16:40:16 +02:00
Rodrigo Lledó
3d827148c9 Update Spanish translation 2023-10-05 13:25:21 +00:00
bootchk
6781a35668 Fix 10115 SF interface call gegl_init
Resource chooser widgets recently changed to use gegl.
2023-10-05 07:37:15 -04:00
Alx Sa
cbf14a7e2d plug-ins: Various warnings/code style fixes for plugins...
After the recent port.
* contrast-retinex: Initialize format & src_buffer to NULL
* curve-bend and map-object: Remove no longer needed functions
* file-load-gif: Fix C++ style comment
2023-10-04 20:27:17 +00:00
Jehan
98f0c44881 app: set keyboard focus to selected item in GimpContainerTreeView.
When the selection changes, the focus must be on one of the selected items. Not
doing this was creating a very annoying behavior where you would select an item
in the tree view with the pointer first, but then when moving up/down with the
keyboard arrow, the move originated from the previously set item. This was
because the arrow move used the "cursor path", i.e. the keyboard focus, and not
the item selection as origin.

In our case, let's make sure these match (i.e. the cursor path is the path of at
least one of the selected items, which is the most expected behavior for mixed
pointer/keyboard interactions).

See code in gtk_tree_view_move_cursor_up_down() from GTK code.
2023-10-04 15:17:43 +02:00
Idriss Fekir
68aadf4a27 Issue #9979:bold and italic broken 2023-10-04 12:01:06 +00:00
Alx Sa
f46160f29c plug-ins: Prevent infinite loop in film
Resolves #10119.

If the user sets the "Image Spacing" and "Hole Width" values
to 0, the hole creation code gets stuck in an infinite loop.
This patch adds a check to the allocation code for the hole
to make sure both its dimensions are greater than 0. If not,
then the hole is not created in the first place.
2023-10-04 11:12:42 +00:00
Jehan
04dcd11fd6 app: complete !1073 for case when transformed <shift>num action clashes…
… with another default shortcut.

This won't happen with the standard US layout, but among all the layouts which
exist (or will exist), there is no say that the characters behing <shift>2-5
keys are not another one of our default shortcuts for other actions. We don't
want to print this case, because it is special enough that it's really not a
bug. In this case, we just ignore the transformed shortcut on the zoom action
and be done with it.
2023-10-04 00:11:35 +02:00
programmer_ceds
13ec70bb16 Make Numeric Shift Shortcuts Work (Fixes issue #9798) 2023-10-03 21:44:59 +00:00
Jehan
ef65087c2b app: save new data to file immediately.
Calling gimp_resource_delete() on a data with a file which was not stored yet
would fail on missing file as reported by Lloyd in a comment in #9976. We could
just special-case the code to make the already-inexisting case acceptable on
deletion, but there are a few more issues.

In particular gimp_data_create_filename() relies on actually checking file
existence on the file system. Therefore generating the file path too early
(before any possible rename, i.e. for uniqueness or other formatting need) would
easily generate duplicate paths (which means one of the data object would be
overwritten on exit). It's better to kinda *reserve* the set file path
immediately by saving the data file.

The only drawback I could see on saving early is possible I/O slowdown if a
script were to create many data, but I actually don't think it's a valid use
case (no script should likely create enough data files that we would notice a
slowdown, i.e. likely creating hundreds of data objects at once) anyway. So
let's go with it, at least for now.
2023-10-03 14:40:33 +02:00
Jehan
03a6fec6b3 plug-ins: GimpUi should be loaded by default in the Python console. 2023-10-03 13:46:24 +02:00
Alx Sa
22963405ac plug-ins: Set Pixel Aspect Ratio for GIFs
If the GIF has a value other than 0 or 49 in its PixelAspectRatio 
header, then we now use it to set the non-square pixel resolution.
For reference, GIFs calculate this value like so:
PAR = (Value + 15) / (float) 64.
2023-10-03 02:14:59 +00:00
Jehan
fc6c0974ea Issue #9976: gimp-brush-new throws critical. 2023-10-03 00:02:33 +02:00
Jehan
eab9d8da28 app, libgimp, pdb: new PDB function gimp_fonts_get_by_name().
It returns all the fonts (possibly more than 1) with a given name. I left the
function gimp_font_get_by_name() as a utility when one don't want to choose (or
is not able anyway, e.g. a script with minimal information), though I wondered
if we should not simplify with a single function (the new one, which is the
correct one now that it is possible to have several fonts with a given name).

It is easy to test with fonts named the same. For instance I could find 2
different fonts, both named 'Holiday'. This call in the Python console returns
both:

> Gimp.fonts_get_by_name('Holiday')

As part of this commit, I also implemented resource arrays (or subtype arrays)
as PDB arguments and return types.
2023-10-02 23:22:49 +02:00
Jehan
66488ed958 plug-in: changed sign of descent in gimp_text_get_extents_font().
The film plug-in is the sole usage of gimp_text_get_extents_font().
2023-10-02 21:42:23 +02:00
Jehan
adce3179d4 app, libgimp, pdb: further fix gimp_text_get_extents_font() and improve…
… description.

- The returned value as width/height/etc. of the glyph extents (or bounding
  box), not "of the font" (which doesn't mean much).
- Adding some definition for ascent and descent. This text is straight out
  copied from Pango documentation comments in pango/pango-types.h.
- I don't see why we were negating the descent value. Let's keep the value sign
  as defined in Pango.
2023-10-02 21:30:20 +02:00
Jehan
a898641cd1 app: fix return type.
Fixes:

> warning: returning ‘void *’ from a function with return type ‘gboolean’
2023-10-02 20:56:19 +02:00
Jehan
24a85eebd6 Issue #9987: text related functions crash using string for font name.
- Fonctions were renamed: s/gimp_text_fontname/gimp_text_font/ and
  s/gimp_text_get_extents_fontname/gimp_text_get_extents_font/
- The size_type arguments were removed. Even in 2.10, this argument was marked
  as "dead" and ignored. It was only kept for API compatibility.
- The font name (string) was replaced by a GimpFont argument.

gimp_text_font() is easily tested in the Python console with:

> Gimp.text_font(Gimp.list_images()[0], None, 10, 40, "Hello World!", 1.0, True, 100, Gimp.context_get_font())

And gimp_text_get_extents_font() with:

> Gimp.text_get_extents_font("Hello World!", 100, Gimp.context_get_font())
2023-10-02 20:49:53 +02:00
Martin
0a77a8492f Update Slovenian translation 2023-10-02 14:52:08 +00:00
Martin
d40137a79d Update Slovenian translation 2023-10-02 14:50:35 +00:00
Martin
fa9d394569 Update Slovenian translation 2023-10-02 14:48:21 +00:00
Martin
5a4d5e7d2d Update Slovenian translation 2023-10-02 14:47:00 +00:00
Luming Zh
d3584d2d50 Update Chinese (China) translation 2023-10-02 13:45:37 +00:00
Luming Zh
a3c39531db Update Chinese (China) translation 2023-10-02 13:43:59 +00:00
Luming Zh
0b01c76808 Update Chinese (China) translation 2023-10-02 13:43:48 +00:00
Luming Zh
4f07172fac Update Chinese (China) translation 2023-10-02 13:42:45 +00:00
Ekaterine Papava
21d9ce5f31 Update Georgian translation 2023-10-02 12:30:21 +00:00
Ekaterine Papava
f67cc26a4b Update Georgian translation 2023-10-02 12:28:44 +00:00
Ekaterine Papava
5109772d28 Update Georgian translation 2023-10-02 12:28:07 +00:00
Ekaterine Papava
0709eebffe Update Georgian translation 2023-10-02 12:24:48 +00:00
Yuri Chornoivan
edddfa2052 Update Ukrainian translation 2023-10-02 06:58:32 +00:00
Yuri Chornoivan
53c70e47b6 Update Ukrainian translation 2023-10-02 06:57:30 +00:00
Yuri Chornoivan
d1d73541c1 Update Ukrainian translation 2023-10-02 06:56:11 +00:00
Yuri Chornoivan
11ef35f7de Update Ukrainian translation 2023-10-02 06:54:52 +00:00
Jehan
a186220e58 app: be more forgiving in reading shortcutsrc.
- First do not write the protocol-version (and therefore don't read it either
  nor compare it to the current one). This file does not depend on the protocol
  version.
- Secondly when reading an unknown identifier, simply print a message on stderr
  for debugging/reference, but ignore it up to the next closing parenthese.
- Finally do not use the file-version as a terminal error as well. When we read
  a shortcutsrc with the wrong version, we still try to read it as best as we
  can. There might be issues, but it's better than fully dropping the whole list
  of shortcuts as it's a pretty important file (people might have spent a lot of
  time tweaking their shortcuts!).
2023-10-02 01:30:02 +02:00
Jehan
278f78fee6 libgimp: fix various GIR build warnings breaking HTML reference generation.
- a few inconsistent parameter naming;
- broken links to other symbols.
2023-10-02 00:25:12 +02:00
Jehan
8694f67918 libgimp: fixing duplicate gimppropwidgets section for introspection docs.
Fixing:

> [809/2421] Generating libgimp/GimpUi-3.0.gir with a custom command (wrapped by meson to set env)
> libgimpwidgets/gimppropwidgets.c:37: Warning: GimpUi: multiple comment blocks documenting 'SECTION:gimppropwidgets:' identifier (already seen at gimppropwidgets.c:23).
2023-10-02 00:05:10 +02:00
Jehan
3acac137ae NEWS: update with all changes from MR !1065.
Only the DDS vulnerability item is not from this MR but from the rebase.
2023-10-01 23:02:12 +02:00
Jehan
5a5a94d9b7 plug-ins: port other Python plug-ins to new gimp_image_procedure_new().
SpyroGIMP will have to be ported to GimpProcedureDialog, or at least, it should
store its arguments. Currently they are resetted at each run.
2023-10-01 21:02:34 +02:00
Jehan
accf3b1e64 plug-ins: port histogram-export to new gimp_image_procedure_new() and…
… to GimpProcedureDialog.
2023-10-01 21:02:34 +02:00
Jehan
1d50c81130 libgimp, plug-ins, extensions: gimp_image_procedure_new2() renamed gimp_image_procedure_new(). 2023-10-01 21:02:34 +02:00
Alx Sa
5c8aa1f242 plug-ins: port lighting to gimp_image_procedure_new2()
...and to GimpProcedureDialog.
As with the last few, improvements could be made to the GUI, mneumonics,
and global variables used.
2023-10-01 21:02:34 +02:00
Alx Sa
5765240f6b plug-ins: port fractal-explorer to gimp_image_procedure_new2()
...and to GimpProcedureDialog.
Note that there are still some unnecessary global variables that could be refactored out.
2023-10-01 21:02:34 +02:00
Jehan
9a2d9991e5 plug-ins: get rid of hardcoded colors for built-in units.
Hardcoded colors don't work well with theme customization (on a dark theme in
particular, it was bad).

Anyway built-in units are already grayed-out and non-editable. I don't think
further styling is needed.
2023-10-01 21:02:34 +02:00
Jehan
0273c1031c app, libgimp, pdb: gimp_text_layer_new() now uses GimpFont.
This function is not perfect and in particular doesn't seem usable with binding
because of GimpUnit being some weird mix between an enum and some kind of class.

So this will have to be fixed too. See #8900.
2023-10-01 21:02:34 +02:00
Jehan
ea55b7a11a app, devel-docs, libgimp: updating gimp_text_layer_[gs]et_font() and new…
… function gimp_font_get_pango_font_description().

Also updating file-pdf-save which is the only plug-in using these right now.

Note that I am not fully happy with the new function
gimp_font_get_pango_font_description() because I experienced some weird behavior
in file-pdf-save which is that some fonts were wrong if this is called after
pango_cairo_font_map_set_resolution().
But let's say this is a first step looking for improvements.
2023-10-01 21:02:34 +02:00
Alx Sa
faae47a9a8 plug-ins: port map-object to gimp_image_procedure_new2()
...and to GimpProcedureDialog.
Also resolves #25 by adding the missing PDB parameters to the GUI.
Note that there are a few remaining tasks:
* The config values are being copied to mapvals. 
Eventually the rest of the code needs to be updated
to directly use the config.
* The material tab uses icons from the Lighting plug-in. They didn't show up before the port; this needs to be fixed.
* The drawable buttons are huge compared to the original plug-in. The styling needs to be looked at.
2023-10-01 21:02:34 +02:00
Alx Sa
640b0cffe0 plug-ins: port sample-colorize to gimp_image_procedure_new2()
..and to GimpProcedureDialog.
Note that the UI could be improved - happy to make changes based on
feedback!
2023-10-01 21:02:34 +02:00
Jehan
2f4d625059 app, libgimp, pdb: generate widgets for GIMP_PROC_ARG_LAYER|CHANNEL arguments.
I am using the same GimpDrawableChooser with an additional drawable_type
argument to only show the appropriate tab if we want to limit what can be
chosen.

None of our plug-ins actually use a GimpLayer or GimpChannel only arg so far,
but if we have some day, or if some third-party plug-ins want to have such arg,
now they quite easily can!
2023-10-01 21:02:34 +02:00
Jehan
4be1166982 app, libgimp: disable again cross-process transient setting.
After testing, setting a window as transient to another from another process is
still broken on Windows and it's hard to diagnose without using Windows
directly. Since it's not just broken, but it even hangs the whole process, which
is quite a blocker issue, let's disable again the whole code on Windows.
2023-10-01 21:02:34 +02:00
Alx Sa
7b29ac247a plug-ins: port compose to gimp_image_procedure_new2()
Converted to GimpProcedureDialog as well, and changed the
string argument for the combobox to GimpChoice.
Some widgets are still standalone and could be further improved
to work with GimpProcedureDialog.
2023-10-01 21:02:33 +02:00
Jehan
b7bff4ee9a libgimpconfig: a NULL GBytes is also a proper argument value.
Do not fail serialization when a GBytes argument is set to NULL by adding a
special case for this.
2023-10-01 21:02:33 +02:00
Alx Sa
e318651c99 plug-ins: port curve-bend to gimp_image_procedure_new2() and GimpProcedureDialog.
A new aux parameter for upper/lower border area was added so this could be generated
as part of the GUI.
I received warnings about serializing the FloatArray and GBytes parameters, so I did not integrate
the existing variables with GimpProcedureConfig in this current version.
2023-10-01 21:02:33 +02:00
Jehan
88c9d54709 plug-ins: port depth-merge to gimp_image_procedure_new2() and GimpProcedureDialog.
The only missing feature is that we don't constrain the various argument
drawables to RGB/grayscale or to the same dimension as the input drawable. This
could actually be quite easily implemented, either through a set of constraint
flags, or a more flexible callback function (similar to the API of
gimp_drawable_combo_box_new()). It could either be implemented on the argument
level (which has the advantage of letting libgimp handle argument sanity of
plug-in developers, even in non-interactive calls, with generic error messages)
or within the new GimpDrawableChooser API.

I was actually implementing this when I realized that this plug-in works fine
even with images of different dimensions. As for the format, GEGL handles format
conversion automatically. There is absolutely no reason to limit ourselves.

So let's drop this feature for now, because we should not over-engineer. If it
turns out useful and we get requests, we can always create later either a
specialized arg macro GIMP_PROC_ARG_CONSTRAINED_DRAWABLE() or a method to
specialize the widget with gimp_drawable_chooser_new_constrained() for
instance).
2023-10-01 21:02:33 +02:00
Jehan
1d16c1584f libgimp, pdb: (meson) fix building of libgimp/gimpenums.h inside the source tree.
This was not working properly and needed some external build script as well as
the stamp/bogus header trick like for other similar in-source generated code.

In the same time, I get rid of old meson code which was meant for when using
meson < 0.57.0 (since our requirement is now meson >= 0.59.0).
2023-10-01 21:02:33 +02:00
Jehan
a40357a165 libgimp: take into account case when gtk_settings_get_default() returns NULL.
I believe it should not happen in normal GUI case (which is when you create a
GimpProcedureDialog). I had the issue while moving around some plug-in code and
moved dialog creation before gimp_ui_init() by mistake. The issue was not
obvious until I followed the trace inside libgimp. This would be even more
frustrating for plug-in developers so let's have a clear warning message giving
the possible plug-in crash reason.
2023-10-01 21:02:33 +02:00
Jehan
36576c7276 libgimp: new GimpDrawableChooser widget, associated propwidget function and…
… generation of such a widget for drawable arguments in PDB procedures.
2023-10-01 21:02:33 +02:00
Jehan
236fd01a1c libgimpwidgets: new gimp_preview_area_reset() function.
The various drawing APIs are cumulative which is not right when we want to
change a preview (especially if the preview changes dimensions! Then we end up
with pieces of the previous drawing behind the new one).

This new function will allow to reset the whole drawing. Note that we may end up
with some black background if the preview are doesn't have the right dimensions.
This should be improved later too.
2023-10-01 21:02:33 +02:00
Jehan
63a97d3be6 app, libgimp, pdb: new PDB group gimpdrawableselect.
Similarly to the various GimpResource select PDB calls, this allows to call a
core dialog in order to choose a drawable which will be returned back to the
calling plug-in.

This new GimpPickableSelect dialog is a subclass of GimpPdbDialog and uses the
same GimpPickableChooser widget as GimpPickablePopup, except that since it's
inter-process window management, it is harder to make a popup positioned
accurately relatively to a parent (especially on Wayland). This is why it's a
separate widget as a simpler dialog (which we will still try to make transient
as much as possible across platforms).
2023-10-01 21:02:33 +02:00
Jehan
901f056878 app: improve GimpPickableButton and split GimpPickablePopup.
Improvements of GimpPickableButton:

- Update the selected pickable live as you choose it in the popup. This allows
  for instance to get live preview of GEGL operations while staying within the
  pickable popup.
- Store the initially selected pickable (before popping up) so that when one
  cancels (either with Esc key or by clicking outside the popup, but not on the
  parent button), the button comes back to the previous pickable.
- Properly destroy the popup when the parent widget is finalized to avoid
  annoying cases where the popup might still be alive.

Additionally I split the GimpPickablePopup with a GimpPickableChooser containing
most of the GUI, which will make it usable as plug-in pickable chooser as well!
2023-10-01 21:02:33 +02:00
Jehan
8059de502a app: clicking on the GimpPopup parent emits a "confirm" signal.
Clicking on the parent (typically a button, as in the GimpPickableButton case
used in GEGL operations' generated GUI) used to emit "cancel". Let's have it
emit "confirm" instead.
Also it makes for a "confirm" interaction through pointer action as there were
none until now (only key "confirm", e.g. Enter or Space keys), unless
implemented in a child class (e.g. GimpPickablePopup would emit "confirm" on
activate-item of the tree view widgets, e.g. when double-clicking an item; that
was not ideally discoverable).
2023-10-01 21:02:33 +02:00
Alx Sa
8be4592e38 plug-ins: Port gimpressionist to gimp_image_procedure_new2 ().
A few minor code style issues were also fixed.
Note that there's only one procedure parameter (Preset name), 
but it's not retained between runs.
I want to ask about this before making a full conversion to
GimpProcedureDialog widgets.
2023-10-01 21:02:33 +02:00
Alx Sa
7e25a6a1e4 plug-ins: port colormap-remap to gimp_image_procedure_new2()
Also fixing some formatting mistakes left in from the GAction port.
2023-10-01 21:02:33 +02:00
Jehan
62a3889617 libgimp: rename Gimp*SelectButton widgets to Gimp*Chooser.
This name was really irking me because it's not a button (anymore? Maybe it used
to be just a button). Depending on the specific widget, it will have several
sub-widgets, including a label. And it can theoretically even be something else
than a button.

So let's just rename these widgets with the more generic "chooser" name.
2023-10-01 21:02:33 +02:00
Jehan
55d6f6c26e libgimp: move GimpFont, GimpGradient and GimpPalette to their own file.
Even though we don't have specific additional functions right now, it's just
much more cleaner this way.
2023-10-01 21:02:33 +02:00
Jehan
457f52a6d1 app, libgimp, pdb: new gimp_pattern_get_buffer() and improved GimpPatternSelectButton.
Similar to the latest commits for GimpBrush:

- gimp_pattern_get_buffer() returns a GeglBuffer and allow getting a scaled
  version of the pattern.
- Old gimp_pattern_get_pixels() is made private.
- Moved GimpPattern into its own file and store the buffer to avoid re-querying
  it through PDB continuously.

No as for the widget to select a pattern:

- Preview frame ensured to be square.
- Default size increased.
- Drawing code using the new gimp_pattern_get_buffer().
- Cleaned up code.
2023-10-01 21:02:33 +02:00
Jehan
330d05e2fc libgimp: gimp_brush_get_buffer() returns a buffer with alpha.
So what I realized was that the core was sending contents without transparency.
Actually the mask was our transparency channel here. Since in most use cases,
what you want to do when you request a brush buffer is to be able to draw it
somewhere, having a buffer already with alpha is much better, even more because
by default, it looks like background color is black which is possibly not what
you expect usually from a brush preview.

If someone wants absolutely no-alpha, it's easy to get rid of the channel. It's
simply better that the default behavior is the most expected use case.
2023-10-01 21:02:33 +02:00
Jehan
0e6c06044c libgimp, plug-ins: massively improve GimpBrushSelectButton.
- Increase the default size to 40x40 and multiply it by the current window scale
  factor to have decent preview size.
- Make the brush preview always square with a GtkAspectFrame: even though
  brushes are not necessarily square, this is a much more obvious size rather
  than letting GTK choose a random allocation size which ends up very weird
  looking.
- Scale down the brush to the biggest possible dimensions which fit the square
  preview area (if the brush native size is already smaller, I don't scale up
  though) while keeping aspect ratio: previous implementation was really weird,
  as we were only seeing a tiny corner of much brushes as we weren't scaling
  them down. Obviously I use new gimp_brush_get_buffer|mask() functions for
  this as it supports scaling.
- Implement drawing color brushes too: the previous implementation was only
  drawing the brush mask, which was absolutely not what would be expected for
  such brushes.
- Add a white background behind color brushes with transparency.
- Simplify and clean up the code.

One of the consequences of this new implementation is obviously that it's
mandatory to call gegl_init() when using this widget.
2023-10-01 21:02:33 +02:00
Jehan
1ff9c12b1e libgimp, pdb: replacing gimp_brush_get_pixels() by gimp_brush_get_buffer()…
… and gimp_brush_get_mask().

gimp_brush_get_pixels() was a bit crappy, returning raw data with only
dimensions and bpp to go with (no color model/space, no bit depth…). So the
assumption is that we work with 8-bit per channel data, possibly with alpha
depending of number of channels as deduced from bpp, and very likely in sRGB
color space. It might be globally ok with many of the brush formats (and
historical brushes) but won't fare well as we improve brush capabilities.

- gimp_brush_get_pixels() is in fact made private.
- The 2 new functions are using this old PDB call _gimp_brush_get_pixels() to
  construct buffers. This has some limitations, in particular that it returns
  only 8-bit per channel sRGB data, but at least the signature won't change when
  we will improve things in the future (so if some day, we pass fancy brushes in
  high-bit depth, the method will stay the same).
- This new implementation also allows scaling down the brush (keeping aspect
  ratio) which is useful when you need to fit a brush preview into a drawing
  widget.
- Current implementation stores the buffers at native size in the libgimp's
  GimpBrush object, hence save re-querying the core every time you need an
  update. This can be improved as current implementation also means that you
  don't get updates if the brush changed. This should handle most common use
  cases for now, though.
- Also with this change, I move GimpBrush class implementation into its own
  dedicated file.
2023-10-01 21:02:33 +02:00
Jehan
ead5d01d27 libgimp*, plug-ins: reorganize the resource property choosers.
- Move the property widget functions for GimpResource properties into a new
  libgimp/gimppropwidgets.[ch] file. This mirrors the files
  libgimpwidgets/gimppropwidgets.[ch] which are for more generic property types.
- Rename the functions gimp_prop_chooser_*_new() to gimp_prop_*_chooser_new().
- gimp_prop_chooser_factory() doesn't need to be public.
- Add a label to GimpResourceSelectButton, make so that the
  gimp_prop_chooser_*_new() functions set the property nick to this label and
  add this label to the size group in GimpProcedureDialog.
2023-10-01 21:02:33 +02:00
Jehan
538cdea996 libgimp: make GimpResourceSelectButton abstract.
Rather than *saying* it is abstract, make it really so with
G_DEFINE_ABSTRACT_TYPE_WITH_PRIVATE().
2023-10-01 21:02:33 +02:00
Jehan
66a05c885a app: fix a complicated race condition when callback from GimpPdbDialog and…
… from the plug-in normal runtime crossed streams!

I also add a huge comment in-code, because this was annoying enough to
understand and debug that I don't want someone to remove the idle without proper
consideration and testing in the future, thinking it's useless.
2023-10-01 21:02:33 +02:00
Jehan
d84c4d763b app, libgimp, pdb: all gimp_*_popup() PDB calls now take a resource object as…
… argument (not a resource name).
2023-10-01 21:02:33 +02:00
Jehan
b578fd8cf1 app, libgimp, plug-ins: a lot of cleanup in GimpResourceSelect* code.
- Removing useless or redundant code.
- Simplifying various logics.
- Using GimpResource directly in temporary PDB procedures, not resource names.
- Better cleanup of the core resource chooser when the plug-in dialog quits (we
  need it to ask core to close also any visible resource chooser dialog).
- Replace the "Close" button by more common OK/Cancel. In particular, the
  GimpPdbDialog now properly keeps track of the initial object and when hitting
  "Cancel" (or Escape key), this initial object is set back.
- Clean up some of the comments, especially when the code is self explanatory.

There is still much more to clean and improve, but it's a first welcome step.
2023-10-01 21:02:33 +02:00
Jehan
19a005ad0f libgimp: properly free resources from the config.
Found by the definitely useful libgimp warnings:

> gimp_plug_in_destroy_proxies: ERROR: GimpPattern proxy with ID 13 was refed by plug-in, it MUST NOT do that!
2023-10-01 21:02:33 +02:00
Jehan
6601e861c4 libgimp*: support having procedure arguments of generic type GimpResource. 2023-10-01 21:02:33 +02:00
Jehan
f759c1e3d9 app, libgimp, pdb: use objects in various gimp_*_set_popup() functions. 2023-10-01 21:02:33 +02:00
Jehan
c5bfe07deb app: default to the system defaults for header bar in GimpPdbDialog creation. 2023-10-01 21:02:33 +02:00
Alx Sa
192bd42510 plug-ins: Removing "args" reference from file-jp2-load
One instance of `(GIMP_VALUES_GET_INT (args, 0)` was missed during the initial conversion.
This caused a compiler error. The value is now retrieved from the GimpProcedureConfig 
object.
2023-10-01 21:02:33 +02:00
Jehan
6aeb456e17 app, libgimp, pdb: add a parent_window parameter to gimp_*_popup() PDB calls.
Brush, font, gradient, palette and pattern choices are currently chosen through
a dialog created by the core, which then returns the user choice to the calling
plug-in. This has the unfortunate consequence of having a pile of likely at
least 3 windows (main GIMP window by core process, plug-in window by plug-in
process, then the choice popup by the core process) shared in 2 processes, which
often end up under each other and that's messy. Even more as the choice popup is
kinda expected to be like a sub-part of the plug-in dialog.

So anyway, now the plug-in can send its window handle to the core so that the
resource choice dialog ends up always above the plug-in dialog.

Of course, it will always work only on platforms where we have working
inter-process transient support.
2023-10-01 21:02:33 +02:00
Jehan
d6a2deb305 libgimpwidgets: new function gimp_dialog_get_native_handle(). 2023-10-01 21:02:33 +02:00
Jehan
9a57ab54e9 app, libgimp*: window handle on Windows have the type HANDLE.
Instead of passing a guint32, pass the proper type, since our the HANDLE type
can be 64-bit on Windows (according to links I found).
I was hoping it might be the reason for the breakage under Windows, though I
also found Microsoft documentation saying that the 64-bit handle can be safely
truncated: https://learn.microsoft.com/en-us/windows/win32/winprog64/interprocess-communication?redirectedfrom=MSDN

Nevertheless I'd appreciate testing again from NikcDC or anyone else, as I
reactivated setting transient between processes on Windows.

Note that I also pass the proper types on X11 now (Window), even though guint32
worked fine. Better be thorough.
2023-10-01 21:02:33 +02:00
Jehan
73e6d4b76c plug-ins: make parent window identifier for Wayland in Freedesktop portal.
The format for this "common convention" argument is explained here:
https://flatpak.github.io/xdg-desktop-portal/#parent_window
2023-10-01 21:02:33 +02:00
Jehan
58b3b14082 app, libgimp*, pdb, plug-ins: reimplement generic inter-process transient window.
Having windows ID as guint32 is a mistake. Different systems have
different protocols. In Wayland in particular, Windows handles are
exchanged as strings. What this commit does is the following:

In core:

- get_window_id() virtual function in core GimpProgress is changed to
  return a GBytes, as a generic "data" to represent a window differently
  on different systems.
- All implementations of get_window_id() in various classes implementing
  this interface are updated accordingly:
  * GimpSubProgress
  * GimpDisplay returns the handle of its shell.
  * GimpDisplayShell now creates its window handle at construction with
    libgimpwidget's gimp_widget_set_native_handle() and simply return
    this handle every time it's requested.
  * GimpFileDialog also creates its window handle at construction with
    gimp_widget_set_native_handle().
- gimp_window_set_transient_for() in core is changed to take a
  GimpProgress as argument (instead of a guint32 ID), requests and
  process the ID itself, according to the running platform. In
  particular, the following were improved:
  * Unlike old code, it will work even if the window is not visible yet.
    In such a case, the function simply adds a signal handler to set
    transient at mapping. It makes it easier to use it at construction
    in a reliable way.
  * It now works for Wayland too, additionally to X11.
- GimpPdbProgress now exchanges a GBytes too with the command
  GIMP_PROGRESS_COMMAND_GET_WINDOW.
- display_get_window_id() in gimp-gui.h also returns a GBytes now.

PDB/libgimp:

- gimp_display_get_window_handle() and gimp_progress_get_window_handle()
  now return a GBytes to represent a window handle in an opaque way
  (depending on the running platform).

In libgimp:

- GimpProgress's get_window() virtual function changed to return a
  GBytes and renamed get_window_handle().
- In particular GimpProgressBar is the only implementation of
  get_window_handle(). It creates its handle at object construction with
  libgimpwidget's gimp_widget_set_native_handle() and the virtual
  method's implementation simply returns the GBytes.

In libgimpUi:

- gimp_ui_get_display_window() and gimp_ui_get_progress_window() were
  removed. We should not assume anymore that it is possible to create a
  GdkWindow to be used. For instance this is not possible with Wayland
  which has its own way to set a window transient with a string handle.
- gimp_window_set_transient_for_display() and
  gimp_window_set_transient() now use an internal implementation similar
  to core gimp_window_set_transient_for(), with the same improvements
  (works even at construction when the window is not visible yet + works
  for Wayland too).

In libgimpwidgets:

- New gimp_widget_set_native_handle() is a helper function used both in
  core and libgimp* libraries for widgets which we want to be usable as
  possible parents. It takes care of getting the relevant window handle
  (depending on the running platform) and stores it in a given pointer,
  either immediately or after a callback once the widget is mapped. So
  it can be used at construction. Also it sets a handle for X11 or
  Wayland.

In plug-ins:

- Screenshot uses the new gimp_progress_get_window_handle() directly now
  in its X11 code path and creates out of it a GdkWindows itself with
  gdk_x11_window_foreign_new_for_display().

Our inter-process transient implementation only worked for X11, and with
this commit, it works for Wayland too.

There is code for Windows but it is currently disabled as it apparently
hangs (there is a comment in-code which links to this old report:
https://bugzilla.gnome.org/show_bug.cgi?id=359538). NikcDC tested
yesterday with re-enabling the code and said they experienced a freeze.
;-(

Finally there is no infrastructure yet to make this work on macOS and
apparently there is no implementation of window handle in GDK for macOS
that I could find. I'm not sure if macOS doesn't have this concept of
setting transient on another processus's window or GDK is simply lacking
the implementation.
2023-10-01 21:02:33 +02:00
Alx Sa
bf210243f2 plug-ins: Port selection-to-path.c to gimp_image_procedure_new2()...
...and to GimpProcedureDialog.
selection-to-path-dialog.c was also removed as the code can now be contained
within selection-to-path.c thanks to the new API.
2023-10-01 21:02:33 +02:00
Jehan
dd1c12a0e1 plug-ins: port script-fu-script.c to gimp_image_procedure_new2(). 2023-10-01 21:02:33 +02:00
Jehan
7f34fb14f7 plug-ins: port pagecurl to gimp_image_procedure_new2() and GimpProcedureDialog.
I'm also changing various arguments to GimpChoice and making "opacity" into an
argument.
2023-10-01 21:02:33 +02:00
Jehan
77a30bfd28 app, libgimp: core loads thumbnail from metadata if no GimpThumbnailProcedure…
… is set.

The order for thumbnail creation in gimp_imagefile_create_thumbnail() is now:

1. If there is a GimpThumbnailProcedure, it is run first.
2. Otherwise we check if a thumbnail is in the metadata.
3. As last resort, we just load the full image.

Part of the fix was to copy gimp_image_metadata_load_thumbnail() into the core
code. I have been wondering if we could not drop the same function from libgimp
and remove the GimpThumbnailProcedure frome file-jpeg, since it just uses the
metadata thumbnail and it is the only plug-in using this code.
Also it is much faster to run this in core and it's generic function which makes
thumbnail loading from Exif data working for every format supported by Exiv2.

On the other hand, the file-jpeg thumbnail procedure also gathers a few more
useful information, such as the color model (in a reliably manner, since based
on JPEG header, unlike from metadata which may be wrong).
2023-10-01 21:02:33 +02:00
Jehan
742bdb4ebe app: fix handling of GimpThumbnailProcedure return values.
There were a bug in some array size check and the image type is an enum, not
simply an int.
2023-10-01 21:02:33 +02:00
Jehan
fa67a6ce0e libgimp, plug-ins: properly document the return values of GimpThumbnailProcedure.
The various information (width, height, image type and number of layers) are
those of the full image, not of the thumbnail. Make it clear in the docs of
GimpRunThumbnailFunc.

Additionally:

- file-xmc was returning the proper information but variables were wrongly
  named, which was confusing.
- Fix file-ico thumbnail proc which was returning the thumbnail width/height.
- In file-darktable, initialize width/height to 0 so that we just don't show any
  size when we don't get the information. It's better not to show anything than
  completely wrong information (the thumbnail target size).
2023-10-01 21:02:33 +02:00
Jehan
9124f9c627 plug-ins: fix algorithm for choosing the best thumbnail of ICNS image.
We were choosing the bigger icon in the ICNS list. Instead let's choose the
bigger icon within the target size bounding box. In case there is no smaller (or
equal size) icon, we falls back to the smallest bigger icon.

Also make sure we set width and height to the full image size, as this is used
as information on the full image (not the thumbnail).
2023-10-01 21:02:32 +02:00
Jehan
93ad26e6bc plug-ins: load SVG image at proper size.
SVG is a vector format which is easy to render exactly within the size×size
bounding box. Let's make sure we do so.
This makes for much sharper SVG thumbnails (and also possibly faster thumbnail
render).
2023-10-01 21:02:32 +02:00
Jehan
ed98b990c5 plug-ins, libgimp: GimpRunThumbnailFunc now uses a GimpProcedureConfig rather…
… than a GimpValueArray.

Similar to other GimpProcedure, move to using a config object. A difference is
that thumbnail procedures are always run non-interactively.

Also fixing WMF load thumbnail procedure: the dimension computation was wrong
when the image was wider than tall.
2023-10-01 21:02:32 +02:00
Jehan
601437addd plug-ins: file-openraster also moved to new gimp_load_procedure_new().
Additionally getting rid of a call to gimp_image_set_file() since we clarified
its docs as not being used for non-XCF files.
2023-10-01 21:02:32 +02:00
Jehan
9e2a7e8759 libgimp, plug-ins: rename gimp_load_procedure_new2() as gimp_load_procedure_new().
All C load procedures are now moved to the new API.
2023-10-01 21:02:32 +02:00
Jehan
136aca3c34 plug-ins: port all remaining C load procedures to gimp_load_procedure_new2(). 2023-10-01 21:02:29 +02:00
Jehan
d5607454b3 plug-ins: port file-cel to gimp_load_procedure_new2() and GimpProcedureDialog.
Also the palette argument is now a proper GFile argument (not a string).

There is also a palette argument for the export procedure, but it's currently
unused. A palette storing function will need to be implemented.

Some bit of additional logic cleanup was done.
2023-10-01 20:52:02 +02:00
Jehan
c256f63d63 plug-ins: port file-png to gimp_load_procedure_new2(). 2023-10-01 20:52:02 +02:00
Jehan
885bae59ba plug-ins: port file-pdf-load to gimp_load_procedure_new2().
I also did a bit of code cleanup in the main run() load code.
2023-10-01 20:52:02 +02:00
Jehan
2416b40c26 plug-ins: port file-svg to gimp_load_procedure_new2 and GimpProcedureDialog.
Again, I am losing a tiny bit of UI, in particular the ratio fields, but also
the update of the size label (this was kinda broken anyway, as it updated only
when updating some fields, not others).

Also moving the default resolution to 300 PPI.

Last but not least, I transformed the "paths" int argument to a GimpChoice
argument.
2023-10-01 20:52:02 +02:00
Jehan
7a0fd77b95 plug-ins: port file-wmf to gimp_load_procedure_new2 and GimpProcedureDialog.
The new dialog is not fully on-par with the old one. We lost the X and Y ratio
fields as well as the ability to constrain dimensions to each other. This should
be improved when we'll get proper automatically generated widgets for dimension
arguments.
2023-10-01 20:52:02 +02:00
Jehan
4a3fd7423a plug-ins: port various plug-ins to gimp_load_procedure_new2(). 2023-10-01 20:52:02 +02:00
Jehan
af644b1950 libgimp, libgimpbase: new gimp_load_procedure_new2() for run() function using…
… a GimpProcedureConfig for arguments.

This also factorizes the code to load metadata. By default, a GimpLoadProcedure
will try and load metadata from a file (if Exiv2 knows the format). The run()
function will be allowed to edit the GimpMetadata object but also the load flags
before it is actually attached to the image, allowing plug-ins to have custom
metadata handling code when needed.
2023-10-01 20:52:02 +02:00
Jehan
2d33f1fb39 plug-ins: "compression" arg of file-tiff-save now becomes a GimpParamChoice. 2023-10-01 20:52:02 +02:00
Jehan
d670ff9f82 libgimpbase, libgimpwidgets: add a concept of insensitive choices in GimpChoice.
This is used in the generated GUIs for GimpChoice arguments, but also for
validation of property setting.

New functions:

* gimp_choice_set_sensitive()
* gimp_string_combo_box_set_sensitivity()
2023-10-01 20:52:02 +02:00
Jehan
cedc45d8f3 plug-ins: change "format" aux argument to a GimpChoice. 2023-10-01 20:52:02 +02:00
Jehan
555c428b70 libgimp: new utility method gimp_procedure_config_get_choice_id().
This is just a method to simplify transforming a GimpChoice argument into an
enum value, which is easier to deal with, in C. It also allows to benefit from
switch() warnings or the like to make sure no cases are missing.
2023-10-01 20:52:02 +02:00
Jehan
9a0cfa67bf libgimp: generate a list of possible choices for a GimpChoice argument.
Developers won't have to maintain manually a list of the possible values in the
help string. It can now be generated from the GimpChoice and will be therefore
ensured to always be up-to-date, and nicely formatted.

I also add some pango markup to the type helper texts to differentiate it from
the main argument docs.
2023-10-01 20:52:02 +02:00
Jehan
4163a29af3 app, libgimp: new GimpChoice procedure argument.
These will replace the int arguments used in place of enums. The problem of int
arguments used as list of choices is that it makes calling PDB functions very
opaque. This is especially bad when a list is long, so you constantly have to
refer to the documentation to understand what a series of numbers mean in
argument lists.

And the second issue is that plug-in developers have to manually maintain a list
of values both in the GUI and in the documentation string. This help text may
get out-of-sync, may end up with missing values or whatnot. Also if it is used
as tooltips, it makes for very weird tooltips in the graphical interface, with
an overlong technical list of int-values mapping which should ideally only be
made visible in the PDB procedure browser listing.
2023-10-01 20:52:02 +02:00
Jehan
20923260cf libgimpwidgets: new GimpLabelStringWidget and update GimpStringComboBox.
- GimpLabelStringWidget widget makes any widget with a "value" string property
  into a GimpLabeled.
- Add a "value" string property to GimpStringComboBox (which makes it usable by
  GimpLabelStringWidget).
2023-10-01 20:52:02 +02:00
Jehan
7e6b01a4e5 libgimpbase: new GimpChoice class meant to represent a list of allowed values.
This will be used for creating limited lists of strings as argument types for
procedures.
Ideally enums are the best type for this, but it can only be used for generic
libgimp* enum types, not custom enums created only for a given plug-in. For
this, we currently just demote the args to ints which lose any semantic. A
limited list of string will give back some semantic and some better validation,
even though it's a tiny bit more annoying to work with strings than int types
(at least in C).
2023-10-01 20:52:02 +02:00
Jehan
29ce8f234f libgimp*: removing now useless Makefile.gi files.
These were include files for the autotools build and are now unused.
2023-10-01 20:52:02 +02:00
Jehan
1dc5635d32 libgimp: support all subtypes of GFile.
In particular if a GFile is created with g_file_new_for_path(), it will be a
GLocalFile. We need this to be supported too.
2023-10-01 20:52:02 +02:00
Alx Sa
3c53d5f38e plug-ins: port cml-explorer to gimp_image_procedure_new2()
Also fixes some spelling issues and removes a warning about an
uninitialized variable.
Currently the only argument is for non-interactive mode, so
the dialogue isn't ported to GimpProcedureDialog yet.
2023-10-01 20:52:02 +02:00
Alx Sa
22cb6b3bb6 plug-ins: port goat-exercise to gimp_image_procedure_new2()
Not yet porting to GimpProcedureDialog because there's no settings to import/export,
so it would add several unnecessary buttons.
2023-10-01 20:52:02 +02:00
Alx Sa
6dc21425c0 plug-ins: port smooth-palette to gimp_image_procedure_new2()
The dialog itself is ported to GimpProcedureDialog. However, the
width and height require another API that allows for size entries with
multiple fields before it can be considered finished.
2023-10-01 20:52:02 +02:00
Jehan
37a867d85a plug-ins: port file-farbfeld to new gimp_save_procedure_new().
This was not forgotten, simply this is a new plug-in which got into the tree
after a rebase. ;-)
2023-10-01 20:52:02 +02:00
Jehan
cd5d221cfa libgimpconfig: add (de)serialization support of GBytes arguments.
Basically the same as GimpParasite, except that we don't same a parasite name
and flags.
2023-10-01 20:52:02 +02:00
Jehan
69edf13e2c plug-ins: fix the GimpSaveProcedure plug-ins in Python.
As usual, these got forgotten!

Also colorxhtml is actually deeply broken by commit 89c359ce47 which removed
gimp_drawable_get_pixel() (Niels thought it was not used, whereas it was simply
harder to spot with bindings!).
This will have to be fixed eventually.
2023-10-01 20:52:02 +02:00
Jehan
fcc810d7d3 libgimp, plug-ins: rename to gimp_save_procedure_new().
Also the mimetype is already set by gimp_file_procedure_set_mime_types() so
transform the mimetype argument into an export_metadata argument.
2023-10-01 20:52:02 +02:00
Jehan
06bd1f1289 plug-ins: port file-gih to GimpSaveProcedureDialog.
I was hoping to redesign further but the whole logic of animated brush creation
is made so complicated that I think it would require a whole more complex GUI
with visual hints. So anyway I stopped at basic redesign and port to the new
dialog generation code.
It still makes the code much simpler and a bit more powerful (also less bugs
hopefully). I have also reviewed the procedure arguments, removing redundant
ones (display-cols and display-rows are just computed from cell-width and
cell-height) and adding some aux arguments instead to simplify dynamic GUI code.
2023-10-01 20:52:02 +02:00
Jehan
272bc69540 libgimpwidgets: improve gimp_label_spin_set_increments().
The assert tests were not taking well into account the case where upper == lower
or where it's an integer spin which is just separated by 1 (both cases seem
silly, but it makes sense in the case of generic — or even dynamic! — spin
widgets where we want to adjust the min and max, e.g. depending on the property
of the image, or on other settings.
2023-10-01 20:52:02 +02:00
Jehan
92e77a4541 libgimp: add ability to sync a label to a string property of a procedure.
Now gimp_procedure_dialog_get_label() can work both with an existing property ID
or a new property ID. In the former case, it will simply sync the label with the
procedure argument, which will make it easy to update the label contents. In the
latter case, it just initialize with the provided text.
2023-10-01 20:52:02 +02:00
Jehan
689e3da5b9 plug-ins: port the last GimpSaveProcedure to gimp_save_procedure_new2().
It's the basic stupid port, though this dialog is so bad that I think I'm going
for a second stage with a basic redesign of this GUI while also moving to
GimpSaveProcedureDialog. To be continued.
2023-10-01 20:52:02 +02:00
Jehan
9ed8f00e5b plug-ins: port most plug-ins to gimp_save_procedure_new2(). 2023-10-01 20:52:02 +02:00
Jehan
51b14a7978 libgimp: fix object memory management in GimpPlugIn.
The expectation of 2 references per object in gimp_plug_in_destroy_proxies() was
wrong. It is true during most of the plug-in life, because both the
GimpProcedure and the GimpPlugIn have a hash-table keeping their own reference
to it, except that in gimp_plug_in_pop_procedure(), we release the reference
owned by the procedure with _gimp_procedure_destroy_proxies() first. So at this
point of the object life, its reference count is supposed to be 1.

The source of the bug was in fact in _gimp_plug_in_get_*() (where * can be
display, image, item or resource) which was behaving differently the first time
it is called for an object with the successive calls. In the first call only, it
was creating then refing into the table (so the object started directly with 2
references) whereas on successive calls, it just returned the hashtable-looked
up reference. In other words, it behaved as a (transfer full) on the first call
and (transfer none) on successive calls. And so did all public API which were
making use of this infrastructure (in particular gimp_*_get_by_id() functions).
2023-10-01 20:52:01 +02:00
Jehan
44e2bab9ad plug-ins: remove "num-images" argument and improve error feedback.
The arg "num-images" is clearly redundant as the "images" array already has this
information. Moreover it is bug-prone, for instance running 'Repeat "Filmstrip"'
would crash the plug-in which was defaulting to NULL "images" and 1 "num-images"
(without any GimpItem serialization ability yet).
Of course, we could just fix this, but better remove the redundant arg and all
possibilities of future similar bugs.

Also I now display a proper error message when running without input images
which says: "\"Filmstrip\" cannot be run without any input images"
2023-10-01 20:52:01 +02:00
Jehan
df6ccf390f plug-ins: fix possibly unreffing a NULL pointer. 2023-10-01 20:52:01 +02:00
Jehan
48f0ac3ad5 libgimp: release leaked reference to resource object.
The widget_creator_func() given to gimp_prop_chooser_factory() will create an
object which will take its own reference. We must release the one we got with
g_object_get().
2023-10-01 20:52:01 +02:00
Jehan
dac29b17a8 libgimp: some memory leak fixed. 2023-10-01 20:52:01 +02:00
Jehan
14bcaa717b plug-ins: a bunch of more plug-ins ported to gimp_save_procedure_new2(). 2023-10-01 20:52:01 +02:00
Jehan
b23519a401 plug-ins: port to gimp_save_procedure_new2() all export procedures…
… which were using gimp_procedure_config_begin_export().
2023-10-01 20:52:01 +02:00
Jehan
da7e8f3388 libgimp: new gimp_save_procedure_new2() meant to replace gimp_save_procedure_new().
Metadata handling is also integrated in this API:

* while giving a possibility to disable metadata saving if you want to do it
  yourself (e.g. in file-heif), by setting a NULL MimeType;
* and the GimpMetadata object is added as run() argument, allowing one to edit
  the metadata during the run, while still letting the infrastucture handle the
  save (e.g. in file-jpeg);
* or to save intermediate metadata with gimp_procedure_config_save_metadata()
  (e.g. in file-tiff).
2023-10-01 20:52:01 +02:00
Jehan
602345143f libgimp: more removal of over-refing. 2023-10-01 20:52:01 +02:00
Jehan
f37c3c42c7 libgimp: simplify GimpFileProcedure public API with G_DECLARE_DERIVABLE_TYPE().
While we definitely should not use this inside app/, because having the private
structure easily accessible as a member is very convenient, it is clear that it
makes for a much nicer public signature. Also the priv member is of no help to
third-party developers using this API to make plug-ins and is better hidden in
such a case.
2023-10-01 20:52:01 +02:00
Alx Sa
e79de5db86 plug-ins: port small-tile to gimp_image_procedure_new2()
The dialog itself is ported to GimpProcedureDialog, but the original 
plug-in only had one config parameter (Number of Tiles).
Some of the other options might make sense as config parameters 
such as the horizontal/vertical toggles and opacity.
2023-10-01 20:52:01 +02:00
Jehan
3c1ecd53ff plug-ins: port film to GimpProcedureDialog.
I needed a few more GimpProcedureDialog widgets, which I now have. The only part
still not generated in this plug-in is the image selection. This is hundreds of
lines less!

It now has arguments for every usable setting (except "keep-height" which is an
aux arg because it is simulated with a 0 "film-height" in non-interactive mode).

Also the film-height/keep-height default in interactive mode is now much better.
I override the film-height default and set it to be the image's height. This
makes for a much better default at all time.

The "Reset" button in Advanced section is not useful anymore since we now have
the generic "Reset" (to Initial/Factory) of GimpProcedureDialog, though it
actually doesn't work right for the time being, as it fails serializing
GimpFont.
2023-10-01 20:52:01 +02:00
Jehan
5cc1c898d7 libgimp, plug-ins: enhance gimp_procedure_dialog_get_label() with markup and…
… mnemonic abilities.
2023-10-01 20:52:01 +02:00
Jehan
2f1c569249 libgimp: new gimp_procedure_dialog_fill_paned() function. 2023-10-01 20:52:01 +02:00
Jehan
334febdebb libgimp: new gimp_procedure_dialog_fill_notebook*() functions. 2023-10-01 20:52:01 +02:00
Jehan
fc9a720b31 libgimp: some debug printing for plug-in developers.
This will be useful for plug-in developers but also for us. Seeing we leak the
config object is often a good indication that something is wrong in our handling
of internal references (since everything relies on the config object in plug-ins
now, in particular all the GUI).
2023-10-01 20:52:01 +02:00
Jehan
e6e3545959 libgimp: all the over-reffing was wrong.
I was clearly confused when I wrote this. The sinking part matters to take
ownership of a reference in the widgets table, but we don't need to ref widgets
again before inserting them in containers. We were leaking widgets and as a
consequence the config object (and as a second consequence, some objects such as
resources for resource-selection widgets).
2023-10-01 20:52:01 +02:00
Jehan
99d4c504d0 plug-ins: port film to gimp_image_procedure_new2().
The dialog is not ported to GimpProcedureDialog yet. It will be worth doing it
as a second step.
2023-10-01 20:52:01 +02:00
Jehan
f5183cbd7b plug-ins: port warp to gimp_image_procedure_new2().
It would be worth porting when GimpDrawableComboBox widgets can be used as
GimpProcedureDialog generated widgets. Or even better, if the GimpPickableButton
were ported to libgimp to be used by plug-ins (since it's actually a lot more
usable).
2023-10-01 20:52:01 +02:00
Jehan
2f91e45b4f plug-ins: port easy plug-ins to gimp_image_procedure_new2().
These were the plug-ins already using gimp_procedure_config_*() API.
2023-10-01 20:52:01 +02:00
Jehan
2a21d45ada plug-ins: port grid to gimp_image_procedure_new2().
I didn't port to GimpProcedureDialog because we'd need first a GimpSizeEntry
generatable widget, which can map to several properties (here for instance 3
width properties).
2023-10-01 20:52:01 +02:00
Jehan
3c658789a6 plug-ins: now port to gimp_image_procedure_new2() all plug-ins without args. 2023-10-01 20:52:01 +02:00
Jehan
4f14f620c4 plug-ins: port to gimp_image_procedure_new2() all plug-ins which were already…
… working with a GimpProcedureConfig.

These are the easiest ones to port as most of the work was already done (mostly
just some now useless calls to remove).
2023-10-01 20:52:01 +02:00
Jehan
96b3302e65 plug-ins: port gradient-flare to gimp_image_procedure_new2() and GimpProcedureDialog.
The port to GimpProcedureDialog is partial as there are still quite a few pieces
which can be improved. But it's a good start.
2023-10-01 20:52:01 +02:00
Jehan
7da0db9e88 plug-ins: port tile to gimp_image_procedure_new2() and GimpProcedureDialog. 2023-10-01 20:52:01 +02:00
Jehan
8c8c64a9ee libgimp: temporary gimp_image_procedure_new2() until port is over.
Same as with gimp_procedure_new2(), I will end up renaming the function to
gimp_image_procedure_new() once all usage of this function will have been ported
to the new function using GimpProcedureConfig instead of GimpValueArray
arguments.
2023-10-01 20:52:01 +02:00
Jehan
3806b46fc5 plug-ins: forgotten Python plug-ins had to be ported to new Gimp.Procedure.new().
There was also one case of port to updated GimpResource API to get the name of a
palette.
2023-10-01 20:52:01 +02:00
Jehan
2b38a2df86 libgimp, plug-ins: rename gimp_procedure_new2() as gimp_procedure_new() and…
… remove the latter.

Now all GimpProcedure use this new implementation with use a config object.
2023-10-01 20:52:01 +02:00
Jehan
f6f622b93d libgimp: port 2 usages of gimp_procedure_new() to gimp_procedure_new2().
The one in GimpResourceSelect is a very nice example of why using config objects
is much nicer, getting arguments by their name instead of an index (which in
this case had to be tracked down by a private function to handle different
cases).
2023-10-01 20:52:01 +02:00
Jehan
a2acf24ecb libgimp, plug-ins: Script-fu scripts now use gimp_procedure_new2() too.
Also in gimp_procedure_config_begin_run(), make sure we sync the arguments with
the config object first thing, even in interactive and with-last-vals case
(where the args may be further overridden). This was especially important for
Script-fu scripts as the image and drawable were not provided separately, so we
need to make sure that the config file has the right values.
2023-10-01 20:52:01 +02:00
Jehan
5d3112a2f1 plug-ins, libgimp: move GimpBatchProcedure's run function to use config objects.
Also port more script-fu procedures to gimp_procedure_new2(), which were sharing
some code with the script-fu batch procedure.
2023-10-01 20:52:01 +02:00
Jehan
af00b66914 plug-ins: port the easy script-fu procedures to gimp_procedure_new2(). 2023-10-01 20:52:01 +02:00
Jehan
38ecbfc762 plug-ins: more plug-ins ported to gimp_procedure_new2(). 2023-10-01 20:52:01 +02:00
Jehan
c09711beaa libgimp: the default run (if no run-mode parameter) should be non-interactive.
Otherwise we will always try to reuse previous values or use the default,
bypassing the actual passed values.

I encountered this issue while porting file-glob and realizing that the
"pattern" argument was always passed to NULL, ignoring the explicitly set
pattern.

When a procedure has no run-mode argument, we should simply not assume anything
and use the passed arguments (which is what the non-interactive mode does).
2023-10-01 20:52:01 +02:00
Jehan
9b2240f51e plug-ins: port web-page to GimpProcedureDialog and gimp_procedure_new2().
Again a lot less lines for more functionalities (e.g. now it should work fine in
WITH_LAST_VALS mode).
2023-10-01 20:52:01 +02:00
Jehan
e92ef9d45a plug-ins: port several of the easy plug-ins to gimp_procedure_new2(). 2023-10-01 20:52:01 +02:00
Jehan
f6da799c11 plug-ins: port screenshot to GimpProcedureDialog and gimp_procedure_new2().
A lot less lines for the same functionalities!
This includes improvements too:

* "include-pointer" as new PDB argument;
* settings storage thanks to GimpProcedureDialog;
* it should hopefully work better in non-interactive (though it's untested).

The macOS and Windows screenshots are untested after this change, though they
should still work the same. Please report if there is any problem!
2023-10-01 20:52:01 +02:00
Jehan
60aeff5623 libgimp: new gimp_procedure_dialog_set_ok_label() function.
This allows to set a custom label for the OK button.
2023-10-01 20:52:01 +02:00
Jehan
59edcde06f libgimp: new function gimp_procedure_dialog_set_sensitive_if_in().
This function allows to change the sensitivity of a widget depending on the
value of another property.
We already had gimp_procedure_dialog_set_sensitive() except it was only syncing
with a boolean property, whereas the new function can compare with any property
type.
2023-10-01 20:52:01 +02:00
Jehan
edab39a868 libgimp: fix the sometimes wrong run-mode value in the config object. 2023-10-01 20:52:01 +02:00
Jehan
982764421f app: fixes the call to "plug-in-busy-dialog".
Fixes the following CRITICAL:

> g_value_set_int: assertion 'G_VALUE_HOLDS_INT (value)' failed
2023-10-01 20:52:01 +02:00
Jehan
7ab87d2b15 Issue #50: new gimp_procedure_new2() which automatically stores procedure config.
This new function is meant to replace gimp_procedure_new() when all plug-in
usage will have been switched.

This function creates the GimpProcedureConfig object on behalf of the plug-in
and calls gimp_procedure_config_begin_run() and gimp_procedure_config_end_run().
This way we ensure that all plug-in calls with successful result are properly
stored without asking the developer not to forget to call these (if a "good
practice" is in fact something we request to do every time, especially for good
user experience, we might as well make it rather a core process).

Advantages:

* Better interactive experience: using any plug-in will result in saved
  previously used settings.
* for developers, working on config objects is also much more comfortable than
  working on GValueArray;
* step forward for the future macro infrastructure: if we can ensure that all
  plug-in calls are properly logged, then we can replay plug-in actions, in
  NON_INTERACTIVE with the same settings.
2023-10-01 20:52:00 +02:00
Sabri Ünal
2003d26105 Update Turkish translation 2023-10-01 18:26:09 +00:00
Sabri Ünal
59fb6e0da5 Update Turkish translation 2023-10-01 18:26:01 +00:00
Alx Sa
6ad54ca3a3 plug-ins: Fix DDS vulnerability (ZDI-CAN-22093)
Resolves #10069

Currently, the DDS header information for the width, height, and bytes per scan line
are read in and assumed to be correct. As these values are used for memory allocation
and reading, it would be good to verify they do not exceed the file size.

This patch adds a condition after the header is read in to verify those values. If they exceed
the file size (mins an offset), the file is not read in and an error message is shown.
2023-10-01 17:06:25 +00:00
Jehan
0b307a3a1a NEWS: update. 2023-10-01 18:01:26 +02:00
Alx Sa
a87afa7255 themes: Set default background-color for buttons
Resolves #9996.
While GIMP has background-colors set for specific buttons,
it did not have a default button background-color. This resulted
in "random" buttons showing system theme colors like the
[Reload Current Theme] button.
This patch defines a default background-color while leaving the
specific button themes intact.
2023-09-30 01:38:37 +00:00
Anders Jonsson
56256e2721 Update Swedish translation 2023-09-29 21:02:45 +00:00
Alx Sa
865cc56894 plug-ins: Fix vulnerability in file-psd
Resolves #10101.
This patch adds a missing break statement after an error condition
is detected to prevent the code from continuing afterwards.
2023-09-29 20:38:51 +00:00
Alx Sa
e4c362a9c3 themes: Highlight when hovering over grid view icons
This adds a border when hovering over icons in various
grid views (brushes, gradients, etc). This makes it more
visually apparent which option you can click to select.
2023-09-28 19:01:05 +00:00
Vasil Pupkin
f22935d3de Update Belarusian translation 2023-09-28 17:59:51 +00:00
bootchk
89901c8466 Fix for 2.99 only #6157
Also refactoring: extract two functions

Add test case scripts/test/register-fail

Catches more registration errors.
Any errors not caught at least will not crash.

Remains to be ported to 2.10, but only a few lines,  without the refactoring.
2023-09-28 13:26:23 +00:00
Jehan
196f1d6e95 Issue #6165: crash when the system icon theme does not contain image-missing icon.
The bug is in fact in GTK. "image-missing" is supposed to never missing since
GTK embeds an icon as GResource. But it turns out that the code is buggy. So if
an icon is missing from GIMP theme, then system theme, then "icon-missing" icon
as well, GIMP crashes.

See: https://gitlab.gnome.org/GNOME/gtk/-/issues/3526

As a workaround for now, let's at least add our own "image-missing", at least in
our main themes (Color and Symbolic, not Legacy). This will make GIMP not
crashing at least by default when another icon is missing.
Of course a crash could still happen if one use Legacy or a third-party theme
and if their system theme doesn't contain "image-missing" as well, until GTK is
fixed.
2023-09-27 21:34:18 +02:00
Anders Jonsson
5b78437328 Update Swedish translation 2023-09-27 19:28:40 +00:00
Jehan
47133b48ef build: add new Belarusian translation in the installer.
This localization was added recently but it was not in the installer scripts.
Discovered with unit testing: meson test gimp:build / windows-installer-langs
2023-09-27 21:01:09 +02:00
Jehan
3dcc4196fb plug-ins: plugin-defs.pl also is a remnant from autotools! 2023-09-27 15:57:58 +02:00
Jehan
d88f6f9733 app, devel-socs, icons, plug-ins, tools: remove various autotools artifacts.
* generate-icon-makefiles.py was a tool to generate the icon-list.mk files.
* mkgen.pl was used to generate plug-ins/common/Makefile.am
2023-09-27 15:39:39 +02:00
Yuri Chornoivan
c8e4f399d0 Update Ukrainian translation 2023-09-26 16:44:30 +00:00
Vasil Pupkin
73f7e6ba44 Add Belarusian translation 2023-09-26 14:54:40 +00:00
Luming Zh
5724696105 Update Chinese (China) translation 2023-09-26 14:31:59 +00:00
Martin
b620927ee7 Update Slovenian translation 2023-09-26 13:07:06 +00:00
Mark
2e9823f8ea coffee fix 2023-09-26 10:32:55 +00:00
Jehan
f38449115f Issue #2902: Preference option to set "Interface/Theme" font size.
Though GTK+3 is supposed to take care of scaling fonts with high density
displays, it turns out it is not enough for many, for various reasons (taste,
eyesight, distance to the display…). So we add this additional settings to tweak
further the font size.

With Aryeom, we experimented/discussed both a percentage UI vs. an absolute font
size field (e.g. as they provide in GNOME Tweaks). In the end, we went for a
percentage UI because we realize that we don't necessarily know what is the
current size at all. Mostly you just want bigger or smaller, and don't
necessarily care so much at which value is the font size.

This settings only has a single limitation (that we could find), which is when
used on a theme with widget rules using absolute font-size rules (px, or
keywords such as small/medium/large). As long as the CSS rules are relative
though (either to the parent widget, or to the root size), then it works fine.
Basically a theme hard-coding font sizes won't fare well with this settings, but
since we can consider this bad practice, it's an acceptable limitation.
2023-09-25 23:05:38 +02:00
Luming Zh
f6310c3db7 Update Chinese (China) translation 2023-09-25 15:16:36 +00:00
Jehan
0a905649c2 themes: make the switch neutral in our Default theme.
Actually just use the foreground color as background when it is checked.
2023-09-25 15:19:56 +02:00
Jehan
823adbe9f9 Issue #9880: Crash on startup (invalid accelerator string '<Primary>VoidSymbol').
GTK docs is pretty clear:

> It is a programmer error to pass an invalid accelerator string. If you are
> unsure, check it with gtk_accelerator_parse() first.

So now we verify validity of accelerator strings before using shortcuts from
config files (which can be consider "human input" as the file can be modified).
2023-09-25 11:53:15 +02:00
Yuri Chornoivan
847afa116f Update Ukrainian translation 2023-09-25 06:54:33 +00:00
Ekaterine Papava
ddb8c7abad Update Georgian translation 2023-09-25 03:51:07 +00:00
Ekaterine Papava
3ba0faf87a Update Georgian translation 2023-09-25 03:49:11 +00:00
Jehan
d71cd9d277 Issue #9604: "view-zoom-*" actions should not be radio actions.
A first attempt at fixing this was going through the idea of changing the
concept of radio actions, such as allowing an active action in an action group
to be called again. Or having some action in the radio group which can be called
but never set active.

But in fact, I just realized that these zoom actions are simply not meant to be
radio actions. They are not stateful actions, nor are they exhaustive.

I also updated the `other_scale` storage logic. Instead of updating it each time
the zoom changed (which was even broken in some cases, like when changing zoom
through another action), I simply save the last custom zoom value. This is the
one which is reused across calls. I don't think always resetting to the current
zoom value is very useful (if you call this dialog, it's not to zoom to the
current zoom!). Also there was some concept of flagging this stored zoom value
as "dirty" by making it negative, but this was never actually used, which makes
me believe that current logic was not the original intent anyway.
Saving the previous custom zoom explicitly set seems to be a good enough
behavior, so let's go with it.
2023-09-24 23:51:14 +02:00
Luming Zh
589a278791 Update Chinese (China) translation 2023-09-24 17:41:44 +00:00
Yuri Chornoivan
abe67517b7 Update Ukrainian translation 2023-09-24 15:53:16 +00:00
Balázs Úr
82f8360b6c Update Hungarian translation 2023-09-24 13:33:39 +00:00
Piotr Drąg
7b018e45c7 Update Polish translation 2023-09-24 13:41:54 +02:00
Martin
9625cc2ef4 Update Slovenian translation 2023-09-24 06:14:02 +00:00
Alx Sa
cb352ab5b2 plug-ins: Add Esm Software PIX format import support 2023-09-23 21:26:47 +00:00
Martin
cf5d92aaf8 Update Slovenian translation 2023-09-23 21:13:55 +00:00
Alx Sa
96f536a335 plug-ins: Fix PSP vulnerability (ZDI-CAN-22096)
Resolves #10072.

The current PSP palette loading code does not check if
the file's palette entry count value is below the limit
(G_MAXUNIT32 / 4 due to each color being 4 bytes long).
This patch adds this check and stops loading if the count
is larger than GIMP currently supports.
2023-09-23 15:46:13 -04:00
Alx Sa
e1bfd87195 plug-ins: Fix PSP vulnerability (ZDI-CAN-22097)
Resolves #10071.

When reading RLE compressed data, a buffer was allocated to 127 bytes.
However, it can potentially be used to read 128 bytes, leading to a
off-by-one vulnerability. This patch allocates 128 bytes to the buffer
to prevent this from occurring.
2023-09-23 02:16:24 +00:00
Alx Sa
5211a2c3e8 themes: Define background color for spinbutton buttons
Resolves #9997.

Another system theme leak, this time for the +/- buttons on
GimpSpinButton. This patch specifically defines them to
bg-color.
2023-09-22 18:51:10 +00:00
Jehan
12d8401d65 app: better handling of failure of gimp_scanner_parse_string().
This fixes 2 issues:

1. gimp_scanner_parse_string() may fail, which here would indicate broken input.
   If it does, the string variable would not be set, so we need to initialize it
   to NULL, otherwise freeing it could crash GIMP.
2. The variables set by gimp_scanner_parse_string() must be freed.
2023-09-22 15:27:59 +02:00
Jehan
ae38b433f8 app: improve robustness of font detection algorithm, allowing for future fields.
While I was testing some fonts I had on my system which were named exactly the
same, I also realized that all their fields were identical (among the ones we
store at least), except for the hash obviously. While the hash is great to
differentiate fonts when we use exactly the same files, there are various
reasons where one could have the right font installed with a different hash
(e.g. a simple reason could be if it was stored in different font formats).

So I'm thinking that maybe we'll want to add more fields in the future (if there
are any more fields allowing to better discriminate among some fonts named
similarly). This commit will allow this version of GIMP to still work when
loading the future serialized fonts with new and unknown fields. The unknown
fields will be ignored but at least it will still do its best to find fonts with
the known fields. Therefore we won't have to bump the XCF format version if we
only add new fields.

Similarly this allows to add the fields in-between, reorder existing fields or
even remove some in the future if we realize something is really unneeded. It's
less a big deal than the ability to add new fields without bumping XCF version
though.
2023-09-22 15:16:52 +02:00
Jehan
6c40f10377 app: improve the double loops to deserialize GimpFont.
Rather than looping fully over the full list of fonts once more, and
re-computing a second time the same font similarity score (with the risk of
messing up the copy-paste), let's just store the indexes of "most similar" fonts
in the first loop, then only query and check the hash for these.
2023-09-22 14:09:00 +02:00
Alx Sa
59ce1a7255 themes: Define treeview checkbox colors
Resolves #8756 (along with !1065)

The system theme leaked due to the checkbox styling not being
defined for GtkTreeView checkboxes.
The background-image in particular overpowers other settings.
The normal checkbox styling is now specifically applied to
these checkboxes as well.
2023-09-21 22:36:31 +00:00
Jehan
8c4ee50867 NEWS: update. 2023-09-21 23:27:49 +02:00
Jehan
db4710de1c Issue #9154: incorrect corner is selected in text tool.
After reframing a rectangle item, make sure we restore its previous state.
2023-09-21 16:16:07 +02:00
Rodrigo Lledó
2ee2a4a2c0 Update Spanish translation 2023-09-21 11:53:29 +00:00
Kristjan SCHMIDT
08b9e899df Update Esperanto translation 2023-09-20 20:38:23 +00:00
Sabri Ünal
c29399314c Update Turkish translation 2023-09-20 19:08:00 +00:00
Jehan
231ca0c505 Issue #9994: do not call g_file_info_get_is_hidden() (and others) directly.
This is not the main reason for the specific output in #9994. These ones are
more probably because of similar usage in GTK (which updated its own calls to
g_file_info_get_is_hidden|backup() in version 3.24.38). But we should likely
also update the various calls we have to use the generic
g_file_info_get_attribute_*() variants.

To be fair, it is unclear to me when we can be sure that an attribute is set.
For instance, when we call g_file_enumerate_children() or g_file_query_info()
with specific attributes, docs say that it is still possible for these
attributes to not be set. So I assume it means we should never use direct
accessor functions.

The only exception is that I didn't remove usage of g_file_info_get_name(),
since its docs says:

> * Gets a display name for a file. This is guaranteed to always be set.

Even though it also says just after:

> * It is an error to call this if the #GFileInfo does not contain
> * %G_FILE_ATTRIBUTE_STANDARD_DISPLAY_NAME.

Which is very contradictory. But assuming that this error warning was
over-zealous documentation, I kept the direct accessors since they are supposed
to be slightly more optimized (still according to in-code documentation) so
let's priorize them when we know they are set for sure.
2023-09-19 15:34:48 +02:00
Alx Sa
d928bd2c93 themes: Define menu checkbox border color
Resolves #10015.

The border color of the menu checkboxes was not
specifically defined by the CSS stylesheet, causing
the boxes to appear invisible when unchecked in
certain system themes. This defines the border color
to the same as the menu text to ensure visibility.
2023-09-19 10:59:28 +00:00
Alx Sa
aa1cce620c themes: Define menu separator color
Resolves #10007.

The menu separator color was not defined in the stylesheet,
so it could vary based on the system stylesheet.
It is now set to @stronger-border-color.
2023-09-19 02:26:27 +00:00
Alx Sa
8653957b96 themes: Define Save Image actionbar border
Resolves #10040.

A System Theme leak could cause a large border to be drawn around
the export options at the bottom of the Save Image dialogue.
This patch defines them specifically as 1px border with the
@strong-border-color CSS styling.
2023-09-18 20:39:16 +00:00
Alx Sa
cb8384e213 themes: Define notebook header border color
Resolves #10000.

The border around notebook headers was not specifically defined in
GIMP's CSS stylesheet, so if the system theme used a different color this
would also change. It has now been defined as @strong-border-color.
The existing CSS was also moved to the same area as the other notebook
header definitions.
2023-09-18 19:32:13 +00:00
Alx Sa
eb1a623728 themes: Fix black border bug in scrolled window viewports
Resolves #10020
For some reason, not having the border-radius CSS style set
in widgets inside scrollwindow viewports causes them to have
a giant black order if they're not a full height. This was previously
fixed for GtkGrids. This patch fixes it for GtkBoxes as well, such as
the Procedure Browser description area.
2023-09-16 18:24:45 +00:00
Martin
04ae1e2d55 Update Slovenian translation 2023-09-15 20:38:25 +00:00
Luming Zh
9fb605db65 Update Chinese (China) translation 2023-09-15 18:26:14 +00:00
Yuri Chornoivan
6a2d782c73 Update Ukrainian translation 2023-09-15 17:28:31 +00:00
bootchk
bfaebccf4e ScriptFu: change binding of resource from string to int
Fix #9991

And change test cases

And fix string-prefix? function in testing framework
2023-09-15 11:02:46 +00:00
Ekaterine Papava
623becd72d Update Georgian translation 2023-09-15 03:46:28 +00:00
Alx Sa
9a15f65a64 core: Improve security of ASE palette loading
Per @Wormnest comment on ACB palette loading,
g_utf16_to_utf8 () now uses the string length rather than -1 to prevent malicious non-NULL terminated strings.
2023-09-14 23:00:07 +00:00
Alx Sa
ab29c4478e core: Add support for Adobe Color Book (ACB) Palettes 2023-09-14 23:00:07 +00:00
Anders Jonsson
6e6f81d23a Update Swedish translation 2023-09-14 22:23:21 +00:00
Luming Zh
030b74ad33 Update Chinese (China) translation 2023-09-14 01:15:19 +00:00
Yuri Chornoivan
32f6c59eca Update Ukrainian translation 2023-09-13 19:02:15 +00:00
Víttor Paulo Vieira da Costa
3c66f4a9fe Update Brazilian Portuguese translation 2023-09-12 17:15:50 +00:00
bootchk
ad78b6d7e6 Remove huge cruft file mistakenly added two commits earlier. 2023-09-12 16:54:59 +00:00
Martin
7fd02806c0 Update Slovenian translation 2023-09-12 16:14:17 +00:00
bootchk
fe0fe3e0bb ScriptFu: extract function marshall_pdb_return
This commit and the ones prior are simple refactoring,
with no intended functional changes.

In anticipation of enhancements 9608 and 8404
which make returned values more scheme like.

Also makes code more readable.
2023-09-12 15:02:15 +00:00
bootchk
d3706a62e3 ScriptFu: add function marshal_PDB_return_by_arity 2023-09-12 15:02:15 +00:00
bootchk
1a8bdf1acc ScriptFu: extract function marshal_pdb_return_values (plural) 2023-09-12 15:02:15 +00:00
bootchk
3e0f37d00a ScriptFu: Extract function marshal_returned_PDB_value 2023-09-12 15:02:15 +00:00
Jehan
e832b73e55 app: fix a few bug in text markup (de)serialization.
- g_str_equal() doesn't have the proper signature for g_slist_find_custom() so
  current code was never processing multiple subfonts in a markup layer text.
- Escape the font name parsed from the XCF. For old XCF format, it could contain
  forbidden characters. And even for new XCF files (with fonts names generated
  such as 'font123' so there should be no escapable characters), we should not
  trust that the XCF/parasite contents is correct. It can be wrong for various
  reasons.
- Search for ' font="%s"', otherwise the search-and-replace might catch other
  XML attributes. For instance we don't want the font "ultrabold" to match
  weight="ultrabold".
- The backward compatibility code didn't have code to stop 2 font name
  replacements to chain up, i.e. if a real world font was named "gimpfont123"
  and another "gimpfont321" and if our replacement code were to change
  "gimpfont123" to "gimpfont321" then "gimpfont321" to something else. In the
  end, we'd have only a single font. I am fixing it by replacing " font=" to
  " gimpfont=" then only correcting the attribute name at the end. This
  intermediate attribute name acts as a "done" flag.
2023-09-12 14:23:40 +00:00
Jehan
ed4c50ce2e app, libgimpconfig: make the code more robust to random text.
There are 3 fixes here:

1. First, searching for "\"GimpFont\"" to determine whether or not this is a new
   format text parasite is not enough, because this string can be found in a
   text layer with "GimpFont" only as contents. It will serialize as:

   > (text "GimpFont")

   Instead search for "(font \"GimpFont\"" which cannot be created as part of
   the text contents because of the unprotected double quotes).

2. We must verify that strstr() did not return NULL when searching for markup
   delimiters. It may happen if the parasite contents is invalid (we must always
   assume it can be, since it's user data).

3. When deserialization of a text from parasite fails (e.g. because parasite
   doesn't actually exist or its format is wrong), still make sure the GimpText
   has a font (setting the standard one before deserializing). Otherwise GIMP
   crashes down the line.

   For this, I also had to fix gimp_config_deserialize_object(): the object type
   name must be parsed even if an object was already set in a GObject property.
2023-09-12 14:23:40 +00:00
Jehan
6d5aaa995f app: new storage format for the text layer parasite implies XCF version bump.
The new parasite format cannot be loaded by old versions of GIMP. This means we
must bump the XCF version (even though technically we didn't really touch the
XCF format itself because text layers are stored in a hackish way, yet text
layers are just too important nowadays to not care).

Nevertheless if an old XCF with text layers was loaded and the text layers left
untouched, the old parasite will be saved back as-is. Therefore no need to bump
the XCF version in this specific case. Only when we created new text layers or
edited existing ones.
2023-09-12 14:23:40 +00:00
Jehan
bd9eb1d8ff meson: requires Pango >= 1.50.
New code uses pango_attribute_as_font_desc() which appeared with Pango 1.50.
Since it's currently present in Debian stable, I don't bother too much and bump
this dependency.

Also let's use the same version for pango, pangocairo and pangoft2. They all
come from the same project/repository, so we must likely expect them to be equal
(if they are not, there is likely a problem).
2023-09-12 14:23:40 +00:00
Jehan
68167ae01b app: fix counting of similar fonts with largest similarity value and a crash.
Previous code was incrementing the similar_fonts count each time we found a
better candidate. So we ended up computing the hash even when we had only 1
candidate with maximum similarity.

Moreover this commit fixes a crash happening with the "standard font". The
lookup name must always be allocated, even when it's an empty string (otherwise
it crashes at free).

Additionally this commit factorizes the code so that gimp_font_get_hash() takes
care of hash computation instead of duplicating code.

Finally I do some code organization.
2023-09-12 14:23:40 +00:00
Idriss Fekir
899dee5926 (De)Serialize fonts in pango markup 2023-09-12 14:23:40 +00:00
Idriss Fekir
7be3f56f5c Serialize GimpFont and fix loading older xcf files
MR #1011 breaks that because now we have a display name
and a lookup name, so font info is saved in the xcf file,
and when loading, the font which matches these info is used.

This doesn't fix pango markup having the wrong fonts names.
2023-09-12 14:23:40 +00:00
Idriss Fekir
a966297498 Port GimpText to GimpFont
In GimpText, The font used to be stored as a string containing its name,
Now, it is stored as a GimpFont object, which makes more sense and makes
operations on fonts easier (such as serialization).
2023-09-12 14:23:40 +00:00
Rafael Fontenelle
b5895aca9a Update Brazilian Portuguese translation 2023-09-12 13:44:20 +00:00
Alx Sa
f5ae105f49 themes: Add border for canvas size in Resize Dialog
Adds a class "gimp-offset-area-frame" to the frame containing a GimpOffsetArea in resize dialogues.
This allows the styling from 2.10 to be applied to indicate canvas size when resizing layers.
Since GimpOffsetArea is a GtkDrawingArea object, it can't have CSS directly
applied to it - that's why the class is added to the frame instead.
2023-09-11 20:07:17 +00:00
Vasil Pupkin
f0f7c0cd2c Update Belarusian translation 2023-09-09 23:05:49 +00:00
Vasil Pupkin
d0d4239e36 Update Belarusian translation 2023-09-09 09:54:48 +00:00
Sabri Ünal
b76947361e Update Turkish translation 2023-09-07 15:33:14 +00:00
Luming Zh
5e399ebd2b Update Chinese (China) translation 2023-09-07 13:48:06 +00:00
dimspingos
cf1dca4347 Updated Greek translation 2023-09-07 16:42:13 +03:00
Sabri Ünal
703be5a103 Update Turkish translation 2023-09-07 10:41:21 +00:00
Sabri Ünal
06e6aa14a3 Update Turkish translation 2023-09-07 10:34:42 +00:00
Martin
d2ea6617da Update Slovenian translation 2023-09-07 07:33:04 +00:00
Alx Sa
a69c7736c2 core: Handle ASE palettes with header padding
This removes any padding the color space label might have originally,
which interfered with g_str_has_prefix ().
2023-09-06 20:15:59 +00:00
Yuri Chornoivan
7372521802 Update Ukrainian translation 2023-09-06 17:43:04 +00:00
lillolollo
ade8cad5d1 gitlab-ci: Windows update python 3.11 2023-09-06 15:08:03 +02:00
bootchk
61c1acbead tinyscheme: enhance: rearrange error msg so error kind is stable prefix
Error kind should be first to read, is most important.

Makes testing error message easier when prefix is stable.
2023-09-06 06:37:29 -04:00
bootchk
14c30f6514 ScriptFu tests: Add some tests and remove hardcoded ID's
Buffer, palette, parasite, unit, context

Also test only a prefix of error message.
2023-09-06 09:53:31 +00:00
dimspingos
6b2cdb3154 Updated Greek translation 2023-09-06 10:24:09 +03:00
Jordi Mas
75033ab6b7 Update Catalan translation 2023-09-06 06:37:42 +02:00
Alx Sa
19050ce7c0 dialog: Use column value from imported palettes
GIMP's .gpl palette format and Swatchbooker's .sbz format can contain
metadata on the number of columns. This value was ignored before;
now the import dialogue checks for this value and uses it.
2023-09-06 01:12:48 +00:00
Alx Sa
6597dabeb3 core: Add support for SwatchBooker palettes 2023-09-06 01:12:48 +00:00
programmer_ceds
9e06e2aa53 Fix Zoom Shortcuts (fixes issue #9797) 2023-09-05 22:35:06 +00:00
Balázs Úr
9c965efd81 Update Hungarian translation 2023-09-05 19:02:16 +00:00
Heiko Becker
8b2574e917 meson: Add explicit options for cfitsio and openmp
...instead of automagically enabling them if the dependency happens
to be installed.
2023-09-03 22:41:04 +02:00
Luming Zh
6f77a661c9 Update Chinese (China) translation 2023-09-03 14:21:47 +00:00
Luming Zh
1d496c8c81 Update Chinese (China) translation 2023-09-03 14:17:02 +00:00
Idriss Fekir
e93e7a124c Improve text quality of UI on Windows
When using the default pangocairo backend (win32),
AA is not enabled.

Switching to the FontConfig backend fixes the problem.
2023-09-02 21:09:06 +00:00
Martin
73ea5464ef Update Slovenian translation 2023-09-02 20:39:08 +00:00
Yuri Chornoivan
e11e21b55d Update Ukrainian translation 2023-09-02 16:26:53 +00:00
Víttor Paulo Vieira da Costa
d812b0d9a6 Update Brazilian Portuguese translation 2023-09-02 13:11:23 +00:00
Víttor Paulo Vieira da Costa
d5805cba34 Update Brazilian Portuguese translation 2023-09-02 13:11:20 +00:00
Víttor Paulo Vieira da Costa
acc4fe982f Update Brazilian Portuguese translation 2023-09-02 13:11:14 +00:00
Alx Sa
531da1560d Issue #30: Add onClick, accesskey, and tabindex tags to Image Map plug-in 2023-09-02 03:30:35 +00:00
Jacob Boerema
b53f7c10e4 libgimp: fix #9902 Critical when calling gimp_text_layer_new ...
from plug-in

I get a critical error when calling gimp_text_layer_new and the function
doesn't return a GimpTextLayer:

(file-psd:47120): LibGimp-CRITICAL **: 16:00:59.035:
gimp_gp_param_to_value: type name GimpTextLayer is not registered

Adding the above line to libgimp/gimp.c fixes the problem.
2023-08-31 21:42:13 +00:00
Sabri Ünal
e425678bcf Update Turkish translation 2023-08-31 18:50:46 +00:00
Sabri Ünal
e22ddb7806 Update Turkish translation 2023-08-31 18:48:39 +00:00
Sabri Ünal
5657feded8 Update Turkish translation 2023-08-31 18:44:03 +00:00
Jehan
459836ee09 Issue #9710: layers borders not properly refreshed.
This was a regression appeared with commit 1b3af8a89b. We still don't want to
flush the whole image, but if the selected layers change, we want to flush the
display shell.
2023-08-31 20:33:31 +02:00
Jehan
79fe90646f NEWS: update. 2023-08-30 17:25:01 +02:00
Alx Sa
caff8dbb7b core: Fix crash when filling with Middle Gray color
Filling with Middle Gray requires getting the image format
for conversion from CIE Lab. This works when filling a layer,
but new images are not yet available in the context.
This adds the image to the context before gimp_drawable_fill ()
is called so it has access to the image format.
2023-08-28 22:42:31 +00:00
Martin
27f18ff872 Update Slovenian translation 2023-08-28 21:55:08 +00:00
Martin
9157211fa4 Update Slovenian translation 2023-08-28 21:53:03 +00:00
Yuri Chornoivan
4d1d8803c4 Update Ukrainian translation 2023-08-28 17:23:30 +00:00
Ekaterine Papava
a04c3cd614 Update Georgian translation 2023-08-28 04:36:54 +00:00
Tim Sabsch
bdf55cd9d4 Update German translation 2023-08-27 20:19:38 +00:00
Alx Sa
38495c7b2d Issue #9901: Add Adobe Swatch Exchange palette import 2023-08-27 16:51:02 +00:00
Piotr Drąg
081b8e65a4 Update Polish translation 2023-08-27 16:23:24 +02:00
Ekaterine Papava
21061bfa31 Update Georgian translation 2023-08-27 14:07:27 +00:00
Martin
63282d00b7 Update Slovenian translation 2023-08-27 05:41:45 +00:00
Martin
793ba32b5b Update Slovenian translation 2023-08-27 05:24:51 +00:00
bootchk
ddbb34f357 Fix #9660 ScriptFu flaws for atoms of type character, UTF-8 encoded
For characters outside ASCII:

1. repr is wrong in REPL

2. sharp constant #\<codepoint> fails to evaluate

3. sharp constant hex #\x<hexdigits> accepts invalid UTF-8 codepoints

4. a call to error with such a character eats the output string

Also, changed the repr of ASCII control characters (was #\x7)
to their unicode repr (now a box glyph with hex)
2023-08-26 18:46:56 +00:00
Yuri Chornoivan
1fddc3b1c4 Update Ukrainian translation 2023-08-26 18:43:35 +00:00
Yuri Chornoivan
2be4b6bf3d Update Ukrainian translation 2023-08-26 18:24:35 +00:00
Boyuan Yang
e28f6fa617 Update Chinese (China) translation 2023-08-26 18:17:49 +00:00
Sabri Ünal
f869a79812 data: add gimpsaveprocedure.c to the POTFILES.in
A leftover from my previous commit: b7ab467cde
2023-08-26 16:26:30 +03:00
Ekaterine Papava
8897574758 Update Georgian translation 2023-08-26 03:47:03 +00:00
Ekaterine Papava
d2ea72e371 Update Georgian translation 2023-08-26 03:41:35 +00:00
Danial Behzadi
e83f150fa3 Update Persian translation 2023-08-25 23:02:32 +00:00
MohammadSaleh Kamyab
50ccf34f8c Update Persian translation 2023-08-25 22:49:46 +00:00
bootchk
2f360ddb34 ScriptFu: #9755 Add test framework and tests for TS and PDB
Test framework and tests in Scheme, and portable.

Work in progress.  Expect commits for more tests.

Testing framework is stable, more or less.

Add more tests

Add tests layer and layerMask.

test Item methods

More tests, selection

Test memory, vector in TS.

More tests char functions

sharp expr tests
2023-08-25 21:39:29 +00:00
Alx Sa
dc50bf0601 menus: Rearrange Help menu
Moves "About Gimp" to end of menu to match common UX.
User Manual is also moved right after the Context Help option as
they are related items.
2023-08-25 21:13:03 +00:00
Sabri Ünal
05b808b095 plug-ins: Mark RAW export dialog related strings translatable
These strings are related to RAW export dialog which
some strings seem not marked as translatable.
2023-08-25 19:41:42 +00:00
Sabri Ünal
5725a3593e plug-ins: Mark PDF/PostScript export dialogs related strings translatable
These strings are related to PDF/PostScript export dialogs which
some strings seem not marked as translatable.
2023-08-25 19:41:42 +00:00
Sabri Ünal
d4146aba5c plug-ins: Mark TIFF export dialog related strings translatable
These strings are related to TIFF export dialog which
some strings seem not marked as translatable.
2023-08-25 19:41:42 +00:00
Sabri Ünal
b7ab467cde plug-ins: Mark JPEG export dialog related strings translatable
These strings are related to JPEG export dialog which
some strings seem not marked as translatable.
2023-08-25 19:41:42 +00:00
Yuri Chornoivan
69abfdbdcc Update Ukrainian translation 2023-08-25 11:52:13 +00:00
Alx Sa
0778b95847 plug-ins: Add support to load PSP ICC Profile data 2023-08-25 02:29:51 +00:00
Timo Jyrinki
05f54698f2 Update Finnish translation 2023-08-24 07:48:18 +00:00
Sabri Ünal
b2979e0534 Update Turkish translation 2023-08-22 20:20:27 +00:00
Sabri Ünal
c0ec541799 Update Turkish translation 2023-08-22 16:35:37 +00:00
Yuri Chornoivan
30c5e40461 Update Ukrainian translation 2023-08-21 19:59:29 +00:00
Jacob Boerema
c9d73e4da7 devel-docs: fix failure to build gir docs
Generating the devel docs fails on Windows because it can't find
Babl-0.1.gir, which is only available for me in GIMP's prefix.

Adding that path with -add-include-path fixes the issue for me.
2023-08-21 16:14:53 +00:00
Idriss Fekir
92f133558a gimptextlayout.c: Fix behaviour of RTL text 2023-08-21 13:21:19 +00:00
Martin
cd0524b383 Update Slovenian translation 2023-08-21 11:39:53 +00:00
Alx Sa
7a971ede15 scripts: Add Table of Contents to User Manual submenu
Resolves #1040.
Adds a [Table of Contents] link that directs users to
ID "gimp-main", the table of contents page.
2023-08-21 02:10:45 +00:00
bootchk
161644fdbc Delete obsolete scripts from 2.99
Moved to gimp-data-extras repo

    erase-rows fix #9885
    grid-system fix #8464
    select-to-brush fix #9878
    select-to-image
    select-to-pattern

Just deleted:

    script-fu-copy-visible fix #9868
2023-08-20 20:44:04 +00:00
bootchk
109f43750c Fix #9874 SF plugin script-fu-set-cmap.scm
New API for GByte to gimp-image-set-colormap
2023-08-20 20:44:04 +00:00
bootchk
7f3595285d Fix #9873 fix SF plugin ripply-anim.scm
Fix new multilayer API in call to to plug-in-tile
2023-08-20 20:44:04 +00:00
bootchk
d934d6d497 Fix #9866 burn-in-anim.scm SF plugin
Fix API change to gimp-image-set-file.
2023-08-20 20:44:04 +00:00
bootchk
8c3d3a5247 Enhance #9532 elide "Script-Fu" from SF plugin dialog title 2023-08-20 20:44:04 +00:00
Daniel Novomeský
8f0e2fd5aa flatpak: remove libjxl
We will use libjxl provided via org.gnome.Sdk//master instead.
2023-08-18 19:39:29 +00:00
Alx Sa
f67ba0d829 libgimpcolor: Remove warnings about uninitialized variables
While `length` is always assigned a value by gimp_color_profile_get_icc_profile (),
some compilers don't recognize this and warn about it being uninitialized.
This assigns six instance of `length` to 0 when declared to remove the warnings.
2023-08-18 10:54:06 +00:00
Alx Sa
0cfdd0a5df plug-ins: Fix crash in Map Palette
Per https://gitlab.gnome.org/GNOME/gimp/-/issues/9875#note_1817995,
the returned value of gimp_context_get_palette () shouldn't be freed in the
calling function.
2023-08-17 11:23:10 +00:00
Timo Jyrinki
491fc3120f Update Finnish translation 2023-08-17 07:58:21 +00:00
Jordi Mas
26454809a7 Update Catalan translation 2023-08-16 19:37:27 +02:00
Alx Sa
64eaed2ad7 modules: Add translation note for Clip warning
Resolves #8207. Adds a note to clarify the purpose of the
Clip Warning color display filter.
2023-08-15 17:09:14 +00:00
Jacob Boerema
40b2412fa4 plug-ins: add synchronization with certain Exif tags.
Exif tags Exif.Image.Artist, Exif.Image.ImageDescription, and
Exif.Image.Copyright were not being synchronized with their Xmp and
Iptc.IIM equivalents in the metadata-editor.

This commit adds synchronization of reading and writing of the metadata.

We adjust the struct for equivalent_metadata_tags by removing unused
fields and adding a field that points to the equivalent Exif tag in
a new struct called exif_tag_info.

On loading of the metadata tags we now also check a limited set of
Exif tags. If no value was set yet, we use the Exif value, or else
we check to make sure both had the same value. If not, print a
warning in the terminal.

On saving of metadata, we now also save to the marked Exif tags, or
if the value is NULL, we remove the tag.

In passing, we also fix two memory leaks by freeing with g_strfreev
temporary string lists.
2023-08-14 17:29:44 -04:00
Jacob Boerema
8495dd6eed plug-ins: improve creation date handling in metadata-editor
Dates in Xmp include a time and timezone, so add a default time when
selecting a date since we can't edit time and timezone yet.

So far, we didn't take into account that IPTC-IIM has separate date
and time+timezone values instead of the combined value in XMP for
DateCreated.

When loading DateCreated check if it has the same value as IPTC
values DateCreated and TimeCreated combined. If not, we show a
terminal error and ignore the IPTC values.
If neither Xmp nor Iptc has a DateCreated, then use Exif.Photo.
DateTimeOriginal combined with OffsetTimeOriginal to set an initial
value.

When saving, synchronize with IPTC-IIM by splitting the DateCreated
value in date and time+timezone and save each to the appropriate tag.
Also make sure that for IPTC-IIM the date separator is a '-'.
2023-08-14 16:50:15 -04:00
Jacob Boerema
83294ba4c7 plug-ins: improve spacing in metadata-editor
Adds a bottom margin to the grids because the horizontal scrollbar
was overlapping the bottom-most row of the grid.
Adds wordwrap and left/right margins to multiline text widgets,
mainly to make the text not start right at the edge of the widget.
2023-08-13 15:15:04 -04:00
Jacob Boerema
b97f96249a plug-ins: Xmp.plus.ImageSupplierName can only have one value
as used in metadata-editor:
Change from MODE_MULTI to MODE_SINGLE.
2023-08-13 15:15:04 -04:00
Jacob Boerema
c633091d54 plug-ins: in metadata-editor use array size constants...
instead of hard-coded numbers.
Also:
- remove unneeded set_tag_string for n_creatorContactInfoTags
- remove now unneeded structs
2023-08-13 15:15:04 -04:00
Jacob Boerema
4e40a3edd2 plug-ins: make mode in metadata-editor an enum
We were using a string for the metadata mode, meaning we had to compare
string values in a lot of places.

We simplify and probably speed-up comparisons here by replacing the
mode string by an enum value.

The only place still needing the string values sometimes is
metadata-impexp.[ch] where we added a conversion table to convert
the mode to a string.
2023-08-13 15:15:03 -04:00
Lukas Oberhuber
5ccac0dd9b macos: Remove DYLD_LIBRARY_PATH
Revert: https://gitlab.gnome.org/GNOME/gimp/-/merge_requests/561
2023-08-13 12:09:14 +00:00
lillolollo
b08602a6f4 libgimpwidgets: hintbox gtk_widget_show update with gtk_widget_set_visible 2023-08-13 12:05:58 +00:00
Stanislav Grinkov
9ab7547607 widgets: initialize TextTag's alpha channel when deserializing markup
Code location and fix found by Massimo Valentini.

Fixes: #6927 (GNOME/Gimp tracker)
2023-08-13 13:40:17 +06:00
Stanislav Grinkov
6947e80b0b icons: add white border to Color theme Dodge icon
Fixes: #9681 (GNOME/Gimp tracker)
2023-08-13 12:18:10 +06:00
Stanislav Grinkov
3f82a57f2d icons: add white border to Legacy Airbrush and Dodge tool icons
Fixes: #9681 (GNOME/Gimp tracker)
2023-08-13 12:18:10 +06:00
Stanislav Grinkov
83f6eec57b app: set the blank font name for the standard font instead of 'Standard'
to fix the issue when 'Standard' can be actual font from the list
or a font which starts with. (ie. Standard Symbols PS)

Fixes: #3104 (GNOME/Gimp tracker)
2023-08-13 12:15:27 +06:00
Luming Zh
e489dc6e53 Update Chinese (China) translation 2023-08-12 19:54:48 +00:00
Luming Zh
eb0c9b04ac Update Chinese (China) translation 2023-08-12 19:53:55 +00:00
Luming Zh
6bccd77e87 Update Chinese (China) translation 2023-08-12 19:52:52 +00:00
Jehan
63076ba342 devel-docs: add URLs to babl and GEGL gi-docgen documentation.
Note that these links are not valid yet. For now, documentations are only in
testing:
* babl: https://testing.developer.gimp.org/api/babl/
* GEGL: https://testing.developer.gimp.org/api/gegl/

The main links will appear next time we merge testing into the main developer
website, or at the next release of GIMP.
2023-08-12 21:09:30 +02:00
Jehan
661009d950 gitlab-ci: generating tarballs for babl and GEGL API reference documentation. 2023-08-12 17:33:54 +02:00
Anders Jonsson
369a7782a1 app, libgimp, libgimpbase: fix gi-docgen rendering 2023-08-12 14:52:52 +00:00
Martin
38b226a558 Update Slovenian translation 2023-08-11 23:22:00 +00:00
Martin
26cb91ddcf Update Slovenian translation 2023-08-11 23:16:41 +00:00
Martin
664de8f311 Update Slovenian translation 2023-08-11 23:13:50 +00:00
Yuri Chornoivan
83130f889b Update Ukrainian translation 2023-08-11 18:47:40 +00:00
Yuri Chornoivan
c9e8b2a120 Update Ukrainian translation 2023-08-11 18:45:12 +00:00
Sabri Ünal
67cd2a60d3 Update Turkish translation 2023-08-11 11:21:30 +00:00
Sabri Ünal
1f24773e0e Update Turkish translation 2023-08-11 11:17:32 +00:00
Sabri Ünal
a460650f75 Update Turkish translation 2023-08-11 11:17:26 +00:00
Sabri Ünal
8a6c385edf Update Turkish translation 2023-08-11 11:17:20 +00:00
Sabri Ünal
af7b3d7e53 Update Turkish translation 2023-08-11 11:15:42 +00:00
Ekaterine Papava
e24974ffc7 Update Georgian translation 2023-08-11 07:35:54 +00:00
Ekaterine Papava
494418f996 Update Georgian translation 2023-08-11 07:30:16 +00:00
Stanislav Grinkov
cbcb477182 core: add FG to Transparent (Hardedge) gradient
Fixes: #9849 (GNOME/Gimp tracker)
2023-08-11 13:01:20 +06:00
Luming Zh
955a890bbc Update Chinese (China) translation 2023-08-11 02:28:35 +00:00
Alx Sa
b459ce95bb plug-ins: Handle single-channel OpenEXR with unknown channel names
OpenEXR allows for arbitrary channel names. Instead of failing once the common ones are checked, this patch 
checks the number of channels in the file.
If there is only one channel, it is treated as 
grayscale (similar to OpenImageIO's behavior).
A debug warning with the channel name is also printed.
2023-08-10 19:37:25 +00:00
Stanislav Grinkov
4465db5223 tools: change text tool behavior when replacing a text
When replacing a selection, take and apply markup (if any)
from the first character of the selection for the entered
text.

This fixes the case when you no longer can change the
global layer text properties after replacing the text.

Also, this changes the behavior introduced in #1220.

Fixes: #7948 (GNOME/Gimp tracker)
2023-08-10 22:23:45 +06:00
lillolollo
4d7c2ab2b9 libgimp: missed break 2023-08-10 15:20:54 +00:00
Jehan
133acb2c99 NEWS: update. 2023-08-10 17:11:36 +02:00
Zander Brown
e00f2b3bf9 play: use GMenu directly 2023-08-10 12:11:01 +00:00
Zander Brown
ddd1a48825 remap: use GMenu directly 2023-08-10 12:11:01 +00:00
Zander Brown
adc7e5331c colourbutton: use GMenu directly 2023-08-10 12:11:01 +00:00
Zander Brown
efabebd0bb help-browser: move menu to XML 2023-08-10 12:11:01 +00:00
Zander Brown
7d1eac18ca ifs: move menu to XML
See: https://gitlab.gnome.org/GNOME/gimp/-/issues/9776
2023-08-10 12:11:01 +00:00
Martin
37220c5dab Update Slovenian translation 2023-08-10 10:55:09 +00:00
Yuri Chornoivan
24694e59c5 Update Ukrainian translation 2023-08-09 18:02:15 +00:00
Alx Sa
8709e91999 plug-ins: Make GFig menus translatable
Based on the IMAP port in !1031, this moves the menu code to a separate file
so that gettext can access it for translation.
2023-08-09 16:17:00 +00:00
Ekaterine Papava
2501807401 Update Georgian translation 2023-08-09 16:13:52 +00:00
Jehan
8a8451750d build: Imath is a dependency of OpenEXR.
Organizing sub-dependencies into modules helps. Later if for instance we need to
remove or change OpenEXR, we know that they are related and that Imath can be
removed if we remove OpenEXR.
2023-08-09 17:21:24 +02:00
lillolollo
8432c555a6 app: silencing warnings in switch statement
See MR !1007.
2023-08-09 15:20:52 +00:00
Zander Brown
3b6ea6f02e imap: generate sources
The targets were just being left floating, and the pre-generated in-tree
source were always used instead

When bison/flex are found, ensure we actually dep on their output - thus
actually running the targets - and only use the in-tree copies as a
fallback
2023-08-09 13:46:56 +00:00
Zander Brown
637385c7d1 imap: move menu to XML
Having it as an inline string doesn't make much sense, and makes it
untranslatable
2023-08-09 13:46:56 +00:00
Jehan
99bb342037 gitlab-ci: further fix the Windows nightly installer.
Continuation of commit 94344bdb46 which was not enough. I just need the full
pipeline from image to Debian GIMP, with dep job too.
2023-08-09 15:25:34 +02:00
mr.fantastic
75d758881d don't allow snapping hidden layers in bbox/equidistance snapping 2023-08-08 15:13:52 +00:00
lillolollo
93b4dbbbcd Update openexr to version 3 2023-08-07 22:45:40 +00:00
Jehan
5c96851431 devel-docs: for the 3.0 series, Win 10 becomes our minimal support.
After discussions on IRC with ender/Jernej and frogonia:

* exchndl.dll (drmingw) requires dbgcore.dll and dbghelp.dll which seem to ship
  with win10+, but not win7 (we don't know for Win8). So for Win7, Jernej had to
  manually add it back (otherwise, building then running on Win10, it looks
  fine, but GIMP fails to start on Win7).
* MSYS2 dropped Win7 support anyway and supports now Win 8.1+.
  See: https://www.msys2.org/docs/windows_support/
  So even though it looks like GIMP works fine on Win7 (after special-casing the
  2 DLLs above by adding them manually in the installed files), there might be
  unforeseen issues in the long run.
* Win7 official support by Microsoft now ended. And Win8 support is soon to be
  (it actually already has, "except for Server 2012 [based on Win8], which's
  supported for another 2 months"). Win8 never had much adoption anyway.
* frogonia confirms they didn't see many Win 7 reports, if at all, in the last
  year.

So based on all these, and in order not to make our life over-complicated, we
drop Win 7/8 support for the next 2.99 versions and for the upcoming stable 3.0
series.

Though we keep support to these versions in the 2.10 series, in order not to
disrupt current usage too much.
2023-08-07 23:52:17 +02:00
Jehan
00dd121ba0 build: sync nightly flatpak manifest with the beta branch on Flathub. 2023-08-07 20:28:46 +02:00
Jehan
342e9b10f6 gitlab-ci: crossroad repository was moved.
Crossroad repo was finally moved to Freedesktop.
See: https://gitlab.freedesktop.org/freedesktop/freedesktop/-/issues/477

This should avoid the too many failures we have lately on TuxFamily
infrastructure (and also gives a proper bug tracker for Crossroad). I am very
thankful to TuxFamily for all these years! :-)
Let's not be said that I moved the repo because I don't like this friendly FLOSS
host anymore. I just needed something different for Crossroad project now.
2023-08-07 15:14:27 +02:00
Jehan
94344bdb46 gitlab-ci: fix the schedule pipeline for our nightly Windows installer.
This should fix:

> 'win-installer-nightly' job needs 'gimp-meson-debian' job, but 'gimp-meson-debian' is not in any previous stage
2023-08-07 14:32:00 +02:00
lillolollo
90cd3de741 Set the bug template as default 2023-08-06 20:45:25 +00:00
Idriss Fekir
89ad3a0ab5 Rename every font in fontconfig, not only the broken ones
Some fonts which pango identifies correctly, became broken
after renaming them in fontconfig, so the strategy was to
rename only fonts which pango can't see.

To check if pango got the correct font, the PangoFont
has to be loaded from PangoContext, which is costly.

It Turns out that querying FontConfig with more attributes
fixes this. Hence renaming every font doesn't affect
the fonts pango already sees.
2023-08-05 23:02:59 +00:00
Idriss Fekir
2b73a5996d Remove code path of not using fontconfig
We use fontconfig directly to rename fonts to fix some issues
with Pango (see MR !1011), and fontconfig is present on all
platforms supported by gimp (even on windows, pango is build with
fontconfig as a dependency), so it makes little sense to keep this
code path which is now never used.
2023-08-05 08:58:44 +01:00
Luming Zh
5c2353660f Update Chinese (China) translation 2023-08-04 20:32:37 +00:00
Luming Zh
9ff6c5c07c Update Chinese (China) translation 2023-08-04 19:49:09 +00:00
Luming Zh
eb6d1b485a Update Chinese (China) translation 2023-08-04 19:47:06 +00:00
Luming Zh
a265c9669a Update Chinese (China) translation 2023-08-02 18:48:19 +00:00
Boyuan Yang
45d644e4b8 Update Chinese (China) translation 2023-08-02 18:16:45 +00:00
Jacob Boerema
72ee6ff469 app: incorrect order of parameters in gimp_channel_select_round_rect
in gimpchannel-select.h
Looking at the version in gimpchannel-select.c, the calls made to it,
and also what is usual, the corner_radius_x should be before
corner_radius_y.

Found looking at the cppcheck logs.
2023-08-02 11:24:43 -04:00
Jacob Boerema
eee763b1c1 plug-ins: fix #9816 file-raw-data.exe Crash
When changing the width we got a division by zero crash because we
did not consider the case of bpp * bitspp being less than 8.

To fix this we check if bitspp is less than 8 and in that case multiply
the amount of bytes by 8 and then divide by the number of bits per
pixel.
2023-07-31 13:58:26 -04:00
Jacob Boerema
df8a349243 app: fix error on Windows with clang
When building using MSYS2 CLANG64 profile using clang 16, we get the
following error (besides other required patches):

../../gimp/app/widgets/gimpwidgets-utils.c:931:12: error: incompatible
pointer to integer conversion returning 'HGDIOBJ' (aka 'void *') from a
function with result type 'guint32' (aka 'unsigned int')
[-Wint-conversion]

For now, let's use the same GPOINTER_TO_INT macro we use in
gimpprogressbar.c. In the end, we need a 64-bit type available to
plug-ins, but that needs more work.
2023-07-31 13:58:26 -04:00
Jacob Boerema
b5be3376a9 ci: remove aalib artifact path
We don't build aalib ourselves anymore since it's now provided by MSYS2,
so this build artifact is obsolete. Let's remove it.
2023-07-31 13:58:26 -04:00
lillolollo
87ed4842b4 Update link to the performance log instructions 2023-07-31 03:46:35 +00:00
Alx Sa
4b54ceb023 plug-ins: Fix lava filter for non-square selections
Resolves issue #9809, fix by @mareroqpoland.
When "Separate Layer" is selected, the entire drawable is always
filled rather than using the selection. This patch uses the selection
instead (which will be "all" if there is no active selection)
2023-07-30 22:24:49 +00:00
Stanislav Grinkov
261eb28eb4 icons: add thin border around color/legacy tool-text icon...
... to make it visible on the dark themes.

Resolves: #9681 (Gitlab GNOME tracker)
2023-07-29 20:47:13 +06:00
Balázs Úr
30afce1cd0 Update Hungarian translation 2023-07-29 06:31:35 +00:00
Balázs Úr
a764bdcc7f Update Hungarian translation 2023-07-29 06:25:55 +00:00
Danial Behzadi
d4d2a09d8a Update Persian translation 2023-07-29 00:41:49 +00:00
Danial Behzadi
248cadcfd8 Update Persian translation 2023-07-29 00:36:28 +00:00
Danial Behzadi
9e72ad0cbb Update Persian translation 2023-07-29 00:33:06 +00:00
Yuri Chornoivan
2c9896506d Update Ukrainian translation 2023-07-28 13:39:26 +00:00
Yuri Chornoivan
37295576b5 Update Ukrainian translation 2023-07-28 13:35:49 +00:00
Martin
c64d7a71e3 Update Slovenian translation 2023-07-28 09:59:19 +00:00
Ekaterine Papava
c42e205efb Update Georgian translation 2023-07-28 03:53:10 +00:00
Jehan
22f120333f Issue #9655: both @blurb and @help arguments should be localized.
Looking further, the @help is only used in gimp_proc_view_new() so far (for the
Procedure Browser) where the blurb and argument descriptions are already
localized. It makes no sense to only keep this in English. So let's ask to have
both arguments translated.

Now clearly we should not ask for @help to be mandatory. Very often, it makes no
sense to have a longer help string (the small blurb and the few arguments may be
very self-explanatory). So I make this argument nullable.

There is only the @help_id which I wonder if we could not have a simpler
function gimp_procedure_set_documentation_uri(). Indeed while having a unified
infrastructure with a XML summary and help IDs and whatelse makes sense for GIMP
as a whole, I think that many third-party plug-ins would work much better with a
very simple direct URL. Or it could even be a GFile to a local file (for
plug-ins which want to embed their documentation in the plug-in folder for
instance). To be continued…
2023-07-27 22:59:51 +02:00
Jehan
ce0a84003c libgimp, libgimpconfig: GimpResource can now be (de)serialized.
I add a new class method deserialize_create() to GimpConfigInterface which
returns the GimpConfig object per deserialization, instead of modifying an
existing bare object.

This matters for cases like our GimpResource (and later our GimpItem) classes
which are fully managed by libgimp and should be unique objects per actual
resource. It should even be possible to compare the pointer itself for identity.
That's why we need to let GimpResource create the object (in reality request it
to the infra and only ref it) through this new class method.

With this commit and the previous ones, all GimpResource are now properly stored
as plug-in settings (e.g. the "film" plug-in has a font setting which is now
properly remembered).

These identifiers are not portable (across various installations and therefore
not for XCF either), but at least they are reasonably identifying data on a same
installation (unlike GimpResource's int ID which is only valid within a single
session) which makes them very fine for plug-in settings storage.

When a data file disappears, we fallback to the context default data instead.
2023-07-27 15:34:45 +02:00
Jehan
38c717b149 app, libgimp, pdb: private _gimp_resource_get_by_identifiers() PDB function.
This finds the core resource knowing its type, name, collection and internal
state (in other words, the values returned by _gimp_resource_get_identifiers()).
2023-07-27 15:32:16 +02:00
Jehan
fe58de7f81 app, libgimp, pdb: new private PDB call _gimp_resource_get_identifiers(). 2023-07-27 15:30:14 +02:00
Jehan
1a9c470b82 app: fix gimp_data_get_identifier() and add a concept of data collection.
The way we were creating a GimpData identifier was simply wrong, because it was
based on the assumption that the source file uniquely identifies a GimpData (cf.
gimp_tagged_get_identifier() which clearly says that the returned string must
uniquely identify this data). The very simple counter-examples for why this is
a mistake to consider a data file to be a good unique identifier are collection
files. For instance, TTC files (TrueType Collection) contain multiple fonts.

Instead I am adding the concept of "collection" with the assumption that
**within a given collection**, data names are unique (I do hope this to be and
stay true). So I add gimp_data_get_identifiers() and gimp_data_identify() to get
identifiers and check for identity.

The collection will use the old implementation of gimp_data_get_identifier()
because it is quite nice to have paths relative to data and config directories
(it allows some cases of data relocation without losing data identification).

The new implementation to compute a GimpTagged identifier on the other hand will
construct a string from the quality of being internal or not, the data name and
its collection.
2023-07-27 15:29:58 +02:00
Jehan
41ed091879 app, libgimp, pdb: add an internal gimp_context_get_resource().
This will be useful in an incoming code to serialize GimpResource PDB arguments.
2023-07-27 15:27:53 +02:00
Jehan
86cbb5232b pdb: fix a typo.
I guess we never use that type nowadays.
2023-07-27 15:27:29 +02:00
Jehan
d439e9ff5c app, libgimp, pdb: factorize a bunch of similar code into gimp_pdb_get_resource().
Rather than reimplementing the same checks for every possible resource data
type, just do it once and redirect to the correct factory container.

For the libgimp API, we leave per-type functions `gimp_*_get_by_name()` (where *
can be brush|gradient|font|palette|pattern so far), but internally they all use
gimp_pdb_get_resource().

Note that eventually we want these functions to return a list of resources as it
should be possible to have several resources of a given type with the same name
(since they are made by third-party who might have had the same idea of a name).
2023-07-27 15:25:32 +02:00
Jehan
ccde23ebaa libgimpconfig: don't break serializing properties if one property serialization…
… fails.

This happens for plug-in settings storage. Serialization stops at first failed
property serialization, whereas we could store more. This feels like the last
settings feature is broken.
2023-07-27 15:24:56 +02:00
Balázs Úr
13dcc85daa Update Hungarian translation 2023-07-26 23:40:40 +00:00
Alx Sa
f947109f92 build: Enable IFF format on Windows
Now that libiff and libilbm have been added to the MSYS2 repositories,
the plug-in can be built automatically on Windows.
2023-07-26 17:12:35 -04:00
Jacob Boerema
43a5b92c65 build: MSYS2 package python3-gobject was replaced by python-gobject 2023-07-26 16:29:22 -04:00
Jehan
b64543caff libgimpwidgets: create proper links in function documentation. 2023-07-26 15:25:39 +02:00
Martin
7b737ecff7 Update Slovenian translation 2023-07-26 08:57:13 +00:00
Martin
18081d1745 Update Slovenian translation 2023-07-26 08:55:42 +00:00
Ekaterine Papava
acc2baa7a6 Update Georgian translation 2023-07-26 03:57:22 +00:00
Ekaterine Papava
3d1325f52a Update Georgian translation 2023-07-26 03:49:57 +00:00
Jehan
269502cfe4 NEWS: update. 2023-07-26 00:53:00 +02:00
programmer-ceds
b84095d7c6 Fix Tools Shortcuts 2023-07-25 21:33:28 +00:00
Anders Jonsson
8b84c5551b plug-ins: add and correct gettext macros in Python 2023-07-25 21:26:57 +00:00
Jehan
21a329dae6 app: nearly all GimpFont object now have an associated file.
(except from the aliases "Sans-serif", "Serif" and "Monospace")

The code to get the file path was inspired by code in MR !1011 by Idriss Fekir.

My initial idea was to use FcFreeTypeQueryAll() when adding each font
individually through FcConfigAppFontAddFile() but we were only doing this for
our additional directories (not the system ones) and also before we actually
loaded all the fonts through FontConfig. So this would have required more work
to get right. Though it also means that now the ! USE_FONTCONFIG_DIRECTLY code
path is more broken than ever (as we consider this path information quite
important for plug-ins now).

Additionally to make this work, I got rid of the code making all GimpFont
objects internal data by default, which is nonsense to begin with. Fonts are not
writable by GIMP, sure, yet they are external to GIMP and loaded from a file!

This will be important for an upcoming commit (which is currently in a branch
related to issues #50 and #9250), where we want to implement GimpResource
storage as plug-in settings, because fonts were the only GimpData without a file
and we are using this information to generate a collection identifier.
2023-07-25 23:10:29 +02:00
Jehan
9f9c0b4ea6 app: GimpFontFactory doesn't force anymore unique font names.
Note that there is a `container_obsolete` too in GimpDataFactory and I don't
apply the "unique-name" property to it because I'm unsure what it is.

Furthermore, eventually we'll want all types of data to allow duplicate names
(brushes, patterns or whatnot may come from all sources and may be named the
same by different people). But for now, let's focus on fonts before breaking
other parts of the codebase which we might not look into right now.
2023-07-25 23:10:26 +02:00
Jehan
0226b3ff5e app: only display the number of ignored fonts (and full listing if…
… the GIMP_DEBUG_FONTS environment variable is set.

Turns out nearly a thousand font files get ignored on my installation (and I
don't install much; a lot of them seem to be bitmap fonts (PCF) in a X11
directory). I still want output so that this topic doesn't get forgotten and
hopefully some day, we can do better. But a single line on stderr (and an
environment variable for details) is enough for now.
2023-07-25 21:16:04 +02:00
Idriss Fekir
5972d8d97f Implement support for custom fonts
Remap font names to unique generated names
so that pango sees them.

keep the font name for display and the internal
name for everything else.

* Fonts are still broken When exporting to pdf

* Not sure if xcf files would be usable on other systems
maybe use hash of psname internally instead

* Not sure if plug-ins using text layer work correctly
(do they use internal font name or the actual name?)
2023-07-25 21:16:04 +02:00
Yuri Chornoivan
d337d2d196 Update Ukrainian translation 2023-07-25 19:04:17 +00:00
Jehan
490cb4ca3a app: rename snap data type to GimpImageSnapData and remove it from core-types.
This is definitely not core type material. Also it's much better in the proper
header gimpimage-snap.h and the type name should reflect the file namespace,
especially as we make it public.
2023-07-25 16:07:06 +02:00
mr.fantastic
a6cf90b208 Support showing distance by view unit in realtime alignment 2023-07-25 15:31:16 +02:00
mr.fantastic
9e793cfe87 Adding on canvas text for equidistance snapping visualization 2023-07-25 15:31:16 +02:00
mr.fantastic
58d85efe75 Adding visuals to snapping by bounding boxes and equidistance
- Avoid conflict between snapping to active point and bbox/alignment snapping
- rearrange bbox snapping calls to give layer center more priority
2023-07-25 15:31:16 +02:00
mr.fantastic
c47f4954ef Adding snapping by equidistance functionality 2023-07-25 15:31:16 +02:00
mr.fantastic
0aa8ac4660 Adding initial support for snapping layers/path_points by layers bounding boxes 2023-07-25 15:31:16 +02:00
Jordi Mas
54728e0fe1 Update Catalan translation 2023-07-25 10:53:09 +02:00
Shubham
a7379664e9 app: Fix extra drawing with airbrush tool on layers with offset
When using airbrush tool, if the layer has a offset, then the offset was
applied to the the coords multiple times creating a series of dots when
holding the airbrush still (from the gimp_airbrush_stamp function).
Fixed this problem by storing the original value of coords before it
gets updated.
2023-07-24 15:55:30 +00:00
Shubham
8463544502 app: fix broken symmetry on offset layers
Painting with symmetry enabled on layers with offset was broken. Fixed
it.
2023-07-24 15:55:30 +00:00
Martin
8f09092ed3 Update Slovenian translation 2023-07-24 10:33:25 +00:00
Idriss Fekir
959426d4ee Fix Font Inline completion not working in some cases
Inline completion is case sensitive, this makes it
broken, because fonts desplayed in the pop should be
quried in a case-insensitive manner.

This fixes #2832.

See gtk issue #275.
2023-07-23 22:29:02 +00:00
psykose
300ce655c3 create_test_env.sh: use sh instead of bash
this is actually a regular sh-portable script, and this prevents needing
bash at build time or for tests (for packaging from tarballs)
2023-07-23 21:06:49 +00:00
Yuri Chornoivan
0485e36cce Update Ukrainian translation 2023-07-23 18:04:04 +00:00
Yuri Chornoivan
690f8ae35e Update Ukrainian translation 2023-07-23 18:02:21 +00:00
Jehan
a7836feed3 NEWS: update. 2023-07-23 18:20:04 +02:00
Ekaterine Papava
c0915480d7 Update Georgian translation 2023-07-23 03:31:45 +00:00
Anders Jonsson
095af5629c extensions: more i18n for goat-exercises 2023-07-22 15:16:42 +00:00
Jehan
ba5b4794e1 libgimp: remove outdated recommendation about sending non-localized strings.
gimp_plug_in_set_translation_domain() was removed in GIMP 2.99.12. Plug-ins are
now fully responsible for their own localization.
2023-07-22 16:17:24 +02:00
Ekaterine Papava
56812b55ce Update Georgian translation 2023-07-22 03:57:00 +00:00
Martin
1c35aa797c Update Slovenian translation 2023-07-21 22:15:08 +00:00
Jacob Boerema
0fb801f7f5 pdb: forgot one case of behavior in previous commit 2023-07-21 17:03:32 -04:00
Jacob Boerema
18408ce966 app, libgimp, libgimpwidgets, plug-ins, etc: rename behaviour to behavior
We use US English which uses behavior. So we replace all occurrences of
behaviour.

Most notable is File Open behavior in preferences. Besides that several
mentions in function documentation and a few in comments.
2023-07-21 15:35:23 -04:00
programmer-ceds
4fa1472e9c Add terminating NULLs to the tools accelerator arrays 2023-07-20 22:59:51 +01:00
Yuri Chornoivan
53239a3ffa Update Ukrainian translation 2023-07-20 16:22:59 +00:00
Yuri Chornoivan
25f14743de Update Ukrainian translation 2023-07-20 15:59:46 +00:00
Martin
6efa8499e1 Update Slovenian translation 2023-07-19 06:33:11 +00:00
Ekaterine Papava
b242365908 Update Georgian translation 2023-07-19 04:17:18 +00:00
Ekaterine Papava
d8ea19fa0e Update Georgian translation 2023-07-19 04:15:28 +00:00
Alx Sa
d1864866ee plug-ins: Support Farbfeld image import/export 2023-07-19 00:37:54 +00:00
Martin
f7c3dee88d Update Slovenian translation 2023-07-18 22:15:58 +00:00
Sabri Ünal
66a5e30d5d menus: Use Header Capitalization in image-menu.ui
Follow Header Capitalization for The "Padding Color" string.

More information: https://developer.gnome.org/hig/guidelines/writing-style.html
2023-07-18 19:08:28 +03:00
Sabri Ünal
84124a9f40 app: Mark two strings as translatable
- Welcome
- Release Notes
2023-07-18 19:07:42 +03:00
Anders Jonsson
21152340c2 Update Esperanto translation 2023-07-18 15:15:02 +00:00
Lukas Oberhuber
c1b4770c40 debug: print stack trace without crashing 2023-07-18 10:24:17 +00:00
Ekaterine Papava
856fa41621 Update Georgian translation 2023-07-18 03:32:58 +00:00
Yuri Chornoivan
8754878dd6 Update Ukrainian translation 2023-07-17 21:08:04 +00:00
Yuri Chornoivan
b7ca157cf4 Update Ukrainian translation 2023-07-17 21:04:26 +00:00
Yuri Chornoivan
8e75c39164 Update Ukrainian translation 2023-07-17 20:57:06 +00:00
Martin
dfe086e88a Update Slovenian translation 2023-07-17 14:49:43 +00:00
Martin
619cb6fe6d Update Slovenian translation 2023-07-17 14:48:12 +00:00
Anders Jonsson
091893ddf5 menus, plug-ins: more tab menu translatability 2023-07-17 10:27:30 +00:00
Alx Sa
48845bdd6f themes: Prevent image tab close button from overflowing...
...the tab itself. Noted by @user062. This adds a right margin to the
close button on the image tabs so that the tab size is pushed out
to fit the button.
2023-07-17 06:43:23 +00:00
Boyuan Yang
9e6946f55e Update Chinese (China) translation 2023-07-16 23:45:39 +00:00
Jehan
b7da9e9cd7 app: fix removing items in GimpMenuModel.
Use the dedicated function rather than comparing strings.

Because of this, menu items for the "windows-display-*" actions were not
destroyed, neither were the relevant images because the proxy menu item was
keeping a reference to the image (for the small in-menu preview in Windows
menu).
2023-07-16 23:55:17 +02:00
Ekaterine Papava
a4afaecf6e Update Georgian translation 2023-07-16 04:53:00 +00:00
Anders Jonsson
87260fb8ac Update Swedish translation 2023-07-15 18:42:02 +00:00
Anders Jonsson
c1a8580215 Update Swedish translation 2023-07-15 18:41:17 +00:00
Anders Jonsson
f8fd1d9175 Update Swedish translation 2023-07-15 18:30:28 +00:00
Anders Jonsson
b9f2e157cb Update Swedish translation 2023-07-15 18:28:52 +00:00
Martin
fc43fe371c Update Slovenian translation 2023-07-15 16:50:35 +00:00
Martin
4396300a0c Update Slovenian translation 2023-07-15 16:49:31 +00:00
Martin
7ec86cd448 Update Slovenian translation 2023-07-15 16:47:57 +00:00
Jehan
42fc27763e menus: forward port 2.10 placeholder names into 3.0 section names.
It's nearly the same list of placeholders which will make it easier to
third-party developers (though format still changed, devs will have to add
square brackets for section names).

Now some section names are missing because we would need to break some list into
smaller sections yet want to avoid having separators everywhere. This makes me
wonder if removing my first placeholder implementation was the right idea.
Anyway this new implementation is cleaner and we should find a way to add
sub-sections without creating separators in menus.

Also I didn't try to add new section names (though I did once or twice, e.g. a
"Close" section around quit/close actions which didn't exist) but eventually we
should. Being able to name logically parts of the menus will make them even more
organized (if we can't name a group of actions, it may mean we didn't think
properly the organization and order).
2023-07-15 16:44:17 +02:00
Anders Jonsson
caff1e61e4 libgimpwidgets, plug-ins: translate dialog buttons
GTK no longer contains stock labels, so the button
labels needed to be marked as translatable.
2023-07-15 14:29:14 +00:00
Alx Sa
9c87aaeebd scripts: Fix warning in Java map tooltip text
Per @ajonsson, gettext does not like < or > used as symbols
and throws a warning. They are replaced with HTML entities
&lt; and &gt; to prevent the problem.
2023-07-15 14:23:01 +00:00
Jehan
dc8ba756e4 app: debug menu and playground should be visible on non-releases stable branch.
These should be hidden on stable releases and shown on unstable branch. But
we'll also want to show these in the stable branch, outside of release
(typically when we'll be at 3.0.1).
2023-07-15 15:06:51 +02:00
Jordi Mas
8d0393bd4d Update Catalan translation 2023-07-15 12:38:36 +02:00
Alx Sa
019c1ba5d9 themes: Remove "corners" around combo-boxes
The combo box button is contained within a box element.
The box was also having its background-color set,
so there were small square "corners" around each dropdown menu.
This patch separates the box color from the button color to prevent
this.
2023-07-15 02:51:41 +00:00
Jehan
e0c8358132 Issue #9322: pass the "hidden-when" attribute in gimp_menu_model_get_item_attributes().
This should hopefully hide (really this time?) the items we don't want to be
seen on macOS menu bar.
2023-07-15 01:37:37 +02:00
Jehan
502944fc02 Issue #9704: radio actions not showing as radio menu items on macOS.
This issue was also happening on other platforms when run with the
GIMP_GTK_MENUBAR codepath.
2023-07-15 01:15:45 +02:00
Jehan
dfdb698ce0 libgimp: update function's documentation. 2023-07-14 17:02:19 +02:00
Jehan
3b05315754 plug-ins: fix the Python test dialog.
With recent changes, a GimpResource's ID is not its name anymore.
2023-07-14 16:59:46 +02:00
Jehan
a964b80ad7 plug-ins: the Python test plug-in should be installed for unstable branch and…
… non-release builds.
2023-07-14 16:45:39 +02:00
Jehan
1b2f229bf6 app: top-level custom menus must be added before the "Windows" menu.
"Windows" and "Help" should always be last. New top-level menus (created by
plug-ins, scripts or GEGL ops) will be appended in the order of creation between
"Filters" and "Windows" menus.
2023-07-14 16:41:55 +02:00
Jehan
0bd3a45757 app: fix hiccups in creation of submenus by plug-ins/filters.
There were some mixups between a few representations of menus:

* "_Some Menu" and "Some Menu" should both map to an existing submenu "Some
  Menu" (in the GimpMenuModel, the stored path doesn't contain mnemonic).
* The menu item on the other hand should contain the mnemonic and not lose it.
* Not only this, but "Some _Menu" should still map to the same menu, even if it
  was already created with a different mnemonic. It means that the first
  registered menmonic "wins", as we don't want duplicate submenus with same
  title (even if they have different mnemonics).

So this new code is better handling the canonical menu path (no mnemonic, no
section name, no double slashes, no trailing slashes, etc.) vs. the
canonical-with-mnemonic menu path to avoid weird duplicates.

Some additional bugs are fixed where we were creating weird empty submenus
containing the same items as the parent menu as well, or when a submenu title
was a perfect prefix of another submenu title at the same level.
2023-07-14 16:21:57 +02:00
Martin
de7c74323f Update Slovenian translation 2023-07-14 09:05:55 +00:00
Martin
6040505563 Update Slovenian translation 2023-07-14 09:04:06 +00:00
Ekaterine Papava
d4e7b25a68 Update Georgian translation 2023-07-14 05:07:26 +00:00
Jehan
982d32e79e menus: hide some menu items on macOS.
File/Quit, Edit/Preferences|Input Devices|Keyboard Shortcuts should not be in
the main menu bar on macOS because they are already in the "app menu".

See #9322.
2023-07-13 23:41:18 +02:00
Jehan
4c1ae49fc9 plug-ins: update the Help/GIMP Online links.
- Remove the wiki which is now dead.
- Update the roadmap link and title it in plural.
- Move the "Bug Reports and Feature Requests" inside "GIMP Online/" submenu.
2023-07-13 23:13:19 +02:00
Anders Jonsson
d99b933243 menus: add missing submenus to image-menu.ui.in.in
This allows for translation and use of accelerators.
2023-07-13 21:30:14 +02:00
Martin
71e217617b Update Slovenian translation 2023-07-13 15:54:21 +00:00
Jehan
c369a5ed70 menus: make all section names non-translatable.
I'm not sure what's the default for random string attribute, but better be
explicit anyway. I think this way, we make sure that gettext won't try and
translate these.
2023-07-13 16:57:23 +02:00
Jehan
b9b1f4c53d app, menus: remove all placeholder code.
This is now fully replaced by the new section name code.
2023-07-13 16:53:11 +02:00
Jehan
9ad5049dec menus, plug-ins: now place various plug-ins in the right menu sections.
This removes a bunch of inconsistencies we had from the before-2.99.16 version
because new items from plug-ins were all added at the bottom of their respective
submenu.
2023-07-13 15:49:05 +02:00
Jehan
d9aa7a6ba1 app: allow a new attribute "section-name" to <section> of menus.
This will replace the "placeholder" concept where I was using an invisible item
with a label and no action, making it invisible. Instead let's just name
(internally) our sections. This has the following advantages:

* Conceptually more correct: basically we just want to place items among the
  same category of actions.
* Easier to search for plug-in developers who'll want to place their plug-in
  procedures in menus, because it uses an actually searchable attribute
  ("section-name").

This is used by the core by allowing a special syntax in menu paths: if finished
by "/[Section]" then the item will be place in the specific section named
"Section". In case one actually wanted to create a submenu called "[Section]",
they can use a double bracket: "[[Section]" and "[[Section]]" will both map to a
normal submenu (not a section name) titled "[Section]".
All other usage of square brackets will not be processed in a particular way.
E.g. "Hello [World]" will end a submenu titled "Hello [World]" or "Bye]" will be
a submenu and so on.

Finally this system is currently limited to the position of the item itself,
i.e. must be placed as last element in the path. In particular, you currently
cannot use it to position a new submenu inside a section. E.g. say that I want
to create a submenu "From Platforms" under the "Open" section of the File/ menu.
This is currently impossible. With this syntax, we can create new items directly
in the "Open" section, or create a "From Platforms" submenu in the end of the
File/ menu, containing our new procedures.
This could be a good improvement to come.
2023-07-13 15:39:50 +02:00
Ekaterine Papava
9efd5fd4f2 Update Georgian translation 2023-07-13 05:04:13 +00:00
Ekaterine Papava
04a39c2ca1 Update Georgian translation 2023-07-13 05:00:50 +00:00
Ekaterine Papava
26683e574a Update Georgian translation 2023-07-13 04:55:50 +00:00
Luming Zh
2e67a21bd7 Update Chinese (China) translation 2023-07-13 00:13:22 +00:00
Alx Sa
ab93a1484a meson: Add option to compile Amiga IFF
Code provided by @lillolollo
Since libilbm and libiff are not in all repositories yet, this adds an option so
it is not required when building GIMP.
2023-07-12 22:55:20 +00:00
Jacob Boerema
b82419305b plug-ins: fix formatting in animation-optimize
A lot of the function calls did not have a space between function name
and opening parenthesis.
2023-07-12 16:45:26 -04:00
Jacob Boerema
5cdfa6e891 plug-ins: fix resource leak in animation-optimize 2023-07-12 16:45:26 -04:00
Jacob Boerema
5f1b0aab87 plug-ins: reduce chance of buffer overflow when copying strings
Sphere-designer: Since some of the strings are translated versions, we
can't know in advance how long they are going to be.
Let's use string copy/cat functions that explicitly check the size and
are guaranteed to add a NULL.
2023-07-12 16:45:26 -04:00
Yuri Chornoivan
35fba13d96 Update Ukrainian translation 2023-07-12 15:07:27 +00:00
Martin
469f1a145c Update Slovenian translation 2023-07-12 14:15:14 +00:00
Anders Jonsson
4239d1af44 plug-ins: uncomment animation-play in POTFILES.in
The animation-play plug-in was readded in
6bb03dc21a

Also remove it from POTFILES.skip together with
curve-bend that already had been reactivated.
2023-07-12 13:22:26 +02:00
Jacob Boerema
6c8625e5fc plugins: fix #8082 XWD file renders incorrectly 2023-07-11 18:26:05 -04:00
Jacob Boerema
ea68d87b66 plug-ins: clean up file-xwd
- Add modern error handling using GError.
- Check return values of fseek and fgetc for errors.
- Remove most occurrences of g(u)long.
- Fixed overflow issue with maxred/green/blue found with coverity.
2023-07-11 18:17:42 -04:00
Jacob Boerema
6484193d8f script-fu: fix out-of-bounds array access
I noticed this in coverity. I couldn't find any actual script using
SF_DISPLAY, so the impact probably isn't very big.
Because the enums start at 0, the size of the array should be at least
one more than the value of the last enum, which was not the case here.

Increase the size of the array by 1, so that accessing SF_DISPLAY,
which is the enum with the highest value, is valid.
2023-07-11 12:04:24 -04:00
Alx Sa
624ae512fc plug-ins: Fix typo in gfig-arc
Resolves #5742.
The check is for a horizontal line (where the Y coordinate
would be the same for all three points), but the X axis was
checked instead due to a copy/paste error.
2023-07-11 15:25:39 +00:00
Jehan
ae29736ee0 app, libgimp, pdb: fix annotations for resources as return values.
Resources are stored by the plug-in infrastructure and their memory should not
be managed by plug-in code.

My commit 4f69995b46 was crappy and modified a generated function. I was just
too tired with all the heat in here, I guess!
2023-07-11 16:16:21 +02:00
Anders Jonsson
30319739ed .gitlab: update link in merge request template 2023-07-11 12:47:12 +00:00
Jehan
4be2dfdee2 devel-docs: our macOS package minimum requirement is now 10.13 (High Sierra). 2023-07-11 14:20:28 +02:00
Jehan
4f69995b46 libgimp: fix annotations for gimp_brush_get_by_name().
Similarly to how we handled image items, all resources are handled and stored by
the plug-in infrastructure and should not be destroyed. This wrong annotation
was triggering bindings to unref resources when going out of scope, hence
crashing plug-ins.
2023-07-11 12:00:22 +02:00
Jehan
d54c511968 plug-ins: use proper gimp_brush_get_by_name().
Note that in the future, we expect this to be possible to create other brushes
with a same name. Maybe we should have a special function allowing to request
core resources (the ones installed by GIMP itself).
2023-07-11 12:00:22 +02:00
Jacob Boerema
d43075dca0 plug-ins: incorrect order of parameters in load_image_resource
Even though these parameters are currently not used here, better use
the correct order.
2023-07-10 17:50:08 -04:00
Jacob Boerema
63bb893c06 plug-ins: fix resource leak in psd-load
Adding unsupported messages was overwriting the old message without
first freeing it. In addition, the first message was initialized
as a string constant.
We now start with duplicating the (empty) string, so that it can be
freed. We then add a define to reduce boilerplate to add the string
for each unsupported feature. The code in this define takes care of
adding the new message and freeing the old message.
2023-07-10 17:50:08 -04:00
Martin
a9f642322d Update Slovenian translation 2023-07-10 20:44:12 +00:00
Yuri Chornoivan
c7d32f37c6 Update Ukrainian translation 2023-07-10 19:44:56 +00:00
Jacob Boerema
bbbd149ba3 plug-ins: fix possible integer overflow on large images in jigsaw
Make sure we use gsize for intermediate results to not get integer
overflow on large image sizes.
This still is not ideal, but better than a crash, since we may (try to)
allocate a very large block of memory, which we should eventually fix
by looping over smaller size buffers.
2023-07-10 14:19:07 -04:00
Jacob Boerema
97a71cfd41 libgimp: fix resource leak in gimpimagemetadata-save 2023-07-10 14:19:07 -04:00
Ekaterine Papava
8febbf9da8 Update Georgian translation 2023-07-10 17:08:06 +00:00
Jacob Boerema
03e32e6fd3 app, pdb: silence coverity warning about integer overflow
Brushes can't be large enough to actually cause overflow here, but
since the result is gsize, it can't hurt to have the intermediate
results to gsize too.
2023-07-10 12:30:24 -04:00
Jacob Boerema
5645abc051 plug-ins: fix meson deprecated warning for file-icns 2023-07-10 12:30:24 -04:00
Anders Jonsson
44108eb9c3 app: make debug menu translatable 2023-07-10 14:58:49 +00:00
Jehan
e6ccea7c39 app: verify that the GimpUIManager exists.
Though I didn't encounter this bug in my commit 54b22c717a, 2 unit tests are now
failing with:

> Bail out! Gimp-Widgets-FATAL-CRITICAL: gimp_ui_manager_update: assertion 'GIMP_IS_UI_MANAGER (manager)' failed

I am assuming this is a consequence of this code I just changed.
2023-07-10 16:58:15 +02:00
Martin
82b1fd6c2e Update Slovenian translation 2023-07-10 13:56:48 +00:00
Jehan
4ddf6ae8f6 Issue #9725: top menus and sub menu not translated.
Adding 2 missing .ui files.
2023-07-10 12:11:34 +02:00
Jehan
54b22c717a app: make sure gimp_ui_manager_update() is run from the main thread.
This GTK widget code could be reach from a thread calling gimp_image_flush().
Yet all GUI-related code must happen in the main thread (also even though
actions are not GTK code anymore, they can trigger GUI updates).

No issue happened from this so far (that we know of), but a trace by SBDaule for
their growing layer project showed that we'd reach this code if calling
gimp_image_flush() from the paint thread.
2023-07-09 23:24:07 +02:00
Jehan
e465e867c1 NEWS: typo fix. 2023-07-09 22:21:00 +02:00
Jehan
760e912d20 INSTALL: add some packages in the optional packages list. 2023-07-09 13:32:51 +02:00
Niels De Graef
ed1ad72255 pdb: Fix size in gimp_image_get_colormap
It looks like we left out the multiplication by 3 when passing the
colormap size to get to the number of bytes in commit 89c359ce

This fixes a crash when saving an XPM file

Fixes: https://gitlab.gnome.org/GNOME/gimp/-/issues/9711
2023-07-08 23:08:54 +02:00
Alx Sa
b9e49a3fd9 tools: Fix hiding on-canvas text editor
After 59cb3e36, the GimpOverlayFrame that contains
the on-canvas text editor is still partially visible as a dot.
This patch now hides and shows that as well based on
the "Show On-Canvas Editor" option.
2023-07-07 23:11:22 +00:00
Alx Sa
69ddbeba29 themes: Hide 1/0 labels on GtkSwitch sliders
Resolves #9676.
Per @pixelmixer and @programmer_ceds's research,
setting the color attribute on the switch's image children
removes the 1/0 labels on non-System themes.
2023-07-07 18:56:34 +00:00
Jehan
2c608168a2 plug-ins: don't use Tabs indentation, only space.
This was introduced in commit 95fa902827. Unfortunately Gitlab web UI is really
not good at showing indentation issues (or any other space coding style issues,
for that matter).
2023-07-07 17:38:23 +02:00
Luming Zh
13dd829335 Update Chinese (China) translation 2023-07-07 12:13:43 +00:00
Luming Zh
b18894ccfd Update Chinese (China) translation 2023-07-07 12:09:41 +00:00
Jehan
1319523de7 app: no need to show the "Merge menu and title bar" option on macOS.
This doesn't do anything in this case, so better hide the settings.
2023-07-07 13:51:29 +02:00
Jehan
6d2580a421 meson.build: post-release version bump to 2.99.17. 2023-07-05 18:09:54 +02:00
Jehan
d3c5536ac8 Release development version GIMP 2.99.16. 2023-07-05 16:00:47 +02:00
Jehan
74fee1a957 desktop: update release date (to today) in AppStream file. 2023-07-05 15:57:24 +02:00
Jehan
18e47a29e0 NEWS: last update (this time really!) before GIMP 2.99.16 release. 2023-07-05 15:49:33 +02:00
Jordi Mas
daa19fc2db Update Catalan translation 2023-07-05 14:00:59 +02:00
Jehan
1b3af8a89b Issue #9648: don't flush the image when selecting items.
This results in an infinite loop and there is no change done, so no reason to
flush anything. Mitch had a fix for this (probably the same, per the IRC
discussion), but I really wanted to just release GIMP 2.99.16. So Mitch, if you
read this, sorry for not waiting for you to push this one!
2023-07-04 22:10:40 +02:00
Jehan
c95b8518fe app, icons: use the Python executable found by pythonmod.find_installation().
We already search for a compatible Python version in the root meson file, no
need to look up Python 3 again in the PATH, each time we run an external Python
script in the build.

This should hopefully fix #9687.
2023-07-04 19:00:55 +02:00
Jordi Mas
95fa902827 Specify no format to prevent the % to be interpreted as formatter by the gettext toolchain 2023-07-04 14:39:11 +02:00
Jordi Mas
ca404795e3 Update Catalan translation 2023-07-04 12:42:58 +02:00
Lukas Oberhuber
df4ed9c1ec app: Fix key presses not working on mac
Part fixes #9322. This was making GIMP on MacOS unusable.
2023-07-02 15:57:44 +01:00
Jordi Mas
780cda6f72 Update Catalan translation 2023-07-02 07:40:17 +02:00
Alexandre Prokoudine
df9a7f9ca1 Update Russian translation 2023-07-02 02:19:29 +02:00
Jehan
274b734e61 libgimp: fix double free crash in gimp_drawable_get_thumbnail(). 2023-07-01 23:24:33 +02:00
Jehan
8e4850dafe build: fix (hopefully) lua in the Windows installer.
See: https://gitlab.gnome.org/GNOME/gimp/-/issues/9653#note_1780587

Looking at MSYS2 logs, it looks like they very recently "fixed" the search paths
for lua files, which in turn broke our workaround (searching in subdirectories
of bin/ instead of share/ and lib/).

This should work better (though untested) with the workaround removed now.

Commit on luajit package at MSYS2:
703c7bae2f
2023-07-01 22:12:13 +02:00
Yuri Chornoivan
e32a67d948 Update Ukrainian translation 2023-07-01 20:06:36 +00:00
Yuri Chornoivan
1a23fc5e9a Update Ukrainian translation 2023-07-01 20:04:25 +00:00
Martin
1186a5dbcc Update Slovenian translation 2023-07-01 18:56:32 +00:00
Marco Ciampa
53f929dc9c Updated Italian translation 2023-07-01 12:00:38 +02:00
Marco Ciampa
95c141007c Updated Italian translation 2023-07-01 11:50:57 +02:00
Asier Sarasua Garmendia
7219245bfb Update Basque translation 2023-07-01 09:23:11 +00:00
Anders Jonsson
f8aa50204f Update Swedish translation 2023-07-01 09:13:23 +00:00
Ekaterine Papava
16a921da37 Update Georgian translation 2023-07-01 06:09:22 +00:00
Jacob Boerema
9038fd2c13 libgimpwidgets: issue #9673 screenshot plug-in crashes
In commit 48c27770 some unicode related changes were made. As a result of
that on Windows display_device, which was previously a duplicated string,
is now referenced directly.
However, the g_free was not removed, causing a crash.

We resolve this by removing the obsolete g_free.
2023-06-30 17:43:39 -04:00
Alx Sa
d68c7f612f plug-ins: Clarify JPEG subsampling option labels
Resolves #5525.
"4:4:0" is the more well-known term rather than "4:2:2 vertical" for this subsampling option.
2023-06-30 17:28:52 +00:00
Jehan
c21dbc8a20 tools: better support of using --runtime with --beta or --nightly. 2023-06-30 18:35:06 +02:00
Anders Jonsson
ba2b7550f7 Update Swedish translation 2023-06-30 16:26:03 +00:00
Alx Sa
3cf5a587ce plug-ins: Match RGB FITS orientation to SiriL
Switching to the cfitsio library's fits_read_img () function in 03ea666f 
caused RGB FITS images to be read in upside down per SiriL developers and
NASA standards (odd, since cfitsio is maintained by NASA). This flips them back.
2023-06-30 16:01:39 +00:00
Martin
71fa32424c Update Slovenian translation 2023-06-30 15:59:48 +00:00
Jacob Boerema
14cce79d16 app: use hyphen for the precision settings in Encoding submenu
The Microsoft style guide and other places online suggest that using a
hyphen is recommended between a number and the related word, when modifying
a noun, so let's do that in our Image -> Encoding submenu too.
2023-06-30 11:37:19 -04:00
Martin
3d7fa18c6d Update Slovenian translation 2023-06-30 15:29:06 +00:00
Martin
7f08ad4d76 Update Slovenian translation 2023-06-30 15:27:44 +00:00
Martin
7521c3dd70 Update Slovenian translation 2023-06-30 15:26:24 +00:00
Anders Jonsson
fee62e2b05 NEWS: Typo fixes 2023-06-30 12:21:09 +02:00
Asier Sarasua Garmendia
27acf41699 Update Basque translation 2023-06-30 08:01:45 +00:00
Alx Sa
03ea666fc8 plug-ins: Fix regression on importing RGB FITS
The developers of SiriL sent me some RGB FITS images that rendered incorrectly
after d4f42076. These must be read in as 
planes rather than individual rows.
2023-06-29 15:31:50 +00:00
Jehan
84fb879973 NEWS: possibly finale update before 2.99.16 release. 2023-06-29 12:13:33 +02:00
Jehan
e1203e9f76 gitlab-ci, build: create Windows installer files with the Linux build.
The creation of the BMP welcome images for the Windows installer (part of
-Dwindows-installer=true build option) fails in the Windows job. After much
debugging, I could run GIMP, yet it was not enough. One of my hypothesis so far
is that the environment variables for DLLs won't work, since all the DLLs must
be in the same directory as the main binary (though with the WSL thing, I am
unsure, maybe it is still supposed to work), which only happens once GIMP is
installed. So GIMP runs successfully but not plug-ins.

Anyway I wasted too much time working on this and without a local Windows, it
just takes too long (mostly testing thanks to the CI) and is frustrating. Let's
just move to building both the localization files and the images on the main
Debian job (gimp-meson-debian), then use these as dependencies of the
win-installer-nightly job, i.e. when building the installer.
2023-06-29 00:21:44 +02:00
Jehan
8db25f2246 build: prepend in case the environment variable already exists.
The common order logic for list of directories in environment variables is that
left paths have precedence. This is at least the case for LD_LIBRARY_PATH (and
probably GI_TYPELIB_PATH too).
Make sure that our local libraries and introspected binaries (in the build
directory) are used and not any version installed on the system or by previous
`ninja install` calls.
2023-06-29 00:21:29 +02:00
Jehan
757adf94bb app: do not load images interactively when we have no interface.
This includes both cases when running gimp-console or running GUI gimp with
--no-interface option.
2023-06-29 00:09:28 +02:00
Jehan
2825fa67e0 build: build images with gimp-console if available.
This was a first attempt at fixing this error on the CI:

> Cannot open display:

Though it was not enough (see next commit calling plug-ins as non-interactive
when called without interface), it is still a useful change overall.
2023-06-29 00:09:28 +02:00
Jehan
9d03cdd9ae build: remove test on now-removed Makefile.am for lang list consistency. 2023-06-29 00:09:28 +02:00
Jehan
f5001a4c8c plug-ins: we must output the dummy file in the same directory. 2023-06-29 00:09:28 +02:00
Alexandre Prokoudine
05b06b1c8d Update Russian translation 2023-06-28 02:00:26 +02:00
Jacob Boerema
f65d8e8730 app: silence warning in gimpimage-convert-indexed
We had the following warning:
In function 'make_remap_table',
    inlined from 'gimp_image_convert_indexed' at
  ../../gimp/app/core/gimpimage-convert-indexed.c:1057:7:
D:/msys64/mingw64/include/glib-2.0/glib/gmem.h:261:19: warning: argument 1
 range [18446744071562067968, 18446744073709551615] exceeds maximum object
 size 9223372036854775807 [-Walloc-size-larger-than=]

This is apparently caused by inlining in combination with using a signed
int.
See also: https://gcc.gnu.org/bugzilla//show_bug.cgi?id=85783

Casting to (guint) silences the warning here.
2023-06-27 14:15:34 -04:00
Alexandre Prokoudine
0c453edc78 Update Russian translation 2023-06-27 19:21:14 +02:00
Jehan
9e9fe1435a build, plug-ins, gitlab: make GIMP runnable from build directory without…
… being installed.

There is already most of the main code logic for this, though now plug-ins need
to be in their own subdirectories, which breaks for plug-ins/common/ and
plug-ins/python/, while I needed plug-ins in both these categories to generate
the Windows installer welcome images (file-png, and python-fu-eval in
particular).

Once again, meson was not very helpful, since all its functions still refuse to
output generated files in subdirectories, so I end up duplicating plug-in files
with a custom Python script.

This should fix the CI. It was working on my machine as GIMP was installed, but
such a build rule should work even without GIMP installed.
This will also be useful in the future when we'll want to run unit tests of
plug-ins through the finale GIMP binary itself.
2023-06-27 17:46:46 +02:00
Jehan
9ccdd56a36 build: run build/windows/meson.build before app/ plug-ins/ and extensions/.
Fixes:

> ../extensions/goat-exercises/meson.build:12:4: ERROR: Unknown variable "gimp_plugins_rc".
2023-06-27 01:01:50 +02:00
Jehan
2fd25fe6bd build: generate the Windows installer welcome images from the splash screen.
After discussion with Jernej, InnoSetup should now work better with rescaling
a big image properly to the window size, yet the ratio should still matter.
Apparently the welcome image is a hack and this is why it requires specific
ratio images. We don't use the big size yet, but since Jernej told me which
dimensions are expected, I already added the code for it to make it easier
later.

So anyway this code would allow us not to have to commit welcome images each
time, which are basically resized copy in BMP of the splash screen, slowly yet
surely filling up our repository with image duplicates.
After all, we develop a scriptable image editor! We should use it to edit images
and export in expected formats!

I only use this script for the devel installer for now, for testing and see how
it goes.
2023-06-27 00:39:17 +02:00
Yuri Chornoivan
8676907c6d Update Ukrainian translation 2023-06-26 18:58:17 +00:00
Yuri Chornoivan
3dadf8899a Update Ukrainian translation 2023-06-26 18:56:47 +00:00
Jehan
2696372680 build: add missing dependencies in packaging script.
While some packages may be needed only when building (and others only when
packaging), we should probably have a shared list of packages needed for both
steps so that we avoid discrepancies which lead to missing libraries in our
installer.

See: https://gitlab.gnome.org/GNOME/gimp/-/issues/9653#note_1777596
2023-06-26 19:27:59 +02:00
Anders Jonsson
0c464718b4 Update Swedish translation 2023-06-26 17:26:01 +00:00
Daniel Novomeský
a4f0239818 plug-ins: support libjxl v0.9 decoding API 2023-06-26 16:41:05 +02:00
Alx Sa
8a53b7c219 widgets: Fix compiler warning in gimpcontainerview
Initialize "border" to 0 to remove a warning that
"'border' may be used uninitialized"
2023-06-26 14:12:42 +00:00
Alexandre Franke
7f74ff976e Update French translation 2023-06-26 08:56:03 +00:00
Jehan
71e25a1ac1 NEWS: update. 2023-06-26 02:41:01 +02:00
Jehan
3cb43bef93 app: localize GEGL filter's action default short label template.
Even though it's just for 3 dots, this may actually be formatted differently in
different languages. Let's not assume we all share this punctuation mark.
2023-06-26 02:19:26 +02:00
Øyvind Kolås
7277baea54 meson,app: depend on GEGL-0.4.46 2023-06-26 00:56:58 +02:00
Niels De Graef
26f967e998 app: update relevant comments about Wayland hotspot 2023-06-25 22:21:37 +00:00
依云
edfded372d app: don't scale hotspot in Wayland
The hotspot coords are in the cairo surface's coords space, and the
cairo surface has half the size as the x2 pixbuf because of scale=2,
which makes the hotspot coords remain the same.

With regard to the referred code snippet in the comment[1], the coords
have been scaled in gdk_cursor_new_from_surface.

This fixes https://gitlab.gnome.org/GNOME/gimp/-/issues/9047.

[1]: https://gitlab.gnome.org/GNOME/gimp/-/merge_requests/545#note_1388777
2023-06-25 22:21:37 +00:00
Jehan
6a9838c804 plug-ins: fix build warnings.
Fixes several missing declaration warnings because in fact of missing include,
such as:

> warning: no previous declaration for ‘console_editor_new’ [-Wmissing-declarations]

Fixes 2 old-style definitions:

> warning: old-style function definition [-Wold-style-definition]
2023-06-25 23:43:40 +02:00
Alexander Shopov
f0ab126563 Update Bulgarian translation 2023-06-25 19:45:54 +00:00
Anders Jonsson
eb25374670 Update Swedish translation 2023-06-25 19:38:34 +00:00
bootchk
7b9b5db69e SF Console history persist as GStrv setting.
Other driveby format and wording changes to dialog title, welcome text.

Part of issue 9579 SF roadmap
2023-06-25 18:28:03 +00:00
lillolollo
691ec70c0e Eliminate warning: ‘gimp_unique_dbus_open’ defined but not used [-Wunused-function] 2023-06-25 18:01:45 +00:00
Jehan
23a87ce4e3 Issue #9350: fix GimpMenu separator lines being randomly thick (other case).
The previous commit did fix one such reason (multiple separators next to each
other), but I realized there is one other case where single separators are just
too big: when the menu is embedded in a GtkHeaderBar, each separator would have
a weird margin of several pixels (at least in my case, probably taken from the
underlying system theme). And worse, this margin was using another background
color.

So anyway this CSS rules takes care of not adding weird margins to menu
separators.
2023-06-25 19:28:54 +02:00
Anders Jonsson
c6240a2002 Update Swedish translation 2023-06-25 17:25:43 +00:00
Jehan
ff91a0ac3d Issue #9350: fix GimpMenu separator lines being randomly thick. 2023-06-25 19:04:37 +02:00
Yuri Chornoivan
5eaec7edf1 Update Ukrainian translation 2023-06-25 13:43:57 +00:00
Yuri Chornoivan
aae7d2f16a Update Ukrainian translation 2023-06-25 13:40:56 +00:00
Anders Jonsson
f6b0f7a50b Update Swedish translation 2023-06-25 13:00:01 +00:00
Anders Jonsson
fa04370cd1 Update Swedish translation 2023-06-25 10:33:35 +00:00
Jordi Mas
fb186a9846 Update Catalan translation 2023-06-25 09:40:32 +02:00
Ekaterine Papava
f3aaf876df Update Georgian translation 2023-06-25 07:22:33 +00:00
Martin
83c8cdaee9 Update Slovenian translation 2023-06-24 22:25:54 +00:00
Alx Sa
ca3c709d56 core: Add color/pattern only fill options
Resolves issue with #8461.
This provides a conditional value for the fill options to only show
a color and pattern, rather than fore/background colors.
Currently only used for the text editor.
2023-06-24 19:42:58 +00:00
Martin
fad2ab33fa Update Slovenian translation 2023-06-24 19:20:37 +00:00
Jehan
5bf0ece215 app: fix build warning.
Though not a bug, this change will get rid of the following warning:

> app/dialogs/module-dialog.c:291:28: warning: ‘location’ may be used uninitialized in this function [-Wmaybe-uninitialized]
>   291 |       text[INFO_LOCATION]  = gimp_module_is_on_disk (module) ?
2023-06-24 18:42:44 +02:00
Alexander Shopov
6b6928192c Update Bulgarian translation 2023-06-24 09:04:22 +00:00
Martin
b43a7f5635 Update Slovenian translation 2023-06-23 21:18:56 +00:00
Alx Sa
280cde75f4 plug-ins: Port checkerboard to...
...GimpProcedureDialog
2023-06-23 14:13:29 +00:00
Alexander Shopov
d910d733e4 Update Bulgarian translation 2023-06-23 08:10:05 +00:00
Ekaterine Papava
6d346701cd Update Georgian translation 2023-06-23 03:28:15 +00:00
Jehan
aecf22defb libgimpwidgets: fix the non-resizing combo-box popup when switching from short…
… to long format of unit names.

We can clearly see that the main part of the widget is correctly resized but not
the popup. Unfortunately we don't have access to the popup widget which is
private data, so the best workaround I found so far was to pop the menu down and
up, which basically provokes a redraw to the correct size after contents change.

This fixes MR !385.
2023-06-23 00:46:20 +02:00
Venkatesh
dc3eb3b340 MR !385: resolve "GimpUnitComboBox doesn't show full unit names in 2.99" 2023-06-22 22:38:25 +00:00
Jehan
8ef8ac58aa app: fix crash when loading a XCF containing a text layer with pattern outline.
There was a bug in commit ca6b58e970 which went under the radar. The gimp
variable was not set at creation, so this line was crashing:

> container = gimp_data_factory_get_container (text->gimp->pattern_factory);
2023-06-22 22:23:05 +02:00
Jehan
cdc9fa9907 app: migrated (style solid) in gimprc.
Since MR !706, (style solid) doesn't exist anymore which makes gimprc parsing
fails (hence losing configuration).

This fixes:

> Gimp-Config-Message: 21:20:21.018: Error while parsing '/home/jehan/.config/GIMP/2.99/gimprc' in line 18: invalid value 'solid' for token style
> Gimp-Config-Message: 21:20:21.018: There was an error parsing your 'gimprc' file. Default values will be used. A backup of your configuration has been created at '/home/jehan/.config/GIMP/2.99/gimprc~'.
2023-06-22 21:30:13 +02:00
Alx Sa
ce6f7179ab core: Replace "Solid Colors" with "FG/BG Colors"
Replaces "Solid Colors" option in Fill Path with Foreground/Background
Colors options. This allows users to fill with either, rather than
having to switch the foreground color each time.
GIMP_CONTEXT_PROP_MASK_BACKGROUND was added to the fill and stroke
contexts to allow the background color to be recognized.
In places where Solid Color was used as a default, Foreground Color is
now used instead.
2023-06-22 18:46:14 +00:00
Ekaterine Papava
809713512d Update Georgian translation 2023-06-22 06:37:40 +00:00
Ekaterine Papava
2480de96fa Update Georgian translation 2023-06-22 06:31:29 +00:00
bootchk
ef662fa02a libgimp: fix #9304 API TextLayer
Adds needed change missing in commit that added class GimpTextLayer
2023-06-21 21:54:04 +00:00
Andras Timar
da0ea189fc Make transform matrix selectable
In our use case it is necessary to save the transform matrix, and the
easiest solution is to make the label selectable. If we print the
whole matrix into a single label, formatted with tabs and linefeeds,
then the whole matrix can be copied with a single operation.
2023-06-21 21:02:23 +00:00
Alx Sa
59cb3e36e1 app: Toggle on-canvas text editor visibility
This adds a new boolean to text options, "Show on-canvas editor".
When toggled, it immediately hides (or re-shows) the current
text layer's on-canvas text editor.
It uses the same signal and function as the "use-editor" property.
2023-06-21 20:17:27 +00:00
Jehan
b48ce94e6a app: replace g_action_map_lookup_action() by gimp_ui_manager_find_action().
With more recent logic, not all actions are inside the application's action map.
We need to look up actions in our GimpUIManager.
This fixes failing to find the actions with the "text-editor." prefix (in the
text tool editor's toolbar).
2023-06-21 22:17:09 +02:00
Alx Sa
01d7e7a992 actions: Fix "Raise or Open" to actually raise
Resolves #9636.
gimp_object_get_name (gimp_display_get_image (display)) returns NULL 
instead of the filename. documents_raise_display was changed to call 
gimp_image_get_imported_file () or gimp_image_get_file() instead to 
get the actual filename.
2023-06-21 20:10:12 +00:00
Jehan
a580f47e22 plug-ins: fix previous commit (!901).
Config string properties are allocated. We can't use static strings.

Also fixing an unused variable (mesg_body) warning.
2023-06-21 21:38:36 +02:00
Alx Sa
51cf74c036 plug-ins: Port mail to GimpProcedureDialog 2023-06-21 19:36:28 +00:00
Alx Sa
e152591e80 plug-ins: Don't run Depth-Merge when cancelled.
When porting depth-merge to GimpPlugin in 5154b271 the return statements
were not fully replicated. As a result, the depth-merge function was 
called even if the dialogue had been cancelled.
This patch adds the missing return statements to prevent this.
2023-06-21 19:01:32 +00:00
Jehan
2541389b0c plug-ins: don't use a hardcoded 256 as max border.
Half of the smaller dimension seem a better value, since once we reach any half,
it means we will compute using all pixels anyway. Any width higher than this is
useless.
2023-06-21 17:33:04 +02:00
Alx Sa
2baa518a30 libgimpwidgets: Don't call scaled digits on pixels
Adds a check to cast resolution to an int if units are pixels,
rather than calling gimp_unit_get_scaled_digits().
This prevents a LibGimp-CRITICAL about "_gimp_unit_cache_get_digits: 
assertion 'unit >= GIMP_UNIT_INCH' failed"
2023-06-21 14:05:19 +00:00
Alx Sa
519b627f5d plug-ins: Port border-average to...
...GimpProcedureDialog.
Also provides an example of the new 
gimp_procedure_dialog_get_size_entry () API.
2023-06-21 14:05:19 +00:00
Alx Sa
6be4549e46 libgimp: new gimp_procedure_get_size_entry ()
This allows plug-in developers to create GimpSizeEntry
widgets with the procedure dialog API.
2023-06-21 14:05:19 +00:00
Jehan
4136166d12 libgimp: fix gimp_drawable_get_sub_thumbnail_data().
Since commit 89c359ce47, it's supposed to return a GBytes, yet it was returning
raw data (probably intermediate hacking state which was not properly cleaned
up).

It was crashing for instance GimpDrawablePreview widgets at drawing time.
2023-06-21 00:12:20 +02:00
Alx Sa
4b8f2113f3 pdb: Fix datatype mismatch created by 2a946712 2023-06-20 17:03:21 +00:00
Alx Sa
2a94671269 pdb: Allow ripple to take floating point inputs
Partially resolves #7211.
plug-in-ripple is a wrapper for the GEGL ripple effect. GEGL allows for
double values for period and amplitude, while the GIMP PDB only allows 
integers. This patch aligns the datatypes.
Note that Angle and Phi are still limited to the current design.
2023-06-20 15:27:10 +00:00
bootchk
57909356ff Implement #9628 enhanced err msg for mismatched parens 2023-06-20 07:39:26 -04:00
bootchk
1bc2ed77a3 Fix #9554 (quit 1) must yield err msg
So that scripts have a way to declare an error.
2023-06-20 11:14:13 +00:00
Alexander Shopov
12a84988ed Update Bulgarian translation 2023-06-20 11:01:33 +00:00
Jordi Mas
a09609bb76 Removes spaces at the end of string and Compuserve company name which is not relevant in 2023 2023-06-19 20:47:51 +00:00
Jordi Mas
bb468d1f90 Update Catalan translation 2023-06-19 22:25:44 +02:00
Stephan Lenor
f5cc64ddd6 Speed up matrix operations (unit-wise, no interface is touched) 2023-06-19 15:45:32 +00:00
Jordi Mas
82d5743e77 Update Catalan translation 2023-06-18 21:09:40 +02:00
Alx Sa
762088f9de plug-ins: Show dimensions, BPP in ICO layer names 2023-06-18 05:11:44 +00:00
Øyvind Kolås
5b129f891a app: better synthesized short_label for gegl menu actions
For all the test-ops thus far in gegl, gimp:menu-label has been
the same as title + "..", to keep the number of duplicate strings
that need to be translated and the number of needed boiler-plate
lines of meta-data in GEGL down, this is the default behavior when
a title key exists.
2023-06-17 22:38:53 +02:00
Alx Sa
addc37880e themes: Fix "box" on highlighted checkbox label
The checkbox label wasn't included the :hover CSS, so its background
color didn't change. This created a "box" around the label without the
highlight color when the mouse was over it.
2023-06-17 19:01:39 +00:00
Mark
45e91bd550 fixes menu bar being todark for gray theme 2023-06-17 17:48:57 +00:00
Alx Sa
2065db7fe7 plug-ins: Don't load image for ICO thumbnail
Due to a small typo, GIMP always loaded the entire image as a thumbnail
even if a suitable one was found.
This patch fixes that typo.
2023-06-17 04:42:34 +00:00
Alx Sa
e5a4336604 plug-ins: Add width/height label to ICO export
Similar to the ICNS export, file-ico now shows the icon dimensions for 
all types in the export dialogue.
2023-06-16 23:44:36 +00:00
Jehan
07ee2fe776 Issue #9446: better logic to prevent multiple successive inhibition requests.
My previous commit was improving the case where we just get many "dirty" signals
and successful inhibition. But if the inhibition request was failing, we would
just retry again and again.

This new version will hold off on on requesting the inhibition for the next 10
minutes. Then it will try again, in case the failure reason might have been
temporary.
2023-06-16 22:53:59 +02:00
Jehan
863fb62581 Issue #9446: do not uninhibit/inhibit at every image change unless…
… the reason message changes (i.e. when number of dirty image changes).

Some actions in particular would trigger several "dirty" signals, there is no
reason to uninhibit then re-inhibit repeatedly. And as a more general rule,
there is no reason to do so even for different actions while we are not planning
to update the inhibition reason.

It may not be the main reason for #9446 (because if it hangs for several
minutes, there is likely something going on, deeper at the dbus call level), yet
it would definitely alleviate the issue (dividing the wait by as many times as
the dirty signal was emitted!).
2023-06-16 22:04:28 +02:00
Daniel Novomeský
69c81f1059 flatpak: upgrade libjxl 2023-06-16 13:15:14 +00:00
Alx Sa
d4260449fb app: fix some glib related deprecations
As in d16734a4, this checks the GLib version and conditionally uses 
G_APPLICATION_DEFAULT_FLAGS or G_APPLICATION_FLAGS_NONE for GimpApp.
2023-06-16 00:13:02 -04:00
Alx Sa
bf1e125138 widgets: Fix RGB histogram pixel/count values
The RGB histogram shows three histograms overlaid on each other.
This multiples the pixel and count attributes by 3. To correct this,
the result of gimp_histogram_get_count () is divided by 3 for the
pixel and count displays.
2023-06-15 19:24:49 -04:00
Ville Pätsi
c9cd4cea2a themes: less thick menu separators and thick dark borders in menu tooltips. 2023-06-16 01:15:39 +02:00
Alx Sa
9efc552069 plug-ins: Keep GIF's full palette on import
Resolves #414.
Currently GIMP only loads the palette colors used in a GIF, discarding 
the rest. This can cause issues when a consistent palette is required
(e.g. a video game sprite or background).
This patch uses either the global or local GIF max palette value to set 
the colormap size, thus retaining the full palette on import.
2023-06-15 21:07:22 +00:00
Lloyd Konneker
3cf3097d62 libgimpconfig: support GStrv aka string array 2023-06-15 17:12:44 +00:00
bootchk
5eac31f07f Refactor ScriptFu Console
Rename fields of ConsoleInterface more desciptive

Add c,h files for object editor and history

Extract object ConsoleEditor

Extract object ConsoleHistory

Extract TotalHistory methods
2023-06-15 13:26:00 +00:00
Jordi Mas
d7287e0f3b Update Catalan translation 2023-06-15 08:13:57 +02:00
Jordi Mas
e8a35c23e6 Fixes to Catalan translation 2023-06-14 00:11:25 +02:00
Øyvind Kolås
21411047ee app,pdb,plug-ins: %s/gegl_node_connect_to/gegl_node_connect/ 2023-06-13 19:58:42 +02:00
Øyvind Kolås
c4734a27b5 meson,app: depend on GEGL 0.4.45 2023-06-13 17:14:03 +02:00
Øyvind Kolås
6919d07b6c plugins/file-gegl: use gegl_node_link instad of gegl_node_connect_to 2023-06-13 17:14:03 +02:00
Øyvind Kolås
e7dcfb2927 app: use gegl_node_link and gegl_node_link_many
Instead of gegl_node_connect_to which is rather verbose, and slated for
deprecation in GEGL.
2023-06-13 17:14:03 +02:00
Martin
fe985c3961 Update Slovenian translation 2023-06-13 14:20:53 +00:00
Alx Sa
f92ecddd53 pdb: Fix NULL check in gimp-file-load-layers
As @bootchk noted, gimp-file-load-layers does not check the result of 
file_open_layers () but the final return variable
which is always NULL at this point in the function.
This patch corrects the problem so it checks the proper variable.
2023-06-13 04:55:13 +00:00
Ekaterine Papava
61ca8f211f Update Georgian translation 2023-06-13 03:58:11 +00:00
Ekaterine Papava
f9e3f28afd Update Georgian translation 2023-06-13 03:53:49 +00:00
Alx Sa
a04f287a4b script-fu: Fixed SF_ONE_OR_MORE_DRAWABLE option
The order of GIMP_PROCEDURE_SENSITIVE_DRAWABLE | 
GIMP_PROCEDURE_SENSITIVE_DRAWABLES was reversed in 
gimp_procedure_set_sensitivity_mask (), which caused scripts using 
SF_ONE_OR_MORE_DRAWABLE to crash.
2023-06-13 02:51:58 +00:00
Yuri Chornoivan
d6ba644575 Update Ukrainian translation 2023-06-12 20:24:10 +00:00
Jehan
90f155365b desktop: new AppStream metadata for upcoming 2.99.16 release. 2023-06-12 16:39:46 +02:00
Jehan
6c49cd65dd NEWS: remove mention of now removed ugly workaround. 2023-06-12 16:39:46 +02:00
Michael Natterer
563aabbf6d po: add resource-cmds.c to POTFILES.in 2023-06-12 16:21:40 +02:00
Jehan
4f600669a9 NEWS: update. 2023-06-12 01:49:42 +02:00
Jehan
7c1fb5bc67 app: return EXIT_FAILURE when failing to pass the batch commands to…
… the main instance.

Note that it doesn't say if the batch command succeded, only if they were
successfuly communicated to the main process for processing.
2023-06-12 01:20:11 +02:00
Jehan
eb0ee5f33a Issue #9598: do not rely on GApplication uniqueness feature.
When passing an application ID (which is necessary for application inhibition to
work, i.e. logoff/reboot/shutdown inhibition), GApplication will try to ensure
process uniqueness, which will trigger a new activation to an already running
process. Since our current code assumes that the application can be activated a
single time only, this was what was triggering a whole lot of errors (on the
first running process) in #9598 because there was all the initialization code
which ran again, whereas it was not supposed to.

This doubly-running initialization code was also what completely messed up the
session files, hence broke the GUI after a restart (#9599).

Therefore passing G_APPLICATION_NON_UNIQUE advertizes we don't want GIO to
handle process uniqueness for us.

Note that this is actually a very interesting feature which we have had in GIMP
codebase forever. It would be interesting to kill all our own uniqueness code in
favor of GIO code (and let them handle/maintain passing command line arguments
from one process to another, for all possible platforms). So I added a TODO for
this (for now, we just ignore this feature as it doesn't work well with current
codebase).
2023-06-12 01:10:59 +02:00
Jehan
7f83b27c3c Issue #5601: help icon in the action search.
Additionally to the F1 shortcut, a secondary icon is now shown in the
action search entry. It works exactly the same as F1, i.e. that by
default, it shows the action search manual page (when nothing is
selected), or the manual page for the specific action currently selected
otherwise.
2023-06-11 23:56:55 +02:00
Jehan
a13289672a Issue #5601: F1 in action search to load the action help page.
The default F1 result (if no action is selected) is to show the generic
help page for the action search. If an action is selected, it will show
the specific help for this action.
2023-06-11 23:02:15 +02:00
Yuri Chornoivan
f58900298b Update Ukrainian translation 2023-06-11 15:58:02 +00:00
Jehan
27f8448fa2 Issue #8204: link gimp-2.99 executable with the static libapp library.
Since we are already building a static (build-only) libapp, to be used with
tests or tools, let's also use it for the main (GUI) executable.

For the CLI executable though (gimp-console-2.99), we must re-compile
libapp_sources from scratch anyway, because we define the additional macro
'GIMP_CONSOLE_COMPILATION'.
2023-06-11 17:52:40 +02:00
Jehan
01e56545bc devel-docs, gitlab-ci: freeze our requirement updates to Debian 12 bookworm.
While Debian testing is the sensible choice for dependency requirements while we
are in full-dev mode, now we are getting closer to 3.0 release, and Debian 12
"bookworm" barely got out.
If we continue to develop at current pace, GIMP 3.0 should be released before
the next stable Debian, so we should not use dependencies unavailable on the
latest stable (otherwise GIMP 3.0 won't be distributable soon enough on Debian,
nor on Debian derivatives such as Ubuntu, Mint, etc.).

This is why we are now basing GIMP dependency requirement on Debian bookworm.
We'll likely get back to the next "testing" after GIMP 3.0 release.
2023-06-11 00:52:13 +02:00
Jehan
7f879d1d31 menus: move back the "GEGL Graph" action in Filters > Generic menu.
Now that we don't blindly generate a messy list of all non-special cased actions
in Filters > GEGL Operations, "GEGL Graph" is all alone in this submenu. It just
makes sense to bring it back to the Generic submenus where it used to be.
2023-06-10 23:13:02 +02:00
Jehan
6dc5f6792e app: use the new GEGL metadata "gimp:menu-path" and "gimp:menu-label".
Instead of unconditionally add all the non-special-cased GEGL operations into
the menu, only insert the ones which explicitly use the new "gimp:menu-path"
GEGL key.
See new operation "gegl:adaptive-threshold" added in commit 7c2a70eee for such
an example.

Note that the other operations will still get their own generated action (which
means for instance that you can still search them through the action search and
that you can create custom shortcuts for your favorite actions). But now you
won't get an overlong generic list of non-organized actions in a single submenu.
Some people were finding this messy when they had a lot of custom GEGL ops.

Also it means that GIMP doesn't assume that any custom GEGL op is usable in
GIMP. Indeed some ops are really not meant to be used as filters, which is why
we have the gimp_gegl_op_blacklisted() internal function; but this cannot apply
to custom operations. Therefore from now on, instead of GIMP guessing, operation
developers will have the say on whether their op should show in menus and in
which menu path exactly!

Moreover the "gimp:menu-label" key will be used as short label, i.e. the label
which is used in menus in particular, where the menu path is a helpful context
(hence allowing to use shorter menu labels).
The main "title" will still be used as long label, for places where there is no
such context, for instance the action search.
2023-06-10 23:09:00 +02:00
Jehan
b437552580 app: make sure that custom GEGL-operation generated actions have unique names.
When reverting commit d51c64ec06 and reimplementing as fa2e9adc29, the code to
make sure the generated per-op action name is unique disappeared. This code
ensures that the action name is indeed unique, otherwise the action will
override a previously registed action, which could be made from a plug-in, or
even by another GEGL operation. Indeed, while GEGL operation names are supposed
to be unique, they are post-processed to be valid GIO action names. So it is
totally possible to have 2 GEGL ops with different GEGL names, yet the same
GAction name.
2023-06-10 23:09:00 +02:00
Martin
1044c05cd5 Update Slovenian translation 2023-06-10 18:23:01 +00:00
Jordi Mas
828a8a7fe7 Update Catalan translation 2023-06-10 13:13:16 +02:00
Asier Sarasua Garmendia
0fa1f02459 Update Basque translation 2023-06-10 07:15:38 +00:00
Alx Sa
73d5dcecae plug-ins: Fix defaults for 1/4/8 bpp ICO export
8bpp and below ICO formats use a 1 bit mask for transparency.
When imported the mask is treated as an additional transparent color.
If the icon used the max palette (e.g. 2 colors for a 1bit icon),
the default export format will become larger than necessary.
This checks if the layer still has 1 bit alpha, and subtracts the
mask color from the count.
2023-06-09 22:12:43 +00:00
Jehan
317aa803d2 Issue #7172: option to apply Client-Side decoration on image windows.
This patch does the following things:

- An option "Merge menu and title bar" (this is hopefully more understandable
  than calling it "Client-side decoration" or again "header bar") is added in
  Preferences > Image Windows. This option triggers the restart warning.
  Moreover when checked a small warning message will tell that in some cases, it
  may not work (there are feedbacks of people having 2 title bars when using GTK
  applications using CSD).
- For the reason evoked above (sometimes 2 title bars) and also because the CSD
  concept seem really to divide people a lot (some love this as much as others
  hate this), this new option "custom-title-bar" on GimpGuiConfig is FALSE by
  default.
- When the option is checked, the image windows will use a GTK header bar
  containing the menu, the window title (image name and information) as well as
  the usual minimize/maximize/close buttons per your OS conventions.
- Since the header bar is set to be hidden when maximizing, if you checked "Show
  menubar" for the "Default Appearance in Fullscreen Mode" in Preferences >
  Image Windows > Appearance, the menu will be moved to its "old style"
  position, i.e. above the canvas. This makes the menu possibly visible (if
  relevant option is checked) even in fullscreen mode.
- I tweaked the Default theme to show the header bar with minimal height,
  because I find GTK default theme's headerbar height unreasonably high
  (especially if the point of the header bar is to save screen space). I am
  unsure if this was the right move though, because maybe the default theme
  should not do such choices (maybe this should go in the Compact theme?).
2023-06-09 20:19:01 +02:00
Jehan
10742367c5 app: create a dedicated UI manager for the quick mask popup.
I don't see a reason why the quick mask menu was sharing the same
manager as the image menu (the main top menu and on-canvas). This was
why it was receiving all notifications to create menu items on <Image>,
as registered by plug-ins.

Giving it its dedicated manager makes sure this doesn't happen.
2023-06-09 17:20:11 +02:00
Jehan
30c5e20ce7 Revert "app: fix bailout condition in gimp_menu_model_handles_subpath()"
This reverts commit 3a35974e3a.
This is not the right fix for the issue (which was happening on the
Quick Mask menu specifically) because root menu models are set with a
NULL path. So forbidding root menu models to handle new subpath means
preventing plug-ins to register new top-level menus.

The correct fix for the issue on the quick mask menu will happen in a
coming commit.
See issue #9586.
2023-06-09 17:15:38 +02:00
Jehan
c9b114e6e9 plug-ins: we still depends on librsvg 2.40.x.
In commits a6756b515b and 23da44e3c8, newer API of librsvg were used, over our
current minimum requirement. The reason why we don't bump this requirement is
that librsvg 2.40.x are the latest versions which are full-C. While we have
nothing against Rust, it is not available on all existing platforms, and we
really want to have GIMP buildable everywhere, while also have SVG support
always present (even though it's a vector format, it's an important one in
graphics work nowadays).
See issue #6821.

So in the end, let's keep the old minimum requirement, but test against librsvg
version to compiler either with old API or new one. The changes are limited
enough that it's not too much a bother.
2023-06-08 17:43:16 +02:00
MohammadSaleh Kamyab
ba66797abe Update Persian translation 2023-06-08 11:32:20 +00:00
Aryeom Han
7eea3c8622 data: new "Wilber Week 2023 edition" splash screen for GIMP 2.99.16. 2023-06-08 00:21:48 +02:00
Alexander Shopov
19a45577b6 Update Bulgarian translation 2023-06-07 21:20:57 +00:00
Jordi Mas
2815f7af94 Update Catalan translation 2023-06-07 19:44:03 +02:00
Alx Sa
e9fdd321cd widgets: Check if editor color is set before...
...trying to get the index. Resolve #9568.
The color picker tool calls this twice if you're in Add to Palette mode,
and the editor's color may not be set the first time it's run.
This adds a check to ensure the color is set before trying to retrieve
it from the palette to prevent a CRITICAL.
2023-06-07 12:19:56 +00:00
Jehan
d0ac96b8b3 build: fix nightly flatpak.
Don't set both a branch and a commit, otherwise flatpak-builder will
compare the HEAD of this branch (which may evolve with the commit).

Fixes:

> Failed to download sources: module qoi: Git commit for branch master is dfc056e813c98d307238d35f7f041a725d699dfc, but expected f6dffaf1e8170cdd79945a4fb60f6403e447e020
2023-06-07 12:24:11 +02:00
Jacob Boerema
0bcce39637 app: update help-ids for layer crop/resize commands
The layer resize to selection and crop to content menu commands were
using the same help ids. This made it difficult to have them both listed
separately in the index of the manual.

Since we use separate help ids everywhere else for menu commands, let's
give each its own help id here too.
2023-06-07 11:24:28 +02:00
Jehan
7f70aa0c61 gitlab-ci: one more missing artifact to fix dev-docs job. 2023-06-07 10:24:22 +02:00
Jehan
bf96451569 gitlab-ci: add more artifacts to gimp-meson-debian job.
This should hopefully fix the CI jobs "dev-docs" and "source-meson".
2023-06-07 00:43:26 +02:00
Jehan
3972122280 meson: remove a reference to autotools files in the meson dist script. 2023-06-06 23:49:39 +02:00
Jehan
0233531020 app: make sure the private variable is a valid object if set.
Though this doesn't make a problem in normal use (AFAICS), we have crash
in a unit test in CI because the action_factory object was apparently
invalid when calling gimp_action_factory_delete_group().
2023-06-06 22:30:03 +02:00
Jehan
36fe8a979d build: remnants of the autotools builds in installer creation script.
Because of this, the script was failing to get the version string, which
in turn was breaking InnoSetup.

This fixes the following InnoSetup bug:

> Error on line 116 in C:\_r\_builds\k3_3muaB\0\GNOME\gimp\build\windows\installer\gimp3264.iss: Value of [Setup] section directive "VersionInfoVersion" is invalid.
2023-06-06 20:45:09 +02:00
Jehan
12f349ef34 build: gobject-introspection was not pulling gobject-introspection-runtime.
This is an issue I'll have to fix in crossroad. Let's have the CI build
fixed for now.
2023-06-06 20:45:09 +02:00
Jehan
503324d348 gitlab-ci: switch to meson logs for CI artifacts.
config.log is an autotools artifact.
2023-06-06 20:45:09 +02:00
Michael Natterer
a858474fe8 pdb: GimpResource: add is_editable(), rename(), duplicate(). delete()
and remove the API from its subclasses.
2023-06-06 16:33:36 +02:00
Michael Natterer
018d9fb615 app: remove draw() from GimpComboTagEntry
We don't need to maanually draw the arrow. Fixes #9498
2023-06-06 16:32:15 +02:00
Martin
06c0a8ca81 Update Slovenian translation 2023-06-06 14:08:44 +00:00
Jehan
f746bfbaf2 gitlab-ci: one-line per installed package for dependency maintenance.
This commit makes no real changes but style.
As discussed, this makes it much easier to compare commit diffs, rather
than an overlong line where you have to search which package may have
been added/removed/changed.
2023-06-06 11:27:05 +02:00
lillolollo
ff0a4d012f Add aalib on crossroad 2023-06-05 23:16:59 +00:00
Alx Sa
aa2a565d60 widgets: Load simulation intent/bpc in preferences
Resolves #9560.
The Simulation Intent and BPC widgets in the Preference Dialogue needed
to be connected to their properties with `gimp_prop_*` when created to
show the saved default image values.
2023-06-05 19:12:18 +00:00
Alx Sa
6041d01655 dialogs: Set default response to "OK"
This allows users to just press Enter/Return to run it with defaults as
you could do in 2.10.
2023-06-05 13:25:45 +00:00
Michael Natterer
2adb283077 libgimp: add API docs for gimp_resource_get_by_name() 2023-06-05 14:41:57 +02:00
Michael Natterer
bb7ed43eac app: make the GimpResource dummy class the parent of GimpData
It does absolutely nothing except sitting there, providing an is-a
relation (both ways because GimpData is its only subclass). This will
simplify having more libgimp API on GimpResource, without having to
add different PDB code for app and libgimp.
2023-06-05 14:33:23 +02:00
Michael Natterer
a4920611d1 libgimp: remove gimpparamspecs-resource.h
and merge it into libgimp/gimpparamspecs.h
2023-06-05 13:06:01 +02:00
Asier Sarasua Garmendia
e3bf2c1f00 Update Basque translation 2023-06-04 07:35:44 +00:00
Rodrigo Lledó
a17a2529ae Update Spanish translation 2023-06-02 11:53:19 +00:00
Rodrigo Lledó
e579bb974e Update Spanish translation 2023-06-02 11:48:22 +00:00
Alx Sa
9058a460b0 core: Import .aco palettes with Babl
This replaces the various GimpHSV/GimpCMYK .aco palette conversions with
Babl.
As a result, it now possible to support importing CIE Lab palettes
(colorspace 7)
2023-06-01 10:56:10 -04:00
Alx Sa
5070e0e9ec plug-ins: Add additional DigitalSourceType...
types for the metadata editor.
2023-05-31 18:06:39 +00:00
Michael Natterer
5acdaac8e0 libgimp: remove getters and setters from GimpResourceSelectButton subclasses 2023-05-31 17:18:19 +02:00
Michael Natterer
8fba6da5db libgimp: remove gimp_resource_select_button_embed_interior()
and a whole bunch of useless code from all its subclasses.
2023-05-31 17:01:46 +02:00
Michael Natterer
9638102418 Introduce a global ID space for GimpData/GimpResource objects
Much like for images and items. Change the PDB to transmit IDs
instead of names for brush, pattern etc. and refactor a whole
lot of libgimp code to deal with it.

	modified:   libgimp/gimpplugin-private.h
2023-05-31 16:12:04 +02:00
Alx Sa
493156cc7a dialogs: Fix header bar assumption
The Extensions dialogue assumed that it had a header bar. Since this is 
not always the case, conditional checks were added to prevent
GtkHeaderBar code from running. This also fixes a crash when you
double-click to expand the extension description.
2023-05-31 03:19:24 +00:00
Jordi Mas
01785632cc Update Catalan translation 2023-05-30 06:47:37 +02:00
Jordi Mas
94572ba6eb Update Catalan translation 2023-05-29 14:26:05 +02:00
Ekaterine Papava
9a8262c991 Update Georgian translation 2023-05-29 05:09:02 +00:00
Jacob Boerema
7908ecfbcd plug-ins: synchronize name of nl-filter with manual
The name of the nl-filter plug-in in the manual was recently changed to be
more in line with its description.
Since that is already the name of the plug-in file here, let's also update
the name of PLUG_IN_PROC to be in line with this.
2023-05-27 23:12:11 -04:00
Michael Natterer
f1bbd8d2c6 app: make GimpNavigationEditor zooming much more responsive
Use g_idle_add() instead of g_timeout_add(300ms), which makes
it respond instantly, while still keeping the actual zoom
call out of the slider callback.

Fixes #9500
2023-05-27 13:32:24 +02:00
Michael Natterer
e12798be0d app: change GimpGeglProcedure to take (n-drawables, drawables)
because we treat it the same as a plug-in procedure.
2023-05-27 12:35:52 +02:00
Niels De Graef
413cf9ad85 app: Don't grab the pointer when doing scrolling
By doing `gimp_display_shell_pointer_grab()`, we actually prevent events
from a tablet coming through. There doesn't seem to be a reason to use
it and it's not regressing in functionality either, so let's just remove
it.

Fixes: https://gitlab.gnome.org/GNOME/gimp/-/issues/8016
2023-05-26 23:34:12 +00:00
Jehan
ebe63c215f INSTALL, meson: remove references to autotools and warning. 2023-05-27 00:33:17 +02:00
Jehan
3da0cdc03d desktop: removing autotools-only test files.
These are implemented directly in the meson build files.
2023-05-27 00:16:47 +02:00
Michael Natterer
26dce72d2c Remove autotools 2023-05-27 00:03:52 +02:00
Jacob Boerema
52fb1e93f9 libgimpbase: issue #1561 update Exif.Photo.PixelX/YDimension
Some images have Exif.Photo.PixelXDimension and Exif.Photo.PixelYDimension
metadata tags in addition to Exif.Image.ImageWidth and
Exif.Image.ImageHeight (mainly tiff images). So far, we were not updating
these optional tags, meaning they could get out-of-sync with the actual
dimensions when resizing and then exporting the image.

Since these tags are non essential, we will only update them if they are
already present.
2023-05-26 12:40:58 -04:00
Michael Natterer
0532cf31b9 app: move action/widget sensitivity logic from GimpMenu to GimpAction
This way we handle all kinds of proxies (particularly buttons).

Also add a small hack that prevents extended multiline tooltips of
GimpButton from being overwritten by gimp_action_update_proxy_tooltip().
2023-05-26 15:31:54 +02:00
Michael Natterer
c4f71f553c app: fix action_data_get_image() to return NULL more often
If "data" is a GimpItemTreeView or a GimpImageEditor, we REALLY want
only the image from these dialogs, even if NULL, and NOT some other
image from a display or context that randomly is around anyway. Fixes
the sensitivity states of lots of buttons in these dialogs.
2023-05-26 15:25:15 +02:00
Simon Budig
c9122fed2f gimp-atomic: drop the use of the volatile qualifier.
The underlying functions don't actually use thaat, so it gets dropped
anyway, causing a compiler warning.
2023-05-26 14:29:42 +02:00
Niels De Graef
85a77f8a64 plug-ins/grid: Make sure dest_buffer is initialized
Initialize to NULL at the very least
2023-05-26 12:45:50 +02:00
Carlos Garnacho
467fa6c5e7 app: Avoid double gtk_drag_finish() call on GimpToolbox
According to the ::drag-drop GTK documentation: "The call to gtk_drag_finish()
can be done either directly or in a “drag-data-received” handler which gets
triggered by calling gtk_drag_get_data()"

The GimpToolbox's vbox handling DnD chooses however to do both, the drag-drop
handler is calling gtk_drag_get_data() and invariably calling gtk_drag_finish()
to hint that the DnD operation is ending. While this worked in practice in X11,
This is a harder either/or in Wayland resulting in the transfer being cancelled.

In order to behave better wrt the documentation, and make DnD into the toolbox
work on both X11 and Wayland, avoid the first gtk_drag_finish() if the data is
being requested, and only bail out if no offered target matches what the widget
can handle. The handling done indirectly through gimp_toolbox_dnd_init() and
gimp_dnd_*_dest_add() will take care of finalizing the DnD data transfers
successfully.

Closes: https://gitlab.gnome.org/GNOME/gimp/-/issues/7373
2023-05-26 10:24:05 +00:00
Martin
310ab1f708 Update Slovenian translation 2023-05-26 07:34:20 +00:00
Martin
a9ac8a5a40 Update Slovenian translation 2023-05-26 07:26:14 +00:00
Yuri Chornoivan
9d684d4ddb Update Ukrainian translation 2023-05-26 06:53:45 +00:00
Alx Sa
fa22ee23c0 dialogs: Fix typo in "Lock Visibility" label 2023-05-26 03:27:55 +00:00
Michael Natterer
58c40a1871 app: add "lock visibility" to the layer,channel,path property dialogs
and make the lock toggles use the same icons as in in the popover in
the dockable dialogs.

Fixes #9306
2023-05-26 02:46:53 +02:00
Michael Natterer
b48846c752 app: remove the "Tab" accelerator from the "windows-hide-docks" action
Apparently this has never worked until we refactored our menus, now it
suddenly does but not as originally intended. Simply remove the
accelerator and let only the canvas event handler deal with the Tab
key. Restores 2.10 behavior which was quite ok.

Fixes #9352
2023-05-26 00:45:30 +02:00
Jehan
c5dd6e0e89 libgimp: fix a GBytes leak. 2023-05-26 00:32:28 +02:00
Jacob Boerema
671996e897 plug-ins: fix #8441 distress-selection.scm script failure
distress-selection.scm uses gimp-image-set-active-channel which has been
removed causing script failure when a channel is selected instead of a
layer.

Use the new multi-layer aware gimp-image-set-selected-channels and also
use the gimp-item-id-is-* functions instead of the deprecated
gimp-item-is-* functions.
2023-05-25 18:31:56 -04:00
Michael Natterer
2e219bccf2 app: one more fix like in the last commit in GimpLayerTreeView 2023-05-26 00:09:01 +02:00
Michael Natterer
6fcf25b3de app: can't rely on a context being set on a GimpItemTreeView
In GimpLayerTreeView, set the action states using GimpActionGroup
instead of using gimp->app directly to look up the actions ( after
trying to get the Gimp from a NULL GimpContext).

Fixes #9433
2023-05-25 23:52:40 +02:00
Niels De Graef
a411026b4c libgimpbase: Don't cast between guint32/gsize
I don't like C and I don't like crashes
2023-05-25 23:47:42 +02:00
Niels De Graef
275f7d5f4c libgimp: Fix checks when writing GdkPixbuf over the wire
* We need to check if `icon_bytes` is NULL, not `icon_data`
* We should not set `icon_bytes` if `gdk_pixbuf_save_to_buffer` fails
2023-05-25 23:19:58 +02:00
Michael Natterer
c9700680fe app: Issue #9490: limit the width of the palette preview
to GIMP_VIEWABLE_MAX_PREVIEW_SIZE in gimppaletteeditor.c
2023-05-25 19:37:41 +02:00
Jehan
821711badb themes: "System" theme should not use smaller font size.
What we call "System" theme should have very minimal edits over the
actual system theme. So let's drop all the "font-size" properties (one
"larger" one, but especially the many "smaller" ones).
This means that the "Default" theme also will keep system font size.

This is as discussed with Ville and Liam, the later saying he can barely
read dockable texts because of this.

On the other hand, we use "small" font size as a general rule in the
"Compact" theme, which is especially meant for people who want a compact
theme.
2023-05-25 18:10:56 +02:00
Michael Natterer
afa2a5ca96 app: fix typo in gimphelp-ids.h, spotted by Wormnest 2023-05-25 17:30:50 +02:00
Michael Natterer
41894be71a app: make the rotation import dialog more similar to profile import
and some general cleanup in both dialogs.
2023-05-25 16:56:07 +02:00
Michael Natterer
652fbe47fa app: use the prefs color management icon in the profile import dialog 2023-05-25 10:26:43 +02:00
Michael Natterer
ea0056ca46 app: set the file on all images immediately after loading
We removed gimp_image_set_file() from all plug-ins but forgot to do it
generically in the core...
2023-05-25 10:22:53 +02:00
Yuri Chornoivan
ce69a0ee2f Update Ukrainian translation 2023-05-25 06:52:07 +00:00
Jehan
097e683b07 NEWS: update. 2023-05-25 03:26:36 +02:00
Michael Natterer
fa2e9adc29 app: reimplement the stuff reverted below
but stay completely in filter-actions.c and filters-menus.c
2023-05-25 02:31:28 +02:00
Michael Natterer
4209a584fc app: clean up forgotten conflict removals from the reverts below 2023-05-25 02:31:28 +02:00
Michael Natterer
dc25c2bc97 Revert "app: add a "Filters > Generic > GEGL Operations" submenu with generated actions."
This reverts commit 747cbf70db.
2023-05-25 02:31:28 +02:00
Michael Natterer
39942c1260 Revert "Issue #9228: make GEGL Operation tool's operations their own actions too."
This reverts commit d51c64ec06.
2023-05-25 02:31:28 +02:00
Jehan
806f88b9a0 app: no longer name variant for "Preferences".
It doesn't feel to me like appending "Dialog" is needed for this
specific dialog.
2023-05-25 02:27:21 +02:00
Jehan
a660a378ac themes: updated Default theme by Ville Pätsi.
The Default theme may have been a bit too dark. Instead let's have it a
tiny bit lighter (and also foreground color a bit less white).

For now, the old "Default" dark theme doesn't disappear totally and is
moved to a "Darker" theme as we have been discussing and wondering on
whether this is prefered by some people (it is). Aryeom also thought a
darker theme may be a good idea.

Moreover Liam actually thought that losing some of the contrast
(especially with the text a tiny bit less white now) is not desired in
his case where eyes may not be as sharp as they used to. Therefore a
"High Contrast" theme may be needed.

Aryeom also suggested that sliders to choose colors could be a much more
generic solution, which might be possible yet would require more ugly
hacks generating on-the-fly theme changes (we do something similar for
dark theme choice already).

This is all work-in-progress and a result from Wilber Week 2023 work.
2023-05-25 02:23:24 +02:00
Michael Natterer
ea83d54cb1 app: move gimp_get_geglopclasses() to gegl/gimp-gegl-utils.[ch]
and rename it to gimp_gegl_get_op_classes(). This looks much cleaner,
just don't look at the internal op blacklisting code...
2023-05-25 01:04:54 +02:00
Michael Natterer
e9e09ceec4 app: vertically center the top-left icon in GimpViewableDialog 2023-05-24 23:37:43 +02:00
Jehan
88e82d57af build: install gobject-introspection with MSYS2 when cross-building…
… for Windows.

Though it's useless for actually building the GIR files, we still need
this package now, for building script-fu with introspection abilities,
to generate GIMP and GEGL enums.
See the 2 previous commits for more information.
2023-05-24 23:19:20 +02:00
Niels De Graef
305b27884d ci: Add gobject-introspection to win64 image 2023-05-24 23:19:20 +02:00
Niels De Graef
01e960e98e plug-ins/scheme-wrapper: Use GIR for enum values
This allows our script-fu plugins to use the GIMP enum values, just like
all our other plug-ins know them.

In other words:

* Names are consistent with those of other plug-ins
* Introspectable enums are automatically added as they are added to the
  introspection file, without even needing a recompile
* No need to keep track of our enum types anymore, as that is just a
  redundant implementation of introspection in practice. This in turn
  will let us simplify some of the pdb code
2023-05-24 23:19:20 +02:00
Niels De Graef
00415bed6a libgimp: Always pass size to g_bytes_unref_to_data
Unlike `g_bytes_get_data()`, the out argument for the size is not
optional, so if we try to pass `NULL` there, we actually get a segfault.
2023-05-24 23:16:36 +02:00
Alx Sa
e1e30c6f72 app: Scale pattern preview to show full image
Currently, patterns are loaded as-is - if the full pattern is larger
than the preview, its cut off and you only see the left corner.
In those cases, the pattern is scaled using gegl_buffer_get ()'s scale
parameter.
2023-05-24 19:44:11 +00:00
Michael Natterer
a8d30578cd script-fu: fix double free in script-fu-dialog.c
Spotted by Lloyd Konneker.
2023-05-24 21:35:48 +02:00
Alx Sa
7a1e6bedd5 plug-ins: Increase Script-fu Console size...
and Plug-in/Procedure Browser size.
gtk_widget_set_size_request () is applied to the dialog, as it does not
seem to bubble up from being applied to individual elements.
The existing 2.10 width/height values are used.
2023-05-24 18:56:23 +00:00
Michael Natterer
15d81b6b10 app: plug leaks in GimpExtensionManager 2023-05-24 18:27:00 +02:00
Michael Natterer
8d9eef875c libgimpwidgets: use gdk_seat_grab,ungrab() in gimphelpui.c,
getting rid of using the the deprecated pointer grab API.

Since there is something fishy and gtk_get_event_widget(event) always
returns the GtkInvisible we grab on (not the actual event widget), we
just steal the "find widget at pointer" code from gtkinspector and
find the help widget that way.
2023-05-24 17:18:38 +02:00
Michael Natterer
7e7a20530d libgimpwidgets: improve parameter names of gimp_grid_attach_aligned() 2023-05-24 15:59:34 +02:00
Michael Natterer
a12339c890 app: increase preview size in gimpviewablebox.c
The height of the boxes was never determined by the preview but by the
label+entry, causing vertical padding around the preview. Now the
preview fills the area in more cases, at the cost of a few less
horizontal pixels for the entry.
2023-05-24 15:20:03 +02:00
Michael Natterer
9c9d3aaa35 themes: minimize spinbutton height in docks too
but add 2px top and bottom padding so all of those entries don't look
like the just escaped the garbage compactor.
2023-05-24 15:17:27 +02:00
Michael Natterer
ee6108aa04 themes: minimize the height of all entries in docks 2023-05-24 14:47:42 +02:00
Michael Natterer
4fb27afd9e plug-ins: don't leak the comment string in file-psp.c 2023-05-24 14:32:00 +02:00
Michael Natterer
82e4bf5792 app: fix "active" state management in GimpToggleAction
gimp_toggle_action_real_toggle(): set "active" before emitting
"change-state" so we don't infinitely try to set the state in case of
a recursion.

gimp_toggle_action_toggle(): add notify("active") because it wasn't
done anywhere.

Fixes #9392
2023-05-24 14:09:50 +02:00
Michael Natterer
3a35974e3a app: fix bailout condition in gimp_menu_model_handles_subpath()
Fixes plug-in menus being added to all a GimpUIManager's menus,
even if they didn't match the menu_path
2023-05-24 13:43:35 +02:00
Michael Natterer
1d393fb926 app: don't try to break up a NULL menu_path in gimp_action_set_menu_path() 2023-05-24 13:41:37 +02:00
Simon Budig
f540e79172 screenshot: there actually is no need to preprocess the PNG data... 2023-05-24 11:32:05 +02:00
Niels De Graef
2b4bf29553 gitlab-ci: Use JUnit reports from Meson
Meson has been generating Junit XML files of its test results since
0.55, so we can use that to show the test results in the GitLab UI.
2023-05-24 00:38:00 +02:00
Niels De Graef
89c359ce47 Remove GimpUint8Array in favor of GBytes
GLib has a specific type for byte arrays: `GBytes` (and it's underlying
GType `G_TYPE_BYTES`).

By using this type, we can avoid having a `GimpUint8Array` which is a
bit cumbersome to use for both the C API, as well as bindings. By using
`GBytes`, we allow other languages to pass on byte arrays as they are
used to, while the bindings will make sure to do the right thing.

In the end, it makes the API a little bit simpler for everyone, and
reduces confusion for people who are used to working with byte arrays
in other C/GLib based code (and not having 2 different types to denote
the same thing).

Related: https://gitlab.gnome.org/GNOME/gimp/-/issues/5919
2023-05-23 23:37:50 +02:00
Michael Natterer
9e79bb78a1 app: update the dialog and dockbook ui managers in gimp_dockbook_show_menu() 2023-05-23 16:31:57 +02:00
Michael Natterer
37dfa24def meson: default to create default binary symlinks only in stable versions 2023-05-23 10:34:47 +02:00
Michael Natterer
514042d57d app: don't leak the GSList connecting GimpRadioActions 2023-05-23 01:42:40 +02:00
Michael Natterer
4879589be6 app: use g_list_delete_link() not _remove_link() in GimpUIManager
so the list element actually gets freed.
2023-05-23 01:42:40 +02:00
Simon Budig
23da44e3c8 file-svg: remove deprecated librsvg api, added some pixbuf/cairo fuckery. 2023-05-23 00:45:50 +02:00
Michael Natterer
e4f0bb0dfe app: valgrind found a bunch of memory leaks 2023-05-23 00:11:23 +02:00
Simon Budig
3b925cd78e animation-play: remove deprecated gtk-alignmnents 2023-05-22 22:35:30 +02:00
Yuri Chornoivan
339c858a65 Update Ukrainian translation 2023-05-22 17:13:13 +00:00
Ekaterine Papava
e97ab651dd Update Georgian translation 2023-05-22 16:32:48 +00:00
Michael Natterer
7ada432690 app: big porting of weak pointers to g_set,clear_weak_pointer()
This started as review of weak pointers, but using
g_set_weak_pointer() and g_clear_weak_pointer() is almost always
better, and shorter.
2023-05-22 18:16:09 +02:00
Jacob Boerema
4789a31a15 plug-ins: issue #7658 add support for unregistered xmp namespaces
Our metadata library exiv2 only registers the most commonly used xmp
namespaces. Other namespaces need to be explicitly registered. We did not
read or try to store these namespaces, which caused a lot of warnings about
"No namespace info available for XMP prefix '...' and then we could not
process that metadata or save/export those tags.

We had to wait for gexiv2 support for registering/reading namespaces, but
that was added in gexiv2 version 0.12.2 (and the "try" version in 0.14.0).

When reading xmp metadata we process all namespaces and add them to our
metadata xml when we haven't seen them before in the same image.
A GHashTable is used to keep track of the prefixes we have seen before.
The new namespace xml tag is skipped in older GIMP versions, but will be
used now to add the namespaces when exporting images with xmp metadata.
2023-05-22 11:57:08 -04:00
Alx Sa
3cd896c983 plug-ins: Import IBM PC Formatted TIFF layers
TIFFs with PSD layers can be saved in either Macintosh or IBM PC format.
IBM PC section labels are reversed and the integers are Little Endian.
We now check for 'MIB8' sections and reverse the necessary values so
that the PSD plug-in functions can handle them.
2023-05-22 14:45:34 +00:00
Martin
daa8ed3567 Update Slovenian translation 2023-05-22 13:50:56 +00:00
Michael Natterer
9886062dca app: don't leave around a dangling weak pointer to some memory on the
stack in gimp_create_image_from_buffer()
2023-05-22 14:30:37 +02:00
Michael Natterer
3d5ea2eeb2 app: remove weak ref to action_factory in GimpMenuFactory 2023-05-22 14:11:48 +02:00
Michael Natterer
91fceebb1d app: improve readability in GimpMenuFactory 2023-05-22 14:11:06 +02:00
Alexander Shopov
db3a88f1f5 Update Bulgarian translation 2023-05-22 08:44:18 +00:00
Simon Budig
a6756b515b file-svg: fix deprecated use of rsvg_handle_get_dimensions() 2023-05-22 09:30:25 +02:00
Alx Sa
6f8f481ee2 plug-ins: Remove screenshot-icon.h in Makefile.am
Since the file itself was removed in 5d7d11a8.
2023-05-22 04:29:56 +00:00
Alx Sa
026e99c441 actions: Restore pasting image in empty workspace
In !769, I accidentally removed the ability to paste into an empty
workspace with Ctrl+V since I added a "does image exist?" check before
the `edit_paste_as_new_image_cmd_callback ()` call.
This patch resolves the issue by moving the check after the
"paste as image" function call.
2023-05-22 03:56:36 +00:00
Michael Natterer
9b388f873b modules: remove "static" from all modules' get_type() functions
Their implementations are defined by G_DEFINE_DYNAMIC_TYPE(), so
the compiler complained about the unused static prototype.
2023-05-22 03:51:36 +02:00
Michael Natterer
f615cbc5af Revert "app: quick/dirty-exit on all releases (not just stable ones) while…"
This reverts commit d22f1c3332.

The memory corruption is fixed, we can restore the original quit code.
2023-05-22 03:39:52 +02:00
Michael Natterer
8f42731074 app: don't leave dangling GimpUIManager weak pointers around
in gimpmenumodel.c and gimpmenushell.c
2023-05-22 03:39:52 +02:00
Michael Natterer
bf15c9d128 app: also remove (not only add) the weak pointer in
gimp_action_impl_activate(), it's only there to guard one function
call
2023-05-22 03:39:52 +02:00
Michael Natterer
1d069d05b4 app: fix dangling weak pointers to GimpEditor->priv->ui_manager 2023-05-22 03:39:52 +02:00
Michael Natterer
ef0eb29e55 app: readability improvement in GimpActionFactory 2023-05-22 03:39:52 +02:00
Michael Natterer
4d38ae333a app: remove the weak pointer GimpPaintOptions->brush in dispose() 2023-05-22 03:39:52 +02:00
Michael Natterer
2de78e45b6 app: some formatting in gimppaintbrush.c 2023-05-22 03:39:52 +02:00
Niels De Graef
da585065d6 Revert "app: Port GimpParasiteList to GListModel"
This reverts commit 3054901af0.

GimpParazite is not a GObject, so using a GListModel is not an option
for now
2023-05-22 01:26:18 +02:00
Niels De Graef
dd3fd682f6 libgimp, pdb: Fix enums_get_type_names annotations
Annotate the array length
2023-05-22 01:19:17 +02:00
Michael Natterer
bbad91d85d quit-dialog: remove write after free in quit_close_all_dialog_response()
This reverts 83397cbb15 except for the
unrelated typo fix.
2023-05-21 18:56:32 +02:00
Michael Natterer
ea61efe679 app: remove gtk_container_set_focus_chain(), it's deprecated and
our use cases were overengineering anyway.
2023-05-21 18:56:32 +02:00
Michael Natterer
0c41856393 meson.build, sanity.c, gui.c: update and sync some dependency versions 2023-05-21 18:56:32 +02:00
Michael Natterer
7de9c347b6 script-fu: use gimp_value_array_copy(), and free the copy 2023-05-21 18:56:32 +02:00
Michael Natterer
0c73d7df12 libgimbase: add gimp_value_array_copy() 2023-05-21 18:56:32 +02:00
Alx Sa
e020a6b3ca plug-ins: Add support ILBM HAM mode images
"Hold and Modify" ILBM images use control bits to increase the palette
beyond what's stored in the CMAP chunk. This patch checks if
HAM mode is set and then interprets the plane bits accordingly.
2023-05-21 15:31:42 +00:00
Simon Budig
5d7d11a81f screenshot: move deprecated pixdata into png resource 2023-05-21 13:22:57 +02:00
Simon Budig
bf0cac7e1c meson: bump minimum required versino to avoid a warning 2023-05-21 12:01:52 +02:00
Yuri Chornoivan
efbdd8e1c4 Update Ukrainian translation 2023-05-21 06:15:31 +00:00
Simon Budig
71b46d5a0b gimpimagemetadata: ...so that we can remove that ugly hack here. 2023-05-21 01:58:16 +02:00
Simon Budig
9e8f5a97d2 meson: add a minimum dependency on exiv2 0.27.4... 2023-05-21 01:58:16 +02:00
Niels De Graef
41e3d10a18 libgimpwidgets: Fix some gir annotations
Add a missing nullable, remove some references to `GtkHScale` as that no
longer exists.
2023-05-21 01:37:18 +02:00
Niels De Graef
3054901af0 app: Port GimpParasiteList to GListModel
GListModels are fun. They will also prove to be useful in the future.
2023-05-21 01:30:53 +02:00
Simon Budig
997e4b5f6c test-ui: re-enable one of the tests, our gtk-dependency is big enough now. 2023-05-21 01:22:00 +02:00
Simon Budig
41b47d1dde colorsvg2png: fix deprecation, slightly changing the behaviour 2023-05-21 01:10:51 +02:00
Niels De Graef
a4c3eacc02 libgimpmodule: Convert ModuleDB to GListModel
This commit converts `GimpModuleDB` into a `GListModel`. This allows us
to drop quite a bit of custom code to have an adaptive list of modules
by just becoming a `GListModel` implementation.

Next to that, this commit also rewrites `GimpModule` to use the `notify`
signal for its 2 new properties: "auto-load" and "on-disk", rather than
trying to define a custom signal for that. This in turn allows us to use
basic methods like `g_object_bind_property()`.

Finally, the module manager dialog now uses `GtkListBox`, which can
easily bind to that new `GListModel` infrastructure.
2023-05-20 22:15:13 +00:00
Niels De Graef
e5820261ec app: Use a GtkListBox for the themes list
Use a `GtkListBox` to show the list of GIMP themes rather than a
treeview. The idea is that we can expand this a bit more to give a
preview of the theme later on.
2023-05-20 22:15:13 +00:00
Simon Budig
8cf388c17f gimpcellrendererdashes: fix type of a variable 2023-05-20 23:59:29 +02:00
Simon Budig
83d6f46ee7 app: fix deprecation of g_spawn_check_exit_status() 2023-05-20 23:56:29 +02:00
Simon Budig
7f10328777 script-fu-dialog: fix memleak 2023-05-20 23:41:18 +02:00
Simon Budig
a100bb7fcf gimptagpopup: port to GtkStateFlags 2023-05-20 23:32:18 +02:00
Simon Budig
289999ad52 core: remove the workaround, neither gcc nor clang generate a warning here. 2023-05-20 23:32:18 +02:00
Simon Budig
51311f913d metadata: shut up a weird warning 2023-05-20 23:32:18 +02:00
Niels De Graef
0f05de3dc0 libgimpwidgets: Try harder to set parent window
In case someone passes a `GtkWidget` rather than a `GtkWindow` as a
parent to a `GimpDialog`, we still have another way of trying to get its
parent window, using `gtk_window_get_toplevel()`. If we still get a
window from that, it allows us to still specify a reasonable
"transient-for" value for our newly-made `GimpDialog`.
2023-05-20 20:24:28 +00:00
Simon Budig
6e1747953a libgimp: fix a warning by using an enum of the correct type. 2023-05-20 22:16:06 +02:00
Jordi Mas
d7f5cd0e43 Fix typo in Catalan translation 2023-05-20 22:05:56 +02:00
Simon Budig
d16734a4e4 plug-ins: fix some glib related deprecations 2023-05-20 21:46:17 +02:00
Simon Budig
690c9ae21a gimpguidetool: fix somewhat pointless warning about uninitalized variable 2023-05-20 18:47:14 +02:00
Simon Budig
a2458f1528 file-tiff-load: fix mismatching variable type 2023-05-20 18:47:14 +02:00
Jacob Boerema
c8739aa494 libgimp: fix failure to write XMP metadata
Certain XMP metadata tags currently can't be saved by us until we get
support in gexiv2 for adding new structs not present in exiv2.
We remove these tags from the exported metadata because the XMPSDK in
exiv2 would otherwise fail to write all XMP metadata.

Examples are the newer (2019, 2021, 2022) sample images from the
IPTC Photo Metadata Standard.

We also add all the static functions present in gimpimagemetadata-save
at the top, which had been forgotten in the past.
2023-05-20 12:39:29 -04:00
Jacob Boerema
b37f0a3182 libgimp, plug-ins: remove obsolete XmpStructs 2023-05-20 12:39:29 -04:00
Simon Budig
36eda4ae9c fix some warning related warnings 2023-05-20 18:25:10 +02:00
Alx Sa
a4541d8a7a gui: Fix upper text scaling for small images
Resolves #5742.
From fa0a0212, the splash's upper text was scaled to PANGO_SCALE_MEDIUM
both when the image width was 2x or less than 2x. This was likely a
copy/paste issue, as the lower text code scaling does not duplicate.
This patch fixes it by changing the else condition to scale to
PANGO_SCALE_SMALL.
Note that this change is unlikely to be seen as it requires a very small
splash screen image to reach the else condition.
2023-05-20 16:20:00 +00:00
Jordi Mas
8b6be32c51 Update Catalan translation 2023-05-20 18:14:49 +02:00
Simon Budig
27af306a8a libgimp: un-deprecate and fix gexiv2 usage. 2023-05-20 18:06:21 +02:00
Alx Sa
604045fc0f plug-ins: Replace deprecated GdkColor with GdkRGBA
As GdkRGBA stores colors as doubles rather than guint16, the assignment
code had to be moved into the ifdef block as well.
Note that this code is only used if X11 is not available on build.
2023-05-20 15:17:14 +00:00
Alx Sa
24a1d34bba plug-ins: Porting to GimpSaveProcedureDialog
These five plug-ins already used GimpProcedureDialog when I originally
worked on them for !9250. However, their export GUI needs to
use GimpSaveProcedureDialog instead.
2023-05-20 14:30:41 +00:00
Simon Budig
b5f6c2e855 Revert "script-fu: resolve some duplicate menu path entries"
I had a bogus installation. Sorry for that.

This reverts commit c0691ea85c.
2023-05-20 01:31:47 +02:00
Simon Budig
c0691ea85c script-fu: resolve some duplicate menu path entries 2023-05-20 01:17:39 +02:00
Jacob Boerema
9accaad0b6 libgimp: replace deprecated functions ...
1. gexiv2_metadata_has_tag with gexiv2_metadata_try_has_tag;
2. gexiv2_metadata_set_exif_thumbnail_from_buffer with the "try" version.

For a while now the minimum gexiv2 version for the master branch is 0.14.0,
which means we can replace these deprecated functions, since the new
versions were added in 0.14.0.
2023-05-18 15:23:59 -04:00
Jacob Boerema
00901276f2 libgimpbase: replace strcpy/strcat with g_strconcat in gimpmetadata
We were using fixed size buffer with strcpy/strcat, which gave warnings in
coverity.

Even though in our case there was no chance of buffer overflow, let's
replace this by using g_strconcat, which allocates memory for the
string which we free after use.

Also get rid of a few unneeded memset's for strdata.
2023-05-18 14:51:12 -04:00
Jordi Mas
8ab345d1e4 Update Catalan translation 2023-05-18 07:19:40 +02:00
Jordi Mas
5bea1c4135 Update Catalan translation 2023-05-15 22:18:02 +02:00
Alx Sa
48e976725c build: Update Windows installer associations
Adds the following formats that GIMP now supports: .ani, .cur, .dcx,
.icns, .pam, .wbmp, .iff/acbm/ilbm/lbm
2023-05-15 19:26:48 +00:00
Yuri Chornoivan
40d9026f9e Update Ukrainian translation 2023-05-15 17:51:40 +00:00
Jehan
3862fad8c1 plug-ins: file-fits becomes an optional plug-in.
Let's make cfitsio an optional dependency, showing up in the final configure
output. The file-fits plug-in will just not be built when the dep is missing.
2023-05-15 12:20:53 +02:00
Alexander Shopov
8f9b8b3d58 Update Bulgarian translation 2023-05-15 09:32:36 +00:00
Martin
3bc5793dbf Update Slovenian translation 2023-05-15 07:54:40 +00:00
Martin
30a8943356 Update Slovenian translation 2023-05-15 07:51:19 +00:00
Ekaterine Papava
1a35e01620 Update Georgian translation 2023-05-15 03:35:55 +00:00
Ekaterine Papava
c12f953d57 Update Georgian translation 2023-05-15 03:31:34 +00:00
Alx Sa
b2874464f5 icons: Revert most of !909
Per @Jehan, this solution would prevent default icons from being loaded
in custom themes if they did not include their own version.
The only thing kept from !909 is the replacement of hardcoded strings
in a few files with constants defined in gimpicons.h.
2023-05-14 21:54:41 -04:00
Alx Sa
d4f420769c plug-ins: Port FITS plug-in to cfitsio library
Switch to NASA-maintained cfitsio library for loading/exporting FITS images.
This allows us to import compressed FITS files (GZIP, HCOMP, PLIO, RICE) in
8/16/32 bit and float/double precision. It also simplifies export code using
the built-in cfitsio APIs.
2023-05-14 15:05:50 +00:00
Jordi Mas
4a67ee4035 Update Catalan translation 2023-05-14 16:13:34 +02:00
Yuri Chornoivan
c8d44578aa Update Ukrainian translation 2023-05-14 11:21:31 +00:00
Alx Sa
0790d6c9d5 widgets: Add Grayscale color picking mode 2023-05-14 10:19:54 +00:00
Jehan
a75015a821 build: add appstream-glib
It is actually available in the SDK but was removed from the runtime (relatively
recently, it would seem). As a more general rule, it seems that GNOME is phasing
it out slowly in favor of libappstream. So probably we should do the same
eventually.
Yet for now, to at least have a working nightly flatpak, let's add it to our
package.
2023-05-13 22:44:00 +02:00
Jehan
fa85eb6565 gitlab-ci: fix the CI.
The flatpak_ci_initiative.yml template we include got changed 2 days ago,
replacing the "only" by a "rules", which broke our CI file.

Cf. commit 193f63c20f87d38868c05beee6446b387b73e140 in repository citemplates.

The present commit should (hopefully) fix this error:

> Unable to create pipeline
>   jobs:flatpak-nightly config key may not be used with `rules`: only

(even though the error is a bit cryptic, the problem is apparently that both
rules: and only: keys cannot be used together)
2023-05-13 22:15:20 +02:00
Jehan
9ebc2cf3f7 NEWS: update. 2023-05-12 18:19:24 +02:00
Jehan
d22f1c3332 app: quick/dirty-exit on all releases (not just stable ones) while…
… clean-exiting on all dev code (whether stable or unstable branches).

This is because the dirty exit prevents the on-exit crashes which seem to happen
somewhere in the memory cleanup (which apparently corrupts memory but all crash
traces don't show the proper area where the issue actually hapened). So let's
have release exit the process without issue (at least all important user-facing
data is saved properly by then), while not hiding the issue to developers.

Also on dev code, the GIMP_DIRTY_EXIT will allow to go anyway for the quick
exit() path, so that for instance one can work on other pieces of code without
feeling bothered by the constant crashes on exit.

For the record, the crashes we are talking about appear when you update to a
recent GLib, after the removal of GSlice implementation (which is basically now
just a malloc/free alias). There may be issues in our usage of GSlice though we
also experience crashes even just with commit 69e9ba80e on GLib which hints at
issues in our GObject/GType code.
2023-05-12 14:37:16 +02:00
Jehan
39bcdc9e40 app: gimp_console_app_class_init() is the class init function, not interface. 2023-05-12 14:37:16 +02:00
Alexander Shopov
8eeeb13a31 Update Bulgarian translation 2023-05-11 13:45:42 +00:00
Alexander Shopov
eff5230370 Update Bulgarian translation 2023-05-11 13:37:09 +00:00
Jehan
6c6cd2df24 app: make sure va_start() is matched by va_end().
xcf_save_prop() starts with va_start(), hence must end with va_end(). Yet any of
the xcf_write*_check_error() macros could end this function abruptly. Therefore
I'm adding a "cleanup" argument to the macros, allowing to add any code
necessary to clean the current function before returning.
2023-05-11 15:18:33 +02:00
Jehan
d1118a5e15 app: missing break statement. 2023-05-11 14:19:37 +02:00
Jehan
b64f79fed9 devel-docs: don't build reference docs when GIR aren't generated.
This can happens in cross-compilation cases for instance.
2023-05-11 12:46:57 +02:00
Jehan
e22c027bbf app: keep the GtkStyleProvider alive.
While GTK keeps a reference to it, we should simply not release our own
reference at init(). This was a case where we freed this twice.
2023-05-11 12:46:57 +02:00
Jehan
f9993b85b6 app: use G_DECLARE_INTERFACE() to declare GimpAction interface.
Less boiler plate code so less reasons to mess up.
For this to be feasible, I also had to define a cleanup function for
GimpObject.
2023-05-11 12:46:57 +02:00
Jehan
bb4438789a app: fix some s/G_TYPE_FROM_CLASS/G_TYPE_FROM_INTERFACE/ calls. 2023-05-11 12:46:57 +02:00
Martin
b37fc57096 Update Slovenian translation 2023-05-11 07:55:40 +00:00
Ekaterine Papava
9bfc69c9d3 Update Georgian translation 2023-05-11 03:32:47 +00:00
Yuri Chornoivan
a375c5f0a9 Update Ukrainian translation 2023-05-10 19:28:09 +00:00
Jacob Boerema
1fa8e8617b plug-ins: fix previous metadata-editor commit
- Missed a necessary autotools change: forgot to remove ui/Makefile
from configure.ac
- Not all compilers allow declaring variables in a case statement without
putting them in a block, so we add a block now.
2023-05-10 14:28:42 -04:00
Jacob Boerema
8969bbcee8 plug-ins: Remove dependency on GtkBuilder from metadata-editor
Instead of loading the GtkBuilder .ui file we now create all widgets in
code.
Added several support functions to reduce code copy/pasting and making
additional widgets and supporting more metadata easier.
The overall layout should still look the same, with a few exceptions:
- Each notebook page only uses one grid. This makes it possible to align
all data entry widgets.
- Featured Organization and it's code were two treeviews next to each
other. These are now organized below each other to make automatic code
generation easier.
- Since we needed to touch this code anyway, I also fixed Xmp.dc.creator
and Xmp.iptcExt.ModelAge to be multiline. This closes #7286.
- The old icons used for the date button, add, and remove row buttons
were replaced by gimp-grid, list-add and list-remove.

Since this was the last .ui file used in GIMP plug-ins, we remove all
files from the .ui subdirectory and references to that.

Note that there are several more places where GtkBuilder is used, but
those cases uses strings defined in code instead of .ui files.
2023-05-10 13:25:12 -04:00
Jacob Boerema
415b32e763 plug-ins: refactor set_tag_string usage in metadata-editor
We had a lot of duplicate code using gexiv2_metadata_try_set_tag_string
and then checking for errors.

Simplify this by re-using the existing set_tag_string function by
introducing an extra parameter that tells us whether or not to clear
the tag first.
2023-05-10 12:48:01 -04:00
Rodrigo Lledó
09f4261e3f Update Spanish translation 2023-05-08 12:55:44 +00:00
Tomasz Golinski
5337070bf2 plug-ins: remove obsolete check for Babl fish in file-psd.c
It was a temporary code added before relevant code landed in babl. The necessary merge request landed in Babl some time ago, and Gimp now requires Babl version 0.1.98, which includes the needed commit.

Related to merge_requests/509
2023-05-07 14:21:17 +02:00
Sabri Ünal
3c6c5c277c Update Turkish translation 2023-05-05 12:27:52 +00:00
Alx Sa
c085d94777 plug-ins: Swap deprecated gexiv2 functions in...
...file-tiff-save. As in a57a62ce, this updates
`gexiv2_metadata_clear_tag ()' to `gexiv2_metadata_try_clear_tag ()`.
2023-05-04 16:38:23 +00:00
Luming Zh
df394a35eb Update Chinese (China) translation 2023-05-03 19:33:37 +00:00
Anders Jonsson
5ca592a337 Update Swedish translation 2023-05-03 09:08:58 +00:00
Martin
bb49e9df34 Update Slovenian translation 2023-05-02 09:17:56 +00:00
Yuri Chornoivan
bc940d0e5d Update Ukrainian translation 2023-05-02 06:54:02 +00:00
Ekaterine Papava
eb1ab8d6a7 Update Georgian translation 2023-05-02 04:57:23 +00:00
Jacob Boerema
a57a62ce1a plug-ins: replace deprecated gexiv2 functions in metadata-editor
In the master branch we depend on gexiv2 0.14, so we can remove the
deprecated functions and replace them with the "try_" versions.

We can't backport this, since our stable branch has a lower dependency
for gexiv2.
2023-05-01 19:01:13 -04:00
Jacob Boerema
58e02b4f4e plug-ins: Reimplement date picker in metadata-editor without GtkBuilder
Also changes the dialog title to not have a ':' and make the title
express what the expected action is.
2023-05-01 19:01:13 -04:00
Yuri Chornoivan
c48ce3675b Update Ukrainian translation 2023-05-01 17:03:25 +00:00
Alx Sa
78a72c89ac plug-ins: Port file-ps to use GimpProcedureConfig
This ports the Import and export dialogs to use GimpProcedureConfig.
It covers all properties except GUI-only options
(which were still ported to libgimpui rather than direct GTK calls)

Additionally, a warning was fixed and mnemonics were added to the
property titles.
2023-05-01 07:15:42 -04:00
Sabri Ünal
9ff4072117 Update Turkish translation 2023-05-01 10:54:31 +00:00
Sabri Ünal
9e60755bfe Update Turkish translation 2023-05-01 10:37:28 +00:00
Jacob Boerema
7b6ceabeba po-plug-ins: remove plug-in-metadata-viewer.ui from POTFILES.in
I missed this one in the previous commit.
2023-04-30 16:33:21 -04:00
Jacob Boerema
9c11b40393 plug-ins: create metadata-viewer gui from code
The metadata-viewer uses a GtkBuilder .ui file to create the interface.
In GIMP we prefer our interfaces to be created in code and these builder
files are also not available anymore in GTK4.

This commit removes the .ui file and support code, and creates the
interface from code in our plug-in.
2023-04-30 16:01:40 -04:00
Alx Sa
bca4535c40 icons: Restore GIMP icons replaced by GTK defaults
Five icons in the Layer dockable were being replaced by GTK defaults at
runtime. A "gimp-" prefix was added so that GIMP's version would always
be used. A few dialogues were fixed to use constants rather than
hardcoding the filename, to make it easier to update the icon in the
future.
2023-04-30 13:58:39 +00:00
Alx Sa
5526bebf3c plug-ins: image_id used rather than image in print
In 2.10, print_temp_proc_name () took in the image id. When it was 
updated to take in GimpImage, it still assumed the g_strdup_printf
parameter was an integer.
This is fixed by calling `gimp_image_get_id ()` on the image parameter.
2023-04-30 13:53:16 +00:00
Martin
1f1533b230 Update Slovenian translation 2023-04-28 20:44:31 +00:00
Andre Klapper
6fcac63fbb DOAP: Add support-forum (GNOME Discourse) 2023-04-28 04:41:52 +02:00
Ekaterine Papava
f4d32a7332 Update Georgian translation 2023-04-27 03:44:59 +00:00
Jacob Boerema
d73bae0c66 plug-ins: add support for 8bpp with 4 planes in PCX/DC import
While testing the DCX import MR I saw that one image (abaddon.dcx) was not
recognized. This image uses 4 planes with 8 bpp while we only support
3 planes. The 4 planes type includes an alpha channel.

A few small changes allow us to also load 4 planes by allowing 3 or 4
planes instead of only 3.
2023-04-26 17:27:14 -04:00
Jacob Boerema
f681c50414 libgimpbase: do not save Photoshop specific EXIF metadata
Photoshop can save metadata when exporting to tiff or jpeg, including
a thumbnail that we can't update. This can contain sensitive data, so we
should not export it. See issue #8383.

To do this, we add the two Photoshop specific tags that we know of to the
list of tags that should not be exported, so they won't be saved.
2023-04-26 17:27:14 -04:00
Yuri Chornoivan
876117f4ad Update Ukrainian translation 2023-04-26 18:16:17 +00:00
Alx Sa
6af7b2f5cb plug-ins: Display warning for unsupported metadata
This allows file-psd-load-metadata to show a warning message like the
PSD plug-in does when unsupported features are loaded.
As PSD metadata does not store rasterized versions of fill layers,
a new option is added to show these layers are dropped entirely unlike
with PSDs.
The dialog title changes based on which plug-in called it.
2023-04-26 12:26:31 +00:00
Alx Sa
b5f80f7a14 plug-ins: Load PSD metadata in JPEG plug-in
This adds the PSD metadata plug-in procedure call to the JPEG
plug-in, as part of implementing issue #7549.
Also implements the import half of issue #1842.
JPEGs only store image-level metadata like paths.
2023-04-26 12:26:31 +00:00
Alx Sa
7b6d229be8 plug-ins: Load PSD metadata in TIFF plug-in
This adds the PSD metadata plug-in procedure call to the TIFF
plug-ins, as part of implementing issue #7549.
Also implements the import part of issue #2921.
TIFFs can have both image and layer-level metadata.
The load_paths() function was removed, as the PSD plug-in should
handle this now.
2023-04-26 12:26:31 +00:00
Alx Sa
b788513bcc plug-ins: Add method to load external PSD metadata
Creates a new public procedure that can be used by JPEG/TIFF files to
load any PSD-formatted metadata they have. This consolidates code
to the PSD plug-in, and lets JPEG/TIFF get immediate updates as the
PSD plug-in improves its own metadata support.
Note that only Macintosh formatted metadata is currently supported
by the PSD plug-in; IBM PC formatted metadata is reversed and not
yet interpreted.
2023-04-26 12:26:31 +00:00
Martin
8bd07e468b Update Slovenian translation 2023-04-26 11:19:48 +00:00
Shubham
de5c805cbb app: Modify stroke selection dialog
Changed stroke selection dialog to use GtkStackSwitcher instead of radio
buttons. Make options hidden under "Advanced options" visible by
default.
2023-04-25 12:59:35 +00:00
Ekaterine Papava
15e2adde0c Update Georgian translation 2023-04-25 04:33:45 +00:00
Martin
82e201f93b Update Slovenian translation 2023-04-24 20:17:37 +00:00
Martin
b333b54842 Update Slovenian translation 2023-04-24 20:14:40 +00:00
Yuri Chornoivan
229221c289 Update Ukrainian translation 2023-04-24 17:10:21 +00:00
Yuri Chornoivan
02d2026419 Update Ukrainian translation 2023-04-24 15:31:30 +00:00
Yuri Chornoivan
cd792f831f Update Ukrainian translation 2023-04-24 15:30:23 +00:00
Rodrigo Lledó
b557a8e581 Update Spanish translation 2023-04-24 14:51:02 +00:00
Rodrigo Lledó
08cdf546fc Update Spanish translation 2023-04-24 14:26:56 +00:00
Rodrigo Lledó
0161775738 Update Spanish translation 2023-04-24 14:23:53 +00:00
Alx Sa
7e371c7884 libgimpbase: Add Middle Gray fill option
Uses CIELAB's 50% lightness (18.42% luminance) for the Middle Gray
color.
2023-04-24 10:25:58 +00:00
Ekaterine Papava
e31a2d3d64 Update Georgian translation 2023-04-24 03:34:10 +00:00
Alx Sa
769e36d7cf core: color pick in image's RGB space
Replaces GimpPickableInterface's pixel_to_srgb () functions with
pixel_to_rgb(). Now GimpRGB's values should be in the correct
image color space from the beginning of the process.
2023-04-23 22:03:29 +00:00
Alexander Shopov
5a9df9e77c Update Bulgarian translation 2023-04-23 21:32:53 +00:00
Sabri Ünal
5b7f9fb8eb Update Turkish translation 2023-04-23 21:10:17 +00:00
Sabri Ünal
aa8a4e4504 Update Turkish translation 2023-04-23 20:44:11 +00:00
Alexander Shopov
c46c4f64db Update Bulgarian translation 2023-04-23 20:00:59 +00:00
Alx Sa
da217088d0 plug-ins: Fix rounding error in PCX load
Some valid PCX/DCX files wouldn't load because the bytes per line
header check can be off by one due to integer division rounding.
This adds 1 to the equation to account for this.
2023-04-23 17:37:45 +00:00
Alx Sa
7bc7273d04 plug-ins: Add support for importing DCX files
DCX files are containers that store up to 1023 PCX files.
The PCX plug-in is rearranged to allow reading multiple PCX images per
file, rather than assuming there's only one image.
2023-04-23 17:37:45 +00:00
Alx Sa
73242fe96a plug-ins: Port file-gif-save to...
...GimpSaveProcedureDialog
2023-04-23 17:35:52 +00:00
Yuri Chornoivan
d6b09d4fed Update Ukrainian translation 2023-04-23 13:52:55 +00:00
Alx Sa
222bef78c7 plug-ins: Initial support for Amiga IFF/ILBM
Imports indexed ILBM, Amiga PBM, and ACBM images.
2023-04-22 21:33:27 -04:00
Yuri Chornoivan
8da4e30cdb Update Ukrainian translation 2023-04-22 18:24:51 +00:00
Alexandre Prokoudine
dc49ff9d54 Update Russian translation 2023-04-22 14:53:43 +02:00
Martin
521a8613d6 Update Slovenian translation 2023-04-22 09:07:17 +00:00
Ekaterine Papava
6c9ec76878 Update Georgian translation 2023-04-22 05:29:12 +00:00
Alx Sa
a05213f82a libgimpwidget: Fix GimpFrame line-spacing property
GimpFrame has a property 'line-spacing'. gimp_frame_get_label_spacing ()
tried to access it as 'line_spacing', so it always returned 0.
Fixing the typo should now return the true spacing value.
2023-04-22 03:01:16 +00:00
Jehan
d8c0ddf95f NEWS: update. 2023-04-22 01:57:19 +02:00
Jehan
1584a9ba50 plug-ins: fix the thread rendering the thumbnails all the time.
After testing a bit more, I realized that the thread was constantly re-rendering
the thumbnails, even though I didn't touch the "white-background"
button/argument.
This was not just a completely invisible problem, it actually affected the page
selection (it was very hard to select pages by clicking on them, it was randomly
working, and more often not selecting anything). This is how I realized there
was a problem.

The reason was simply that I was never actually calling g_cond_wait() because of
a first_loop flag I forgot to set.

Note that docs of g_cond_wait() explains that it is possible that "spurious
wakeup" happen. At first I thought I had this issue, which is why this commit
also adds a boolean flag to check after a wakeup, to make sure that I was in the
"condition met" case and not the "spurious wakeup" one.
Even though I realized afterwards the real reason was much more stupid, I still
left this additional check.

Fortunately this issue doesn't seem to affect the 2.10 code. Or to be more
accurate: the continuous render very likely happens there too, yet it doesn't
break page selection interaction with GTK+2 as far as I can see.
2023-04-22 01:29:42 +02:00
Jehan
179ff7ff4d plug-ins: option to choose whether loading a PDF with white background.
Port commit 41f40f530a from gimp-2-10 branch to the main branch:

    While at first, the idea of always loading PDF with transparency seemed good
    (commit 7aff7e9c70), I realized that a lot of administrative PDF (generated with
    text and vector graphics, rather than scans or alike containing raster) actually
    have transparency. So now all these documents load with transparent background.
    Clearly all the office software are assuming that PDF readers will fill the
    background with white.

    So add a checkbox to decide whether or not to fill the image with white. I don't
    update the PDB procedure. I'll just do this on the main dev branch (while also
    updating a bit the code to newer API).

    Fortunately I regularly open such PDF documents with GIMP and could witness this
    no-transparency expectation before we released GIMP 2.10.34! 😅

As side changes, I also:

* ported file-pdf-load to work with GimpProcedureConfig arguments instead of
  GimpValueArray;
* ported the dialog to GimpProcedureDialog and generating as much of it as
  possible (except for the page selector/preview, and resolution entries);
* renamed the "pdf-password" argument to "password";
* added the "target", "antialias" and "white-background" procedure arguments.

A few issues which would deserve to be looked at more closely in the future:

* adding "width" and "height" arguments and decide how to handle "resolution";
  this will likely be better handled with a new GimpVectorLoadProcedure subclass
  to support vector formats in particular;
* shouldn't page selection be handled in a better way? Probably this could be
  handled by adding a generic logic in GimpLoadProcedure (as multi-page support
  is a common feature across image formats);
* GimpInt32Array arguments ("pages") can't be stored anyway right now.
* the "target" arg should be an enum.
2023-04-22 00:24:24 +02:00
Aurimas Černius
41bd71efb9 Update Lithuanian translation 2023-04-21 19:14:37 +00:00
Jehan
0d95b960c5 app: replace deprecated GLib function.
This fixes:

> app/core/gimpitemlist.c:632:7: warning: ‘g_pattern_match_string’ is deprecated: Use 'g_pattern_spec_match_string' instead [-Wdeprecated-declarations]

The new function appeared in GLib 2.70 which is our current minimum GLib
requirement, so the replacement is fine.
2023-04-21 01:09:35 +02:00
Idriss Fekir
99644ff5c9 Issue 7826: "select all" should not be reapplied
To check if "all" is selected call a function added to to channel interface
"is_full".
2023-04-20 21:49:03 +00:00
Jehan
466349762d app: fix broken preset menus in tool options (tool-options-menu.ui).
Generated actions are not necessarily application-wide actions ("app." prefix of
detailed action name). As is the case here, they can be actions specific to a
group only.
2023-04-20 16:56:49 +02:00
Jehan
4b36bff01a app: get rid of unused variable warning.
Warning was:

> gimpsourcetool.c:232:22: warning: unused variable ‘paint_tool’
2023-04-20 15:38:17 +02:00
Jehan
c6906e77da app: get rid of dummy "*-menu" and "*-popup" actions.
With our old code, we needed dummy actions for every submenu. This is not needed
anymore. Actions are only for end menu items (items which actually do something,
not just open a submenu).
Get rid of them all, as well as the code to ignore any action ending with such
suffixes in action-listing pieces of code.
2023-04-20 15:36:11 +02:00
Jehan
8a8914bc21 app: a bit of code cleanup.
Especially some remnants of when Gimp(Toggle|Radio)Action were not descendants
of GimpActionImpl and had to reimplement GimpAction interface.

Also fixing a few details here and there.
2023-04-20 15:36:11 +02:00
Jehan
e3bb3bf57f app: fix address sanitizer error.
The error is:

> app/widgets/gimpdeviceinfo.c:387:13: runtime error: null pointer passed as argument 1, which is declared to never be nul
2023-04-20 15:36:11 +02:00
Jehan
86693d1839 app: free GimpActionGroup's action list in dispose().
This helps make sure we break circular references as soon as possible when
destroying an action group. I also steal the pointer before freeing objects to
make sure the list is empty immediately and any further signal from the actions
won't affect this group.
2023-04-20 15:36:11 +02:00
Jehan
d5aa4f73ac app: add a "color" property to GimpMenuModel.
Note that it will only work for a model attached to a GimpMenu. In particular,
it won't work for the menu bar set to a GtkApplication with gtk_application_set_menubar().

In other words, it won't work on macOS where we let the OS handle the menu.
2023-04-20 15:36:11 +02:00
Martin
ec4ac18178 Update Slovenian translation 2023-04-20 10:59:10 +00:00
Martin
8bcc7545fc Update Slovenian translation 2023-04-20 10:29:00 +00:00
Ekaterine Papava
cd1490dba3 Update Georgian translation 2023-04-20 05:28:28 +00:00
Ekaterine Papava
636a8758da Update Georgian translation 2023-04-20 05:26:20 +00:00
Yuri Chornoivan
2161c31e54 Update Ukrainian translation 2023-04-19 16:36:07 +00:00
Yuri Chornoivan
3a11d3ff30 Update Ukrainian translation 2023-04-19 15:37:35 +00:00
Jehan
564103fdc1 app: allow changing submenu's labels with gimp_menu_model_set_title().
Use this for the "View > Zoom" and "View > Flip & Rotate" submenus which used to
display the zoom level and rotation angle. This regression is now fixed.
2023-04-19 15:21:48 +02:00
Alx Sa
66716e4d04 plug-ins: Port file-xbm to GimpSaveProcedureDialog 2023-04-19 12:32:06 +00:00
Jehan
b0916fe701 Issue #9362: ordered argument format in printf requires no argument "holes".
Though it actually worked in some cases, and failed in others (I have not
figured out which build option exactly makes the format with hole work anyway),
printf manual actually explicitly says:

> There may be no gaps in the numbers of arguments specified using '$'; for
> example, if arguments 1 and 3 are specified, argument 2 must also be specified
> somewhere in the format string.

This explained while it was crashing GIMP (again, only with some build options,
or lack of build options):

> *** invalid %N$ use detected ***

There were 2 possible solutions for this: either ensure that the order number is
always used, but that defeats the purpose of plural localization. Instead I
reorder the argument so that the file name (which must always be shown for sure)
is first in arguments. This way, even if the order number is sometimes omitted
(be it in English or in any language), we avoid the crash.
2023-04-19 14:30:11 +02:00
Alx Sa
e3074df900 tools: Correct Fixed Size toggle behavior
gimp_rectangle_options_fixed_rule_changed is called when either the
checkbox or the dropdown for Fixed Size is changed.
However, the "fixed-size-active" property was not updated until after
it ran, so the toggle behavior is inverted.
This checks to see if the toggle was changed and updates the boolean 
before setting the size field as (in)sensitive.
2023-04-18 01:37:25 +00:00
Sabri Ünal
940fe5e2a9 Update Turkish translation 2023-04-17 15:38:00 +00:00
Sabri Ünal
b766d6654c Update Turkish translation 2023-04-17 15:35:52 +00:00
Sabri Ünal
2c8e4dead5 Update Turkish translation 2023-04-17 15:33:20 +00:00
Sabri Ünal
b39f784ecb Update Turkish translation 2023-04-17 15:08:26 +00:00
Martin
5b94387f72 Update Slovenian translation 2023-04-17 14:06:57 +00:00
Ekaterine Papava
ccaf05728e Update Georgian translation 2023-04-17 04:01:58 +00:00
Yuri Chornoivan
2fde2ed31f Update Ukrainian translation 2023-04-16 17:22:55 +00:00
Alx Sa
88a674c80a plug-ins: Port file-html-table to...
...GimpSaveProcedureDialog
2023-04-16 16:38:17 +00:00
Alexander Shopov
71b695ca83 Update Bulgarian translation 2023-04-16 14:22:35 +00:00
Alexander Shopov
a1ff2902e1 Update Bulgarian translation 2023-04-16 14:20:46 +00:00
Alexander Shopov
b14189defa Update Bulgarian translation 2023-04-16 14:19:08 +00:00
Martin
d29a66fc66 Update Slovenian translation 2023-04-16 12:07:32 +00:00
Martin
3f1ad97f72 Update Slovenian translation 2023-04-16 12:01:04 +00:00
Yuri Chornoivan
f5c77d7d26 Update Ukrainian translation 2023-04-16 08:39:17 +00:00
Ekaterine Papava
4e85d39d8d Update Georgian translation 2023-04-16 01:42:49 +00:00
Alx Sa
70578378dd plug-ins: Port file-mng to GimpSaveProcedureDialog 2023-04-15 23:13:04 +00:00
Alx Sa
7c72202416 libgimp: Fix critical for int SpinScale API
The GimpProcedureDialog API allows int and double  SpinScales. However,
it calls gimp_prop_widget_set_factor () which requires doubles.
A conditional check for a double property was added to this call.
A check was also added to ensure int properties have a factor of 1.0.
2023-04-15 13:40:46 +00:00
Jehan
f785f18892 po*: add menus folder to the POTFILES.skip of various gettext modules. 2023-04-15 14:56:01 +02:00
Yuri Chornoivan
7c91522a83 Update Ukrainian translation 2023-04-14 20:01:36 +00:00
Yuri Chornoivan
f775a097cc Update Ukrainian translation 2023-04-14 19:52:33 +00:00
Ekaterine Papava
1e21af782a Update Georgian translation 2023-04-14 18:08:46 +00:00
Ekaterine Papava
290c617558 Update Georgian translation 2023-04-14 17:45:58 +00:00
Jehan
24048ef862 app: add some longer label variant for dialog actions.
Just "Layers" or "Patterns" was always very confusing. It was even worse when
both tools and dialogs had nearly6 the same name (for instance "Gradient" was
the tool action, but "Gradients" was the dialog).

Now these dialog actions will be labelled more obviously in the action search,
such as "Layers Dialog" or "Gradients Dialog".

Of course, the short name will stay in contextualized menus, such as in the
"Windows > Dockable Dialogs" top submenu, or in the Dockbooks' "Add Tab"
submenu.
2023-04-14 19:27:24 +02:00
Jehan
2511c70e8d Issue #9349: long label variant for tool actions.
While the short label can be "Gradient" for instance, because it is in the
submenu "Tools > Paint Tools", this is a confusing label say in the action
search.

Now the longer label will be used in there and will say:

> Activate tool "Gradient"
2023-04-14 19:15:16 +02:00
Jehan
ea1205f094 Issue #9349: removing 2 duplicate "*-short" actions.
"edit-paste-as-new-image-short" and "vectors-selection-to-vectors-short" were
just duplicate of the action named the same, except for the "-short" suffix, and
the only point was to have different labels.

Not though that this time, it was not enough to conclude that the action in a
menu shoud have the short variant. These were both used differently depending on
the menu.
Instead I added the concept of "label-variant" attribute in .ui menu files. When
the "long" variant is set, then we simply use the longer label.

There is still one more "-short" action: "tools-by-color-select-short", but I am
a still unsure how to handle this one.
2023-04-14 18:54:16 +02:00
Jehan
89772351c9 Issue #9349: Add concept of "short" (contextual) vs "long" label for actions.
All Gimp*ActionEntry (except GimpProcedureActionEntry) now have a short_label
member.
This commit doesn't add any new short label yet. It just fixes the struct usage,
and fixes a few localization contexts here and there when I saw such broken
strings.

I also fixed a few gradient editor action strings which were not proper labels
(like "splitmidpoint" or "splituniform", or missing uppercase, etc.).
2023-04-14 17:48:57 +02:00
Jehan
4aa141603b app: remove unused finalize().
Get rid of an unused variable warning, though the whole function was useless
anyway.
2023-04-14 16:50:18 +02:00
Jehan
6e980dbe36 app: fix weird broken indentation.
Apparently my vim indentation rules got confused by a comment.
2023-04-14 16:35:50 +02:00
Jehan
1b932d10d3 Issue #9349: short and long labels for "windows-display-*" actions.
The short labels are just the file names as we have all the context in the menu
to understand what these actions do (in Windows menu, ordered by view position
and with a `Ctrl+n` shortcut next to each, increasing by position).

In the action search for instance, we keep a 'Show "<image name>"' label.

Also I'm adding a relevant tooltip to further explain what each of these actions
do, using the view position.
2023-04-14 16:33:35 +02:00
Anders Jonsson
9d175f681a plug-ins: fix typos in sparkle 2023-04-14 10:54:05 +00:00
Martin
70bb6fe939 Update Slovenian translation 2023-04-14 10:50:06 +00:00
Martin
998039ffa6 Update Slovenian translation 2023-04-14 10:42:24 +00:00
Alx Sa
82a4f568d4 plug-ins: Port sparkle to GimpProcedureDialog 2023-04-14 04:23:11 +00:00
Ekaterine Papava
71ecdd30ea Update Georgian translation 2023-04-14 04:17:40 +00:00
Alx Sa
fe9b13f43c plug-ins: Update GimpPreview format in despeckle 2023-04-14 02:25:36 +00:00
Anders Jonsson
e0eb79b5c1 Update POTFILES.in 2023-04-13 23:21:49 +00:00
Jehan
341fd90958 Issue #9349: add concept of "short" (contextual) vs "long" label for actions.
Basically actions in menus should show the short label (we assume the menu
position brings contextuality) when available, whereas it will use the longer
label in GUI lacking contextuality.

As a first such usage, the `file-open-recent-*` actions have the file name which
will be opened as short label. This is used in menus since the submenu `File >
Open Recent` ensures that the action which will run is perfectly understandable.
On the other hand, in the action search, the action is named 'Open "<file
name>"' since an action named only with a file name would not be understandable.
2023-04-14 00:17:15 +02:00
Jehan
747cbf70db app: add a "Filters > Generic > GEGL Operations" submenu with generated actions.
Since we now generate actions for GEGL ops, we might as well generate menu items
for these too.

What I did:

- Move the "GEGL Operation…" tool (generic dialog with a drop-down list of all
  non-ignored GEGL ops) to Tools menu.
- Create a "GEGL Operations" submenu in Filters > Generic.
- Move "GEGL Graph" to the top of this new submenu.
- Generate a new menu item for each generated action tied to a GEGL plug-in,
  alphabetically sorted.
2023-04-13 23:06:54 +02:00
Alexander Shopov
0568866871 Update Bulgarian translation 2023-04-13 20:30:34 +00:00
Alexander Shopov
a8ed8a7e0c Update Bulgarian translation 2023-04-13 19:32:03 +00:00
Jehan
d51c64ec06 Issue #9228: make GEGL Operation tool's operations their own actions too.
Though the GEGL Operation tool is still useful as a generic dialog, let's
generate also per-operation (the ones not ignored and not already special-cased
in the rest of the GUI) tools and actions.

These "tools" are mostly hidden (e.g. not selectable in toolbox where it would
be a bit useless as they would show with the generic GEGL icon or none), but
they can be searched with the action search, shortcuts can be assigned and they
can be added to menus.
2023-04-13 21:28:52 +02:00
Alexander Shopov
60354a0e59 Update Bulgarian translation 2023-04-13 19:22:04 +00:00
Yuri Chornoivan
171d9b8f0c Update Ukrainian translation 2023-04-13 16:19:28 +00:00
Jehan
6776439c6f NEWS: update. 2023-04-13 12:18:54 +02:00
Martin
73b73153d3 Update Slovenian translation 2023-04-13 10:04:12 +00:00
Alexander Shopov
5919f44d9d Update Bulgarian translation 2023-04-13 10:03:30 +00:00
Martin
045bc02e15 Update Slovenian translation 2023-04-13 10:01:14 +00:00
Alexander Shopov
4a4ef92120 Update Bulgarian translation 2023-04-13 08:26:23 +00:00
Ekaterine Papava
c3732bfd02 Update Georgian translation 2023-04-13 04:31:32 +00:00
Jehan
0ee620f4e6 menus: fix autotools distclean.
Fixes the following build error on CI:

> ERROR: files left in build directory after distclean:
2023-04-12 22:36:21 +02:00
Jehan
5790adcfd3 menus: do not validate the DTD for GtkBuilder UI format. 2023-04-12 22:07:09 +02:00
Jehan
c7c5f126b1 app: disable some unit tests temporarily.
Since the recent changes, these 3 tests are not working:
- tools
- session-2-8-compatibility-multi-window
- session-2-8-compatibility-single-window

(the 2 latters were only working with xvfb anyway)

I could just dig further as I did a bit these last few days, and tweak more and
more the testing code. But I think our current unit-testing framework is just
non-reliable and for all these years, we have spent more time fixing the tests
than actually relying on them to tell us there is a bug in GIMP.
Furthermore creating new tests is so cumbersome that basically none do it.

I have a plan laid out in #9339 for a much better and more reliable unit testing
infrastructure, based on the GIMP executable itself and a very simple syntax to
create new test scenari (so that even non-developers should be able to create
them eventually). So until then, let's disable these tests and stop wasting
time.
2023-04-12 22:07:09 +02:00
Jehan
aa8ccf3ba8 Issue #6612: support numpad's divide ('/') as secondary action search shortcut. 2023-04-12 22:07:09 +02:00
Jehan
af5612eda2 Issue #3834: keys Copy, Cut and Paste now supported as secondary shortcuts. 2023-04-12 22:07:09 +02:00
Jehan
ab33d032ad app: support Forward and Back keys.
Same as ZoomIn/Out keys, these are implemented as secondary shortcuts to actions
"windows-show-display-next" and "windows-show-display-previous" respectively.

See issue #637.
2023-04-12 22:07:09 +02:00
Jehan
9e8304aeb9 Issue #637: support ZoomIn and ZoomOut special keys.
These will simply be recorded as secondary shortcuts for view-zoom-in and
view-zoom-out.
2023-04-12 22:07:09 +02:00
Jehan
71c8ff1f21 app: change all action entry structs to allow several shortcuts.
- The `accelerator` variable is a NULL-terminated array, allowing up to 3
  accelerators per action (so far, none has more than 2).
- Only the struct GimpProcedureActionEntry still has a single accelerator as I
  don't think it makes sense that we change the plug-in API to allow a plug-in
  to register more than 1 shortcut for a procedure (e.g. we don't want a plug-in
  to just register all possible keys for their procedure!).
  Of course, users will still be allowed to register more shortcuts for plug-in
  actions through the shortcut dialog. It's only the initialization which
  1-shortcut max for procedure actions.
- Remove all actions ending up in "-accel" as these were only a trick to
  register more shortcut for a same action. Now we just have the real
  possibility (rather than creating bogus duplicate actions). As a consequence,
  these actions accelerators have been moved as secondary accelerator to their
  main action.
  The deleted actions are: "view-zoom-out-accel", "view-zoom-in-accel",
  "view-zoom-16-1-accel", "view-zoom-4-1-accel", "view-zoom-2-1-accel" and
  "view-zoom-1-1-accel".
2023-04-12 22:07:09 +02:00
Jehan
d6a86b1ab7 app: fix "Remove all Keyboard Shortcuts" and "Reset Keyboard Shortcuts to…
… Default Values" buttons in Preferences.

I considered just deleting the "Remove all shortcuts" action, because really I
am wondering how useful (and often used) it is, and if we are not over-featuring
the shortcut code.
I could find the origin commit 6da388be93, from 2006. Basically the use case is
for people who want such a different mapping overall that it's much better to
start from a blank slate (e.g. DVORAK users, like in the original report).
See: https://bugzilla.gnome.org/show_bug.cgi?id=331839

So in the end, I just reimplemented this with newer code.

Also this commit fixes the "Reset Keyboard Shortcuts to Default Values" code.
2023-04-12 22:07:09 +02:00
Jehan
beb093f549 app: remove the "Save" button from the "Configure Keyboard Shortcuts" dialog.
This was always confusing to people that they had to click "Save" then "Close".
With new code anyway, any change is instantly put into effect, and the only
point of "Save" is to actually store immediately in the shortcutsrc file. But
this is clearly not very clear to people (and it can be done in the Preferences
dialog too).

Instead let's just have a "OK" button. The file will be actually updated on exit
only (if "Save keyboard shortcuts on exit" is checked). And that's it.

The only missing feature would be the ability to cancel the latest changes
before hitting OK, i.e. having a "Cancel" button too. Let's see to do this
later.
2023-04-12 22:07:09 +02:00
Jehan
817ee1c660 app, docs, etc.: transform menurc in shortcutsrc after an update.
Also get rid of various old references to menurc and don't install it anymore to
etc/ (neither the new shortcutsrc as it doesn't look like it brings much value
to do so).
2023-04-12 22:07:09 +02:00
Jehan
42bc6ba1c0 app: fix ignoring paths with parentheses.
I had the case of a path with parentheses in the folder name. Just don't assume
any character should not be in a path.
2023-04-12 22:07:09 +02:00
Jehan
73f607fd73 app: the menu "paths" must be based on the English original whereas…
… the actual labels can be localized.

This fixes menu creation when GIMP is localized.
2023-04-12 22:07:09 +02:00
Jehan
df0bd8c183 app: cleanly delete the UI manager and action groups associated to finalized…
… dock windows.

This fixes crashes which happen when switching from multi-window mode to single
window mode.
2023-04-12 22:07:09 +02:00
Jehan
2967020d16 app: verify shortcutsrc exists before parsing it. 2023-04-12 22:07:09 +02:00
Jehan
7d1155af4a Issue #5601: Command Search (/) Results to show Menu Path. 2023-04-12 22:07:09 +02:00
Jehan
32f93c49de app: handle duplicate accelerators in shortcutsrc parsing. 2023-04-12 22:07:09 +02:00
Jehan
8383928790 app: comment-out actions using default shortcuts in shortcutsrc.
This uses a new concept of "default shortcuts" which must be called only once at
most per action. Any subsequent shortcuts setting are custom settings.

Commenting these lines out is mostly informational as it allows to see in a
quick glimpse in shortcutsrc file which are custom shortcuts or not.
2023-04-12 22:07:09 +02:00
Jehan
94ebb4f821 app: serialize and deserialize the actions' accelerators.
gtk_accel_map_load()/gtk_accel_map_save() are not working with the new
GAction-based code. GtkApplication does not seem to have helper functions to
simply load and save accelerators in a file, so we just implement it ourselves.

A few things are missing right now, namely:

- On parsing, it doesn't handle any kind of duplicate accelerators (possible
  especially if someone edited the new shortcutsrc manually).
- On reading, maybe we should only write down the changed (from defaults)
  actions, while keeping the old ones commented-out, as menurc used to be. This
  is actually useful info both for debugging or even for users who want to look
  at this file and see what they changed.
- We should add import code to transform the menurc into shortcutsrc when
  updating GIMP, otherwise all custom shortcuts would get lost.

There is still the question on whether we should add the group name too. I think
we should, expecially for plug-in's procedure actions, though right now these
are just added in the GtkApplication's main action group anyway. I'll see later
to refine this.
2023-04-12 22:07:09 +02:00
Jehan
0278480f87 app: new gimp_action_set_group() and gimp_action_get_group().
Now that we don't have any action duplicated in groups based on names (i.e. that
there could just be 2 actions with the same name in different groups), let's
have the GimpAction also store its group.

Use this to fix some code which was now crashing when confirming erasing an
existing shortcut.
2023-04-12 22:07:09 +02:00
Jehan
d4fb4362c9 app: fix unit tests with GUI.
Run them with the new GApplication logic, otherwise the various new
parts (such as actions) are not properly loaded.
2023-04-12 22:07:09 +02:00
Jehan
6324357051 app: add a weak pointer to GimpEditor's UI Manager.
I only came into a problem during unit-testing while trying to access an
already destroyed ui_manager.
2023-04-12 22:07:09 +02:00
Jehan
a752ad5e07 app, menus: add an application menu for systems which wants this.
In particular on macOS, we want to show some default common actions (see
comments in !837) but gtk_application_prefers_app_menu() docs says that it will
always return FALSE on this OS. So we ignore this call on macOS.
2023-04-12 22:07:09 +02:00
Jehan
634bb0836e menus: fix dialogs_dockable_actions being in 2 groups.
Depending on where it's used, this list of action can be either in the
"dockable" or the "dialogs" action group.

The meson rule is a bit more complicated than I wished it were because of the
ever-so-blocking lack of simple dependency in meson.
Cf. my latest comment: https://github.com/mesonbuild/meson/issues/8123#issuecomment-1496168759
2023-04-12 22:07:09 +02:00
Jehan
3e6735872a menus: make sure the generated menus are rebuilt when inserted submenu is…
… modified.
2023-04-12 22:07:09 +02:00
Jehan
9753755249 app: fix action's proxy button clicks.
Using gimp_action_activate() ensures we call the action with the expected
GVariant for the specific class of action (and not a NULL GVariant).
2023-04-12 22:07:09 +02:00
Jehan
f3eb6e1677 app: GimpUIManager and GimpActionGroup are for a given (id, user_data) couple.
This deals in particular with the dockable issue. Each dockbook needs its own
GimpUiManager and the action groups inside, which are identified by a string
identifier but also by a different user data (allowing to identify the specific
dockbook an action was call from, so that for instance you close the right
dockable).

It also makes the name requirement of plug-in procedure more flexible as a
procedure name clash can only happen between plug-in procedures now (not with
core actions).
2023-04-12 22:07:09 +02:00
Jehan
caf4c68c71 app: move special-casing of radio action submenus from GimpMenu to GimpMenuModel.
This is a continuation of previous work where we are slowly moving to most logic
being in GimpMenuModel so that it works both when we create menus ourselves or
when we let GTK do it for us (e.g. the main menu bar in macOS).
2023-04-12 22:07:09 +02:00
Jehan
ce776c947d app, menus: progressively move to action group logics. 2023-04-12 22:07:09 +02:00
Jehan
d9b9fa0acd app: only <Image> GimpUIManager's actions should be application actions. 2023-04-12 22:07:09 +02:00
Jehan
e8294660cc app: make GimpActionGroup a subclass of GActionGroup.
It should make it possible to attach an action group to a widget, instead of
making it global to the application. This will be useful/used for context
actions, such as actions which are only relevant to a dock and which will
therefore be duplicated to each dock (with the specific dock as user action so
that we work on the right part of the GUI).

I have not implemented all virtual methods. Not sure if they are all necessary.
2023-04-12 22:07:09 +02:00
Jehan
9b0c1b6f62 app, menus: fix the "Recently Closed Docks" auto-filling menu.
It was actually working fine except that I wrongly named the submenu somehow,
but even more particularly I thought it was about single dockables (tabs)
whereas it was about full detached docks (a window containing several
dockables/tabs).
2023-04-12 22:07:09 +02:00
Jehan
bd4e17dd1e menus: the .xml files are now unneeded (replaced by .ui files). 2023-04-12 22:07:09 +02:00
Jehan
b76d46d75b app: fix Makefile for the new objects created for the GAction port. 2023-04-12 22:07:09 +02:00
Jehan
228af9c3c1 app: only update the menu items which changed.
As a further optimization (even though the big slowness situation is
mostly resolved anyway by a previous commit), let's not rebuild whole
submenus when only a few items were added or removed.

1. First make so that the action "visible" property is only notified
   when the visibility actually changes. This way, we can trust that the
   visibility of the item and of the related action are properly synced.
2. Now when an action which is part of a model changes its visibility,
   we trigger the proper "items-changed" only for the added or removed
   item. This replaces the old procedure of removing then adding
   everything (i.e. a full reset).
3. Add some utilities in gimpwidgets-utils (out of gimpmenushell.c).
   This cleans up some code and also fixes some bugs which were
   reimplementing (badly) some code I already implemented (right) in a
   static function.
4. Fix adding new actions in sub-sub… menus. Previous code was only
   showing the direct parent, not up to the root menu (this could happen
   for plug-in procedure items in particular).
2023-04-12 22:07:09 +02:00
Jehan
ff684fbeb4 plug-ins: remove "Animators" placeholder from script-fu scripts. 2023-04-12 22:07:09 +02:00
Jehan
6bed6e1ef8 app: properly remove action from the application when no longer used.
When an action is removed from a group, we verify if it's not in any group
anymore. If so, we remove it from the GimpApp action map.

This fixes some CRITICALs happening when some actions were dynamically deleted
and re-created, in particular the "windows-display-XXXX" actions.
2023-04-12 22:07:09 +02:00
Jehan
50a3bb57ee app: don't notify "enabled" when the sensitivity didn't change.
This was the main reason for the slowness of the new GUI as it was triggering
far too much useless code far too often.
2023-04-12 22:07:09 +02:00
Jehan
16656e7076 app, libgimpwidgets: last GtkUIManager and GtkAction usage in libgimpwidgets.
These were the last use of the old GtkAction API and it was particularly
annoying here as this widget is used both in core GIMP and in plug-ins, yet core
GIMP actions were not GtkAction anymore (so the "activate" signal handler's
signature was different, which would crash the core code).

Now the clash is resolved as this widget just uses GAction (which both
GimpAction, for core code, or GSimpleAction, for plug-ins, are).

This is also the absolute last use of GtkAction (and other related API) in all
our code (core, libgimp* and plug-ins). \o/
2023-04-12 22:07:09 +02:00
Jehan
2196c7585c app: no GtkAction or GtkActivatable API call anymore in core code! 2023-04-12 22:07:09 +02:00
Jehan
e724a9bff3 app: GimpActionGroup is not a GtkGroup anymore, but a GimpObject descendant!
I've hesitated if we should make it a GActionGroup, whose API handles actions
fully through name strings. I didn't see what it brings us short-term compared
to the additional work, so for now it's just a class of its own, not
implementing GActionGroup interface. Maybe later.
2023-04-12 22:07:09 +02:00
Jehan
60e80b28da app: fix creating submenus for plug-ins.
This got broken since the new GimpMenuModel implementation.
2023-04-12 22:07:09 +02:00
Jehan
38d0abc026 app: prevent multiple registrations of a same action.
Pre-GIMP-3.0 code logics would re-allocate several GimpMenuFactory or
GimpUIManager for no good reason. While it was still working with old GtkAction
code, with our new GAction-based code, we were ending up overriding an action
with a new version of the same action, while keeping reference to old actions.
This made for discrepancies of the enabled or visible state of actions.

The new code keeps singleton of some objects and references to already
registered GimpUIManager or GimpActionGroups objects and make sure no actions
with the same name are created twice.
2023-04-12 22:07:09 +02:00
Jehan
fd05b75cf7 app: GimpUIManager not a subclass of GtkUIManager anymore! 2023-04-12 22:07:09 +02:00
Jehan
45b2e8c783 app: remove some gtkosxapplication code.
Unless mistaken, this is not needed anymore. New GtkApplication code should take
care of creating the native macOS application menu for us.

Cf. also contents of MR !558.
2023-04-12 22:07:09 +02:00
Jehan
55cd88bd8d app: using GtkApplication menubar with GIMP_GTK_MENUBAR environment variable.
Testing the 2 code paths is otherwise extremely annoying. Let's just add an
environment variable allowing us to run one or the other implementation if the
variable is set.
2023-04-12 22:07:09 +02:00
Jehan
1637dd1cd4 app: new GimpMenuModel object, which is our own implementation of GMenuModel.
Since GAction don't have labels or visibility, it is up to every application to
fill the GMenuModel with such infos. In my previous implementation, I was simply
handling these in GimpMenuShell subclasses (GimpMenu, GimpToolbar and
GimpMenuBar) since we need them for tooltip support (unavailable from GMenu).

Nevertheless there are cases where we want to use GTK API directly with a
GMenuModel, in particular with gtk_application_set_menubar(). This is necessary
to handle the macOS specific code path, where we don't want our usual menu bar.
This OS has its own display of a software menu bar, directly in the desktop GUI.
See !558 for some screenshots of this.

So this commit moves around some code away from GimpMenuShell subclasses into
the new GimpMenuModel class. Now we use this new class instead of simpler GMenu
objects. It handles syncing with GimpAction-s, auto-updating labels, visibility
and sensitivity, as well as adding custom items (plug-in actions, recently
opened files, opened images, etc.).
2023-04-12 22:07:09 +02:00
Jehan
475bd45d32 app: GimpActionGroups listed in GimpUIManager directly.
Getting rid of more GtkUIManager code.
2023-04-12 22:07:09 +02:00
Jehan
4251c931c7 app, menus: big cleanup of most of GtkUIManager API.
Only remaining API are action group-related.

While doing this, I also remove 2 debug actions which don't look like they were
outputting any information anyway (at least on the main dev branch):
"debug-dump-items" and "debug-dump-managers".
2023-04-12 22:07:09 +02:00
Jehan
aff946b051 libgimpwidgets: fix menu item with tooltip without help ID.
In such a case, we may not want to connect to "query-tooltip", yet we still want
the normal tooltip to show up. This was a case for instance for the recently
opened file actions ("file-open-recent-*") or opened image actions which were
not showing their tooltips.
2023-04-12 22:07:09 +02:00
Jehan
3cbdb93358 app: do not destroy GimpUIManager immediately on "hide".
When we do this, their actions are not properly run, because this happens after
the "hide" signal. So we need to detach the popup in an iddle function (so that
it runs after all in-progress signal handling happen), which will in turn
removes the last reference to the object.
2023-04-12 22:07:09 +02:00
Jehan
57a0fd4dbf app, menus: fix tool options menus.
My last commit message was slightly wrong. I had one last special case to
handle: the ability to only create sub-GimpMenuShell (i.e. at a specific path
other than the root).
We are using this ability in particular for tool options submenus.
2023-04-12 22:07:08 +02:00
Jehan
033aa8e71b menus: add all the missing menus in the new GtkBuilder format!
I was handling all the problematic cases first. These remaining menus are
working fine otherwise by just implementing them, as far as my tests go.
2023-04-12 22:07:08 +02:00
Jehan
55dc688759 app, menus: use the new GimpToolbar in the GimpTextEditor. 2023-04-12 22:07:08 +02:00
Jehan
da32f539d8 app: new GimpToolbar widget.
It's still pretty simple now and allows to add toolbar buttons and separators
(at start or end). There is no possibility of runtime-customization yet, but in
the future, it would be great to allow such ability and use this widget for a
main window toolbar which people can customize to add quick access to their
favorite actions.
2023-04-12 22:07:08 +02:00
Jehan
f492871e88 app: better use GimpMenuShell and shift around some code as virtual…
… function implementations.

I am also preparing to create a new class GimpToolbar which will make good use
of the interface too.
2023-04-12 22:07:08 +02:00
Jehan
8a2d895ae8 app: fix non-reactive display shell after popping up tool menus.
The canvas was not reactive to any pointer or keyboard event until we hit
Escape. This was because we needed to reset the `mod_action` variable.
2023-04-12 22:07:08 +02:00
Jehan
bd4cb8f67a app: improve GimpMenuShell handling of GimpRadioAction and GimpToggleAction.
Somehow the toggle actions were not working correctly on GimpMenu popped up e.g.
as dockbook menus (but it was fine in the GimpMenuBar). I straightened up the
code to be a bit clearer. I also rely on the "toggled" signal rather than
"change-state" (the latter is supposed to happen before state change actually
happen). It now works much better.
2023-04-12 22:07:08 +02:00
Jehan
e800159847 menus: add dashboard-menu with proper placeholder support. 2023-04-12 22:07:08 +02:00
Jehan
987f86a218 app: make sure widgets exist when an action change state.
Otherwise it may end up in crashes while exiting GIMP. The widget must be alive
or the signal handler removed.
2023-04-12 22:07:08 +02:00
Jehan
9c7469fb22 app, menus: handle the case where a menu is used both as popup and submenu.
Several menus can be triggered either as popups on their own when right-clicking
the dockable or on items, or as a submenu in the docks main menu.
In the former case, we want the menu items to be at the root level, whereas in
the latter case, we want them inside a properly named submenu.

To handle this, I wrap these in a properly labelled <submenu> in the .ui files,
and I add a boolean flag to gimp_menu_shell_fill() which will drop the top
submenu if and only if this is the only top item. I use this flag only when
using these menus as popup menu on their own.

Also fixing a few memory leaks around these pieces of code.
2023-04-12 22:07:08 +02:00
Jehan
87a22a37ae app: run action group's update functions when changing gradient editor's…
… selection.

Since we change some actions' group name depending on the selected editor's
segment, we need to update actions accordingly.
2023-04-12 22:07:08 +02:00
Jehan
2335e14d59 app: add the gradient editor submenu and a new concept of GimpRadioAction's…
… group name.

The gradient editor submenu add 2 submenus with changing names. It was using
again bogus actions: "gradient-editor-blending-func" and
"gradient-editor-coloring-type" do nothing except for being used as name
holders.

Instead I add the concept of group name for GimpRadioAction-s and when I use a
radio action attribute as <submenu>, this submenu will use the group name (and
sync with it, if it changes).
2023-04-12 22:07:08 +02:00
Jehan
b1f022f144 app, menus: now support the child menu of the GimpDockbook menu.
I only translated the undo menu into GtkBuilder's .ui format for now.
The only missing part is that the icon is now shown.

Note that in various parts, I don't rely anymore on a bogus menu action (i.e.
"undo-popup" action in this case) which does nothing but has an associated label
and icon. I simply add the label and icon as submenu attribute directly in the
.ui file, which is translatable and whose strings should be parsed by gettext.

Eventually I'll just get rid of all the various "*-popup" or "*-menu" bogus
actions.
2023-04-12 22:07:08 +02:00
Jehan
1b48792089 app: do not register shortcuts with deprecated GtkActionGroup code anymore. 2023-04-12 22:07:08 +02:00
Jehan
83c466bdec app: don't implement GtkAction activate() anymore.
All action types work fine with GAction activate() now.
2023-04-12 22:07:08 +02:00
Jehan
4776b092bd app: action names set in GimpToolControl don't need the group name appended.
Not with the new GAction-based actions.
2023-04-12 22:07:08 +02:00
Jehan
082bec3721 app: GimpEnumAction don't implement anything from GtkAction anymore. 2023-04-12 22:07:08 +02:00
Jehan
9f1fd64a41 app: GimpRadioAction is now a subclass of GimpRadioAction.
We now completely got rid of all GtkToggleAction and GtkRadioAction code in the
whole of GIMP!
2023-04-12 22:07:08 +02:00
Jehan
a813f82252 app: GimpToggleAction is now a GimpActionImpl subclass. 2023-04-12 22:07:08 +02:00
Jehan
dcd911ba60 menus: implement a bunch of menus in GtkBuilder format.
It's not all of them yet, just the ones which work out of the box with current
code and which I could easily trigger.
2023-04-12 22:07:08 +02:00
Jehan
9c5812ffbb app: use the new GimpMenu so that we instantly get much nicer looking menus! 2023-04-12 22:07:08 +02:00
Jehan
7af01cbb16 app: new GimpMenu widget and GimpMenuShell interface.
The new GimpMenu is derived from GtkMenu. Both GimpMenu and GimpMenuBar are now
implementing GimpMenuShell which allows to share a lot of the logic for filling
the menus, adding items, etc.
2023-04-12 22:07:08 +02:00
Jehan
06b7242cc0 app: rename GimpMenu to GimpMenuBar.
This is better in sync with GTK naming (GtkMenuBar), but especially, it will
allow me to make a GimpMenu subclass of GtkMenu.
2023-04-12 22:07:08 +02:00
Jehan
4e038a66a6 app: remove more of GtkAction API.
This is less and less a GtkAction. Note that I don't implement
gimp_action_get_name() because once we will drop completely GtkAction and make
GimpObject the parent, we can just use gimp_object_get_name().
2023-04-12 22:07:08 +02:00
Jehan
c20039b25e app: move "visible" property to GimpAction, rather than GtkAction. 2023-04-12 22:07:08 +02:00
Jehan
47ff65aa86 menus: add a dockable-menu with the new GtkBuilder format.
The dialogs-menuitems is shared between dockable-menu and image-menu, just as it
was with the old format. For this, we use XSL transformation with XInclude, then
drop the namespace (because GTK doesn't like the unknown namespace being defined
and crash immediately otherwise).
2023-04-12 22:07:08 +02:00
Jehan
f9fec03751 app: display shell popup menu now uses GMenuModel.
The menu is still very incomplete, but it's a start.
2023-04-12 22:07:08 +02:00
Jehan
8ec589915a app: only show the new menubar now. 2023-04-12 22:07:08 +02:00
Jehan
6ecfc4a77b plug-ins: more placeholders removed from menu paths. 2023-04-12 22:07:08 +02:00
Jehan
c8a2f77c98 plug-ins: don't use "Send" placeholder either. 2023-04-12 22:07:08 +02:00
Jehan
5b009690f4 app: correctly show the pixbuf set with gimp_procedure_set_icon_pixbuf()…
… next to item labels for GtkMenuItem proxy widgets (e.g. in main menu).
2023-04-12 22:07:08 +02:00
Jehan
9eea95255a plug-ins: remove the "Acquire" of the menu path.
This is a placeholder which is not meant to appear in the menu. Our new system
uses placeholders internally, but plug-ins cannot make use of these.

Not sure anyway if this is so useful in the cases of plug-ins. At least, I don't
feel it is for these particular use cases.
2023-04-12 22:07:08 +02:00
Jehan
c1fc3cf8eb app: display the optional (main) shortcut next to menu items.
Also getting rid of gimp_action_get_proxies() API which is now unneeded, I
think. Furthermore GimpMenu does not have to connect to label changes. Making
the items proxies of a GimpAction is enough to have them updated.
2023-04-12 22:07:08 +02:00
Jehan
9485b4ef5b app: implement F1 help binding on GimpMenu. 2023-04-12 22:07:08 +02:00
Jehan
01a4feb784 app, libgimpwidgets: GimpAction proxy widgets will display the proper tooltip.
The tooltip contains the reason for action inactivity, if relevant. And in case
of a GtkMenuItem in particular, it will also contain the "Press F1 for more
help" text at the bottom.
2023-04-12 22:07:08 +02:00
Jehan
63e48171a4 app: fix activating GimpEnumAction in the GimpMenu.
Not sure why gtk_actionable_set_action_name() works fine to activate base
GimpActionImpl, but not subclasses like GimpProcedureAction or GimpEnumAction
(and maybe others subclasses?), such as the "file-open-recent-*" actions. This
will have to be investigated further IMO.
2023-04-12 22:07:08 +02:00
Jehan
d73337680d app: rename the dynamic label for the "file-open-recent-*" actions.
While in the menu, under a contextual "Open Recent" submenu, it is well
understandable, the action is much less understandable without context, e.g. in
the action search. So I prepend an "Open" prefix.

Maybe a future alternative could be to have GimpAction have both contextual and
non-contextual labels (a.k.a. short vs long label)?
2023-04-12 22:07:08 +02:00
Jehan
69a780babb app: add proxy support to GimpAction/GimpMenu.
The proxy properly shows a color area or viewable (depending on context), and
this is properly updated when the associated properties are changed.

The label change is also properly updated in the label part of the proxy.

Very relevant actions to test the proxy items are dynamically updated are
generated actions such as the "file-open-recent-*" actions (with both label and
viewable updates), or again the Edit > "Fill with (FG|BG Color)|Pattern" (with
color/pattern updates).
2023-04-12 22:07:08 +02:00
Jehan
2f70d1a154 app, menus: add the generated actions in the main menu.
These are the menu items such as the recently opened images, or recently used
filters, etc.

Some notes:

- I added back a "placeholder" concept in the GimpMenu logic. This will allow to
  place items at specific positions in the menu (either under the placeholder,
  which will make the last item be on top or above the placeholder to have the
  last item be in the bottom, depending on needs). Technically placeholders are
  just menu items with a label (used as placeholder key) and no associated
  action, which I will leave invisible.
- I add a logic for submenus so that they are invisible by default and are only
  made visible when we add a menu item with an action in there.
- I removed filling the "/Filters/Recently Used/Plug-ins" placeholder. As far as
  I could see, it was never filled (neither with old or new code) and the
  "/Filters/Recently Used/Filters" actually already takes care of filling the
  "Recently Used" submenu with both GEGL operations and plug-in calls.
- The old gimp_ui_manager_add_ui() API is for all types of menus, e.g. including
  the ones created by dockables or elsewhere whereas my new API is (for now)
  still specific to the top menu. This will have to be further implemented
  later. I left a bunch of "TODO GMenu"-s for the time being.
- I see 2 dock-related generated items which seem to never be added, for
  recently added and closed docks. It doesn't seem to work in the old API as
  well. I'll want to have a closer look too.
2023-04-12 22:07:08 +02:00
Jehan
37c11f0134 app: support adding new items and submenus to GimpMenu.
In particular, we use this to add the actions created by GimpPlugInProcedure
(i.e. by plug-ins) to the main menu.
2023-04-12 22:07:08 +02:00
Jehan
f66e893bb3 app: GimpMenu also monitors the "label" and "tooltip" properties of GimpAction.
Some actions in particular can change their label. E.g. "file-export" and
"file-overwrite" will have customized labels containing the imported or exported
file name. The menu will now reflect such changes, live.
2023-04-12 22:07:08 +02:00
Jehan
66eeb4fe6c app, menus: make GimpMenu item visibility sync on action visibility. 2023-04-12 22:07:08 +02:00
Jehan
19b03fcc43 app: make "sensitive" a GimpAction property.
I'm starting to override GtkAction properties, starting with "sensitive" in
order to finally move away from GtkAction. Obviously, this breaks the
sensitivity check of the original menu.
2023-04-12 22:07:08 +02:00
Jehan
ed8a4f7410 app: fix a segfault which may happen randomly.
I could reproduce this while closing GIMP immediately after starting it.
Sometimes the idle source would be running and working on now finalized objects.
2023-04-12 22:07:08 +02:00
Jehan
3119ad4c34 app: toggle and radio item are now correctly synced with their action state.
In particular, when running actions from somewhere else (i.e. the action
search), the menu render is updated.
2023-04-12 22:07:08 +02:00
Jehan
febb9dccd6 app: fix default values of 2 actions.
"windows-show-tabs" and "windows-use-single-window-mode" were set to FALSE by
default, while it is now supposed to be TRUE, same as the config properties. The
discrepancy was only showing with my new GimpMenu which better follows the
action's state.
2023-04-12 22:07:08 +02:00
Jehan
342ad2c37f app, menus: very early prototype for a GimpMenu.
This demonstrates a first version of our replacing menu, using GAction and
GMenuModel. I had to make our own subclass of GtkMenu to process the model (from
a .ui XML file) for the following reasons:

* gtk_menu_new_from_model() doesn't support tooltips, which is a feature we use
  quite extensively in GIMP: with all our filters, being able to give a longer
  description is often useful; moreover we use tooltips to give hints about why
  a menu item is deactivated as well.
  Unfortunately it looks like GTK doesn't consider this lack as a problem and
  don't plan on adding tooltip support.
  See: https://gitlab.gnome.org/GNOME/gtk/-/issues/785
* I won't to avoid copying action's label and icons in the .ui file. This only
  duplicates strings and would be a source of issues each time we change
  action's strings (we'd have to do it in 2 places, which someone will
  inevitably forget).

Now it still has various issues:

* The syncing between actions and menu items need to be cleaned up. It's still
  in early demo code.
* It uses directly some Gtk*Action code because GimpRadioAction and
  GimpToggleAction are not directly related right now (only through their
  parents).
* gtk_application_set_menubar() might still be necessary on macOS as I think
  it's what enables the native menu system on this OS. It means that we'll have
  to edit the menu model to add back the labels (as this function does not
  extract these from the linked action since GAction has no label or icon
  concept).
* Icons are not taken into account right now.
* I'll have to verify if GimpAction with proxy work (but my guess is that right
  now, it won't).
* Action's active state is not synced with menu item active state right now.
* Various actions are inserted live, such as opened images, opened views,
  recently opened images, and so on. This needs to be implemented back.
* Plug-ins need to be able to create their own menu item into this new menu.
* For all these various reasons, I'm keeping the old menu around, for the sake
  of comparison, until the time the new one becomes feature-full.

Part of this commit is inspired by !558 and obsoletes this MR.
2023-04-12 22:07:08 +02:00
Jehan
b6a99077dc app: gimp_action_activate() uses GAction API.
Since GimpAction-s are currently both a GtkAction and a GAction, let's use the
GAction API for activating actions.
2023-04-12 22:07:08 +02:00
Jehan
1b54616492 app: don't make "context" mandatory on a GimpAction.
Simply with a NULL context, we can't set or get accels from a GimpAction. Having
a mandatory context was a problem for GimpColorButton which could create a
GimpAction even though libgimpwidget has no knowledge of GimpContext.
2023-04-12 22:07:08 +02:00
Jehan
a98a903976 app: get rid of gimp_action_(g|s)et_accel_path(). 2023-04-12 22:07:08 +02:00
Jehan
ef645695c2 app: unique accelerator check now happens on the GAction/GtkApplication. 2023-04-12 22:07:08 +02:00
Jehan
3f85fee2e7 app: GimpActionEditor now keeps a Gimp object instead of GimpUIManager. 2023-04-12 22:07:08 +02:00
Jehan
68d862b3c2 app: fully get rid of gimp_action_get_accel_closure().
All the remaining pieces of code where the deprecated concept of accelerator
closure was still used have now been replaced by proper GimpAction API using the
newer GAction API.
2023-04-12 22:07:08 +02:00
Jehan
39315fe6a2 app: GimpActionView uses newer GAction-based API.
It's still not perfect, especially as we might want to get back GimpActionGroup
for this specific dialog (it may be nicer than an overlong list of actions). And
overall, I am not fond of this interface so maybe I'll want to review how we
display and change actions too. Moreover we now have the ability to set several
shortcuts per action, which was a really wanted feature and this dialog doesn't
allow this yet.

I'll get back later at this widget, but for now, it is a step forward for
deprecation.
2023-04-12 22:07:08 +02:00
Jehan
05968c35e5 app: GimpAccelLabel now closure-free.
- New gimp_action_get_display_accels() added to GimpAction API to get directly
  the human-visible strings for actions.
- Also adding an "accels-changed" signal to GimpAction. As far as I can see,
  even though accelerators are now to be set on the GtkApplication, there seems
  to be no signals or properties to connect to at all on this class. So instead,
  let's do it on our GimpAction (which means we must absolutely not use
  gtk_application_set_accels_for_action()).
- GimpAccelLabel now uses the proper GimpAction API instead of accelerator
  closure which is a disappearing concept.
2023-04-12 22:07:08 +02:00
Jehan
9ff9d16367 app: use the GAction shortcut for the toolbox's color area.
In particular, there is no concept of accel closure for actions anymore in
GAction, which means that eventually gimp_action_get_accel_closure() will have
to disappear too.
2023-04-12 22:07:08 +02:00
Jehan
e04d85e0f9 app: get rid of one more deprecated usage of gdk_screen_make_display_name(). 2023-04-12 22:07:08 +02:00
Jehan
fd7ec4df6a app: make sure the "%s-move-to-screen-%s" have valid action names.
Depending on the OS, the display name may contain characters which are not valid
for action names. In particular, on X11, the display name could be ":0.0" and
therefore we get actions named "app.dock-move-to-screen-:0.0" or
"app.view-move-to-screen-:0.0". The ':' is invalid, which will make calling
gtk_application_get_accels_for_action() (or more simply our new function
gimp_action_get_accels()) fail.
See docs of g_action_parse_detailed_name().
The new utils function gimp_make_valid_action_name() will help us get rid of
invalid characters for actions whose name was generated from strings we don't
totally control.

Furthermore gdk_screen_make_display_name() is now deprecated API, and more
generally gdk_display_get_n_screens() is deprecated too and now always returns 1
since GTK+ 3.10 (i.e. now each display only contains a single screen). Instead
we just use gdk_display_get_default_screen() for every GdkDisplay. So this
commit doubles as GTK/GDK deprecation cleanup.
2023-04-12 22:07:08 +02:00
Jehan
9f62bd5822 app: remove useless gimp_core_app_finalize().
If we want to reuse this in subclasses, we'd need to overwrite finalize() in the
subclasses, call gimp_core_app_finalize() and chain up with the parent class.
Not doing this until now was leading us not to call GApplication or
GtkApplication finalize() function, which in turn, in the later case, was
leaking all the GAction-s which were added to the GActionMap. I realized this as
a leaking GimpContext-s warning was printing when ending GIMP.
2023-04-12 22:07:08 +02:00
Jehan
ae7ddfd5f5 app: better label the "windows-display-[0-9]*" actions.
Adding a 'Show" before the image identifier, which is now between quotes, and
making this string localizable.
This makes the action more understandable, especially when listed in
less-contextual UI such as the action search.
2023-04-12 22:07:08 +02:00
Jehan
835d8c3455 app: add gimp_action_set_accels().
It's just a lot nicer to set and get accelerators directly through the
GimpAction. It also makes more sense within GIMP context.
2023-04-12 22:07:08 +02:00
Jehan
726e690d38 app: make the GimpContext a mandatory property for a Gimp*Action.
Making the action be context-awareness will be useful, in particular as we'll
have access to the GtkApplication.
2023-04-12 22:07:08 +02:00
Jehan
c8845c95ec app: move more of GimpActionImpl code into GimpAction. 2023-04-12 22:07:08 +02:00
Jehan
453f5670b3 app: move get|set_disable_reason() implementation from GimpActionImpl to GimpAction.
The obvious reason why it was not implemeted in GimpAction is because as
interface, it cannot have a private struct.
Yet actually we can, by setting the struct as qdata on the object, as we do in
several other interface. This allows to move implementation of functions or
properties for things which make no sense to reimplement each time we implement
a subclass.
2023-04-12 22:07:08 +02:00
Jehan
a4e7bfdf23 app: rename "layers-mask-add-last-values" action as …
… "Add La_yer Masks with Last Values".

Add the "with Last Values", otherwise the shown label is the same as
"layers-mask-add" action, which is confusing (until we read the longer
description/tooltip).
2023-04-12 22:07:08 +02:00
Jehan
147e8c7d91 app: "layers-mask-add-button" should be GUI-blacklisted.
It's basically a conveniency action for internal usage, which is similar to
"layers-mask-add" (except for sensitivity rules). In particular, I don't want to
see 2 seemingly identical actions in the action search.
2023-04-12 22:07:08 +02:00
Jehan
0d2c30d2df app: use GAction API directly in GimpLayerTreeView. 2023-04-12 22:07:07 +02:00
Jehan
3383d160d4 app: GimpToolButton now uses GAction API.
There were 2 pieces of code where I was unsure of the use. I left them
surrounded by `#if 0` macros and a comment for the time being, to easily find
them later if we encounter issues.
2023-04-12 22:07:07 +02:00
Jehan
9b568f960c app: Quit dialog now uses GAction directly.
Note that I could edit the GimpUiManager directly to use the GAction API, but I
feel like it is adding a level of complexity to existing GIO/GTK API. So right
now, I am planning to either get rid of it or really simplifying it a lot.
2023-04-12 22:07:07 +02:00
Jehan
764cbe53f3 app: actions in GimpStatusBar directly calls GAction. 2023-04-12 22:07:07 +02:00
Jehan
385b697a60 app: "gtk-can-change-accels" feature is ignored since GTK+ 3.10.
We had this feature "can-change-accels" where people could change their shortcut
directly by browsing the menu. It was on the property "gtk-can-change-accels" in
GtkSettings. Unfortunately this got deprecated in GTK+ 3.10 (more accurately in
dev version 3.9.8, according to GTK's NEWS file), and is therefore ignored since
then. In other words, whether we check the box or not in our Preferences, it
doesn't do a difference.

If we want to get the feature back some day, we'll have to reimplement it with
custom code. In the meantime, there is no need to leave this visible in
Preferences.
2023-04-12 22:07:07 +02:00
Jehan
4f8357d7f6 app: Action Search does not use GimpUiManager anymore.
It directly uses the action added to the GtkApplication/GActionMap.
2023-04-12 22:07:07 +02:00
Jehan
35b5729bcc app: add all our actions in the GApplication.
Right now, our actions are added both in the GActionMap (a.k.a. as
GApplication|GtkApplication) and with the old GtkActionGroup API. The later code
is meant to be removed soon.

A major difference with the old implementation is that we don't add the actions
in separate action groups. Even though GLib has a GActionGroup concept, these
don't seem to be used at all when adding actions on the GtkApplication level.
It might mean that eventually we will even remove the GimpActionGroup code and
move everything up one level.

Of course, I am still evaluating if we really want an action group concept, in
which case, we could simply recreate it, but I'm actually unsure how useful it
is. The only place where I see a use to this is in the shortcut settings (to
organize actions by groups), but even there, it was rarely useful to me. I
usually rather search for actions by text search anyway.
2023-04-12 22:07:07 +02:00
Jehan
dfcc339e15 app: fix non-properly matching gimp_image_undo_group_start/end() calls. 2023-04-12 22:07:07 +02:00
Jehan
d735ba10ea app: GimpRadioAction and GimpToggleAction are now GAction-s.
Since these were not children of GimpActionImpl, I had to reimplement basically
the same code, which is kinda ugly. When we'll have finally gotten rid of any
dependency to Gtk*Action, these 2 classes should be re-parented under
GimpActionImpl, hence simplifying their code.
2023-04-12 22:07:07 +02:00
Jehan
c65a4e8a5c app: override GAction's activate() virtual method for GimpDoubleAction, …
… GimpStringAction, GimpEnumAction and GimpProcedureAction.

All these are child classes of GimpActionImpl.
2023-04-12 22:07:07 +02:00
Jehan
72b6f9246c app: GimpActionImpl is now also a GAction.
A good chunk of the code is taken from GSimpleAction implementation in GLib.

Thanks to Lukas Oberhuber for his early attempt to implement something similar.
2023-04-12 22:07:07 +02:00
Martin
4b622770a1 Update Slovenian translation 2023-04-12 19:54:53 +00:00
dimspingos
30558d7489 Updated Greek translation 2023-04-12 21:19:10 +03:00
Alx Sa
5112394636 Issue #9340: Make To/From property less ambiguous
Translators noted these might be confused with To/From fields in email.
Revising labels to match load dialogue UIs.
2023-04-11 16:59:45 +00:00
Daniel Novomeský
bcac1107b5 build: update meson options in MSYS2 build 2023-04-11 10:44:18 +02:00
Jacob Boerema
ef7f955e1e pdb, libgimp: improve function documentation for sample points
- gimp_image_add_sample_point: guide is a left-over from copy-pasting and
add apostrophe
- gimp_image_get_sample_point_position: it was not clear that the
parameter was the y-offset and the return value the x-offset
2023-04-09 21:32:00 -04:00
Ekaterine Papava
c3c991c527 Update Georgian translation 2023-04-09 17:55:27 +00:00
Yuri Chornoivan
9ab7d07476 Update Ukrainian translation 2023-04-09 17:20:16 +00:00
Andre Klapper
e71b39df3f Update GIMP Help ID for Drop Shadow filter
109f14cf39
2023-04-09 18:12:32 +02:00
Alx Sa
4828970fa8 plug-ins: Restore original preview when disabled
I noticed after porting the last few plug-ins that GimpPreview went
to black when you unchecked the auto-preview option.
These widgets must be added directly to the dialogue rather than via the
new API in order for the unfiltered image drawable to be loaded
properly. They will eventually be removed in favor of on-canvas preview,
but let's get them working correctly for now.
2023-04-09 12:19:24 +00:00
Alx Sa
37e114612c plug-ins: Port destripe to GimpProcedureDialog. 2023-04-09 11:49:13 +00:00
Martin
f1ef708d63 Update Slovenian translation 2023-04-09 07:35:07 +00:00
Yuri Chornoivan
9bc52d72db Update Ukrainian translation 2023-04-09 06:24:15 +00:00
Ekaterine Papava
32b5afb6c7 Update Georgian translation 2023-04-09 02:27:07 +00:00
Alx Sa
d171355703 plug-ins: Port nl-filter to GimpProcedureDialog 2023-04-09 02:13:46 +00:00
Ekaterine Papava
43b4ec765a Update Georgian translation 2023-04-08 20:01:14 +00:00
Alx Sa
cefb9c92ea plug-ins: Port jigsaw to GimpProcedureDialog 2023-04-08 15:34:29 +00:00
Ekaterine Papava
138aae527a Update Georgian translation 2023-04-08 04:01:27 +00:00
Martin
45e7b3790e Update Slovenian translation 2023-04-07 21:21:43 +00:00
Alx Sa
651bda7728 plug-ins: Port contrast-retinex to...
...GimpProcedureDialog
2023-04-07 16:30:38 +00:00
Hugo Carvalho
c051f70378 Update Portuguese translation 2023-04-07 10:07:31 +00:00
Hugo Carvalho
60700b763c Update Portuguese translation 2023-04-07 10:04:46 +00:00
Alx Sa
c2b1ce5030 plug-ins: Port blinds to GimpProcedureDialog.
Also, update despeckle to close config when cancelled.
2023-04-07 04:06:59 +00:00
Ekaterine Papava
cc437dafec Update Georgian translation 2023-04-07 02:25:02 +00:00
Alx Sa
2368add7e7 plug-ins: Port despeckle widgets to use...
...GimpProcedureDialog APIs.
Adaptive and Recursive checkboxes were converted to a combobox since
they affect one property.
2023-04-07 00:18:51 +00:00
Yuri Chornoivan
e9a5e1eda0 Update Ukrainian translation 2023-04-06 17:34:17 +00:00
Jehan
ddb572bcae libgimp: fix GIR creation warning.
The warning was:

> Warning: GimpUi: gimp_procedure_dialog_fill_scrolled_window: unknown parameter 'contents_id' in documentation comment, should be 'property'
2023-04-06 17:55:23 +02:00
Ekaterine Papava
024aac2ae1 Update Georgian translation 2023-04-06 03:34:49 +00:00
Alx Sa
e6a679f233 plug-ins: Port bmp-save widgets to use...
...GimpDialogProcedure functions rather than gimp_prop_* directly.
Minor typos in the original descriptions were also fixed.
2023-04-05 17:43:23 +00:00
Yuri Chornoivan
7d827d6ec1 Update Ukrainian translation 2023-04-05 17:12:58 +00:00
Jehan
3d70cbd5a8 app: use GIMP_TESTING_ABS_TOP_SRCDIR rather than UI_TEST.
I realize that UI_TEST is only used in our meson scripts and is therefore not a
reliable environment variable to check for whether we are running a unit test or
not. GIMP_TESTING_ABS_TOP_SRCDIR should be present for all unit testing, on both
build systems.
2023-04-05 17:21:52 +02:00
Jehan
1993f7461a meson: API binding options transformed to features.
- Lua, Javascript and Python were boolean defaulting to true, which was
  installing them even when not available (and if not installed then, it
  would show warnings at each run). Instead I make them features with
  'auto' as default. In this default, we don't install when the
  interpreters are absent.
- These 3 options can still be forced by setting them to 'enabled' (the
  interpreters are not actually necessary during build).
- Vala behavior stay the same (and unlike other binding, you cannot
  force it since it has a build step); it's only renamed to just "vala"
  for consistency of option naming.
2023-04-05 16:46:10 +02:00
Jehan
cc6cc6f09a app: do not call inhibit code while unit-testing.
The real problem was not actuall logout-inhibition, but availability of the
GtkApplication. Anyway this feature is not really to block the system while
unit-testing but for saving people's actual work. Let's just disable running it
in test case.

This will fix the CI.
2023-04-05 13:16:43 +02:00
Martin
501be51817 Update Slovenian translation 2023-04-05 09:31:14 +00:00
Martin
3c7e347a0b Update Slovenian translation 2023-04-05 09:29:15 +00:00
Ekaterine Papava
6137751107 Update Georgian translation 2023-04-05 04:34:52 +00:00
Ekaterine Papava
11225f5029 Update Georgian translation 2023-04-05 04:25:49 +00:00
Alx Sa
a148b56779 plug-ins: Port file-aa to GimpSaveProcedureDialog 2023-04-05 02:05:33 +00:00
Jehan
942b78f857 NEWS: update. 2023-04-05 00:03:08 +02:00
Jehan
bce051d2a4 Issue #431: handle logoff, reboot and shutdown events.
GIMP will now inhibit the LOGOUT event on OSes which support it.
2023-04-04 23:29:14 +02:00
Yuri Chornoivan
c71c93bb0f Update Ukrainian translation 2023-04-04 18:42:29 +00:00
Alx Sa
faf2be6dff actions: Standardize usage of "Soft-proofing"
Per #9269, every UI in GIMP but the Softproof Profile wrote it as
"Soft-proof". Now all menu options are consistent.
2023-04-04 17:46:21 +00:00
Martin
d71c18cb4f Update Slovenian translation 2023-04-04 06:25:21 +00:00
Ekaterine Papava
c46d6f7dc4 Update Georgian translation 2023-04-04 00:15:11 +00:00
Jehan
508a6351c9 app: fix a call to gimp_edit_paste() (fixing buffers-paste* action). 2023-04-04 01:56:20 +02:00
Daniel Novomeský
1f4ce4c51f flatpak: install QOI header 2023-04-03 17:38:31 +02:00
Daniel Novomeský
04b97dc97c build: enable QOI format on Windows
and associate in the installer.
2023-04-03 09:45:10 +02:00
Ekaterine Papava
77d3aa1a5b Update Georgian translation 2023-04-03 04:48:09 +00:00
Yuri Chornoivan
784cc1c54b Update Ukrainian translation 2023-04-02 17:44:45 +00:00
Jacob Boerema
2894b2191d plug-ins: fix criticals in scripts with page size == step size
Two of our scripts have a spinbutton step size the same as the page size.
Since page size should be larger than the step size, this causes a
CRITICAL in LibGimpWidgets:
gimp_label_spin_set_increments: assertion 'step < page' failed

We fix this by setting a page size larger than step size in
coffee.scm and tileblur.scm.
2023-04-02 13:09:57 -04:00
Alx Sa
ac9f620c2d plug-ins: Port file-gbr, file-psp to new API.
Ports both to use GimpSaveProcedureDialog.
(Note that file-psp's export function is currently unused)
2023-04-02 12:43:50 +00:00
Martin
7e1ba7a527 Update Slovenian translation 2023-04-02 09:12:34 +00:00
Asier Sarasua Garmendia
91d2d416f1 Update Basque translation 2023-04-02 07:48:01 +00:00
Yuri Chornoivan
514c665dea Update Ukrainian translation 2023-04-02 06:11:28 +00:00
Ekaterine Papava
e77e0c42a0 Update Georgian translation 2023-04-02 03:09:32 +00:00
Alx Sa
4e8c7b8e89 plug-ins: Port file-pnm to GimpSaveProcedureDialog 2023-04-02 02:55:17 +00:00
Alx Sa
01e0941dbc plug-ins: Port file-fli to GimpProcedureDialog API
Also, port the save dialog to use GimpSaveProcedureDialog API.
2023-04-02 01:20:09 +00:00
Yuri Chornoivan
cc9167f76f Update Ukrainian translation 2023-04-01 17:50:59 +00:00
Yuri Chornoivan
56ca88111f Update Ukrainian translation 2023-04-01 17:48:28 +00:00
Alx Sa
06ee7a999a plug-ins: Port sgi.c to GimpSaveProcedureDialog 2023-04-01 17:41:51 +00:00
Alx Sa
66e6d5a727 po-plugins: Add plug-ins/common/file-qoi.c to...
POTFILES.in.
2023-04-01 13:51:42 +00:00
Martin
33559135f2 Update Slovenian translation 2023-04-01 06:57:14 +00:00
Ekaterine Papava
e596b14967 Update Georgian translation 2023-04-01 04:37:35 +00:00
Alx Sa
6ce835b9d7 plug-ins: Port DDS load dialog widgets to use...
GimpProcedureDialog APIs. Also add mnemonics.
2023-04-01 02:03:55 +00:00
Alx Sa
f15b144a81 libgimp: new gimp_procedure_dialog_fill_scrolled_window()
This allows plug-in developers to create GTKScrolledWindow with the
procedure dialog API.
2023-03-31 20:26:53 +00:00
Alx Sa
f9eec671a9 plug-ins: Port JPEG2000 to GimpProcedureConfig
This ports the optional load dialogue to use GimpProcedureConfig.
2023-03-31 14:09:48 +00:00
Martin
da92021df6 Update Slovenian translation 2023-03-31 13:50:38 +00:00
Daniel Novomeský
318148abca plug-ins: fix QOI meson script 2023-03-31 14:15:57 +02:00
Alx Sa
6892ab0530 plug-ins: Add import/export support for QOI file
Allows users to import and export 8 bit, RGB/RGBA Quite Ok Images.
Inspired by Piotr Fusik's work on a plug-in for 2.10.
2023-03-30 18:41:56 +00:00
Asier Sarasua Garmendia
a3053edd42 Update Basque translation 2023-03-30 18:22:00 +00:00
Asier Sarasua Garmendia
62b71c4789 Update Basque translation 2023-03-30 18:07:03 +00:00
Yuri Chornoivan
41d44a1b63 Update Ukrainian translation 2023-03-30 14:16:28 +00:00
Ekaterine Papava
a2b74ef670 Update Georgian translation 2023-03-30 04:23:40 +00:00
Alx Sa
958af23775 plug-ins: Restore mnemonics to file-csource 2023-03-30 04:07:33 +00:00
Yuri Chornoivan
05a3854f8f Update Ukrainian translation 2023-03-30 03:48:59 +00:00
Alx Sa
7f74820b8d plug-ins: Port file-csource to use...
...GimpDialogProcedure functions rather than gimp_prop_* directly.
2023-03-30 02:04:00 +00:00
Tim Sabsch
fa4538683a Update German translation 2023-03-29 09:58:24 +00:00
Martin
b77a64980b Update Slovenian translation 2023-03-28 08:06:38 +00:00
Ekaterine Papava
4e7c6bc922 Update Georgian translation 2023-03-28 05:19:04 +00:00
Hugo Carvalho
4e86f4020f Update Portuguese translation 2023-03-27 22:45:50 +00:00
Yuri Chornoivan
c0f004c356 Update Ukrainian translation 2023-03-27 19:00:20 +00:00
Asier Sarasua Garmendia
23e3621e3a Update Basque translation 2023-03-27 18:12:11 +00:00
Asier Sarasua Garmendia
951312d4b6 Update Basque translation 2023-03-27 18:10:42 +00:00
Asier Sarasua Garmendia
ecf25a6a7d Update Basque translation 2023-03-27 18:07:08 +00:00
Asier Sarasua Garmendia
08b7629ecc Update Basque translation 2023-03-27 18:07:01 +00:00
Asier Sarasua Garmendia
a70e31ffd0 Update Basque translation 2023-03-27 18:05:39 +00:00
Alx Sa
e599a9be59 plug-ins: Add option to override PCX 1 bit palette
If a 1 bit PCX image is opened interactively, a dialogue will let
users choose to either use the built-in palette, or force the colors to
be black/white only. Otherwise, the user can choose this via a script
parameter.
2023-03-27 15:53:05 +00:00
Hugo Carvalho
ce75607dd2 Update Portuguese translation 2023-03-27 15:49:13 +00:00
Ekaterine Papava
8d5636aed2 Update Georgian translation 2023-03-27 04:24:01 +00:00
Anders Jonsson
7c4ad8aed7 plug-ins: typo and spacing fixes 2023-03-26 19:20:48 +00:00
Jacob Boerema
f9217862cf app, tests: fix not running tools tests under meson
The meson build had the tools tests disabled unlike the autotools build.
Since enabling them doesn't cause any problems, let's enable them for
meson too.
2023-03-26 13:26:57 -04:00
Jacob Boerema
a62cad35be app, meson: fix single window test failure
Our CI meson tests for single window failed even though the sessionrc
looked the same as the one created by the autotools tests.

Looking at the Makefile.am it explicitly states that the tests shouldn't
be run in parallel or in a different order than specified, which was not
the case in our meson build.

We change this by setting is_parallel to false for each build, and
setting a different priority for each test. Since higher priority values
execute first we count down.
2023-03-26 13:26:57 -04:00
Jacob Boerema
078cccf4f5 build, meson: fix headless tests not being run with meson
I noticed that in our CI meson job certain tests were skipped, which didn't
happen with autotools.
On examination I noticed these tests check for HAVE_XVFB_RUN. Even though
meson checks for xvfb-run etc, it doesn't set HAVE_XVFB_RUN.

Adding HAVE_XVFB_RUN allows the tests to run without skipping certain parts.
2023-03-26 13:26:57 -04:00
Jehan
1d43b65144 plug-ins: fix authorship.
It looks like my commit 3d55452933 broke authorship of the "file-jp2-load"
procedure. This was very likely a copy-paste error.
2023-03-26 19:19:07 +02:00
Danial Behzadi
4d56ad943c Revert "Update Persian translation"
This reverts commit d3057f2e38
2023-03-26 11:10:26 +00:00
حجت‌اله مداحی
d3057f2e38 Update Persian translation 2023-03-26 11:00:30 +00:00
Martin
fb5a33b538 Update Slovenian translation 2023-03-26 08:53:16 +00:00
Yuri Chornoivan
e826637f5e Update Ukrainian translation 2023-03-26 06:54:31 +00:00
Ekaterine Papava
c0b0c82162 Update Georgian translation 2023-03-26 05:11:47 +00:00
Alx Sa
054934565f plug-ins: Port file-xpm widget to use...
...GimpDialogProcedure functions rather than gimp_prop_* directly.
2023-03-26 02:19:07 +00:00
Alx Sa
dd12d06631 plug-ins: Port file-pat dialog to use...
...GimpDialogProcedure functions rather than gimp_prop_* directly.
2023-03-26 01:56:38 +00:00
Alx Sa
7b5f241591 plug-ins: Add compatibility notice to PSD export
Users have noted that legacy layer modes have better compatibility
when exporting PSDs and reopening them in Photoshop.
This patch adds a notice with that information to the PSD export GUI.
2023-03-25 18:04:42 +00:00
Jacob Boerema
6871a0cfc4 plug-ins: more improvements in file-gif-load
- Use a pre-defined MAXDATABLOCKSIZE for all the buffers filled with
GetDataBlock that is known to be large enough.
- When reading comments ensure that it always ends with a NULL.
- Ensure that the right/bottom frame dimensions are also within range.
2023-03-25 13:37:54 -04:00
Jacob Boerema
d86f6a2d6f plug-ins: improve error messages in file-gif-load
Inspired by issue #9195 I went over how we handled error messages when
loading GIF images.
- I replaced some cases with g_set_error and added an error parameter to
ReadImage.
- Introduced function read_error that uses g_set_error when image == NULL,
or else g_message.
- Enabled translations for the messages.
- Synchronized the error messages used to reduce the amount of work for
translators.
- Changed the error code returned internally in a few places, to be better
able to distinguish between encountering and end_code (-2) and possible
corruption errors (-1).
- Moved allocating dest down to not need freeing it in case of error.
- Allow to show partial results in case of errors.
2023-03-25 13:37:54 -04:00
Yuri Chornoivan
45455428dd Update Ukrainian translation 2023-03-25 16:56:07 +00:00
Ekaterine Papava
0323b798e0 Update Georgian translation 2023-03-25 01:24:07 +00:00
Hugo Carvalho
3607decda7 Update Portuguese translation 2023-03-24 22:58:54 +00:00
Alx Sa
0dc98936a0 plug-ins: Prevent buffer overflow in ANI metadata
The IART and INAM metadata fields were stored in gchar arrays,
which have a limit of G_MAXSHORT indexes.
However, you can have strings larger than that in the format.
To prevent overflows, they were changed to gchar*. f_read ()'s result
is also checked, and an error is set if it returns 0.
The frame count variable is also now reset per icon block to prevent
overflow as well.
2023-03-24 18:43:13 +00:00
Ekaterine Papava
b78b8a80ec Update Georgian translation 2023-03-24 05:21:25 +00:00
Martin
a5865aa61d Update Slovenian translation 2023-03-23 17:37:31 +00:00
Jehan
371925e16b build: sync beta and nightly flatpak manifests.
I'm actually syncing with a branch which I can't test right now because flathub
seem to have some breakage. For the nightly, let's just directly push as anyway
we can't test in Gitlab MRs either because of the non-master jobs timeout.
See: https://github.com/flathub/org.gimp.GIMP/pull/202

We should always keep the diff between these files to a minimum.
2023-03-23 15:44:27 +01:00
Jehan
23a0f22614 build: improve further the flatpak README.
- Fix the markdown styling.
- Add commands on how to build GIMP from the local repository instead of a brand
  new clone (otherwise I don't see how one could develop with flatpak). I knew
  it were possible, but until today, I never tried to do this so I had to test
  first.
2023-03-23 15:12:12 +01:00
Jehan
5e1a7b15da build: remove outdated cron file and update our flatpak howto.
- The cron file was from the very early flatpak experiments before Flathub came
  into the picture, as well as the GNOME Nightly repository. Back then, we
  wanted to set up our own nightlies or release repository through a cron.
- It is still interesting to keep some instructions for local builds of the
  flatpak as some people want to use this for development (but all the part
  about exporting to a repository, signing, etc. is now unneeded for such use
  case). So I'm updating the howto to more current recommendations.
- `flatpak-howto.txt` renamed to `README.md`.
2023-03-23 14:38:08 +01:00
Yuri Chornoivan
747e015381 Update Ukrainian translation 2023-03-23 13:09:29 +00:00
Yuri Chornoivan
5617f9ebd2 Update Ukrainian translation 2023-03-23 13:08:08 +00:00
Alx Sa
e7695c2b57 plug-ins: Port file-tga widgets to use...
...GimpDialogProcedure functions rather than gimp_prop_* directly.
2023-03-23 02:45:55 +00:00
Martin
9573997f45 Update Slovenian translation 2023-03-22 22:07:09 +00:00
Anders Jonsson
d4d9c2bcf5 Update Swedish translation 2023-03-22 21:48:44 +00:00
Daniel Novomeský
2e6e5f0321 plug-ins: Port file-heif to GimpProcedureDialog 2023-03-22 20:05:27 +00:00
Michael Schumacher
61943ca11b gitlab-ci: Use tee to get flatpak job output on stdout and into a log file. 2023-03-22 18:58:44 +00:00
Martin
405d8b765f Update Slovenian translation 2023-03-22 15:14:44 +00:00
Ekaterine Papava
be026d4cba Update Georgian translation 2023-03-22 02:25:06 +00:00
Yuri Chornoivan
d5c523580a Update Ukrainian translation 2023-03-21 19:24:28 +00:00
Alx Sa
cc04035a54 plug-ins: Port file-sunras widgets to use...
...GimpDialogProcedure functions rather than gimp_prop_* directly.
2023-03-21 18:54:15 +00:00
Martin
51a5112793 Update Slovenian translation 2023-03-21 07:25:45 +00:00
Ekaterine Papava
d3560e1eb8 Update Georgian translation 2023-03-21 06:03:15 +00:00
Yuri Chornoivan
ad2aca633f Update Ukrainian translation 2023-03-21 05:26:18 +00:00
Alx Sa
0bc38d9df2 plug-ins: Make WebP preset names translatable
Resolves #9252
2023-03-21 00:48:25 +00:00
Ekaterine Papava
4990ed4f34 Update Georgian translation 2023-03-20 23:54:06 +00:00
Martin
c42038fae8 Update Slovenian translation 2023-03-20 22:00:32 +00:00
Yuri Chornoivan
b3b8f0f840 Update Ukrainian translation 2023-03-20 16:54:17 +00:00
Alx Sa
c034c383c3 plug-ins: Port wavelet decompose in to...
...GimpProcedureConfig.
This ports the main dialogue to use GimpProcedureConfig.
2023-03-20 11:50:25 +00:00
Yuri Chornoivan
728973a9ef Update Ukrainian translation 2023-03-19 06:53:06 +00:00
Martin
91d869c4b7 Update Slovenian translation 2023-03-18 22:49:22 +00:00
Alx Sa
bcce4607c5 plug-ins: Port hot-plug-in to GimpProcedureConfig
This ports the main dialogue to use GimpProcedureConfig.
2023-03-18 19:27:00 +00:00
Hugo Carvalho
50a028ac33 Update Portuguese translation 2023-03-18 09:45:01 +00:00
Martin
ad7a2e53eb Update Slovenian translation 2023-03-17 09:11:57 +00:00
Jehan
6ffdea6a17 LICENSE: add a note about data/ licensing for future added data.
I am adding this note as a consequence of this discussion on Pixls.us:
https://discuss.pixls.us/t/gimp-patterns-and-the-gpl-license/35969

Now we were always very clear that GIMP can be used for whatever use you want
and that the project doesn't intent to claim any rights on produced artworks.

There is even a FAQ entry about the fact we don't intend to put any restriction
on people's work (though this FAQ entry was added in 2015 AFAICS):
https://www.gimp.org/docs/userfaq.html#can-i-use-gimp-commercially

Yet it's better to be as clear as possible. Therefore this new note in the
LICENSE file will serve to make sure any new data is properly licensed CC0 by
the simple fact of contributing it.
This is similar to the fact that people contributing patches to core GIMP (app/)
are implicitly licensing it as GPL. Now people contributing data to data/ are
implicitly licensing it as CC0 as per our LICENSE file.
2023-03-16 23:20:44 +01:00
Ekaterine Papava
ac85f19752 Update Georgian translation 2023-03-16 20:39:56 +00:00
Yuri Chornoivan
4766f2c81a Update Ukrainian translation 2023-03-16 17:47:21 +00:00
Alx Sa
bbccf2656a plug-ins: Port align-layers to GimpProcedureConfig
This ports the main dialogue to use GimpProcedureConfig.
It also adds the GUI-only options to the procedure itself, so that you
can call them via scripts.

Additionally, the layer warning was fixed and 
mnemonics were added to the
property titles.
2023-03-16 00:15:14 -04:00
Alx Sa
0ce773da76 plug-ins: Fix potential crash in PSD CMYK export
@Wormnest notified me of issues with CMYK profiles overwriting existing
ones, and potentially access a dereferenced profile.
This patch adds an additional condition check, and clears out the
profile in addition to dereferencing it.
2023-03-15 00:30:11 +00:00
Balázs Úr
e7f5263b9c Update Hungarian translation 2023-03-15 00:22:49 +00:00
Balázs Úr
ea2b0a3818 Update Hungarian translation 2023-03-15 00:03:40 +00:00
Balázs Meskó
26e917e93b Update Hungarian translation 2023-03-14 23:43:38 +00:00
dimspingos
418e747853 Update Greek translation 2023-03-14 22:54:06 +02:00
Jacob Boerema
ecbcc4c4a4 build: fix ci failure due to partial missing bg in windows installer
Bulgarian was added to the installer po files and LINGUAS, but the other
files needing updates were forgotten. Let's fix that.
2023-03-14 14:17:19 -04:00
Alx Sa
6d02eb4505 plug-ins: Recognize https:// in ImageMap plug-in
This adds "https://" as a valid website prefix in the ImageMap URL edit
field, in addition to http://.
It also restores the prefix change that 2.10 had when you switched URL
types. It also fixes code formatting in affected areas.
2023-03-11 21:53:12 +00:00
Michael Schumacher
d7216f5e49 gitlab-ci: Add xvfb to win32 and win64 image, because we now attempt to run wine there. 2023-03-11 19:48:47 +01:00
Balázs Úr
e3f150b241 Update Hungarian translation 2023-03-10 23:45:51 +00:00
Alx Sa
66271e1e56 actions: Disable Arbitrary Rotation menus if...
...no image is active.
There are Arbitrary Rotation options under both the Image and Layer
menus. All of those rotation options are disabled without an image open.
To keep consistency, this disables those menu options as well.
The Tools menu Rotation option is left as-is.
2023-03-07 20:45:48 +00:00
Hugo Carvalho
9d73413c3d Update Portuguese translation 2023-03-07 19:15:52 +00:00
Piotr Drąg
9e9367c412 Update Polish translation 2023-03-05 13:51:17 +01:00
Martin
e8a9f1cc45 Update Slovenian translation 2023-03-05 10:43:28 +00:00
Yuri Chornoivan
787a3d3dff Update Ukrainian translation 2023-03-05 07:48:42 +00:00
Anders Jonsson
949c6d43c3 plugins: Remove extra word, spacing 2023-03-04 07:13:52 +01:00
Yuri Chornoivan
3b77af9264 Update Ukrainian translation 2023-03-03 14:50:15 +00:00
Martin
9448842b79 Update Slovenian translation 2023-03-03 08:32:26 +00:00
Ekaterine Papava
97f5e74215 Update Georgian translation 2023-03-03 05:33:28 +00:00
lapaz
9908a06896 app: Increase width of position/size boxes ...
... in rectangle select tool. This allows boxes to display larger
values up to 7 characters.

Resolves: #9034 (GNOME/GIMP tracker)
2023-03-03 09:57:14 +06:00
Alx Sa
1d45fc0808 plug-ins: Show unsupported PSD features in GUI
Adds a new PSDSupport struct to keep track of what unsupported features
a PSD contains.
It is then used to conditionally display a compatibility notice
via a GUI.
2023-03-03 02:34:32 +00:00
Sveinn í Felli
2c533abe9f Update Icelandic translation 2023-03-01 11:35:14 +00:00
Sveinn í Felli
4804d69fdb Update Icelandic translation 2023-03-01 10:17:54 +00:00
Jordi Mas
32a92f76fd Update Catalan translation 2023-02-28 22:19:20 +01:00
Sveinn í Felli
ad073dedda Update Icelandic translation 2023-02-28 18:43:44 +00:00
Sveinn í Felli
82826f2a30 Update Icelandic translation 2023-02-28 18:33:04 +00:00
Alx Sa
dbaea2ac50 core: Fix CSS palette import regex
GIMP expects CSS palettes to end with a ";" when importing. However,
GIMP exports CSS lines without ";". This means GIMP can't reopen its
own exported CSS palettes.
The ";" was removed from the regex since CSS2 does not require
the last line to end with a ";". However, CSS3 and above
require ending all lines with a ";", so it is added to the
export script.
2023-02-28 16:00:03 +00:00
Sveinn í Felli
340edf4f1e Update Icelandic translation 2023-02-28 14:08:56 +00:00
Sveinn í Felli
f852b8e572 Update Icelandic translation 2023-02-28 13:18:35 +00:00
Alexander Shopov
1f46063e52 Add Bulgarian translation 2023-02-27 21:49:42 +00:00
Alexander Shopov
c25bcf4ca4 Add Bulgarian translation 2023-02-27 21:47:27 +00:00
Daniel Novomeský
359ce849bc Fix flatpak release info about JPEG XL
(cherry picked from commit d8566241a0)
2023-02-27 01:47:17 +01:00
Tim Sabsch
1fd4b270e2 Update German translation 2023-02-25 21:16:30 +00:00
Michael Schumacher
c689c41841 gitlab-ci: Install dependencies for ASCII art and PostScript plug-ins. 2023-02-25 11:09:22 +01:00
Michael Schumacher
39f4029bfc gitlab-ci: python3-zstandard is a Debian package. pip3 requires a venv to install packages now. 2023-02-25 10:47:50 +01:00
Michael Schumacher
1f3a2475fc gitlab-ci: gi-docgen is a Debian package, installing it through pip3 seems to fail on some runners 2023-02-25 10:37:55 +01:00
Tim Sabsch
24ecaf3f34 Update German translation 2023-02-24 21:37:39 +00:00
Alx Sa
3df39dee91 plug-ins: Re-add toggle behavior from GAction port
When porting IFS-Compose and GFig to GAction, I originally created
all icons as GtkToolButtons. However, the toggle buttons no longer 
appeared "pressed in" when selected.

This is fixed by creating those as GtkToggleToolButtons instead.
A lingering UIManager object was removed from IFS Compose as well.
2023-02-24 03:25:08 +00:00
Jehan
2167ff98fb desktop: update AppStream metadata release date.
(cherry picked from commit c4efe45cab)
2023-02-22 14:04:15 +01:00
Jehan
9c15a2055f desktop: new <release> tag for GIMP 2.10.34.
See #9136.

(cherry picked from commit 0cd38a87e1)

Note: when cherry-picking, the tags were fixed as the main dev branch does not
need the underlined tags for localization anymore.
2023-02-22 14:04:08 +01:00
Jehan
220f0948f7 libgimp: (meson) disable GIR building when a sanitizer is set.
Similar to the change in autotools, a few commits before.
2023-02-22 13:42:59 +01:00
Jehan
87bda8879b libgimp: fix leak.
Discovered by running with sanitize=address.
2023-02-22 13:28:07 +01:00
Jehan
ee92210dde app: fix an unused variable warning. 2023-02-22 12:46:56 +01:00
Jehan
36cc6c6e8a configure, libgimp: disable introspection when building libgimp with sanitizer.
The initial issue was that 3 leaks were detected when running the "DumpCompiler"
during g-ir-scanner phase. The failing command was apparently about running some
temp binary, which looks like would be called the DumpCompiler in g-ir-scanner
code:

> libgimp/tmp-introspectn8jg64to/Gimp-3.0 --introspect-dump=libgimp/tmp-introspectn8jg64to/functions.txt,libgimp/tmp-introspectn8jg64to/dump.xml

My first fix attempt was to try and play with build/link FLAGS so that this temp
binary is built without sanitizer. But the problem when I did this was that
libgimp itself is sanitized, so we are mixing a sanitized lib with a
non-sanitized binary:

> ASan runtime does not come first in initial library list; you should either link runtime to your application or manually preload it with LD_PRELOAD.

So it looks like I could still solve this with tweaking LD_PRELOAD, cf. this
sanitizer FAQ: https://github.com/google/sanitizers/wiki/AddressSanitizer#faq

Nevertheless it proved complex to do it right while not interfering with other
parts of the build and I found out that I risk encountering more issues down the
road with GIR + sanitizer:
https://gitlab.gnome.org/GNOME/gobject-introspection/-/issues/375

So I've decided that I didn't want to waste too much time on this and simply
disable introspection when sanitizing, as I guess what we care the most to
diagnose when sanitizing is core code anyway.
2023-02-22 12:23:26 +01:00
Jehan
0b75fbd91c tools: do not sanitize build tools. It's OK if they leak a bit.
Especially as our code does not actually leak as far as we can see. It looks
like librsvg might not play well with -fsanitize=address (possibly having real
leaks or false positives).
2023-02-22 10:57:36 +01:00
dimspingos
e0f070a649 Update Greek translation 2023-02-22 10:01:06 +02:00
Alexander Shopov
2616df0921 Update Bulgarian translation 2023-02-21 10:27:03 +00:00
dimspingos
07516e2c4d Update Greek translation 2023-02-21 12:21:53 +02:00
dimspingos
0d14b0bca7 Update Greek translation 2023-02-20 13:06:35 +02:00
Jehan
577d803bd4 app: don't draw the drop zone, just nothing when converting.
(cherry picked from commit 6adf574513)
2023-02-19 18:54:46 +01:00
Jehan
aab73ae3a4 app: fix a crash when converting to higher precision.
gimp_display_shell_render() writes to a GeglBuffer backed by allocated memory
(shell->profile_data). Unfortunately while converting prevision in
gimp_image_convert_precision(), we change the "precision" property (hence the
source format) first, hence end up trying to write data in a too small buffer.
This crash was hard to find as it was not showing up on my machine (though it
did produce rendering artifacts!), unless I built both GIMP and babl with
`b_sanitize=address`.

Note that an alternate fix was to make sure that the profile_data buffer is big
enough (by calling gimp_display_shell_profile_update() before rendering), but
anyway the image is in an inconsistent state while conversion is in progress:
whereas the `src_format` is the new one, the `src_profile` is still the old one
(and cannot be changed before we finish converting).

Moreover the render happen regularly on progress signals, once after each
converted drawable. So each of these rendering step happens in an inconsistent
state, with the wrong profile set, some of the drawables converted and others
not yet.
We could still render properly if each drawable's buffer used space-aware format
(thus allowing different drawables to use different profiles/spaces), but it
feels over-engineering the problem. It might be much better to ignore rendering
steps while converting the image precision. Moreover it would obviously make a
faster conversion.

See discussions in #9136 for this crash, which didn't have dedicated report
AFAIK.

(cherry picked from commit de25be9210)

Note: on the `master` branch, even with sanitized code, I don't get the crash.
Yet this change seems relevant enough that I'm adding it.
2023-02-19 18:46:31 +01:00
Jacob Boerema
ba9ceae7d7 Revert "Upload New File"
This reverts commit 2023e4c6ca.
2023-02-18 18:40:42 -05:00
dimspingos
9f2942fec9 Updated Greek translation 2023-02-18 21:12:47 +02:00
Dimitris Spingos
2023e4c6ca Upload New File 2023-02-18 13:14:10 +00:00
Piotr Drąg
34f8a20e5f Update Polish translation 2023-02-18 11:50:27 +01:00
Alexander Shopov
adde450fb7 Update Bulgarian translation 2023-02-18 07:47:21 +00:00
Martin
641679cd31 Update Slovenian translation 2023-02-17 20:13:50 +00:00
Ekaterine Papava
4acaca633a Update Georgian translation 2023-02-17 05:02:37 +00:00
Jehan
d5f845e35a Issue #9147: freeze when switching from multi-window to single window mode.
Don't keep bindings to still existing objects. We were ending up in some ugly
infinite looping.

(cherry picked from commit bddcd5c268)
2023-02-16 22:26:17 +01:00
Jehan
18c21abf0c libgimp: fix a memory leak.
Discovered while playing with b_sanitize=address flag.
2023-02-16 20:59:33 +01:00
Jehan
7f29543895 app: fix global-buffer-overflow in "gimp:dissolve" implementation.
In case of negative y in the region to process, we were accessing invalid memory
(negative array index).

I hesitated between make so that a given ordinate always use the same index or
if we just want the start ordinate (whatever it is) to use index 0. The later
could have just been `(y - result->y) % RANDOM_TABLE_SIZE`.

I just decided to keep the existing logic (former case) though to be fair, not
sure it matters much.

(cherry picked from commit a86560bb57)
2023-02-16 20:31:41 +01:00
Jehan
31672ee340 tools: avoid build-only tool with memory issues. to break the whole build.
Cf. the previous commit: colorsvg2png has a memory leak in librsvg (so we can't
fix it easily). In any case, it's just a one-time-use tool, we don't really need
to focus on its memory bugs as long as it does its job to make icons.
2023-02-16 20:07:41 +01:00
Jehan
8e32da9889 tools: better memory handling in colorsvg2png.
Actually even with this, b_sanitize=address still detects a memory leak. After
some testing, it seems that just creating a RsvgHandle, then freeing it
immediately is enough to leak some data, which means the leak is in librsvg.
2023-02-16 20:07:41 +01:00
Hugo Carvalho
1d5a6a4829 Update Portuguese translation 2023-02-16 18:36:54 +00:00
Yuri Chornoivan
4a2a000924 Update Ukrainian translation 2023-02-16 14:06:56 +00:00
Alx Sa
5102355ac9 plug-ins: Port ImageMap to GAction/GMenuModel
Additionally, the ImageMap-specific icons weren't showing up due to the
filenames not matching the references strings ("imap-polygon" but
the filename was "imagemap-polygon.png"). This patch fixes that by
renaming the strings to match file name.
Partial code style fixes were made as well; a lot more are needed.
2023-02-16 04:16:11 +00:00
Martin
8b204d50ff Update Slovenian translation 2023-02-15 22:09:18 +00:00
Jehan
6a2908ed0b Issue #9151: link to the "Building GIMP" page of dev website in INSTALL. 2023-02-15 12:13:24 +01:00
Sabri Ünal
e9270d3d1f Update Turkish translation 2023-02-14 21:25:50 +00:00
Sabri Ünal
2f9d431271 Update Turkish translation 2023-02-14 21:22:04 +00:00
Sabri Ünal
5306c475d3 Update Turkish translation 2023-02-14 21:19:40 +00:00
Jacob Boerema
5ef77e6e8e plug-ins: disable magics detection for Windows CUR and ICO files
The magics used for detection for CUR and ICO are not very unique and
interfere with the detection of certain types of TGA images.
Since these TGA images are regularly used, it seems better to only base
CUR and ICO detection on the extension, just as we do with TGA version 1
files.

See also issue #7912
2023-02-14 15:16:15 -05:00
Jacob Boerema
5f9415a641 plug-ins: fix #9067 TGA files saved by Krita can't be opened
Krita had a bug where it incorrectly saved 4 for the alpha bits instead of
8. We will allow 4 and convert that to 8 to be able to read the incorrect
TGA images.

The likelyhood of real TGA images with 4 alphabits seems pretty low, so it
should not interfere with real images that have this set. We were not
supporting that anyway.
2023-02-14 15:16:15 -05:00
Alan Mortensen
375e91cb9d Update Danish translation 2023-02-14 20:02:01 +00:00
Yuri Chornoivan
6a8db1dd21 Update Ukrainian translation 2023-02-14 18:08:34 +00:00
Hugo Carvalho
7321061588 Update Portuguese translation 2023-02-14 16:56:22 +00:00
Ekaterine Papava
7afb2b15e4 Update Georgian translation 2023-02-14 16:47:42 +00:00
Jehan
1b780cd8e0 app, libgimp, pdb: minor fixes.
- fix a typo s/Commponent/Component/.
- Add &std_pdb_compat() to the new PDB procedures (I realize that's probably
  what the contributor was asking about, back in !446). Not sure if it's right
  as there were none in this file, but these are clearly just wrappers around
  GEGL ops, so it seems fitting.
- Some alignment fixes.
- More accurate "$since" variables.

(cherry picked from commit 66ef1ef1ef)
2023-02-14 17:18:38 +01:00
Jehan
c6972eabde pdb: meson-pdbgen.sh should return the return value of pdbgen.pl.
Otherwise even when the main script fails, hence generation of source files does
not end up correctly, the build continues (and likely fails later).
2023-02-14 15:36:19 +01:00
Ian Martins
acdf5a3776 pdb: add a PDB procedure for extract-component
(cherry picked from commit dbf9f277a2)

Committer's (Jehan) updates:

- Component type is now int32 (int8 is not a PDB type available anymore).
- PDB files re-generated to handle changes in API and types.
2023-02-14 15:36:19 +01:00
Stanislav Grinkov
d1eb30d863 themes: Set smaller Compact theme separator width...
for better consistency with the overall theme.
2023-02-14 16:50:38 +06:00
Stanislav Grinkov
bbbbc671eb themes: Increase dockable panel separator width...
to make panel resizing action more accessible.
2023-02-14 16:50:38 +06:00
Stanislav Grinkov
49cbe651a6 themes: Add three-dot handle to paned separators ...
to improve their accessibility to Default, Gray,
and Compact themes.

Resolves: #9144
2023-02-14 16:50:32 +06:00
Hugo Carvalho
25d6c51bf5 Update Portuguese translation 2023-02-14 10:49:38 +00:00
Martin
e19143cffb Update Slovenian translation 2023-02-14 00:16:07 +00:00
Jehan
473f0b49ef app: better handle bogus file names.
When a plug-in enters a bogus file name such as "Untitled.xcd" as URI,
g_file_is_native() returns FALSE. So when saving such file, core code tries to
mount a remote volume and fails (of course), without even opening the file
dialog.

This change is an attempt to detect such cases beforehand and not even try to
save it (just open the file dialog directly; the file name is still useful as
default proposed file name, as this part is actually valid).
Actually remote files will have a valid URI anyway (something with a valid
scheme, such as https:// or whatever other scheme).

As side fix, I am adding a missing space to the error which I got.
2023-02-13 22:57:09 +01:00
Jehan
4f1d0fb53b plug-ins: get rid of various gimp_image_set_file() calls.
- This is unneeded in all import procedures. See previous commit. Note though
  that this is not because of a change in previous commit. This was already
  useless previously. The file set with this PDB function was overridden by the
  core anyway (i.e. even before the previous commits).
  In app/file/file-import.c:file_import_image(), the imported file is correctly
  set (so there is no need to set it from plug-in, which anyway libgimp's
  gimp_image_set_file() was not doing) and the XCF file is reset to NULL
  (rendering the call to gimp_image_set_file() in a GimpLoadProcedure useless).
- Similarly, this is a useless call in export procedures because
  app/file/file-save.c:file_save() overrides such call too. I could only see one
  such case for JPEG export, which was quite useless.
- Finally in other types of plug-ins, setting a non-XCF file extension was
  interfering with the save feature (similarly to commit e6e73e14c7). I only
  fixed the screenshot implementations doing such a thing.
- I left a few usages which will have to be looked at more in details later.
2023-02-13 22:54:16 +01:00
Jehan
fc2925def0 app, libgimp, pdb: gimp_image_set_file() only works for XCF files.
This is not made to set the imported or exported file, but only the XCF file.
See previous commit to see what happens when this API is used to set non-XCF
file extensions (saving fails unless one edits the filename).
2023-02-13 22:54:01 +01:00
Jehan
e6e73e14c7 Issue #8581: forward-porting file-name fix from gimp-2-10 branch.
This is a port of commit 57ee6e13ab to the main dev branch.
2023-02-13 22:54:01 +01:00
Daniel Novomeský
dc8121729d flatpak: upgrade libjxl, highway, libde265 2023-02-13 17:59:14 +00:00
Ekaterine Papava
3381ad0a7f Update Georgian translation 2023-02-13 17:22:57 +00:00
Yuri Chornoivan
4929b505f7 Update Ukrainian translation 2023-02-13 15:33:22 +00:00
Jehan
b9a6799082 app, libgimp, pdb: fixing generated code and wrong GEGL op arguments.
This commit is a fixup commit for MR !790 which had a few issues:

- The args for shadows and highlights adjustments are "shadows-ccorrect" and
  "highlights-ccorrect" respectively.
- Also fixing generated code.

(cherry picked from commit e456ab019b)
2023-02-13 14:28:00 +01:00
Ian Martins
e238ea07ca pdb: add a PDB procedure for shadows-highlights
(cherry picked from commit 0b96363e10)

Reviewer's (Jehan) note: the generated source files were re-generated and
amended in this commit.
2023-02-13 14:26:04 +01:00
Jehan
851ddad2ee plug-ins: add back the prompt when "clearing" the Python console.
This code is taken from Massimo's comment in #1786 and MR !834. It doesn't fix
a crash as this was already handled in !404, yet the missing prompt after
hitting "clear" was clearly not consistent with how one expect a clear feature
to work.

At least now, we've got a prompt back immediately after clearing.
2023-02-13 13:17:30 +01:00
Piotr Drąg
d19a397cf8 Update Polish translation 2023-02-12 13:17:44 +01:00
Martin
f76c3fd630 Update Slovenian translation 2023-02-12 10:09:20 +00:00
Martin
f65fa3e4e7 Update Slovenian translation 2023-02-12 10:04:13 +00:00
Hugo Carvalho
30cc8fe5be Update Portuguese translation 2023-02-11 22:18:55 +00:00
Hugo Carvalho
40949d5368 Update Portuguese translation 2023-02-11 22:15:45 +00:00
Yuri Chornoivan
3b3f4df1fe Update Ukrainian translation 2023-02-11 16:24:35 +00:00
Ekaterine Papava
3da1f5969a Update Georgian translation 2023-02-11 04:46:55 +00:00
Jehan
c369827725 plug-ins: load PDF without filling the background to white.
Some PDF have transparency on purpose. Filling with white, without any question,
is counter-productive and prevents from working on such PDF files.

Note that we could add an option with a checkbox, leaving one to decide whether
to fill the background or not. But it feels over-engineering the issue. The PDF
is transparent, so that's what we load, and that's it. If one wants to add a
background, it's easy to add a layer at the bottom of the stack (and they can
make it any color they want, not just white), after loading the file.
2023-02-10 19:51:45 +01:00
Alx Sa
8b2262530b plug-ins: Make PDF background color fill optional
This adds a checkbox to single and multi-page PDF export to not fill
transparency with the background color 
(which currently happens automatically)
2023-02-10 18:35:14 +00:00
Jehan
fb1f16d4b8 plug-ins: fix a crash in tiff_io_error().
I had a TIFF file which would crash while triggering an error, inside g_logv()
code (and according to the stacktrace, even probably inside some lower level
printf implementation code).

The reason was that I already processed the variable list with
g_strdup_vprintf() and printf didn't like this va_list being reused, then
segfaulted with some "Cannot access memory at address" error.

The alternate fix was to first copy the va_list in the first use with
va_copy()/G_VA_COPY, yet since we already processed the format data, I thought
it was useless to do this. Let's just directly use the formatted string.
2023-02-10 19:28:19 +01:00
Ekaterine Papava
2dfe70e16f Update Georgian translation 2023-02-10 10:07:41 +00:00
Jehan
f77f772f56 Issue #8359: GIMP crashes from "open the font selection dialog" button.
Apparently GDK/Win32 sends the "grab-broken-event" signal before the "clicked"
signal. This has only been changed since GTK4 so far.

Anyway the bottom line is that GimpContainerPopup would process a handled on
"clicked", using the object destroyed when "grab-broken-event" happened as
callback data. The solution is to make sure that the object stays alive long
enough. So I'm changing gimp_editor_add_button() to connect to signals with
g_signal_connect_object() (since all usage of this function was used with
GObject callback data, it was not a problem).

See discussion in !815.

As a side change, gimp_container_popup_dialog_clicked() should emit the
"cancel", not "confirm". This part was taken from MR !815 by Lloyd Konneker.
2023-02-09 22:22:56 +00:00
Yuri Chornoivan
9328c9c03c Update Ukrainian translation 2023-02-09 21:14:11 +00:00
Stanislav Grinkov
9b517fbf7d [app] Ensure calculated histogram spike height ...
is positive or zero. Sometimes the calculated `y` or `bg_y`
values are negative because the histogram value was divided
by zero (when max == 0.0).

Resolves: #9132 (Gnome/GIMP bug tracker)
2023-02-10 00:45:47 +06:00
Jehan
8bd3d5e0bb Issue %8365: Ambiguous naming of "Lock path strokes". 2023-02-09 15:11:49 +01:00
Jehan
b71abffe51 NEWS: update.
Some items are removed because they were backported in upcoming 2.10.34 before
we released GIMP 2.99.16.
2023-02-09 14:44:36 +01:00
Hugo Carvalho
297f0679a3 Update Portuguese translation 2023-02-08 11:28:43 +00:00
Martin
fd0c906ef4 Update Slovenian translation 2023-02-07 16:39:14 +00:00
kotvkvante
708af26890 fix typo 2023-02-06 15:24:27 +00:00
Ekaterine Papava
8259e166b2 Update Georgian translation 2023-02-06 15:18:44 +00:00
Yuri Chornoivan
ead5512d6b Update Ukrainian translation 2023-02-06 09:39:54 +00:00
Alx Sa
38c031e01d plug-ins: Port GFig to GAction/GMenuModel
Because of how many actions can change the sensitivity of "undo" options
most of the plug-in files had to be edited to pass GimpGfig to them.
2023-02-04 23:16:24 -05:00
Rodrigo Lledó
e6382e9262 Update Spanish translation 2023-02-04 03:36:05 +00:00
Rodrigo Lledó
a4b6f00a77 Update Spanish translation 2023-02-04 03:21:29 +00:00
Martin
0a8c8c2649 Update Slovenian translation 2023-02-02 22:20:02 +00:00
Alx Sa
0628db1506 plug-ins: Fix possible crash on ifs-compose load
The build variable in GimpIfs struct is now initialized to NULL to
prevent build issues when finalized.
2023-02-02 14:27:34 -05:00
Sabri Ünal
e9f8d00c82 Update Turkish translation 2023-02-02 12:49:40 +00:00
Sabri Ünal
76c817f2fb Update Turkish translation 2023-02-02 12:31:42 +00:00
Sabri Ünal
c72c2e5716 Update Turkish translation 2023-02-02 12:29:35 +00:00
Sabri Ünal
1497d4d5d8 Update Turkish translation 2023-02-02 12:28:22 +00:00
Yuri Chornoivan
c2cd943021 Update Ukrainian translation 2023-02-02 09:04:08 +00:00
Ekaterine Papava
b13eff27da Update Georgian translation 2023-02-02 05:36:39 +00:00
Alx Sa
78d2e8819b plug-ins: Port IFS Fractal GUI to GAction
Converts the pop-up menu and toolbar. Also replaces deprecated
gtk_arrow_new () with similar GtkImage of an arrow.
2023-02-01 20:26:53 +00:00
Martin
4312240eb9 Update Slovenian translation 2023-02-01 20:17:56 +00:00
Yuri Chornoivan
a04dcc49ea Update Ukrainian translation 2023-02-01 18:46:37 +00:00
Hugo Carvalho
30e9cb9f7c Update Portuguese translation 2023-02-01 16:45:58 +00:00
Ekaterine Papava
28401c2bef Update Georgian translation 2023-02-01 16:12:15 +00:00
Alexander Shopov
857dad6301 Update Bulgarian translation 2023-02-01 14:42:51 +00:00
Alx Sa
c7bef41a1e plug-ins: Add export support for PAM files
Exports the following PAM formats: 
GRAYSCALE, GRAYSCALE_ALPHA, RGB, RGB_ALPHA.
As with import, the main difference is the header and transparency.
Raw PPM export code is reused for the actual data.
2023-01-29 22:09:05 -05:00
Alx Sa
af904ec55d plug-ins: Add import support for PAM files
PAM files are essentially PPM files with a different header format and
alpha/16 bit support.
Jörg Walter's 2.2 code was updated and implemented to read the revised
header format. The existing PPM loading code works with PAM files.
2023-01-29 18:01:48 +00:00
Jehan
3e53b28f7a libgimp: include the header from the implementation file.
It was failing with the autotools build.
Why did this even compile with our meson build?
2023-01-29 18:01:53 +01:00
Jehan
a0e95f6f35 plug-ins: G_APPLICATION_DEFAULT_FLAGS exists since GLib 2.74.
Our current minimum requirement is 2.70.0.
2023-01-29 15:02:11 +01:00
Alx Sa
a4f2b06547 plug-ins: Remove GIMP_PROC_ARG_UCHAR parameters
Replaces them with GIMP_PROC_ARG_INT, which will be necessary for a
future INDEXED mode with greater than 256 colors.
2023-01-28 16:19:50 +00:00
Alx Sa
5ac2027285 plug-ins: Port colormap-remap to GAction
Modeled after the animation-play port in 691e0c02
2023-01-28 10:17:33 -05:00
Yuri Chornoivan
5ca0541ce7 Update Ukrainian translation 2023-01-27 15:12:23 +00:00
Yuri Chornoivan
83cdcffa11 Update Ukrainian translation 2023-01-27 14:45:57 +00:00
Yuri Chornoivan
41ab0fe2ab Update Ukrainian translation 2023-01-27 14:42:51 +00:00
Yuri Chornoivan
e3ee010be1 Update Ukrainian translation 2023-01-27 14:40:18 +00:00
Jehan
c1aa1b7b3d plug-ins: fix freeing NULL object.
When the plug-in is queried initially for plug-in setup, then freed, the builder
object is not created.
2023-01-27 14:18:20 +01:00
Alx Sa
f6b4adafa3 build: Port fileicon.ico from gimp-2-10
This .ico contains additional 24x24, 64x64, 128x128, and 256x256 sizes
for clearer icons on different resolutions and displays.
2023-01-27 04:41:10 +00:00
Jehan
bd94175c9a plug-ins: coding-style fixes.
While studying this code as base for the previous commit, I noticed various
coding style issues.
2023-01-27 01:48:33 +01:00
Jehan
691e0c0272 plug-in: port animation-play to GAction.
Largely inspired by commit dddb23c6. This also gave me a good overview of the
various missing features in GAction (compared to GtkAction) and how we'll have
to implement this in GIMP core. I now have a very clear path of what remains to
be done.
2023-01-27 01:48:33 +01:00
Martin
2a20f32cf5 Update Slovenian translation 2023-01-26 17:59:13 +00:00
Martin
eba0e36182 Update Slovenian translation 2023-01-26 17:57:13 +00:00
Jehan
114d0f35df devel-docs: move debug-plug-ins.txt to gimp-web-devel.
Now in the "Resource development" section of the developer website under
resource/debug-plug-ins/.
2023-01-26 17:08:56 +01:00
Jehan
9716768bb1 devel-docs: debugging-tips.md also moved to gimp-web-devel repo. 2023-01-26 16:43:34 +01:00
Jehan
0036b190e1 devel-docs: performance-logs documentation now moved to gimp-web-devel. 2023-01-26 16:37:22 +01:00
Jehan
4f45ddc17e libgimp: rename gimppropchooser.* to gimppropchooser-private.* and…
… don't include it from public gimpui.h.

As reviewed during !786, if this file is private, the name should show it
clearly. And of course, we must not include it from another public header, since
it won't be installed.

This also fixes building plug-ins with gimptool as reported by tmanni:
e00f2d7f50 (note_1650791)
2023-01-26 15:46:12 +01:00
Hugo Carvalho
27dac96f83 Update Portuguese translation 2023-01-25 12:14:53 +00:00
Hugo Carvalho
cb45d4d5cc Update Portuguese translation 2023-01-25 12:10:24 +00:00
Hugo Carvalho
427e6d9947 Update Portuguese translation 2023-01-25 12:03:47 +00:00
Hugo Carvalho
35098c9dec Update Portuguese translation 2023-01-25 12:02:18 +00:00
Ekaterine Papava
f614e47cad Update Georgian translation 2023-01-25 06:49:07 +00:00
Jehan
95a87cb6ac po-script-fu: remove predator.scm from POTFILES.in. 2023-01-24 22:29:51 +01:00
Jehan
f7579eabbb libgimp: set_i18n() method of GimpPlugIn expects UTF-8 catalog directory.
Nothing was really clearly specified until now, which was kinda equivalent to
the string being in the OS encoding as used by GLib. Since this string will
usually be statically hardcoded in code (and not extracted from system), it's
just much easier to request UTF-8 for this specific case.
2023-01-24 20:06:38 +01:00
Jehan
f5d2c5369c libgimpbase: fix annotations.
As per the changes in commit 005b3a05b8 and discussions in !800,
gimp_locale_directory() returns a string in the OS encoding for all but Windows
(UTF-8), i.e. the "filename" type in GIR annotations.
2023-01-24 19:59:40 +01:00
Jehan
9642034a02 NEWS: update. 2023-01-24 19:53:13 +01:00
Jehan
6fb882ac5a Issue #5440: removed broken "Predator" script.
It relied on the now non-existing max-rgb plug-in, which was removed in commit
dd89f4a3d5. After some thoughts and discussions, the Predator script is fun, but
clearly not a mandatorily "needed" one here, which is why — instead of
re-integrating max-rgb —, I have decided to also remove Predator.

Both these script/plug-in are not totally dead. They were moved to the
gimp-data-extras repository and even ported to GIMP 3.0 API. They can be an
interesting use case for a fun extension to be installable through our future
extension platform. To be continued.
2023-01-24 19:22:26 +01:00
Jehan
19cb236955 Issue #8073: Crop can also be an extend.
Rename "Crop to Selection" to "Resize Layers to Selection" since it's not
necessarily a crop. The layer dimension can also grow now.

Also specifying "Layers" because action titles can also be displayed
off-context, such as in the action search, so we must be more detailed with our
action titles. Similarly adding a "Layers" to "Crop to Content".
2023-01-24 18:54:29 +01:00
Jehan
9c641050e0 app: cut with a selection works similarly as a copy followed by a clear. 2023-01-24 18:46:41 +01:00
Jehan
29dff58a2f build: more meson setup syntax update. 2023-01-24 17:48:29 +01:00
Luca Bacci
e360cef004 screenshot-win32-magnification-api.h: Fix coding style 2023-01-24 14:48:44 +00:00
Luca Bacci
005b3a05b8 Make use of the gimp_bind_text_domain () util function 2023-01-24 14:48:44 +00:00
Luca Bacci
cbcb9181d0 Add gimp_bind_text_domain () utility function
On UNIX it's just a stub calling bindtextdomain () directly;
on Windows it converts the path to UTF-16 and calls wbindtextdomain ().
2023-01-24 14:48:44 +00:00
Luca Bacci
48c27770b6 Use unicode-aware color management API
* GetMonitorInfoW
* EnumDisplayDevicesW
* GetStandardColorSpaceProfileW
* GetColorDirectoryW
2023-01-24 14:48:44 +00:00
Luca Bacci
cfaaec6347 Use ExcHndlSetLogFileNameW ()
This is a Dr.MinGW function
2023-01-24 14:48:44 +00:00
Luca Bacci
11801cf402 Use SetWindowsHookExW () 2023-01-24 14:48:44 +00:00
Luca Bacci
08142062a7 Use GetModuleFileNameExW () 2023-01-24 14:48:44 +00:00
Luca Bacci
54b3e3956e Use SHGetKnownFolderPath instead of the deprecated SHGetSpecialFolderLocation 2023-01-24 14:48:44 +00:00
Luca Bacci
689201e827 Use OpenFileMappingW () 2023-01-24 14:48:44 +00:00
Luca Bacci
2db0bf1909 Use MessageBoxW () 2023-01-24 14:48:44 +00:00
Luca Bacci
7b9e9ef7b6 Use CreateFileMappingW () 2023-01-24 14:48:44 +00:00
Luca Bacci
3f0ddcb885 Use GetBinaryTypeW () 2023-01-24 14:48:44 +00:00
Luca Bacci
1e24240f5d Use GetLocaleInfoW () 2023-01-24 14:48:44 +00:00
Luca Bacci
abe7c53cf5 Use GetStartupInfoW () 2023-01-24 14:48:44 +00:00
Luca Bacci
db570de3b2 Use SetDllDirectoryW ()
No need to use GetProcAddress (), SetDllDirectory () is available
since XP SP1
2023-01-24 14:48:44 +00:00
Luca Bacci
ed1e4236ba Use GetModuleHandleW ()
Also fix an unwanted ref-count increment on a module HANDLE
2023-01-24 14:48:44 +00:00
Luca Bacci
f7be0cf68e Use LoadLibraryW () 2023-01-24 14:48:44 +00:00
Luca Bacci
c98ffb7e0e Replace uses of plain fopen () with GLib's g_fopen ()
On Windows fopen () is limited to the current codepage,
GLib's g_fopen () instead accepts full UTF-8 by calling
_wfopen () internally (or a similar wide-char CRT routine).
2023-01-24 14:48:44 +00:00
Luca Bacci
afe9625bdb Simpler way to get the module HANDLE 2023-01-24 14:48:44 +00:00
Luca Bacci
0657b85202 Use GLib to convert between UTF-8 and UTF-16 2023-01-24 14:48:44 +00:00
Jehan
48c1d07600 meson: fix cross-building GIMP.
We don't want to fail the build configuration just because we can't test for
runtime dependencies. In such a case, just assume it's good as we at least have
libheif and we can compile.
Fixes:

> ../meson.build:756:2: ERROR: Can not run test applications in this cross environment.
2023-01-24 15:44:50 +01:00
Jehan
4699d9e2ac build, gitlab-ci: using non-ambiguous meson setup syntax.
Fixes:

> WARNING: Running the setup command as `meson [options]` instead of `meson setup [options]` is ambiguous and deprecated.
2023-01-24 15:35:30 +01:00
Jehan
ba5c423331 Issue #8924: Paste as new image uses the full canvas instead of just…
… the copied selection.
2023-01-24 12:51:30 +01:00
Jehan
2e30a92c0a Issue #8524: add or change some missing or duplicate mnemonics. 2023-01-23 23:38:51 +01:00
Jehan
2aa325a55e libgimpwidgets: new gimp_spin_scale_get_mnemonic_keyval() function.
This solves part of #8524, for properties displaying as spin scale, which have a
mnemonic, yet our code was not able to tell so.
2023-01-23 23:28:15 +01:00
Jehan
e4ace369c1 meson: list both AVIF and HEIC mimetype support if the plug-in is built.
Even though, some format support might be missing, since codecs can be added at
runtime, it can always change later without having to touch GIMP. Yet we won't
be able to edit the desktop file when this happens.

See new comments in #9080.
2023-01-23 19:38:19 +01:00
Jehan
706cff2037 meson: VALA language is only needed for the build target.
Without this change, meson outputs this warning:

> meson.build:868: WARNING: add_languages is missing native:, assuming languages are wanted for both host and build
2023-01-23 19:19:10 +01:00
Rodrigo Lledó
e4dae320bc Update Spanish translation 2023-01-23 18:14:12 +00:00
Rodrigo Lledó
3229a68e8a Update Spanish translation 2023-01-23 18:08:56 +00:00
Jehan
7b0064107e Issue #9080: Checking for available libheif codecs at compile-time.
From libheif >= 1.14.0, the pkg-config variable will become bogus and always
return 'yes' so we now need to check for codec avaibility at compile time the
same way we look for these at runtime.

It may seem irrelevant to do these checks since these codecs can be added
anytime later, but it's still very good information for packagers to immediately
see that we have runtime package missing.
2023-01-23 19:01:38 +01:00
Jehan
704c868ca1 meson: add a 'name' arg to the IPC_RMID compile/run test.
It makes for easier to read logs and build files. Also fixing a typo in the
original text from autotools.
2023-01-23 18:33:12 +01:00
Jehan
decdb2ba3f meson: Improve C99 compatibility of IPC_RMID check.
See previous commit and !810. Porting the autotools fix we made there to the
meson build too.
2023-01-23 18:13:18 +01:00
Florian Weimer
99531e73e9 configure.ac: Improve C99 compatibility of IPC_RMID check
Do not call the undeclared exit function.  Implicit function
declarations are likely not going to be supported by future compilers
by default, changing the outcome of this configure probe with
such compilers.
2023-01-23 16:07:59 +00:00
Martin
e7c9b9d073 Update Slovenian translation 2023-01-22 17:30:49 +00:00
Martin
41f838db8b Update Slovenian translation 2023-01-22 17:27:50 +00:00
Ekaterine Papava
4b6ff68094 Update Georgian translation 2023-01-21 15:56:08 +00:00
Ekaterine Papava
6df84c25f1 Update Georgian translation 2023-01-21 15:53:46 +00:00
Jordi Mas
8b2edc0ff8 Update Catalan translation 2023-01-21 09:05:02 +01:00
Rodrigo Lledó
c2318f6664 Update Spanish translation 2023-01-20 18:06:46 +00:00
Rodrigo Lledó
37fc28c9f3 Update Spanish translation 2023-01-20 18:01:20 +00:00
Rodrigo Lledó
4a5aefe5bf Update Spanish translation 2023-01-20 17:53:10 +00:00
Rodrigo Lledó
4a846d11e5 Update Spanish translation 2023-01-20 17:47:22 +00:00
Daniel Novomeský
3533606a13 gitlab-ci: fix win64-nightly
ca-certificates are no longer present in gimp-prefix/ssl
but in gimp-prefix/etc/ssl
2023-01-20 14:39:13 +01:00
Daniel Novomeský
12b1890980 flatpak: upgrade exiv2, libheif, libjxl 2023-01-20 12:49:16 +01:00
Alexander Shopov
f9281dd8f9 Update Bulgarian translation 2023-01-15 14:40:27 +00:00
Alx Sa
d087c1a84e plug-ins: Port Save as CSS GUI from 2.10
This plug-in has a partial GUI (a FileChooser dialog is launched).
However, you could only save the active gradient rather than choosing
any of them like the 2.10 version of this plug-in.
This patch ports the original UI so you can choose both the gradient
and file in interactive mode.
2023-01-14 21:14:45 +00:00
Alx Sa
506b324112 plug-ins: Show GUI for Palette to Gradient
Also shows GUI for Palette to Repeating Gradient function
2023-01-14 21:14:45 +00:00
Jacob Boerema
9ac2178e6e app: update gimphelp-ids.h
Removed several help ids that are not in use anymore.
Fixed spelling of one help id, the spelling has also been fixed in
gimp-help.
2023-01-14 16:02:03 -05:00
Jehan
c9b1ce8fa9 plug-ins: make test-dialog runnable even with no image.
It's a test plug-in which doesn't actually need an image to work, so it's
annoying that it currently requires one (making testing more cumbersome).

Also cleaning up a bit the coding style.
2023-01-14 20:17:57 +01:00
Jehan
f99bdcd008 plug-ins: use generated widget for GimpPalette arg.
Also make the start checks a bit more robust to broken core code by
double-checking that the palette is valid from the start, even though getting an
invalid palette should normally not happen anymore (at least I fixed one such
case with a palette with a NULL id in my previous commit; but it looks like our
core code is not perfectly robust and we should push the code to extensive
testing).

Note that the generated widget is currently ugly (no label and terrible UX), but
this is meant to improve soon.
2023-01-14 19:27:08 +01:00
Jehan
e8365e81e2 libgimp: fix getting invalid resource the first call with a NULL arg.
When the core sends a NULL resource, which would be the default for object args,
hence is also what you get for the first call of a plug-in with a resource
parameter, libgimp was creating a GimpResource with NULL id, which is invalid.
It is much better to return NULL (since we made it so that NULL is a valid
value) and let the plug-in handle the NULL value as it sees fit for a given
parameter (they could just set the contextual resource for this type, or keep
NULL to mean "no resource selected").

This fixes failing to run plug-ins the first time (before any "last" values are
set). E.g. I had the issue when testing palette-sort.

Also I'm improving the error message when trying to use a non-installed resource
(it will now also print the resource ID and the error message). And the GError
was leaking in this case, so I properly free it now.
2023-01-14 19:10:42 +01:00
Jehan
24b955bf17 app, libgimp, pdb: various coding-style fixing and struct for final types…
… moved to the implementation file.

When declaring with G_DECLARE_FINAL_TYPE(), the whole concept is that the struct
is made private (which also allows the type to evolve without breaking ABI if we
some day decide to make the class derivable). For this to make sense, the struct
goes in the implementation file, not the header.

For the rest, it's mostly alignment bugs and the like.
2023-01-14 18:44:31 +01:00
Jehan
eae386fbff devel-docs: write dependency name with the namespace casing.
It is apparently how dependency names are supposed to be spelled to be taken
into account. The previous commits fixed some, but missed 2. I'm not sure they
will actually end up in the right-side list of the docs (it looks like when a
dependency is not actually found in the API, it isn't listed there), though it's
at least always listed in the left side, as I can see it.
And while I would prefer the upstream "display" name (i.e. GEGL and babl instead
of Gegl and Babl), better be consistent in how we list these dependencies in the
libgimp and libgimpui docs.

See discussion in !811.
2023-01-14 17:56:32 +01:00
Corey Berla
a0e94250eb docs: Fix dependency names
Dependency names need to match the namespace name exactly (including
capitalization) otherwise they won't be shown as dependencies.
2023-01-14 16:50:18 +00:00
lloyd konneker
e00f2d7f50 Fix plugins to use new GimpResource. 2023-01-14 17:43:26 +01:00
Jehan
54db045f45 libimp: declaration must be at start of a block.
Fixes:

> libgimp/gimpresourceselectbutton.c:510:9: error: a label can only be part of a statement and a declaration is not a statement
> 510 |         GimpResource *specific_value;

As well as some coding style bug (space after '*').
2023-01-14 16:38:40 +00:00
Jehan
d5f4cabfcc libgimp: do not define a class struct when G_DECLARE_FINAL_TYPE is used.
This fixes the VAPI build. I am actually astonished the lib build seem to have
passed and that we didn't get double definition clashes.

The build error was:

[750/2424] Generating libgimp/gimp-ui-3.0.vapi with a custom command
FAILED: libgimp/gimp-ui-3.0.vapi
/usr/bin/vapigen --quiet --library=gimp-ui-3.0 --directory=/builds/GNOME/gimp/_build/libgimp --pkg=babl-0.1 --pkg=cairo-1.0 --pkg=gdk-pixbuf-2.0 --pkg=gegl-0.4 --pkg=gio-2.0 --pkg=glib-2.0 --pkg=gobject-2.0 --pkg=gtk+-3.0 --vapidir=/builds/GNOME/gimp/_build/libgimp --girdir=/builds/GNOME/gimp/_build/libgimp --pkg=gimp-3.0 --metadatadir=/builds/GNOME/gimp/libgimp /builds/GNOME/gimp/_build/libgimp/GimpUi-3.0.gir
GimpUi-3.0.gir:22111.7-22111.33: warning: Virtual method `GimpUi.ResourceSelectButton.draw_interior' conflicts with method of the same name
GimpUi-3.0.gir:26688.73-26688.73: error: The type name `ResourceSelectButtonClass' could not be found
GimpUi-3.0.gir:26695.73-26695.73: error: The type name `ResourceSelectButtonClass' could not be found
GimpUi-3.0.gir:26704.73-26704.73: error: The type name `ResourceSelectButtonClass' could not be found
GimpUi-3.0.gir:26712.73-26712.73: error: The type name `ResourceSelectButtonClass' could not be found
GimpUi-3.0.gir:26720.73-26720.73: error: The type name `ResourceSelectButtonClass' could not be found
2023-01-14 16:38:40 +00:00
lloyd konneker
d59a7af38c libgimp: API refactor GUI for GimpResource
Simplifies chooser widgets (e.g. GimpBrushSelect) by eliminating attributes (e.g. opacity) of chosen resource.
See #8745, but this commit fixes that by first refactoring the code.

Refactors GUI widgets (e.g. GimpBrushSelectButton and GimpBrushSelect etc.)

Refactor by "Extract class" GimpResourceSelectButton from GimpBrushSelectButton etc.
This moves common code into an inherited class (formerly called GimpSelectButton)
but the subclasses still exist.
The subclasses mainly just do drawing now.

Refactor by "Extract module" GimpResourceSelect from GimpBrushSelect etc.
Moves common code into one file, generic at runtime on type of GimpResource,
that is, the new code dispatches on type i.e. switch statements.
In the future, when core is changed some of that can be deleted.
The files gimpbrushselect.[c,h] etc. are deleted.
The module adapts the API from core to the API of callbacks to libgimp.

Note that core is running the resource chooser (select) widgets remotely.
Core is still calling back over the wire via PDB with more attributes
than necessary.
The new design gets the attributes from the resource themselves,
instead of receiving them from core callback.
The libgimp side adapts by discarding unneeded attributes.
In the future, core (running choosers for plugins) can be simplified also.

Fix gimp_prop_chooser_brush_new same as other resources.

Finish changes, and clean style.

Annotations
2023-01-14 16:38:40 +00:00
Ekaterine Papava
8d5f470507 Add Georgian translation 2023-01-14 14:38:58 +00:00
Ekaterine Papava
2c1a168790 Update Georgian translation 2023-01-14 14:35:34 +00:00
Ekaterine Papava
446db3b382 Update Georgian translation 2023-01-14 14:33:01 +00:00
lloyd konneker
d720375e97 2.99 libgimp: add GimpResource, GimpBrush, GimpPropWidgetBrush
So procedures can declare args and GimpProcedureDialog show chooser
widgets

Fix so is no error dialog on id_is_valid for resources

Palette.pdb changes and testing

Memory mgt changes

Gradient pdb

Font and Pattern tests

Test  brush, palette

Cleanup, remove generator

Rebase, edit docs, install test-dialog.py

Whitespace, and fix failed distcheck

Fix some clang-format, fix fail distcheck

Fix distcheck

Cleanup from review Jehan
2023-01-14 12:58:05 +00:00
Martin
60fa18137d Update Slovenian translation 2023-01-13 23:01:37 +00:00
Martin
5b39bca3cd Update Slovenian translation 2023-01-13 22:56:00 +00:00
Martin
8fe4c103b7 Update Slovenian translation 2023-01-13 22:54:35 +00:00
Martin
d30667f5fe Update Slovenian translation 2023-01-13 22:53:25 +00:00
Yuri Chornoivan
ee2846ffd8 Update Ukrainian translation 2023-01-13 15:06:26 +00:00
Yuri Chornoivan
6360634435 Update Ukrainian translation 2023-01-13 15:04:45 +00:00
Yuri Chornoivan
3256cf16cb Update Ukrainian translation 2023-01-13 14:57:42 +00:00
Yuri Chornoivan
a73b9f235e Update Ukrainian translation 2023-01-13 14:56:21 +00:00
Jehan
68cd873481 app: add a comment to complete !808.
It is better to add a comment rather than simply disabling these 2 calls without
explanation on macOS. This way, developers who'll look at this code in the
future will immediately know what's the reason and status for the "unicity"
concept of GIMP process on macOS. Basically there are 3 features:

- Opening files from another software (such as "open with" in file browsers)
  which is handled differently in macOS and apparently works fine. It looks like
  it works by handling system signals, connected from gui_unique_quartz_init().
- Opening files by running a new GIMP process which would pipe the filenames
  into an existing GIMP process before immediately exiting.
- Running batch process in an existing GIMP process, also by running a short-run
  GIMP process.

The last 2 features are simply now officially disabled in macOS because dbus is
not installed by default and seem like it may cause issues when it is.

See discussions in !808 and #8997.
2023-01-12 18:55:22 +01:00
Lukas Oberhuber
9102e47637 macos: do not call dbus for uniqueness
DBus can cause instability on the MacOS platform, and regardless
MacOS handles application uniqueness already.

The batch version has also been modified as it only applies if
compiled as an application, since it returns FALSE if it is complied
as a console app.
2023-01-12 17:15:48 +00:00
Hugo Carvalho
a9ee41eff0 Update Portuguese translation 2023-01-12 14:31:13 +00:00
Hugo Carvalho
5242cd46db Update Portuguese translation 2023-01-12 14:19:53 +00:00
Hugo Carvalho
2b85fdd439 Update Portuguese translation 2023-01-12 14:16:16 +00:00
Hugo Carvalho
0a0fc105c0 Update Portuguese translation 2023-01-12 14:11:43 +00:00
programmer_ceds
62e2716b21 Expand from Centre Issue (Fixes issue #7954) 2023-01-11 21:29:19 +00:00
Alx Sa
8dcc397498 plug-ins: Show Palette Sort GUI
Recreates GUI so this plug-in matches the
2.10 version.
2023-01-11 16:13:17 +00:00
Alan Mortensen
9117740c13 Update Danish translation 2023-01-11 14:57:24 +00:00
Jehan
71605b092c app: remove definitions of gimp_image_[gs]et_active_(layer|channel|vectors).
These are not used anymore anywhere in our codebase! I'm sure some issues still
exist in various places, yet we can now consider that the multi-item awareness
project is finally over! Wouhou! 🥳

One big question which remains is whether I want to get back to the old naming
of "active" items, rather than "selected" items. The main reason to change the
wording globally was to be able to easily find remnants of non-multi-item aware
code. Now that it's all gone, I could very simply revert to the old naming.

This is in particular a big question for the public API for plug-ins, as the
"active" wording has been used for decades litterally. The only difference now
with how it used to be is that we could have several active items at once.
2023-01-11 02:18:32 +01:00
Jehan
06413174ee app: fix forgotten fill_dialog_new() and stroke_dialog_new() usage.
They need to take a list of items now.
2023-01-11 02:13:41 +01:00
Jehan
9ec7c155a6 app: make Stroke Paths actions multi-paths aware.
These were also the last usages of the macro return_if_no_vectors.
2023-01-11 01:56:29 +01:00
Jehan
a1fc57b325 app: vectors-fill-last-values now also multi-paths aware. 2023-01-11 01:39:29 +01:00
Jehan
d96c13de2b app: "Fill Paths" action, multi-paths aware. 2023-01-11 01:31:10 +01:00
Jehan
bc8590b40a app: several paths action made multi-items aware.
- Duplicate and Delete Paths are now both callable on several paths at once.
- Path Edit and Edit Attributes can only be run with exactly one path selected.
- Merge Visible Paths obviously always worked with more than one path.
2023-01-11 00:33:51 +01:00
Jehan
ca8f4ef0d3 app: remove last usages of return_if_no_layer macro.
- "Discard Text Information" work on all selected text layers.
- "Text to Path" creates as many paths as there are selected text layers.
- "Text along Path" still only works with exactly 1 text layer and 1 path
  selected.
2023-01-10 23:13:49 +01:00
Jehan
563744934a app: layers edit actions are only meant to work on single layers. 2023-01-10 20:12:15 +01:00
Jehan
35ef93be03 app: remove last usage of return_if_no_channel macro.
The channel attribute edit action only works with a single channel at once.
2023-01-10 20:07:44 +01:00
Jehan
897d7ef168 app: channels and path to selection actions multi-item aware. 2023-01-10 20:07:44 +01:00
Jehan
545b794b72 app: setting color tags actions now multi-item aware. 2023-01-10 20:07:44 +01:00
Jehan
036ba77415 app: actions for lock position of items multi-item aware. 2023-01-10 20:07:44 +01:00
Jehan
a602ea7662 app: lock contents of items multi-item aware. 2023-01-10 20:07:44 +01:00
Jehan
7c7c62a1df app: Toggle Layers/Channels/Vectors visibility action multi-item aware. 2023-01-10 20:07:44 +01:00
Jehan
955dd922a7 libgimpwidgets: new gimp_int_store_new_array().
Because the variable argument list variants of the function won't work in
binding. This makes creating GimpIntStore easy.
2023-01-10 17:48:05 +01:00
Jehan
f76f3dfe76 Issue #8982: Select all -> Copy -> paste inserts an empty layer.
This is because gimp_drawable_edit_clear() would also clear the full drawable in
the special case when there is no selection at all. So as we were inverting the
"all" selection, we were ending up in this special-case.
2023-01-10 03:13:51 +01:00
Jehan
c3869fc0e1 NEWS: update. 2023-01-10 01:58:09 +01:00
Alx Sa
3d54665a94 libgimpconfig: Retain color scale preferences
RGB 0..255/0..100 and LCh/HSV settings are now remembered when closing
and reopening GIMP.
A few enums were explicitly cast to GimpColorSelectorChannel to clear
some compiler warnings.
2023-01-10 00:20:22 +00:00
programmer-ceds
0c89be5f06 Smudge problem on offset layers (fixes #8999) 2023-01-09 22:37:37 +00:00
programmer-ceds
8a066f0430 Strokes on offset layers are offset - fixes issue #8767 2023-01-09 20:57:26 +00:00
Jehan
064ec53964 app: fix bug added in commit 036510d191.
This second GIMP_IS_ITEM() test was obviously for the iter2->data item. This
fixes handling cases when aligning/distributing a mix of GimpItem-s and guides.
2023-01-09 19:14:44 +01:00
Alan Mortensen
e0913586fd Update Danish translation 2023-01-09 18:07:02 +00:00
Jehan
b35e11da0b app: also apply "use extents of layer contents" to alignment reference.
I'm not sure if there are a lot of cases where we might want to use the layer
extents for items to align while using the contents extents for the reference
(or the other way around). It looks to me you either want one of the other for
all the items in the most common case.

So for now, let's apply this option to both the items to align and the reference
item. We'll see if anyone wants a separate option some day and has a good use
case to submit for this.
2023-01-09 18:22:08 +01:00
Jehan
036510d191 app: when arranging an item and an ancestor item, drop the descendant.
Trying to arranging both doesn't make sense and only end up in weird result. If
both the parent (layer group) and one or several child items are selected, just
arrange the parent.
2023-01-09 18:22:08 +01:00
Alx Sa
74b32f7c86 build: Add support for OpenMP dependency
Enables general support for OpenMP.
Currently, only the DDS plug-in utilizes it.
2023-01-09 16:41:06 +00:00
Alx Sa
11495ea4fd tools: Don't auto-activate when image changes
This changes the auto-activate behavior for transform and
GEGL tools so it does not apply when the image is changed.
2023-01-09 15:28:37 +00:00
Alx Sa
a41ba956e6 tools: Auto-activate GEGL operation tool on click
This extends the work done in !778 to open the GEGL operation dialogue
automatically when selected from the menu, rather than requiring the
user to click on the canvas first.
2023-01-09 15:28:37 +00:00
Stanislav Grinkov
fa9f4e6825 app, build: depend on GLib 2.70
Commit 52d17439 introduced use of g_thread_pool_new_full which is
available only since GLib 2.70
2023-01-09 14:20:21 +00:00
Lukas Oberhuber
15c34716cf gimphelplocale: MacOS can get http and https
(cherry picked from commit cad9feed71)
2023-01-08 23:55:22 +00:00
Rodrigo Lledó
b54ca06579 Update Spanish translation 2023-01-08 23:36:57 +00:00
Rodrigo Lledó
09aa6e1440 Update Spanish translation 2023-01-08 23:00:49 +00:00
Rodrigo Lledó
d1d2506d3f Update Spanish translation 2023-01-07 23:44:12 +00:00
Hugo Carvalho
48ee6db7bd Update Portuguese translation 2023-01-06 21:42:36 +00:00
Hugo Carvalho
a5f2987e78 Update Portuguese translation 2023-01-06 21:37:16 +00:00
Jehan
6378f3af8d gitlab-ci: using the 'posix_local' installation scheme for Python.
Python 3.10 introduced sysconfig.get_default_scheme() and somehow Debian decided
it was a good idea to move from the 'posix_prefix' to the 'posix_local' scheme.
See: https://lists.debian.org/debian-python/2022/03/msg00039.html

The main issue with this scheme is that it adds a local/ subdirectory to the set
--prefix. As a consequence, with --prefix=~/.local/, scripts are installed in
~/.local/local/bin/ (instead of proper ~/.local/bin/), data are now in
~/.local/local/share/ and so on.
As expected, this broke a lot of CIs for a lot of projects, as well as a lot of
custom scripts, usage of Python in virtualenv (this later case seems like it is
fixed by special-casing it in Python 3.11), flatpak, etc.

Setting DEB_PYTHON_INSTALL_LAYOUT environment variable to "deb" solves this by
changing the default scheme.

This URL is also useful to understand the issue:
https://askubuntu.com/questions/1406304/virtualenv-installs-envs-into-local-bin-instead-of-bin

As a side note, Debian is not the only one which made the mistake. Fedora also
did the same thing (and they have also their own different environment variable
to handle this): https://bugzilla.redhat.com/show_bug.cgi?id=2026979
2023-01-06 18:47:52 +01:00
Martin
106ef0affd Update Slovenian translation 2023-01-06 07:46:02 +00:00
Alexander Shopov
fe8fe422c5 Update Bulgarian translation 2023-01-04 21:18:43 +00:00
Martin
f4778804ac Update Slovenian translation 2023-01-04 16:44:29 +00:00
Martin
52d85621bb Update Slovenian translation 2023-01-04 16:38:45 +00:00
Alan Mortensen
0549185c10 Update Danish translation 2023-01-03 15:13:40 +00:00
Alan Mortensen
f75592140e Update Danish translation 2023-01-03 15:12:48 +00:00
Alan Mortensen
db8416398a Update Danish translation 2023-01-03 15:11:40 +00:00
Alan Mortensen
874d239bc1 Update Danish translation 2023-01-03 15:11:05 +00:00
Alan Mortensen
52ffdf4e4d Update Danish translation 2023-01-03 15:10:39 +00:00
valadaptive
ea28ac0bbd app: Fix "Handle Transform" handle snap location
(cherry picked from commit d6d2e56c00)
2023-01-03 15:59:55 +01:00
Zurab Kargareteli
7f46c04e66 Update Georgian translation 2023-01-03 00:47:46 +00:00
Yuri Chornoivan
307afe349d Update Ukrainian translation 2023-01-02 18:56:23 +00:00
Yuri Chornoivan
7ad5635946 Update Ukrainian translation 2023-01-02 18:50:52 +00:00
Luming Zh
99f6566534 Update Chinese (China) translation 2023-01-01 20:39:00 +00:00
Chao-Hsiung Liao
dc20b1d123 Update Chinese (Taiwan) translation
(cherry picked from commit ec5c48005e)
2022-12-31 00:01:10 +00:00
Chao-Hsiung Liao
16275b5a36 Update Chinese (Taiwan) translation
(cherry picked from commit a1f24a414a)
2022-12-30 23:59:35 +00:00
Chao-Hsiung Liao
a4cbb0f407 Update Chinese (Taiwan) translation 2022-12-30 23:57:47 +00:00
Chao-Hsiung Liao
602e6110b9 Update Chinese (Taiwan) translation 2022-12-30 23:51:57 +00:00
Alx Sa
fc202818dd plug-ins: Add support for PSD clipping paths
Adds import and export support for clipping paths in PSD files.
On import, path name and flatness value are saved in parasites.
Prior settings are loaded in the GUI on export.
2022-12-30 16:33:37 +00:00
Alx Sa
ec60d376a5 plug-ins: Create struct for PSD save options
Allows more save options to be added without changing
the method signatures.
2022-12-30 16:33:37 +00:00
Sabri Ünal
5d9f214cb8 app: Make a comment reachable
gettext cannot reach otherwise.
2022-12-30 12:43:41 +00:00
Richard Szibele
f470691e06 ScriptFu: Add byte support.
Add a new type 'byte' to be able to handle binary data while still
retaining the utf8 char and string behavior.

Internally the file and string port and character handling have
been reworked to use the new byte-centric functions.

Also adds a new test script (test9) that tests byte, char and
utf8 string handling.
2022-12-27 16:48:13 +00:00
Jehan
b62ae798d1 libgimp: libgimp does not depend on GTK+.
Only libgimpui depends on GTK+, display servers and other GUI-related
dependencies. There was a problematic include added in commit 0b56aa0d13 for
macOS, but the needed code (testing the macro GDK_WINDOWING_QUARTZ to use some
[NSApp activateIgnoringOtherApps:YES] API) doesn't seem to be present anymore in
there, so I think that removing this include (replace by including GLib for
other calls) should work fine. Of course, we'll know it when the separate CI
will test a macOS build as we still don't have in-Gitlab macOS jobs. :-/
2022-12-26 22:29:52 +01:00
Jehan
c6bc4fbe38 tools: add a --runtime option to flatpak-releases script.
This will allow to also check the list of runtime builds. We could see an
example in a report (#8993) where someone had the latest flatpak build of GIMP
but an older build of the runtime flatpak. So they had a bug because of a
dependency which got updated since then.
2022-12-26 18:53:51 +01:00
Jehan
9347c9d5fd tools: add the flatpak commit info to flatpak-releases script output.
This is useful when wanting to check someone is using the last flatpak build in
a bug report.
2022-12-26 18:18:54 +01:00
Ekaterine Papava
26ff19a89d Update Georgian translation 2022-12-23 22:59:05 +00:00
Jacob Boerema
8372220345 app: use pre-defined help id GIMP_HELP_COLORSELECTOR_PALETTE
Instead of using the string directly. This ensures that possible updates
in the string don't go unnoticed in gimp-help.
2022-12-23 13:01:11 -05:00
Jacob Boerema
469dfdcf11 app: update available help ids for gimp-help
Add several missing help ids, remove those that are not used anymore,
and update "gimp-colorselector-water" to "gimp-colorselector-watercolor".

Also add a comment why some help ids are not used directly.
2022-12-23 12:56:47 -05:00
Jehan
5d30089d71 gitlab-ci: fix the CI build.
In the last few days, our deps-win64 job started to fail with:
> $ update-alternatives --set x86_64-w64-mingw32-g++ /usr/bin/x86_64-w64-mingw32-g++-posix
> update-alternatives: error: no alternatives for x86_64-w64-mingw32-g++

The reason lies in this change in Debian testing 10 days ago:

----
gcc-mingw-w64 (25) unstable; urgency=medium

  * Upgrade to GCC 12. Closes: #1023679. It is no longer possible to tweak
    the installation directory for different thread models, so the -posix
    and -win32 packages are no longer co-installable.
  * Drop “Built-Using” from “Architecture: all” packages.
  * Since the POSIX and Win32 packages are no longer co-installable,
    drop support for alternatives and use symlinks to provide the full
    set of command names.
  * Standards-Version 4.6.1, no change required.

 -- Stephen Kitt <skitt@debian.org>  Mon, 12 Dec 2022 09:00:34 +0100
----

So from now on, we'll only install the posix variant of the cross-compiler.
Hopefully it will work for all packages we build.
2022-12-23 18:28:36 +01:00
Jordi Mas
d08a63d610 Update Catalan translation 2022-12-21 17:28:33 +01:00
Jordi Mas
cea954b42c Update Catalan translation 2022-12-18 20:31:41 +01:00
Kristjan SCHMIDT
798ef480de Update Esperanto translation 2022-12-18 11:14:07 +00:00
Kristjan SCHMIDT
641379886a Update Esperanto translation
(cherry picked from commit 8ef0a8701d)
2022-12-18 11:05:23 +00:00
Jordi Mas
fb98b3198c Update Catalan translation 2022-12-17 14:28:42 +01:00
Alx Sa
d1746e464c plug-in: Initial support for CMYK/A JPEGXL export
Adds option to export JPEG XL images in CMYK/A format.
Key and Alpha data is saved in extra channels, and the
simulation profile is saved as well.
Per the specification developers, the format does not
support 'naive' CMYK conversion, so a profile is required
for export. The option will be disabled if not set.
2022-12-14 21:43:38 +00:00
Alx Sa
b04f45f354 plug-in: Initial support for CMYK/A JPEGXL import
Checks if file has an extra key channel for CMYK. If so, it is combined
with the image's CMY image to create a CMYK buffer for import.
Color profile is stored as image simulation profile.
If alpha channel is present, it is now loaded as well for CMKYA images.
2022-12-14 21:43:38 +00:00
Jehan
5c4dac0d67 devel-docs: release-howto was now moved into the developer website.
The URI will be: https://developer.gimp.org/core/maintainer/release/ (once we
merge the testing website to the main)

The new procedure also contains a wrapper step where we paste the checklist,
markdown-formatted, into a Gitlab report for better progress follow-up and also
onboarding testers into the release procedure.
2022-12-13 23:53:08 +01:00
Emin Tufan Çetin
1d9d3b8f11 Update Turkish translation 2022-12-13 01:00:58 +00:00
Sabri Ünal
64302025dd Update Turkish translation 2022-12-13 00:51:52 +00:00
Jehan
0e8a52a9f5 devel-docs: removing files and contents moved to developer.gimp.org.
The milestone and libtool instructions were moved over, as well as "Maintainer"
section text from the devel README.
2022-12-12 23:15:48 +01:00
Jehan
8ab38eb883 meson: fix the shared object version.
The current code was wrong, hence was producing wrongly versioned shared
library files. This commit do it the same way as we do it on autotools build,
and additionally compute the library version (since "current:revision:age" gets
transformed into "(current - age).age.revision" by libtool, but meson doesn't
use libtool so we have to do this ourselves).

Now meson and autotools builds produce the same result at least. There are still
some points I'm wondering and which we should handle before GIMP 3.0 release:

* Since meson doesn't use libtool (and no .la files are created), should we
  actually stick to libtool version scheme? It seems like some projects would
  use semver instead. On the other hand libtool version gives a bit more info.
* Also it raises the question on whether we want the API version to be semver at
  all or simply follow GIMP version? It used not to be much of a problem as we
  wouldn't add features (hence new API) on micro version, yet now we can. So
  GIMP program's version could not pass as semantic versioning. On the other
  hand, having a diverging API version (whose minor version would increment
  faster in particular, with regular micro version resets) would be confusing
  too.
* If we keep libtool versioning, I'm thinking we should do it manually. It's
  actually pretty easy with a good docs (or even just following GNU docs:
  https://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html),
  and simple to understand whereas the current code logic is very weird and we
  end up with huge current and age values with complicated computation.

Note also that I raise the "Libtool versioning" section near meson.build top and
updated gimp_interface_age to be the same as on autotools currently.
2022-12-12 19:58:17 +01:00
Jehan
d5d0808fee NEWS: update. 2022-12-12 14:38:54 +01:00
Jehan
d76d5bdb4b devel-docs: update release-howto.
- The <_p> or <_li> syntax for localizing AppData is the old code logics from
  intltool.
- Mailing lists don't exist anymore. Move all usage on discourse.
- Microsoft Store is only for stable builds.
- Let's always merge `origin/testing` into `master` on gimp-web module (no
  cherry-picking) as it's clearly the procedure we've been doing for quite some
  time now.
2022-12-12 14:33:47 +01:00
Sabri Ünal
d60b14e2e0 Update Turkish translation 2022-12-11 19:46:46 +00:00
Alexander Shopov
4390e4522e Update Bulgarian translation 2022-12-11 17:24:56 +00:00
Alexander Shopov
d2442edd56 Update Bulgarian translation 2022-12-11 14:05:21 +00:00
Sabri Ünal
d4d5f1eb47 Update Turkish translation 2022-12-11 09:14:17 +00:00
Jehan
09ece8f6f9 Issue #8948: Autotools build does not support the new babl-0.1 naming. 2022-12-09 16:34:11 +01:00
Cristian Secară
aea3b9132a Update Romanian translation 2022-12-08 22:21:52 +00:00
Cristian Secară
9eddb55076 Update Romanian translation 2022-12-08 22:17:54 +00:00
Cristian Secară
cf91b0af76 Update Romanian translation 2022-12-08 22:16:54 +00:00
Cristian Secară
b8e732cfd8 Update Romanian translation 2022-12-08 22:16:01 +00:00
Cristian Secară
d35b82c066 Update Romanian translation 2022-12-08 22:15:25 +00:00
Cristian Secară
3698d0975f Update Romanian translation 2022-12-08 22:13:58 +00:00
Cristian Secară
7b96d67a95 Update Romanian translation 2022-12-08 22:12:59 +00:00
Jordi Mas
d3ea4d7fa4 Update Catalan translation 2022-12-05 22:36:59 +01:00
Jehan
04a78154e1 meson: take into account babl's pkg-config name change.
See babl!52 (babl commit b8da847) and gimp#8912.
2022-12-05 14:34:48 +01:00
Jehan
83545ee94d devel-docs: adding libgimp as dependency to libgimpui.
Also use proper naming of dependencies, regarding of casing (e.g. GIMP
and GEGL, but babl).
2022-11-29 04:37:09 +01:00
Jehan
4acd18309a app: use our custom layer search entry with Ctrl-F in the Layers dockable.
GtkTreeView has an "interactive search" feature built-in, which basically kicks
in with the Ctrl-F shortcut by default. Let's hijack this feature and trigger
our own new search popover which is much more powerful (multi-item selection,
ability to use regexp or glob search by enabling these in Preferences, etc.).

This was an idea by Aryeom who wanted to be able to hit Ctrl-F to search for
layers.
2022-11-28 21:48:53 +01:00
Jehan
3795afefa5 app: GIMP_TIMER_START|END are no-op on release builds.
These are typically debug outputs and we don't want them to appear on stderr of
release builds. They confuse people (some tester would report these on IRC when
we last release GIMP 2.99.14).
So let's not show these debug text on release versions.
2022-11-28 20:59:30 +01:00
Jehan
2912552263 app: make the "Anchor" tooltip depending on whether we are floating over…
… a layer or a layer mask.
2022-11-28 20:43:56 +01:00
Christian Kirbach
dd3ed440a7 Update German translation 2022-11-24 21:58:25 +00:00
Balázs Úr
7ab7997a63 Update Hungarian translation 2022-11-22 23:55:34 +00:00
Jordi Mas
a1792a56cb Update Catalan translation 2022-11-22 21:32:54 +01:00
Lukas Oberhuber
e62f00ad4e macos: support MacPorts
This provides MacPorts support which is now the official way that
the MacOS port is built and packaged.
2022-11-22 14:36:22 +00:00
Jordi Mallach
1aec2281f5 Increase the timeout of tests from default 30s to 60s.
Some slower architectures hit the timeouts and fail their build.

See
https://buildd.debian.org/status/fetch.php?pkg=gimp&arch=armel&ver=2.99.14-1&stamp=1669046159&raw=0
for an example of a failed build.
2022-11-22 10:01:44 +01:00
Jordi Mas
46f2ea4142 Update Catalan translation 2022-11-20 23:59:10 +01:00
Jehan
c5f34477e6 build: sync flathub's beta and nightly branches of the flatpak.
Only the libwmf patches are still different. Apparently we may have fixed the
same bugs in different way on both branches. We should look later in details to
see if some patches are better than the other.
2022-11-18 23:48:46 +01:00
Jehan
ac94f06216 README: add a "Contributing" section in README. 2022-11-18 23:47:46 +01:00
Hugo Carvalho
976cbc7d45 Update Portuguese translation 2022-11-18 14:07:51 +00:00
Hugo Carvalho
27b3cb0d00 Update Portuguese translation 2022-11-18 14:06:26 +00:00
Alx Sa
01afc271ce plug-ins: Don't show invalid icons twice on export
This adds a check to make sure icon is valid when displaying
the icons in order, to prevent duplicates showing there and in the
invalid list at the bottom
2022-11-16 14:54:11 -05:00
Martin
6865c6f620 Update Slovenian translation 2022-11-16 14:28:53 +00:00
Martin
f6f576d97d Update Slovenian translation 2022-11-16 14:20:23 +00:00
Jehan
f7f92b61e1 devel-docs: GIMP format specs files moved to gimp-web-devel repository. 2022-11-14 23:06:37 +01:00
Jehan
fde0315cb3 devel-docs: some document updates.
For the release-howto (release process update) and the gitlab-mr document
(updating the git endpoint).
2022-11-14 21:33:54 +01:00
Jehan
8c5e3887f9 configure.ac, meson.build: post-release version bump to 2.99.15. 2022-11-14 01:20:27 +01:00
Jehan
a0811ff614 Release development version GIMP 2.99.14. 2022-11-13 23:04:38 +00:00
Jehan
cab8748c6c build: delete now outdated files.
It's probably unneeded as the 2.99 installers are transient and anything
installed by GIMP 2.99 won't be in stable 3.0 anymore. Still, it's nice not to
have any weird warnings even in dev releases.
2022-11-13 23:04:38 +00:00
Yuri Chornoivan
de2f3c3647 Update Ukrainian translation 2022-11-13 23:01:15 +00:00
Yuri Chornoivan
d5263bf3f8 Update Ukrainian translation 2022-11-13 22:59:43 +00:00
Jehan
a5e56f2ff8 NEWS: update.
Add macOS changes from the dedicated repo as they are pretty important too.
2022-11-13 22:22:57 +01:00
Jehan
3852f164d2 modules: fix typo in meson build.
This explains such WARNING over a previous installation on Windows:

> (gimp-2.99.exe:11524): GLib-GObject-WARNING **: 21:36:36.664: Two different plugins tried to register 'ControllerDXDInput'.

The previous install was autotools-built, so it didn't have the typo.
2022-11-13 22:21:14 +01:00
Jehan
75e56986a0 NEWS: update. 2022-11-13 19:52:02 +01:00
Alexandre Prokoudine
4caa543dee Update Russian translation 2022-11-13 21:29:47 +03:00
Alx Sa
cc3f7afb04 tools: auto-activate transform tools on canvas
This removes the need to click the canvas after selecting a transform
tool before you can start working on the transform.
2022-11-13 17:52:25 +00:00
Øyvind Kolås
06b481a3ec meson, configure, app: depend on babl 0.1.98 2022-11-13 17:31:32 +01:00
Øyvind Kolås
b85032d8b6 meson, configure, app: depend on GEGL 0.4.40 2022-11-13 17:16:49 +01:00
Zurab Kargareteli
7eb07347fe Update Georgian translation 2022-11-13 06:48:54 +00:00
Anders Jonsson
d3cea66c39 Update Swedish translation 2022-11-12 23:17:45 +00:00
Anders Jonsson
389da6447d Update Swedish translation 2022-11-12 23:15:18 +00:00
Jehan
143496af22 app, menus, pdb: new "Paste as Single Layer( in Place)?" actions.
When the clipboard contains raw image data or single layers, it's the same as
the normal "Paste" (and "Paste In Place" respectively). These actions are useful
if you want to copy a bunch of layers and paste them "merged" into a single
layers (since now the copy-paste of multiple layers will create multiple
layers).
It is somehow similar to the "Copy Visible" action except that it works on
selected layers only and work at paste time, making the action more versatile.
2022-11-12 22:34:51 +01:00
Jehan
fc050914ab app, menus, plug-ins: move some advanced paste actions into submenu.
There are so many paste options and I feel that the "Paste into Selection*"
actions are advanved enough that they can go into submenus. So I move them into
"Paste as". The other reason is that I'm going to add 2 more options!

I hesitated to rename the "Paste as" submenu but we couldn't find a good naming
(except just "Paste" but it's redundant with the default action and "Paste…" but
this usually implies a dialog, not a submenu).

Last but not least, I renamed the various paste actions to contain the word
"Paste" in it. E.g. s/New Image/Paste as New Image/. The old naming made sense
when action labels were only displayed in menus. But nowadays they can be shown
in other more independant context, such as the action search (and just
displaying "New Image" in there is very misleading).
2022-11-12 22:34:36 +01:00
Jehan
92cc33d52a app: fix a use of gimp_edit_paste().
When dropping a buffer, we just consider it like common data pasting, hence we
leave the GIMP_PASTE_TYPE_NEW_LAYER_OR_FLOATING algorithm decide what type of
paste it will be.
2022-11-12 19:07:47 +01:00
Jehan
9a2f5b0709 app: rework and fix the logic for copy-pasting multiple drawables.
There were a lot of incertainty of what should happen when we copy layers being
descendant of each other (i.e. when you select a group layer and some of its
children), then when you paste such data. So we sat down with Aryeom and tried
to come up with some consistent behavior which is somewhat expectable, but also
which would allow the most use-case.

Otherwise it was making very weird result when pasting the data, duplicating
some layers and whatnot, which was obviously a buggy behavior and never the
expected result.

We decided that if you select one leaf item, then even if you also selected a
parent item, it would be as though the parent was not selected. This is very
often what you expect anyway when you select a whole bunch of layers and would
work well if, say, you shift-click over many layers in sub-groups. Then you
wouldn't have to manually ctrl-click to unselect every group.

Then what if you were instead expecting to copy many groups? Then you could
shift-click the group arrow, closing all same-level groups. Once they are all
closed, you can shift-click the groups to only select group layers, not their
contents.

This way, both use cases are still quite doable easily with this default choice.
2022-11-12 18:28:58 +01:00
Jordi Mas
6e92077a1f Update Catalan translation 2022-11-12 15:20:59 +01:00
Anders Jonsson
a27089385e Update Swedish translation 2022-11-11 23:32:26 +00:00
Hugo Carvalho
418a45b165 Update Portuguese translation 2022-11-11 11:53:15 +00:00
Jehan
18c5b39cf5 app: copying from selection creates layers the size of the selection.
After further discussions with Aryeom, we had to make decisions about a few
problems. The main problem was: what happens when we copy a selection of a layer
whose bounds don't intersect with the selection?

The silent treatment of discarding the layer was not acceptable, because e.g. it
could happen on huge set of selected layers (like say you copy 100 layers with a
selection: you expect 100 created layers and if you realize you don't have them
all — e.g. you have 99! — after hours of work, trying to find the missing one
can be a huge time loss).
The status bar notification (or even error) did not feel right either because
this can typically be missed easily. Also it doesn't give a lot of feedback
(e.g. you might want hint to find the non-intersecting layers, in case it was
not supposed to happen).
An error box was even considered, possibly proposing to ignore the problematic
layers, or even giving easy ways to find them.
Finally what if we let the selection happen regardless the non-intersecting
layers? What should the dimension and offset of said layers be?

In the end, we went with the more consistent behavior of always creating new
layers of the exact same size as the selection. It can be considered as a rule
which would make the behavior predictable. For the non-intersecting layers, we'd
just have new layers with the dimension/offset of the selection bounding box,
and no contents. For other layers, they'd be also this same dimension, possibly
increasing the dimension of the source layers (though any new pixel is fully
transparent obviously). Aryeom wondered if some people might absolutely need for
their workflow that the new layers stick to the origin bounding box. But we felt
it was enough of a stretch that we'd try this way for now.

Note: of course if some day we get infinite canvas/layers, this whole discussion
could be less of a problem anyway! This was Aryeom's conclusion! Ahahah!
2022-11-11 00:04:38 +01:00
Jehan
363facef5e app: fix one case in gimp_edit_paste_get_top_item().
I was forgetting to store the path for the first item, which in particular was
making a problem when the top item was the first one in the list.
2022-11-10 23:29:23 +01:00
Jehan
1b64fdf52d app: pasting selection from multiple layers should still create multiple layers.
This is also work-in-progress for better copy-paste handling for multi-items.
Until now, I had decided that, if a selection existed, a copy would copy a
merged version of the selected items. But sometimes you want to have a piece of
each layer, each piece in its own layer. Also you may always merge the pasted
layers afterwards.

So now we will indeed create as many layers out as there are layers in. Being
able to copy a merged down version of all selected layers is still an
interesting feature though. We might add a dedicated "Copy Merged" action,
similarly to the fact we have a "Copy Visible" (which does the same thing but
for all visible layers, not specifically the selected ones).
2022-11-10 22:49:47 +01:00
Jehan
bd186d56ee app: fix position of pasted data.
Position of pasted image data was getting very bad lately, especially with the
multi-item selection logic which confused the hell out of the legacy algorithm.
So I reviewed it a bit, in light of the multi-item abilities, as well as the
recent no-floating-selection paste changes.

One of the particularly wrong paste position was when pasting one or several
pieces (through selection) of existing layers. The positionning was really bad
and sometimes even off-canvas (which was explicitly forbidden by the algorithm,
except it was broken now).

Now the behavior is much more reliable and consistent, by centering on viewport
or on target drawables. If there are several such targets, their bounding box is
used as target position (and the bounding box of all source drawables is also
used now). An interesting consequence of this is that copy-pasting quickly
without removing a selection paste "in-place" since the target this time will
use the selection bounding box.

Aryeom and I are doing some work on specifying copy-paste (based on existing
logic, we tried not to disrupt too much years of logic, but also keeping
consistency and new logic for recent changes, such as multi-items). It will all
be written down into the GIMP developer website, section "Specifications".
2022-11-10 22:49:47 +01:00
Daniel Novomeský
ec3da29f67 flatpak: remove extra lcms2
lcms 2.13 is already present.
2022-11-10 16:50:20 +01:00
Alexandre Prokoudine
61279385fb Update Russian translation 2022-11-10 14:49:21 +03:00
Yuri Chornoivan
178f283a37 Update Ukrainian translation 2022-11-10 09:20:34 +00:00
Jehan
3453c8bd55 app, pdb: paste layers over the top selected drawable.
When several drawables were selected, it was pasting at the top of the layer
stack. Instead, paste over the top selected layer ("top" visually in the Layers
dockable).

There was the question of: what should we do when pasting over a layer group.
Should we consistently paste the new layers above the group or inside the group?
After discussions with Aryeom, we decided to stay consistent and paste above, at
least for now.
2022-11-09 17:22:35 +01:00
Jehan
6083fd81a1 app, desktop: prepare AppData <release/> item for upcoming GIMP 2.99.14. 2022-11-09 15:31:39 +01:00
Jehan
b674fd33f0 app: fix a critical for release demos with a dockable and no specific widget.
Fixes:

> GLib-CRITICAL **: 13:39:39.804: g_strchug: assertion 'string != NULL' failed
2022-11-09 15:22:05 +01:00
Jehan
51fe025afb app: update sensitivity rules of distribute buttons.
Distribute features do not care about the reference object anymore. All we care
about is whether we have more than 2 objects.
2022-11-09 13:20:31 +01:00
Jehan
c3e1197ec9 app: fix a CRITICAL.
We should look at the display stored on the GimpDrawTool.
2022-11-09 13:04:51 +01:00
Zurab Kargareteli
d5f21716f7 Update Georgian translation 2022-11-09 05:13:33 +00:00
Jehan
6b787312c0 NEWS: update. 2022-11-09 02:42:23 +01:00
Jehan
28457ce337 app: display the floating mask over the layer mask.
It would make using floating masks a lot easier as it is visually understandable
that it applies to the layer mask.
2022-11-09 02:15:41 +01:00
Alx Sa
2c4f91f585 app: Paste as new layer by default
This changes the default selection pasting behavior to be a new layer,
rather than a floating selection. It also removes the
"Paste as New Layer" submenu options as they are now redundant.
2022-11-09 00:31:00 +00:00
Jehan
f6dd7f9b3a app: get rid of return_if_no_drawable() macro and…
… gimp_image_get_active_drawable() function!

Also fixing some memory leaks from previous usages of the multi version
return_if_no_drawables().
2022-11-09 01:24:34 +01:00
Jehan
5d75c79c89 app: remove compat registration for gimp-image-get-active-drawable.
Now we must use gimp-image-get-selected-drawables which is not a compatible
signature, as it returns an array of drawables.
2022-11-09 00:59:59 +01:00
Jehan
ddec8e2255 app: remove the last usage of gimp_image_get_active_layer().
The histogram is still not multi-drawable aware. In the future, it would be nice
to add ability to generate histogram for all selected layers (merged and as
separate images) as well as the whole visible image, therefore 3 possible cases.

But for now, it's alright like this (no more, but no less feature than before)
and at least we got rid of the last usage of functions assuming single item
selection.
2022-11-09 00:53:17 +01:00
Jehan
bd87766170 app: various Alignement tool strings update.
- Option dockable is named "Align and Distribute" rather than "Alignment".
  First, because it's not just about alignment; also because this way, it looks
  like other software, such as Inkscape; lastly because it's more consistent
  with other tool options ("Move", "Rotate", etc.).
- Add a tooltip to the Anchor Point widget to explain what it's used for.
- Rewrite various align/distribute button tooltips to make clearer that we are
  aligning anchor points with specific edges (or distributing these anchor
  points).
- Rename the first section to simpler "Targets".
- Some more rewording of other texts.
2022-11-09 00:40:44 +01:00
Jehan
6a63091e68 app: remove the offset feature in the Align/Distribute tool.
It's clearly broken right now. I can see it might have been used even to
progressively shift aligned items, but this was not used anymore. As for being
used while distributing, it doesn't make any sense anymore with the new logic of
not moving the extreme (first/last in coordinates) items.

I can see how an additional concept of offset can be useful in some situations,
but for now, let's get rid of this. We'll see in the future if someone asks for
it and provides valid use cases to work from.
2022-11-09 00:08:16 +01:00
Jehan
e48b002c84 app, icons, libgimpwidgets: add "distribute with evenly gaps" options.
There was one case in Inkscape which we could not do: distributing objects
keeping even gaps between them. Until now, we could only distribute keeping even
distance between anchor points (top, left, bottom, right or center).

With these 2 additional distribute options, I believe that GIMP is able to do
all the Alignment and Distribution options available in Inkscape (not the
"Rearrange" or node features, neither the text align/distrib; I just mean the
common align/distribute on objects), and even a bit more thanks to the anchor
point system (e.g. in Inkscape, we can't left or right-align to a reference
object/image center, or we can't center to a reference left/right/bottom/top
border; but we can do it in GIMP).

The icons are hopefully temporary, until we can make better ones.
2022-11-08 23:48:32 +01:00
Jacob Boerema
9ba5b8dbd6 app: fix issues in gimpmodifiersmanager.c found by coverity
- buttons_key doesn't get freed.
- modifiers could theoretically be used uninitialized.
2022-11-08 16:57:04 -05:00
Jacob Boerema
981979bb39 plug-ins: improve security in flame plug-in
- Use g_malloc* functions instead of malloc, so we don't continue on
failed allocations unless we test for NULL.
- Make sure we don't iterate past the known number of control points (ncps).
- Safely allocate, initialize and free points. Since points seems to be
used uninitialized, we use g_malloc0 to set everything to 0.
2022-11-08 16:57:04 -05:00
Martin
4fa8e7941d Update Slovenian translation 2022-11-08 21:42:45 +00:00
Zurab Kargareteli
a18408f73f Update Georgian translation 2022-11-08 20:50:04 +00:00
Jehan
09543af82a app: distribute while keeping extreme objects unmoved.
After discussing with Aryeom, we decided that "Distribute" should work within
the current horizontal or vertical bounds, as this is how it is usually done in
other software (e.g. Inkscape). For instance, if there are 4 items, the first
and last (coordinate-wise) stay untouched, and only the 2 intermediate items get
distributed evenly.

Since the Reference is not relevant anymore for "Distribute", I undo part of my
previous commit, where I was organizing the reference setting into its own
section of the Alignment tool options. This setting is back as part of the
"Align" section.
2022-11-08 21:39:58 +01:00
Jehan
2b0928d895 app: big UI rework of the align/distribute tool.
- Adding a separate pivot widget to allow choosing which point of the items we
  align or distribute. E.g. until now, we could only align the right side of
  objects to the right side of the reference object, left to left and center to
  center. Now these are independent. Therefore I can align the left side of
  objects to the right border of a selection or a layer, and so on.
- Only keep 2 "distribute" buttons (for now). Most of the distribution actions
  were basically broken or extremely hard to understand. Also they were
  apparently mixing concepts of alignments with distributions. Now let's
  basically only keep the bases: horizontal or vertical distributions.
  Everything is still possible using a mix of alignment and distribution
  buttons, and it's much clearer.
- Since the GimpAlignmentType was used nearly only there (except for some usage
  like to store dock side or filter preview split direction, but these
  GIMP_ARRANGE_* values were unused there), I removed the various enum values
  which we don't use anymore.
- The Reference settings gets its own subsection in the Align tool options.
  Until now, it looked like it only applied to alignment, whereas it applies to
  distribution too.

Note: this is still work-in-progress, mostly some initial dev work to put some
algorithmic bases. We had some UI and specification discussions with Aryeom
already and some things might still change a lot.
2022-11-08 19:19:55 +01:00
Jehan
63dc7dee8a app: redraw handles when needed.
There were various cases when the reference's on-canvas handles were not
redrawn, or drawn at all:

- When the reference is an image, we now draw them. It may seem redundant as
  it's the image bounds, but it's still useful to see what are the reference
  bounds in a glimpse. Moreover in "Show All" mode, it's even more useful.
- Start the tool, hence draw the reference handles, in oper_update() if not
  started yet.
- When the "align-reference" property changes.
- When the display (active image) changes.
2022-11-08 13:05:56 +01:00
Jehan
4c09f194d1 app: more fine-grained align/distribute button sensitivity.
When the reference is a guide in particular, no distribution is possible (on one
dimension, the size is 0, on the other, it's infinite) and alignment is only
possible in one direction (depending on guide orientation).
2022-11-07 22:48:30 +01:00
Martin
a8983f7823 Update Slovenian translation 2022-11-06 20:19:07 +00:00
Luming Zh
06a9240046 Update Chinese (China) translation 2022-11-06 19:22:53 +00:00
Boyuan Yang
c0cd58f38f Update Chinese (China) translation 2022-11-06 19:20:16 +00:00
Daniel Novomeský
e58efc314d flatpak: change recipe for libjxl 2022-11-04 11:17:58 +00:00
Rodrigo Lledó
dab80500f9 Update Spanish translation 2022-11-03 12:43:35 +00:00
Daniel Novomeský
006b77674d flatpak: Upgrade libde265 2022-11-03 12:07:52 +00:00
Hugo Carvalho
7164f27308 Update Portuguese translation 2022-11-03 11:38:08 +00:00
Yuri Chornoivan
e98f9cd797 Update Ukrainian translation 2022-11-02 18:33:52 +00:00
Zurab Kargareteli
7461eb8cd3 Update Georgian translation 2022-11-02 04:52:19 +00:00
Jehan
947130f2cb app: make a copy of selected items before gimp_container_view_select_items().
Otherwise the selected items might change and invalidate the pointer, eventually
leading to a segfault.
2022-11-01 22:57:21 +01:00
Jehan
04810ec95e app: name the "Floating Selection" differently depending it floats a layer or…
… a layer mask.

This is a first step to make a clearer difference between the 2 use cases.
2022-11-01 22:57:21 +01:00
Hugo Carvalho
fae838b227 Update Portuguese translation 2022-11-01 21:44:11 +00:00
Yuri Chornoivan
3c8d873914 Update Ukrainian translation 2022-11-01 20:43:11 +00:00
Zurab Kargareteli
1fac53a91b Update Georgian translation 2022-11-01 19:47:25 +00:00
Jehan
fa2fa71619 app: add a tooltip to "_Don't ask me again" checkbox.
I find these options always a bit unwise when people have no idea how to change
their mind. Therefore adding a tooltip with the information (though maybe we
should even do it even more clearly and adding that in checkbox text too?).
2022-11-01 17:36:45 +01:00
Jehan
092627fdb3 Issue #8697: do not make conversion to another profile the default behavior.
For this to happen, I've updated the main question to be "Keep the Embedded
Working Space?" instead of "Convert to * Working Space?". Basically now we put
emphasis on keeping the image's color profile as being the proposed action.
Therefore "Keep" is the default answer, on the right.
Yet "Convert" stays on the right too. There is no "Cancel" button anymore
because it is not a question we can really escape even though "Esc" still works,
and it still corresponds to "Keep", same as Enter now. The reason is that "Keep"
is actually the non-destructive option. So if someone really doesn't want to
answer and make an explicit choice, we do it for them with the only
non-destructive choice possible.

Also I'm changing "Convert" mnemonic to 'c'. I guess that earlier devs might
have used 'o' because it is the usual mnemonic for "OK", so it was right when
the question was "Convert?". But since now the question is the opposite, there
is no reason to make it look like "OK". Let's just use the first letter, which
is easier to guess (and not taken by any other button here).

I've been hesitating because I don't think "Convert" was the right default
anymore with our anyRGB move. Until now, it was kinda implying that sRGB (when
no preferred color profile was set) was kinda the recommended space. It's not.
If a file already has another space, it's probably much better to keep it.
First because "Convert" is often a destructive change (even more if the target
is sRGB), so for people who don't necessarily understand all the ins and outs,
we were kinda promoting a destructive default behavior.

On the other hand (and that's why I was hesitating):

* "Keep" is also what happens when we hit "Esc" so some might complain that
  there is no easy "Convert" key anymore (there is alt-c, but it's for sure not
  as easy as Esc or Enter). Basically it makes the "Convert" option always a
  much more explicit choice (yet it is likely for the best for people who care
  about their colors).
* There might have been many people who would just use the default (Convert
  until now) without thinking too much of what was asked, and that was working
  good because they would just publish on the web or similar basic usage. If
  they continue just accepting with Enter without reading and understanding what
  is asked, now they could publish images with a color profile (and we know it
  doesn't always work perfectly on the web).
  In other words, it might be the best default for professional usage now, yet
  it requires to understand a bit what you are doing.

It's really a hard call!
2022-11-01 17:24:22 +01:00
Rodrigo Lledó
db97cb4500 Update Spanish translation 2022-11-01 11:56:49 +00:00
Rodrigo Lledó
1a572830a9 Update Spanish translation 2022-11-01 11:08:43 +00:00
Jacob Boerema
89c83ef4c7 plug-ins: fix crash when reading corrupt flame settings file
Thanks to a report by Stefan Cornelius, we became aware that the flame
plug-in does no checking for correct input when loading a pre-saved
settings file.

I reworked the parser to read one or more values based on the type of
token, making sure we also don't read past the end of our token buffer.

All int values have a min and max value set. If any unexpected input is
encountered, we will give a warning.
2022-10-31 14:22:44 -04:00
Jacob Boerema
536c7cbc4b plug-ins: fix missing input buffer length checking in flame
The flame plug-in can read stored settings from a file. The expected
input is that a ; signifies the end of input.

However, with user input we cannot depend on this to be true, so we need
to make sure that we do not read past the end of our input buffer.
To do so, we add a length check.
2022-10-31 14:00:54 -04:00
Jacob Boerema
193596397e plug-ins: fix failure to load flame saved settings from file
We were using the plug-in name with underscores, which is incorrect.
Since nobody ever complained about this, this doesn't seem to be used
very often.

We will use the const that defines the plug-in name instead.
2022-10-31 13:57:14 -04:00
Piotr Drąg
729c876654 Update Polish translation 2022-10-30 13:12:50 +01:00
Hugo Carvalho
6d0dc6a3a1 Update Portuguese translation 2022-10-29 15:59:27 +00:00
Jordi Mas
3274671af4 Update Catalan translation 2022-10-29 17:57:42 +02:00
Yuri Chornoivan
1388d1af9c Update Ukrainian translation 2022-10-29 05:50:46 +00:00
Martin
a9ce2b8539 Update Slovenian translation 2022-10-28 06:30:31 +00:00
Zurab Kargareteli
1f635a50aa Update Georgian translation 2022-10-28 04:13:49 +00:00
Jehan
f7b026e3f0 build: add glib-networking to cross-built Windows jobs.
This dep is needed for various network GIO modules. Also various moving files
around from lib/gio/modules/ were broken in the new brought back jobs.
2022-10-27 16:23:56 +00:00
Jehan
6e2177bcd2 gitlab-ci: no contents in libexec/ on Windows.
Whatever is here on other platforms is in bin/ on Windows.
2022-10-27 16:23:56 +00:00
Jehan
afbb5494fa gitlab-ci: add --output-dll-list option to dll_link.py calls.
I added this option in commit 38d6783299. It makes the script stateful, able to
remember all previously processed DLL, hence making the whole job much faster
and efficient.
2022-10-27 16:23:56 +00:00
Jehan
0b709a99d5 Revert "gitlab-ci: removing win*-nightly jobs."
This reverts commit c11dc69137.
2022-10-27 16:23:56 +00:00
Jehan
b76411ff86 po-plug-ins: add missing plug-ins/file-icns/file-icns-save.c in POTFILES. 2022-10-27 14:36:14 +02:00
Jehan
75dd13981a libgimpconfig: more param spec types to ignore (GeglParamFormat). 2022-10-26 23:29:32 +02:00
Martin
43285bce57 Update Slovenian translation 2022-10-26 21:28:54 +00:00
Jehan
e5d5be4277 Issue #8062: error when offsetting a layer. 2022-10-26 23:10:51 +02:00
Alx Sa
dca12039ea plug-ins: fix #8127 Option to load reduced TIFFs
Adds a toggle to let users load TIFF pages with FILETYPE_REDUCEDIMAGE
tags. The specs do not state that these are always thumbnails, and they 
may have other uses. We assume that if only one page with this metadata
exists then it is a thumbnail; otherwise, the toggle option is 
enabled on load.
2022-10-26 20:34:30 +00:00
Jehan
14c973e522 NEWS: update. 2022-10-26 21:15:40 +02:00
Zurab Kargareteli
e1d0b8b4b3 Update Georgian translation 2022-10-26 03:41:39 +00:00
Jehan
92caf44817 libgimp: improve gimp_procedure_add_menu_path() docs regarding localization.
This was the last remaining bit in #8124. Basically I needed to check how
localization of menu paths worked. I was thinking of maybe have 2 arguments to
gimp_procedure_add_menu_path(), one non-localized (for default menu paths) and
one localized by the plug-in (for custom menus). That would break all plug-ins,
but also looking at our code, it's complicated to do right.

Instead let's just keep current API and add an example in function docs. We'll
see how we can improve the API if the very hypothetical problem I am foreseeing
actually happens some day: say a word in English translates to e.g. "Filters" in
some other language, whereas English "Filters" translates to yet another term;
in such case, this new menu would still merge with the default /Filters/ menu
when localized in this language, so we'd have the weird situation where the
custom menu label would have passed through 2 translations somehow.

But let's see how it goes. If we really need, in the future, we can deprecate
gimp_procedure_add_menu_path() and add a gimp_procedure_add_menu_paths() with a
base_path and a custom_path, while the custom_path would be expected to be
already translated.
2022-10-26 01:13:43 +02:00
Jehan
255cab6b43 plug-ins: fix a crash for closing a FILE twice.
Fixes:

> free(): double free detected in tcache 2

The file is closed also after resource_load() runs. Anyway it's better to free
resource on the same level they were created, so I remove the fclose inside the
function.
2022-10-26 00:23:18 +02:00
Jehan
f686d2afbf app: zlib saving is now multi-threaded too!
For the same file, which was saving in ~50 secs in RLE (now ~12), and ~80 secs
in zlib. It now saves zlib-encoded XCF in ~35 secs on the same machine with 8
threads.
2022-10-25 20:15:43 +02:00
Jehan
52d1743924 app: reorganized multi-thread saving code.
Contributed code was not wrong, far from it! But the whole memory management was
a bit on the hard-to-read side. For maintainability, I prefer some simpler code,
which contains a bit more allocation but it's reasonable and at least much less
indexes to play with.

Also instead of gegl_parallel_distribute(), then waiting for each set of batches
to entirely finish, I'm using a GThreadPool which I progressively fill with new
batch data. And finally I'm running the gegl_buffer_get() inside the threads (I
know that we have only reads on the buffer at this point; also GEGL has an
internal lock mechanism anyway).
These actually do not provide a huge additional speedup (compared to the initial
speedup by just going multi-threaded), most likely because the I/O are now the
bottleneck anyway (which is quite a good thing!).
2022-10-25 20:15:43 +02:00
Jehan
b35bdd2dc9 app: cleaning the previous commit for fast saving of RLE XCF.
- Coding style fixes.
- Removing gimp_gegl_num_processors unknown variable which didn't exist (coming
  from another patch from suzu. See discussion in #4985).
- Removing the `cleanup()` attribute to keep our code as generic as possible
  without specific compiler extensions. Just free memory manually as is expected
  in C.

Testing on a 115MiB XCF file, saving went down (on my machine, as average on
saving a few times) from about 50 seconds to 15 seconds.
This first version is already pretty neat, though we can probably do even
better.
2022-10-25 20:15:43 +02:00
suzu_11
a51434beb4 Issue #4985: Parallelize xcf_save_tile_rle to reduce time when saving xcf file. 2022-10-25 20:15:43 +02:00
Hugo Carvalho
586980a635 Update Portuguese translation 2022-10-25 16:34:09 +00:00
Alx Sa
08fedaa55a plug-ins: Add initial ICNS export support
This adds the ability to export to the most "compatible" modern ICNS
format for a particular layer.
2022-10-24 23:46:17 +00:00
Zurab Kargareteli
869c9bdcdf Update Georgian translation 2022-10-24 21:16:01 +00:00
Michael Schumacher
149358021e app: Add GDK_SCROLL_MASK to gimpviewablebutton initialization.
This makes these buttons respond to scroll wheels again, a regression encountered in GIMP 2.99.x.
Code location and fix found by Massimo Valentini.

Fixes issue #6929.
2022-10-24 00:27:13 +02:00
Jordi Mas
ce6626163e Update Catalan translation 2022-10-22 15:45:52 +02:00
Yuri Chornoivan
9ed613ced8 Update Ukrainian translation 2022-10-21 14:41:23 +00:00
Hugo Carvalho
72f696e3e2 Update Portuguese translation 2022-10-21 12:26:45 +00:00
Martin
df6464dfe2 Update Slovenian translation 2022-10-21 08:44:19 +00:00
Jehan
8f288bf722 libgimp: add gimp_image_list_selected_drawables().
Similar to other functions, we want a variant which returns a GList.
2022-10-20 23:17:07 +02:00
Jehan
831cb91303 app: remove gimp_image_get_active_drawable() usage in colormap actions. 2022-10-20 23:17:07 +02:00
Jehan
81969a0651 app, devel-docs: add a new "Vectors Structure" in the XCF format.
Instead of storing vectors as properties, they have their own structure, which
make them able to store and load all the usual and common properties of other
items. In other words, it makes XCF now able to store locks, color tags and
several selected paths.
2022-10-20 23:17:07 +02:00
Asier Sarasua Garmendia
32cf103939 Update Basque translation 2022-10-20 20:20:10 +00:00
Asier Sarasua Garmendia
caf0006d1e Update Basque translation 2022-10-20 18:59:24 +00:00
Jehan
a77c64fafe app, pdb: fixing gimp_vectors_export*() libgimp API.
It seems I forgot to fix some usage of core gimp_vectors_export*(),
which now take a list of paths (not a single path anymore since commit
9fc8260c7c), as these were used by PDB functions.
2022-10-20 19:07:16 +02:00
Jehan
759ee663f0 app, pdb: fix a few "incompatible pointer type" conversions.
That's the problem when there are still too many old warnings hiding the
new ones!
2022-10-20 18:56:24 +02:00
Jehan
b73278f1a8 app, libgimp, pdb: add missing functions for selected items.
Missing functions were:
* gimp_image_get_selected_channels()
* gimp_image_get_selected_vectors()
* gimp_image_list_selected_channels()
* gimp_image_list_selected_vectors()
* gimp_image_set_selected_channels()
* gimp_image_set_selected_vectors()
* gimp_image_take_selected_channels()
* gimp_image_take_selected_vectors()

There are discussions of renaming GimpVectors to GimpPath, which would
also be consistent with the GUI and make the always-plural less akward
in API. We'll see. For now keeping named like this.
2022-10-20 18:25:43 +02:00
Martin
0c6f7b167a Update Slovenian translation 2022-10-19 14:45:38 +00:00
Yuri Chornoivan
1b507376c4 Update Ukrainian translation 2022-10-19 14:41:18 +00:00
Jehan
6dc48f571c app: fix logic in gimp_edit_selection_tool_translate().
We should not check if all items are locked, but if one item is locked. It is
enough to forbid the translation from happening.
Otherwise it is currently possible to bypass position lock by using keyboard
arrows for layers or channels.
2022-10-19 15:47:11 +02:00
Jehan
789f52c412 app: make moving vectors with keyboard arrows multi-selection aware.
And this is one less usage of gimp_image_get_active_vectors()!
2022-10-19 15:41:23 +02:00
Jehan
48bebb8a27 app: replace one more usage of gimp_image_get_active_drawable(). 2022-10-19 15:14:14 +02:00
Jehan
74b4951e50 app: remove a gimp_image_get_active_drawable() in select actions.
The action "select-float" should probably only work for a single selected
drawable anyway since a floating selection can only be stacked on one drawable
at a time.
2022-10-19 15:09:38 +02:00
Jehan
6716d06aa1 app: remove one more gimp_image_get_active_drawable().
Actions "vectors-fill*" and "vectors-stroke*" require a single drawable to paint
to. So action logic is unchange. I only replace gimp_image_get_active_drawable()
by gimp_image_get_selected_drawables() and counting the drawables.
2022-10-18 22:36:24 +02:00
Jehan
6eb78ca11f app: remaining drawable actions are now multi-layer aware. 2022-10-18 22:19:44 +02:00
Jehan
85adfb46c8 app: make "drawable-lock-content|position" multi-drawable aware. 2022-10-18 22:06:21 +02:00
Yuri Chornoivan
564c37d06b Update Ukrainian translation 2022-10-18 18:48:43 +00:00
Jehan
cff1ae4176 app: remove one more usage of gimp_image_get_active_vectors().
For "text-tool-text-along-path", it makes sense to keep it only usable when a
single path is selected.
2022-10-18 16:35:59 +02:00
Hugo Carvalho
9dd33e0234 Update Portuguese translation 2022-10-18 11:11:46 +00:00
Hugo Carvalho
cd7b2fd99b Update Portuguese translation 2022-10-18 11:01:34 +00:00
Martin
0056b0b2f7 Update Slovenian translation 2022-10-18 04:24:27 +00:00
Jehan
c8547d0a50 app: new option "Use extents of layer contents" to Align tool.
Instead of using the layer borders, we use the bounding box for the contents.
This is similar to first run "Crop to Content" on every selected layer except
we don't actually need to crop. Therefore we can work on bigger layer than the
actual content while still arranging them based on content bounds.

So often the result of alignment/distribution feels wrong because it doesn't
correspond to the content we are seeing. With this option, we'll have the option
to choose the desired behavior.
2022-10-18 00:48:51 +02:00
Jehan
9be6a6b711 app: highlight guides which will be aligned or distributed. 2022-10-17 23:08:33 +02:00
Yuri Chornoivan
33330fb29c Update Ukrainian translation 2022-10-17 19:12:30 +00:00
Jehan
4eaf6c16b9 app: rework the Align tool interaction taking multi-item selection into account.
The old interaction was quite horrible. I don't think I ever really got a good
use of it. It was so hard to understand what you were picking and so on.

Now that we can multi-select items, let's just use this as the base of what we
want to align or distribute. Clicking on canvas will now mostly be used to pick
an item as reference. From now on, only the reference object will get on-canvas
handle, making it very obvious how your alignment or distribution will work.

I leave only an alternative picking method (with Alt or Shift-Alt pick) to add
guides to objects to align or distributes, as these don't have a selection
dockable.

I'm also improving the selection of stacked layers by looping through them
(similar as the layer selection on canvas feature) so that we can select even
background layers which have a lot of layers showing above.

I am planning to improve this tool even further, but this is a first step to
make it actually usable within the new multi-item interaction logic.
2022-10-17 19:03:50 +02:00
Alx Sa
53202a70ed app: Disabled symmetry menu when no image is set
To improve discoverability, the symmetry dockable's combobox menu is now
shown (but disabled) when no image is set.
2022-10-17 14:42:22 +00:00
Jacob Boerema
28e0033ed2 app: fix string of GIMP_HELP_FILE_CREATE_TEMPLATE
Even though GIMP updated the name of the define for Create Template to
GIMP_HELP_FILE_CREATE_TEMPLATE, it did not change the id string.
In gimp-help this string was updated, causing help not found when asking
for help for Create Template.

This commit updates the string used for the help id to be the same as
used in gimp-help. It also removes the old define that is not used
anymore in GIMP.
2022-10-16 17:17:18 -04:00
Hugo Carvalho
9469fd16f4 Update Portuguese translation 2022-10-16 14:15:05 +00:00
Hugo Carvalho
e2416b2ba0 Update Portuguese translation 2022-10-16 14:07:23 +00:00
Piotr Drąg
0581df1caa Update POTFILES.skip 2022-10-16 14:17:40 +02:00
Martin
bb91c380eb Update Slovenian translation 2022-10-16 06:21:57 +00:00
Yuri Chornoivan
05d36f9a27 Update Ukrainian translation 2022-10-16 05:51:29 +00:00
Alx Sa
00232e1787 plug-ins: Add support for loading .icns files
This ports ICNS loading code from Brion Vibber's 2004 plug-in.
It extends support for ICNS files that contain PNG or JP2 format icons.
2022-10-16 02:20:51 +00:00
Jehan
62963aa748 devel-docs: delete various devel docs which are now in developer.gimp.org. 2022-10-15 22:33:25 +02:00
Jehan
6c0c2f15c4 themes: toggle buttons were not styled at all when toggled. 2022-10-15 22:33:25 +02:00
Jacob Boerema
6cb58fbc8d app: remove duplicate GIMP_HELP_TOOL_CURVES define
This caused a missing documentation warning for help id gimp-tool-curves
in gimp-help.
2022-10-15 16:32:29 -04:00
Alx Sa
b317eceda9 pdb: Use floating point offset in stroke_translate
Update gimp_vectors_stroke_translate () to accept
floating point values for offset parameters
like gimp_stroke_translate () does.
2022-10-15 18:26:55 +00:00
Jacob Boerema
4b4dd5ec38 app: remove unused GIMP_HELP_TOOLS_DIALOG help id
This help id was used in the past but all references to it were removed
long ago with commit c53113d0cc.

Let's remove this define too since it causes a warning in gimp-help when
checking for help id's without documentation.
2022-10-15 14:05:03 -04:00
Luming Zh
177e3b7d49 Update Chinese (China) translation 2022-10-15 16:29:52 +00:00
lloyd konneker
7708c3fec3 Issue #8744: refactor overdependence on gimpui.h
To reduce compiling due to changes in libgimpui.
2022-10-15 15:17:08 +00:00
Alexandre Prokoudine
cb49cd84aa Update Russian translation 2022-10-14 18:39:48 +03:00
Yuri Chornoivan
d26761ff01 Update Ukrainian translation 2022-10-13 11:06:51 +00:00
Martin
e7246b1356 Update Slovenian translation 2022-10-13 08:10:06 +00:00
Alx Sa
0aa63806e6 text: Fix xcf load issue caused by MR !751
Loading an .xcf with a patterned outline caused GIMP to crash.
This is because PROP_GIMP was loaded at the end, so it was null when
text->gimp->pattern_factory was called. Moving PROP_GIMP to the
top of the property enum list ensures it's loaded first,
which resolves the issue.
2022-10-13 00:16:44 +00:00
Alx Sa
ca6b58e970 text: Add outline options to text editor
This ports Massimo’s code to work in the latest version of GIMP.
It adds new outline-related properties to GimpText and GimpTextOptions.
These are controlled via the Text Tool Editor.
Cairo is currently used to draw the outline around the text.
2022-10-12 22:00:40 +00:00
Jehan
2080abf0a3 Issue #8734: Python-fu misses sys.stdout.flush.
Just add a no-op flush() as I think it's actually unneeded in the context of a
GtkTextView GUI. At least it doesn't cause issues with copy-pasted code or when
using external libraries using the sys.stdout.flush() interface.
2022-10-12 23:40:04 +02:00
Jehan
bee4dd0fc3 app: finally remove the get_active_item() and set_active_item() abstract…
… methods of GimpItemTreeView.

There were 2 last usages of get_active_item() which are now gone with this
commit.
2022-10-12 22:47:22 +02:00
Jehan
0508148580 app: get rid of one more usage of get_active_item() abstract method. 2022-10-12 22:38:35 +02:00
Martin
6441008fa5 Update Slovenian translation 2022-10-12 20:18:14 +00:00
Jehan
9fc8260c7c app: "vectors-copy" and "vectors-export" are now multi-paths aware. 2022-10-12 22:13:38 +02:00
Jehan
fde780daeb app: "vectors-(raise|lower)*" actions now multi-paths aware. 2022-10-12 21:45:13 +02:00
Jehan
2835e85950 app: make the "vectors-select-*" actions multi-selection aware. 2022-10-12 21:21:22 +02:00
Jehan
acf428b24c app: get rid of one more gimp_image_get_active_vectors(). 2022-10-12 18:02:43 +02:00
Jehan
925d4c317f app: cleaning unused variables.
Removing build warnings!
2022-10-12 17:53:04 +02:00
Jehan
131cdf0f1c app: fix preview for multi-layer transform.
Though it was working in the "Composited preview" case, it was only showing one
of the multiple layers being transformed in the basic case.
2022-10-12 17:52:04 +02:00
Hugo Carvalho
d589547fa0 Update Portuguese translation 2022-10-12 15:48:54 +00:00
Jehan
274c079c4c app: also show rotation preview for multiple-selected paths. 2022-10-12 17:19:10 +02:00
Jehan
b74e6c2198 Issue #8640: Rotate two selected paths creates error window. 2022-10-12 17:19:10 +02:00
Jehan
dd0fc44677 NEWS: update. 2022-10-12 01:08:55 +02:00
Jehan
e4e87d65ca plug-ins: fix the new unit editor (!655).
- Don't forget to run gimp_ui_init() to get GIMP's styling in plug-ins.
- Process the "key-press-event" signal so that Escape key closes the window (as
  it used to before the MR commit).
- Expand vertically the tree view, otherwise resizing the window leaves a lot of
  ugly empty space, even though the tree view is still shown incomplete with a
  scrollbar.
- Fix the Help button (which was doing nothing).
- Use full words for the "Refresh" and "Help" buttons, rather than icons. Text
  is usually prefered for UI discoverability/understandability, unless there is
  a space issue (i.e. too many icons for all of them to be words).
- Add a "OK" button too, and reorder the buttons similarly to how we usually
  order them.
- Minor coding style fixes (alignments…).
2022-10-11 22:11:16 +00:00
Jehan
dc8298ce76 libgimpwidgets: use "system-help" for GIMP_ICON_HELP.
Just "help" is not one of the standard icon names as per the Freedesktop Icon
Naming specification.
See: https://specifications.freedesktop.org/icon-naming-spec/icon-naming-spec-latest.html

Therefore when using this name, we usually don't have any icon (especially as we
don't provide any in our own icon themes).
Use "system-help" instead which is a standard name 'for the “Help” system
category'.
2022-10-11 22:11:16 +00:00
Niels De Graef
567d7beb11 plug-ins: Remove GtkAction from unit editor
Migrate to `GAction` and while we're at it, clean up the plug-in by
using `G_DECLARE_FINAL_TYPE()`.
2022-10-11 22:11:16 +00:00
Jehan
c928fda8ff app: fix GEX installation with warning while decompressing.
There is not only the ARCHIVE_OK and ARCHIVE_FATAL cases. There are also
ARCHIVE_WARN cases which should not break the installation (I think?). Since I
still want to pass the warning over to extension developers, I am printing it to
stderr.

As an additional fix, prevent such a warning when installing an extension over
itself. In such case, it looks like the archive_entry_size() would be 0, which
was triggering some "Writing to Empty File" warning.
2022-10-12 00:08:28 +02:00
Jehan
5df4875c88 app: do not depend on returned image for successful file_open_with_display().
We may return GIMP_PDB_SUCCESS with no image for generic file procedure, such as
is the case with .gex extension files.
file_open_image() already sanitizes the status returned by the plug-in, so at
this point, we should trust the returned status.

This fixes a crash when loading .gex files (GIMP_PDB_SUCCESS status yet a NULL
error).
2022-10-11 23:19:18 +02:00
Jehan
bfc9e4bb72 configure: add an info message to advise building with meson and report bugs. 2022-10-11 16:39:12 +02:00
Jehan
8ac5178214 libgimpwidgets: fix automake syntaxe.
Automake doesn't accept the "if else" syntax. Instead, we must add a new if/else
inside the first else block.

While I'm at it, I also add a G_GNUC_INTERNAL to the internal function
_gimp_pick_button_win32_pick(), though I don't think it's absolutely necessary
(yet explicit is better).
2022-10-11 00:29:57 +02:00
Jehan
fb1cb22f62 app: cleanup MR !734.
- app_activate_callback() moved with other private functions.
- Removing the `if (app)` test in app_activate_callback() as we don't
  set it to NULL anymore. The app variable is always set.
- As a consequence of the previous point, change signature of
  app_exit_after_callback() which doesn't have to change the value of
  app anymore.
- Don't emit direcly the "exit" signal from app_activate_callback(). We
  must call `gimp_exit (gimp, TRUE);` instead, which does more than just
  emitting this signal. It also takes care of cleaning any remaining
  images without a display. If we don't do this, we are leaking
  GeglBuffer when opening images from command lines while quitting
  immediately with --quit.
- Get rid of gimp_core_app_set_values() which was completely bypassing
  the fact that all the properties of a GimpCoreApp were construct-only.
  Instead make these proper properties. I use a trick used in other
  interface, creating a gimp_container_view_install_properties() which
  is called from child classes.
  The point of GimpCoreApp is not just to share a common interface, it's
  rather to weakly simulate some kind of multi-inheritance in GObject.
  Since we want both GimpApp and GimpConsoleApp to inherit from a same
  parent class while we also want them to inherit either from
  GtkApplication and GApplication respectively (yet without linking to
  GTK in this second case), we are stuck as far as normal GObject
  inheritance goes. This is why we use an interface to which we add a
  private struct through a GQuark trick. We want the property settings
  and function implementations to also be part of this shared code.
- Get rid of all the abstract methods of GimpCoreApp of the form
  get_*(). These are useless as we don't expect these to have different
  implementation depending on the actual child class. Once again, our
  main goal was to simulate multiple inheritance rather than actually
  have an interface with various implementations.
- Make "no-splash" a property of GimpApp, because it's cleaner this way.
- Fix gimp_core_app_private_finalize().
- don't use #pragma once, it's not standard. Just use include guards.
- Fix includes: order was wrong, include from the source, not other
  headers, etc.
- Clean various other details, coding styles, fix several more bugs and
  more…
2022-10-09 16:12:07 +02:00
Lukas Oberhuber
1ee1224d05 app: Add in gimpconsoleapp and gimpcoreapp interface
GimpApp is a GtkApplication
GimpCoreApp is an interface for common functions
GimpConsoleApp is a GApplication (to avoid linking in Gtk)
2022-10-09 16:12:07 +02:00
Niels De Graef
27fe67814e app: initial work on moving to GtkApplication.
Reviewer's message (Jehan): This was a work-in-progress by Niels, which
we only keep in this state because Lukas worked over it. I have rebased
and fix-amended many broken part of this commit, because various things
had been changed in these areas of code since this commit was initially
written.
2022-10-09 16:12:07 +02:00
Jehan
8bbde7db25 Issue #8695: fix GIR build in autotools.
Fixing this error:

> Gimp-3.0.o:(.data.rel+0x430): undefined reference to `gimp_text_layer_get_type' linking of temporary binary failed
2022-10-09 16:09:10 +02:00
Martin
5eb65a06a5 Update Slovenian translation 2022-10-09 08:09:34 +00:00
Luca Bacci
d2dc2cb983 Add GimpPickButton implementation for Windows
Fixes https://gitlab.gnome.org/GNOME/gimp/-/issues/8506
2022-10-07 10:45:22 +00:00
Luca Bacci
9ef4aee21b Fix warning about using %d format modifier for an unsigned type
GetLastError () returns a DWORD, which is a typedef for a 32 bit
unsigned integral.
2022-10-07 10:45:22 +00:00
Zurab Kargareteli
36050fd5be Update Georgian translation 2022-10-06 21:40:14 +00:00
Hugo Carvalho
4d592d0b6c Update Portuguese translation 2022-10-05 22:09:00 +00:00
Yuri Chornoivan
dda66fe354 Update Ukrainian translation 2022-10-05 19:55:27 +00:00
Alx Sa
ffbee51776 plug-ins: Fix odd length for .ani metadata
.ani files require metadata fields to be an even length. If the data
length is odd, an extra 0x00 is added for padding.
This patch updates the export and import code to comply with this
requirement.
2022-10-05 19:01:14 +00:00
Hugo Carvalho
30f13a75e3 Update Portuguese translation 2022-10-05 16:06:29 +00:00
Daniel Novomeský
d11e175612 Add libheif-dev and libjxl-dev to Debian container 2022-10-05 16:44:47 +02:00
Daniel Novomeský
eac694905f plug-ins: metadata import/export for JPEG XL format
Changes require libjxl 0.7.0
2022-10-05 14:15:26 +00:00
Lukas Oberhuber
bce3bf23de goat-exercise: fix ability to load js
However, this is still currently crashing on MacOS.
2022-10-04 18:02:38 +01:00
Alx Sa
697b41dc45 plug-ins: Export PSD with paths
Ports PSD path export from file-tiff-save.c so that paths are carried
over in PSD project files as well.
2022-10-02 14:44:46 +00:00
Hugo Carvalho
b3332bb900 Update Portuguese translation 2022-10-01 22:10:06 +00:00
Fran Dieguez
af5587197f Update Galician translation 2022-10-01 19:08:56 +00:00
Luming Zh
b39569cb2e Update Chinese (China) translation 2022-10-01 14:19:37 +00:00
Jehan
892b62ec36 app, libgimp, pdb, plug-ins: new GimpTextLayer class in libgimp.
Now text layers are proper types, which means that the binding API will also be
nicer (e.g. `txt_layer.set_text('hello world')` in Python).

This commit also adds the param specs allowing to create plug-in procedures with
text layer parameters.

Finally it fixes the few calls in file-pdf-save (apparently the only plug-in
using specific text layer API right now) with explicit type conversion.
2022-09-30 20:55:51 +02:00
Gotam Gorabh
091ce7cdf2 libgimp: Add scrollbar to dialog comments
Resolves #8550
Puts comments widget in GtkScrolledWindow widget to prevent
dialogue growing too tall with multi-line comments.
2022-09-30 18:54:07 +00:00
Yuri Chornoivan
aec5c3c108 Update Ukrainian translation 2022-09-30 17:20:50 +00:00
Martin
471f9e641b Update Slovenian translation 2022-09-30 16:18:54 +00:00
Jehan
690949eb34 app, libgimp, pdb: add a note about unsupported markup.
After re-reading #534, I realized I missed the discussion about unsupported
markup by the tool. Then I tested and confirmed what Ian Munsie initially said
in a comment: unsupported markups are properly rendered in the text layer, yet
are simply dropped when editing with the text tool.

This is actually the ideal behavior as it means that with the API, you can even
go further than what is currently possible with the GUI. So it gives nice powers
to people who can script GIMP. We still need some warning in the function
documentation to tell developers about this weakness in the tool GUI.
2022-09-30 00:59:10 +02:00
Jehan
9aa32ffe42 themes: fix textview background color.
It seems I had forgotten some hardcoded color in there. I didn't notice it until
now, because it was not that bad in the few instances where it was shown (for
instance the comment field in export plug-ins), but I really realized there was
a problem with the Python console which was not too practical (white writing on
kinda light background).
2022-09-30 00:51:33 +02:00
Ian Munsie
445909bff5 Issue #534: add a function to set the Pango markup of a text layer
This complements the existing text_layer_get_markup function and allows
scripts to create and modify complex text layers.

It adds the <markup> root tag if it was not supplied and will run the
markup through pango_parse_markup() to check for errors.

Reviewer's (Jehan) note: this is a mostly untouched patch contributed in #534,
except that code moved around. I also fixed the header set in the .pdb, a link
to pango markup docs and added the meson changes.
2022-09-30 00:50:34 +02:00
Jehan
8dcc9345fa libgimp: fix GObject-Introspection build in autotools.
Fixes:

> /usr/bin/ld: ../libgimp/.libs/libgimpui-3.0.so: undefined reference to `gimp_check_custom_color2'

I am actually unsure this fix is fine. It doesn't look like it should
work. And worse, I can't reproduce the fix by reverting it after.

The only other person who reported it was akk, with exactly the same
symptoms.
2022-09-29 23:11:38 +02:00
Jehan
c342bcf1d9 NEWS: update. 2022-09-29 22:47:18 +02:00
Jehan
4e08ab9659 themes: add some border theming to default and active buttons.
I noticed some buttons had a bluish border, showing the system theme leaking
over our default theme. So I'm just overriding this with a grayscale color.

These 2 new rules are especially useful in dialogs so that you know what happens
when you hit "Enter". The "default" action (.suggested-action in GTK CSS) is the
action we set to be the active one by default. E.g. if you open a dialog and hit
Enter immediately, without touching any widget focus, this is what will be
activated.

The GTK CSS .default action on the other hand seems to simply be the button with
focus right now, which can be changed through Tab or other ways. If both types
of styles are visible, the .default one is the actually activated action (not
.suggested-action), which is why I make its style a bit stronger (solid rather
than dotted and a bit more opaque).

Also I discover the shade() function to reuse a color and adding it
transparency!
2022-09-29 21:06:47 +02:00
Jehan
5c53fe7b49 themes: no different background for checked check/radio buttons.
Checked buttons had a background using the @selected-color. This was because of
a too broad rule on `.text-button:checked`. Basically it looks like the broad
rules are not good because they sometimes override more accurate rules for
specific widgets.

I also make a few more rules a bit more accurate. Also I extend some CSS rules
for check and radio buttons.
2022-09-29 19:59:55 +02:00
Alx Sa
4ddb71c8ac plug-ins: Export PSD as CMYK file
Adds an option to export as CMYK (mutually exclusive with the existing
Duotone export option). Header information (mode and number of channels)
are set, and the data itself is converted via Babl.
Layer channels are also hardcoded to 4, since GIMP currently doesn't
support CMYK channels.
2022-09-29 17:27:03 +00:00
Jehan
91ec8a34f3 themes: have the "extreme" CSS colors a bit less extreme.
We had some concept of slightly more extreme theme colors (i.e. darker in dark
themes) to color differently in some widget-in-widget cases.

For instance, we use this in the treeview list to separate it better from nearby
interface. But this extreme dark background may have been a bit "too dark", as
reported by Jacob. The goal is for this list to stand out, but maybe it was
standing out too much. Hopefully it's better now.

As a side change, I also add some borders to the top icon header (with "eye" and
"lock" icons) just above the list. I think it better explain the separation.
2022-09-29 19:01:00 +02:00
Daniel Novomeský
403d11330c flatpak: minor fixes in libde265 and libjxl modules
don't build unnecessary tools from libde265
libjxl uses existing BROTLI library instead of bundled one
2022-09-29 11:51:47 +00:00
Jehan
4ab1102ae2 themes: switch should have a border otherwise it's hard to understand. 2022-09-29 00:04:12 +02:00
Jehan
7c96fc723c Issue #8670: the color of the "selected text" field seems too dark.
Just use an inverted logic for the selected text (i.e. white on black in light
mode, or black on white in dark mode). This is the usual logic for rendering
selected text anyway (except that we don't use non-grayscale colors, e.g. blue
background is common in system themes).
2022-09-28 23:27:50 +02:00
Jehan
a021b1999a libgimp: change signature of get_window() of GimpProgressVtable.
As diagnosed in #8649, using a guint32 for windows identifier may have been
right long ago (was it?), but is definitely not anymore. I can see that a XID is
an unsigned long nowadays (usually 64-bit on 64-bit Linux).

As far as I can see, on Windows, it would be a void* behind (which also
corresponds to the error message in #8649 description):

> typedef void *PVOID;
> typedef PVOID HANDLE;
> typedef HANDLE HWND;

Cf. https://learn.microsoft.com/en-us/windows/win32/winprog/windows-data-types

I *think* that pointers would be 64-bit on Windows 64-bit, though I'm unsure
(after all, this is an OS with 32-bit long int on 64-bit arch!).

Anyway, it's just better to move to 64-bit window identifiers.
2022-09-28 22:41:05 +02:00
Jehan
a93249fa65 Issue #8649: fix "incompatible pointer to integer conversion".
Since Clang 15.0.0:

> The -Wint-conversion warning diagnostic for implicit int <-> pointer
> conversions now defaults to an error in all C language modes. It may be
> downgraded to a warning with -Wno-error=int-conversion, or disabled entirely
> with -Wno-int-conversion.
2022-09-28 22:34:05 +02:00
Jehan
d3458a82d0 Issue #7023: icon size selection on GIMP 2.99.
This kinda reverts commit 6aebd30de1 ("app: remove
icon sizing preferences"), except that the code base is different enough since
this old commit was mainly for GIMP 2.10.x.
In any case, after initially thinking that GTK+3 handling for high density
display would be enough, we finally decide that adding back a Preferences-wide
setting for overriding the theme-set icon size is a good idea (additionally to
GTK+3 automatic support).

The base idea for removing the feature was that GTK+3 has high density display
support, through the "scale factor". Typically a high density display will
normally be set as using a ×2 scale factor so all icons will be double size.
Unfortunately it turns out it's not enough.

For instance, on very small screen estate, even with a scale factor of 1, if the
theme sets 24px toolbox icons, it may still take too much space.
Oppositely on huge screens, even with ×2 factor scale detected by the OS, the
icons may still feel too small (this is possibly what happens with #7023).

Furthermore there is also a matter of taste. Some people like small icons even
when they have the space. Others may want bigger icons, easy to click on.

Finally you can like a theme for its color scheme for instance, but it may not
have the icon size you want. Right now, we'd need to duplicate every theme in
small or bigger size. Instead of doing so, let's just have this global setting
overriding the theme rules.

Comparison with the 2.10 implementation:

- We still provide 4 sizes: small, medium, large and huge.
- We don't have the "Guess ideal size" setting anymore. Instead this is now a
  mix of the GTK+3 scale factor logic and the theme-set or custom size. I.e.
  that on a high density display with ×2 scale factor, we could have toolbox
  icons up to 96 pixels (48×2)!
- We now try to have less custom code in widgets as we append the CSS rules to
  the theme (similar to what we were already doing for dark theme or icon
  variants). What happens in widget code is mostly to connect to changes in
  themes and redraw the widgets which need to be.
- The custom size will now affect: toolbox icons, the FG/BG editor widget (in
  both the toolbox and the color dockable), dockable tab icons, the main
  dockable buttons, eye and lock header icons in item tree views, eye and lock
  cell icons in the item lists.

There are still a bunch of areas where it is not taken into account, such as
plug-ins, and various dialogs, but even in custom-made interface in dockables.
Ultimately it might be interesting to have a way to sync more buttons and
widgets to a global size settings.

Lastly, I fixed a bunch of existing bugs where we were updating icon sizes with
gtk_image_set_from_icon_name() using the const icon name taken from
gtk_image_get_icon_name(). As this was reusing the same string pointer, we were
ending with freeing the icon name.
2022-09-28 21:11:58 +02:00
Jehan
b48bd7d337 themes: do not set a background-color on all .horizontal class widgets.
This was massively breaking GtkScale rendering. Or at least the marks (and mark
texts) added by gtk_scale_add_mark() were simply invisible.
I tried to figure why, staring at the GTK inspector and testing various CSS
rules to fix it without removing this line, but just couldn't make sense of it.
In the end, I'll just remove this line. It looks like in CSS (or just GTK CSS?),
it might be better to set rules on accurate widgets rather than too broad rules. 🤷
2022-09-28 20:49:54 +02:00
Tim Sabsch
1dda74a849 Update German translation 2022-09-27 16:16:31 +00:00
Jehan
624493af4b app: properly resize the GimpFgBgEditor when changing icon size.
This is the needed improvements I was talking about in commit 00fbcbea0b. Right
now, when changing the icon size, the FG/BG color widget was not immediately
resizing. It needed a restart of GIMP.

Now it will properly react to "style-updated" signal, but also to "theme"
property of GimpGuiConfig.
The reset of the color icon pixbufs is also needed when GimpFgBgEditor size is
re-allocated.
2022-09-26 21:53:13 +02:00
Jehan
dfbaf4d501 app: make sure the icon size and button relief are updated when changing theme.
When changing the theme, the style-updated signal is *usually* run, but not
always. For instance, moving from a theme with big icons to one with smaller
icons (or the other way around) sometimes work, and sometimes doesn't. I'm not
sure if it's to be considered a bug in GTK or if this signal depends on other
things. Anyway we have our own "theme" signal on the GimpGuiConfig and we know
exactly that we need to make sure that the icons are properly redrawn in such a
case. So let's just connect to this signal.
2022-09-26 21:10:30 +02:00
Jehan
d2cf2813dd themes: new "Middle Gray" theme.
So what we read on the topic is to use (as base color) the gray which is
perceptually half-way between black and white. Unfortunately it can mean
different colors. For instance if using the sRGB TRC, the #808080 color is
sometimes cited.

Instead I went with the color LCH (50, 0, 0), i.e. with half perceptual
lightness in "CIE LCH(ab) float" babl space, i.e. #777777 in sRGB. It
corresponds to the 18.42% gray which is often refered to, so it seemed a fine
choice.

This replaces proposal in !683 because the contributor is not responding
anymore, and also it uses the common theme base CSS files used by all other
official themes.
2022-09-26 18:37:16 +02:00
Daniel Novomeský
0f8f3c3f1a flatpak: enable BMFF format support in exiv2
Improves AVIF, HEIF, JPEG XL metadata support.
2022-09-23 13:30:12 +02:00
Daniel Novomeský
e0ef799473 flatpak: upgrade libheif and libjxl 2022-09-22 16:32:33 +02:00
Balázs Úr
a50a4ddd1b Update Hungarian translation 2022-09-20 22:07:08 +00:00
Balázs Meskó
524317753a Update Hungarian translation 2022-09-19 23:04:03 +00:00
Balázs Úr
4bb592fd71 Update Hungarian translation 2022-09-19 22:52:19 +00:00
Daniel Novomeský
213aa77fc9 plug-ins: RGB AVIF compatibility with Safari on iOS 16.0
Write both ICC and NCLX boxes for RGB AVIF to make sure that
all browsers render the AVIF images in same manner.
Use heif_init/heif_deinit in libheif 1.13.0+
2022-09-19 14:01:11 +02:00
Martin
bb0e243374 Update Slovenian translation 2022-09-18 09:39:31 +00:00
Sveinn í Felli
dbe81ac91c Update Icelandic translation 2022-09-16 21:48:54 +00:00
Sveinn í Felli
6b10d6e8c1 Update Icelandic translation 2022-09-15 22:45:59 +00:00
Fran Dieguez
27bbc8a5df Update Galician translation 2022-09-15 06:26:32 +00:00
Zurab Kargareteli
42330e30af Update Georgian translation 2022-09-14 15:45:00 +00:00
Boyuan Yang
e94411661e Update Chinese (China) translation 2022-09-13 18:13:04 +00:00
Anders Jonsson
250d82cc7c Update Swedish translation 2022-09-13 17:17:59 +00:00
Anders Jonsson
46e75e952c Update Swedish translation 2022-09-13 17:04:14 +00:00
Boyuan Yang
7c9a1f5021 Update Chinese (China) translation 2022-09-11 19:30:56 +00:00
Hugo Carvalho
1c5c1d90b8 Update Portuguese translation 2022-09-11 13:46:58 +00:00
Yuri Chornoivan
2f6ca56301 Update Ukrainian translation 2022-09-11 06:11:09 +00:00
Jehan
2c3e65a6b6 NEWS: update. 2022-09-10 23:45:08 +02:00
Thomas Klausner
22dee60a9d Issue #8605: Unportable test(1) operator in tools/extract-vector-icon.sh 2022-09-10 23:08:06 +02:00
Jehan
2be2c43c9c plug-ins: new "root-layers-only" argument to file-pdf-save.
Something I wanted to implement for a long time and today I finally took
the time after I had one more annoying case where I had to merge all
groups for exporting then undo for saving!

Now this won't be needed anymore as the plug-in will allow to export
only as pages any first-level layers (groups included, so you could
gather your page compositions in root layer groups). For me, it's the
only way I use this when making/editing PDFs with GIMP, but maybe some
people would still want GIMP to crawl into groups and subgroups and
export layers individually. That's why I make it an option, defaulting
at TRUE.
2022-09-10 22:56:01 +02:00
Jehan
e3ce70c5e8 plug-ins: port "file-pdf-save" to GimpProcedureDialog.
Note that I didn't port "file-pdf-save-multi" at this point, though I
did move to using GimpProcedureConfig instead of GimpValueArray
everywhere.

In any case, that's a lot of code removal and simplification already,
though some part of this plug-in is still a bit ugly.

We also get proper config storing between sessions now.

As for metadata, it unfortunately doesn't look like Exiv2 has PDF
support, so I didn't add metadata settings.
2022-09-10 22:23:03 +02:00
Jehan
b24d4c93e2 libgimp: deactivate metadata flags without appropriate property in…
… gimp_procedure_config_save_metadata().

If you use gimp_procedure_config_save_metadata() or
gimp_procedure_config_end_export(), you don't really control the flags
and let the GimpProcedure API make somes choices for you, based on
various assumptions. One of them is that the procedure has specific
properties (named "save-*", either created manually or with the various
gimp_save_procedure_set_support_*() functions). So if you don't have
them, we should assume this format doesn't handle a given metadata
format and deactivate it.

For plug-ins with a different/specific logic, they are expected not to
use these helper functions. They would likely call lower level functions
such as gimp_image_metadata_save_finish() or the newer
gimp_image_metadata_save_filter(), where you control the metadata flags.
2022-09-10 21:35:00 +02:00
Jehan
646bc3e43b Issue #8604: NetBSD does not provide libdl.
The dl*() functions are in libc directly. This probably applies to all
*BSD too. And from what I read, it should even apply to macOS, even
though a libdl is present there (is it bogus?).

So let's make the libdl check proper by only make it mandatory on Linux
(on Windows it was already unchecked too).
2022-09-10 17:42:28 +02:00
Jehan
a78651aca4 Issue #8604: Linux Input is enabled even though it is not Linux.
Fix the Linux Input test to correctly only depend on whether or not the
header is present. Having X11 target is not enough (e.g. it breaks the
build for NetBSD and probably on all BSDs).
2022-09-10 14:50:38 +02:00
Jehan
76bc349279 devel-docs: starting to move development documents to dev website.
This file was just moved as content/core/specifications/locks.md in the
pat/bootstrap branch of the gimp-web-devel repository.
This branch will soon be merged and become our new website. Removing the
now duplicate in our source repo.
2022-09-09 21:12:25 +02:00
Jehan
cfeedb8736 data, devel-docs, gitlab-ci: improve the docs tarball.
- Use a relative path for GIMP_LOGO_PATH inside the gi-docgen generated
  HTML, and not an absolute path taken from build dir (otherwise this
  would break, for installed docs, but also for the tarball and the
  developer website!).
- Also use either gimp-logo.png or gimp-devel-logo.png depending on
  whether we are on a stable or unstable branch.
- Install these in images/ inside the GIMP docs folder, which
  corresponds to the relative path given to GIMP_LOGO_PATH.
- The installed root dir will be $datadir/doc/gimp-2.99/, e.g.
  /usr/share/doc/gimp-2.99/
- Inside this folder, the library references will be in libgimp-3.0/ and
  libgimpui-3.0/ (instead of weird Gimp-3.0/ and GimpUi-3.0/). Note that
  the root dir uses the application version (2.99) whereas the library
  folder use the API versions. These are different in development phase.
- Archive the gi-docgen installed files, not taken from the build dir,
  to avoid packaging temp files, such as the .toml files. Note that
  `g-ir-docs` files are still taken from the build dir, as we don't
  install them yet.
- Finally package all this in a directory before archiving in a tar.xz,
  named the same as the directory (e.g. gimp-api-docs-2.99.13/ inside
  gimp-api-docs-2.99.13.tar.xz).
2022-09-09 20:32:27 +02:00
Jehan
faff5d00b5 gitlab-ci: generate tarball for GIMP documentation. 2022-09-09 16:54:28 +02:00
Sveinn í Felli
ccfb56d6ce Update Icelandic translation 2022-09-08 16:48:47 +00:00
Sveinn í Felli
c183b4478b Update Icelandic translation 2022-09-08 16:46:18 +00:00
Sveinn í Felli
fb386d09c9 Update Icelandic translation 2022-09-08 16:44:47 +00:00
Sveinn í Felli
49b2241055 Update Icelandic translation 2022-09-08 16:41:41 +00:00
Lukas Oberhuber
7f257a3a33 gimp-updates: fix update checks on macOS
Update processing has to be done on the main thread to avoid
problems with GTK thread safety.
2022-09-06 21:29:18 +01:00
Jordi Mas
f45a62d672 Update Catalan translation 2022-09-06 19:56:52 +02:00
Jehan
fbb5b40345 app, autotools, meson: new GIMP_RELEASE macro.
We were using GIMP_UNSTABLE extensively to differentiate development
from stable code. But there is actually another level of development
code. Basically GIMP_UNSTABLE tells you are on the development branch,
e.g. for current branches, that you are on 2.99.* versions (vs. 2.10).
This depends on the minor version oddness.

GIMP_RELEASE will tell you if it's a release or a in-between-releases
code. This works with the micro version which must be even on release.
Any odd number means you are basically using random git code.

There can be any combination of GIMP_RELEASE and GIMP_UNSTABLE. For
instance 2.99.12 is a release of the unstable branch, whereas 2.10.33 is
development code of the stable branch.

I use this first in the update code as we were using GIMP_UNSTABLE for
both concepts but it made it harder to test. Now:

* GIMP_DEV_VERSIONS_JSON environment variable is only available on
  development code, not on release (whether stable or unstable).
* The weekly check limitation is also only for releases (dev code just
  check at every startup to quickly detect issues and regressions).
* Whether to look on testing website or public website json file depends
  on the code being a release or not.
* Finally only whether to check "DEVELOPMENT" or "STABLE" sections in
  the json file depends on whether we are on stable or unstable
  branches.
2022-09-05 22:16:56 +02:00
Lukas Oberhuber
5735bd7fa8 check_for_updates: fixes update check macos #7325
This was not working due to a missing port in glib.

Potentially could be contributed upstream to GLib.

(cherry picked from commit b391f9f5c8)

Conflicts fixed:
	app/gimp-update.c
2022-09-05 16:33:57 +02:00
Hanabishi
76728fee01 Fix 'gimp-script-fu-interpreter' version
It supposed to use api version instead of app version. And seems like the symlink is excessive, it can't be run by user anyway.
2022-09-05 05:33:32 +05:00
Daniel Novomeský
75121fdbc8 build: remove ilmbase from crossroad build,
because it is no longer offered by MSYS2
2022-09-03 19:19:30 +00:00
Daniel Novomeský
a61299ddb1 plug-ins: fix builing with libheif 1.13.0+ 2022-09-03 19:19:30 +00:00
Zurab Kargareteli
937a7774c2 Update Georgian translation 2022-09-03 18:27:27 +00:00
Hugo Carvalho
f48de7a041 Update Portuguese translation 2022-09-02 14:11:10 +00:00
Hugo Carvalho
cd6011db71 Update Portuguese translation 2022-09-02 13:42:25 +00:00
Balázs Úr
640f9c6bf9 Update Hungarian translation 2022-09-01 23:15:06 +00:00
Jehan
47a56cf644 NEWS: kickstart GIMP 2.99.14 release notes. 2022-08-31 16:34:35 +02:00
Jehan
d4f12a843a Issue #8561: unrecognized command-line options '-mmx', '-sse'.
Fixes:

> gcc: error: unrecognized command-line options '-mmx'; did you mean '-mmmx'?
> gcc: error: unrecognized command-line options '-sse'; did you mean '-msse'?
2022-08-31 15:31:00 +02:00
Hanabishi
358ba0991f Cleanup meson symlinks
More elegant solution to avoid platform-dependent executable extension detection
2022-08-31 13:10:13 +00:00
Jehan
08b7de3b13 Issue #8520: show devel download link when relevant.
This is shown in the About dialog when a new version is available, but
also in the debug dialog (also when a new version is available).

Of course, for stable versions, we should still show the main download
page (which I double-checked current code does).
2022-08-31 13:13:27 +02:00
Jehan
99d16a6f31 meson: fix one more deprecation warning when cross-building.
This meson warning was only showing when configuring a cross-compilation
project.

Fixes:

> WARNING: Project targets '>=0.56.0' but uses feature deprecated since '0.55.0': meson.has_exe_wrapper. use meson.can_run_host_binaries instead.
2022-08-31 12:42:08 +02:00
Jehan
a791151ed0 meson: update the end WARNING about meson being experimental.
Now we call it "extensive testing phase" and encourage packagers to use
meson and report bugs.
2022-08-31 01:40:12 +02:00
Jehan
ca230cb770 meson: fix warnings of deprecated features.
Now that we bumped our meson requirement, meson is complaining about
several features now deprecated even in the minimum required meson
version:

s/meson.source_root/meson.project_source_root/ to fix:

> WARNING: Project targets '>=0.56.0' but uses feature deprecated since '0.56.0': meson.source_root. use meson.project_source_root() or meson.global_source_root() instead.

s/meson.build_root/meson.project_build_root/ to fix:

> WARNING: Project targets '>=0.56.0' but uses feature deprecated since '0.56.0': meson.build_root. use meson.project_build_root() or meson.global_build_root() instead.

Fixing using path() on xdg_email and python ExternalProgram variables:

> WARNING: Project targets '>=0.56.0' but uses feature deprecated since '0.55.0': ExternalProgram.path. use ExternalProgram.full_path() instead

s/get_pkgconfig_variable *(\([^)]*\))/get_variable(pkgconfig: \1)/ to
fix:

> WARNING: Project targets '>=0.56.0' but uses feature deprecated since '0.56.0': dependency.get_pkgconfig_variable. use dependency.get_variable(pkgconfig : ...) instead
2022-08-31 01:29:37 +02:00
Jehan
9ff1358e0b Issue #8552: Failed to build using gimp-2.99.12-autotools.tar.bz2 tarball. 2022-08-31 00:46:29 +02:00
Jehan
dd53de0f0b meson: bump our requirement to meson 0.56.0.
For meson, I want to be particularly careful and not follow the "Debian
testing" rule as it bit us by the past for babl.
But this bump is probably OK:

* Debian stable has meson 0.56.2.
* meson 0.56.0 was released on 2020-10-30.
* GIMP 2.99 is a dev branch with no end release date yet.

This should also fix this warning at configuration time:

> WARNING: Project specifies a minimum meson_version '>=0.53.0' but uses features which were added in newer versions:
>  * 0.55.0: {'Calling "add_dist_script" with File, CustomTarget, Index of CustomTarget, Executable, or ExternalProgram'}

We missed it until now because it was only happening with tarball builds
where gitversion_h could be a files() object, unlike in git builds.
2022-08-31 00:15:36 +02:00
Jehan
76df38399c Issue #8537: GIMP 2.99 tarball fails to configure with Meson. 2022-08-31 00:06:31 +02:00
Jacob Boerema
85134478c7 plug-ins: fix #8553 GIMP 2.99.12 Cannot Open WebP Files
GIMP tried to open webp files as ani (animated cursor) files. The reason
for this is that for ani we had set the file magic as the first 4 bytes
should be RIFF.

However, RIFF is a container format, used by many different file formats,
among which is also webp.
This means that checking for RIFF is not specific enough.

Based on the info on http://fileformats.archiveteam.org/wiki/ANI
we will check the 4 bytes starting at offset 8 for ACON, which is
apparently the identifying part for animated icons.
2022-08-30 15:33:12 -04:00
Balázs Úr
6324f3f142 Update Hungarian translation 2022-08-29 22:47:24 +00:00
Jacob Boerema
268b063c00 plug-ins: fix #8548 export to mng not working
Due to a typo in the config property "default-delay", loading of that
option and the ones after it, failed.

Because of this, default-chunks had an invalid value, which made our
export fail. After correcting the typo the export succeeds.
2022-08-29 12:14:54 -04:00
Jehan
9ce27be989 meson: improve/fix previous commit from MR !725.
- Setting an exec_dir variable is an error. As meson docs says, if
  relative, it is installed relatively to prefix anyway: "If this is a
  relative path, it is assumed to be relative to the prefix."
  On the other hand, it would make problems if someone tried to set an
  absolute bindir.
  Moreover it is a lot clearer now. When we want to install in the
  binary directory unconditionally, then get_option('bindir') is the
  meson way, hence the way to go.
- On the other hand, the `gimp-debug-tool` is installed either in bindir
  for Windows or macOS and libexecdir for all other platforms, at least
  that's how it's set in the autotools build. So let's keep both builds
  consistent.
- Make a hopefully clearer description for enable-default-bin option.
  Let's clarify this is just about creating unversionning links pointing
  to versionned files.
- Adding an item in the "Optional Features" part of the summary listing
  during meson configure, for better discovery.

For the ".exe" extension on Windows, I wished we had an $(EXEEXT)
equivalent on meson rather than trying to set it ourselves (are there
other platforms where we must set a different extension?). But I could
not find any.
2022-08-29 15:43:25 +02:00
Hanabishi
879f7b48de Issue #8546: Meson options fixes
- Implement `enable-console-bin` meson option
- Fix wrong `enable-default-bin` behavior in docs
- Implement `enable-default-bin` meson option
2022-08-29 13:41:08 +00:00
Piotr Drąg
b2729643f8 Update Polish translation 2022-08-28 15:26:07 +02:00
Jehan
efbc422a9d tools: small update to the stats script.
- GTK+3 themes are CSS.
- Also check for cursor updates.
2022-08-28 15:17:19 +02:00
Jehan
e52da94072 NEWS: update.
Minor fix, missing new feature and removing a DDS feature which appeared
in GIMP 2.10.32.
2022-08-28 15:03:36 +02:00
Martin
50a1fd6ed3 Update Slovenian translation 2022-08-26 12:05:01 +00:00
Yuri Chornoivan
82789d469c Update Ukrainian translation 2022-08-25 20:15:01 +00:00
Jacob Boerema
fac6b2f3f1 plug-ins: improve formatting and comments related to resolution export ...
for PSD's
2022-08-24 14:19:46 -04:00
Jacob Boerema
24886f91b1 plug-ins: fix #8508 Print exporting to PSD seems to export as cm ...
and import as inches

When GIMP's display unit was mm, our PSD export converted the X and Y
resolution as if a conversion from mm to inch was needed.

However, PSD's resolution is always measured in pixels per inch, so a
conversion is never necessary.
Removing the conversion, resolves the issue.
2022-08-24 14:19:46 -04:00
Zurab Kargareteli
0dbb00a3c9 Update Georgian translation 2022-08-24 06:44:23 +00:00
Jacob Boerema
0ad54f863a plug-ins: fix #8467 "incorrect value RichTIFFIPTC" when loading TIFF ...
created by Adobe Lightroom 5.1

Adobe products are known to write incorrect RichTIFFIPTC tags in TIFF
images.

Since libtiff correctly detects and handles this there is no real need
for end users to be warned. So instead of a warning we will only output
a message to stderr.
2022-08-23 17:27:18 -04:00
Jacob Boerema
ced071a8ee plug-ins: check for invalid resolution when loading TIFF image
This is essentially the same check as done in gimp_image_set_resolution,
but doing it here means we can load the image instead of throwing an
error.

We still need to get replacement xres and yres values, because these are
used to compute layer_offset_x_pixel and layer_offset_y_pixel.
2022-08-23 17:27:18 -04:00
Jacob Boerema
18d466df7f plug-ins: fix GIMP becoming unresponsive due to corrupt image
Image m2-d0f86ab189cbe900ec389ca6d7464713.tif from the imagetestsuite
is a fuzzed image with an invalid very high number for the channel count.

This causes GIMP to become unresponsive for a very long time. Possibly
trying to allocate memory for all channels or another cause related to
the high number of channels.

Let's go for a more "reasonable" limit of 99 channels like we also do
for Photoshop images and show a message when we find an image with more
channels.
2022-08-23 17:27:17 -04:00
Jacob Boerema
853e9d5cb4 plug-ins: fix crash when loading multi page TIFF images in non interactive mode
When loading a TIFF image using a script/plug-in in non interactive mode,
we did not initialize the list of pages, causing a crash when trying to
access it.

So, always initialize this list when non interactive.
2022-08-23 17:27:17 -04:00
Jacob Boerema
ac5a6e56b7 plug-ins: fix TIFF warnings about unknown tags not filtered out anymore
Due to a change in the format string in libtiff, warnings about unknown
fields were not filtered out anymore.

Adjust our filtering of warning messages so we catch this again since
end-users don't need to worry about this and we don't need the
possible extra issues.
2022-08-23 17:27:17 -04:00
Hugo Carvalho
a66989d534 Update Portuguese translation 2022-08-23 17:01:29 +00:00
Martin
106d0565bf Update Slovenian translation 2022-08-23 08:20:58 +00:00
3336 changed files with 718937 additions and 566523 deletions

View File

@@ -36,9 +36,7 @@ SpaceAfterCStyleCast: true
ColumnLimit: 80
PenaltyBreakAssignment: 60
PenaltyBreakBeforeFirstCallParameter: 100
PenaltyBreakString: 60
# Uncomment this when we start using clang-format 14 in the CI.
# PenaltyBreakOpenParenthesis: 40
PenaltyBreakOpenParenthesis: 40
PenaltyExcessCharacter: 1
# Strings are more often longer by usage, so let's give these slightly
# more space to breath.

56
.gitignore vendored
View File

@@ -1,56 +1,2 @@
# Meson
/_build
/compile_commands.json
# Atom editor
/.vscode
# Autotools
*.la
*.lo
*.o
*~
/*.config
/*.creator
/*.creator.user
/*.files
/*.includes
/ChangeLog
/Gimp-3.0.gir
/Gimp-3.0.typelib
/INSTALL
/Makefile
/Makefile.in
/aclocal.m4
/authors.md
/autom4te.cache
/compile
/config.cache
/config.guess
/config.h
/config.h.in
/config.log
/config.rpath
/config.status
/config.status.lineno
/config.sub
/configure
/cscope.files
/cscope.out
/depcomp
/gimp-3.0.pc
/gimp-zip
/gimpthumb-3.0.pc
/gimpui-3.0.pc
/git-version.h
/gtk-doc.make
/install-sh
/libtool
/ltmain.sh
/missing
/mkinstalldirs
/py-compile
/stamp-h
/stamp-h.in
/stamp-h1
/test-driver
/compile_commands.json

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,32 @@
#!/usr/bin/python3
# Equivalent to:
# configure_file(input: src,
# output: name / src,
# copy: true,
# install_dir: gimpplugindir / 'plug-ins' / name,
# install_mode: 'rwxr-xr-x')
# Except that configure_file() does not accept output in a subdirectory. So we
# use this wrapper for now.
# See: https://github.com/mesonbuild/meson/issues/2320
import os
import shutil
import stat
import sys
src_file = sys.argv[1]
dir_name = sys.argv[2]
dummy_path = None
if len(sys.argv) > 3:
dummy_path = sys.argv[3]
os.makedirs(dir_name, exist_ok=True)
file_name = os.path.basename(src_file)
dst_file = os.path.join(dir_name, file_name)
shutil.copyfile(src_file, dst_file)
os.chmod(dst_file, stat.S_IRWXU | stat.S_IRGRP | stat.S_IXGRP | stat.S_IROTH | stat.S_IXOTH)
if dummy_path is not None:
# Just touch the dummy file.
open(dummy_path, mode='w').close()

View File

@@ -1,3 +1,10 @@
<!-- ⚠️ IMPORTANT: READ ME! ⚠️
This is the default template for bug reports.
For feature requests or performance issues, please switch instead to the appropriate template in the "Choose a template" list.
It is important that you fill all the fields of the template.
-->
### Environment/Versions
- GIMP version:

View File

@@ -2,14 +2,13 @@
### Description of the feature
<!-- Please describe your feature with details.
Add screenshots, design images or other files which would help for
understanding the feature or for implementation.
Also add links when needed, for instance for implementation standards
or other relevant resources.-->
<!-- Please describe your feature with details. Also:
- If the feature is UI-related, add screenshots, mockups or videos;
- If the feature is about some standard or API, link relevant resources;
- If you have a patch, see: https://developer.gimp.org/core/submit-patch/ -->
### Use cases
<!-- If not obvious, explain the use cases or problems to solve. -->
<!-- Explain the use cases or problems to solve.
If you are unsure, you should first discuss with the community in the forums
or talk with the developers on IRC: https://www.gimp.org/discuss.html -->

View File

@@ -17,7 +17,7 @@ either in the last stable version of GIMP or on updated development code
<!-- Please record a performance log demonstrating the issue, and attach it to the report.
For more information, see
https://gitlab.gnome.org/GNOME/gimp/blob/master/devel-docs/performance-logs/performance-logs.md
https://developer.gimp.org/core/debug/performance-logs/
-->

View File

@@ -1,7 +1,7 @@
Contribution guidelines:
- Follow our coding style, which is mostly the GNU coding style
with some specificities: see [HACKING](HACKING#L123).
with some specificities: see [Coding Style](https://developer.gimp.org/core/coding_style/).
- Make sure no trailing spaces or tabs are left out.

11
.vscode/settings.json vendored Normal file
View File

@@ -0,0 +1,11 @@
{
"C_Cpp.clang_format_fallbackStyle": "GNU",
"editor.rulers": [
80
],
"editor.tabSize": 2,
"editor.renderControlCharacters": true,
"editor.renderWhitespace": "trailing",
"files.trimTrailingWhitespace": true,
"files.eol": "\n"
}

View File

@@ -4,20 +4,30 @@ Installation instructions for GIMP @GIMP_APP_VERSION@
There are some basic steps to building and installing GIMP.
GIMP @GIMP_APP_VERSION@ replaces earlier GIMP 2.x versions. It is advised that you
GIMP @GIMP_APP_VERSION@ replaces earlier GIMP 2.99.x versions. It is advised to
uninstall them before installing GIMP @GIMP_APP_VERSION@. Since libgimp* libraries
and data are all versionned anyway, it is possible to keep your older GIMP 2.x
installation in parallel to GIMP @GIMP_APP_VERSION@ on a same prefix.
and data are all versionned anyway, it is possible to keep your older
GIMP 2.x installation in parallel to GIMP @GIMP_APP_VERSION@ on a same prefix.
GIMP @GIMP_APP_VERSION@ is not backward compatible with GIMP 2.x version.
Plug-ins and scripts written for GIMP 2.8, 2.6 or earlier GIMP 2.x
versions will not work because the API changed.
GIMP @GIMP_APP_VERSION@ is not backward compatible with GIMP 2.10 and earlier
versions. Plug-ins and scripts written for GIMP 2.10, 2.8, 2.6 or
earlier GIMP 2.x versions will not work because the API changed.
The most important part is to make sure the requirements for a build
are fulfilled. We depend on a number of tools and libraries which are
listed below. For libraries this means you need to also have the
header files installed.
This file is generated (versions are filled by our build system) and
focuses on keeping an up-to-date list of dependencies intended to
packagers, contributors or whoever wants to compile GIMP from source.
Building and running self-built software often requires more setup, in
particular environment variables so that your system knows where to
find the various pieces of the software. The following document can
help in that regard:
https://developer.gimp.org/core/setup/build/
******************************************************************
* Unless you are experienced with building software from source, *
@@ -49,7 +59,7 @@ header files installed.
GIR data is when cross-compiling because of the difficulty to make cross-tools
for GObject Introspection.
Nevertheless if you have working GIR cross-tools, you can force the expected
behaviour with GIMP's meson option -Dcan-crosscompile-gir=true
behavior with GIMP's meson option -Dcan-crosscompile-gir=true
Optional:
@@ -67,7 +77,7 @@ header files installed.
4. You need to have installed GTK version @GTK_REQUIRED_VERSION@ or newer.
GIMP also needs a recent version of GLib (>= @GLIB_REQUIRED_VERSION@), GDK-Pixbuf
(>= @GDK_PIXBUF_REQUIRED_VERSION@), and Pango (>= @PANGOCAIRO_REQUIRED_VERSION@). Sources for these can be grabbed
(>= @GDK_PIXBUF_REQUIRED_VERSION@), and Pango (>= @PANGO_REQUIRED_VERSION@). Sources for these can be grabbed
from https://download.gnome.org/sources/.
5. We use cairo >= @CAIRO_REQUIRED_VERSION@, which is hosted at
@@ -201,14 +211,6 @@ header files installed.
17. Configure GIMP by running `meson _build`. You may want to pass some
options to it, see below.
Note that we now recommend officially to build GIMP with `meson`
instead of `autotools` (`configure` script, make, etc.).
The autotools build scripts are left alive a bit longer in the git
repository , so that we can revert the recommendation in case big
regressions were discovered.
So if you encounter issues with the meson build, now is the time to
report them!
18. Build GIMP by running `ninja -C _build'.
19. Install GIMP by running `ninja -C _build install'. In order to
@@ -245,7 +247,7 @@ header files installed.
libtiff @LIBTIFF_REQUIRED_VERSION@
Little CMS @LCMS_REQUIRED_VERSION@
mypaint-brushes-1.0
pangocairo @PANGOCAIRO_REQUIRED_VERSION@
pangocairo @PANGO_REQUIRED_VERSION@
poppler-data @POPPLER_DATA_REQUIRED_VERSION@
zlib
@@ -254,10 +256,12 @@ header files installed.
Package Name Version Feature
cairo-pdf @CAIRO_PDF_REQUIRED_VERSION@ PDF export
cfitsio - FITS
ExcHndl - Crash logs on Windows with Dr. MinGW
gs - ghostscript
libaa - ASCII art
libheif @LIBHEIF_REQUIRED_VERSION@ HEIF
libilbm - Amiga IFF/ILBM
libmng - MNG
libwebp @WEBP_REQUIRED_VERSION@ WebP (built with --enable-libwebpmux and --enable-libwebpdemux)
libwmf @WMF_REQUIRED_VERSION@ WMF
@@ -265,6 +269,7 @@ header files installed.
libxpm - XPM
openexr @OPENEXR_REQUIRED_VERSION@ OpenEXR
OpenJPEG @OPENJPEG_REQUIRED_VERSION@ JPEG 2000
qoi - QOI
webkit @WEBKITGTK_REQUIRED_VERSION@ Help browser & webpage
vala - Vala plug-ins

20
LICENSE
View File

@@ -27,3 +27,23 @@
* Icon themes are licensed under Creative Commons by-sa 3.0 or 4.0. See
the 'COPYING' files in icons/Symbolic and icons/Color respectively.
* Any data used in artworks, such as brushes, patterns and the like, and more
broadly likely all data inside the data/ folder should be under a CC0 license
(Creative Commons Zero) or equivalent, i.e. "No rights Reserved", because GIMP
contributors clearly don't intend to claim any right on anyone's work just
because they used GIMP and its default data.
We cannot clearly give proper licensing on all existing data, prior to the
addition of this note in the LICENSE file (for historical reasons, simply
because their contributors are since long gone), though we can say that an
uncountable number of users have used these for dozens of years and never had
legal problems as far as we know (it is anyway unclear whether anyone could
really claim any right for very basic brush or pattern usage). Since 2015, we
even have a clear FAQ entry to explicitly say the GIMP project has no
intention whatsoever to put restrictions on people's work:
https://www.gimp.org/docs/userfaq.html#can-i-use-gimp-commercially
Therefore any new data file under the data/ folder will be expected to be CC0.
All contributors are expected to read the LICENSE file and therefore are
implicitly agreeing to license their data under CC0 by contributing it as core
GIMP data.

View File

@@ -1,167 +0,0 @@
## Process this file with automake to produce Makefile.in
ACLOCAL_AMFLAGS = -I m4macros ${ACLOCAL_FLAGS}
if WITH_PDBGEN
PDB = pdb
endif
SUBDIRS = \
m4macros \
cursors \
themes \
po \
po-libgimp \
po-plug-ins \
po-python \
po-script-fu \
po-tips \
po-windows-installer \
data \
desktop \
menus \
libgimpbase \
tools \
$(PDB) \
icons \
libgimpcolor \
libgimpmath \
libgimpconfig \
libgimpmodule \
libgimpthumb \
libgimpwidgets \
libgimp \
app \
app-tools \
$(GIMP_MODULES) \
$(GIMP_PLUGINS) \
$(GIMP_EXTENSIONS) \
etc \
devel-docs \
docs \
build
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = \
gimp-@GIMP_PKGCONFIG_VERSION@.pc \
gimpthumb-@GIMP_PKGCONFIG_VERSION@.pc \
gimpui-@GIMP_PKGCONFIG_VERSION@.pc
AUTHORS: authors.xml authors.xsl
if HAVE_XSLTPROC
$(XSLTPROC) -o $(@) $(top_srcdir)/authors.xsl $< || rm -f $(@)
endif
authors.md: authors.xml authors4gimp-web.xsl
if HAVE_XSLTPROC
$(XSLTPROC) --stringparam today "`date --iso-8601=seconds`" -o $(@) $(top_srcdir)/authors4gimp-web.xsl $< || rm -f $(@)
endif
EXTRA_DIST = \
AUTHORS \
COPYING \
ChangeLog \
ChangeLog.pre-1-0 \
ChangeLog.pre-1-2 \
ChangeLog.pre-2-0 \
ChangeLog.pre-2-2 \
ChangeLog.pre-2-4 \
ChangeLog.pre-2-6 \
ChangeLog.pre-git \
INSTALL \
LICENSE \
NEWS \
NEWS.pre-2-0 \
NEWS.pre-2-2 \
NEWS.pre-2-4 \
NEWS.pre-2-6 \
NEWS.pre-2-8 \
NEWS.pre-2-10 \
README \
README.i18n \
authors.dtd \
authors.xml \
authors.xsl \
git-version.h
AM_DISTCHECK_CONFIGURE_FLAGS = --enable-gi-docgen --with-python=force --with-javascript=force --with-lua=force
check-defs:
@$(PYTHON) $(top_srcdir)/tools/defcheck.py $(top_srcdir) || \
( echo "*** .def files inconsistent ***"; exit 1; )
validate-authors:
if HAVE_XMLLINT
@cd $(srcdir); \
$(XMLLINT) --noout --valid authors.xml || \
( echo "*** authors.xml INVALID ***"; exit 1; )
endif
all-local: AUTHORS
dist-hook: check-defs validate-authors
CHANGELOG_START = 74424325abb54620b370f2595445b2b2a19fe5e7
ChangeLog: $(srcdir)/ChangeLog $(srcdir)/ChangeLog.pre-git
$(srcdir)/ChangeLog:
@echo Creating $@ based on git log
@if test -d "$(srcdir)/.git"; then \
(GIT_DIR=$(top_srcdir)/.git ./missing --run \
git log $(CHANGELOG_START)^.. --stat) | fmt --split-only > $@.tmp \
&& mv -f $@.tmp $@ && echo Appending ChangeLog.pre-git && cat ChangeLog.pre-git >> $@ \
|| ($(RM) $@.tmp; \
echo Failed to generate ChangeLog, your ChangeLog may be outdated >&2; \
(test -f $@ || echo git-log is required to generate this file >> $@)); \
else \
test -f $@ || \
(echo A git checkout and git-log is required to generate ChangeLog >&2 && \
echo A git checkout and git-log is required to generate this file >> $@); \
fi
.PHONY: $(srcdir)/ChangeLog
generated_sources = \
git-version.h
# Build git-version.h before anything in the subdirs as this is needed
# in the about and debug dialog (app/) and in the debug tool (tools/).
BUILT_SOURCES = $(generated_sources)
CLEANFILES = $(generated_sources)
# If git is available, always check if git-version.h should be
# updated. If git is not available, don't do anything if git-version.h
# already exists because then we are probably working with a tarball
# in which case the git-version.h we ship is correct.
git-version.h: update-git-version-header
@if test -e "$(top_srcdir)/.git"; then \
git_version="`git --git-dir=$(top_srcdir)/.git describe --always`"; \
git_version_abbrev="`git --git-dir=$(top_srcdir)/.git rev-parse --short HEAD`"; \
git_last_commit_year="`git --git-dir=$(top_srcdir)/.git log -n1 --reverse --pretty=%ci | cut -b 1-4`"; \
elif test ! -f "$@"; then \
git_version="Unknown, shouldn't happen"; \
git_version_abbrev="$$git_version"; \
git_last_commit_timestamp=-1; \
git_last_commit_year="`date -u '+%Y'`"; \
fi; \
if test -n "$$git_version"; then \
echo "#ifndef __GIT_VERSION_H__" > "$@.tmp"; \
echo "#define __GIT_VERSION_H__" >> "$@.tmp"; \
echo "#define GIMP_GIT_VERSION \"$$git_version\"" >> "$@.tmp"; \
echo "#define GIMP_GIT_VERSION_ABBREV \"$$git_version_abbrev\"" >> "$@.tmp"; \
echo "#define GIMP_GIT_LAST_COMMIT_YEAR \"$$git_last_commit_year\"" >> "$@.tmp"; \
echo "#endif /* __GIT_VERSION_H__ */" >> "$@.tmp"; \
fi
@if ( test -f "$@.tmp" && test -f "$@" && cmp "$@.tmp" "$@" > /dev/null ); then \
rm -f "$@.tmp"; \
elif test -f "$@.tmp"; then \
mv "$@.tmp" "$@"; \
echo " git HEAD changed: $@ regenerated"; \
fi
.PHONY: update-git-version-header

1128
NEWS

File diff suppressed because it is too large Load Diff

51
README
View File

@@ -30,8 +30,31 @@ The latest version of GIMP can be found at:
https://www.gimp.org/downloads/
We also have a website dedicated to documentation at:
2. Discussion Channels
https://docs.gimp.org/
2. Contributing
===============
GIMP source code can be found at:
https://gitlab.gnome.org/GNOME/gimp/
Resources for contributors:
https://developer.gimp.org/
In particular, you may want to look in the "Core Development" section. Some
articles of particular interest for newcomers could be:
* Setting up your developer environment: https://developer.gimp.org/core/setup/
* GIMP Coding Style: https://developer.gimp.org/core/coding_style/
* Submit your first patch: https://developer.gimp.org/core/submit-patch/
3. Discussion Channels
======================
We have several discussion channels dedicated to GIMP user and
@@ -39,30 +62,20 @@ development discussion. There is more info at:
https://www.gimp.org/discuss.html
Links to several archives of the mailing lists are included in that page.
Gimp-user-list is a mailing list dedicated to user problems, hints and
tips, discussion of cool effects, etc. Gimp-developer-list is oriented
to GIMP core and plug-in developers. Gimp-gui-list is for discussing
about GIMP interface to improve user experience. Most people will only
want to be subscribed to gimp-user-list. If you want to help develop
GIMP, the gimp-developer mailing list is a good starting point; if you
want to help with GUI design, the gimp-gui list is where you want to
subscribe.
Other discussion channels can be listed on this page when they are
moderated by a team member, such as forums.
Finally, for the real junkies, there are IRC channels devoted to GIMP.
On GIMPNet (a private free software oriented network) there is #gimp.
For the real junkies, there are IRC channels (e.g. #gimp or #gimp-user)
devoted to GIMP on GIMPNet (a private free software oriented network).
Many of the developers hang out there. Some of the GIMPNet servers are:
irc.gimp.org:6667
irc.us.gimp.org:6667
irc.eu.gimp.org:6667
More discussion channels, such as forums, will be listed on the above
"discuss" page when they are moderated by a team member.
Links to archives of former discussion methods (e.g. mailing lists) are
also included in that page.
3. Customizing
4. Customizing
==============
The look of GIMP's interface can be customized like any other GTK+ app
@@ -72,7 +85,7 @@ Additionally, GIMP reads `${XDG_CONFIG_HOME}/GIMP/2.99/gimp.css` so you
can have settings that only apply to GIMP.
You can also manually change the keybindings to any of your choice by
editing: `${XDG_CONFIG_HOME}/GIMP/2.99/menurc`.
editing: `${XDG_CONFIG_HOME}/GIMP/2.99/shortcutsrc`.
Have fun,

View File

@@ -1,9 +0,0 @@
m4_include([m4macros/alsa.m4])
m4_include([m4macros/ax_compare_version.m4])
m4_include([m4macros/ax_cxx_compile_stdcxx.m4])
m4_include([m4macros/ax_gcc_func_attribute.m4])
m4_include([m4macros/ax_prog_cc_for_build.m4])
m4_include([m4macros/ax_prog_perl_version.m4])
m4_include([m4macros/detectcflags.m4])
m4_include([m4macros/python3dev.m4])
m4_include([m4macros/vapigen.m4])

View File

@@ -1,6 +0,0 @@
/Makefile
/Makefile.in
/.deps
/.libs
/gimp-debug-tool-2.99
/gimp-debug-tool-2.99.exe

View File

@@ -1,85 +0,0 @@
## Process this file with automake to produce Makefile.in
AUTOMAKE_OPTIONS = subdir-objects
libapp = $(top_builddir)/app/libapp.a
libappwidgets = $(top_builddir)/app/widgets/libappwidgets.a
libgimpbase = $(top_builddir)/libgimpbase/libgimpbase-$(GIMP_API_VERSION).la
if PLATFORM_OSX
xobjective_c = "-xobjective-c"
xobjective_cxx = "-xobjective-c++"
xnone = "-xnone"
framework_appkit = -framework AppKit
endif
if OS_WIN32
bin_PROGRAMS = gimp-debug-tool-@GIMP_TOOL_VERSION@
else
if PLATFORM_OSX
bin_PROGRAMS = gimp-debug-tool-@GIMP_TOOL_VERSION@
else
libexec_PROGRAMS = gimp-debug-tool-@GIMP_TOOL_VERSION@
endif
endif
gimp_debug_tool_@GIMP_TOOL_VERSION@_SOURCES = \
gimp-debug-tool.c
gimp_debug_tool_@GIMP_TOOL_VERSION@_CPPFLAGS = \
-DCC_VERSION=\""$(CC_VERSION)"\" \
-I$(top_srcdir)/app \
-I$(top_builddir)/app \
$(AM_CPPFLAGS) \
$(GIO_CFLAGS) \
$(GEGL_CFLAGS) \
$(GTK_CFLAGS) \
$(FONTCONFIG_CFLAGS)
gimp_debug_tool_@GIMP_TOOL_VERSION@_LDADD = \
$(libappwidgets) \
$(libapp) \
$(libgimpbase) \
$(GIO_LIBS) \
$(GEGL_LIBS) \
$(GTK_LIBS) \
$(FONTCONFIG_LIBS)
AM_CPPFLAGS = \
-DGIMP_APP_VERSION=\"@GIMP_APP_VERSION@\" \
-DLOCALEDIR=\""$(gimplocaledir)"\" \
-DPREFIX=\""$(prefix)"\" \
-DEXEC_PREFIX=\""$(exec_prefix)"\" \
-DBINDIR=\""$(bindir)"\" \
-DSBINDIR=\""$(sbindir)"\" \
-DLIBEXECDIR=\""$(libexecdir)"\" \
-DDATADIR=\""$(datadir)"\" \
-DDATAROOTDIR=\""$(datarootdir)"\" \
-DSYSCONFDIR=\""$(sysconfdir)"\" \
-DSHAREDSTATEDIR=\""$(sharedstatedir)"\" \
-DLOCALSTATEDIR=\""$(localstatedir)"\" \
-DLIBDIR=\""$(libdir)"\" \
-DINFODIR=\""$(infodir)"\" \
-DMANDIR=\""$(mandir)"\" \
-DGIMPPLUGINDIR=\""$(gimpplugindir)"\" \
-DGIMPDATADIR=\""$(gimpdatadir)"\" \
-DCC=\""$(CC)"\" \
-DGIMPDIR=\""$(gimpdir)"\" \
-DGIMP_PLUGIN_VERSION=\""$(GIMP_PLUGIN_VERSION)"\" \
-I$(top_srcdir) \
$(GTK_CFLAGS) \
-I$(includedir)
AM_CFLAGS = \
$(xobjective_c)
AM_CXXFLAGS = \
$(xobjective_cxx)
AM_LDFLAGS = \
$(framework_appkit) \
$(xnone)

View File

@@ -1,5 +1,11 @@
if platform_windows or platform_osx
gimp_debug_tool_dir = get_option('bindir')
else
gimp_debug_tool_dir = get_option('libexecdir')
endif
gimp_debug_tool = executable('gimp-debug-tool-' + gimp_app_version,
gimp_debug_tool = executable('gimp-debug-tool' + exec_ver,
'gimp-debug-tool.c',
include_directories: rootInclude,
dependencies: [
@@ -14,5 +20,12 @@ gimp_debug_tool = executable('gimp-debug-tool-' + gimp_app_version,
libgimpbase,
],
install: true,
install_dir: get_option('libexecdir')
install_dir: gimp_debug_tool_dir
)
if enable_default_bin and meson.version().version_compare('>=0.61.0')
install_symlink(fs.name(gimp_debug_tool.full_path()).replace(exec_ver, ''),
pointing_to: fs.name(gimp_debug_tool.full_path()),
install_dir: gimp_debug_tool_dir
)
endif

9
app/.gitignore vendored
View File

@@ -1,9 +0,0 @@
/.deps
/.libs
/Makefile
/Makefile.in
/gimp-2.*
/gimp-console-2.*
/gimp.rc
/libapp.a
/makefile.mingw

View File

@@ -1,295 +0,0 @@
## Process this file with automake to produce Makefile.in
if PLATFORM_OSX
xobjective_c = "-xobjective-c"
xobjective_cxx = "-xobjective-c++"
xnone = "-xnone"
endif
libgimpbase = $(top_builddir)/libgimpbase/libgimpbase-$(GIMP_API_VERSION).la
libgimpconfig = $(top_builddir)/libgimpconfig/libgimpconfig-$(GIMP_API_VERSION).la
libgimpcolor = $(top_builddir)/libgimpcolor/libgimpcolor-$(GIMP_API_VERSION).la
libgimpmath = $(top_builddir)/libgimpmath/libgimpmath-$(GIMP_API_VERSION).la
libgimpmodule = $(top_builddir)/libgimpmodule/libgimpmodule-$(GIMP_API_VERSION).la
libgimpwidgets = $(top_builddir)/libgimpwidgets/libgimpwidgets-$(GIMP_API_VERSION).la
libgimpthumb = $(top_builddir)/libgimpthumb/libgimpthumb-$(GIMP_API_VERSION).la
# Sort this by architectural dependencies, lowest level at the top,
# so that when e.g. changing a header-file the subdirs are built in
# the right order
SUBDIRS = \
config \
core \
operations \
gegl \
text \
vectors \
paint \
plug-in \
xcf \
file \
file-data \
pdb \
widgets \
propgui \
display \
tools \
dialogs \
actions \
menus \
gui \
. \
tests
# Put the GIMP core in a lib so we can conveniently link against that
# in test cases
noinst_LIBRARIES = libapp.a
if ENABLE_GIMP_CONSOLE
bin_PROGRAMS = gimp-@GIMP_APP_VERSION@ gimp-console-@GIMP_APP_VERSION@
else
bin_PROGRAMS = gimp-@GIMP_APP_VERSION@
endif
libapp_sources = \
about.h \
app.c \
app.h \
errors.c \
errors.h \
language.c \
language.h \
sanity.c \
sanity.h \
signals.c \
signals.h \
tests.c \
tests.h \
unique.c \
unique.h \
gimp-debug.c \
gimp-debug.h \
gimp-intl.h \
gimp-log.c \
gimp-log.h \
gimp-priorities.h \
gimp-update.c \
gimp-update.h \
gimp-version.c \
gimp-version.h
libapp_a_SOURCES = $(libapp_sources)
gimp_@GIMP_APP_VERSION@_SOURCES = $(libapp_sources) main.c
if PLATFORM_LINUX
libdl = -ldl
endif
if PLATFORM_OSX
framework_cocoa = -framework Cocoa
endif
if OS_WIN32
win32_ldflags = -mwindows -Wl,--tsaware $(WIN32_LARGE_ADDRESS_AWARE)
# for GimpDashboard and GimpBacktrace
psapi_cflags = -DPSAPI_VERSION=1
libpsapi = -lpsapi
# for GimpBacktrace
libdbghelp = -ldbghelp
# for I_RpcExceptionFilter()
librpcrt4 = -lrpcrt4
if HAVE_EXCHNDL
exchndl = -lexchndl
endif
else
libm = -lm
endif
if ENABLE_RELOCATABLE_RESOURCES
munix = -Wl,-rpath '-Wl,$$ORIGIN/../lib'
endif
if HAVE_WINDRES
include $(top_srcdir)/build/windows/gimprc.rule
GIMPRC = gimp-$(GIMP_APP_VERSION).rc.o
GIMPCONSOLERC = gimp-console-$(GIMP_APP_VERSION).rc.o
endif
AM_CPPFLAGS = \
-DGIMPDIR=\""$(gimpdir)"\" \
-DLIBEXECDIR=\""$(libexecdir)"\" \
-DGIMP_USER_VERSION=\"$(GIMP_USER_VERSION)\" \
-DGIMP_TOOL_VERSION=\"$(GIMP_TOOL_VERSION)\" \
-DG_LOG_DOMAIN=\"Gimp\" \
-DGIMP_APP_GLUE_COMPILATION \
-DCC_VERSION=\""$(CC_VERSION)"\" \
-I$(top_srcdir) \
$(GTK_CFLAGS) \
$(PANGOCAIRO_CFLAGS) \
$(GEGL_CFLAGS) \
$(LCMS_CFLAGS) \
$(GEXIV2_CFLAGS) \
$(psapi_cflags) \
$(xobjective_c) \
-I$(includedir) \
-I$(builddir)/gui
# We need this due to circular dependencies
AM_LDFLAGS = \
$(munix) \
-Wl,-u,$(SYMPREFIX)gimp_vectors_undo_get_type \
-Wl,-u,$(SYMPREFIX)gimp_vectors_mod_undo_get_type \
-Wl,-u,$(SYMPREFIX)gimp_config_param_spec_duplicate \
-Wl,-u,$(SYMPREFIX)gimp_operations_init \
-Wl,-u,$(SYMPREFIX)xcf_init \
-Wl,-u,$(SYMPREFIX)internal_procs_init \
-Wl,-u,$(SYMPREFIX)gimp_pdb_compat_procs_register \
-Wl,-u,$(SYMPREFIX)gimp_plug_in_manager_restore \
-Wl,-u,$(SYMPREFIX)gimp_layer_mode_is_legacy \
-Wl,-u,$(SYMPREFIX)gimp_parallel_init \
-Wl,-u,$(SYMPREFIX)gimp_async_set_new \
-Wl,-u,$(SYMPREFIX)gimp_uncancelable_waitable_new
gimpconsoleldadd = \
xcf/libappxcf.a \
pdb/libappinternal-procs.a \
pdb/libapppdb.a \
plug-in/libappplug-in.a \
vectors/libappvectors.a \
core/libappcore.a \
file/libappfile.a \
file-data/libappfile-data.a \
text/libapptext.a \
paint/libapppaint.a \
operations/libappoperations.a \
operations/layer-modes/libapplayermodes.a \
operations/layer-modes-legacy/libapplayermodeslegacy.a \
gegl/libappgegl.a \
config/libappconfig.a \
$(libgimpconfig) \
$(libgimpmath) \
$(libgimpthumb) \
$(libgimpcolor) \
$(libgimpmodule) \
$(libgimpbase) \
$(APPSTREAM_GLIB_LIBS) \
$(GDK_PIXBUF_LIBS) \
$(FREETYPE_LIBS) \
$(FONTCONFIG_LIBS) \
$(PANGOCAIRO_LIBS) \
$(HARFBUZZ_LIBS) \
$(CAIRO_LIBS) \
$(GIO_UNIX_LIBS) \
$(GIO_WINDOWS_LIBS) \
$(GEGL_LIBS) \
$(GLIB_LIBS) \
$(LCMS_LIBS) \
$(GEXIV2_LIBS) \
$(Z_LIBS) \
$(JSON_C_LIBS) \
$(LIBARCHIVE_LIBS) \
$(LIBMYPAINT_LIBS) \
$(LIBBACKTRACE_LIBS) \
$(LIBUNWIND_LIBS) \
$(INTLLIBS) \
$(RT_LIBS) \
$(libm) \
$(libdl) \
$(libpsapi) \
$(libdbghelp) \
$(librpcrt4)
gimp_@GIMP_APP_VERSION@_LDFLAGS = \
$(AM_LDFLAGS) \
$(win32_ldflags) \
$(framework_cocoa) \
-Wl,-u,$(SYMPREFIX)gimp_lebl_dialog \
-Wl,-u,$(SYMPREFIX)gimp_core_pixbufs_get_resource \
-Wl,-u,$(SYMPREFIX)gimp_tool_cursors_get_resource
gimp_@GIMP_APP_VERSION@_LDADD = \
gui/libappgui.a \
menus/libappmenus.a \
actions/libappactions.a \
dialogs/libappdialogs.a \
tools/libapptools.a \
display/libappdisplay.a \
propgui/libapppropgui.a \
widgets/libappwidgets.a \
$(libgimpwidgets) \
$(GTK_LIBS) \
$(GTK_MAC_INTEGRATION_LIBS) \
$(gimpconsoleldadd) \
$(exchndl) \
$(GIMPRC)
if ENABLE_GIMP_CONSOLE
gimp_console_@GIMP_APP_VERSION@_SOURCES = $(libapp_sources) main.c
gimp_console_@GIMP_APP_VERSION@_CPPFLAGS = \
$(AM_CPPFLAGS) \
-DGIMP_CONSOLE_COMPILATION
gimp_console_@GIMP_APP_VERSION@_LDADD = \
$(gimpconsoleldadd) \
$(GIMPCONSOLERC)
endif
install-exec-hook:
if DEFAULT_BINARY
cd $(DESTDIR)$(bindir) \
&& rm -f gimp$(EXEEXT) \
&& $(LN_S) gimp-$(GIMP_APP_VERSION)$(EXEEXT) gimp$(EXEEXT)
if ENABLE_GIMP_CONSOLE
cd $(DESTDIR)$(bindir) \
&& rm -f gimp-console$(EXEEXT) \
&& $(LN_S) gimp-console-$(GIMP_APP_VERSION)$(EXEEXT) gimp-console$(EXEEXT)
endif
endif
uninstall-local:
if DEFAULT_BINARY
rm -f $(DESTDIR)$(bindir)/gimp$(EXEEXT)
if ENABLE_GIMP_CONSOLE
rm -f $(DESTDIR)$(bindir)/gimp-console$(EXEEXT)
endif
endif
# require gimp-console when making dist
#
if ENABLE_GIMP_CONSOLE
dist-check-gimp-console:
else
dist-check-gimp-console:
@echo "*** gimp-console must be enabled in order to make dist"
@false
endif
# hook to assure that the system gimprc and the gimprc manpage are
# uptodate when a release is made
#
dist-dump-gimprc: gimp-console-$(GIMP_APP_VERSION)$(EXEEXT)
./$< --dump-gimprc-system > gimprc.tmp \
&& (cmp -s gimprc.tmp $(top_srcdir)/etc/gimprc.in || \
cp gimprc.tmp $(top_srcdir)/etc/gimprc.in) \
&& rm gimprc.tmp
./$< --dump-gimprc-manpage > gimprc.tmp \
&& (cmp -s gimprc.tmp $(top_srcdir)/docs/gimprc.5.in ||\
cp gimprc.tmp $(top_srcdir)/docs/gimprc.5.in) \
&& rm gimprc.tmp
dist-hook: dist-check-gimp-console dist-dump-gimprc

View File

@@ -1,7 +0,0 @@
/Makefile
/Makefile.in
/.deps
/.libs
/*.lo
/libappactions.a
/libappactions.la

View File

@@ -1,206 +0,0 @@
## Process this file with automake to produce Makefile.in
AM_CPPFLAGS = \
-DG_LOG_DOMAIN=\"Gimp-Actions\" \
-I$(top_builddir) \
-I$(top_srcdir) \
-I$(top_builddir)/app \
-I$(top_srcdir)/app \
$(GEGL_CFLAGS) \
$(GTK_CFLAGS) \
-I$(includedir)
noinst_LIBRARIES = libappactions.a
libappactions_a_SOURCES = \
actions-types.h \
actions.c \
actions.h \
\
gimpgeglprocedure.c \
gimpgeglprocedure.h \
\
brush-editor-actions.c \
brush-editor-actions.h \
brushes-actions.c \
brushes-actions.h \
buffers-actions.c \
buffers-actions.h \
buffers-commands.c \
buffers-commands.h \
channels-actions.c \
channels-actions.h \
channels-commands.c \
channels-commands.h \
colormap-actions.c \
colormap-actions.h \
colormap-commands.c \
colormap-commands.h \
context-actions.c \
context-actions.h \
context-commands.c \
context-commands.h \
cursor-info-actions.c \
cursor-info-actions.h \
cursor-info-commands.c \
cursor-info-commands.h \
dashboard-actions.c \
dashboard-actions.h \
dashboard-commands.c \
dashboard-commands.h \
data-commands.c \
data-commands.h \
data-editor-commands.c \
data-editor-commands.h \
debug-actions.c \
debug-actions.h \
debug-commands.c \
debug-commands.h \
dialogs-actions.c \
dialogs-actions.h \
dialogs-commands.c \
dialogs-commands.h \
dock-actions.c \
dock-actions.h \
dock-commands.c \
dock-commands.h \
dockable-actions.c \
dockable-actions.h \
dockable-commands.c \
dockable-commands.h \
documents-actions.c \
documents-actions.h \
documents-commands.c \
documents-commands.h \
drawable-actions.c \
drawable-actions.h \
drawable-commands.c \
drawable-commands.h \
dynamics-actions.c \
dynamics-actions.h \
dynamics-editor-actions.c \
dynamics-editor-actions.h \
edit-actions.c \
edit-actions.h \
edit-commands.c \
edit-commands.h \
error-console-actions.c \
error-console-actions.h \
error-console-commands.c \
error-console-commands.h \
file-actions.c \
file-actions.h \
file-commands.c \
file-commands.h \
filters-actions.c \
filters-actions.h \
filters-commands.c \
filters-commands.h \
fonts-actions.c \
fonts-actions.h \
gradient-editor-actions.c \
gradient-editor-actions.h \
gradient-editor-commands.c \
gradient-editor-commands.h \
gradients-actions.c \
gradients-actions.h \
gradients-commands.c \
gradients-commands.h \
help-actions.c \
help-actions.h \
help-commands.c \
help-commands.h \
image-actions.c \
image-actions.h \
image-commands.c \
image-commands.h \
images-actions.c \
images-actions.h \
images-commands.c \
images-commands.h \
items-commands.c \
items-commands.h \
items-actions.c \
items-actions.h \
layers-actions.c \
layers-actions.h \
layers-commands.c \
layers-commands.h \
mypaint-brushes-actions.c \
mypaint-brushes-actions.h \
palette-editor-actions.c \
palette-editor-actions.h \
palette-editor-commands.c \
palette-editor-commands.h \
palettes-actions.c \
palettes-actions.h \
palettes-commands.c \
palettes-commands.h \
patterns-actions.c \
patterns-actions.h \
plug-in-actions.c \
plug-in-actions.h \
plug-in-commands.c \
plug-in-commands.h \
procedure-commands.c \
procedure-commands.h \
quick-mask-actions.c \
quick-mask-actions.h \
quick-mask-commands.c \
quick-mask-commands.h \
sample-points-actions.c \
sample-points-actions.h \
sample-points-commands.c \
sample-points-commands.h \
select-actions.c \
select-actions.h \
select-commands.c \
select-commands.h \
templates-actions.c \
templates-actions.h \
templates-commands.c \
templates-commands.h \
text-editor-actions.c \
text-editor-actions.h \
text-editor-commands.c \
text-editor-commands.h \
text-tool-actions.c \
text-tool-actions.h \
text-tool-commands.c \
text-tool-commands.h \
tool-options-actions.c \
tool-options-actions.h \
tool-options-commands.c \
tool-options-commands.h \
tool-presets-actions.c \
tool-presets-actions.h \
tool-presets-commands.c \
tool-presets-commands.h \
tool-preset-editor-actions.c \
tool-preset-editor-actions.h \
tool-preset-editor-commands.c \
tool-preset-editor-commands.h \
tools-actions.c \
tools-actions.h \
tools-commands.c \
tools-commands.h \
vector-toolpath-actions.c \
vector-toolpath-actions.h \
vector-toolpath-commands.c \
vector-toolpath-commands.h \
vectors-actions.c \
vectors-actions.h \
vectors-commands.c \
vectors-commands.h \
view-actions.c \
view-actions.h \
view-commands.c \
view-commands.h \
window-actions.c \
window-actions.h \
window-commands.c \
window-commands.h \
windows-actions.c \
windows-actions.h \
windows-commands.c \
windows-commands.h

View File

@@ -365,9 +365,17 @@ action_data_get_image (gpointer data)
recursion = TRUE;
if (GIMP_IS_ITEM_TREE_VIEW (data))
result = gimp_item_tree_view_get_image ((GimpItemTreeView *) data);
{
result = gimp_item_tree_view_get_image ((GimpItemTreeView *) data);
recursion = FALSE;
return result;
}
else if (GIMP_IS_IMAGE_EDITOR (data))
result = ((GimpImageEditor *) data)->image;
{
result = ((GimpImageEditor *) data)->image;
recursion = FALSE;
return result;
}
if (! result)
{

View File

@@ -91,47 +91,28 @@ void action_message (GimpDisplay *display,
if (! widget) \
return
#define return_if_no_drawable(image,drawable,data) \
return_if_no_image (image,data); \
drawable = gimp_image_get_active_drawable (image); \
if (! drawable) \
return
#define return_if_no_drawables(image,drawables,data) \
return_if_no_image (image,data); \
drawables = gimp_image_get_selected_drawables (image); \
if (! drawables) \
return
#define return_if_no_layer(image,layer,data) \
return_if_no_image (image,data); \
layer = gimp_image_get_active_layer (image); \
if (! layer) \
return
#define return_if_no_layers(image,layers,data) \
return_if_no_image (image,data); \
layers = gimp_image_get_selected_layers (image); \
if (! layers) \
return
#define return_if_no_channel(image,channel,data) \
return_if_no_image (image,data); \
channel = gimp_image_get_active_channel (image); \
if (! channel) \
return
#define return_if_no_channels(image,channels,data) \
return_if_no_image (image,data); \
channels = gimp_image_get_selected_channels (image); \
if (! channels) \
return
#define return_if_no_vectors(image,vectors,data) \
#define return_if_no_vectors_list(image,list,data) \
return_if_no_image (image,data); \
vectors = gimp_image_get_active_vectors (image); \
if (! vectors) \
list = gimp_image_get_selected_vectors (image); \
if (! list) \
return

View File

@@ -37,17 +37,10 @@
#include "gimp-intl.h"
static const GimpActionEntry brush_editor_actions[] =
{
{ "brush-editor-popup", GIMP_ICON_BRUSH,
NC_("brush-editor-action", "Brush Editor Menu"), NULL, NULL, NULL,
GIMP_HELP_BRUSH_EDITOR_DIALOG }
};
static const GimpToggleActionEntry brush_editor_toggle_actions[] =
{
{ "brush-editor-edit-active", GIMP_ICON_LINKED,
NC_("brush-editor-action", "Edit Active Brush"), NULL, NULL,
NC_("brush-editor-action", "Edit Active Brush"), NULL, { NULL }, NULL,
data_editor_edit_active_cmd_callback,
FALSE,
GIMP_HELP_BRUSH_EDITOR_EDIT_ACTIVE }
@@ -57,10 +50,6 @@ static const GimpToggleActionEntry brush_editor_toggle_actions[] =
void
brush_editor_actions_setup (GimpActionGroup *group)
{
gimp_action_group_add_actions (group, "brush-editor-action",
brush_editor_actions,
G_N_ELEMENTS (brush_editor_actions));
gimp_action_group_add_toggle_actions (group, "brush-editor-action",
brush_editor_toggle_actions,
G_N_ELEMENTS (brush_editor_toggle_actions));

View File

@@ -39,48 +39,44 @@
static const GimpActionEntry brushes_actions[] =
{
{ "brushes-popup", GIMP_ICON_BRUSH,
NC_("brushes-action", "Brushes Menu"), NULL, NULL, NULL,
GIMP_HELP_BRUSH_DIALOG },
{ "brushes-open-as-image", GIMP_ICON_DOCUMENT_OPEN,
NC_("brushes-action", "_Open Brush as Image"), NULL,
NC_("brushes-action", "_Open Brush as Image"), NULL, { NULL },
NC_("brushes-action", "Open brush as image"),
data_open_as_image_cmd_callback,
GIMP_HELP_BRUSH_OPEN_AS_IMAGE },
{ "brushes-new", GIMP_ICON_DOCUMENT_NEW,
NC_("brushes-action", "_New Brush"), NULL,
NC_("brushes-action", "_New Brush"), NULL, { NULL },
NC_("brushes-action", "Create a new brush"),
data_new_cmd_callback,
GIMP_HELP_BRUSH_NEW },
{ "brushes-duplicate", GIMP_ICON_OBJECT_DUPLICATE,
NC_("brushes-action", "D_uplicate Brush"), NULL,
NC_("brushes-action", "D_uplicate Brush"), NULL, { NULL },
NC_("brushes-action", "Duplicate this brush"),
data_duplicate_cmd_callback,
GIMP_HELP_BRUSH_DUPLICATE },
{ "brushes-copy-location", GIMP_ICON_EDIT_COPY,
NC_("brushes-action", "Copy Brush _Location"), NULL,
NC_("brushes-action", "Copy Brush _Location"), NULL, { NULL },
NC_("brushes-action", "Copy brush file location to clipboard"),
data_copy_location_cmd_callback,
GIMP_HELP_BRUSH_COPY_LOCATION },
{ "brushes-show-in-file-manager", GIMP_ICON_FILE_MANAGER,
NC_("brushes-action", "Show in _File Manager"), NULL,
NC_("brushes-action", "Show in _File Manager"), NULL, { NULL },
NC_("brushes-action", "Show brush file location in the file manager"),
data_show_in_file_manager_cmd_callback,
GIMP_HELP_BRUSH_SHOW_IN_FILE_MANAGER },
{ "brushes-delete", GIMP_ICON_EDIT_DELETE,
NC_("brushes-action", "_Delete Brush"), NULL,
NC_("brushes-action", "_Delete Brush"), NULL, { NULL },
NC_("brushes-action", "Delete this brush"),
data_delete_cmd_callback,
GIMP_HELP_BRUSH_DELETE },
{ "brushes-refresh", GIMP_ICON_VIEW_REFRESH,
NC_("brushes-action", "_Refresh Brushes"), NULL,
NC_("brushes-action", "_Refresh Brushes"), NULL, { NULL },
NC_("brushes-action", "Refresh brushes"),
data_refresh_cmd_callback,
GIMP_HELP_BRUSH_REFRESH }
@@ -89,7 +85,7 @@ static const GimpActionEntry brushes_actions[] =
static const GimpStringActionEntry brushes_edit_actions[] =
{
{ "brushes-edit", GIMP_ICON_EDIT,
NC_("brushes-action", "_Edit Brush..."), NULL,
NC_("brushes-action", "_Edit Brush..."), NULL, { NULL },
NC_("brushes-action", "Edit this brush"),
"gimp-brush-editor",
GIMP_HELP_BRUSH_EDIT }

View File

@@ -38,18 +38,14 @@
static const GimpActionEntry buffers_actions[] =
{
{ "buffers-popup", GIMP_ICON_BUFFER,
NC_("buffers-action", "Buffers Menu"), NULL, NULL, NULL,
GIMP_HELP_BUFFER_DIALOG },
{ "buffers-paste-as-new-image", GIMP_ICON_EDIT_PASTE_AS_NEW,
NC_("buffers-action", "Paste Buffer as _New Image"), NULL,
NC_("buffers-action", "Paste Buffer as _New Image"), NULL, { NULL },
NC_("buffers-action", "Paste the selected buffer as a new image"),
buffers_paste_as_new_image_cmd_callback,
GIMP_HELP_BUFFER_PASTE_AS_NEW_IMAGE },
{ "buffers-delete", GIMP_ICON_EDIT_DELETE,
NC_("buffers-action", "_Delete Buffer"), NULL,
NC_("buffers-action", "_Delete Buffer"), NULL, { NULL },
NC_("buffers-action", "Delete the selected buffer"),
buffers_delete_cmd_callback,
GIMP_HELP_BUFFER_DELETE }
@@ -58,38 +54,38 @@ static const GimpActionEntry buffers_actions[] =
static const GimpEnumActionEntry buffers_paste_actions[] =
{
{ "buffers-paste", GIMP_ICON_EDIT_PASTE,
NC_("buffers-action", "_Paste Buffer"), NULL,
NC_("buffers-action", "_Paste Buffer"), NULL, { NULL },
NC_("buffers-action", "Paste the selected buffer"),
GIMP_PASTE_TYPE_FLOATING, FALSE,
GIMP_HELP_BUFFER_PASTE },
{ "buffers-paste-in-place", GIMP_ICON_EDIT_PASTE,
NC_("buffers-action", "Paste Buffer In Pl_ace"), NULL,
NC_("buffers-action", "Paste Buffer In Pl_ace"), NULL, { NULL },
NC_("buffers-action", "Paste the selected buffer at its original position"),
GIMP_PASTE_TYPE_FLOATING_IN_PLACE, FALSE,
GIMP_HELP_BUFFER_PASTE_IN_PLACE },
{ "buffers-paste-into", GIMP_ICON_EDIT_PASTE_INTO,
NC_("buffers-action", "Paste Buffer _Into The Selection"), NULL,
NC_("buffers-action", "Paste Buffer _Into The Selection"), NULL, { NULL },
NC_("buffers-action", "Paste the selected buffer into the selection"),
GIMP_PASTE_TYPE_FLOATING_INTO, FALSE,
GIMP_HELP_BUFFER_PASTE_INTO },
{ "buffers-paste-into-in-place", GIMP_ICON_EDIT_PASTE_INTO,
NC_("buffers-action", "Paste Buffer Into The Selection In Place"), NULL,
NC_("buffers-action", "Paste Buffer Into The Selection In Place"), NULL, { NULL },
NC_("buffers-action",
"Paste the selected buffer into the selection at its original position"),
GIMP_PASTE_TYPE_FLOATING_INTO_IN_PLACE, FALSE,
GIMP_HELP_BUFFER_PASTE_INTO_IN_PLACE },
{ "buffers-paste-as-new-layer", GIMP_ICON_EDIT_PASTE_AS_NEW,
NC_("buffers-action", "Paste Buffer as New _Layer"), NULL,
NC_("buffers-action", "Paste Buffer as New _Layer"), NULL, { NULL },
NC_("buffers-action", "Paste the selected buffer as a new layer"),
GIMP_PASTE_TYPE_NEW_LAYER, FALSE,
GIMP_HELP_BUFFER_PASTE_AS_NEW_LAYER },
{ "buffers-paste-as-new-layer-in-place", GIMP_ICON_EDIT_PASTE_AS_NEW,
NC_("buffers-action", "Paste Buffer as New Layer in Place"), NULL,
NC_("buffers-action", "Paste Buffer as New Layer in Place"), NULL, { NULL },
NC_("buffers-action",
"Paste the selected buffer as a new layer at its original position"),
GIMP_PASTE_TYPE_NEW_LAYER_IN_PLACE, FALSE,

View File

@@ -90,9 +90,9 @@ buffers_paste_cmd_callback (GimpAction *action,
{
GList *drawables = gimp_image_get_selected_drawables (image);
g_list_free (gimp_edit_paste (image,
g_list_length (drawables) == 1 ? drawables->data : NULL,
g_list_free (gimp_edit_paste (image, drawables,
GIMP_OBJECT (buffer), paste_type,
context, FALSE,
x, y, width, height));
gimp_image_flush (image);
@@ -122,7 +122,8 @@ buffers_paste_as_new_image_cmd_callback (GimpAction *action,
GimpImage *new_image;
new_image = gimp_edit_paste_as_new_image (context->gimp,
GIMP_OBJECT (buffer));
GIMP_OBJECT (buffer),
context);
gimp_create_display (context->gimp, new_image,
GIMP_UNIT_PIXEL, 1.0,
G_OBJECT (gimp_widget_get_monitor (widget)));

View File

@@ -41,66 +41,58 @@
static const GimpActionEntry channels_actions[] =
{
{ "channels-popup", GIMP_ICON_DIALOG_CHANNELS,
NC_("channels-action", "Channels Menu"), NULL, NULL, NULL,
GIMP_HELP_CHANNEL_DIALOG },
{ "channels-color-tag-menu", NULL,
NC_("channels-action", "Color Tag"), NULL, NULL, NULL,
GIMP_HELP_CHANNEL_COLOR_TAG },
{ "channels-edit-attributes", GIMP_ICON_EDIT,
NC_("channels-action", "_Edit Channel Attributes..."), NULL,
NC_("channels-action", "_Edit Channel Attributes..."), NULL, { NULL },
NC_("channels-action", "Edit the channel's name, color and opacity"),
channels_edit_attributes_cmd_callback,
GIMP_HELP_CHANNEL_EDIT },
{ "channels-new", GIMP_ICON_DOCUMENT_NEW,
NC_("channels-action", "_New Channel..."), NULL,
NC_("channels-action", "_New Channel..."), NULL, { NULL },
NC_("channels-action", "Create a new channel"),
channels_new_cmd_callback,
GIMP_HELP_CHANNEL_NEW },
{ "channels-new-last-values", GIMP_ICON_DOCUMENT_NEW,
NC_("channels-action", "_New Channel"), NULL,
NC_("channels-action", "_New Channel"), NULL, { NULL },
NC_("channels-action", "Create a new channel with last used values"),
channels_new_last_vals_cmd_callback,
GIMP_HELP_CHANNEL_NEW },
{ "channels-duplicate", GIMP_ICON_OBJECT_DUPLICATE,
NC_("channels-action", "D_uplicate Channels"), NULL,
NC_("channels-action", "D_uplicate Channels"), NULL, { NULL },
NC_("channels-action",
"Create duplicates of selected channels and add them to the image"),
channels_duplicate_cmd_callback,
GIMP_HELP_CHANNEL_DUPLICATE },
{ "channels-delete", GIMP_ICON_EDIT_DELETE,
NC_("channels-action", "_Delete Channels"), NULL,
NC_("channels-action", "_Delete Channels"), NULL, { NULL },
NC_("channels-action", "Delete selected channels"),
channels_delete_cmd_callback,
GIMP_HELP_CHANNEL_DELETE },
{ "channels-raise", GIMP_ICON_GO_UP,
NC_("channels-action", "_Raise Channels"), NULL,
NC_("channels-action", "_Raise Channels"), NULL, { NULL },
NC_("channels-action", "Raise these channels one step in the channel stack"),
channels_raise_cmd_callback,
GIMP_HELP_CHANNEL_RAISE },
{ "channels-raise-to-top", GIMP_ICON_GO_TOP,
NC_("channels-action", "Raise Channels to _Top"), NULL,
NC_("channels-action", "Raise Channels to _Top"), NULL, { NULL },
NC_("channels-action",
"Raise these channels to the top of the channel stack"),
channels_raise_to_top_cmd_callback,
GIMP_HELP_CHANNEL_RAISE_TO_TOP },
{ "channels-lower", GIMP_ICON_GO_DOWN,
NC_("channels-action", "_Lower Channels"), NULL,
NC_("channels-action", "_Lower Channels"), NULL, { NULL },
NC_("channels-action", "Lower these channels one step in the channel stack"),
channels_lower_cmd_callback,
GIMP_HELP_CHANNEL_LOWER },
{ "channels-lower-to-bottom", GIMP_ICON_GO_BOTTOM,
NC_("channels-action", "Lower Channels to _Bottom"), NULL,
NC_("channels-action", "Lower Channels to _Bottom"), NULL, { NULL },
NC_("channels-action",
"Lower these channels to the bottom of the channel stack"),
channels_lower_to_bottom_cmd_callback,
@@ -110,19 +102,19 @@ static const GimpActionEntry channels_actions[] =
static const GimpToggleActionEntry channels_toggle_actions[] =
{
{ "channels-visible", GIMP_ICON_VISIBLE,
NC_("channels-action", "Toggle Channel _Visibility"), NULL, NULL,
NC_("channels-action", "Toggle Channel _Visibility"), NULL, { NULL }, NULL,
channels_visible_cmd_callback,
FALSE,
GIMP_HELP_CHANNEL_VISIBLE },
{ "channels-lock-content", GIMP_ICON_LOCK_CONTENT,
NC_("channels-action", "L_ock Pixels of Channel"), NULL, NULL,
NC_("channels-action", "L_ock Pixels of Channel"), NULL, { NULL }, NULL,
channels_lock_content_cmd_callback,
FALSE,
GIMP_HELP_CHANNEL_LOCK_PIXELS },
{ "channels-lock-position", GIMP_ICON_LOCK_POSITION,
NC_("channels-action", "L_ock Position of Channel"), NULL, NULL,
NC_("channels-action", "L_ock Position of Channel"), NULL, { NULL }, NULL,
channels_lock_position_cmd_callback,
FALSE,
GIMP_HELP_CHANNEL_LOCK_POSITION }
@@ -131,55 +123,55 @@ static const GimpToggleActionEntry channels_toggle_actions[] =
static const GimpEnumActionEntry channels_color_tag_actions[] =
{
{ "channels-color-tag-none", GIMP_ICON_EDIT_CLEAR,
NC_("channels-action", "None"), NULL,
NC_("channels-action", "None"), NULL, { NULL },
NC_("channels-action", "Channel Color Tag: Clear"),
GIMP_COLOR_TAG_NONE, FALSE,
GIMP_HELP_CHANNEL_COLOR_TAG },
{ "channels-color-tag-blue", NULL,
NC_("channels-action", "Blue"), NULL,
NC_("channels-action", "Blue"), NULL, { NULL },
NC_("channels-action", "Channel Color Tag: Set to Blue"),
GIMP_COLOR_TAG_BLUE, FALSE,
GIMP_HELP_CHANNEL_COLOR_TAG },
{ "channels-color-tag-green", NULL,
NC_("channels-action", "Green"), NULL,
NC_("channels-action", "Green"), NULL, { NULL },
NC_("channels-action", "Channel Color Tag: Set to Green"),
GIMP_COLOR_TAG_GREEN, FALSE,
GIMP_HELP_CHANNEL_COLOR_TAG },
{ "channels-color-tag-yellow", NULL,
NC_("channels-action", "Yellow"), NULL,
NC_("channels-action", "Yellow"), NULL, { NULL },
NC_("channels-action", "Channel Color Tag: Set to Yellow"),
GIMP_COLOR_TAG_YELLOW, FALSE,
GIMP_HELP_CHANNEL_COLOR_TAG },
{ "channels-color-tag-orange", NULL,
NC_("channels-action", "Orange"), NULL,
NC_("channels-action", "Orange"), NULL, { NULL },
NC_("channels-action", "Channel Color Tag: Set to Orange"),
GIMP_COLOR_TAG_ORANGE, FALSE,
GIMP_HELP_CHANNEL_COLOR_TAG },
{ "channels-color-tag-brown", NULL,
NC_("channels-action", "Brown"), NULL,
NC_("channels-action", "Brown"), NULL, { NULL },
NC_("channels-action", "Channel Color Tag: Set to Brown"),
GIMP_COLOR_TAG_BROWN, FALSE,
GIMP_HELP_CHANNEL_COLOR_TAG },
{ "channels-color-tag-red", NULL,
NC_("channels-action", "Red"), NULL,
NC_("channels-action", "Red"), NULL, { NULL },
NC_("channels-action", "Channel Color Tag: Set to Red"),
GIMP_COLOR_TAG_RED, FALSE,
GIMP_HELP_CHANNEL_COLOR_TAG },
{ "channels-color-tag-violet", NULL,
NC_("channels-action", "Violet"), NULL,
NC_("channels-action", "Violet"), NULL, { NULL },
NC_("channels-action", "Channel Color Tag: Set to Violet"),
GIMP_COLOR_TAG_VIOLET, FALSE,
GIMP_HELP_CHANNEL_COLOR_TAG },
{ "channels-color-tag-gray", NULL,
NC_("channels-action", "Gray"), NULL,
NC_("channels-action", "Gray"), NULL, { NULL },
NC_("channels-action", "Channel Color Tag: Set to Gray"),
GIMP_COLOR_TAG_GRAY, FALSE,
GIMP_HELP_CHANNEL_COLOR_TAG }
@@ -188,26 +180,26 @@ static const GimpEnumActionEntry channels_color_tag_actions[] =
static const GimpEnumActionEntry channels_to_selection_actions[] =
{
{ "channels-selection-replace", GIMP_ICON_SELECTION_REPLACE,
NC_("channels-action", "Channel to Sele_ction"), NULL,
NC_("channels-action", "Replace the selection with this channel"),
NC_("channels-action", "Channels to Sele_ction"), NULL, { NULL },
NC_("channels-action", "Replace the selection with selected channels"),
GIMP_CHANNEL_OP_REPLACE, FALSE,
GIMP_HELP_CHANNEL_SELECTION_REPLACE },
{ "channels-selection-add", GIMP_ICON_SELECTION_ADD,
NC_("channels-action", "_Add to Selection"), NULL,
NC_("channels-action", "Add this channel to the current selection"),
NC_("channels-action", "_Add Channels to Selection"), NULL, { NULL },
NC_("channels-action", "Add selected channels to the current selection"),
GIMP_CHANNEL_OP_ADD, FALSE,
GIMP_HELP_CHANNEL_SELECTION_ADD },
{ "channels-selection-subtract", GIMP_ICON_SELECTION_SUBTRACT,
NC_("channels-action", "_Subtract from Selection"), NULL,
NC_("channels-action", "Subtract this channel from the current selection"),
NC_("channels-action", "_Subtract Channels from Selection"), NULL, { NULL },
NC_("channels-action", "Subtract selected channels from the current selection"),
GIMP_CHANNEL_OP_SUBTRACT, FALSE,
GIMP_HELP_CHANNEL_SELECTION_SUBTRACT },
{ "channels-selection-intersect", GIMP_ICON_SELECTION_INTERSECT,
NC_("channels-action", "_Intersect with Selection"), NULL,
NC_("channels-action", "Intersect this channel with the current selection"),
NC_("channels-action", "_Intersect Channels with Selection"), NULL, { NULL },
NC_("channels-action", "Intersect selected channels with the current selection and each other"),
GIMP_CHANNEL_OP_INTERSECT, FALSE,
GIMP_HELP_CHANNEL_SELECTION_INTERSECT }
};
@@ -215,25 +207,25 @@ static const GimpEnumActionEntry channels_to_selection_actions[] =
static const GimpEnumActionEntry channels_select_actions[] =
{
{ "channels-select-top", NULL,
NC_("channels-action", "Select _Top Channel"), NULL,
NC_("channels-action", "Select _Top Channel"), NULL, { NULL },
NC_("channels-action", "Select the topmost channel"),
GIMP_ACTION_SELECT_FIRST, FALSE,
GIMP_HELP_CHANNEL_TOP },
{ "channels-select-bottom", NULL,
NC_("channels-action", "Select _Bottom Channel"), NULL,
NC_("channels-action", "Select _Bottom Channel"), NULL, { NULL },
NC_("channels-action", "Select the bottommost channel"),
GIMP_ACTION_SELECT_LAST, FALSE,
GIMP_HELP_CHANNEL_BOTTOM },
{ "channels-select-previous", NULL,
NC_("channels-action", "Select _Previous Channels"), NULL,
NC_("channels-action", "Select _Previous Channels"), NULL, { NULL },
NC_("channels-action", "Select the channels above the selected channels"),
GIMP_ACTION_SELECT_PREVIOUS, FALSE,
GIMP_HELP_CHANNEL_PREVIOUS },
{ "channels-select-next", NULL,
NC_("channels-action", "Select _Next Channels"), NULL,
NC_("channels-action", "Select _Next Channels"), NULL, { NULL },
NC_("channels-action", "Select the channels below the selected channels"),
GIMP_ACTION_SELECT_NEXT, FALSE,
GIMP_HELP_CHANNEL_NEXT }
@@ -337,10 +329,10 @@ channels_actions_update (GimpActionGroup *group,
SET_SENSITIVE ("channels-lower", !fs && n_selected_channels > 0 && have_next);
SET_SENSITIVE ("channels-lower-to-bottom", !fs && n_selected_channels > 0 && have_next);
SET_SENSITIVE ("channels-selection-replace", !fs && (n_selected_channels == 1 || component));
SET_SENSITIVE ("channels-selection-add", !fs && (n_selected_channels == 1 || component));
SET_SENSITIVE ("channels-selection-subtract", !fs && (n_selected_channels == 1 || component));
SET_SENSITIVE ("channels-selection-intersect", !fs && (n_selected_channels == 1 || component));
SET_SENSITIVE ("channels-selection-replace", !fs && (n_selected_channels > 0 || component));
SET_SENSITIVE ("channels-selection-add", !fs && (n_selected_channels > 0 || component));
SET_SENSITIVE ("channels-selection-subtract", !fs && (n_selected_channels > 0 || component));
SET_SENSITIVE ("channels-selection-intersect", !fs && (n_selected_channels > 0 || component));
SET_SENSITIVE ("channels-select-top", !fs && n_channels > 0 && (n_selected_channels == 0 || have_prev));
SET_SENSITIVE ("channels-select-bottom", !fs && n_channels > 0 && (n_selected_channels == 0 || have_next));

View File

@@ -65,24 +65,26 @@ static void channels_new_callback (GtkWidget *dialog,
GimpChannel *channel,
GimpContext *context,
const gchar *channel_name,
const GimpRGB *channel_color,
GeglColor *channel_color,
gboolean save_selection,
gboolean channel_visible,
GimpColorTag channel_color_tag,
gboolean channel_lock_content,
gboolean channel_lock_position,
gboolean channel_lock_visibility,
gpointer user_data);
static void channels_edit_attributes_callback (GtkWidget *dialog,
GimpImage *image,
GimpChannel *channel,
GimpContext *context,
const gchar *channel_name,
const GimpRGB *channel_color,
GeglColor *channel_color,
gboolean save_selection,
gboolean channel_visible,
GimpColorTag channel_color_tag,
gboolean channel_lock_content,
gboolean channel_lock_position,
gboolean channel_lock_visibility,
gpointer user_data);
@@ -95,14 +97,19 @@ channels_edit_attributes_cmd_callback (GimpAction *action,
{
GimpImage *image;
GimpChannel *channel;
GList *channels;
GtkWidget *widget;
GtkWidget *dialog;
return_if_no_channel (image, channel, data);
return_if_no_channels (image, channels, data);
return_if_no_widget (widget, data);
#define EDIT_DIALOG_KEY "gimp-channel-edit-attributes-dialog"
dialog = dialogs_get_dialog (G_OBJECT (channel), EDIT_DIALOG_KEY);
if (g_list_length (channels) != 1)
return;
channel = channels->data;
dialog = dialogs_get_dialog (G_OBJECT (channel), EDIT_DIALOG_KEY);
if (! dialog)
{
@@ -120,11 +127,12 @@ channels_edit_attributes_cmd_callback (GimpAction *action,
_("_Fill opacity:"),
FALSE,
gimp_object_get_name (channel),
&channel->color,
channel->color,
gimp_item_get_visible (item),
gimp_item_get_color_tag (item),
gimp_item_get_lock_content (item),
gimp_item_get_lock_position (item),
gimp_item_get_lock_visibility (item),
channels_edit_attributes_callback,
NULL);
@@ -165,11 +173,12 @@ channels_new_cmd_callback (GimpAction *action,
_("_Fill opacity:"),
TRUE,
config->channel_new_name,
&config->channel_new_color,
config->channel_new_color,
TRUE,
GIMP_COLOR_TAG_NONE,
FALSE,
FALSE,
FALSE,
channels_new_callback,
NULL);
@@ -195,7 +204,7 @@ channels_new_last_vals_cmd_callback (GimpAction *action,
gimp_image_get_width (image),
gimp_image_get_height (image),
config->channel_new_name,
&config->channel_new_color);
config->channel_new_color);
gimp_drawable_fill (GIMP_DRAWABLE (channel),
action_data_get_context (data),
@@ -474,11 +483,23 @@ channels_to_selection_cmd_callback (GimpAction *action,
}
else
{
GimpChannel *channel;
return_if_no_channel (image, channel, data);
GList *channels;
GList *iter;
return_if_no_channels (image, channels, data);
gimp_item_to_selection (GIMP_ITEM (channel),
op, TRUE, FALSE, 0.0, 0.0);
gimp_image_undo_group_start (image,
GIMP_UNDO_GROUP_DRAWABLE_MOD,
_("Channels to selection"));
for (iter = channels; iter; iter = iter->next)
{
gimp_item_to_selection (iter->data, op, TRUE, FALSE, 0.0, 0.0);
if (op == GIMP_CHANNEL_OP_REPLACE && iter == channels)
op = GIMP_CHANNEL_OP_ADD;
}
gimp_image_undo_group_end (image);
}
gimp_image_flush (image);
@@ -489,11 +510,11 @@ channels_visible_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data)
{
GimpImage *image;
GimpChannel *channel;
return_if_no_channel (image, channel, data);
GimpImage *image;
GList *channels;
return_if_no_channels (image, channels, data);
items_visible_cmd_callback (action, value, image, GIMP_ITEM (channel));
items_visible_cmd_callback (action, value, image, channels);
}
void
@@ -501,11 +522,11 @@ channels_lock_content_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data)
{
GimpImage *image;
GimpChannel *channel;
return_if_no_channel (image, channel, data);
GimpImage *image;
GList *channels;
return_if_no_channels (image, channels, data);
items_lock_content_cmd_callback (action, value, image, GIMP_ITEM (channel));
items_lock_content_cmd_callback (action, value, image, channels);
}
void
@@ -513,11 +534,11 @@ channels_lock_position_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data)
{
GimpImage *image;
GimpChannel *channel;
return_if_no_channel (image, channel, data);
GimpImage *image;
GList *channels;
return_if_no_channels (image, channels, data);
items_lock_position_cmd_callback (action, value, image, GIMP_ITEM (channel));
items_lock_position_cmd_callback (action, value, image, channels);
}
void
@@ -526,14 +547,13 @@ channels_color_tag_cmd_callback (GimpAction *action,
gpointer data)
{
GimpImage *image;
GimpChannel *channel;
GList *channels;
GimpColorTag color_tag;
return_if_no_channel (image, channel, data);
return_if_no_channels (image, channels, data);
color_tag = (GimpColorTag) g_variant_get_int32 (value);
items_color_tag_cmd_callback (action, image, GIMP_ITEM (channel),
color_tag);
items_color_tag_cmd_callback (action, image, channels, color_tag);
}
void
@@ -593,12 +613,13 @@ channels_new_callback (GtkWidget *dialog,
GimpChannel *channel,
GimpContext *context,
const gchar *channel_name,
const GimpRGB *channel_color,
GeglColor *channel_color,
gboolean save_selection,
gboolean channel_visible,
GimpColorTag channel_color_tag,
gboolean channel_lock_content,
gboolean channel_lock_position,
gboolean channel_lock_visibility,
gpointer user_data)
{
GimpDialogConfig *config = GIMP_DIALOG_CONFIG (image->gimp->config);
@@ -617,7 +638,7 @@ channels_new_callback (GtkWidget *dialog,
gimp_object_set_name (GIMP_OBJECT (channel),
config->channel_new_name);
gimp_channel_set_color (channel, &config->channel_new_color, FALSE);
gimp_channel_set_color (channel, config->channel_new_color, FALSE);
}
else
{
@@ -625,7 +646,7 @@ channels_new_callback (GtkWidget *dialog,
gimp_image_get_width (image),
gimp_image_get_height (image),
config->channel_new_name,
&config->channel_new_color);
config->channel_new_color);
gimp_drawable_fill (GIMP_DRAWABLE (channel), context,
GIMP_FILL_TRANSPARENT);
@@ -635,6 +656,7 @@ channels_new_callback (GtkWidget *dialog,
gimp_item_set_color_tag (GIMP_ITEM (channel), channel_color_tag, FALSE);
gimp_item_set_lock_content (GIMP_ITEM (channel), channel_lock_content, FALSE);
gimp_item_set_lock_position (GIMP_ITEM (channel), channel_lock_position, FALSE);
gimp_item_set_lock_visibility (GIMP_ITEM (channel), channel_lock_visibility, FALSE);
gimp_image_add_channel (image, channel,
GIMP_IMAGE_ACTIVE_PARENT, -1, TRUE);
@@ -649,22 +671,24 @@ channels_edit_attributes_callback (GtkWidget *dialog,
GimpChannel *channel,
GimpContext *context,
const gchar *channel_name,
const GimpRGB *channel_color,
GeglColor *channel_color,
gboolean save_selection,
gboolean channel_visible,
GimpColorTag channel_color_tag,
gboolean channel_lock_content,
gboolean channel_lock_position,
gboolean channel_lock_visibility,
gpointer user_data)
{
GimpItem *item = GIMP_ITEM (channel);
if (strcmp (channel_name, gimp_object_get_name (channel)) ||
gimp_rgba_distance (channel_color, &channel->color) > RGBA_EPSILON ||
channel_visible != gimp_item_get_visible (item) ||
channel_color_tag != gimp_item_get_color_tag (item) ||
channel_lock_content != gimp_item_get_lock_content (item) ||
channel_lock_position != gimp_item_get_lock_position (item))
if (strcmp (channel_name, gimp_object_get_name (channel)) ||
! gimp_color_is_perceptually_identical (channel_color, channel->color) ||
channel_visible != gimp_item_get_visible (item) ||
channel_color_tag != gimp_item_get_color_tag (item) ||
channel_lock_content != gimp_item_get_lock_content (item) ||
channel_lock_position != gimp_item_get_lock_position (item) ||
channel_lock_visibility != gimp_item_get_lock_visibility (item))
{
gimp_image_undo_group_start (image,
GIMP_UNDO_GROUP_ITEM_PROPERTIES,
@@ -673,7 +697,7 @@ channels_edit_attributes_callback (GtkWidget *dialog,
if (strcmp (channel_name, gimp_object_get_name (channel)))
gimp_item_rename (GIMP_ITEM (channel), channel_name, NULL);
if (gimp_rgba_distance (channel_color, &channel->color) > RGBA_EPSILON)
if (! gimp_color_is_perceptually_identical (channel_color, channel->color))
gimp_channel_set_color (channel, channel_color, TRUE);
if (channel_visible != gimp_item_get_visible (item))
@@ -688,6 +712,9 @@ channels_edit_attributes_callback (GtkWidget *dialog,
if (channel_lock_position != gimp_item_get_lock_position (item))
gimp_item_set_lock_position (item, channel_lock_position, TRUE);
if (channel_lock_visibility != gimp_item_get_lock_visibility (item))
gimp_item_set_lock_visibility (item, channel_lock_visibility, TRUE);
gimp_image_undo_group_end (image);
gimp_image_flush (image);

View File

@@ -28,8 +28,10 @@
#include "core/gimpdrawable.h"
#include "core/gimpimage.h"
#include "core/gimpimage-colormap.h"
#include "core/gimppalette.h"
#include "widgets/gimpactiongroup.h"
#include "widgets/gimpcolormapeditor.h"
#include "widgets/gimphelp-ids.h"
#include "actions.h"
@@ -41,27 +43,29 @@
static const GimpActionEntry colormap_actions[] =
{
{ "colormap-popup", GIMP_ICON_COLORMAP,
NC_("colormap-action", "Colormap Menu"), NULL, NULL, NULL,
GIMP_HELP_INDEXED_PALETTE_DIALOG },
{ "colormap-edit-color", GIMP_ICON_EDIT,
NC_("colormap-action", "_Edit Color..."), NULL,
NC_("colormap-action", "_Edit Color..."), NULL, { NULL },
NC_("colormap-action", "Edit this color"),
colormap_edit_color_cmd_callback,
GIMP_HELP_INDEXED_PALETTE_EDIT },
{ "colormap-delete-color", GIMP_ICON_EDIT_DELETE,
NC_("colormap-action", "_Delete Color..."), NULL, { NULL },
NC_("colormap-action", "Delete this color"),
colormap_delete_color_cmd_callback,
GIMP_HELP_INDEXED_PALETTE_EDIT }
};
static const GimpEnumActionEntry colormap_add_color_actions[] =
{
{ "colormap-add-color-from-fg", GIMP_ICON_LIST_ADD,
NC_("colormap-action", "_Add Color from FG"), "",
NC_("colormap-action", "_Add Color from FG"), NULL, { NULL },
NC_("colormap-action", "Add current foreground color"),
FALSE, FALSE,
GIMP_HELP_INDEXED_PALETTE_ADD },
{ "colormap-add-color-from-bg", GIMP_ICON_LIST_ADD,
NC_("colormap-action", "_Add Color from BG"), "",
NC_("colormap-action", "_Add Color from BG"), NULL, { NULL },
NC_("colormap-action", "Add current background color"),
TRUE, FALSE,
GIMP_HELP_INDEXED_PALETTE_ADD }
@@ -70,25 +74,25 @@ static const GimpEnumActionEntry colormap_add_color_actions[] =
static const GimpEnumActionEntry colormap_to_selection_actions[] =
{
{ "colormap-selection-replace", GIMP_ICON_SELECTION_REPLACE,
NC_("colormap-action", "_Select this Color"), NULL,
NC_("colormap-action", "_Select this Color"), NULL, { NULL },
NC_("colormap-action", "Select all pixels with this color"),
GIMP_CHANNEL_OP_REPLACE, FALSE,
GIMP_HELP_INDEXED_PALETTE_SELECTION_REPLACE },
{ "colormap-selection-add", GIMP_ICON_SELECTION_ADD,
NC_("colormap-action", "_Add to Selection"), NULL,
NC_("colormap-action", "_Add to Selection"), NULL, { NULL },
NC_("colormap-action", "Add all pixels with this color to the current selection"),
GIMP_CHANNEL_OP_ADD, FALSE,
GIMP_HELP_INDEXED_PALETTE_SELECTION_ADD },
{ "colormap-selection-subtract", GIMP_ICON_SELECTION_SUBTRACT,
NC_("colormap-action", "_Subtract from Selection"), NULL,
NC_("colormap-action", "_Subtract from Selection"), NULL, { NULL },
NC_("colormap-action", "Subtract all pixels with this color from the current selection"),
GIMP_CHANNEL_OP_SUBTRACT, FALSE,
GIMP_HELP_INDEXED_PALETTE_SELECTION_SUBTRACT },
{ "colormap-selection-intersect", GIMP_ICON_SELECTION_INTERSECT,
NC_("colormap-action", "_Intersect with Selection"), NULL,
NC_("colormap-action", "_Intersect with Selection"), NULL, { NULL },
NC_("colormap-action", "Intersect all pixels with this color with the current selection"),
GIMP_CHANNEL_OP_INTERSECT, FALSE,
GIMP_HELP_INDEXED_PALETTE_SELECTION_INTERSECT }
@@ -116,13 +120,12 @@ void
colormap_actions_update (GimpActionGroup *group,
gpointer data)
{
GimpImage *image = action_data_get_image (data);
GimpContext *context = action_data_get_context (data);
gboolean indexed = FALSE;
gboolean drawable_indexed = FALSE;
gint num_colors = 0;
GimpRGB fg;
GimpRGB bg;
GimpColormapEditor *editor = GIMP_COLORMAP_EDITOR (data);
GimpImage *image = action_data_get_image (data);
GimpContext *context = action_data_get_context (data);
gboolean indexed = FALSE;
gboolean drawable_indexed = FALSE;
gint num_colors = 0;
if (image)
{
@@ -130,19 +133,17 @@ colormap_actions_update (GimpActionGroup *group,
if (indexed)
{
GimpDrawable *drawable = gimp_image_get_active_drawable (image);
GList *drawables = gimp_image_get_selected_drawables (image);
num_colors = gimp_image_get_colormap_size (image);
drawable_indexed = gimp_drawable_is_indexed (drawable);
num_colors = gimp_palette_get_n_colors (gimp_image_get_colormap_palette ((image)));
if (g_list_length (drawables) == 1)
drawable_indexed = gimp_drawable_is_indexed (drawables->data);
g_list_free (drawables);
}
}
if (context)
{
gimp_context_get_foreground (context, &fg);
gimp_context_get_background (context, &bg);
}
#define SET_SENSITIVE(action,condition) \
gimp_action_group_set_action_sensitive (group, action, (condition) != 0, NULL)
#define SET_COLOR(action,color) \
@@ -150,14 +151,17 @@ colormap_actions_update (GimpActionGroup *group,
SET_SENSITIVE ("colormap-edit-color",
indexed && num_colors > 0);
SET_SENSITIVE ("colormap-delete-color",
indexed && num_colors > 0 &&
gimp_colormap_editor_is_color_deletable (editor));
SET_SENSITIVE ("colormap-add-color-from-fg",
indexed && num_colors < 256);
SET_SENSITIVE ("colormap-add-color-from-bg",
indexed && num_colors < 256);
SET_COLOR ("colormap-add-color-from-fg", context ? &fg : NULL);
SET_COLOR ("colormap-add-color-from-bg", context ? &bg : NULL);
SET_COLOR ("colormap-add-color-from-fg", context ? gimp_context_get_foreground (context) : NULL);
SET_COLOR ("colormap-add-color-from-bg", context ? gimp_context_get_background (context) : NULL);
SET_SENSITIVE ("colormap-selection-replace",
drawable_indexed && num_colors > 0);

View File

@@ -26,6 +26,7 @@
#include "core/gimpcontext.h"
#include "core/gimpimage.h"
#include "core/gimpimage-colormap.h"
#include "core/gimppalette.h"
#include "widgets/gimpcolormapeditor.h"
#include "widgets/gimpcolormapselection.h"
@@ -46,6 +47,16 @@ colormap_edit_color_cmd_callback (GimpAction *action,
gimp_colormap_editor_edit_color (editor);
}
void
colormap_delete_color_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data)
{
GimpColormapEditor *editor = GIMP_COLORMAP_EDITOR (data);
gimp_colormap_editor_delete_color (editor);
}
void
colormap_add_color_cmd_callback (GimpAction *action,
GVariant *value,
@@ -59,16 +70,16 @@ colormap_add_color_cmd_callback (GimpAction *action,
background = (gboolean) g_variant_get_int32 (value);
if (gimp_image_get_colormap_size (image) < 256)
if (gimp_palette_get_n_colors (gimp_image_get_colormap_palette ((image))) < 256)
{
GimpRGB color;
GeglColor *color;
if (background)
gimp_context_get_background (context, &color);
color = gimp_context_get_background (context);
else
gimp_context_get_foreground (context, &color);
color = gimp_context_get_foreground (context);
gimp_image_add_colormap_entry (image, &color);
gimp_image_add_colormap_entry (image, color);
gimp_image_flush (image);
}
}
@@ -81,6 +92,7 @@ colormap_to_selection_cmd_callback (GimpAction *action,
GimpColormapSelection *selection;
GimpColormapEditor *editor;
GimpImage *image;
GList *drawables;
GimpChannelOps op;
gint col_index;
@@ -92,10 +104,22 @@ colormap_to_selection_cmd_callback (GimpAction *action,
op = (GimpChannelOps) g_variant_get_int32 (value);
drawables = gimp_image_get_selected_drawables (image);
if (g_list_length (drawables) != 1)
{
/* We should not reach this anyway as colormap-actions.c normally takes
* care at making the action insensitive when the item selection is wrong.
*/
g_warning ("This action requires exactly one selected drawable.");
g_list_free (drawables);
return;
}
gimp_channel_select_by_index (gimp_image_get_mask (image),
gimp_image_get_active_drawable (image),
drawables->data,
col_index, op,
FALSE, 0.0, 0.0);
g_list_free (drawables);
gimp_image_flush (image);
}

View File

@@ -22,6 +22,9 @@
void colormap_edit_color_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data);
void colormap_delete_color_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data);
void colormap_add_color_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data);

File diff suppressed because it is too large Load Diff

View File

@@ -34,6 +34,7 @@
#include "core/gimpbrushgenerated.h"
#include "core/gimpcontext.h"
#include "core/gimpdatafactory.h"
#include "core/gimpimage.h"
#include "core/gimplist.h"
#include "core/gimppaintinfo.h"
#include "core/gimptoolinfo.h"
@@ -61,19 +62,19 @@ static gint context_paint_mode_index (GimpLayerMode paint_mode,
gint n_modes);
static void context_select_color (GimpActionSelectType select_type,
GimpRGB *color,
GeglColor *color,
gboolean use_colormap,
gboolean use_palette);
static gint context_get_color_index (gboolean use_colormap,
gboolean use_palette,
const GimpRGB *color);
GeglColor *color);
static gint context_max_color_index (gboolean use_colormap,
gboolean use_palette);
static gboolean context_set_color_index (gint index,
gboolean use_colormap,
gboolean use_palette,
GimpRGB *color);
GeglColor *color);
static GimpPaletteEditor * context_get_palette_editor (void);
static GimpColormapEditor * context_get_colormap_editor (void);
@@ -110,16 +111,17 @@ context_##name##_##fgbg##ground_cmd_callback (GimpAction *action, \
gpointer data) \
{ \
GimpContext *context; \
GimpRGB color; \
GeglColor *color; \
GimpActionSelectType select_type; \
return_if_no_context (context, data); \
\
select_type = (GimpActionSelectType) g_variant_get_int32 (value); \
\
gimp_context_get_##fgbg##ground (context, &color); \
context_select_color (select_type, &color, \
color = gegl_color_duplicate (gimp_context_get_##fgbg##ground (context)); \
context_select_color (select_type, color, \
use_colormap, use_palette); \
gimp_context_set_##fgbg##ground (context, &color); \
gimp_context_set_##fgbg##ground (context, color); \
g_object_unref (color); \
}
SELECT_COLOR_CMD_CALLBACK (palette, fore, FALSE, TRUE)
@@ -135,18 +137,30 @@ context_foreground_red_cmd_callback (GimpAction *action,
gpointer data)
{
GimpContext *context;
GimpRGB color;
GeglColor *color;
const Babl *format;
gdouble pixel[4];
GimpActionSelectType select_type;
return_if_no_context (context, data);
select_type = (GimpActionSelectType) g_variant_get_int32 (value);
gimp_context_get_foreground (context, &color);
color.r = action_select_value (select_type,
color.r,
0.0, 1.0, 1.0,
1.0 / 255.0, 0.01, 0.1, 0.0, FALSE);
gimp_context_set_foreground (context, &color);
color = gegl_color_duplicate (gimp_context_get_foreground (context));
format = gimp_context_get_rgba_format (context, color, "double", NULL);
gegl_color_get_pixel (color, format, pixel);
/* TODO: if value was already out-of-gamut, say we want to decrease it
* progressively. Should the algorithm allow it to be decreased while still
* staying out-of-gamut? Currently the function always clamps the result to
* min/max.
*/
pixel[0] = action_select_value (select_type,
pixel[0],
0.0, 1.0, 1.0,
1.0 / 255.0, 0.01, 0.1, 0.0, FALSE);
gegl_color_set_pixel (color, format, pixel);
gimp_context_set_foreground (context, color);
g_object_unref (color);
}
void
@@ -155,18 +169,25 @@ context_foreground_green_cmd_callback (GimpAction *action,
gpointer data)
{
GimpContext *context;
GimpRGB color;
GeglColor *color;
const Babl *format;
gdouble pixel[4];
GimpActionSelectType select_type;
return_if_no_context (context, data);
select_type = (GimpActionSelectType) g_variant_get_int32 (value);
gimp_context_get_foreground (context, &color);
color.g = action_select_value (select_type,
color.g,
0.0, 1.0, 1.0,
1.0 / 255.0, 0.01, 0.1, 0.0, FALSE);
gimp_context_set_foreground (context, &color);
color = gegl_color_duplicate (gimp_context_get_foreground (context));
format = gimp_context_get_rgba_format (context, color, "double", NULL);
gegl_color_get_pixel (color, format, pixel);
pixel[1] = action_select_value (select_type,
pixel[1],
0.0, 1.0, 1.0,
1.0 / 255.0, 0.01, 0.1, 0.0, FALSE);
gegl_color_set_pixel (color, format, pixel);
gimp_context_set_foreground (context, color);
g_object_unref (color);
}
void
@@ -175,18 +196,25 @@ context_foreground_blue_cmd_callback (GimpAction *action,
gpointer data)
{
GimpContext *context;
GimpRGB color;
GeglColor *color;
const Babl *format;
gdouble pixel[4];
GimpActionSelectType select_type;
return_if_no_context (context, data);
select_type = (GimpActionSelectType) g_variant_get_int32 (value);
gimp_context_get_foreground (context, &color);
color.b = action_select_value (select_type,
color.b,
0.0, 1.0, 1.0,
1.0 / 255.0, 0.01, 0.1, 0.0, FALSE);
gimp_context_set_foreground (context, &color);
color = gegl_color_duplicate (gimp_context_get_foreground (context));
format = gimp_context_get_rgba_format (context, color, "double", NULL);
gegl_color_get_pixel (color, format, pixel);
pixel[2] = action_select_value (select_type,
pixel[2],
0.0, 1.0, 1.0,
1.0 / 255.0, 0.01, 0.1, 0.0, FALSE);
gegl_color_set_pixel (color, format, pixel);
gimp_context_set_foreground (context, color);
g_object_unref (color);
}
void
@@ -195,18 +223,25 @@ context_background_red_cmd_callback (GimpAction *action,
gpointer data)
{
GimpContext *context;
GimpRGB color;
GeglColor *color;
const Babl *format;
gdouble pixel[4];
GimpActionSelectType select_type;
return_if_no_context (context, data);
select_type = (GimpActionSelectType) g_variant_get_int32 (value);
gimp_context_get_background (context, &color);
color.r = action_select_value (select_type,
color.r,
0.0, 1.0, 1.0,
1.0 / 255.0, 0.01, 0.1, 0.0, FALSE);
gimp_context_set_background (context, &color);
color = gegl_color_duplicate (gimp_context_get_background (context));
format = gimp_context_get_rgba_format (context, color, "double", NULL);
gegl_color_get_pixel (color, format, pixel);
pixel[0] = action_select_value (select_type,
pixel[0],
0.0, 1.0, 1.0,
1.0 / 255.0, 0.01, 0.1, 0.0, FALSE);
gegl_color_set_pixel (color, format, pixel);
gimp_context_set_background (context, color);
g_object_unref (color);
}
void
@@ -215,18 +250,25 @@ context_background_green_cmd_callback (GimpAction *action,
gpointer data)
{
GimpContext *context;
GimpRGB color;
GeglColor *color;
const Babl *format;
gdouble pixel[4];
GimpActionSelectType select_type;
return_if_no_context (context, data);
select_type = (GimpActionSelectType) g_variant_get_int32 (value);
gimp_context_get_background (context, &color);
color.g = action_select_value (select_type,
color.g,
0.0, 1.0, 1.0,
1.0 / 255.0, 0.01, 0.1, 0.0, FALSE);
gimp_context_set_background (context, &color);
color = gegl_color_duplicate (gimp_context_get_background (context));
format = gimp_context_get_rgba_format (context, color, "double", NULL);
gegl_color_get_pixel (color, format, pixel);
pixel[1] = action_select_value (select_type,
pixel[1],
0.0, 1.0, 1.0,
1.0 / 255.0, 0.01, 0.1, 0.0, FALSE);
gegl_color_set_pixel (color, format, pixel);
gimp_context_set_background (context, color);
g_object_unref (color);
}
void
@@ -235,18 +277,25 @@ context_background_blue_cmd_callback (GimpAction *action,
gpointer data)
{
GimpContext *context;
GimpRGB color;
GeglColor *color;
const Babl *format;
gdouble pixel[4];
GimpActionSelectType select_type;
return_if_no_context (context, data);
select_type = (GimpActionSelectType) g_variant_get_int32 (value);
gimp_context_get_background (context, &color);
color.b = action_select_value (select_type,
color.b,
0.0, 1.0, 1.0,
1.0 / 255.0, 0.01, 0.1, 0.0, FALSE);
gimp_context_set_background (context, &color);
color = gegl_color_duplicate (gimp_context_get_background (context));
format = gimp_context_get_rgba_format (context, color, "double", NULL);
gegl_color_get_pixel (color, format, pixel);
pixel[2] = action_select_value (select_type,
pixel[2],
0.0, 1.0, 1.0,
1.0 / 255.0, 0.01, 0.1, 0.0, FALSE);
gegl_color_set_pixel (color, format, pixel);
gimp_context_set_background (context, color);
g_object_unref (color);
}
void
@@ -255,21 +304,22 @@ context_foreground_hue_cmd_callback (GimpAction *action,
gpointer data)
{
GimpContext *context;
GimpRGB color;
GimpHSV hsv;
GeglColor *color;
gdouble pixel[3];
GimpActionSelectType select_type;
return_if_no_context (context, data);
select_type = (GimpActionSelectType) g_variant_get_int32 (value);
gimp_context_get_foreground (context, &color);
gimp_rgb_to_hsv (&color, &hsv);
hsv.h = action_select_value (select_type,
hsv.h,
0.0, 1.0, 1.0,
1.0 / 360.0, 0.01, 0.1, 0.0, FALSE);
gimp_hsv_to_rgb (&hsv, &color);
gimp_context_set_foreground (context, &color);
color = gegl_color_duplicate (gimp_context_get_foreground (context));
gegl_color_get_pixel (color, babl_format_with_space ("HSV double", NULL), pixel);
pixel[0] = action_select_value (select_type,
pixel[0],
0.0, 1.0, 1.0,
1.0 / 360.0, 0.01, 0.1, 0.0, FALSE);
gegl_color_set_pixel (color, babl_format_with_space ("HSV double", NULL), pixel);
gimp_context_set_foreground (context, color);
g_object_unref (color);
}
void
@@ -278,21 +328,22 @@ context_foreground_saturation_cmd_callback (GimpAction *action,
gpointer data)
{
GimpContext *context;
GimpRGB color;
GimpHSV hsv;
GeglColor *color;
gdouble pixel[3];
GimpActionSelectType select_type;
return_if_no_context (context, data);
select_type = (GimpActionSelectType) g_variant_get_int32 (value);
gimp_context_get_foreground (context, &color);
gimp_rgb_to_hsv (&color, &hsv);
hsv.s = action_select_value (select_type,
hsv.s,
0.0, 1.0, 1.0,
0.01, 0.01, 0.1, 0.0, FALSE);
gimp_hsv_to_rgb (&hsv, &color);
gimp_context_set_foreground (context, &color);
color = gegl_color_duplicate (gimp_context_get_foreground (context));
gegl_color_get_pixel (color, babl_format_with_space ("HSV double", NULL), pixel);
pixel[1] = action_select_value (select_type,
pixel[1],
0.0, 1.0, 1.0,
0.01, 0.01, 0.1, 0.0, FALSE);
gegl_color_set_pixel (color, babl_format_with_space ("HSV double", NULL), pixel);
gimp_context_set_foreground (context, color);
g_object_unref (color);
}
void
@@ -301,21 +352,22 @@ context_foreground_value_cmd_callback (GimpAction *action,
gpointer data)
{
GimpContext *context;
GimpRGB color;
GimpHSV hsv;
GeglColor *color;
gdouble pixel[3];
GimpActionSelectType select_type;
return_if_no_context (context, data);
select_type = (GimpActionSelectType) g_variant_get_int32 (value);
gimp_context_get_foreground (context, &color);
gimp_rgb_to_hsv (&color, &hsv);
hsv.v = action_select_value (select_type,
hsv.v,
0.0, 1.0, 1.0,
0.01, 0.01, 0.1, 0.0, FALSE);
gimp_hsv_to_rgb (&hsv, &color);
gimp_context_set_foreground (context, &color);
color = gegl_color_duplicate (gimp_context_get_foreground (context));
gegl_color_get_pixel (color, babl_format_with_space ("HSV double", NULL), pixel);
pixel[2] = action_select_value (select_type,
pixel[2],
0.0, 1.0, 1.0,
0.01, 0.01, 0.1, 0.0, FALSE);
gegl_color_set_pixel (color, babl_format_with_space ("HSV double", NULL), pixel);
gimp_context_set_foreground (context, color);
g_object_unref (color);
}
void
@@ -324,21 +376,22 @@ context_background_hue_cmd_callback (GimpAction *action,
gpointer data)
{
GimpContext *context;
GimpRGB color;
GimpHSV hsv;
GeglColor *color;
gdouble pixel[3];
GimpActionSelectType select_type;
return_if_no_context (context, data);
select_type = (GimpActionSelectType) g_variant_get_int32 (value);
gimp_context_get_background (context, &color);
gimp_rgb_to_hsv (&color, &hsv);
hsv.h = action_select_value (select_type,
hsv.h,
0.0, 1.0, 1.0,
1.0 / 360.0, 0.01, 0.1, 0.0, FALSE);
gimp_hsv_to_rgb (&hsv, &color);
gimp_context_set_background (context, &color);
color = gegl_color_duplicate (gimp_context_get_background (context));
gegl_color_get_pixel (color, babl_format_with_space ("HSV double", NULL), pixel);
pixel[0] = action_select_value (select_type,
pixel[0],
0.0, 1.0, 1.0,
1.0 / 360.0, 0.01, 0.1, 0.0, FALSE);
gegl_color_set_pixel (color, babl_format_with_space ("HSV double", NULL), pixel);
gimp_context_set_background (context, color);
g_object_unref (color);
}
void
@@ -347,21 +400,22 @@ context_background_saturation_cmd_callback (GimpAction *action,
gpointer data)
{
GimpContext *context;
GimpRGB color;
GimpHSV hsv;
GeglColor *color;
gdouble pixel[3];
GimpActionSelectType select_type;
return_if_no_context (context, data);
select_type = (GimpActionSelectType) g_variant_get_int32 (value);
gimp_context_get_background (context, &color);
gimp_rgb_to_hsv (&color, &hsv);
hsv.s = action_select_value (select_type,
hsv.s,
0.0, 1.0, 1.0,
0.01, 0.01, 0.1, 0.0, FALSE);
gimp_hsv_to_rgb (&hsv, &color);
gimp_context_set_background (context, &color);
color = gegl_color_duplicate (gimp_context_get_background (context));
gegl_color_get_pixel (color, babl_format_with_space ("HSV double", NULL), pixel);
pixel[1] = action_select_value (select_type,
pixel[1],
0.0, 1.0, 1.0,
0.01, 0.01, 0.1, 0.0, FALSE);
gegl_color_set_pixel (color, babl_format_with_space ("HSV double", NULL), pixel);
gimp_context_set_background (context, color);
g_object_unref (color);
}
void
@@ -370,21 +424,22 @@ context_background_value_cmd_callback (GimpAction *action,
gpointer data)
{
GimpContext *context;
GimpRGB color;
GimpHSV hsv;
GeglColor *color;
gdouble pixel[3];
GimpActionSelectType select_type;
return_if_no_context (context, data);
select_type = (GimpActionSelectType) g_variant_get_int32 (value);
gimp_context_get_background (context, &color);
gimp_rgb_to_hsv (&color, &hsv);
hsv.v = action_select_value (select_type,
hsv.v,
0.0, 1.0, 1.0,
0.01, 0.01, 0.1, 0.0, FALSE);
gimp_hsv_to_rgb (&hsv, &color);
gimp_context_set_background (context, &color);
color = gegl_color_duplicate (gimp_context_get_background (context));
gegl_color_get_pixel (color, babl_format_with_space ("HSV double", NULL), pixel);
pixel[2] = action_select_value (select_type,
pixel[2],
0.0, 1.0, 1.0,
0.01, 0.01, 0.1, 0.0, FALSE);
gegl_color_set_pixel (color, babl_format_with_space ("HSV double", NULL), pixel);
gimp_context_set_background (context, color);
g_object_unref (color);
}
void
@@ -868,7 +923,7 @@ context_paint_mode_index (GimpLayerMode paint_mode,
static void
context_select_color (GimpActionSelectType select_type,
GimpRGB *color,
GeglColor *color,
gboolean use_colormap,
gboolean use_palette)
{
@@ -887,9 +942,9 @@ context_select_color (GimpActionSelectType select_type,
}
static gint
context_get_color_index (gboolean use_colormap,
gboolean use_palette,
const GimpRGB *color)
context_get_color_index (gboolean use_colormap,
gboolean use_palette,
GeglColor *color)
{
if (use_colormap)
{
@@ -954,10 +1009,10 @@ context_max_color_index (gboolean use_colormap,
}
static gboolean
context_set_color_index (gint index,
gboolean use_colormap,
gboolean use_palette,
GimpRGB *color)
context_set_color_index (gint index,
gboolean use_colormap,
gboolean use_palette,
GeglColor *color)
{
if (use_colormap)
{

View File

@@ -35,17 +35,10 @@
#include "gimp-intl.h"
static const GimpActionEntry cursor_info_actions[] =
{
{ "cursor-info-popup", GIMP_ICON_CURSOR,
NC_("cursor-info-action", "Pointer Information Menu"), NULL, NULL, NULL,
GIMP_HELP_POINTER_INFO_DIALOG }
};
static const GimpToggleActionEntry cursor_info_toggle_actions[] =
{
{ "cursor-info-sample-merged", NULL,
NC_("cursor-info-action", "_Sample Merged"), "",
NC_("cursor-info-action", "_Sample Merged"), NULL, { NULL },
NC_("cursor-info-action", "Use the composite color of all visible layers"),
cursor_info_sample_merged_cmd_callback,
TRUE,
@@ -56,10 +49,6 @@ static const GimpToggleActionEntry cursor_info_toggle_actions[] =
void
cursor_info_actions_setup (GimpActionGroup *group)
{
gimp_action_group_add_actions (group, "cursor-info-action",
cursor_info_actions,
G_N_ELEMENTS (cursor_info_actions));
gimp_action_group_add_toggle_actions (group, "cursor-info-action",
cursor_info_toggle_actions,
G_N_ELEMENTS (cursor_info_toggle_actions));

View File

@@ -36,10 +36,6 @@
static const GimpActionEntry dashboard_actions[] =
{
{ "dashboard-popup", GIMP_ICON_DIALOG_DASHBOARD,
NC_("dashboard-action", "Dashboard Menu"), NULL, NULL, NULL,
GIMP_HELP_DASHBOARD_DIALOG },
{ "dashboard-groups", NULL,
NC_("dashboard-action", "_Groups") },
{ "dashboard-update-interval", NULL,
@@ -48,25 +44,25 @@ static const GimpActionEntry dashboard_actions[] =
NC_("dashboard-action", "_History Duration") },
{ "dashboard-log-record", GIMP_ICON_RECORD,
NC_("dashboard-action", "_Start/Stop Recording..."), NULL,
NC_("dashboard-action", "_Start/Stop Recording..."), NULL, { NULL },
NC_("dashboard-action", "Start/stop recording performance log"),
dashboard_log_record_cmd_callback,
GIMP_HELP_DASHBOARD_LOG_RECORD },
{ "dashboard-log-add-marker", GIMP_ICON_MARKER,
NC_("dashboard-action", "_Add Marker..."), NULL,
NC_("dashboard-action", "_Add Marker..."), NULL, { NULL },
NC_("dashboard-action", "Add an event marker "
"to the performance log"),
dashboard_log_add_marker_cmd_callback,
GIMP_HELP_DASHBOARD_LOG_ADD_MARKER },
{ "dashboard-log-add-empty-marker", GIMP_ICON_MARKER,
NC_("dashboard-action", "Add _Empty Marker"), NULL,
NC_("dashboard-action", "Add _Empty Marker"), NULL, { NULL },
NC_("dashboard-action", "Add an empty event marker "
"to the performance log"),
dashboard_log_add_empty_marker_cmd_callback,
GIMP_HELP_DASHBOARD_LOG_ADD_EMPTY_MARKER },
{ "dashboard-reset", GIMP_ICON_RESET,
NC_("dashboard-action", "_Reset"), NULL,
NC_("dashboard-action", "_Reset"), NULL, { NULL },
NC_("dashboard-action", "Reset cumulative data"),
dashboard_reset_cmd_callback,
GIMP_HELP_DASHBOARD_RESET },
@@ -75,7 +71,7 @@ static const GimpActionEntry dashboard_actions[] =
static const GimpToggleActionEntry dashboard_toggle_actions[] =
{
{ "dashboard-low-swap-space-warning", NULL,
NC_("dashboard-action", "_Low Swap Space Warning"), NULL,
NC_("dashboard-action", "_Low Swap Space Warning"), NULL, { NULL },
NC_("dashboard-action", "Raise the dashboard when "
"the swap size approaches its limit"),
dashboard_low_swap_space_warning_cmd_callback,
@@ -86,27 +82,27 @@ static const GimpToggleActionEntry dashboard_toggle_actions[] =
static const GimpRadioActionEntry dashboard_update_interval_actions[] =
{
{ "dashboard-update-interval-0-25-sec", NULL,
NC_("dashboard-update-interval", "0.25 Seconds"), NULL, NULL,
NC_("dashboard-update-interval", "0.25 Seconds"), NULL, { NULL }, NULL,
GIMP_DASHBOARD_UPDATE_INTERVAL_0_25_SEC,
GIMP_HELP_DASHBOARD_UPDATE_INTERVAL },
{ "dashboard-update-interval-0-5-sec", NULL,
NC_("dashboard-update-interval", "0.5 Seconds"), NULL, NULL,
NC_("dashboard-update-interval", "0.5 Seconds"), NULL, { NULL }, NULL,
GIMP_DASHBOARD_UPDATE_INTERVAL_0_5_SEC,
GIMP_HELP_DASHBOARD_UPDATE_INTERVAL },
{ "dashboard-update-interval-1-sec", NULL,
NC_("dashboard-update-interval", "1 Second"), NULL, NULL,
NC_("dashboard-update-interval", "1 Second"), NULL, { NULL }, NULL,
GIMP_DASHBOARD_UPDATE_INTERVAL_1_SEC,
GIMP_HELP_DASHBOARD_UPDATE_INTERVAL },
{ "dashboard-update-interval-2-sec", NULL,
NC_("dashboard-update-interval", "2 Seconds"), NULL, NULL,
NC_("dashboard-update-interval", "2 Seconds"), NULL, { NULL }, NULL,
GIMP_DASHBOARD_UPDATE_INTERVAL_2_SEC,
GIMP_HELP_DASHBOARD_UPDATE_INTERVAL },
{ "dashboard-update-interval-4-sec", NULL,
NC_("dashboard-update-interval", "4 Seconds"), NULL, NULL,
NC_("dashboard-update-interval", "4 Seconds"), NULL, { NULL }, NULL,
GIMP_DASHBOARD_UPDATE_INTERVAL_4_SEC,
GIMP_HELP_DASHBOARD_UPDATE_INTERVAL }
};
@@ -114,27 +110,27 @@ static const GimpRadioActionEntry dashboard_update_interval_actions[] =
static const GimpRadioActionEntry dashboard_history_duration_actions[] =
{
{ "dashboard-history-duration-15-sec", NULL,
NC_("dashboard-history-duration", "15 Seconds"), NULL, NULL,
NC_("dashboard-history-duration", "15 Seconds"), NULL, { NULL }, NULL,
GIMP_DASHBOARD_HISTORY_DURATION_15_SEC,
GIMP_HELP_DASHBOARD_HISTORY_DURATION },
{ "dashboard-history-duration-30-sec", NULL,
NC_("dashboard-history-duration", "30 Seconds"), NULL, NULL,
NC_("dashboard-history-duration", "30 Seconds"), NULL, { NULL }, NULL,
GIMP_DASHBOARD_HISTORY_DURATION_30_SEC,
GIMP_HELP_DASHBOARD_HISTORY_DURATION },
{ "dashboard-history-duration-60-sec", NULL,
NC_("dashboard-history-duration", "60 Seconds"), NULL, NULL,
NC_("dashboard-history-duration", "60 Seconds"), NULL, { NULL }, NULL,
GIMP_DASHBOARD_HISTORY_DURATION_60_SEC,
GIMP_HELP_DASHBOARD_HISTORY_DURATION },
{ "dashboard-history-duration-120-sec", NULL,
NC_("dashboard-history-duration", "120 Seconds"), NULL, NULL,
NC_("dashboard-history-duration", "120 Seconds"), NULL, { NULL }, NULL,
GIMP_DASHBOARD_HISTORY_DURATION_120_SEC,
GIMP_HELP_DASHBOARD_HISTORY_DURATION },
{ "dashboard-history-duration-240-sec", NULL,
NC_("dashboard-history-duration", "240 Seconds"), NULL, NULL,
NC_("dashboard-history-duration", "240 Seconds"), NULL, { NULL }, NULL,
GIMP_DASHBOARD_HISTORY_DURATION_240_SEC,
GIMP_HELP_DASHBOARD_HISTORY_DURATION }
};

View File

@@ -31,52 +31,42 @@
#include "debug-actions.h"
#include "debug-commands.h"
#include "gimp-intl.h"
static const GimpActionEntry debug_actions[] =
{
{ "debug-menu", NULL, "_Debug" },
{ "debug-gtk-inspector", NULL,
"Start _GtkInspector", NULL, NULL,
N_("Start _GtkInspector"), NULL, { NULL }, NULL,
debug_gtk_inspector_cmd_callback,
NULL },
{ "debug-mem-profile", NULL,
"_Memory Profile", NULL, NULL,
N_("_Memory Profile"), NULL, { NULL }, NULL,
debug_mem_profile_cmd_callback,
NULL },
{ "debug-benchmark-projection", NULL,
"Benchmark _Projection", NULL,
"Invalidates the entire projection, measures the time it takes to "
N_("Benchmark _Projection"), NULL, { NULL },
N_("Invalidates the entire projection, measures the time it takes to "
"validate (render) the part that is visible in the active display, "
"and print the result to stdout.",
"and print the result to stdout."),
debug_benchmark_projection_cmd_callback,
NULL },
{ "debug-show-image-graph", NULL,
"Show Image _Graph", NULL,
"Creates a new image showing the GEGL graph of this image",
N_("Show Image _Graph"), NULL, { NULL },
N_("Creates a new image showing the GEGL graph of this image"),
debug_show_image_graph_cmd_callback,
NULL },
{ "debug-dump-items", NULL,
"_Dump Items", NULL, NULL,
debug_dump_menus_cmd_callback,
NULL },
{ "debug-dump-managers", NULL,
"Dump _UI Managers", NULL, NULL,
debug_dump_managers_cmd_callback,
NULL },
{ "debug-dump-keyboard-shortcuts", NULL,
"Dump _Keyboard Shortcuts", NULL, NULL,
N_("Dump _Keyboard Shortcuts"), NULL, { NULL }, NULL,
debug_dump_keyboard_shortcuts_cmd_callback,
NULL },
{ "debug-dump-attached-data", NULL,
"Dump Attached Data", NULL, NULL,
N_("Dump _Attached Data"), NULL, { NULL }, NULL,
debug_dump_attached_data_cmd_callback,
NULL }
};

View File

@@ -55,19 +55,11 @@
static gboolean debug_benchmark_projection (GimpDisplay *display);
static gboolean debug_show_image_graph (GimpImage *source_image);
static void debug_dump_menus_recurse_menu (GtkWidget *menu,
gint depth,
gchar *path);
static void debug_print_qdata (GimpObject *object);
static void debug_print_qdata_foreach (GQuark key_id,
gpointer data,
gpointer user_data);
static gboolean debug_accel_find_func (GtkAccelKey *key,
GClosure *closure,
gpointer data);
/* public functions */
@@ -117,94 +109,19 @@ debug_show_image_graph_cmd_callback (GimpAction *action,
g_idle_add ((GSourceFunc) debug_show_image_graph, g_object_ref (source_image));
}
void
debug_dump_menus_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data)
{
GList *list;
for (list = gimp_menu_factory_get_registered_menus (global_menu_factory);
list;
list = g_list_next (list))
{
GimpMenuFactoryEntry *entry = list->data;
GList *managers;
managers = gimp_ui_managers_from_name (entry->identifier);
if (managers)
{
GimpUIManager *manager = managers->data;
GList *list;
for (list = manager->registered_uis; list; list = g_list_next (list))
{
GimpUIManagerUIEntry *ui_entry = list->data;
if (GTK_IS_MENU_SHELL (ui_entry->widget))
{
g_print ("\n\n"
"========================================\n"
"Menu: %s%s\n"
"========================================\n\n",
entry->identifier, ui_entry->ui_path);
debug_dump_menus_recurse_menu (ui_entry->widget, 1,
entry->identifier);
g_print ("\n");
}
}
}
}
}
void
debug_dump_managers_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data)
{
GList *list;
for (list = gimp_menu_factory_get_registered_menus (global_menu_factory);
list;
list = g_list_next (list))
{
GimpMenuFactoryEntry *entry = list->data;
GList *managers;
managers = gimp_ui_managers_from_name (entry->identifier);
if (managers)
{
g_print ("\n\n"
"========================================\n"
"UI Manager: %s\n"
"========================================\n\n",
entry->identifier);
g_print ("%s\n", gimp_ui_manager_get_ui (managers->data));
}
}
}
void
debug_dump_keyboard_shortcuts_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data)
{
GimpDisplay *display;
GimpImageWindow *window;
GimpUIManager *manager;
GtkAccelGroup *accel_group;
GList *group_it;
GList *strings = NULL;
GimpDisplay *display;
GimpUIManager *manager;
GList *group_it;
GList *strings = NULL;
return_if_no_display (display, data);
window = gimp_display_shell_get_window (gimp_display_get_shell (display));
manager = gimp_image_window_get_ui_manager (window);
accel_group = gimp_ui_manager_get_accel_group (manager);
manager = menus_get_image_manager_singleton (display->gimp);
/* Gather formatted strings of keyboard shortcuts */
for (group_it = gimp_ui_manager_get_action_groups (manager);
@@ -220,43 +137,34 @@ debug_dump_keyboard_shortcuts_cmd_callback (GimpAction *action,
for (action_it = actions; action_it; action_it = g_list_next (action_it))
{
GimpAction *action = action_it->data;
const gchar *name = gimp_action_get_name (action);
GClosure *accel_closure = NULL;
gchar **accels;
GimpAction *action = action_it->data;
const gchar *name = gimp_action_get_name (action);
if (strstr (name, "-menu") ||
strstr (name, "-popup") ||
name[0] == '<')
continue;
if (name[0] == '<')
continue;
accel_closure = gimp_action_get_accel_closure (action);
accels = gimp_action_get_display_accels (action);
if (accel_closure)
if (accels && accels[0])
{
GtkAccelKey *key = gtk_accel_group_find (accel_group,
debug_accel_find_func,
accel_closure);
if (key &&
key->accel_key &&
key->accel_flags & GTK_ACCEL_VISIBLE)
{
const gchar *label_tmp;
gchar *label;
gchar *key_string;
const gchar *label_tmp;
gchar *label;
label_tmp = gimp_action_get_label (action);
label = gimp_strip_uline (label_tmp);
key_string = gtk_accelerator_get_label (key->accel_key,
key->accel_mods);
label_tmp = gimp_action_get_label (action);
label = gimp_strip_uline (label_tmp);
strings = g_list_prepend (strings,
g_strdup_printf ("%-20s %s",
key_string, label));
strings = g_list_prepend (strings,
g_strdup_printf ("%-20s %s",
accels[0], label));
g_free (key_string);
g_free (label);
}
g_free (label);
for (gint i = 1; accels[i] != NULL; i++)
strings = g_list_prepend (strings, g_strdup (accels[i]));
}
g_strfreev (accels);
}
g_list_free (actions);
@@ -371,54 +279,6 @@ debug_show_image_graph (GimpImage *source_image)
return FALSE;
}
static void
debug_dump_menus_recurse_menu (GtkWidget *menu,
gint depth,
gchar *path)
{
GList *children;
GList *list;
children = gtk_container_get_children (GTK_CONTAINER (menu));
for (list = children; list; list = g_list_next (list))
{
GtkWidget *menu_item = GTK_WIDGET (list->data);
GtkWidget *child = gtk_bin_get_child (GTK_BIN (menu_item));
if (GTK_IS_LABEL (child))
{
GtkWidget *submenu;
const gchar *label;
gchar *full_path;
gchar *help_page;
gchar *format_str;
label = gtk_label_get_text (GTK_LABEL (child));
full_path = g_strconcat (path, "/", label, NULL);
help_page = g_object_get_data (G_OBJECT (menu_item), "gimp-help-id");
help_page = g_strdup (help_page);
format_str = g_strdup_printf ("%%%ds%%%ds %%-20s %%s\n",
depth * 2, depth * 2 - 40);
g_print (format_str,
"", label, "", help_page ? help_page : "");
g_free (format_str);
g_free (help_page);
submenu = gtk_menu_item_get_submenu (GTK_MENU_ITEM (menu_item));
if (submenu)
debug_dump_menus_recurse_menu (submenu, depth + 1, full_path);
g_free (full_path);
}
}
g_list_free (children);
}
static void
debug_print_qdata (GimpObject *object)
{
@@ -436,11 +296,3 @@ debug_print_qdata_foreach (GQuark key_id,
{
g_print ("%s: %p\n", g_quark_to_string (key_id), data);
}
static gboolean
debug_accel_find_func (GtkAccelKey *key,
GClosure *closure,
gpointer data)
{
return (GClosure *) data == closure;
}

View File

@@ -34,9 +34,6 @@ void debug_show_image_graph_cmd_callback (GimpAction *action,
void debug_dump_menus_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data);
void debug_dump_managers_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data);
void debug_dump_keyboard_shortcuts_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data);

View File

@@ -44,199 +44,259 @@
const GimpStringActionEntry dialogs_dockable_actions[] =
{
{ "dialogs-toolbox", NULL,
NC_("windows-action", "Tool_box"), "<primary>B",
NC_("windows-action", "Tool_box"), NULL, { "<primary>B", NULL },
NULL /* set in dialogs_actions_update() */,
"gimp-toolbox",
GIMP_HELP_TOOLBOX },
{ "dialogs-tool-options", GIMP_ICON_DIALOG_TOOL_OPTIONS,
NC_("dialogs-action", "Tool _Options"), NULL,
NC_("dialogs-action", "Tool _Options Dialog"),
NC_("dialogs-action", "Tool _Options"),
{ NULL },
NC_("dialogs-action", "Open the tool options dialog"),
"gimp-tool-options",
GIMP_HELP_TOOL_OPTIONS_DIALOG },
{ "dialogs-device-status", GIMP_ICON_DIALOG_DEVICE_STATUS,
NC_("dialogs-action", "_Device Status"), NULL,
NC_("dialogs-action", "_Device Status Dialog"),
NC_("dialogs-action", "_Device Status"),
{ NULL },
NC_("dialogs-action", "Open the device status dialog"),
"gimp-device-status",
GIMP_HELP_DEVICE_STATUS_DIALOG },
{ "dialogs-symmetry", GIMP_ICON_SYMMETRY,
NC_("dialogs-action", "_Symmetry Painting"), NULL,
NC_("dialogs-action", "_Symmetry Painting Dialog"),
NC_("dialogs-action", "_Symmetry Painting"),
{ NULL },
NC_("dialogs-action", "Open the symmetry dialog"),
"gimp-symmetry-editor",
GIMP_HELP_SYMMETRY_DIALOG },
{ "dialogs-layers", GIMP_ICON_DIALOG_LAYERS,
NC_("dialogs-action", "_Layers"), "<primary>L",
NC_("dialogs-action", "_Layers Dialog"),
NC_("dialogs-action", "_Layers"),
{ "<primary>L", NULL },
NC_("dialogs-action", "Open the layers dialog"),
"gimp-layer-list",
GIMP_HELP_LAYER_DIALOG },
{ "dialogs-channels", GIMP_ICON_DIALOG_CHANNELS,
NC_("dialogs-action", "_Channels"), NULL,
NC_("dialogs-action", "_Channels Dialog"),
NC_("dialogs-action", "_Channels"),
{ NULL },
NC_("dialogs-action", "Open the channels dialog"),
"gimp-channel-list",
GIMP_HELP_CHANNEL_DIALOG },
{ "dialogs-vectors", GIMP_ICON_DIALOG_PATHS,
NC_("dialogs-action", "_Paths"), NULL,
NC_("dialogs-action", "_Paths Dialog"),
NC_("dialogs-action", "_Paths"),
{ NULL },
NC_("dialogs-action", "Open the paths dialog"),
"gimp-vectors-list",
GIMP_HELP_PATH_DIALOG },
{ "dialogs-indexed-palette", GIMP_ICON_COLORMAP,
NC_("dialogs-action", "Color_map"), NULL,
NC_("dialogs-action", "Color_map Dialog"),
NC_("dialogs-action", "Color_map"),
{ NULL },
NC_("dialogs-action", "Open the colormap dialog"),
"gimp-indexed-palette",
GIMP_HELP_INDEXED_PALETTE_DIALOG },
{ "dialogs-histogram", GIMP_ICON_HISTOGRAM,
NC_("dialogs-action", "Histogra_m"), NULL,
NC_("dialogs-action", "Histogra_m Dialog"),
NC_("dialogs-action", "Histogra_m"),
{ NULL },
NC_("dialogs-action", "Open the histogram dialog"),
"gimp-histogram-editor",
GIMP_HELP_HISTOGRAM_DIALOG },
{ "dialogs-selection-editor", GIMP_ICON_SELECTION,
NC_("dialogs-action", "_Selection Editor"), NULL,
{ NULL },
NC_("dialogs-action", "Open the selection editor"),
"gimp-selection-editor",
GIMP_HELP_SELECTION_DIALOG },
{ "dialogs-navigation", GIMP_ICON_DIALOG_NAVIGATION,
NC_("dialogs-action", "Na_vigation"), NULL,
NC_("dialogs-action", "Na_vigation Dialog"),
NC_("dialogs-action", "Na_vigation"),
{ NULL },
NC_("dialogs-action", "Open the display navigation dialog"),
"gimp-navigation-view",
GIMP_HELP_NAVIGATION_DIALOG },
{ "dialogs-undo-history", GIMP_ICON_DIALOG_UNDO_HISTORY,
NC_("dialogs-action", "Undo _History"), NULL,
NC_("dialogs-action", "Undo _History Dialog"),
NC_("dialogs-action", "Undo _History"),
{ NULL },
NC_("dialogs-action", "Open the undo history dialog"),
"gimp-undo-history",
GIMP_HELP_UNDO_DIALOG },
{ "dialogs-cursor", GIMP_ICON_CURSOR,
NC_("dialogs-action", "_Pointer"), NULL,
NC_("dialogs-action", "_Pointer Dialog"),
NC_("dialogs-action", "_Pointer"),
{ NULL },
NC_("dialogs-action", "Open the pointer information dialog"),
"gimp-cursor-view",
GIMP_HELP_POINTER_INFO_DIALOG },
{ "dialogs-sample-points", GIMP_ICON_SAMPLE_POINT,
NC_("dialogs-action", "_Sample Points"), NULL,
NC_("dialogs-action", "_Sample Points Dialog"),
NC_("dialogs-action", "_Sample Points"),
{ NULL },
NC_("dialogs-action", "Open the sample points dialog"),
"gimp-sample-point-editor",
GIMP_HELP_SAMPLE_POINT_DIALOG },
{ "dialogs-colors", GIMP_ICON_COLORS_DEFAULT,
NC_("dialogs-action", "Colo_rs"), NULL,
NC_("dialogs-action", "Colo_rs Dialog"),
NC_("dialogs-action", "Colo_rs"),
{ NULL },
NC_("dialogs-action", "Open the FG/BG color dialog"),
"gimp-color-editor",
GIMP_HELP_COLOR_DIALOG },
{ "dialogs-brushes", GIMP_ICON_BRUSH,
NC_("dialogs-action", "_Brushes"), "<primary><shift>B",
NC_("dialogs-action", "_Brushes Dialog"),
NC_("dialogs-action", "_Brushes"),
{ "<primary><shift>B", NULL },
NC_("dialogs-action", "Open the brushes dialog"),
"gimp-brush-grid|gimp-brush-list",
GIMP_HELP_BRUSH_DIALOG },
{ "dialogs-brush-editor", GIMP_ICON_BRUSH,
NC_("dialogs-action", "Brush Editor"), NULL,
{ NULL },
NC_("dialogs-action", "Open the brush editor"),
"gimp-brush-editor",
GIMP_HELP_BRUSH_EDIT },
{ "dialogs-dynamics", GIMP_ICON_DYNAMICS,
NC_("dialogs-action", "Paint D_ynamics"), NULL,
NC_("dialogs-action", "Paint D_ynamics Dialog"),
NC_("dialogs-action", "Paint D_ynamics"),
{ NULL },
NC_("dialogs-action", "Open paint dynamics dialog"),
"gimp-dynamics-list|gimp-dynamics-grid",
GIMP_HELP_DYNAMICS_DIALOG },
{ "dialogs-dynamics-editor", GIMP_ICON_DYNAMICS,
NC_("dialogs-action", "Paint Dynamics Editor"), NULL,
{ NULL },
NC_("dialogs-action", "Open the paint dynamics editor"),
"gimp-dynamics-editor",
GIMP_HELP_DYNAMICS_EDITOR_DIALOG },
{ "dialogs-mypaint-brushes", GIMP_ICON_MYPAINT_BRUSH,
NC_("dialogs-action", "_MyPaint Brushes"), NULL,
NC_("dialogs-action", "_MyPaint Brushes Dialog"),
NC_("dialogs-action", "_MyPaint Brushes"),
{ NULL },
NC_("dialogs-action", "Open the mypaint brushes dialog"),
"gimp-mypaint-brush-grid|gimp-mapyint-brush-list",
GIMP_HELP_MYPAINT_BRUSH_DIALOG },
{ "dialogs-patterns", GIMP_ICON_PATTERN,
NC_("dialogs-action", "P_atterns"), "<primary><shift>P",
NC_("dialogs-action", "P_atterns Dialog"),
NC_("dialogs-action", "P_atterns"),
{ "<primary><shift>P", NULL },
NC_("dialogs-action", "Open the patterns dialog"),
"gimp-pattern-grid|gimp-pattern-list",
GIMP_HELP_PATTERN_DIALOG },
{ "dialogs-gradients", GIMP_ICON_GRADIENT,
NC_("dialogs-action", "_Gradients"), "<primary>G",
NC_("dialogs-action", "_Gradients Dialog"),
NC_("dialogs-action", "_Gradients"),
{ "<primary>G", NULL },
NC_("dialogs-action", "Open the gradients dialog"),
"gimp-gradient-list|gimp-gradient-grid",
GIMP_HELP_GRADIENT_DIALOG },
{ "dialogs-gradient-editor", GIMP_ICON_GRADIENT,
NC_("dialogs-action", "Gradient Editor"), NULL,
{ NULL },
NC_("dialogs-action", "Open the gradient editor"),
"gimp-gradient-editor",
GIMP_HELP_GRADIENT_EDIT },
{ "dialogs-palettes", GIMP_ICON_PALETTE,
NC_("dialogs-action", "Pal_ettes"), NULL,
NC_("dialogs-action", "Pal_ettes Dialog"),
NC_("dialogs-action", "Pal_ettes"),
{ NULL },
NC_("dialogs-action", "Open the palettes dialog"),
"gimp-palette-list|gimp-palette-grid",
GIMP_HELP_PALETTE_DIALOG },
{ "dialogs-palette-editor", GIMP_ICON_PALETTE,
NC_("dialogs-action", "Palette _Editor"), NULL,
NC_("dialogs-action", "Palette _Editor"),
NC_("dialogs-action", "Palette _Editor"),
{ NULL },
NC_("dialogs-action", "Open the palette editor"),
"gimp-palette-editor",
GIMP_HELP_PALETTE_EDIT },
{ "dialogs-tool-presets", GIMP_ICON_TOOL_PRESET,
NC_("dialogs-action", "Tool Pre_sets"), NULL,
NC_("dialogs-action", "Tool Pre_sets Dialog"),
NC_("dialogs-action", "Tool Pre_sets"),
{ NULL },
NC_("dialogs-action", "Open tool presets dialog"),
"gimp-tool-preset-list|gimp-tool-preset-grid",
GIMP_HELP_TOOL_PRESET_DIALOG },
{ "dialogs-fonts", GIMP_ICON_FONT,
NC_("dialogs-action", "_Fonts"), NULL,
NC_("dialogs-action", "_Fonts Dialog"),
NC_("dialogs-action", "_Fonts"),
{ NULL },
NC_("dialogs-action", "Open the fonts dialog"),
"gimp-font-list|gimp-font-grid",
GIMP_HELP_FONT_DIALOG },
{ "dialogs-buffers", GIMP_ICON_BUFFER,
NC_("dialogs-action", "B_uffers"), "",
NC_("dialogs-action", "B_uffers Dialog"),
NC_("dialogs-action", "B_uffers"),
{ NULL },
NC_("dialogs-action", "Open the named buffers dialog"),
"gimp-buffer-list|gimp-buffer-grid",
GIMP_HELP_BUFFER_DIALOG },
{ "dialogs-images", GIMP_ICON_DIALOG_IMAGES,
NC_("dialogs-action", "_Images"), NULL,
NC_("dialogs-action", "_Images Dialog"),
NC_("dialogs-action", "_Images"),
{ NULL },
NC_("dialogs-action", "Open the images dialog"),
"gimp-image-list|gimp-image-grid",
GIMP_HELP_IMAGE_DIALOG },
{ "dialogs-document-history", GIMP_ICON_DOCUMENT_OPEN_RECENT,
NC_("dialogs-action", "Document Histor_y"), "",
NC_("dialogs-action", "Document Histor_y Dialog"),
NC_("dialogs-action", "Document Histor_y"),
{ NULL },
NC_("dialogs-action", "Open the document history dialog"),
"gimp-document-list|gimp-document-grid",
GIMP_HELP_DOCUMENT_DIALOG },
{ "dialogs-templates", GIMP_ICON_TEMPLATE,
NC_("dialogs-action", "_Templates"), "",
NC_("dialogs-action", "_Templates Dialog"),
NC_("dialogs-action", "_Templates"),
{ NULL },
NC_("dialogs-action", "Open the image templates dialog"),
"gimp-template-list|gimp-template-grid",
GIMP_HELP_TEMPLATE_DIALOG },
{ "dialogs-error-console", GIMP_ICON_DIALOG_WARNING,
NC_("dialogs-action", "Error Co_nsole"), NULL,
NC_("dialogs-action", "Error Co_nsole"),
NC_("dialogs-action", "Error Co_nsole"),
{ NULL },
NC_("dialogs-action", "Open the error console"),
"gimp-error-console",
GIMP_HELP_ERRORS_DIALOG },
{ "dialogs-dashboard", GIMP_ICON_DIALOG_DASHBOARD,
NC_("dialogs-action", "_Dashboard"), NULL,
NC_("dialogs-action", "_Dashboard"),
NC_("dialogs-action", "_Dashboard"),
{ NULL },
NC_("dialogs-action", "Open the dashboard"),
"gimp-dashboard",
GIMP_HELP_ERRORS_DIALOG }
@@ -247,37 +307,47 @@ gint n_dialogs_dockable_actions = G_N_ELEMENTS (dialogs_dockable_actions);
static const GimpStringActionEntry dialogs_toplevel_actions[] =
{
{ "dialogs-preferences", GIMP_ICON_PREFERENCES_SYSTEM,
NC_("dialogs-action", "_Preferences"), NULL,
NC_("dialogs-action", "_Preferences"),
NC_("dialogs-action", "_Preferences"),
{ NULL },
NC_("dialogs-action", "Open the preferences dialog"),
"gimp-preferences-dialog",
GIMP_HELP_PREFS_DIALOG },
{ "dialogs-input-devices", GIMP_ICON_INPUT_DEVICE,
NC_("dialogs-action", "_Input Devices"), NULL,
NC_("dialogs-action", "_Input Devices Editor"),
NC_("dialogs-action", "_Input Devices"),
{ NULL },
NC_("dialogs-action", "Open the input devices editor"),
"gimp-input-devices-dialog",
GIMP_HELP_INPUT_DEVICES },
{ "dialogs-keyboard-shortcuts", GIMP_ICON_CHAR_PICKER,
NC_("dialogs-action", "_Keyboard Shortcuts"), NULL,
NC_("dialogs-action", "_Keyboard Shortcuts Editor"),
NC_("dialogs-action", "_Keyboard Shortcuts"),
{ NULL },
NC_("dialogs-action", "Open the keyboard shortcuts editor"),
"gimp-keyboard-shortcuts-dialog",
GIMP_HELP_KEYBOARD_SHORTCUTS },
{ "dialogs-module-dialog", GIMP_ICON_SYSTEM_RUN,
NC_("dialogs-action", "_Modules"), NULL,
NC_("dialogs-action", "_Modules Dialog"),
NC_("dialogs-action", "_Modules"),
{ NULL },
NC_("dialogs-action", "Open the module manager dialog"),
"gimp-module-dialog",
GIMP_HELP_MODULE_DIALOG },
{ "dialogs-tips", GIMP_ICON_DIALOG_INFORMATION,
NC_("dialogs-action", "_Tip of the Day"), NULL,
{ NULL },
NC_("dialogs-action", "Show some helpful tips on using GIMP"),
"gimp-tips-dialog",
GIMP_HELP_TIPS_DIALOG },
{ "dialogs-welcome", GIMP_ICON_DIALOG_INFORMATION,
NC_("dialogs-action", "Welcome Dialog"), NULL,
{ NULL },
NC_("dialogs-action", "Show information on running GIMP release"),
"gimp-welcome-dialog",
GIMP_HELP_WELCOME_DIALOG },
@@ -290,22 +360,26 @@ static const GimpStringActionEntry dialogs_toplevel_actions[] =
#else /* UNIX: use GNOME HIG */
NC_("dialogs-action", "_About"),
#endif
NULL,
NULL, { NULL },
NC_("dialogs-action", "About GIMP"),
"gimp-about-dialog",
GIMP_HELP_ABOUT_DIALOG },
{ "dialogs-action-search", GIMP_ICON_TOOL_ZOOM,
NC_("dialogs-action", "_Search and Run a Command"), "slash",
NC_("dialogs-action", "_Search and Run a Command"), NULL,
{ "slash", "KP_Divide", NULL },
NC_("dialogs-action", "Search commands by keyword, and run them"),
"gimp-action-search-dialog",
GIMP_HELP_ACTION_SEARCH_DIALOG },
#ifndef GIMP_RELEASE
{ "dialogs-extensions", GIMP_ICON_PLUGIN,
NC_("dialogs-action", "Manage _Extensions"), NULL,
{ NULL },
NC_("dialogs-action", "Manage Extensions: search, install, uninstall, update."),
"gimp-extensions-dialog",
GIMP_HELP_EXTENSIONS_DIALOG }
#endif
};

View File

@@ -42,17 +42,13 @@
static const GimpActionEntry dock_actions[] =
{
{ "dock-move-to-screen-menu", GIMP_ICON_WINDOW_MOVE_TO_SCREEN,
NC_("dock-action", "M_ove to Screen"), NULL, NULL, NULL,
GIMP_HELP_DOCK_CHANGE_SCREEN },
{ "dock-close", GIMP_ICON_WINDOW_CLOSE,
NC_("dock-action", "Close Dock"), "", NULL,
NC_("dock-action", "Close Dock"), NULL, { NULL }, NULL,
window_close_cmd_callback,
GIMP_HELP_DOCK_CLOSE },
{ "dock-open-display", NULL,
NC_("dock-action", "_Open Display..."), NULL,
NC_("dock-action", "_Open Display..."), NULL, { NULL },
NC_("dock-action", "Connect to another display"),
window_open_display_cmd_callback,
NULL }
@@ -61,13 +57,13 @@ static const GimpActionEntry dock_actions[] =
static const GimpToggleActionEntry dock_toggle_actions[] =
{
{ "dock-show-image-menu", NULL,
NC_("dock-action", "_Show Image Selection"), NULL, NULL,
NC_("dock-action", "_Show Image Selection"), NULL, { NULL }, NULL,
dock_toggle_image_menu_cmd_callback,
TRUE,
GIMP_HELP_DOCK_IMAGE_MENU },
{ "dock-auto-follow-active", NULL,
NC_("dock-action", "Auto _Follow Active Image"), NULL, NULL,
NC_("dock-action", "Auto _Follow Active Image"), NULL, { NULL }, NULL,
dock_toggle_auto_cmd_callback,
TRUE,
GIMP_HELP_DOCK_AUTO_BUTTON }

View File

@@ -45,37 +45,25 @@
static const GimpActionEntry dockable_actions[] =
{
{ "dockable-popup", NULL,
NC_("dockable-action", "Dialogs Menu"), NULL, NULL, NULL,
GIMP_HELP_DOCK },
{ "dockable-menu", "image-missing", "" },
{ "dockable-add-tab-menu", NULL, NC_("dockable-action",
"_Add Tab") },
{ "dockable-preview-size-menu", NULL, NC_("dockable-action",
"_Preview Size") },
{ "dockable-tab-style-menu", NULL, NC_("dockable-action",
"_Tab Style") },
{ "dockable-close-tab", "window-close",
NC_("dockable-action", "_Close Tab"), "", NULL,
NC_("dockable-action", "_Close Tab"), NULL, { NULL }, NULL,
dockable_close_tab_cmd_callback,
GIMP_HELP_DOCK_TAB_CLOSE },
{ "dockable-detach-tab", GIMP_ICON_DETACH,
NC_("dockable-action", "_Detach Tab"), "", NULL,
NC_("dockable-action", "_Detach Tab"), NULL, { NULL }, NULL,
dockable_detach_tab_cmd_callback,
GIMP_HELP_DOCK_TAB_DETACH }
};
#define VIEW_SIZE(action,label,size) \
{ "dockable-preview-size-" action, NULL, \
(label), NULL, NULL, \
(label), NULL, { NULL }, NULL, \
(size), \
GIMP_HELP_DOCK_PREVIEW_SIZE }
#define TAB_STYLE(action,label,style) \
{ "dockable-tab-style-" action, NULL, \
(label), NULL, NULL, \
(label), NULL, { NULL }, NULL, \
(style), \
GIMP_HELP_DOCK_TAB_STYLE }
@@ -122,7 +110,7 @@ static const GimpRadioActionEntry dockable_tab_style_actions[] =
static const GimpToggleActionEntry dockable_toggle_actions[] =
{
{ "dockable-lock-tab", NULL,
NC_("dockable-action", "Loc_k Tab to Dock"), NULL,
NC_("dockable-action", "Loc_k Tab to Dock"), NULL, { NULL },
NC_("dockable-action",
"Protect this tab from being dragged with the mouse pointer"),
dockable_lock_tab_cmd_callback,
@@ -130,7 +118,7 @@ static const GimpToggleActionEntry dockable_toggle_actions[] =
GIMP_HELP_DOCK_TAB_LOCK },
{ "dockable-show-button-bar", NULL,
NC_("dockable-action", "Show _Button Bar"), NULL, NULL,
NC_("dockable-action", "Show _Button Bar"), NULL, { NULL }, NULL,
dockable_show_button_bar_cmd_callback,
TRUE,
GIMP_HELP_DOCK_SHOW_BUTTON_BAR }
@@ -139,12 +127,12 @@ static const GimpToggleActionEntry dockable_toggle_actions[] =
static const GimpRadioActionEntry dockable_view_type_actions[] =
{
{ "dockable-view-type-list", NULL,
NC_("dockable-action", "View as _List"), NULL, NULL,
NC_("dockable-action", "View as _List"), NULL, { NULL }, NULL,
GIMP_VIEW_TYPE_LIST,
GIMP_HELP_DOCK_VIEW_AS_LIST },
{ "dockable-view-type-grid", NULL,
NC_("dockable-action", "View as _Grid"), NULL, NULL,
NC_("dockable-action", "View as _Grid"), NULL, { NULL }, NULL,
GIMP_VIEW_TYPE_GRID,
GIMP_HELP_DOCK_VIEW_AS_GRID }
};
@@ -288,8 +276,6 @@ dockable_actions_update (GimpActionGroup *group,
SET_ACTIVE ("dockable-lock-tab", locked);
SET_VISIBLE ("dockable-preview-size-menu", view_size != -1);
if (view_size != -1)
{
if (view_size >= GIMP_VIEW_SIZE_GIGANTIC)

View File

@@ -38,66 +38,62 @@
static const GimpActionEntry documents_actions[] =
{
{ "documents-popup", GIMP_ICON_DOCUMENT_OPEN_RECENT,
NC_("documents-action", "Documents Menu"), NULL, NULL, NULL,
GIMP_HELP_DOCUMENT_DIALOG },
{ "documents-open", GIMP_ICON_DOCUMENT_OPEN,
NC_("documents-action", "_Open Image"), NULL,
NC_("documents-action", "_Open Image"), NULL, { NULL },
NC_("documents-action", "Open the selected entry"),
documents_open_cmd_callback,
GIMP_HELP_DOCUMENT_OPEN },
{ "documents-raise-or-open", NULL,
NC_("documents-action", "_Raise or Open Image"), NULL,
NC_("documents-action", "_Raise or Open Image"), NULL, { NULL },
NC_("documents-action", "Raise window if already open"),
documents_raise_or_open_cmd_callback,
GIMP_HELP_DOCUMENT_OPEN },
{ "documents-file-open-dialog", NULL,
NC_("documents-action", "File Open _Dialog"), NULL,
NC_("documents-action", "File Open _Dialog"), NULL, { NULL },
NC_("documents-action", "Open image dialog"),
documents_file_open_dialog_cmd_callback,
GIMP_HELP_DOCUMENT_OPEN },
{ "documents-copy-location", GIMP_ICON_EDIT_COPY,
NC_("documents-action", "Copy Image _Location"), NULL,
NC_("documents-action", "Copy Image _Location"), NULL, { NULL },
NC_("documents-action", "Copy image location to clipboard"),
documents_copy_location_cmd_callback,
GIMP_HELP_DOCUMENT_COPY_LOCATION },
{ "documents-show-in-file-manager", GIMP_ICON_FILE_MANAGER,
NC_("documents-action", "Show in _File Manager"), NULL,
NC_("documents-action", "Show in _File Manager"), NULL, { NULL },
NC_("documents-action", "Show image location in the file manager"),
documents_show_in_file_manager_cmd_callback,
GIMP_HELP_DOCUMENT_SHOW_IN_FILE_MANAGER },
{ "documents-remove", GIMP_ICON_LIST_REMOVE,
NC_("documents-action", "Remove _Entry"), NULL,
NC_("documents-action", "Remove _Entry"), NULL, { NULL },
NC_("documents-action", "Remove the selected entry"),
documents_remove_cmd_callback,
GIMP_HELP_DOCUMENT_REMOVE },
{ "documents-clear", GIMP_ICON_SHRED,
NC_("documents-action", "_Clear History"), NULL,
NC_("documents-action", "_Clear History"), NULL, { NULL },
NC_("documents-action", "Clear the entire document history"),
documents_clear_cmd_callback,
GIMP_HELP_DOCUMENT_CLEAR },
{ "documents-recreate-preview", GIMP_ICON_VIEW_REFRESH,
NC_("documents-action", "Recreate _Preview"), NULL,
NC_("documents-action", "Recreate _Preview"), NULL, { NULL },
NC_("documents-action", "Recreate preview"),
documents_recreate_preview_cmd_callback,
GIMP_HELP_DOCUMENT_REFRESH },
{ "documents-reload-previews", NULL,
NC_("documents-action", "Reload _all Previews"), NULL,
NC_("documents-action", "Reload _all Previews"), NULL, { NULL },
NC_("documents-action", "Reload all previews"),
documents_reload_previews_cmd_callback,
GIMP_HELP_DOCUMENT_REFRESH },
{ "documents-remove-dangling", NULL,
NC_("documents-action", "Remove Dangling E_ntries"), NULL,
NC_("documents-action", "Remove Dangling E_ntries"), NULL, { NULL },
NC_("documents-action",
"Remove entries for which the corresponding file is not available"),
documents_remove_dangling_cmd_callback,

View File

@@ -34,6 +34,7 @@
#include "core/gimpcontainer.h"
#include "core/gimpcontext.h"
#include "core/gimpimagefile.h"
#include "core/gimpimage.h"
#include "file/file-open.h"
@@ -121,7 +122,7 @@ documents_raise_or_open_cmd_callback (GimpAction *action,
closure.name = gimp_object_get_name (imagefile);
closure.found = FALSE;
gimp_container_foreach (context->gimp->displays,
gimp_container_foreach (GIMP_CONTAINER (context->gimp->displays),
(GFunc) documents_raise_display,
&closure);
@@ -399,11 +400,24 @@ static void
documents_raise_display (GimpDisplay *display,
RaiseClosure *closure)
{
const gchar *uri = gimp_object_get_name (gimp_display_get_image (display));
GimpImage *image;
GFile *file;
gchar *uri = NULL;
image = gimp_display_get_image (display);
file = gimp_image_get_file (image);
if (! file)
file = gimp_image_get_imported_file (image);
if (file)
uri = g_file_get_uri (file);
if (! g_strcmp0 (closure->name, uri))
{
closure->found = TRUE;
gimp_display_shell_present (gimp_display_get_shell (display));
}
g_free (uri);
}

View File

@@ -42,13 +42,13 @@
static const GimpActionEntry drawable_actions[] =
{
{ "drawable-equalize", NULL,
NC_("drawable-action", "_Equalize"), NULL,
NC_("drawable-action", "_Equalize"), NULL, { NULL },
NC_("drawable-action", "Automatic contrast enhancement"),
drawable_equalize_cmd_callback,
GIMP_HELP_LAYER_EQUALIZE },
{ "drawable-levels-stretch", NULL,
NC_("drawable-action", "_White Balance"), NULL,
NC_("drawable-action", "_White Balance"), NULL, { NULL },
NC_("drawable-action", "Automatic white balance correction"),
drawable_levels_stretch_cmd_callback,
GIMP_HELP_LAYER_WHITE_BALANCE }
@@ -57,23 +57,23 @@ static const GimpActionEntry drawable_actions[] =
static const GimpToggleActionEntry drawable_toggle_actions[] =
{
{ "drawable-visible", GIMP_ICON_VISIBLE,
NC_("drawable-action", "Toggle Drawable _Visibility"), NULL, NULL,
NC_("drawable-action", "Toggle Drawables _Visibility"), NULL, { NULL }, NULL,
drawable_visible_cmd_callback,
FALSE,
GIMP_HELP_LAYER_VISIBLE },
{ "drawable-lock-content", GIMP_ICON_LOCK_CONTENT,
NC_("drawable-action", "L_ock Pixels of Drawable"), NULL,
NC_("drawable-action", "L_ock Pixels of Drawables"), NULL, { NULL },
NC_("drawable-action",
"Keep the pixels on this drawable from being modified"),
"Keep the pixels on selected drawables from being modified"),
drawable_lock_content_cmd_callback,
FALSE,
GIMP_HELP_LAYER_LOCK_PIXELS },
{ "drawable-lock-position", GIMP_ICON_LOCK_POSITION,
NC_("drawable-action", "L_ock Position of Drawable"), NULL,
NC_("drawable-action", "L_ock Position of Drawables"), NULL, { NULL },
NC_("drawable-action",
"Keep the position on this drawable from being modified"),
"Keep the position on selected drawables from being modified"),
drawable_lock_position_cmd_callback,
FALSE,
GIMP_HELP_LAYER_LOCK_POSITION },
@@ -82,13 +82,13 @@ static const GimpToggleActionEntry drawable_toggle_actions[] =
static const GimpEnumActionEntry drawable_flip_actions[] =
{
{ "drawable-flip-horizontal", GIMP_ICON_OBJECT_FLIP_HORIZONTAL,
NC_("drawable-action", "Flip _Horizontally"), NULL,
NC_("drawable-action", "Flip _Horizontally"), NULL, { NULL },
NC_("drawable-action", "Flip drawable horizontally"),
GIMP_ORIENTATION_HORIZONTAL, FALSE,
GIMP_HELP_LAYER_FLIP_HORIZONTAL },
{ "drawable-flip-vertical", GIMP_ICON_OBJECT_FLIP_VERTICAL,
NC_("drawable-action", "Flip _Vertically"), NULL,
NC_("drawable-action", "Flip _Vertically"), NULL, { NULL },
NC_("drawable-action", "Flip drawable vertically"),
GIMP_ORIENTATION_VERTICAL, FALSE,
GIMP_HELP_LAYER_FLIP_VERTICAL }
@@ -97,21 +97,21 @@ static const GimpEnumActionEntry drawable_flip_actions[] =
static const GimpEnumActionEntry drawable_rotate_actions[] =
{
{ "drawable-rotate-90", GIMP_ICON_OBJECT_ROTATE_90,
NC_("drawable-action", "Rotate 90° _clockwise"), NULL,
NC_("drawable-action", "Rotate 90° _clockwise"), NULL, { NULL },
NC_("drawable-action", "Rotate drawable 90 degrees to the right"),
GIMP_ROTATE_90, FALSE,
GIMP_ROTATE_DEGREES90, FALSE,
GIMP_HELP_LAYER_ROTATE_90 },
{ "drawable-rotate-180", GIMP_ICON_OBJECT_ROTATE_180,
NC_("drawable-action", "Rotate _180°"), NULL,
NC_("drawable-action", "Rotate _180°"), NULL, { NULL },
NC_("drawable-action", "Turn drawable upside-down"),
GIMP_ROTATE_180, FALSE,
GIMP_ROTATE_DEGREES180, FALSE,
GIMP_HELP_LAYER_ROTATE_180 },
{ "drawable-rotate-270", GIMP_ICON_OBJECT_ROTATE_270,
NC_("drawable-action", "Rotate 90° counter-clock_wise"), NULL,
NC_("drawable-action", "Rotate 90° counter-clock_wise"), NULL, { NULL },
NC_("drawable-action", "Rotate drawable 90 degrees to the left"),
GIMP_ROTATE_270, FALSE,
GIMP_ROTATE_DEGREES270, FALSE,
GIMP_HELP_LAYER_ROTATE_270 }
};
@@ -151,56 +151,67 @@ void
drawable_actions_update (GimpActionGroup *group,
gpointer data)
{
GimpImage *image;
GimpDrawable *drawable = NULL;
GList *drawables = NULL;
gboolean has_visible = FALSE;
gboolean is_rgb = FALSE;
gboolean locked = FALSE;
gboolean can_lock = FALSE;
gboolean locked_pos = FALSE;
gboolean can_lock_pos = FALSE;
gboolean writable = FALSE;
gboolean movable = FALSE;
gboolean children = FALSE;
GList *iter;
GimpImage *image;
GList *drawables = NULL;
GList *iter;
gboolean has_visible = FALSE;
gboolean locked = TRUE;
gboolean can_lock = FALSE;
gboolean locked_pos = TRUE;
gboolean can_lock_pos = FALSE;
gboolean all_rgb = TRUE;
gboolean all_writable = TRUE;
gboolean all_movable = TRUE;
gboolean none_children = TRUE;
image = action_data_get_image (data);
if (image)
{
drawable = gimp_image_get_active_drawable (image);
drawables = gimp_image_get_selected_drawables (image);
for (iter = drawables; iter; iter = iter->next)
{
GimpItem *item;
if (gimp_item_get_visible (iter->data))
has_visible = TRUE;
if (has_visible)
break;
}
if (gimp_item_can_lock_content (iter->data))
{
if (! gimp_item_get_lock_content (iter->data))
locked = FALSE;
can_lock = TRUE;
}
if (drawable)
{
GimpItem *item;
if (gimp_item_can_lock_position (iter->data))
{
if (! gimp_item_get_lock_position (iter->data))
locked_pos = FALSE;
can_lock_pos = TRUE;
}
is_rgb = gimp_drawable_is_rgb (drawable);
if (gimp_viewable_get_children (GIMP_VIEWABLE (iter->data)))
none_children = FALSE;
if (GIMP_IS_LAYER_MASK (drawable))
item = GIMP_ITEM (gimp_layer_mask_get_layer (GIMP_LAYER_MASK (drawable)));
if (! gimp_drawable_is_rgb (iter->data))
all_rgb = FALSE;
if (GIMP_IS_LAYER_MASK (iter->data))
item = GIMP_ITEM (gimp_layer_mask_get_layer (GIMP_LAYER_MASK (iter->data)));
else
item = GIMP_ITEM (drawable);
item = GIMP_ITEM (iter->data);
locked = gimp_item_get_lock_content (item);
can_lock = gimp_item_can_lock_content (item);
writable = ! gimp_item_is_content_locked (item, NULL);
locked_pos = gimp_item_get_lock_position (item);
can_lock_pos = gimp_item_can_lock_position (item);
movable = ! gimp_item_is_position_locked (item, NULL);
if (gimp_item_is_content_locked (item, NULL))
all_writable = FALSE;
if (gimp_viewable_get_children (GIMP_VIEWABLE (drawable)))
children = TRUE;
if (gimp_item_is_position_locked (item, NULL))
all_movable = FALSE;
if (has_visible && ! locked && ! locked_pos &&
! none_children && ! all_rgb &&
! all_writable && ! all_movable)
break;
}
}
@@ -209,8 +220,8 @@ drawable_actions_update (GimpActionGroup *group,
#define SET_ACTIVE(action,condition) \
gimp_action_group_set_action_active (group, action, (condition) != 0)
SET_SENSITIVE ("drawable-equalize", writable && !children);
SET_SENSITIVE ("drawable-levels-stretch", writable && !children && is_rgb);
SET_SENSITIVE ("drawable-equalize", drawables && all_writable && none_children);
SET_SENSITIVE ("drawable-levels-stretch", drawables && all_writable && none_children && all_rgb);
SET_SENSITIVE ("drawable-visible", drawables);
SET_SENSITIVE ("drawable-lock-content", can_lock);
@@ -220,12 +231,12 @@ drawable_actions_update (GimpActionGroup *group,
SET_ACTIVE ("drawable-lock-content", locked);
SET_ACTIVE ("drawable-lock-position", locked_pos);
SET_SENSITIVE ("drawable-flip-horizontal", writable && movable);
SET_SENSITIVE ("drawable-flip-vertical", writable && movable);
SET_SENSITIVE ("drawable-flip-horizontal", drawables && all_writable && all_movable);
SET_SENSITIVE ("drawable-flip-vertical", drawables && all_writable && all_movable);
SET_SENSITIVE ("drawable-rotate-90", writable && movable);
SET_SENSITIVE ("drawable-rotate-180", writable && movable);
SET_SENSITIVE ("drawable-rotate-270", writable && movable);
SET_SENSITIVE ("drawable-rotate-90", drawables && all_writable && all_movable);
SET_SENSITIVE ("drawable-rotate-180", drawables && all_writable && all_movable);
SET_SENSITIVE ("drawable-rotate-270", drawables && all_writable && all_movable);
#undef SET_SENSITIVE
#undef SET_ACTIVE

View File

@@ -49,12 +49,25 @@ drawable_equalize_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data)
{
GimpImage *image;
GimpDrawable *drawable;
return_if_no_drawable (image, drawable, data);
GimpImage *image;
GList *drawables;
GList *iter;
return_if_no_drawables (image, drawables, data);
if (g_list_length (drawables) > 1)
gimp_image_undo_group_start (image,
GIMP_UNDO_GROUP_DRAWABLE_MOD,
_("Equalize"));
for (iter = drawables; iter; iter = iter->next)
gimp_drawable_equalize (iter->data, TRUE);
if (g_list_length (drawables) > 1)
gimp_image_undo_group_end (image);
gimp_drawable_equalize (drawable, TRUE);
gimp_image_flush (image);
g_list_free (drawables);
}
void
@@ -63,24 +76,40 @@ drawable_levels_stretch_cmd_callback (GimpAction *action,
gpointer data)
{
GimpImage *image;
GimpDrawable *drawable;
GList *drawables;
GList *iter;
GimpDisplay *display;
GtkWidget *widget;
return_if_no_drawable (image, drawable, data);
return_if_no_drawables (image, drawables, data);
return_if_no_display (display, data);
return_if_no_widget (widget, data);
if (! gimp_drawable_is_rgb (drawable))
for (iter = drawables; iter; iter = iter->next)
{
gimp_message_literal (image->gimp,
G_OBJECT (widget), GIMP_MESSAGE_WARNING,
_("White Balance operates only on RGB color "
"layers."));
return;
if (! gimp_drawable_is_rgb (iter->data))
{
gimp_message_literal (image->gimp,
G_OBJECT (widget), GIMP_MESSAGE_WARNING,
_("White Balance operates only on RGB color "
"layers."));
return;
}
}
gimp_drawable_levels_stretch (drawable, GIMP_PROGRESS (display));
if (g_list_length (drawables) > 1)
gimp_image_undo_group_start (image,
GIMP_UNDO_GROUP_DRAWABLE_MOD,
_("Levels"));
for (iter = drawables; iter; iter = iter->next)
gimp_drawable_levels_stretch (iter->data, GIMP_PROGRESS (display));
if (g_list_length (drawables) > 1)
gimp_image_undo_group_end (image);
gimp_image_flush (image);
g_list_free (drawables);
}
void
@@ -154,6 +183,7 @@ drawable_visible_cmd_callback (GimpAction *action,
gimp_image_undo_group_end (image);
gimp_image_flush (image);
g_list_free (drawables);
}
void
@@ -161,35 +191,67 @@ drawable_lock_content_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data)
{
GimpImage *image;
GimpDrawable *drawable;
gboolean locked;
return_if_no_drawable (image, drawable, data);
GimpImage *image;
GList *drawables;
GList *iter;
gboolean locked;
gboolean push_undo = TRUE;
return_if_no_drawables (image, drawables, data);
locked = g_variant_get_boolean (value);
if (GIMP_IS_LAYER_MASK (drawable))
drawable =
GIMP_DRAWABLE (gimp_layer_mask_get_layer (GIMP_LAYER_MASK (drawable)));
if (locked != gimp_item_get_lock_content (GIMP_ITEM (drawable)))
if (GIMP_IS_LAYER_MASK (drawables->data))
{
#if 0
GimpUndo *undo;
#endif
gboolean push_undo = TRUE;
GimpLayerMask *mask = GIMP_LAYER_MASK (drawables->data);
#if 0
undo = gimp_image_undo_can_compress (image, GIMP_TYPE_ITEM_UNDO,
GIMP_UNDO_ITEM_VISIBILITY);
if (undo && GIMP_ITEM_UNDO (undo)->item == GIMP_ITEM (drawable))
push_undo = FALSE;
#endif
gimp_item_set_lock_content (GIMP_ITEM (drawable), locked, push_undo);
gimp_image_flush (image);
g_list_free (drawables);
drawables = g_list_prepend (NULL, gimp_layer_mask_get_layer (mask));
}
for (iter = drawables; iter; iter = iter->next)
{
if (! locked && ! gimp_item_get_lock_content (iter->data))
{
/* If any of the drawables are already unlocked, we don't toggle the
* lock. This prevents the SET_ACTIVE() in drawables-actions.c to
* toggle locks unexpectedly.
*/
g_list_free (drawables);
return;
}
}
for (iter = drawables; iter; iter = iter->next)
if (locked != gimp_item_get_lock_content (iter->data))
break;
if (g_list_length (drawables) == 1)
{
GimpUndo *undo;
undo = gimp_image_undo_can_compress (image, GIMP_TYPE_ITEM_UNDO,
GIMP_UNDO_ITEM_LOCK_CONTENT);
if (undo && GIMP_ITEM_UNDO (undo)->item == GIMP_ITEM (drawables->data))
push_undo = FALSE;
}
else
{
/* TODO: undo groups cannot be compressed so far. */
gimp_image_undo_group_start (image,
GIMP_UNDO_GROUP_ITEM_LOCK_CONTENTS,
_("Lock/Unlock content"));
}
for (; iter; iter = iter->next)
gimp_item_set_lock_content (iter->data, locked, push_undo);
if (g_list_length (drawables) != 1)
gimp_image_undo_group_end (image);
gimp_image_flush (image);
g_list_free (drawables);
}
void
@@ -197,31 +259,67 @@ drawable_lock_position_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data)
{
GimpImage *image;
GimpDrawable *drawable;
gboolean locked;
return_if_no_drawable (image, drawable, data);
GimpImage *image;
GList *drawables;
GList *iter;
gboolean locked;
gboolean push_undo = TRUE;
return_if_no_drawables (image, drawables, data);
locked = g_variant_get_boolean (value);
if (GIMP_IS_LAYER_MASK (drawable))
drawable =
GIMP_DRAWABLE (gimp_layer_mask_get_layer (GIMP_LAYER_MASK (drawable)));
if (GIMP_IS_LAYER_MASK (drawables->data))
{
GimpLayerMask *mask = GIMP_LAYER_MASK (drawables->data);
if (locked != gimp_item_get_lock_position (GIMP_ITEM (drawable)))
g_list_free (drawables);
drawables = g_list_prepend (NULL, gimp_layer_mask_get_layer (mask));
}
for (iter = drawables; iter; iter = iter->next)
{
if (! locked && ! gimp_item_get_lock_position (iter->data))
{
/* If any of the drawables are already unlocked, we don't toggle the
* lock. This prevents the SET_ACTIVE() in drawables-actions.c to
* toggle locks unexpectedly.
*/
g_list_free (drawables);
return;
}
}
for (iter = drawables; iter; iter = iter->next)
if (locked != gimp_item_get_lock_position (iter->data))
break;
if (g_list_length (drawables) == 1)
{
GimpUndo *undo;
gboolean push_undo = TRUE;
undo = gimp_image_undo_can_compress (image, GIMP_TYPE_ITEM_UNDO,
GIMP_UNDO_ITEM_LOCK_POSITION);
if (undo && GIMP_ITEM_UNDO (undo)->item == GIMP_ITEM (drawable))
if (undo && GIMP_ITEM_UNDO (undo)->item == GIMP_ITEM (drawables->data))
push_undo = FALSE;
gimp_item_set_lock_position (GIMP_ITEM (drawable), locked, push_undo);
gimp_image_flush (image);
}
else
{
/* TODO: undo groups cannot be compressed so far. */
gimp_image_undo_group_start (image,
GIMP_UNDO_GROUP_ITEM_LOCK_POSITION,
_("Lock/Unlock position"));
}
for (; iter; iter = iter->next)
gimp_item_set_lock_position (iter->data, locked, push_undo);
if (g_list_length (drawables) != 1)
gimp_image_undo_group_end (image);
gimp_image_flush (image);
g_list_free (drawables);
}
void
@@ -230,39 +328,54 @@ drawable_flip_cmd_callback (GimpAction *action,
gpointer data)
{
GimpImage *image;
GimpDrawable *drawable;
GimpItem *item;
GList *drawables;
GList *iter;
GimpContext *context;
gint off_x, off_y;
gdouble axis = 0.0;
GimpOrientationType orientation;
return_if_no_drawable (image, drawable, data);
return_if_no_drawables (image, drawables, data);
return_if_no_context (context, data);
orientation = (GimpOrientationType) g_variant_get_int32 (value);
item = GIMP_ITEM (drawable);
if (g_list_length (drawables) > 1)
gimp_image_undo_group_start (image,
GIMP_UNDO_GROUP_DRAWABLE_MOD,
_("Flip Drawables"));
gimp_item_get_offset (item, &off_x, &off_y);
switch (orientation)
for (iter = drawables; iter; iter = iter->next)
{
case GIMP_ORIENTATION_HORIZONTAL:
axis = ((gdouble) off_x + (gdouble) gimp_item_get_width (item) / 2.0);
break;
GimpItem *item;
case GIMP_ORIENTATION_VERTICAL:
axis = ((gdouble) off_y + (gdouble) gimp_item_get_height (item) / 2.0);
break;
item = GIMP_ITEM (iter->data);
default:
break;
gimp_item_get_offset (item, &off_x, &off_y);
switch (orientation)
{
case GIMP_ORIENTATION_HORIZONTAL:
axis = ((gdouble) off_x + (gdouble) gimp_item_get_width (item) / 2.0);
break;
case GIMP_ORIENTATION_VERTICAL:
axis = ((gdouble) off_y + (gdouble) gimp_item_get_height (item) / 2.0);
break;
default:
break;
}
gimp_item_flip (item, context, orientation, axis,
gimp_item_get_clip (item, FALSE));
}
gimp_item_flip (item, context, orientation, axis,
gimp_item_get_clip (item, FALSE));
if (g_list_length (drawables) > 1)
gimp_image_undo_group_end (image);
gimp_image_flush (image);
g_list_free (drawables);
}
void
@@ -271,27 +384,42 @@ drawable_rotate_cmd_callback (GimpAction *action,
gpointer data)
{
GimpImage *image;
GimpDrawable *drawable;
GList *drawables;
GList *iter;
GimpContext *context;
GimpItem *item;
gint off_x, off_y;
gdouble center_x, center_y;
GimpRotationType rotation_type;
return_if_no_drawable (image, drawable, data);
return_if_no_drawables (image, drawables, data);
return_if_no_context (context, data);
rotation_type = (GimpRotationType) g_variant_get_int32 (value);
item = GIMP_ITEM (drawable);
if (g_list_length (drawables) > 1)
gimp_image_undo_group_start (image,
GIMP_UNDO_GROUP_DRAWABLE_MOD,
_("Rotate Drawables"));
gimp_item_get_offset (item, &off_x, &off_y);
for (iter = drawables; iter; iter = iter->next)
{
GimpItem *item;
gint off_x, off_y;
gdouble center_x, center_y;
center_x = ((gdouble) off_x + (gdouble) gimp_item_get_width (item) / 2.0);
center_y = ((gdouble) off_y + (gdouble) gimp_item_get_height (item) / 2.0);
item = GIMP_ITEM (iter->data);
gimp_item_rotate (item, context,
rotation_type, center_x, center_y,
gimp_item_get_clip (item, FALSE));
gimp_item_get_offset (item, &off_x, &off_y);
center_x = ((gdouble) off_x + (gdouble) gimp_item_get_width (item) / 2.0);
center_y = ((gdouble) off_y + (gdouble) gimp_item_get_height (item) / 2.0);
gimp_item_rotate (item, context,
rotation_type, center_x, center_y,
gimp_item_get_clip (item, FALSE));
}
if (g_list_length (drawables) > 1)
gimp_image_undo_group_end (image);
gimp_image_flush (image);
g_list_free (drawables);
}

View File

@@ -39,42 +39,38 @@
static const GimpActionEntry dynamics_actions[] =
{
{ "dynamics-popup", GIMP_ICON_DYNAMICS,
NC_("dynamics-action", "Paint Dynamics Menu"), NULL, NULL, NULL,
GIMP_HELP_DYNAMICS_DIALOG },
{ "dynamics-new", GIMP_ICON_DOCUMENT_NEW,
NC_("dynamics-action", "_New Dynamics"), NULL,
NC_("dynamics-action", "_New Dynamics"), NULL, { NULL },
NC_("dynamics-action", "Create a new dynamics"),
data_new_cmd_callback,
GIMP_HELP_DYNAMICS_NEW },
{ "dynamics-duplicate", GIMP_ICON_OBJECT_DUPLICATE,
NC_("dynamics-action", "D_uplicate Dynamics"), NULL,
NC_("dynamics-action", "D_uplicate Dynamics"), NULL, { NULL },
NC_("dynamics-action", "Duplicate this dynamics"),
data_duplicate_cmd_callback,
GIMP_HELP_DYNAMICS_DUPLICATE },
{ "dynamics-copy-location", GIMP_ICON_EDIT_COPY,
NC_("dynamics-action", "Copy Dynamics _Location"), NULL,
NC_("dynamics-action", "Copy Dynamics _Location"), NULL, { NULL },
NC_("dynamics-action", "Copy dynamics file location to clipboard"),
data_copy_location_cmd_callback,
GIMP_HELP_DYNAMICS_COPY_LOCATION },
{ "dynamics-show-in-file-manager", GIMP_ICON_FILE_MANAGER,
NC_("dynamics-action", "Show in _File Manager"), NULL,
NC_("dynamics-action", "Show in _File Manager"), NULL, { NULL },
NC_("dynamics-action", "Show dynamics file location in the file manager"),
data_show_in_file_manager_cmd_callback,
GIMP_HELP_DYNAMICS_SHOW_IN_FILE_MANAGER },
{ "dynamics-delete", GIMP_ICON_EDIT_DELETE,
NC_("dynamics-action", "_Delete Dynamics"), NULL,
NC_("dynamics-action", "_Delete Dynamics"), NULL, { NULL },
NC_("dynamics-action", "Delete this dynamics"),
data_delete_cmd_callback,
GIMP_HELP_DYNAMICS_DELETE },
{ "dynamics-refresh", GIMP_ICON_VIEW_REFRESH,
NC_("dynamics-action", "_Refresh Dynamics"), NULL,
NC_("dynamics-action", "_Refresh Dynamics"), NULL, { NULL },
NC_("dynamics-action", "Refresh dynamics"),
data_refresh_cmd_callback,
GIMP_HELP_DYNAMICS_REFRESH }
@@ -83,7 +79,7 @@ static const GimpActionEntry dynamics_actions[] =
static const GimpStringActionEntry dynamics_edit_actions[] =
{
{ "dynamics-edit", GIMP_ICON_EDIT,
NC_("dynamics-action", "_Edit Dynamics..."), NULL,
NC_("dynamics-action", "_Edit Dynamics..."), NULL, { NULL },
NC_("dynamics-action", "Edit this dynamics"),
"gimp-dynamics-editor",
GIMP_HELP_DYNAMICS_EDIT }

View File

@@ -37,18 +37,10 @@
#include "gimp-intl.h"
static const GimpActionEntry dynamics_editor_actions[] =
{
{ "dynamics-editor-popup", GIMP_ICON_DYNAMICS,
NC_("dynamics-editor-action", "Paint Dynamics Editor Menu"), NULL, NULL, NULL,
GIMP_HELP_BRUSH_EDITOR_DIALOG }
};
static const GimpToggleActionEntry dynamics_editor_toggle_actions[] =
{
{ "dynamics-editor-edit-active", GIMP_ICON_LINKED,
NC_("dynamics-editor-action", "Edit Active Dynamics"), NULL, NULL,
NC_("dynamics-editor-action", "Edit Active Dynamics"), NULL, { NULL }, NULL,
data_editor_edit_active_cmd_callback,
FALSE,
GIMP_HELP_BRUSH_EDITOR_EDIT_ACTIVE }
@@ -58,10 +50,6 @@ static const GimpToggleActionEntry dynamics_editor_toggle_actions[] =
void
dynamics_editor_actions_setup (GimpActionGroup *group)
{
gimp_action_group_add_actions (group, "dynamics-editor-action",
dynamics_editor_actions,
G_N_ELEMENTS (dynamics_editor_actions));
gimp_action_group_add_toggle_actions (group, "dynamics-editor-action",
dynamics_editor_toggle_actions,
G_N_ELEMENTS (dynamics_editor_toggle_actions));

View File

@@ -50,10 +50,10 @@
/* local function prototypes */
static void edit_actions_foreground_changed (GimpContext *context,
const GimpRGB *color,
GeglColor *color,
GimpActionGroup *group);
static void edit_actions_background_changed (GimpContext *context,
const GimpRGB *color,
GeglColor *color,
GimpActionGroup *group);
static void edit_actions_pattern_changed (GimpContext *context,
GimpPattern *pattern,
@@ -62,102 +62,90 @@ static void edit_actions_pattern_changed (GimpContext *context,
static const GimpActionEntry edit_actions[] =
{
{ "edit-menu", NULL, NC_("edit-action", "_Edit") },
{ "edit-paste-as-menu", NULL, NC_("edit-action", "Paste _as") },
{ "edit-buffer-menu", NULL, NC_("edit-action", "_Buffer") },
{ "undo-popup",
"edit-undo", NC_("edit-action", "Undo History Menu"), NULL, NULL, NULL,
GIMP_HELP_UNDO_DIALOG },
{ "edit-undo", GIMP_ICON_EDIT_UNDO,
NC_("edit-action", "_Undo"), "<primary>Z",
NC_("edit-action", "_Undo"), NULL, { "<primary>Z", NULL },
NC_("edit-action", "Undo the last operation"),
edit_undo_cmd_callback,
GIMP_HELP_EDIT_UNDO },
{ "edit-redo", GIMP_ICON_EDIT_REDO,
NC_("edit-action", "_Redo"), "<primary>Y",
NC_("edit-action", "_Redo"), NULL, { "<primary>Y", NULL },
NC_("edit-action", "Redo the last operation that was undone"),
edit_redo_cmd_callback,
GIMP_HELP_EDIT_REDO },
{ "edit-strong-undo", GIMP_ICON_EDIT_UNDO,
NC_("edit-action", "Strong Undo"), "<primary><shift>Z",
NC_("edit-action", "Strong Undo"), NULL, { "<primary><shift>Z", NULL },
NC_("edit-action", "Undo the last operation, skipping visibility changes"),
edit_strong_undo_cmd_callback,
GIMP_HELP_EDIT_STRONG_UNDO },
{ "edit-strong-redo", GIMP_ICON_EDIT_REDO,
NC_("edit-action", "Strong Redo"), "<primary><shift>Y",
NC_("edit-action", "Strong Redo"), NULL, { "<primary><shift>Y", NULL },
NC_("edit-action",
"Redo the last operation that was undone, skipping visibility changes"),
edit_strong_redo_cmd_callback,
GIMP_HELP_EDIT_STRONG_REDO },
{ "edit-undo-clear", GIMP_ICON_SHRED,
NC_("edit-action", "_Clear Undo History"), NULL,
NC_("edit-action", "_Clear Undo History"), NULL, { NULL },
NC_("edit-action", "Remove all operations from the undo history"),
edit_undo_clear_cmd_callback,
GIMP_HELP_EDIT_UNDO_CLEAR },
{ "edit-cut", GIMP_ICON_EDIT_CUT,
NC_("edit-action", "Cu_t"), "<primary>X",
NC_("edit-action", "Cu_t"), NULL, { "<primary>X", "Cut", NULL },
NC_("edit-action", "Move the selected pixels to the clipboard"),
edit_cut_cmd_callback,
GIMP_HELP_EDIT_CUT },
{ "edit-copy", GIMP_ICON_EDIT_COPY,
NC_("edit-action", "_Copy"), "<primary>C",
NC_("edit-action", "_Copy"), NULL, { "<primary>C", "Copy", NULL },
NC_("edit-action", "Copy the selected pixels to the clipboard"),
edit_copy_cmd_callback,
GIMP_HELP_EDIT_COPY },
{ "edit-copy-visible", NULL, /* GIMP_ICON_COPY_VISIBLE, */
NC_("edit-action", "Copy _Visible"), "<primary><shift>C",
NC_("edit-action", "Copy _Visible"), NULL, { "<primary><shift>C", "<shift>Copy", NULL },
NC_("edit-action", "Copy what is visible in the selected region"),
edit_copy_visible_cmd_callback,
GIMP_HELP_EDIT_COPY_VISIBLE },
{ "edit-paste-as-new-image", GIMP_ICON_EDIT_PASTE_AS_NEW,
NC_("edit-action", "From _Clipboard"), "<primary><shift>V",
NC_("edit-action", "Create a new image from the content of the clipboard"),
edit_paste_as_new_image_cmd_callback,
GIMP_HELP_EDIT_PASTE_AS_NEW_IMAGE },
{ "edit-paste-as-new-image-short", GIMP_ICON_EDIT_PASTE_AS_NEW,
NC_("edit-action", "_New Image"), NULL,
NC_("edit-action", "Paste as _New Image"),
NC_("edit-action", "From _Clipboard"),
{ "<primary><shift>V", "<shift>Paste", NULL },
NC_("edit-action", "Create a new image from the content of the clipboard"),
edit_paste_as_new_image_cmd_callback,
GIMP_HELP_EDIT_PASTE_AS_NEW_IMAGE },
{ "edit-named-cut", GIMP_ICON_EDIT_CUT,
NC_("edit-action", "Cu_t Named..."), NULL,
NC_("edit-action", "Cu_t Named..."), NULL, { NULL },
NC_("edit-action", "Move the selected pixels to a named buffer"),
edit_named_cut_cmd_callback,
GIMP_HELP_BUFFER_CUT },
{ "edit-named-copy", GIMP_ICON_EDIT_COPY,
NC_("edit-action", "_Copy Named..."), NULL,
NC_("edit-action", "_Copy Named..."), NULL, { NULL },
NC_("edit-action", "Copy the selected pixels to a named buffer"),
edit_named_copy_cmd_callback,
GIMP_HELP_BUFFER_COPY },
{ "edit-named-copy-visible", NULL, /* GIMP_ICON_COPY_VISIBLE, */
NC_("edit-action", "Copy _Visible Named..."), "",
NC_("edit-action", "Copy _Visible Named..."), NULL, { NULL },
NC_("edit-action",
"Copy what is visible in the selected region to a named buffer"),
edit_named_copy_visible_cmd_callback,
GIMP_HELP_BUFFER_COPY },
{ "edit-named-paste", GIMP_ICON_EDIT_PASTE,
NC_("edit-action", "_Paste Named..."), NULL,
NC_("edit-action", "_Paste Named..."), NULL, { NULL },
NC_("edit-action", "Paste the content of a named buffer"),
edit_named_paste_cmd_callback,
GIMP_HELP_BUFFER_PASTE },
{ "edit-clear", GIMP_ICON_EDIT_CLEAR,
NC_("edit-action", "Cl_ear"), "Delete",
NC_("edit-action", "Cl_ear"), NULL, { "Delete", NULL },
NC_("edit-action", "Clear the selected pixels"),
edit_clear_cmd_callback,
GIMP_HELP_EDIT_CLEAR }
@@ -166,64 +154,75 @@ static const GimpActionEntry edit_actions[] =
static const GimpEnumActionEntry edit_paste_actions[] =
{
{ "edit-paste", GIMP_ICON_EDIT_PASTE,
NC_("edit-action", "_Paste"), "<primary>V",
NC_("edit-action", "_Paste"), NULL, { "<primary>V", "Paste", NULL },
NC_("edit-action", "Paste the content of the clipboard"),
GIMP_PASTE_TYPE_FLOATING, FALSE,
GIMP_PASTE_TYPE_NEW_LAYER_OR_FLOATING, FALSE,
GIMP_HELP_EDIT_PASTE },
{ "edit-paste-in-place", GIMP_ICON_EDIT_PASTE,
NC_("edit-action", "Paste In P_lace"), "<primary><alt>V",
NC_("edit-action", "Paste In P_lace"), NULL, { "<primary><alt>V", "<alt>Paste", NULL },
NC_("edit-action",
"Paste the content of the clipboard at its original position"),
GIMP_PASTE_TYPE_FLOATING_IN_PLACE, FALSE,
GIMP_PASTE_TYPE_NEW_LAYER_OR_FLOATING_IN_PLACE, FALSE,
GIMP_HELP_EDIT_PASTE_IN_PLACE },
{ "edit-paste-merged", GIMP_ICON_EDIT_PASTE,
NC_("edit-action", "_Paste as Single Layer"), NULL, { NULL },
NC_("edit-action", "Paste the content of the clipboard as a single layer"),
GIMP_PASTE_TYPE_NEW_MERGED_LAYER_OR_FLOATING, FALSE,
GIMP_HELP_EDIT_PASTE },
{ "edit-paste-merged-in-place", GIMP_ICON_EDIT_PASTE,
NC_("edit-action", "Paste as Single Layer In P_lace"), NULL, { NULL },
NC_("edit-action",
"Paste the content of the clipboard at its original position as a single layer"),
GIMP_PASTE_TYPE_NEW_MERGED_LAYER_OR_FLOATING_IN_PLACE, FALSE,
GIMP_HELP_EDIT_PASTE_IN_PLACE },
{ "edit-paste-into", GIMP_ICON_EDIT_PASTE_INTO,
NC_("edit-action", "Paste _Into Selection"), NULL,
NC_("edit-action", "Paste as Floating Data _Into Selection"), NULL, { NULL },
NC_("edit-action",
"Paste the content of the clipboard into the current selection"),
GIMP_PASTE_TYPE_FLOATING_INTO, FALSE,
GIMP_HELP_EDIT_PASTE_INTO },
{ "edit-paste-into-in-place", GIMP_ICON_EDIT_PASTE_INTO,
NC_("edit-action", "Paste Int_o Selection In Place"), NULL,
NC_("edit-action", "Paste as Floating Data Int_o Selection In Place"), NULL, { NULL },
NC_("edit-action",
"Paste the content of the clipboard into the current selection "
"at its original position"),
GIMP_PASTE_TYPE_FLOATING_INTO_IN_PLACE, FALSE,
GIMP_HELP_EDIT_PASTE_INTO_IN_PLACE },
{ "edit-paste-as-new-layer", GIMP_ICON_EDIT_PASTE_AS_NEW,
NC_("edit-action", "New _Layer"), NULL,
NC_("edit-action", "Create a new layer from the content of the clipboard"),
GIMP_PASTE_TYPE_NEW_LAYER, FALSE,
GIMP_HELP_EDIT_PASTE_AS_NEW_LAYER },
{ "edit-paste-float", GIMP_ICON_EDIT_PASTE,
NC_("edit-action", "Paste as _Floating Data"), NULL, { NULL },
NC_("edit-action", "Paste the content of the clipboard as Floating Data"),
GIMP_PASTE_TYPE_FLOATING, FALSE,
GIMP_HELP_EDIT_PASTE },
{ "edit-paste-as-new-layer-in-place", GIMP_ICON_EDIT_PASTE_AS_NEW,
NC_("edit-action", "New Layer In _Place"), NULL,
NC_("edit-action",
"Create a new layer from the content of the clipboard "
"and place it at its original position"),
GIMP_PASTE_TYPE_NEW_LAYER_IN_PLACE, FALSE,
GIMP_HELP_EDIT_PASTE_AS_NEW_LAYER_IN_PLACE }
{ "edit-paste-float-in-place", GIMP_ICON_EDIT_PASTE,
NC_("edit-action", "Paste as Floa_ting Data In Place"), NULL, { NULL },
NC_("edit-action", "Paste the content of the clipboard as Floating Data at its original position"),
GIMP_PASTE_TYPE_FLOATING_IN_PLACE, FALSE,
GIMP_HELP_EDIT_PASTE }
};
static const GimpEnumActionEntry edit_fill_actions[] =
{
{ "edit-fill-fg", GIMP_ICON_TOOL_BUCKET_FILL,
NC_("edit-action", "Fill with _FG Color"), "<primary>comma",
NC_("edit-action", "Fill with _FG Color"), NULL, { "<primary>comma", NULL },
NC_("edit-action", "Fill the selection using the foreground color"),
GIMP_FILL_FOREGROUND, FALSE,
GIMP_HELP_EDIT_FILL_FG },
{ "edit-fill-bg", GIMP_ICON_TOOL_BUCKET_FILL,
NC_("edit-action", "Fill with B_G Color"), "<primary>period",
NC_("edit-action", "Fill with B_G Color"), NULL, { "<primary>period", NULL },
NC_("edit-action", "Fill the selection using the background color"),
GIMP_FILL_BACKGROUND, FALSE,
GIMP_HELP_EDIT_FILL_BG },
{ "edit-fill-pattern", GIMP_ICON_PATTERN,
NC_("edit-action", "Fill _with Pattern"), "<primary>semicolon",
NC_("edit-action", "Fill _with Pattern"), NULL, { "<primary>semicolon", NULL },
NC_("edit-action", "Fill the selection using the active pattern"),
GIMP_FILL_PATTERN, FALSE,
GIMP_HELP_EDIT_FILL_PATTERN }
@@ -234,9 +233,8 @@ void
edit_actions_setup (GimpActionGroup *group)
{
GimpContext *context = gimp_get_user_context (group->gimp);
GimpRGB color;
GeglColor *color;
GimpPattern *pattern;
GimpAction *action;
gimp_action_group_add_actions (group, "edit-action",
edit_actions,
@@ -252,15 +250,6 @@ edit_actions_setup (GimpActionGroup *group)
G_N_ELEMENTS (edit_fill_actions),
edit_fill_cmd_callback);
action = gimp_action_group_get_action (group,
"edit-paste-as-new-image-short");
gimp_action_set_accel_path (action,
"<Actions>/edit/edit-paste-as-new-image");
gimp_action_group_set_action_context (group, "edit-fill-fg", context);
gimp_action_group_set_action_context (group, "edit-fill-bg", context);
gimp_action_group_set_action_context (group, "edit-fill-pattern", context);
g_signal_connect_object (context, "foreground-changed",
G_CALLBACK (edit_actions_foreground_changed),
group, 0);
@@ -271,11 +260,11 @@ edit_actions_setup (GimpActionGroup *group)
G_CALLBACK (edit_actions_pattern_changed),
group, 0);
gimp_context_get_foreground (context, &color);
edit_actions_foreground_changed (context, &color, group);
color = gimp_context_get_foreground (context);
edit_actions_foreground_changed (context, color, group);
gimp_context_get_background (context, &color);
edit_actions_background_changed (context, &color, group);
color = gimp_context_get_background (context);
edit_actions_background_changed (context, color, group);
pattern = gimp_context_get_pattern (context);
edit_actions_pattern_changed (context, pattern, group);
@@ -369,8 +358,6 @@ edit_actions_update (GimpActionGroup *group,
SET_SENSITIVE ("edit-paste-in-place", image);
SET_SENSITIVE ("edit-paste-into", image);
SET_SENSITIVE ("edit-paste-into-in-place", image);
SET_SENSITIVE ("edit-paste-as-new-layer", image);
SET_SENSITIVE ("edit-paste-as-new-layer-in-place", image);
SET_SENSITIVE ("edit-named-cut", have_writable && have_no_groups);
SET_SENSITIVE ("edit-named-copy", drawables);
@@ -393,7 +380,7 @@ edit_actions_update (GimpActionGroup *group,
static void
edit_actions_foreground_changed (GimpContext *context,
const GimpRGB *color,
GeglColor *color,
GimpActionGroup *group)
{
gimp_action_group_set_action_color (group, "edit-fill-fg", color, FALSE);
@@ -401,7 +388,7 @@ edit_actions_foreground_changed (GimpContext *context,
static void
edit_actions_background_changed (GimpContext *context,
const GimpRGB *color,
GeglColor *color,
GimpActionGroup *group)
{
gimp_action_group_set_action_color (group, "edit-fill-bg", color, FALSE);

View File

@@ -36,6 +36,7 @@
#include "core/gimpfilloptions.h"
#include "core/gimplayer.h"
#include "core/gimplayer-new.h"
#include "core/gimplayermask.h"
#include "core/gimpimage.h"
#include "core/gimpimage-undo.h"
@@ -68,6 +69,7 @@ static gboolean check_drawable_alpha (GimpDrawable *drawable,
gpointer data);
static void edit_paste (GimpDisplay *display,
GimpPasteType paste_type,
gboolean merged,
gboolean try_svg);
static void cut_named_buffer_callback (GtkWidget *widget,
const gchar *name,
@@ -340,10 +342,14 @@ edit_paste_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data)
{
GimpImage *image;
GimpDisplay *display = action_data_get_display (data);
GimpPasteType paste_type = (GimpPasteType) g_variant_get_int32 (value);
GimpPasteType converted_type;
GList *drawables;
gboolean merged = FALSE;
if (paste_type == GIMP_PASTE_TYPE_FLOATING)
if (paste_type == GIMP_PASTE_TYPE_NEW_LAYER_OR_FLOATING)
{
if (! display || ! gimp_display_get_image (display))
{
@@ -352,6 +358,8 @@ edit_paste_cmd_callback (GimpAction *action,
}
}
return_if_no_image (image, data);
if (! display)
return;
@@ -361,12 +369,43 @@ edit_paste_cmd_callback (GimpAction *action,
case GIMP_PASTE_TYPE_FLOATING_IN_PLACE:
case GIMP_PASTE_TYPE_FLOATING_INTO:
case GIMP_PASTE_TYPE_FLOATING_INTO_IN_PLACE:
edit_paste (display, paste_type, TRUE);
edit_paste (display, paste_type, merged, TRUE);
break;
case GIMP_PASTE_TYPE_NEW_LAYER:
case GIMP_PASTE_TYPE_NEW_LAYER_IN_PLACE:
edit_paste (display, paste_type, FALSE);
edit_paste (display, paste_type, merged, FALSE);
break;
case GIMP_PASTE_TYPE_NEW_MERGED_LAYER_OR_FLOATING:
case GIMP_PASTE_TYPE_NEW_MERGED_LAYER_OR_FLOATING_IN_PLACE:
merged = TRUE;
case GIMP_PASTE_TYPE_NEW_LAYER_OR_FLOATING:
case GIMP_PASTE_TYPE_NEW_LAYER_OR_FLOATING_IN_PLACE:
drawables = gimp_image_get_selected_drawables (image);
if (drawables &&
(g_list_length (drawables) == 1) &&
GIMP_IS_LAYER_MASK (drawables->data))
{
converted_type = (paste_type == GIMP_PASTE_TYPE_NEW_LAYER_OR_FLOATING ||
paste_type == GIMP_PASTE_TYPE_NEW_MERGED_LAYER_OR_FLOATING) ?
GIMP_PASTE_TYPE_FLOATING :
GIMP_PASTE_TYPE_FLOATING_IN_PLACE;
edit_paste (display, converted_type, merged, TRUE);
}
else
{
converted_type = (paste_type == GIMP_PASTE_TYPE_NEW_LAYER_OR_FLOATING ||
paste_type == GIMP_PASTE_TYPE_NEW_MERGED_LAYER_OR_FLOATING) ?
GIMP_PASTE_TYPE_NEW_LAYER :
GIMP_PASTE_TYPE_NEW_LAYER_IN_PLACE;
edit_paste (display, converted_type, merged, FALSE);
}
g_list_free (drawables);
break;
}
}
@@ -387,7 +426,8 @@ edit_paste_as_new_image_cmd_callback (GimpAction *action,
if (paste)
{
image = gimp_edit_paste_as_new_image (gimp, paste);
image = gimp_edit_paste_as_new_image (gimp, paste,
action_data_get_context (data));
g_object_unref (paste);
}
@@ -595,11 +635,17 @@ check_drawable_alpha (GimpDrawable *drawable,
static void
edit_paste (GimpDisplay *display,
GimpPasteType paste_type,
gboolean merged,
gboolean try_svg)
{
GimpImage *image = gimp_display_get_image (display);
GimpObject *paste;
g_return_if_fail (paste_type != GIMP_PASTE_TYPE_NEW_LAYER_OR_FLOATING &&
paste_type != GIMP_PASTE_TYPE_NEW_LAYER_OR_FLOATING_IN_PLACE &&
paste_type != GIMP_PASTE_TYPE_NEW_MERGED_LAYER_OR_FLOATING &&
paste_type != GIMP_PASTE_TYPE_NEW_MERGED_LAYER_OR_FLOATING_IN_PLACE);
if (try_svg)
{
gchar *svg;
@@ -629,33 +675,29 @@ edit_paste (GimpDisplay *display,
{
GimpDisplayShell *shell = gimp_display_get_shell (display);
GList *drawables = gimp_image_get_selected_drawables (image);
GimpDrawable *drawable = NULL;
GList *pasted_layers;
gint x, y;
gint width, height;
/* Paste on multiple selection is probably wrong right now (though
* I guess it can be argued). For now we just default to the same
* as pasting with no selected drawable, which will just create a
* new drawable.
*/
if (g_list_length (drawables) == 1)
drawable = drawables->data;
g_list_free (drawables);
if (drawable &&
paste_type != GIMP_PASTE_TYPE_NEW_LAYER &&
paste_type != GIMP_PASTE_TYPE_NEW_LAYER_IN_PLACE)
if (g_list_length (drawables) != 1 ||
(paste_type != GIMP_PASTE_TYPE_NEW_LAYER &&
paste_type != GIMP_PASTE_TYPE_NEW_LAYER_IN_PLACE))
{
if (gimp_viewable_get_children (GIMP_VIEWABLE (drawable)))
if (g_list_length (drawables) != 1)
{
gimp_message_literal (display->gimp, G_OBJECT (display),
GIMP_MESSAGE_INFO,
_("Pasted as new layer because the "
"target is not a single layer or layer mask."));
}
else if (gimp_viewable_get_children (GIMP_VIEWABLE (drawables->data)))
{
gimp_message_literal (display->gimp, G_OBJECT (display),
GIMP_MESSAGE_INFO,
_("Pasted as new layer because the "
"target is a layer group."));
}
else if (gimp_item_is_content_locked (GIMP_ITEM (drawable), NULL))
else if (gimp_item_is_content_locked (GIMP_ITEM (drawables->data), NULL))
{
gimp_message_literal (display->gimp, G_OBJECT (display),
GIMP_MESSAGE_INFO,
@@ -671,14 +713,16 @@ edit_paste (GimpDisplay *display,
! gimp_display_shell_get_infinite_canvas (shell),
&x, &y, &width, &height);
if ((pasted_layers = gimp_edit_paste (image, drawable, paste,
paste_type, x, y, width, height)))
if ((pasted_layers = gimp_edit_paste (image, drawables, paste, paste_type,
gimp_get_user_context (display->gimp),
merged, x, y, width, height)))
{
gimp_image_set_selected_layers (image, pasted_layers);
g_list_free (pasted_layers);
gimp_image_flush (image);
}
g_list_free (drawables);
g_object_unref (paste);
}
else

View File

@@ -36,37 +36,33 @@
static const GimpActionEntry error_console_actions[] =
{
{ "error-console-popup", GIMP_ICON_DIALOG_WARNING,
NC_("error-console-action", "Error Console Menu"), NULL, NULL, NULL,
GIMP_HELP_ERRORS_DIALOG },
{ "error-console-clear", GIMP_ICON_EDIT_CLEAR,
NC_("error-console-action", "_Clear"), NULL,
NC_("error-console-action", "_Clear"), NULL, { NULL },
NC_("error-console-action", "Clear error console"),
error_console_clear_cmd_callback,
GIMP_HELP_ERRORS_CLEAR },
{ "error-console-select-all", NULL,
NC_("error-console-action", "Select _All"), "",
NC_("error-console-action", "Select _All"), NULL, { NULL },
NC_("error-console-action", "Select all error messages"),
error_console_select_all_cmd_callback,
GIMP_HELP_ERRORS_SELECT_ALL },
{ "error-console-highlight", NULL,
NC_("error-console-action", "_Highlight"), NULL, NULL, NULL,
NC_("error-console-action", "_Highlight"), NULL, { NULL }, NULL, NULL,
GIMP_HELP_ERRORS_HIGHLIGHT }
};
static const GimpEnumActionEntry error_console_save_actions[] =
{
{ "error-console-save-all", GIMP_ICON_DOCUMENT_SAVE_AS,
NC_("error-console-action", "_Save Error Log to File..."), NULL,
NC_("error-console-action", "_Save Error Log to File..."), NULL, { NULL },
NC_("error-console-action", "Write all error messages to a file"),
FALSE, FALSE,
GIMP_HELP_ERRORS_SAVE },
{ "error-console-save-selection", GIMP_ICON_DOCUMENT_SAVE_AS,
NC_("error-console-action", "Save S_election to File..."), NULL,
NC_("error-console-action", "Save S_election to File..."), NULL, { NULL },
NC_("error-console-action", "Write the selected error messages to a file"),
TRUE, FALSE,
GIMP_HELP_ERRORS_SAVE }
@@ -75,21 +71,21 @@ static const GimpEnumActionEntry error_console_save_actions[] =
static const GimpToggleActionEntry error_console_highlight_actions[] =
{
{ "error-console-highlight-error", NULL,
NC_("error-console-action", "_Errors"), NULL,
NC_("error-console-action", "_Errors"), NULL, { NULL },
NC_("error-console-action", "Highlight error console on errors"),
error_console_highlight_error_cmd_callback,
FALSE,
GIMP_HELP_ERRORS_HIGHLIGHT },
{ "error-console-highlight-warning", NULL,
NC_("error-console-action", "_Warnings"), NULL,
NC_("error-console-action", "_Warnings"), NULL, { NULL },
NC_("error-console-action", "Highlight error console on warnings"),
error_console_highlight_warning_cmd_callback,
FALSE,
GIMP_HELP_ERRORS_HIGHLIGHT },
{ "error-console-highlight-info", NULL,
NC_("error-console-action", "_Messages"), NULL,
NC_("error-console-action", "_Messages"), NULL, { NULL },
NC_("error-console-action", "Highlight error console on messages"),
error_console_highlight_info_cmd_callback,
FALSE,

View File

@@ -30,6 +30,7 @@
#include "widgets/gimperrorconsole.h"
#include "widgets/gimphelp-ids.h"
#include "widgets/gimptextbuffer.h"
#include "widgets/gimpwidgets-utils.h"
#include "error-console-commands.h"
@@ -104,14 +105,13 @@ error_console_save_cmd_callback (GimpAction *action,
gtk_dialog_set_default_response (GTK_DIALOG (dialog), GTK_RESPONSE_OK);
gimp_dialog_set_alternative_button_order (GTK_DIALOG (dialog),
GTK_RESPONSE_OK,
GTK_RESPONSE_CANCEL,
-1);
GTK_RESPONSE_OK,
GTK_RESPONSE_CANCEL,
-1);
console->save_selection = selection;
g_object_add_weak_pointer (G_OBJECT (dialog),
(gpointer) &console->file_dialog);
g_set_weak_pointer (&console->file_dialog, dialog);
gtk_window_set_screen (GTK_WINDOW (dialog),
gtk_widget_get_screen (GTK_WIDGET (console)));
@@ -133,6 +133,10 @@ error_console_save_cmd_callback (GimpAction *action,
}
gtk_window_present (GTK_WINDOW (console->file_dialog));
#ifdef G_OS_WIN32
gimp_window_set_title_bar_theme (console->gimp, console->file_dialog, FALSE);
#endif
}
void

View File

@@ -69,60 +69,56 @@ static gchar * file_actions_create_label (const gchar *format,
static const GimpActionEntry file_actions[] =
{
{ "file-menu", NULL, NC_("file-action", "_File") },
{ "file-create-menu", NULL, NC_("file-action", "Crea_te") },
{ "file-open-recent-menu", NULL, NC_("file-action", "Open _Recent") },
{ "file-open", GIMP_ICON_IMAGE_OPEN,
NC_("file-action", "_Open..."), "<primary>O",
NC_("file-action", "_Open..."), NULL, { "<primary>O", NULL },
NC_("file-action", "Open an image file"),
file_open_cmd_callback,
GIMP_HELP_FILE_OPEN },
{ "file-open-as-layers", GIMP_ICON_LAYER,
NC_("file-action", "Op_en as Layers..."), "<primary><alt>O",
NC_("file-action", "Op_en as Layers..."), NULL, { "<primary><alt>O", NULL },
NC_("file-action", "Open an image file as layers"),
file_open_as_layers_cmd_callback,
GIMP_HELP_FILE_OPEN_AS_LAYER },
{ "file-open-location", GIMP_ICON_WEB,
NC_("file-action", "Open _Location..."), NULL,
NC_("file-action", "Open _Location..."), NULL, { NULL },
NC_("file-action", "Open an image file from a specified location"),
file_open_location_cmd_callback,
GIMP_HELP_FILE_OPEN_LOCATION },
{ "file-create-template", NULL,
NC_("file-action", "Create _Template..."), NULL,
NC_("file-action", "Create _Template..."), NULL, { NULL },
NC_("file-action", "Create a new template from this image"),
file_create_template_cmd_callback,
GIMP_HELP_FILE_CREATE_TEMPLATE },
{ "file-revert", GIMP_ICON_IMAGE_RELOAD,
NC_("file-action", "Re_vert"), NULL,
NC_("file-action", "Re_vert"), NULL, { NULL },
NC_("file-action", "Reload the image file from disk"),
file_revert_cmd_callback,
GIMP_HELP_FILE_REVERT },
{ "file-close-all", GIMP_ICON_CLOSE_ALL,
NC_("file-action", "C_lose All"), "<primary><shift>W",
NC_("file-action", "C_lose All"), NULL, { "<primary><shift>W", NULL },
NC_("file-action", "Close all opened images"),
file_close_all_cmd_callback,
GIMP_HELP_FILE_CLOSE_ALL },
{ "file-copy-location", GIMP_ICON_EDIT_COPY,
NC_("file-action", "Copy _Image Location"), NULL,
NC_("file-action", "Copy _Image Location"), NULL, { NULL },
NC_("file-action", "Copy image file location to clipboard"),
file_copy_location_cmd_callback,
GIMP_HELP_FILE_COPY_LOCATION },
{ "file-show-in-file-manager", GIMP_ICON_FILE_MANAGER,
NC_("file-action", "Show in _File Manager"), "<primary><alt>F",
NC_("file-action", "Show in _File Manager"), NULL, { "<primary><alt>F", NULL },
NC_("file-action", "Show image file location in the file manager"),
file_show_in_file_manager_cmd_callback,
GIMP_HELP_FILE_SHOW_IN_FILE_MANAGER },
{ "file-quit", GIMP_ICON_APPLICATION_EXIT,
NC_("file-action", "_Quit"), "<primary>Q",
NC_("file-action", "_Quit"), NULL, { "<primary>Q", NULL },
NC_("file-action", "Quit the GNU Image Manipulation Program"),
file_quit_cmd_callback,
GIMP_HELP_FILE_QUIT }
@@ -131,19 +127,19 @@ static const GimpActionEntry file_actions[] =
static const GimpEnumActionEntry file_save_actions[] =
{
{ "file-save", GIMP_ICON_DOCUMENT_SAVE,
NC_("file-action", "_Save"), "<primary>S",
NC_("file-action", "_Save"), NULL, { "<primary>S", NULL },
NC_("file-action", "Save this image"),
GIMP_SAVE_MODE_SAVE, FALSE,
GIMP_HELP_FILE_SAVE },
{ "file-save-as", GIMP_ICON_DOCUMENT_SAVE_AS,
NC_("file-action", "Save _As..."), "<primary><shift>S",
NC_("file-action", "Save _As..."), NULL, { "<primary><shift>S", NULL },
NC_("file-action", "Save this image with a different name"),
GIMP_SAVE_MODE_SAVE_AS, FALSE,
GIMP_HELP_FILE_SAVE_AS },
{ "file-save-a-copy", NULL,
NC_("file-action", "Save a Cop_y..."), NULL,
NC_("file-action", "Save a Cop_y..."), NULL, { NULL },
NC_("file-action",
"Save a copy of this image, without affecting the source file "
"(if any) or the current state of the image"),
@@ -151,25 +147,25 @@ static const GimpEnumActionEntry file_save_actions[] =
GIMP_HELP_FILE_SAVE_A_COPY },
{ "file-save-and-close", NULL,
NC_("file-action", "Save and Close..."), NULL,
NC_("file-action", "Save and Close..."), NULL, { NULL },
NC_("file-action", "Save this image and close its window"),
GIMP_SAVE_MODE_SAVE_AND_CLOSE, FALSE,
GIMP_HELP_FILE_SAVE },
{ "file-export", NULL,
NC_("file-action", "E_xport..."), "<primary>E",
NC_("file-action", "E_xport..."), NULL, { "<primary>E", NULL },
NC_("file-action", "Export the image"),
GIMP_SAVE_MODE_EXPORT, FALSE,
GIMP_HELP_FILE_EXPORT },
{ "file-overwrite", NULL,
NC_("file-action", "Over_write"), "",
NC_("file-action", "Over_write"), NULL, { NULL },
NC_("file-action", "Export the image back to the imported file in the import format"),
GIMP_SAVE_MODE_OVERWRITE, FALSE,
GIMP_HELP_FILE_OVERWRITE },
{ "file-export-as", NULL,
NC_("file-action", "E_xport As..."), "<primary><shift>E",
NC_("file-action", "E_xport As..."), NULL, { "<primary><shift>E", NULL },
NC_("file-action", "Export the image to various file formats such as PNG or JPEG"),
GIMP_SAVE_MODE_EXPORT_AS, FALSE,
GIMP_HELP_FILE_EXPORT_AS }
@@ -206,11 +202,11 @@ file_actions_setup (GimpActionGroup *group)
entries[i].value_variable = FALSE;
if (i < 9)
entries[i].accelerator = g_strdup_printf ("<primary>%d", i + 1);
entries[i].accelerator[0] = g_strdup_printf ("<primary>%d", i + 1);
else if (i == 9)
entries[i].accelerator = g_strdup ("<primary>0");
entries[i].accelerator[0] = g_strdup ("<primary>0");
else
entries[i].accelerator = NULL;
entries[i].accelerator[0] = NULL;
}
gimp_action_group_add_enum_actions (group, NULL, entries, n_entries,
@@ -219,12 +215,10 @@ file_actions_setup (GimpActionGroup *group)
for (i = 0; i < n_entries; i++)
{
gimp_action_group_set_action_visible (group, entries[i].name, FALSE);
gimp_action_group_set_action_context (group, entries[i].name,
gimp_get_user_context (group->gimp));
g_free ((gchar *) entries[i].name);
if (entries[i].accelerator)
g_free ((gchar *) entries[i].accelerator);
if (entries[i].accelerator[0])
g_free ((gchar *) entries[i].accelerator[0]);
}
g_free (entries);
@@ -366,12 +360,13 @@ file_actions_last_opened_update (GimpContainer *container,
GimpImagefile *imagefile = (GimpImagefile *)
gimp_container_get_child_by_index (container, i);
if (GIMP_ACTION_IMPL (action)->viewable != (GimpViewable *) imagefile)
if (gimp_action_get_viewable (action) != (GimpViewable *) imagefile)
{
GFile *file;
const gchar *name;
gchar *basename;
gchar *escaped;
gchar *label;
file = gimp_imagefile_get_file (imagefile);
@@ -379,17 +374,22 @@ file_actions_last_opened_update (GimpContainer *container,
basename = g_path_get_basename (name);
escaped = gimp_escape_uline (basename);
g_free (basename);
/* TRANSLATORS: the %s will be replaced by the file name of a
* recently opened image.
*/
label = g_strdup_printf (_("Open \"%s\""), escaped);
g_object_set (action,
"label", escaped,
"tooltip", name,
"visible", TRUE,
"viewable", imagefile,
"label", label,
"short-label", escaped,
"tooltip", name,
"visible", TRUE,
"viewable", imagefile,
NULL);
g_free (escaped);
g_free (label);
g_free (escaped);
}
}
else

View File

@@ -258,9 +258,27 @@ file_save_cmd_callback (GimpAction *action,
! GIMP_GUI_CONFIG (image->gimp->config)->trust_dirty_flag) ||
file == NULL)
{
GimpPlugInProcedure *save_proc = gimp_image_get_save_proc (image);
GimpPlugInProcedure *save_proc = gimp_image_get_save_proc (image);
gboolean valid_file = FALSE;
if (file && ! save_proc)
if (file)
{
gchar *uri = g_file_get_uri (file);
/* Non-valid URI (such as "Untitled.xcd" without a scheme) are
* considered non-native by GLib and will trigger remote file code
* path in file_save_dialog_save_image(), eventually failing with
* a weird error. When we encounter such non-valid URI, we just
* consider that the file was entered manually with a bogus name
* (possibly by some script or plug-in) and we fall through
* directly to showing the file dialog. The file name will still
* be useful as default file name.
*/
valid_file = g_uri_is_valid (uri, G_URI_FLAGS_NONE, NULL);
g_free (uri);
}
if (valid_file && ! save_proc)
{
save_proc =
gimp_plug_in_manager_file_procedure_find (image->gimp->plug_in_manager,
@@ -268,7 +286,7 @@ file_save_cmd_callback (GimpAction *action,
file, NULL);
}
if (file && save_proc)
if (valid_file && save_proc)
{
saved = file_save_dialog_save_image (GIMP_PROGRESS (display),
gimp, image, file,

File diff suppressed because it is too large Load Diff

View File

@@ -51,12 +51,6 @@ static gchar * filters_parse_operation (Gimp *gimp,
const gchar *icon_name,
GimpObject **settings);
static void filters_run_procedure (Gimp *gimp,
GimpDisplay *display,
GimpProcedure *procedure,
GimpRunMode run_mode);
/* public functions */
void
@@ -65,12 +59,20 @@ filters_apply_cmd_callback (GimpAction *action,
gpointer data)
{
GimpImage *image;
GimpDrawable *drawable;
GList *drawables;
gchar *operation;
GimpObject *settings;
GimpProcedure *procedure;
GVariant *variant;
return_if_no_drawable (image, drawable, data);
return_if_no_drawables (image, drawables, data);
if (g_list_length (drawables) != 1)
{
/* We only support running filters on single drawable for now. */
g_list_free (drawables);
return;
}
operation = filters_parse_operation (image->gimp,
g_variant_get_string (value, NULL),
@@ -78,6 +80,7 @@ filters_apply_cmd_callback (GimpAction *action,
&settings);
procedure = gimp_gegl_procedure_new (image->gimp,
NULL,
GIMP_RUN_NONINTERACTIVE, settings,
operation,
gimp_action_get_name (action),
@@ -99,6 +102,7 @@ filters_apply_cmd_callback (GimpAction *action,
g_variant_unref (variant);
g_object_unref (procedure);
g_list_free (drawables);
}
void
@@ -107,12 +111,21 @@ filters_apply_interactive_cmd_callback (GimpAction *action,
gpointer data)
{
GimpImage *image;
GimpDrawable *drawable;
GList *drawables;
GimpProcedure *procedure;
GVariant *variant;
return_if_no_drawable (image, drawable, data);
return_if_no_drawables (image, drawables, data);
if (g_list_length (drawables) != 1)
{
/* We only support running filters on single drawable for now. */
g_list_free (drawables);
return;
}
procedure = gimp_gegl_procedure_new (image->gimp,
NULL,
GIMP_RUN_INTERACTIVE, NULL,
g_variant_get_string (value, NULL),
gimp_action_get_name (action),
@@ -129,6 +142,7 @@ filters_apply_interactive_cmd_callback (GimpAction *action,
g_variant_unref (variant);
g_object_unref (procedure);
g_list_free (drawables);
}
void
@@ -222,7 +236,7 @@ filters_parse_operation (Gimp *gimp,
return g_strdup (operation_str);
}
static void
void
filters_run_procedure (Gimp *gimp,
GimpDisplay *display,
GimpProcedure *procedure,

View File

@@ -33,5 +33,10 @@ void filters_history_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data);
void filters_run_procedure (Gimp *gimp,
GimpDisplay *display,
GimpProcedure *procedure,
GimpRunMode run_mode);
#endif /* __FILTERS_COMMANDS_H__ */

View File

@@ -40,12 +40,8 @@
static const GimpActionEntry fonts_actions[] =
{
{ "fonts-popup", GIMP_ICON_FONT,
NC_("fonts-action", "Fonts Menu"), NULL, NULL, NULL,
GIMP_HELP_FONT_DIALOG },
{ "fonts-refresh", GIMP_ICON_VIEW_REFRESH,
NC_("fonts-action", "_Rescan Font List"), NULL,
NC_("fonts-action", "_Rescan Font List"), NULL, { NULL },
NC_("fonts-action", "Rescan the installed fonts"),
data_refresh_cmd_callback,
GIMP_HELP_FONT_REFRESH }

View File

@@ -41,6 +41,7 @@
#include "core/gimpcontext.h"
#include "core/gimpdisplay.h"
#include "core/gimpdrawable-operation.h"
#include "core/gimpdrawablefilter.h"
#include "core/gimpimage.h"
#include "core/gimplayermask.h"
#include "core/gimpparamspecs.h"
@@ -190,6 +191,7 @@ gimp_gegl_procedure_get_sensitive (GimpProcedure *procedure,
if (gimp_viewable_get_children (GIMP_VIEWABLE (drawable)))
sensitive = FALSE;
}
g_list_free (drawables);
return sensitive;
@@ -203,30 +205,38 @@ gimp_gegl_procedure_execute (GimpProcedure *procedure,
GimpValueArray *args,
GError **error)
{
GimpImage *image;
GimpDrawable *drawable;
GObject *config;
GeglNode *node;
GimpImage *image;
gint n_drawables;
GObject **drawables;
GObject *config;
image = g_value_get_object (gimp_value_array_index (args, 1));
drawable = g_value_get_object (gimp_value_array_index (args, 2));
config = g_value_get_object (gimp_value_array_index (args, 3));
image = g_value_get_object (gimp_value_array_index (args, 1));
n_drawables = g_value_get_int (gimp_value_array_index (args, 2));
drawables = gimp_value_get_object_array (gimp_value_array_index (args, 3));
config = g_value_get_object (gimp_value_array_index (args, 4));
node = gegl_node_new_child (NULL,
"operation",
GIMP_GEGL_PROCEDURE (procedure)->operation,
NULL);
if (n_drawables == 1)
{
GeglNode *node;
gimp_drawable_apply_operation_with_config (
drawable,
progress, gimp_procedure_get_label (procedure),
node, config);
node = gegl_node_new_child (NULL,
"operation",
GIMP_GEGL_PROCEDURE (procedure)->operation,
NULL);
g_object_unref (node);
gimp_drawable_apply_operation_with_config (GIMP_DRAWABLE (drawables[0]),
progress,
gimp_procedure_get_label (procedure),
node, config);
gimp_image_flush (image);
g_object_unref (node);
return gimp_procedure_get_return_values (procedure, TRUE, NULL);
gimp_image_flush (image);
return gimp_procedure_get_return_values (procedure, TRUE, NULL);
}
return gimp_procedure_get_return_values (procedure, FALSE, NULL);
}
static void
@@ -244,7 +254,7 @@ gimp_gegl_procedure_execute_async (GimpProcedure *procedure,
const gchar *tool_name;
run_mode = g_value_get_enum (gimp_value_array_index (args, 0));
settings = g_value_get_object (gimp_value_array_index (args, 3));
settings = g_value_get_object (gimp_value_array_index (args, 4));
if (! settings &&
(run_mode != GIMP_RUN_INTERACTIVE ||
@@ -255,7 +265,7 @@ gimp_gegl_procedure_execute_async (GimpProcedure *procedure,
GType config_type;
GimpContainer *container;
config_type = G_VALUE_TYPE (gimp_value_array_index (args, 3));
config_type = G_VALUE_TYPE (gimp_value_array_index (args, 4));
container = gimp_operation_config_get_container (gimp, config_type,
(GCompareFunc)
@@ -282,7 +292,7 @@ gimp_gegl_procedure_execute_async (GimpProcedure *procedure,
{
GimpValueArray *return_vals;
g_value_set_object (gimp_value_array_index (args, 3), settings);
g_value_set_object (gimp_value_array_index (args, 4), settings);
return_vals = gimp_procedure_execute (procedure, gimp, context, progress,
args, NULL);
gimp_value_array_unref (return_vals);
@@ -357,6 +367,7 @@ gimp_gegl_procedure_execute_async (GimpProcedure *procedure,
if (! strcmp (tool_name, "gimp-operation-tool"))
{
gimp_operation_tool_set_operation (GIMP_OPERATION_TOOL (active_tool),
gegl_procedure->filter,
gegl_procedure->operation,
gimp_procedure_get_label (procedure),
gimp_procedure_get_label (procedure),
@@ -367,6 +378,74 @@ gimp_gegl_procedure_execute_async (GimpProcedure *procedure,
tool_manager_initialize_active (gimp, display);
/* For GIMP-specific GEGL operations, we need to copy over the
* config object stored in the GeglNode */
if (gegl_procedure->filter)
{
GeglNode *node;
GIMP_FILTER_TOOL (active_tool)->existing_filter = gegl_procedure->filter;
gimp_filter_set_active (GIMP_FILTER (gegl_procedure->filter), FALSE);
node = gimp_drawable_filter_get_operation (gegl_procedure->filter);
if (gimp_operation_config_is_custom (gimp, gegl_procedure->operation))
{
gegl_node_get (node,
"config", &settings,
NULL);
}
else
{
GParamSpec **pspecs;
guint n_pspecs;
gdouble opacity;
GimpLayerMode paint_mode;
GimpFilterRegion region;
opacity = gimp_drawable_filter_get_opacity (gegl_procedure->filter);
paint_mode = gimp_drawable_filter_get_paint_mode (gegl_procedure->filter);
region = gimp_drawable_filter_get_region (gegl_procedure->filter);
settings =
g_object_new (gimp_operation_config_get_type (active_tool->tool_info->gimp,
gegl_procedure->operation,
gimp_tool_get_icon_name (active_tool),
GIMP_TYPE_OPERATION_SETTINGS),
NULL);
pspecs = gegl_operation_list_properties (gegl_procedure->operation, &n_pspecs);
for (gint i = 0; i < n_pspecs; i++)
{
GValue value = G_VALUE_INIT;
GParamSpec *pspec = pspecs[i];
GParamSpec *gimp_pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (settings),
pspec->name);
g_value_init (&value, pspec->value_type);
gegl_node_get_property (node, pspec->name,
&value);
if (gimp_pspec)
g_object_set_property (G_OBJECT (settings), gimp_pspec->name,
&value);
else
g_critical ("%s: property '%s' of operation '%s' doesn't exist in config %s",
G_STRFUNC, pspec->name, gegl_procedure->operation,
g_type_name (G_TYPE_FROM_INSTANCE (settings)));
g_value_unset (&value);
}
g_free (pspecs);
g_object_set (settings,
"gimp-opacity", opacity,
"gimp-mode", paint_mode,
"gimp-region", region,
NULL);
}
}
if (settings)
gimp_filter_tool_set_config (GIMP_FILTER_TOOL (active_tool),
GIMP_CONFIG (settings));
@@ -377,15 +456,16 @@ gimp_gegl_procedure_execute_async (GimpProcedure *procedure,
/* public functions */
GimpProcedure *
gimp_gegl_procedure_new (Gimp *gimp,
GimpRunMode default_run_mode,
GimpObject *default_settings,
const gchar *operation,
const gchar *name,
const gchar *menu_label,
const gchar *tooltip,
const gchar *icon_name,
const gchar *help_id)
gimp_gegl_procedure_new (Gimp *gimp,
GimpDrawableFilter *filter,
GimpRunMode default_run_mode,
GimpObject *default_settings,
const gchar *operation,
const gchar *name,
const gchar *menu_label,
const gchar *tooltip,
const gchar *icon_name,
const gchar *help_id)
{
GimpProcedure *procedure;
GimpGeglProcedure *gegl_procedure;
@@ -403,6 +483,7 @@ gimp_gegl_procedure_new (Gimp *gimp,
gegl_procedure = GIMP_GEGL_PROCEDURE (procedure);
gegl_procedure->filter = filter;
gegl_procedure->operation = g_strdup (operation);
gegl_procedure->default_run_mode = default_run_mode;
gegl_procedure->menu_label = g_strdup (menu_label);
@@ -433,11 +514,17 @@ gimp_gegl_procedure_new (Gimp *gimp,
FALSE,
GIMP_PARAM_READWRITE));
gimp_procedure_add_argument (procedure,
gimp_param_spec_drawable ("drawable",
"Drawable",
"Input drawable",
TRUE,
GIMP_PARAM_READWRITE));
g_param_spec_int ("num-drawables",
"N drawables",
"The number of drawables",
0, G_MAXINT32, 0,
GIMP_PARAM_READWRITE));
gimp_procedure_add_argument (procedure,
gimp_param_spec_object_array ("drawables",
"Drawables",
"Input drawables",
GIMP_TYPE_DRAWABLE,
GIMP_PARAM_READWRITE));
gimp_procedure_add_argument (procedure,
g_param_spec_object ("settings",
"Settings",

View File

@@ -40,12 +40,13 @@ struct _GimpGeglProcedure
{
GimpProcedure parent_instance;
gchar *operation;
GimpDrawableFilter *filter;
gchar *operation;
GimpRunMode default_run_mode;
GimpObject *default_settings;
GimpRunMode default_run_mode;
GimpObject *default_settings;
gchar *menu_label;
gchar *menu_label;
};
struct _GimpGeglProcedureClass
@@ -56,15 +57,15 @@ struct _GimpGeglProcedureClass
GType gimp_gegl_procedure_get_type (void) G_GNUC_CONST;
GimpProcedure * gimp_gegl_procedure_new (Gimp *gimp,
GimpRunMode default_run_mode,
GimpObject *default_settings,
const gchar *operation,
const gchar *name,
const gchar *menu_label,
const gchar *tooltip,
const gchar *icon_name,
const gchar *help_id);
GimpProcedure * gimp_gegl_procedure_new (Gimp *gimp,
GimpDrawableFilter *filter,
GimpRunMode default_run_mode,
GimpObject *default_settings,
const gchar *operation,
const gchar *name,
const gchar *menu_label,
const gchar *tooltip,
const gchar *icon_name,
const gchar *help_id);
#endif /* __GIMP_GEGL_PROCEDURE_H__ */

View File

@@ -32,6 +32,7 @@
#include "widgets/gimpactiongroup.h"
#include "widgets/gimpgradienteditor.h"
#include "widgets/gimphelp-ids.h"
#include "widgets/gimpradioaction.h"
#include "data-editor-commands.h"
#include "gradient-editor-actions.h"
@@ -42,10 +43,6 @@
static const GimpActionEntry gradient_editor_actions[] =
{
{ "gradient-editor-popup", GIMP_ICON_GRADIENT,
NC_("gradient-editor-action", "Gradient Editor Menu"), NULL, NULL, NULL,
GIMP_HELP_GRADIENT_EDITOR_DIALOG },
{ "gradient-editor-left-color-type", NULL,
NC_("gradient-editor-action", "Left Color Type") },
{ "gradient-editor-load-left-color", GIMP_ICON_DOCUMENT_REVERT,
@@ -60,61 +57,64 @@ static const GimpActionEntry gradient_editor_actions[] =
{ "gradient-editor-save-right-color", GIMP_ICON_DOCUMENT_SAVE,
NC_("gradient-editor-action", "Sa_ve Right Color To") },
/* TODO GMenu: remove these 2 bogus actions once old style XML menu files are
* deleted.
*/
{ "gradient-editor-blending-func", NULL, "blending-function" },
{ "gradient-editor-coloring-type", NULL, "coloring-type" },
{ "gradient-editor-left-color", NULL,
NC_("gradient-editor-action", "L_eft Endpoint's Color..."), NULL, NULL,
NC_("gradient-editor-action", "L_eft Endpoint's Color..."), NULL, { NULL }, NULL,
gradient_editor_left_color_cmd_callback,
GIMP_HELP_GRADIENT_EDITOR_LEFT_COLOR },
{ "gradient-editor-right-color", NULL,
NC_("gradient-editor-action", "R_ight Endpoint's Color..."), NULL, NULL,
NC_("gradient-editor-action", "R_ight Endpoint's Color..."), NULL, { NULL }, NULL,
gradient_editor_right_color_cmd_callback,
GIMP_HELP_GRADIENT_EDITOR_RIGHT_COLOR },
{ "gradient-editor-flip", GIMP_ICON_OBJECT_FLIP_HORIZONTAL,
"flip", NULL, NULL,
NC_("gradient-editor-action", "Flip"), NULL, { NULL }, NULL,
gradient_editor_flip_cmd_callback,
GIMP_HELP_GRADIENT_EDITOR_FLIP },
{ "gradient-editor-replicate", GIMP_ICON_OBJECT_DUPLICATE,
"replicate", NULL, NULL,
NC_("gradient-editor-action", "Replicate"), NULL, { NULL }, NULL,
gradient_editor_replicate_cmd_callback,
GIMP_HELP_GRADIENT_EDITOR_FLIP },
{ "gradient-editor-split-midpoint", NULL,
"splitmidpoint", NULL, NULL,
NC_("gradient-editor-action", "Split Midpoint"), NULL, { NULL }, NULL,
gradient_editor_split_midpoint_cmd_callback,
GIMP_HELP_GRADIENT_EDITOR_SPLIT_MIDPOINT },
{ "gradient-editor-split-uniform", NULL,
"splituniform", NULL, NULL,
NC_("gradient-editor-action", "Split Uniformly"), NULL, { NULL }, NULL,
gradient_editor_split_uniformly_cmd_callback,
GIMP_HELP_GRADIENT_EDITOR_SPLIT_UNIFORM },
{ "gradient-editor-delete", GIMP_ICON_EDIT_DELETE,
"delete", "", NULL,
NC_("gradient-editor-action", "Delete"), NULL, { NULL }, NULL,
gradient_editor_delete_cmd_callback,
GIMP_HELP_GRADIENT_EDITOR_DELETE },
{ "gradient-editor-recenter", NULL,
"recenter", NULL, NULL,
NC_("gradient-editor-action", "Recenter"), NULL, { NULL }, NULL,
gradient_editor_recenter_cmd_callback,
GIMP_HELP_GRADIENT_EDITOR_RECENTER },
{ "gradient-editor-redistribute", NULL,
"redistribute", NULL, NULL,
NC_("gradient-editor-action", "Redistribute"), NULL, { NULL }, NULL,
gradient_editor_redistribute_cmd_callback,
GIMP_HELP_GRADIENT_EDITOR_REDISTRIBUTE },
{ "gradient-editor-blend-color", NULL,
NC_("gradient-editor-action", "Ble_nd Endpoints' Colors"), NULL, NULL,
NC_("gradient-editor-action", "Ble_nd Endpoints' Colors"), NULL, { NULL }, NULL,
gradient_editor_blend_color_cmd_callback,
GIMP_HELP_GRADIENT_EDITOR_BLEND_COLOR },
{ "gradient-editor-blend-opacity", NULL,
NC_("gradient-editor-action", "Blend Endpoints' Opacit_y"), NULL, NULL,
NC_("gradient-editor-action", "Blend Endpoints' Opacit_y"), NULL, { NULL }, NULL,
gradient_editor_blend_opacity_cmd_callback,
GIMP_HELP_GRADIENT_EDITOR_BLEND_OPACITY }
};
@@ -122,7 +122,7 @@ static const GimpActionEntry gradient_editor_actions[] =
static const GimpToggleActionEntry gradient_editor_toggle_actions[] =
{
{ "gradient-editor-edit-active", GIMP_ICON_LINKED,
NC_("gradient-editor-action", "Edit Active Gradient"), NULL, NULL,
NC_("gradient-editor-action", "Edit Active Gradient"), NULL, { NULL }, NULL,
data_editor_edit_active_cmd_callback,
FALSE,
GIMP_HELP_GRADIENT_EDITOR_EDIT_ACTIVE }
@@ -131,44 +131,44 @@ static const GimpToggleActionEntry gradient_editor_toggle_actions[] =
#define LOAD_LEFT_FROM(num,magic) \
{ "gradient-editor-load-left-" num, NULL, \
num, NULL, NULL, \
num, NULL, { NULL }, NULL, \
(magic), FALSE, \
GIMP_HELP_GRADIENT_EDITOR_LEFT_LOAD }
#define SAVE_LEFT_TO(num,magic) \
{ "gradient-editor-save-left-" num, NULL, \
num, NULL, NULL, \
num, NULL, { NULL }, NULL, \
(magic), FALSE, \
GIMP_HELP_GRADIENT_EDITOR_LEFT_SAVE }
#define LOAD_RIGHT_FROM(num,magic) \
{ "gradient-editor-load-right-" num, NULL, \
num, NULL, NULL, \
num, NULL, { NULL }, NULL, \
(magic), FALSE, \
GIMP_HELP_GRADIENT_EDITOR_RIGHT_LOAD }
#define SAVE_RIGHT_TO(num,magic) \
{ "gradient-editor-save-right-" num, NULL, \
num, NULL, NULL, \
num, NULL, { NULL }, NULL, \
(magic), FALSE, \
GIMP_HELP_GRADIENT_EDITOR_RIGHT_SAVE }
static const GimpEnumActionEntry gradient_editor_load_left_actions[] =
{
{ "gradient-editor-load-left-left-neighbor", NULL,
NC_("gradient-editor-action", "_Left Neighbor's Right Endpoint"), NULL, NULL,
NC_("gradient-editor-action", "_Left Neighbor's Right Endpoint"), NULL, { NULL }, NULL,
GRADIENT_EDITOR_COLOR_NEIGHBOR_ENDPOINT, FALSE,
GIMP_HELP_GRADIENT_EDITOR_LEFT_LOAD },
{ "gradient-editor-load-left-right-endpoint", NULL,
NC_("gradient-editor-action", "_Right Endpoint"), NULL, NULL,
NC_("gradient-editor-action", "_Right Endpoint"), NULL, { NULL }, NULL,
GRADIENT_EDITOR_COLOR_OTHER_ENDPOINT, FALSE,
GIMP_HELP_GRADIENT_EDITOR_LEFT_LOAD },
{ "gradient-editor-load-left-fg", NULL,
NC_("gradient-editor-action", "_Foreground Color"), NULL, NULL,
NC_("gradient-editor-action", "_Foreground Color"), NULL, { NULL }, NULL,
GRADIENT_EDITOR_COLOR_FOREGROUND, FALSE,
GIMP_HELP_GRADIENT_EDITOR_LEFT_LOAD },
{ "gradient-editor-load-left-bg", NULL,
NC_("gradient-editor-action", "_Background Color"), NULL, NULL,
NC_("gradient-editor-action", "_Background Color"), NULL, { NULL }, NULL,
GRADIENT_EDITOR_COLOR_BACKGROUND, FALSE,
GIMP_HELP_GRADIENT_EDITOR_LEFT_LOAD },
@@ -201,22 +201,22 @@ static const GimpEnumActionEntry gradient_editor_save_left_actions[] =
static const GimpEnumActionEntry gradient_editor_load_right_actions[] =
{
{ "gradient-editor-load-right-right-neighbor", NULL,
NC_("gradient-editor-action", "_Right Neighbor's Left Endpoint"), NULL, NULL,
NC_("gradient-editor-action", "_Right Neighbor's Left Endpoint"), NULL, { NULL }, NULL,
GRADIENT_EDITOR_COLOR_NEIGHBOR_ENDPOINT, FALSE,
GIMP_HELP_GRADIENT_EDITOR_RIGHT_LOAD },
{ "gradient-editor-load-right-left-endpoint", NULL,
NC_("gradient-editor-action", "_Left Endpoint"), NULL, NULL,
NC_("gradient-editor-action", "_Left Endpoint"), NULL, { NULL }, NULL,
GRADIENT_EDITOR_COLOR_OTHER_ENDPOINT, FALSE,
GIMP_HELP_GRADIENT_EDITOR_RIGHT_LOAD },
{ "gradient-editor-load-right-fg", NULL,
NC_("gradient-editor-action", "_Foreground Color"), NULL, NULL,
NC_("gradient-editor-action", "_Foreground Color"), NULL, { NULL }, NULL,
GRADIENT_EDITOR_COLOR_FOREGROUND, FALSE,
GIMP_HELP_GRADIENT_EDITOR_RIGHT_LOAD },
{ "gradient-editor-load-right-bg", NULL,
NC_("gradient-editor-action", "_Background Color"), NULL, NULL,
NC_("gradient-editor-action", "_Background Color"), NULL, { NULL }, NULL,
GRADIENT_EDITOR_COLOR_BACKGROUND, FALSE,
GIMP_HELP_GRADIENT_EDITOR_RIGHT_LOAD },
@@ -255,29 +255,27 @@ static const GimpEnumActionEntry gradient_editor_save_right_actions[] =
static const GimpRadioActionEntry gradient_editor_left_color_type_actions[] =
{
{ "gradient-editor-left-color-fixed", NULL,
NC_("gradient-editor-color-type", "_Fixed"), NULL, NULL,
NC_("gradient-editor-color-type", "_Fixed"), NULL, { NULL }, NULL,
GIMP_GRADIENT_COLOR_FIXED,
GIMP_HELP_GRADIENT_EDITOR_LEFT_COLOR },
{ "gradient-editor-left-color-foreground", NULL,
NC_("gradient-editor-color-type", "F_oreground Color"), NULL, NULL,
NC_("gradient-editor-color-type", "F_oreground Color"), NULL, { NULL }, NULL,
GIMP_GRADIENT_COLOR_FOREGROUND,
GIMP_HELP_GRADIENT_EDITOR_LEFT_COLOR },
{ "gradient-editor-left-color-foreground-transparent", NULL,
NC_("gradient-editor-color-type",
"Fo_reground Color (Transparent)"), NULL, NULL,
NC_("gradient-editor-color-type", "Fo_reground Color (Transparent)"), NULL, { NULL }, NULL,
GIMP_GRADIENT_COLOR_FOREGROUND_TRANSPARENT,
GIMP_HELP_GRADIENT_EDITOR_LEFT_COLOR },
{ "gradient-editor-left-color-background", NULL,
NC_("gradient-editor-color-type", "_Background Color"), NULL, NULL,
NC_("gradient-editor-color-type", "_Background Color"), NULL, { NULL }, NULL,
GIMP_GRADIENT_COLOR_BACKGROUND,
GIMP_HELP_GRADIENT_EDITOR_LEFT_COLOR },
{ "gradient-editor-left-color-background-transparent", NULL,
NC_("gradient-editor-color-type",
"B_ackground Color (Transparent)"), NULL, NULL,
NC_("gradient-editor-color-type", "B_ackground Color (Transparent)"), NULL, { NULL }, NULL,
GIMP_GRADIENT_COLOR_BACKGROUND_TRANSPARENT,
GIMP_HELP_GRADIENT_EDITOR_LEFT_COLOR }
};
@@ -285,29 +283,27 @@ static const GimpRadioActionEntry gradient_editor_left_color_type_actions[] =
static const GimpRadioActionEntry gradient_editor_right_color_type_actions[] =
{
{ "gradient-editor-right-color-fixed", NULL,
NC_("gradient-editor-color-type", "_Fixed"), NULL, NULL,
NC_("gradient-editor-color-type", "_Fixed"), NULL, { NULL }, NULL,
GIMP_GRADIENT_COLOR_FIXED,
GIMP_HELP_GRADIENT_EDITOR_RIGHT_COLOR },
{ "gradient-editor-right-color-foreground", NULL,
NC_("gradient-editor-color-type", "F_oreground Color"), NULL, NULL,
NC_("gradient-editor-color-type", "F_oreground Color"), NULL, { NULL }, NULL,
GIMP_GRADIENT_COLOR_FOREGROUND,
GIMP_HELP_GRADIENT_EDITOR_RIGHT_COLOR },
{ "gradient-editor-right-color-foreground-transparent", NULL,
NC_("gradient-editor-color-type",
"Fo_reground Color (Transparent)"), NULL, NULL,
NC_("gradient-editor-color-type", "Fo_reground Color (Transparent)"), NULL, { NULL }, NULL,
GIMP_GRADIENT_COLOR_FOREGROUND_TRANSPARENT,
GIMP_HELP_GRADIENT_EDITOR_RIGHT_COLOR },
{ "gradient-editor-right-color-background", NULL,
NC_("gradient-editor-color-type", "_Background Color"), NULL, NULL,
NC_("gradient-editor-color-type", "_Background Color"), NULL, { NULL }, NULL,
GIMP_GRADIENT_COLOR_BACKGROUND,
GIMP_HELP_GRADIENT_EDITOR_RIGHT_COLOR },
{ "gradient-editor-right-color-background-transparent", NULL,
NC_("gradient-editor-color-type",
"B_ackground Color (Transparent)"), NULL, NULL,
NC_("gradient-editor-color-type", "B_ackground Color (Transparent)"), NULL, { NULL }, NULL,
GIMP_GRADIENT_COLOR_BACKGROUND_TRANSPARENT,
GIMP_HELP_GRADIENT_EDITOR_RIGHT_COLOR }
};
@@ -315,37 +311,37 @@ static const GimpRadioActionEntry gradient_editor_right_color_type_actions[] =
static const GimpRadioActionEntry gradient_editor_blending_actions[] =
{
{ "gradient-editor-blending-linear", NULL,
NC_("gradient-editor-blending", "_Linear"), NULL, NULL,
NC_("gradient-editor-blending", "_Linear"), NULL, { NULL }, NULL,
GIMP_GRADIENT_SEGMENT_LINEAR,
GIMP_HELP_GRADIENT_EDITOR_BLENDING },
{ "gradient-editor-blending-curved", NULL,
NC_("gradient-editor-blending", "_Curved"), NULL, NULL,
NC_("gradient-editor-blending", "_Curved"), NULL, { NULL }, NULL,
GIMP_GRADIENT_SEGMENT_CURVED,
GIMP_HELP_GRADIENT_EDITOR_BLENDING },
{ "gradient-editor-blending-sine", NULL,
NC_("gradient-editor-blending", "_Sinusoidal"), NULL, NULL,
NC_("gradient-editor-blending", "_Sinusoidal"), NULL, { NULL }, NULL,
GIMP_GRADIENT_SEGMENT_SINE,
GIMP_HELP_GRADIENT_EDITOR_BLENDING },
{ "gradient-editor-blending-sphere-increasing", NULL,
NC_("gradient-editor-blending", "Spherical (i_ncreasing)"), NULL, NULL,
NC_("gradient-editor-blending", "Spherical (i_ncreasing)"), NULL, { NULL }, NULL,
GIMP_GRADIENT_SEGMENT_SPHERE_INCREASING,
GIMP_HELP_GRADIENT_EDITOR_BLENDING },
{ "gradient-editor-blending-sphere-decreasing", NULL,
NC_("gradient-editor-blending", "Spherical (_decreasing)"), NULL, NULL,
NC_("gradient-editor-blending", "Spherical (_decreasing)"), NULL, { NULL }, NULL,
GIMP_GRADIENT_SEGMENT_SPHERE_DECREASING,
GIMP_HELP_GRADIENT_EDITOR_BLENDING },
{ "gradient-editor-blending-step", NULL,
NC_("gradient-editor-blending", "S_tep"), NULL, NULL,
NC_("gradient-editor-blending", "S_tep"), NULL, { NULL }, NULL,
GIMP_GRADIENT_SEGMENT_STEP,
GIMP_HELP_GRADIENT_EDITOR_BLENDING },
{ "gradient-editor-blending-varies", NULL,
NC_("gradient-editor-blending", "(Varies)"), NULL, NULL,
NC_("gradient-editor-blending", "(Varies)"), NULL, { NULL }, NULL,
-1,
GIMP_HELP_GRADIENT_EDITOR_BLENDING }
};
@@ -353,22 +349,22 @@ static const GimpRadioActionEntry gradient_editor_blending_actions[] =
static const GimpRadioActionEntry gradient_editor_coloring_actions[] =
{
{ "gradient-editor-coloring-rgb", NULL,
NC_("gradient-editor-coloring", "_RGB"), NULL, NULL,
NC_("gradient-editor-coloring", "_RGB"), NULL, { NULL }, NULL,
GIMP_GRADIENT_SEGMENT_RGB,
GIMP_HELP_GRADIENT_EDITOR_COLORING },
{ "gradient-editor-coloring-hsv-ccw", NULL,
NC_("gradient-editor-coloring", "HSV (_counter-clockwise hue)"), NULL, NULL,
NC_("gradient-editor-coloring", "HSV (_counter-clockwise hue)"), NULL, { NULL }, NULL,
GIMP_GRADIENT_SEGMENT_HSV_CCW,
GIMP_HELP_GRADIENT_EDITOR_COLORING },
{ "gradient-editor-coloring-hsv-cw", NULL,
NC_("gradient-editor-coloring", "HSV (clockwise _hue)"), NULL, NULL,
NC_("gradient-editor-coloring", "HSV (clockwise _hue)"), NULL, { NULL }, NULL,
GIMP_GRADIENT_SEGMENT_HSV_CW,
GIMP_HELP_GRADIENT_EDITOR_COLORING },
{ "gradient-editor-coloring-varies", NULL,
NC_("gradient-editor-coloring", "(Varies)"), NULL, NULL,
NC_("gradient-editor-coloring", "(Varies)"), NULL, { NULL }, NULL,
-1,
GIMP_HELP_GRADIENT_EDITOR_COLORING }
};
@@ -376,19 +372,19 @@ static const GimpRadioActionEntry gradient_editor_coloring_actions[] =
static const GimpEnumActionEntry gradient_editor_zoom_actions[] =
{
{ "gradient-editor-zoom-in", GIMP_ICON_ZOOM_IN,
N_("Zoom In"), NULL,
N_("Zoom In"), NULL, { NULL },
N_("Zoom in"),
GIMP_ZOOM_IN, FALSE,
GIMP_HELP_GRADIENT_EDITOR_ZOOM_IN },
{ "gradient-editor-zoom-out", GIMP_ICON_ZOOM_OUT,
N_("Zoom Out"), NULL,
N_("Zoom Out"), NULL, { NULL },
N_("Zoom out"),
GIMP_ZOOM_OUT, FALSE,
GIMP_HELP_GRADIENT_EDITOR_ZOOM_OUT },
{ "gradient-editor-zoom-all", GIMP_ICON_ZOOM_FIT_BEST,
N_("Zoom All"), NULL,
N_("Zoom All"), NULL, { NULL },
N_("Zoom all"),
GIMP_ZOOM_OUT_MAX, FALSE,
GIMP_HELP_GRADIENT_EDITOR_ZOOM_ALL }
@@ -411,7 +407,7 @@ gradient_editor_actions_setup (GimpActionGroup *group)
G_N_ELEMENTS (gradient_editor_load_left_actions),
gradient_editor_load_left_cmd_callback);
gimp_action_group_add_enum_actions (group, "gradient-editor-action",
gimp_action_group_add_enum_actions (group, NULL,
gradient_editor_save_left_actions,
G_N_ELEMENTS (gradient_editor_save_left_actions),
gradient_editor_save_left_cmd_callback);
@@ -422,7 +418,7 @@ gradient_editor_actions_setup (GimpActionGroup *group)
gradient_editor_load_right_cmd_callback);
gimp_action_group_add_enum_actions (group, "gradient-editor-action",
gimp_action_group_add_enum_actions (group, NULL,
gradient_editor_save_right_actions,
G_N_ELEMENTS (gradient_editor_save_right_actions),
gradient_editor_save_right_cmd_callback);
@@ -465,23 +461,22 @@ void
gradient_editor_actions_update (GimpActionGroup *group,
gpointer data)
{
GimpGradientEditor *editor = GIMP_GRADIENT_EDITOR (data);
GimpDataEditor *data_editor = GIMP_DATA_EDITOR (data);
GimpGradientEditor *editor = GIMP_GRADIENT_EDITOR (data);
GimpDataEditor *data_editor = GIMP_DATA_EDITOR (data);
GimpGradient *gradient;
gboolean editable = FALSE;
GimpRGB left_color;
GimpRGB right_color;
GimpRGB left_seg_color;
GimpRGB right_seg_color;
GimpRGB fg;
GimpRGB bg;
gboolean blending_equal = TRUE;
gboolean coloring_equal = TRUE;
gboolean left_editable = TRUE;
gboolean right_editable = TRUE;
gboolean selection = FALSE;
gboolean delete = FALSE;
gboolean edit_active = FALSE;
gboolean editable = FALSE;
GeglColor *color;
GeglColor *left_color = NULL;
GeglColor *right_color = NULL;
GeglColor *left_seg_color = NULL;
GeglColor *right_seg_color = NULL;
gboolean blending_equal = TRUE;
gboolean coloring_equal = TRUE;
gboolean left_editable = TRUE;
gboolean right_editable = TRUE;
gboolean selection = FALSE;
gboolean delete = FALSE;
gboolean edit_active = FALSE;
gradient = GIMP_GRADIENT (data_editor->data);
@@ -496,35 +491,31 @@ gradient_editor_actions_update (GimpActionGroup *group,
if (data_editor->data_editable)
editable = TRUE;
gimp_gradient_segment_get_left_flat_color (gradient,
data_editor->context,
editor->control_sel_l,
&left_color);
left_color = gimp_gradient_segment_get_left_flat_color (gradient,
data_editor->context,
editor->control_sel_l);
if (editor->control_sel_l->prev)
left_seg = editor->control_sel_l->prev;
else
left_seg = gimp_gradient_segment_get_last (editor->control_sel_l);
gimp_gradient_segment_get_right_flat_color (gradient,
data_editor->context,
left_seg,
&left_seg_color);
left_seg_color = gimp_gradient_segment_get_right_flat_color (gradient,
data_editor->context,
left_seg);
gimp_gradient_segment_get_right_flat_color (gradient,
data_editor->context,
editor->control_sel_r,
&right_color);
right_color = gimp_gradient_segment_get_right_flat_color (gradient,
data_editor->context,
editor->control_sel_r);
if (editor->control_sel_r->next)
right_seg = editor->control_sel_r->next;
else
right_seg = gimp_gradient_segment_get_first (editor->control_sel_r);
gimp_gradient_segment_get_left_flat_color (gradient,
data_editor->context,
right_seg,
&right_seg_color);
right_seg_color = gimp_gradient_segment_get_left_flat_color (gradient,
data_editor->context,
right_seg);
left_editable = (editor->control_sel_l->left_color_type ==
GIMP_GRADIENT_COLOR_FIXED);
@@ -550,12 +541,6 @@ gradient_editor_actions_update (GimpActionGroup *group,
delete = (editor->control_sel_l->prev || editor->control_sel_r->next);
}
if (data_editor->context)
{
gimp_context_get_foreground (data_editor->context, &fg);
gimp_context_get_background (data_editor->context, &bg);
}
/* pretend the gradient not being editable while the dialog is
* insensitive. prevents the gradient from being modified while a
* dialog is running. bug #161411 --mitch
@@ -577,6 +562,9 @@ gradient_editor_actions_update (GimpActionGroup *group,
gimp_action_group_set_action_color (group, action, (color), (set_label))
#define SET_LABEL(action,label) \
gimp_action_group_set_action_label (group, action, (label))
#define SET_GROUP_LABEL(action,label) \
gimp_radio_action_set_group_label (GIMP_RADIO_ACTION (gimp_action_group_get_action (group, action)), \
label)
#define SET_SENSITIVE(action,condition) \
gimp_action_group_set_action_sensitive (group, action, (condition) != 0, NULL)
#define SET_VISIBLE(action,condition) \
@@ -614,23 +602,22 @@ gradient_editor_actions_update (GimpActionGroup *group,
SET_SENSITIVE ("gradient-editor-load-left-left-neighbor", editable);
SET_SENSITIVE ("gradient-editor-load-left-right-endpoint", editable);
color = gegl_color_new (NULL);
if (gradient)
{
SET_COLOR ("gradient-editor-left-color",
&left_color, FALSE);
SET_COLOR ("gradient-editor-load-left-left-neighbor",
&left_seg_color, FALSE);
SET_COLOR ("gradient-editor-load-left-right-endpoint",
&right_color, FALSE);
SET_COLOR ("gradient-editor-left-color", left_color, FALSE);
SET_COLOR ("gradient-editor-load-left-left-neighbor", left_seg_color, FALSE);
SET_COLOR ("gradient-editor-load-left-right-endpoint", right_color, FALSE);
}
SET_SENSITIVE ("gradient-editor-load-left-fg", left_editable);
SET_SENSITIVE ("gradient-editor-load-left-bg", left_editable);
SET_COLOR ("gradient-editor-load-left-fg",
data_editor->context ? &fg : NULL, FALSE);
data_editor->context ? gimp_context_get_foreground (data_editor->context) : NULL, FALSE);
SET_COLOR ("gradient-editor-load-left-bg",
data_editor->context ? &bg : NULL, FALSE);
data_editor->context ? gimp_context_get_background (data_editor->context) : NULL, FALSE);
SET_SENSITIVE ("gradient-editor-load-left-01", left_editable);
SET_SENSITIVE ("gradient-editor-load-left-02", left_editable);
@@ -643,16 +630,26 @@ gradient_editor_actions_update (GimpActionGroup *group,
SET_SENSITIVE ("gradient-editor-load-left-09", left_editable);
SET_SENSITIVE ("gradient-editor-load-left-10", left_editable);
SET_COLOR ("gradient-editor-load-left-01", &editor->saved_colors[0], TRUE);
SET_COLOR ("gradient-editor-load-left-02", &editor->saved_colors[1], TRUE);
SET_COLOR ("gradient-editor-load-left-03", &editor->saved_colors[2], TRUE);
SET_COLOR ("gradient-editor-load-left-04", &editor->saved_colors[3], TRUE);
SET_COLOR ("gradient-editor-load-left-05", &editor->saved_colors[4], TRUE);
SET_COLOR ("gradient-editor-load-left-06", &editor->saved_colors[5], TRUE);
SET_COLOR ("gradient-editor-load-left-07", &editor->saved_colors[6], TRUE);
SET_COLOR ("gradient-editor-load-left-08", &editor->saved_colors[7], TRUE);
SET_COLOR ("gradient-editor-load-left-09", &editor->saved_colors[8], TRUE);
SET_COLOR ("gradient-editor-load-left-10", &editor->saved_colors[9], TRUE);
gegl_color_set_pixel (color, babl_format ("R'G'B'A double"), &editor->saved_colors[0]);
SET_COLOR ("gradient-editor-load-left-01", color, TRUE);
gegl_color_set_pixel (color, babl_format ("R'G'B'A double"), &editor->saved_colors[1]);
SET_COLOR ("gradient-editor-load-left-02", color, TRUE);
gegl_color_set_pixel (color, babl_format ("R'G'B'A double"), &editor->saved_colors[2]);
SET_COLOR ("gradient-editor-load-left-03", color, TRUE);
gegl_color_set_pixel (color, babl_format ("R'G'B'A double"), &editor->saved_colors[3]);
SET_COLOR ("gradient-editor-load-left-04", color, TRUE);
gegl_color_set_pixel (color, babl_format ("R'G'B'A double"), &editor->saved_colors[4]);
SET_COLOR ("gradient-editor-load-left-05", color, TRUE);
gegl_color_set_pixel (color, babl_format ("R'G'B'A double"), &editor->saved_colors[5]);
SET_COLOR ("gradient-editor-load-left-06", color, TRUE);
gegl_color_set_pixel (color, babl_format ("R'G'B'A double"), &editor->saved_colors[6]);
SET_COLOR ("gradient-editor-load-left-07", color, TRUE);
gegl_color_set_pixel (color, babl_format ("R'G'B'A double"), &editor->saved_colors[7]);
SET_COLOR ("gradient-editor-load-left-08", color, TRUE);
gegl_color_set_pixel (color, babl_format ("R'G'B'A double"), &editor->saved_colors[8]);
SET_COLOR ("gradient-editor-load-left-09", color, TRUE);
gegl_color_set_pixel (color, babl_format ("R'G'B'A double"), &editor->saved_colors[9]);
SET_COLOR ("gradient-editor-load-left-10", color, TRUE);
SET_SENSITIVE ("gradient-editor-save-left-01", gradient);
SET_SENSITIVE ("gradient-editor-save-left-02", gradient);
@@ -665,16 +662,26 @@ gradient_editor_actions_update (GimpActionGroup *group,
SET_SENSITIVE ("gradient-editor-save-left-09", gradient);
SET_SENSITIVE ("gradient-editor-save-left-10", gradient);
SET_COLOR ("gradient-editor-save-left-01", &editor->saved_colors[0], TRUE);
SET_COLOR ("gradient-editor-save-left-02", &editor->saved_colors[1], TRUE);
SET_COLOR ("gradient-editor-save-left-03", &editor->saved_colors[2], TRUE);
SET_COLOR ("gradient-editor-save-left-04", &editor->saved_colors[3], TRUE);
SET_COLOR ("gradient-editor-save-left-05", &editor->saved_colors[4], TRUE);
SET_COLOR ("gradient-editor-save-left-06", &editor->saved_colors[5], TRUE);
SET_COLOR ("gradient-editor-save-left-07", &editor->saved_colors[6], TRUE);
SET_COLOR ("gradient-editor-save-left-08", &editor->saved_colors[7], TRUE);
SET_COLOR ("gradient-editor-save-left-09", &editor->saved_colors[8], TRUE);
SET_COLOR ("gradient-editor-save-left-10", &editor->saved_colors[9], TRUE);
gegl_color_set_pixel (color, babl_format ("R'G'B'A double"), &editor->saved_colors[0]);
SET_COLOR ("gradient-editor-save-left-01", color, TRUE);
gegl_color_set_pixel (color, babl_format ("R'G'B'A double"), &editor->saved_colors[1]);
SET_COLOR ("gradient-editor-save-left-02", color, TRUE);
gegl_color_set_pixel (color, babl_format ("R'G'B'A double"), &editor->saved_colors[2]);
SET_COLOR ("gradient-editor-save-left-03", color, TRUE);
gegl_color_set_pixel (color, babl_format ("R'G'B'A double"), &editor->saved_colors[3]);
SET_COLOR ("gradient-editor-save-left-04", color, TRUE);
gegl_color_set_pixel (color, babl_format ("R'G'B'A double"), &editor->saved_colors[4]);
SET_COLOR ("gradient-editor-save-left-05", color, TRUE);
gegl_color_set_pixel (color, babl_format ("R'G'B'A double"), &editor->saved_colors[5]);
SET_COLOR ("gradient-editor-save-left-06", color, TRUE);
gegl_color_set_pixel (color, babl_format ("R'G'B'A double"), &editor->saved_colors[6]);
SET_COLOR ("gradient-editor-save-left-07", color, TRUE);
gegl_color_set_pixel (color, babl_format ("R'G'B'A double"), &editor->saved_colors[7]);
SET_COLOR ("gradient-editor-save-left-08", color, TRUE);
gegl_color_set_pixel (color, babl_format ("R'G'B'A double"), &editor->saved_colors[8]);
SET_COLOR ("gradient-editor-save-left-09", color, TRUE);
gegl_color_set_pixel (color, babl_format ("R'G'B'A double"), &editor->saved_colors[9]);
SET_COLOR ("gradient-editor-save-left-10", color, TRUE);
SET_SENSITIVE ("gradient-editor-right-color-fixed", editable);
SET_SENSITIVE ("gradient-editor-right-color-foreground", editable);
@@ -710,21 +717,18 @@ gradient_editor_actions_update (GimpActionGroup *group,
if (gradient)
{
SET_COLOR ("gradient-editor-right-color",
&right_color, FALSE);
SET_COLOR ("gradient-editor-load-right-right-neighbor",
&right_seg_color, FALSE);
SET_COLOR ("gradient-editor-load-right-left-endpoint",
&left_color, FALSE);
SET_COLOR ("gradient-editor-right-color", right_color, FALSE);
SET_COLOR ("gradient-editor-load-right-right-neighbor", right_seg_color, FALSE);
SET_COLOR ("gradient-editor-load-right-left-endpoint", left_color, FALSE);
}
SET_SENSITIVE ("gradient-editor-load-right-fg", right_editable);
SET_SENSITIVE ("gradient-editor-load-right-bg", right_editable);
SET_COLOR ("gradient-editor-load-right-fg",
data_editor->context ? &fg : NULL, FALSE);
data_editor->context ? gimp_context_get_foreground (data_editor->context) : NULL, FALSE);
SET_COLOR ("gradient-editor-load-right-bg",
data_editor->context ? &bg : NULL, FALSE);
data_editor->context ? gimp_context_get_background (data_editor->context) : NULL, FALSE);
SET_SENSITIVE ("gradient-editor-load-right-01", right_editable);
SET_SENSITIVE ("gradient-editor-load-right-02", right_editable);
@@ -737,16 +741,26 @@ gradient_editor_actions_update (GimpActionGroup *group,
SET_SENSITIVE ("gradient-editor-load-right-09", right_editable);
SET_SENSITIVE ("gradient-editor-load-right-10", right_editable);
SET_COLOR ("gradient-editor-load-right-01", &editor->saved_colors[0], TRUE);
SET_COLOR ("gradient-editor-load-right-02", &editor->saved_colors[1], TRUE);
SET_COLOR ("gradient-editor-load-right-03", &editor->saved_colors[2], TRUE);
SET_COLOR ("gradient-editor-load-right-04", &editor->saved_colors[3], TRUE);
SET_COLOR ("gradient-editor-load-right-05", &editor->saved_colors[4], TRUE);
SET_COLOR ("gradient-editor-load-right-06", &editor->saved_colors[5], TRUE);
SET_COLOR ("gradient-editor-load-right-07", &editor->saved_colors[6], TRUE);
SET_COLOR ("gradient-editor-load-right-08", &editor->saved_colors[7], TRUE);
SET_COLOR ("gradient-editor-load-right-09", &editor->saved_colors[8], TRUE);
SET_COLOR ("gradient-editor-load-right-10", &editor->saved_colors[9], TRUE);
gegl_color_set_pixel (color, babl_format ("R'G'B'A double"), &editor->saved_colors[0]);
SET_COLOR ("gradient-editor-load-right-01", color, TRUE);
gegl_color_set_pixel (color, babl_format ("R'G'B'A double"), &editor->saved_colors[1]);
SET_COLOR ("gradient-editor-load-right-02", color, TRUE);
gegl_color_set_pixel (color, babl_format ("R'G'B'A double"), &editor->saved_colors[2]);
SET_COLOR ("gradient-editor-load-right-03", color, TRUE);
gegl_color_set_pixel (color, babl_format ("R'G'B'A double"), &editor->saved_colors[3]);
SET_COLOR ("gradient-editor-load-right-04", color, TRUE);
gegl_color_set_pixel (color, babl_format ("R'G'B'A double"), &editor->saved_colors[4]);
SET_COLOR ("gradient-editor-load-right-05", color, TRUE);
gegl_color_set_pixel (color, babl_format ("R'G'B'A double"), &editor->saved_colors[5]);
SET_COLOR ("gradient-editor-load-right-06", color, TRUE);
gegl_color_set_pixel (color, babl_format ("R'G'B'A double"), &editor->saved_colors[6]);
SET_COLOR ("gradient-editor-load-right-07", color, TRUE);
gegl_color_set_pixel (color, babl_format ("R'G'B'A double"), &editor->saved_colors[7]);
SET_COLOR ("gradient-editor-load-right-08", color, TRUE);
gegl_color_set_pixel (color, babl_format ("R'G'B'A double"), &editor->saved_colors[8]);
SET_COLOR ("gradient-editor-load-right-09", color, TRUE);
gegl_color_set_pixel (color, babl_format ("R'G'B'A double"), &editor->saved_colors[9]);
SET_COLOR ("gradient-editor-load-right-10", color, TRUE);
SET_SENSITIVE ("gradient-editor-save-right-01", gradient);
SET_SENSITIVE ("gradient-editor-save-right-02", gradient);
@@ -759,16 +773,26 @@ gradient_editor_actions_update (GimpActionGroup *group,
SET_SENSITIVE ("gradient-editor-save-right-09", gradient);
SET_SENSITIVE ("gradient-editor-save-right-10", gradient);
SET_COLOR ("gradient-editor-save-right-01", &editor->saved_colors[0], TRUE);
SET_COLOR ("gradient-editor-save-right-02", &editor->saved_colors[1], TRUE);
SET_COLOR ("gradient-editor-save-right-03", &editor->saved_colors[2], TRUE);
SET_COLOR ("gradient-editor-save-right-04", &editor->saved_colors[3], TRUE);
SET_COLOR ("gradient-editor-save-right-05", &editor->saved_colors[4], TRUE);
SET_COLOR ("gradient-editor-save-right-06", &editor->saved_colors[5], TRUE);
SET_COLOR ("gradient-editor-save-right-07", &editor->saved_colors[6], TRUE);
SET_COLOR ("gradient-editor-save-right-08", &editor->saved_colors[7], TRUE);
SET_COLOR ("gradient-editor-save-right-09", &editor->saved_colors[8], TRUE);
SET_COLOR ("gradient-editor-save-right-10", &editor->saved_colors[9], TRUE);
gegl_color_set_pixel (color, babl_format ("R'G'B'A double"), &editor->saved_colors[0]);
SET_COLOR ("gradient-editor-save-right-01", color, TRUE);
gegl_color_set_pixel (color, babl_format ("R'G'B'A double"), &editor->saved_colors[1]);
SET_COLOR ("gradient-editor-save-right-02", color, TRUE);
gegl_color_set_pixel (color, babl_format ("R'G'B'A double"), &editor->saved_colors[2]);
SET_COLOR ("gradient-editor-save-right-03", color, TRUE);
gegl_color_set_pixel (color, babl_format ("R'G'B'A double"), &editor->saved_colors[3]);
SET_COLOR ("gradient-editor-save-right-04", color, TRUE);
gegl_color_set_pixel (color, babl_format ("R'G'B'A double"), &editor->saved_colors[4]);
SET_COLOR ("gradient-editor-save-right-05", color, TRUE);
gegl_color_set_pixel (color, babl_format ("R'G'B'A double"), &editor->saved_colors[5]);
SET_COLOR ("gradient-editor-save-right-06", color, TRUE);
gegl_color_set_pixel (color, babl_format ("R'G'B'A double"), &editor->saved_colors[6]);
SET_COLOR ("gradient-editor-save-right-07", color, TRUE);
gegl_color_set_pixel (color, babl_format ("R'G'B'A double"), &editor->saved_colors[7]);
SET_COLOR ("gradient-editor-save-right-08", color, TRUE);
gegl_color_set_pixel (color, babl_format ("R'G'B'A double"), &editor->saved_colors[8]);
SET_COLOR ("gradient-editor-save-right-09", color, TRUE);
gegl_color_set_pixel (color, babl_format ("R'G'B'A double"), &editor->saved_colors[9]);
SET_COLOR ("gradient-editor-save-right-10", color, TRUE);
SET_SENSITIVE ("gradient-editor-flip", editable);
SET_SENSITIVE ("gradient-editor-replicate", editable);
@@ -780,10 +804,10 @@ gradient_editor_actions_update (GimpActionGroup *group,
if (! selection)
{
SET_LABEL ("gradient-editor-blending-func",
_("_Blending Function for Segment"));
SET_LABEL ("gradient-editor-coloring-type",
_("Coloring _Type for Segment"));
SET_GROUP_LABEL ("gradient-editor-blending-linear",
_("_Blending Function for Segment"));
SET_GROUP_LABEL ("gradient-editor-coloring-rgb",
_("Coloring _Type for Segment"));
SET_LABEL ("gradient-editor-flip",
_("_Flip Segment"));
@@ -802,10 +826,10 @@ gradient_editor_actions_update (GimpActionGroup *group,
}
else
{
SET_LABEL ("gradient-editor-blending-func",
_("_Blending Function for Selection"));
SET_LABEL ("gradient-editor-coloring-type",
_("Coloring _Type for Selection"));
SET_GROUP_LABEL ("gradient-editor-blending-linear",
_("_Blending Function for Selection"));
SET_GROUP_LABEL ("gradient-editor-coloring-rgb",
_("Coloring _Type for Selection"));
SET_LABEL ("gradient-editor-flip",
_("_Flip Selection"));
@@ -903,4 +927,10 @@ gradient_editor_actions_update (GimpActionGroup *group,
#undef SET_LABEL
#undef SET_SENSITIVE
#undef SET_VISIBLE
g_object_unref (color);
g_clear_object (&left_color);
g_clear_object (&right_color);
g_clear_object (&left_seg_color);
g_clear_object (&right_seg_color);
}

View File

@@ -80,18 +80,21 @@ gradient_editor_left_color_type_cmd_callback (GimpAction *action,
color_type !=
gimp_gradient_segment_get_left_color_type (gradient, left))
{
GimpRGB color;
gimp_gradient_segment_get_left_flat_color (gradient,
GIMP_DATA_EDITOR (editor)->context,
left, &color);
gimp_data_freeze (GIMP_DATA (gradient));
gimp_gradient_segment_set_left_color_type (gradient, left, color_type);
if (color_type == GIMP_GRADIENT_COLOR_FIXED)
gimp_gradient_segment_set_left_color (gradient, left, &color);
{
GeglColor *color;
color = gimp_gradient_segment_get_left_flat_color (gradient,
GIMP_DATA_EDITOR (editor)->context,
left);
gimp_gradient_segment_set_left_color (gradient, left, color);
g_object_unref (color);
}
gimp_data_thaw (GIMP_DATA (gradient));
}
@@ -108,7 +111,7 @@ gradient_editor_load_left_cmd_callback (GimpAction *action,
GimpGradientSegment *left;
GimpGradientSegment *right;
GimpGradientSegment *seg;
GimpRGB color;
GeglColor *color;
GimpGradientColor color_type = GIMP_GRADIENT_COLOR_FIXED;
gint index = g_variant_get_int32 (value);
@@ -132,11 +135,11 @@ gradient_editor_load_left_cmd_callback (GimpAction *action,
break;
case GRADIENT_EDITOR_COLOR_FOREGROUND:
gimp_context_get_foreground (data_editor->context, &color);
color = gimp_context_get_foreground (data_editor->context);
break;
case GRADIENT_EDITOR_COLOR_BACKGROUND:
gimp_context_get_background (data_editor->context, &color);
color = gimp_context_get_background (data_editor->context);
break;
default: /* Load a color */
@@ -146,10 +149,8 @@ gradient_editor_load_left_cmd_callback (GimpAction *action,
gimp_data_freeze (GIMP_DATA (gradient));
gimp_gradient_segment_range_blend (gradient, left, right,
&color,
&right->right_color,
TRUE, TRUE);
gimp_gradient_segment_range_blend (gradient, left, right, color,
right->right_color, TRUE, TRUE);
gimp_gradient_segment_set_left_color_type (gradient, left, color_type);
gimp_data_thaw (GIMP_DATA (gradient));
@@ -167,8 +168,8 @@ gradient_editor_save_left_cmd_callback (GimpAction *action,
gimp_gradient_editor_get_selection (editor, &gradient, &left, NULL);
gimp_gradient_segment_get_left_color (gradient, left,
&editor->saved_colors[index]);
g_clear_object (&editor->saved_colors[index]);
editor->saved_colors[index] = gegl_color_duplicate (gimp_gradient_segment_get_left_color (gradient, left));
}
void
@@ -200,18 +201,20 @@ gradient_editor_right_color_type_cmd_callback (GimpAction *action,
color_type !=
gimp_gradient_segment_get_right_color_type (gradient, right))
{
GimpRGB color;
gimp_gradient_segment_get_right_flat_color (gradient,
GIMP_DATA_EDITOR (editor)->context,
right, &color);
gimp_data_freeze (GIMP_DATA (gradient));
gimp_gradient_segment_set_right_color_type (gradient, right, color_type);
if (color_type == GIMP_GRADIENT_COLOR_FIXED)
gimp_gradient_segment_set_right_color (gradient, right, &color);
{
GeglColor *color;
color = gimp_gradient_segment_get_right_flat_color (gradient, GIMP_DATA_EDITOR (editor)->context,
right);
gimp_gradient_segment_set_right_color (gradient, right, color);
g_object_unref (color);
}
gimp_data_thaw (GIMP_DATA (gradient));
}
@@ -228,7 +231,7 @@ gradient_editor_load_right_cmd_callback (GimpAction *action,
GimpGradientSegment *left;
GimpGradientSegment *right;
GimpGradientSegment *seg;
GimpRGB color;
GeglColor *color;
GimpGradientColor color_type = GIMP_GRADIENT_COLOR_FIXED;
gint index = g_variant_get_int32 (value);
@@ -252,11 +255,11 @@ gradient_editor_load_right_cmd_callback (GimpAction *action,
break;
case GRADIENT_EDITOR_COLOR_FOREGROUND:
gimp_context_get_foreground (data_editor->context, &color);
color = gimp_context_get_foreground (data_editor->context);
break;
case GRADIENT_EDITOR_COLOR_BACKGROUND:
gimp_context_get_background (data_editor->context, &color);
color = gimp_context_get_background (data_editor->context);
break;
default: /* Load a color */
@@ -266,10 +269,8 @@ gradient_editor_load_right_cmd_callback (GimpAction *action,
gimp_data_freeze (GIMP_DATA (gradient));
gimp_gradient_segment_range_blend (gradient, left, right,
&left->left_color,
&color,
TRUE, TRUE);
gimp_gradient_segment_range_blend (gradient, left, right, left->left_color,
color, TRUE, TRUE);
gimp_gradient_segment_set_right_color_type (gradient, left, color_type);
gimp_data_thaw (GIMP_DATA (gradient));
@@ -287,8 +288,8 @@ gradient_editor_save_right_cmd_callback (GimpAction *action,
gimp_gradient_editor_get_selection (editor, &gradient, NULL, &right);
gimp_gradient_segment_get_right_color (gradient, right,
&editor->saved_colors[index]);
g_clear_object (&editor->saved_colors[index]);
editor->saved_colors[index] = gegl_color_duplicate (gimp_gradient_segment_get_right_color (gradient, right));
}
void
@@ -629,8 +630,8 @@ gradient_editor_blend_color_cmd_callback (GimpAction *action,
gimp_gradient_editor_get_selection (editor, &gradient, &left, &right);
gimp_gradient_segment_range_blend (gradient, left, right,
&left->left_color,
&right->right_color,
left->left_color,
right->right_color,
TRUE, FALSE);
}
@@ -647,8 +648,8 @@ gradient_editor_blend_opacity_cmd_callback (GimpAction *action,
gimp_gradient_editor_get_selection (editor, &gradient, &left, &right);
gimp_gradient_segment_range_blend (gradient, left, right,
&left->left_color,
&right->right_color,
left->left_color,
right->right_color,
FALSE, TRUE);
}

View File

@@ -40,48 +40,44 @@
static const GimpActionEntry gradients_actions[] =
{
{ "gradients-popup", GIMP_ICON_GRADIENT,
NC_("gradients-action", "Gradients Menu"), NULL, NULL, NULL,
GIMP_HELP_GRADIENT_DIALOG },
{ "gradients-new", GIMP_ICON_DOCUMENT_NEW,
NC_("gradients-action", "_New Gradient"), NULL,
NC_("gradients-action", "_New Gradient"), NULL, { NULL },
NC_("gradients-action", "Create a new gradient"),
data_new_cmd_callback,
GIMP_HELP_GRADIENT_NEW },
{ "gradients-duplicate", GIMP_ICON_OBJECT_DUPLICATE,
NC_("gradients-action", "D_uplicate Gradient"), NULL,
NC_("gradients-action", "D_uplicate Gradient"), NULL, { NULL },
NC_("gradients-action", "Duplicate this gradient"),
data_duplicate_cmd_callback,
GIMP_HELP_GRADIENT_DUPLICATE },
{ "gradients-copy-location", GIMP_ICON_EDIT_COPY,
NC_("gradients-action", "Copy Gradient _Location"), NULL,
NC_("gradients-action", "Copy Gradient _Location"), NULL, { NULL },
NC_("gradients-action", "Copy gradient file location to clipboard"),
data_copy_location_cmd_callback,
GIMP_HELP_GRADIENT_COPY_LOCATION },
{ "gradients-show-in-file-manager", GIMP_ICON_FILE_MANAGER,
NC_("gradients-action", "Show in _File Manager"), NULL,
NC_("gradients-action", "Show in _File Manager"), NULL, { NULL },
NC_("gradients-action", "Show gradient file location in the file manager"),
data_show_in_file_manager_cmd_callback,
GIMP_HELP_GRADIENT_SHOW_IN_FILE_MANAGER },
{ "gradients-save-as-pov", GIMP_ICON_DOCUMENT_SAVE_AS,
NC_("gradients-action", "Save as _POV-Ray..."), NULL,
NC_("gradients-action", "Save as _POV-Ray..."), NULL, { NULL },
NC_("gradients-action", "Save gradient as POV-Ray"),
gradients_save_as_pov_ray_cmd_callback,
GIMP_HELP_GRADIENT_SAVE_AS_POV },
{ "gradients-delete", GIMP_ICON_EDIT_DELETE,
NC_("gradients-action", "_Delete Gradient"), NULL,
NC_("gradients-action", "_Delete Gradient"), NULL, { NULL },
NC_("gradients-action", "Delete this gradient"),
data_delete_cmd_callback,
GIMP_HELP_GRADIENT_DELETE },
{ "gradients-refresh", GIMP_ICON_VIEW_REFRESH,
NC_("gradients-action", "_Refresh Gradients"), NULL,
NC_("gradients-action", "_Refresh Gradients"), NULL, { NULL },
NC_("gradients-action", "Refresh gradients"),
data_refresh_cmd_callback,
GIMP_HELP_GRADIENT_REFRESH }
@@ -90,7 +86,7 @@ static const GimpActionEntry gradients_actions[] =
static const GimpStringActionEntry gradients_edit_actions[] =
{
{ "gradients-edit", GIMP_ICON_EDIT,
NC_("gradients-action", "_Edit Gradient..."), NULL,
NC_("gradients-action", "_Edit Gradient..."), NULL, { NULL },
NC_("gradients-action", "Edit this gradient"),
"gimp-gradient-editor",
GIMP_HELP_GRADIENT_EDIT }

View File

@@ -31,6 +31,7 @@
#include "widgets/gimpcontainereditor.h"
#include "widgets/gimpcontainerview.h"
#include "widgets/gimphelp-ids.h"
#include "widgets/gimpwidgets-utils.h"
#include "dialogs/dialogs.h"
@@ -85,9 +86,9 @@ gradients_save_as_pov_ray_cmd_callback (GimpAction *action,
gtk_dialog_set_default_response (GTK_DIALOG (dialog), GTK_RESPONSE_OK);
gimp_dialog_set_alternative_button_order (GTK_DIALOG (dialog),
GTK_RESPONSE_OK,
GTK_RESPONSE_CANCEL,
-1);
GTK_RESPONSE_OK,
GTK_RESPONSE_CANCEL,
-1);
g_object_set_data (G_OBJECT (dialog), "gimp", context->gimp);
@@ -119,6 +120,10 @@ gradients_save_as_pov_ray_cmd_callback (GimpAction *action,
}
gtk_window_present (GTK_WINDOW (dialog));
#ifdef G_OS_WIN32
gimp_window_set_title_bar_theme (context->gimp, dialog, FALSE);
#endif
}

View File

@@ -35,16 +35,14 @@
static const GimpActionEntry help_actions[] =
{
{ "help-menu", NULL, NC_("help-action", "_Help") },
{ "help-help", "gimp-prefs-help-system",
NC_("help-action", "_Help"), "F1",
NC_("help-action", "_Help"), NULL, { "F1", NULL },
NC_("help-action", "Open the GIMP user manual"),
help_help_cmd_callback,
GIMP_HELP_HELP },
{ "help-context-help", "gimp-prefs-help-system",
NC_("help-action", "_Context Help"), "<shift>F1",
NC_("help-action", "_Context Help"), NULL, { "<shift>F1", NULL },
NC_("help-action", "Show the help for a specific user interface item"),
help_context_help_cmd_callback,
GIMP_HELP_HELP_CONTEXT }

View File

@@ -51,138 +51,110 @@
static const GimpActionEntry image_actions[] =
{
{ "image-menubar", NULL,
NC_("image-action", "Image Menu"), NULL, NULL, NULL,
GIMP_HELP_IMAGE_WINDOW },
{ "image-popup", NULL,
NC_("image-action", "Image Menu"), NULL, NULL, NULL,
GIMP_HELP_IMAGE_WINDOW },
{ "image-menu", NULL, NC_("image-action", "_Image") },
{ "image-mode-menu", NULL, NC_("image-action", "_Mode") },
{ "image-precision-menu", NULL, NC_("image-action", "_Encoding") },
{ "image-color-management-menu", NULL, NC_("image-action",
"Color Ma_nagement") },
{ "image-transform-menu", NULL, NC_("image-action", "_Transform") },
{ "image-guides-menu", NULL, NC_("image-action", "_Guides") },
{ "image-metadata-menu", NULL, NC_("image-action", "Meta_data") },
{ "colors-menu", NULL, NC_("image-action", "_Colors") },
{ "colors-info-menu", NULL, NC_("image-action", "I_nfo") },
{ "colors-auto-menu", NULL, NC_("image-action", "_Auto") },
{ "colors-map-menu", NULL, NC_("image-action", "_Map") },
{ "colors-tone-mapping-menu", NULL, NC_("image-action", "_Tone Mapping") },
{ "colors-components-menu", NULL, NC_("image-action", "C_omponents") },
{ "colors-desaturate-menu", NULL, NC_("image-action", "D_esaturate") },
{ "image-new", GIMP_ICON_DOCUMENT_NEW,
NC_("image-action", "_New..."), "<primary>N",
NC_("image-action", "_New..."), NULL, { "<primary>N", NULL },
NC_("image-action", "Create a new image"),
image_new_cmd_callback,
GIMP_HELP_FILE_NEW },
{ "image-duplicate", GIMP_ICON_OBJECT_DUPLICATE,
NC_("image-action", "_Duplicate"), "<primary>D",
NC_("image-action", "_Duplicate"), NULL, { "<primary>D", NULL },
NC_("image-action", "Create a duplicate of this image"),
image_duplicate_cmd_callback,
GIMP_HELP_IMAGE_DUPLICATE },
{ "image-color-profile-assign", NULL,
NC_("image-action", "_Assign Color Profile..."), NULL,
NC_("image-action", "_Assign Color Profile..."), NULL, { NULL },
NC_("image-action", "Set a color profile on the image"),
image_color_profile_assign_cmd_callback,
GIMP_HELP_IMAGE_COLOR_PROFILE_ASSIGN },
{ "image-color-profile-convert", NULL,
NC_("image-action", "_Convert to Color Profile..."), NULL,
NC_("image-action", "_Convert to Color Profile..."), NULL, { NULL },
NC_("image-action", "Apply a color profile to the image"),
image_color_profile_convert_cmd_callback,
GIMP_HELP_IMAGE_COLOR_PROFILE_CONVERT },
{ "image-color-profile-discard", NULL,
NC_("image-action", "_Discard Color Profile"), NULL,
NC_("image-action", "_Discard Color Profile"), NULL, { NULL },
NC_("image-action", "Remove the image's color profile"),
image_color_profile_discard_cmd_callback,
GIMP_HELP_IMAGE_COLOR_PROFILE_DISCARD },
{ "image-softproof-profile", NULL,
NC_("image-action", "_Softproof Profile..."), NULL,
NC_("image-action", "Set the softproofing profile"),
NC_("image-action", "_Soft-proof Profile..."), NULL, { NULL },
NC_("image-action", "Set the soft-proofing profile"),
image_softproof_profile_cmd_callback,
GIMP_HELP_VIEW_COLOR_MANAGEMENT },
{ "image-color-profile-save", NULL,
NC_("image-action", "_Save Color Profile to File..."), NULL,
NC_("image-action", "_Save Color Profile to File..."), NULL, { NULL },
NC_("image-action", "Save the image's color profile to an ICC file"),
image_color_profile_save_cmd_callback,
GIMP_HELP_IMAGE_COLOR_PROFILE_SAVE },
{ "image-softproof-intent-menu", NULL,
NC_("image-action", "Soft-Proofing Re_ndering Intent") },
{ "image-resize", GIMP_ICON_OBJECT_RESIZE,
NC_("image-action", "Can_vas Size..."), NULL,
NC_("image-action", "Can_vas Size..."), NULL, { NULL },
NC_("image-action", "Adjust the image dimensions"),
image_resize_cmd_callback,
GIMP_HELP_IMAGE_RESIZE },
{ "image-resize-to-layers", NULL,
NC_("image-action", "Fit Canvas to L_ayers"), NULL,
NC_("image-action", "Fit Canvas to L_ayers"), NULL, { NULL },
NC_("image-action", "Resize the image to enclose all layers"),
image_resize_to_layers_cmd_callback,
GIMP_HELP_IMAGE_RESIZE_TO_LAYERS },
{ "image-resize-to-selection", NULL,
NC_("image-action", "F_it Canvas to Selection"), NULL,
NC_("image-action", "F_it Canvas to Selection"), NULL, { NULL },
NC_("image-action", "Resize the image to the extents of the selection"),
image_resize_to_selection_cmd_callback,
GIMP_HELP_IMAGE_RESIZE_TO_SELECTION },
{ "image-print-size", GIMP_ICON_DOCUMENT_PRINT_RESOLUTION,
NC_("image-action", "_Print Size..."), NULL,
NC_("image-action", "_Print Size..."), NULL, { NULL },
NC_("image-action", "Adjust the print resolution"),
image_print_size_cmd_callback,
GIMP_HELP_IMAGE_PRINT_SIZE },
{ "image-scale", GIMP_ICON_OBJECT_SCALE,
NC_("image-action", "_Scale Image..."), NULL,
NC_("image-action", "_Scale Image..."), NULL, { NULL },
NC_("image-action", "Change the size of the image content"),
image_scale_cmd_callback,
GIMP_HELP_IMAGE_SCALE },
{ "image-crop-to-selection", GIMP_ICON_TOOL_CROP,
NC_("image-action", "_Crop to Selection"), NULL,
NC_("image-action", "_Crop to Selection"), NULL, { NULL },
NC_("image-action", "Crop the image to the extents of the selection"),
image_crop_to_selection_cmd_callback,
GIMP_HELP_IMAGE_CROP },
{ "image-crop-to-content", GIMP_ICON_TOOL_CROP,
NC_("image-action", "Crop to C_ontent"), NULL,
NC_("image-action", "Crop to C_ontent"), NULL, { NULL },
NC_("image-action", "Crop the image to the extents of its content (remove empty borders from the image)"),
image_crop_to_content_cmd_callback,
GIMP_HELP_IMAGE_CROP },
{ "image-merge-layers", NULL,
NC_("image-action", "Merge Visible _Layers..."), "<primary>M",
NC_("image-action", "Merge Visible _Layers..."), NULL, { "<primary>M", NULL },
NC_("image-action", "Merge all visible layers into one layer"),
image_merge_layers_cmd_callback,
GIMP_HELP_IMAGE_MERGE_LAYERS },
{ "image-flatten", NULL,
NC_("image-action", "_Flatten Image"), NULL,
NC_("image-action", "_Flatten Image"), NULL, { NULL },
NC_("image-action", "Merge all layers into one and remove transparency"),
image_flatten_image_cmd_callback,
GIMP_HELP_IMAGE_FLATTEN },
{ "image-configure-grid", GIMP_ICON_GRID,
NC_("image-action", "Configure G_rid..."), NULL,
NC_("image-action", "Configure G_rid..."), NULL, { NULL },
NC_("image-action", "Configure the grid for this image"),
image_configure_grid_cmd_callback,
GIMP_HELP_IMAGE_GRID },
{ "image-properties", "dialog-information",
NC_("image-action", "Image Pr_operties"), "<alt>Return",
NC_("image-action", "Image Pr_operties"), NULL, { "<alt>Return", NULL },
NC_("image-action", "Display information about this image"),
image_properties_cmd_callback,
GIMP_HELP_IMAGE_PROPERTIES }
@@ -191,7 +163,7 @@ static const GimpActionEntry image_actions[] =
static const GimpToggleActionEntry image_toggle_actions[] =
{
{ "image-color-profile-use-srgb", NULL,
NC_("image-action", "Use _sRGB Profile"), NULL,
NC_("image-action", "Use _sRGB Profile"), NULL, { NULL },
NC_("image-action", "Temporarily use an sRGB profile for the image. "
"This is the same as discarding the image's color profile, but "
"allows to easily restore the profile."),
@@ -200,7 +172,7 @@ static const GimpToggleActionEntry image_toggle_actions[] =
GIMP_HELP_IMAGE_COLOR_PROFILE_USE_SRGB },
{ "image-softproof-black-point-compensation", NULL,
NC_("image-action", "_Black Point Compensation"), NULL,
NC_("image-action", "_Black Point Compensation"), NULL, { NULL },
NC_("image-action", "Use black point compensation for soft-proofing"),
image_softproof_bpc_cmd_callback,
TRUE,
@@ -210,17 +182,17 @@ static const GimpToggleActionEntry image_toggle_actions[] =
static const GimpRadioActionEntry image_convert_base_type_actions[] =
{
{ "image-convert-rgb", GIMP_ICON_CONVERT_RGB,
NC_("image-convert-action", "_RGB"), NULL,
NC_("image-convert-action", "_RGB"), NULL, { NULL },
NC_("image-convert-action", "Convert the image to the RGB colorspace"),
GIMP_RGB, GIMP_HELP_IMAGE_CONVERT_RGB },
{ "image-convert-grayscale", GIMP_ICON_CONVERT_GRAYSCALE,
NC_("image-convert-action", "_Grayscale"), NULL,
NC_("image-convert-action", "_Grayscale"), NULL, { NULL },
NC_("image-convert-action", "Convert the image to grayscale"),
GIMP_GRAY, GIMP_HELP_IMAGE_CONVERT_GRAYSCALE },
{ "image-convert-indexed", GIMP_ICON_CONVERT_INDEXED,
NC_("image-convert-action", "_Indexed..."), NULL,
NC_("image-convert-action", "_Indexed..."), NULL, { NULL },
NC_("image-convert-action", "Convert the image to indexed colors"),
GIMP_INDEXED, GIMP_HELP_IMAGE_CONVERT_INDEXED }
};
@@ -228,58 +200,58 @@ static const GimpRadioActionEntry image_convert_base_type_actions[] =
static const GimpRadioActionEntry image_convert_precision_actions[] =
{
{ "image-convert-u8", NULL,
NC_("image-convert-action", "8 bit integer"), NULL,
NC_("image-convert-action", "8-bit integer"), NULL, { NULL },
NC_("image-convert-action",
"Convert the image to 8 bit integer"),
"Convert the image to 8-bit integer"),
GIMP_COMPONENT_TYPE_U8, GIMP_HELP_IMAGE_CONVERT_U8 },
{ "image-convert-u16", NULL,
NC_("image-convert-action", "16 bit integer"), NULL,
NC_("image-convert-action", "16-bit integer"), NULL, { NULL },
NC_("image-convert-action",
"Convert the image to 16 bit integer"),
"Convert the image to 16-bit integer"),
GIMP_COMPONENT_TYPE_U16, GIMP_HELP_IMAGE_CONVERT_U16 },
{ "image-convert-u32", NULL,
NC_("image-convert-action", "32 bit integer"), NULL,
NC_("image-convert-action", "32-bit integer"), NULL, { NULL },
NC_("image-convert-action",
"Convert the image to 32 bit integer"),
"Convert the image to 32-bit integer"),
GIMP_COMPONENT_TYPE_U32, GIMP_HELP_IMAGE_CONVERT_U32 },
{ "image-convert-half", NULL,
NC_("image-convert-action", "16 bit floating point"), NULL,
NC_("image-convert-action", "16-bit floating point"), NULL, { NULL },
NC_("image-convert-action",
"Convert the image to 16 bit floating point"),
"Convert the image to 16-bit floating point"),
GIMP_COMPONENT_TYPE_HALF, GIMP_HELP_IMAGE_CONVERT_HALF },
{ "image-convert-float", NULL,
NC_("image-convert-action", "32 bit floating point"), NULL,
NC_("image-convert-action", "32-bit floating point"), NULL, { NULL },
NC_("image-convert-action",
"Convert the image to 32 bit floating point"),
"Convert the image to 32-bit floating point"),
GIMP_COMPONENT_TYPE_FLOAT, GIMP_HELP_IMAGE_CONVERT_FLOAT },
{ "image-convert-double", NULL,
NC_("image-convert-action", "64 bit floating point"), NULL,
NC_("image-convert-action", "64-bit floating point"), NULL, { NULL },
NC_("image-convert-action",
"Convert the image to 64 bit floating point"),
"Convert the image to 64-bit floating point"),
GIMP_COMPONENT_TYPE_DOUBLE, GIMP_HELP_IMAGE_CONVERT_DOUBLE }
};
static const GimpRadioActionEntry image_convert_trc_actions[] =
{
{ "image-convert-linear", NULL,
NC_("image-convert-action", "Linear light"), NULL,
NC_("image-convert-action", "Linear light"), NULL, { NULL },
NC_("image-convert-action",
"Convert the image to linear light"),
GIMP_TRC_LINEAR, GIMP_HELP_IMAGE_CONVERT_GAMMA },
{ "image-convert-non-linear", NULL,
NC_("image-convert-action", "Non-Linear"), NULL,
NC_("image-convert-action", "Non-Linear"), NULL, { NULL },
NC_("image-convert-action",
"Convert the image to non-linear gamma from the color profile"),
GIMP_TRC_NON_LINEAR, GIMP_HELP_IMAGE_CONVERT_GAMMA },
{ "image-convert-perceptual", NULL,
NC_("image-convert-action", "Perceptual (sRGB)"), NULL,
NC_("image-convert-action", "Perceptual (sRGB)"), NULL, { NULL },
NC_("image-convert-action",
"Convert the image to perceptual (sRGB) gamma"),
GIMP_TRC_PERCEPTUAL, GIMP_HELP_IMAGE_CONVERT_GAMMA }
@@ -288,13 +260,13 @@ static const GimpRadioActionEntry image_convert_trc_actions[] =
static const GimpEnumActionEntry image_flip_actions[] =
{
{ "image-flip-horizontal", GIMP_ICON_OBJECT_FLIP_HORIZONTAL,
NC_("image-action", "Flip _Horizontally"), NULL,
NC_("image-action", "Flip _Horizontally"), NULL, { NULL },
NC_("image-action", "Flip image horizontally"),
GIMP_ORIENTATION_HORIZONTAL, FALSE,
GIMP_HELP_IMAGE_FLIP_HORIZONTAL },
{ "image-flip-vertical", GIMP_ICON_OBJECT_FLIP_VERTICAL,
NC_("image-action", "Flip _Vertically"), NULL,
NC_("image-action", "Flip _Vertically"), NULL, { NULL },
NC_("image-action", "Flip image vertically"),
GIMP_ORIENTATION_VERTICAL, FALSE,
GIMP_HELP_IMAGE_FLIP_VERTICAL }
@@ -303,46 +275,46 @@ static const GimpEnumActionEntry image_flip_actions[] =
static const GimpEnumActionEntry image_rotate_actions[] =
{
{ "image-rotate-90", GIMP_ICON_OBJECT_ROTATE_90,
NC_("image-action", "Rotate 90° _clockwise"), NULL,
NC_("image-action", "Rotate 90° _clockwise"), NULL, { NULL },
NC_("image-action", "Rotate the image 90 degrees to the right"),
GIMP_ROTATE_90, FALSE,
GIMP_ROTATE_DEGREES90, FALSE,
GIMP_HELP_IMAGE_ROTATE_90 },
{ "image-rotate-180", GIMP_ICON_OBJECT_ROTATE_180,
NC_("image-action", "Rotate _180°"), NULL,
NC_("image-action", "Rotate _180°"), NULL, { NULL },
NC_("image-action", "Turn the image upside-down"),
GIMP_ROTATE_180, FALSE,
GIMP_ROTATE_DEGREES180, FALSE,
GIMP_HELP_IMAGE_ROTATE_180 },
{ "image-rotate-270", GIMP_ICON_OBJECT_ROTATE_270,
NC_("image-action", "Rotate 90° counter-clock_wise"), NULL,
NC_("image-action", "Rotate 90° counter-clock_wise"), NULL, { NULL },
NC_("image-action", "Rotate the image 90 degrees to the left"),
GIMP_ROTATE_270, FALSE,
GIMP_ROTATE_DEGREES270, FALSE,
GIMP_HELP_IMAGE_ROTATE_270 }
};
static const GimpRadioActionEntry image_softproof_intent_actions[] =
{
{ "image-softproof-intent-perceptual", NULL,
NC_("image-action", "_Perceptual"), NULL,
NC_("image-action", "_Perceptual"), NULL, { NULL },
NC_("image-action", "Soft-proofing rendering intent is perceptual"),
GIMP_COLOR_RENDERING_INTENT_PERCEPTUAL,
GIMP_HELP_VIEW_COLOR_MANAGEMENT },
{ "image-softproof-intent-relative-colorimetric", NULL,
NC_("image-action", "_Relative Colorimetric"), NULL,
NC_("image-action", "_Relative Colorimetric"), NULL, { NULL },
NC_("image-action", "Soft-proofing rendering intent is relative colorimetric"),
GIMP_COLOR_RENDERING_INTENT_RELATIVE_COLORIMETRIC,
GIMP_HELP_VIEW_COLOR_MANAGEMENT },
{ "image-softproof-intent-saturation", NULL,
NC_("image-action", "_Saturation"), NULL,
NC_("image-action", "_Saturation"), NULL, { NULL },
NC_("image-action", "Soft-proofing rendering intent is saturation"),
GIMP_COLOR_RENDERING_INTENT_SATURATION,
GIMP_HELP_VIEW_COLOR_MANAGEMENT },
{ "image-softproof-intent-absolute-colorimetric", NULL,
NC_("image-action", "_Absolute Colorimetric"), NULL,
NC_("image-action", "_Absolute Colorimetric"), NULL, { NULL },
NC_("image-action", "Soft-proofing rendering intent is absolute colorimetric"),
GIMP_COLOR_RENDERING_INTENT_ABSOLUTE_COLORIMETRIC,
GIMP_HELP_VIEW_COLOR_MANAGEMENT }

View File

@@ -1177,15 +1177,7 @@ image_convert_indexed_callback (GtkWidget *dialog,
"image-convert-indexed-dither-text-layers", dither_text_layers,
NULL);
if (image_convert_indexed_custom_palette)
g_object_remove_weak_pointer (G_OBJECT (image_convert_indexed_custom_palette),
(gpointer) &image_convert_indexed_custom_palette);
image_convert_indexed_custom_palette = custom_palette;
if (image_convert_indexed_custom_palette)
g_object_add_weak_pointer (G_OBJECT (image_convert_indexed_custom_palette),
(gpointer) &image_convert_indexed_custom_palette);
g_set_weak_pointer (&image_convert_indexed_custom_palette, custom_palette);
progress = gimp_progress_start (GIMP_PROGRESS (display), FALSE,
_("Converting to indexed colors"));

View File

@@ -39,24 +39,20 @@
static const GimpActionEntry images_actions[] =
{
{ "images-popup", GIMP_ICON_DIALOG_IMAGES,
NC_("images-action", "Images Menu"), NULL, NULL, NULL,
GIMP_HELP_IMAGE_DIALOG },
{ "images-raise-views", GIMP_ICON_GO_TOP,
NC_("images-action", "_Raise Views"), NULL,
NC_("images-action", "_Raise Views"), NULL, { NULL },
NC_("images-action", "Raise this image's displays"),
images_raise_views_cmd_callback,
NULL },
{ "images-new-view", GIMP_ICON_DOCUMENT_NEW,
NC_("images-action", "_New View"), NULL,
NC_("images-action", "_New View"), NULL, { NULL },
NC_("images-action", "Create a new display for this image"),
images_new_view_cmd_callback,
NULL },
{ "images-delete", GIMP_ICON_EDIT_DELETE,
NC_("images-action", "_Delete Image"), NULL,
NC_("images-action", "_Delete Image"), NULL, { NULL },
NC_("images-action", "Delete this image"),
images_delete_image_cmd_callback,
NULL }

View File

@@ -55,13 +55,14 @@ items_actions_setup (GimpActionGroup *group,
}
else
{
GimpRGB color;
GeglColor *color;
GimpRGB rgb;
gimp_action_group_set_action_context (group, action,
gimp_get_user_context (group->gimp));
gimp_get_color_tag_color (value->value, &color, FALSE);
gimp_action_group_set_action_color (group, action, &color, FALSE);
gimp_get_color_tag_color (value->value, &rgb, FALSE);
color = gegl_color_new (NULL);
gegl_color_set_pixel (color, babl_format ("R'G'B'A double"), &rgb);
gimp_action_group_set_action_color (group, action, color, FALSE);
g_object_unref (color);
}
}
@@ -122,8 +123,6 @@ items_actions_update (GimpActionGroup *group,
gimp_action_group_set_action_sensitive (group, action, (condition) != 0, NULL)
#define SET_ACTIVE(action,condition) \
gimp_action_group_set_action_active (group, action, (condition) != 0)
#define SET_COLOR(action,color) \
gimp_action_group_set_action_color (group, action, color, FALSE)
g_snprintf (action, sizeof (action), "%s-visible", prefix);
SET_SENSITIVE (action, items);
@@ -137,9 +136,6 @@ items_actions_update (GimpActionGroup *group,
SET_SENSITIVE (action, can_lock_position);
SET_ACTIVE (action, lock_position);
g_snprintf (action, sizeof (action), "%s-color-tag-menu", prefix);
SET_COLOR (action, has_color_tag ? &tag_color : NULL);
enum_class = g_type_class_ref (GIMP_TYPE_COLOR_TAG);
for (value = enum_class->values; value->value_name; value++)
@@ -154,5 +150,4 @@ items_actions_update (GimpActionGroup *group,
#undef SET_SENSITIVE
#undef SET_ACTIVE
#undef SET_COLOR
}

View File

@@ -46,13 +46,13 @@
/* local function prototypes */
static void items_fill_callback (GtkWidget *dialog,
GimpItem *item,
GList *items,
GList *drawables,
GimpContext *context,
GimpFillOptions *options,
gpointer user_data);
static void items_stroke_callback (GtkWidget *dialog,
GimpItem *item,
GList *items,
GList *drawables,
GimpContext *context,
GimpStrokeOptions *options,
@@ -65,102 +65,198 @@ void
items_visible_cmd_callback (GimpAction *action,
GVariant *value,
GimpImage *image,
GimpItem *item)
GList *items)
{
gboolean visible = g_variant_get_boolean (value);
GimpUndo *undo;
gboolean push_undo = TRUE;
GList *start = NULL;
GList *iter;
gboolean visible = g_variant_get_boolean (value);
gint n_items = 0;
if (visible != gimp_item_get_visible (item))
for (iter = items; iter; iter = iter->next)
{
GimpUndo *undo;
gboolean push_undo = TRUE;
if (visible && gimp_item_get_visible (iter->data))
{
/* If any of the items are already visible, we don't
* toggle the selection visibility.
*/
return;
}
}
for (iter = items; iter; iter = iter->next)
if (visible != gimp_item_get_visible (iter->data))
{
if (start == NULL)
start = iter;
n_items++;
}
if (n_items == 0)
{
return;
}
else if (n_items == 1)
{
undo = gimp_image_undo_can_compress (image, GIMP_TYPE_ITEM_UNDO,
GIMP_UNDO_ITEM_VISIBILITY);
if (undo && GIMP_ITEM_UNDO (undo)->item == item)
if (undo && GIMP_ITEM_UNDO (undo)->item == GIMP_ITEM (start->data))
push_undo = FALSE;
gimp_item_set_visible (item, visible, push_undo);
gimp_image_flush (image);
}
else
{
/* TODO: undo groups cannot be compressed so far. */
gimp_image_undo_group_start (image,
GIMP_UNDO_GROUP_ITEM_VISIBILITY,
"Item visibility");
}
for (iter = start; iter; iter = iter->next)
if (visible != gimp_item_get_visible (iter->data))
gimp_item_set_visible (iter->data, visible, push_undo);
if (n_items != 1)
gimp_image_undo_group_end (image);
gimp_image_flush (image);
}
void
items_lock_content_cmd_callback (GimpAction *action,
GVariant *value,
GimpImage *image,
GimpItem *item)
GList *items)
{
gboolean locked = g_variant_get_boolean (value);
GList *locked_items = NULL;
GList *iter;
gchar *undo_label;
gboolean locked = g_variant_get_boolean (value);
if (locked != gimp_item_get_lock_content (item))
{
GimpUndo *undo;
gboolean push_undo = TRUE;
for (iter = items; iter; iter = iter->next)
if (gimp_item_can_lock_content (iter->data))
{
if (! locked && ! gimp_item_get_lock_content (iter->data))
{
/* When unlocking, we expect all selected items to be locked. */
g_list_free (locked_items);
return;
}
else if (locked != gimp_item_get_lock_content (iter->data))
{
locked_items = g_list_prepend (locked_items, iter->data);
}
}
undo = gimp_image_undo_can_compress (image, GIMP_TYPE_ITEM_UNDO,
GIMP_UNDO_ITEM_LOCK_CONTENT);
if (! locked_items)
return;
if (undo && GIMP_ITEM_UNDO (undo)->item == item)
push_undo = FALSE;
if (locked)
undo_label = _("Lock content");
else
undo_label = _("Unlock content");
gimp_item_set_lock_content (item, locked, push_undo);
gimp_image_flush (image);
}
gimp_image_undo_group_start (image,
GIMP_UNDO_GROUP_ITEM_LOCK_CONTENTS,
undo_label);
for (iter = locked_items; iter; iter = iter->next)
gimp_item_set_lock_content (iter->data, locked, TRUE);
gimp_image_flush (image);
gimp_image_undo_group_end (image);
g_list_free (locked_items);
}
void
items_lock_position_cmd_callback (GimpAction *action,
GVariant *value,
GimpImage *image,
GimpItem *item)
GList *items)
{
gboolean locked = g_variant_get_boolean (value);
GList *iter;
GList *locked_items = NULL;
gchar *undo_label;
gboolean locked = g_variant_get_boolean (value);
if (locked != gimp_item_get_lock_position (item))
{
GimpUndo *undo;
gboolean push_undo = TRUE;
for (iter = items; iter; iter = iter->next)
if (gimp_item_can_lock_position (iter->data))
{
if (! locked && ! gimp_item_get_lock_position (iter->data))
{
/* When unlocking, we expect all selected items to be locked. */
g_list_free (locked_items);
return;
}
else if (locked != gimp_item_get_lock_position (iter->data))
{
locked_items = g_list_prepend (locked_items, iter->data);
}
}
undo = gimp_image_undo_can_compress (image, GIMP_TYPE_ITEM_UNDO,
GIMP_UNDO_ITEM_LOCK_POSITION);
if (! locked_items)
return;
if (undo && GIMP_ITEM_UNDO (undo)->item == item)
push_undo = FALSE;
if (locked)
undo_label = _("Lock position");
else
undo_label = _("Unlock position");
gimp_image_undo_group_start (image,
GIMP_UNDO_GROUP_ITEM_LOCK_POSITION,
undo_label);
gimp_item_set_lock_position (item, locked, push_undo);
gimp_image_flush (image);
}
for (iter = locked_items; iter; iter = iter->next)
gimp_item_set_lock_position (iter->data, locked, TRUE);
gimp_image_flush (image);
gimp_image_undo_group_end (image);
g_list_free (locked_items);
}
void
items_color_tag_cmd_callback (GimpAction *action,
GimpImage *image,
GimpItem *item,
GList *items,
GimpColorTag color_tag)
{
if (color_tag != gimp_item_get_color_tag (item))
{
GimpUndo *undo;
gboolean push_undo = TRUE;
GimpUndo *undo;
gboolean push_undo = TRUE;
GList *iter;
if (g_list_length (items) == 1)
{
undo = gimp_image_undo_can_compress (image, GIMP_TYPE_ITEM_UNDO,
GIMP_UNDO_ITEM_COLOR_TAG);
if (undo && GIMP_ITEM_UNDO (undo)->item == item)
if (undo && GIMP_ITEM_UNDO (undo)->item == GIMP_ITEM (items->data))
push_undo = FALSE;
gimp_item_set_color_tag (item, color_tag, push_undo);
gimp_image_flush (image);
}
else
{
/* TODO: undo groups cannot be compressed so far. */
gimp_image_undo_group_start (image,
GIMP_UNDO_GROUP_ITEM_PROPERTIES,
"Item color tag");
}
for (iter = items; iter; iter = iter->next)
if (color_tag != gimp_item_get_color_tag (iter->data))
gimp_item_set_color_tag (iter->data, color_tag, push_undo);
if (g_list_length (items) != 1)
gimp_image_undo_group_end (image);
gimp_image_flush (image);
}
void
items_fill_cmd_callback (GimpAction *action,
GimpImage *image,
GimpItem *item,
const gchar *dialog_key,
GList *items,
const gchar *dialog_title,
const gchar *dialog_icon_name,
const gchar *dialog_help_id,
@@ -177,29 +273,20 @@ items_fill_cmd_callback (GimpAction *action,
{
gimp_message_literal (image->gimp,
G_OBJECT (widget), GIMP_MESSAGE_WARNING,
_("There are no selected layers or channels to fill."));
_("There are no selected items to fill."));
return;
}
dialog = dialogs_get_dialog (G_OBJECT (item), dialog_key);
if (! dialog)
{
GimpDialogConfig *config = GIMP_DIALOG_CONFIG (image->gimp->config);
dialog = fill_dialog_new (item,
drawables,
action_data_get_context (data),
dialog_title,
dialog_icon_name,
dialog_help_id,
widget,
config->fill_options,
items_fill_callback,
NULL);
dialogs_attach_dialog (G_OBJECT (item), dialog_key, dialog);
}
dialog = fill_dialog_new (items,
drawables,
action_data_get_context (data),
dialog_title,
dialog_icon_name,
dialog_help_id,
widget,
GIMP_DIALOG_CONFIG (image->gimp->config)->fill_options,
items_fill_callback,
NULL);
gtk_window_present (GTK_WINDOW (dialog));
g_list_free (drawables);
@@ -208,7 +295,7 @@ items_fill_cmd_callback (GimpAction *action,
void
items_fill_last_vals_cmd_callback (GimpAction *action,
GimpImage *image,
GimpItem *item,
GList *items,
gpointer data)
{
GList *drawables;
@@ -229,25 +316,29 @@ items_fill_last_vals_cmd_callback (GimpAction *action,
config = GIMP_DIALOG_CONFIG (image->gimp->config);
if (! gimp_item_fill (item, drawables,
config->fill_options, TRUE, NULL, &error))
{
gimp_message_literal (image->gimp, G_OBJECT (widget),
GIMP_MESSAGE_WARNING, error->message);
g_clear_error (&error);
}
else
{
gimp_image_flush (image);
}
gimp_image_undo_group_start (image,
GIMP_UNDO_GROUP_DRAWABLE_MOD,
"Fill");
for (GList *iter = items; iter; iter = iter->next)
if (! gimp_item_fill (iter->data, drawables,
config->fill_options, TRUE, NULL, &error))
{
gimp_message_literal (image->gimp, G_OBJECT (widget),
GIMP_MESSAGE_WARNING, error->message);
g_clear_error (&error);
break;
}
gimp_image_undo_group_end (image);
gimp_image_flush (image);
g_list_free (drawables);
}
void
items_stroke_cmd_callback (GimpAction *action,
GimpImage *image,
GimpItem *item,
const gchar *dialog_key,
GList *items,
const gchar *dialog_title,
const gchar *dialog_icon_name,
const gchar *dialog_help_id,
@@ -268,25 +359,17 @@ items_stroke_cmd_callback (GimpAction *action,
return;
}
dialog = dialogs_get_dialog (G_OBJECT (item), dialog_key);
if (! dialog)
{
GimpDialogConfig *config = GIMP_DIALOG_CONFIG (image->gimp->config);
dialog = stroke_dialog_new (item,
drawables,
action_data_get_context (data),
dialog_title,
dialog_icon_name,
dialog_help_id,
widget,
config->stroke_options,
items_stroke_callback,
NULL);
dialogs_attach_dialog (G_OBJECT (item), dialog_key, dialog);
}
dialog = stroke_dialog_new (items,
drawables,
action_data_get_context (data),
dialog_title,
dialog_icon_name,
dialog_help_id,
widget,
GIMP_DIALOG_CONFIG (image->gimp->config)->stroke_options,
items_stroke_callback,
NULL);
gtk_window_present (GTK_WINDOW (dialog));
g_list_free (drawables);
@@ -295,7 +378,7 @@ items_stroke_cmd_callback (GimpAction *action,
void
items_stroke_last_vals_cmd_callback (GimpAction *action,
GimpImage *image,
GimpItem *item,
GList *items,
gpointer data)
{
GList *drawables;
@@ -316,20 +399,24 @@ items_stroke_last_vals_cmd_callback (GimpAction *action,
config = GIMP_DIALOG_CONFIG (image->gimp->config);
if (! gimp_item_stroke (item, drawables,
action_data_get_context (data),
config->stroke_options, NULL,
TRUE, NULL, &error))
{
gimp_message_literal (image->gimp, G_OBJECT (widget),
GIMP_MESSAGE_WARNING, error->message);
g_clear_error (&error);
}
else
{
gimp_image_flush (image);
}
gimp_image_undo_group_start (image,
GIMP_UNDO_GROUP_DRAWABLE_MOD,
"Stroke");
for (GList *iter = items; iter; iter = iter->next)
if (! gimp_item_stroke (iter->data, drawables,
action_data_get_context (data),
config->stroke_options, NULL,
TRUE, NULL, &error))
{
gimp_message_literal (image->gimp, G_OBJECT (widget),
GIMP_MESSAGE_WARNING, error->message);
g_clear_error (&error);
break;
}
gimp_image_undo_group_end (image);
gimp_image_flush (image);
g_list_free (drawables);
}
@@ -338,30 +425,36 @@ items_stroke_last_vals_cmd_callback (GimpAction *action,
static void
items_fill_callback (GtkWidget *dialog,
GimpItem *item,
GList *items,
GList *drawables,
GimpContext *context,
GimpFillOptions *options,
gpointer user_data)
{
GimpDialogConfig *config = GIMP_DIALOG_CONFIG (context->gimp->config);
GimpImage *image = gimp_item_get_image (item);
GimpImage *image = gimp_item_get_image (items->data);
GError *error = NULL;
gimp_config_sync (G_OBJECT (options),
G_OBJECT (config->fill_options), 0);
if (! gimp_item_fill (item, drawables, options, TRUE, NULL, &error))
{
gimp_message_literal (context->gimp,
G_OBJECT (dialog),
GIMP_MESSAGE_WARNING,
error ? error->message : "NULL");
gimp_image_undo_group_start (image,
GIMP_UNDO_GROUP_DRAWABLE_MOD,
"Fill");
g_clear_error (&error);
return;
}
for (GList *iter = items; iter; iter = iter->next)
if (! gimp_item_fill (iter->data, drawables, options, TRUE, NULL, &error))
{
gimp_message_literal (context->gimp,
G_OBJECT (dialog),
GIMP_MESSAGE_WARNING,
error ? error->message : "NULL");
g_clear_error (&error);
break;
}
gimp_image_undo_group_end (image);
gimp_image_flush (image);
gtk_widget_destroy (dialog);
@@ -369,31 +462,37 @@ items_fill_callback (GtkWidget *dialog,
static void
items_stroke_callback (GtkWidget *dialog,
GimpItem *item,
GList *items,
GList *drawables,
GimpContext *context,
GimpStrokeOptions *options,
gpointer data)
{
GimpDialogConfig *config = GIMP_DIALOG_CONFIG (context->gimp->config);
GimpImage *image = gimp_item_get_image (item);
GimpImage *image = gimp_item_get_image (items->data);
GError *error = NULL;
gimp_config_sync (G_OBJECT (options),
G_OBJECT (config->stroke_options), 0);
if (! gimp_item_stroke (item, drawables, context, options, NULL,
TRUE, NULL, &error))
{
gimp_message_literal (context->gimp,
G_OBJECT (dialog),
GIMP_MESSAGE_WARNING,
error ? error->message : "NULL");
gimp_image_undo_group_start (image,
GIMP_UNDO_GROUP_DRAWABLE_MOD,
"Stroke");
g_clear_error (&error);
return;
}
for (GList *iter = items; iter; iter = iter->next)
if (! gimp_item_stroke (iter->data, drawables, context, options, NULL,
TRUE, NULL, &error))
{
gimp_message_literal (context->gimp,
G_OBJECT (dialog),
GIMP_MESSAGE_WARNING,
error ? error->message : "NULL");
g_clear_error (&error);
break;
}
gimp_image_undo_group_end (image);
gimp_image_flush (image);
gtk_widget_destroy (dialog);

View File

@@ -22,45 +22,43 @@
void items_visible_cmd_callback (GimpAction *action,
GVariant *value,
GimpImage *image,
GimpItem *item);
GList *items);
void items_lock_content_cmd_callback (GimpAction *action,
GVariant *value,
GimpImage *image,
GimpItem *item);
GList *items);
void items_lock_position_cmd_callback (GimpAction *action,
GVariant *value,
GimpImage *image,
GimpItem *item);
GList *items);
void items_color_tag_cmd_callback (GimpAction *action,
GimpImage *image,
GimpItem *item,
GList *items,
GimpColorTag color_tag);
void items_fill_cmd_callback (GimpAction *action,
GimpImage *image,
GimpItem *item,
const gchar *dialog_key,
GList *items,
const gchar *dialog_title,
const gchar *dialog_icon_name,
const gchar *dialog_help_id,
gpointer data);
void items_fill_last_vals_cmd_callback (GimpAction *action,
GimpImage *image,
GimpItem *item,
GList *items,
gpointer data);
void items_stroke_cmd_callback (GimpAction *action,
GimpImage *image,
GimpItem *item,
const gchar *dialog_key,
GList *items,
const gchar *dialog_title,
const gchar *dialog_icon_name,
const gchar *dialog_help_id,
gpointer data);
void items_stroke_last_vals_cmd_callback (GimpAction *action,
GimpImage *image,
GimpItem *item,
GList *items,
gpointer data);

View File

@@ -48,131 +48,94 @@
static const GimpActionEntry layers_actions[] =
{
{ "layers-popup", GIMP_ICON_DIALOG_LAYERS,
NC_("layers-action", "Layers Menu"), NULL, NULL, NULL,
GIMP_HELP_LAYER_DIALOG },
{ "layers-blend-space-menu", NULL,
NC_("layers-action", "Blend Space"), NULL, NULL, NULL,
NULL },
{ "layers-composite-space-menu", NULL,
NC_("layers-action", "Composite Space"), NULL, NULL, NULL,
NULL },
{ "layers-composite-mode-menu", NULL,
NC_("layers-action", "Composite Mode"), NULL, NULL, NULL,
NULL },
{ "layers-color-tag-menu", NULL,
NC_("layers-action", "Color Tag"), NULL, NULL, NULL,
GIMP_HELP_LAYER_COLOR_TAG },
{ "layers-menu", NULL,
NC_("layers-action", "_Layer") },
{ "layers-stack-menu", NULL,
NC_("layers-action", "Stac_k") },
{ "layers-mask-menu", NULL,
NC_("layers-action", "_Mask") },
{ "layers-transparency-menu", NULL,
NC_("layers-action", "Tr_ansparency") },
{ "layers-transform-menu", NULL,
NC_("layers-action", "_Transform") },
{ "layers-properties-menu", GIMP_ICON_DOCUMENT_PROPERTIES,
NC_("layers-action", "_Properties") },
{ "layers-opacity-menu", GIMP_ICON_TRANSPARENCY,
NC_("layers-action", "_Opacity") },
{ "layers-mode-menu", GIMP_ICON_TOOL_PENCIL,
NC_("layers-action", "Layer _Mode") },
{ "layers-edit", GIMP_ICON_EDIT,
NC_("layers-action", "Default Edit Action"), NULL,
NC_("layers-action", "Default Edit Action"), NULL, { NULL },
NC_("layers-action", "Activate the default edit action for this type of layer"),
layers_edit_cmd_callback,
GIMP_HELP_LAYER_EDIT },
{ "layers-edit-text", GIMP_ICON_EDIT,
NC_("layers-action", "Edit Te_xt on canvas"), NULL,
NC_("layers-action", "Edit Te_xt on canvas"), NULL, { NULL },
NC_("layers-action", "Edit this text layer content on canvas"),
layers_edit_text_cmd_callback,
GIMP_HELP_LAYER_EDIT },
{ "layers-edit-attributes", GIMP_ICON_EDIT,
NC_("layers-action", "_Edit Layer Attributes..."), NULL,
NC_("layers-action", "_Edit Layer Attributes..."), NULL, { NULL },
NC_("layers-action", "Edit the layer's name"),
layers_edit_attributes_cmd_callback,
GIMP_HELP_LAYER_EDIT },
{ "layers-new", GIMP_ICON_DOCUMENT_NEW,
NC_("layers-action", "_New Layer..."), "<primary><shift>N",
NC_("layers-action", "_New Layer..."), NULL, { "<primary><shift>N", NULL },
NC_("layers-action", "Create a new layer and add it to the image"),
layers_new_cmd_callback,
GIMP_HELP_LAYER_NEW },
{ "layers-new-last-values", GIMP_ICON_DOCUMENT_NEW,
NC_("layers-action", "_New Layer"), NULL,
NC_("layers-action", "_New Layer"), NULL, { NULL },
NC_("layers-action", "Create new layers with last used values"),
layers_new_last_vals_cmd_callback,
GIMP_HELP_LAYER_NEW },
{ "layers-new-from-visible", NULL,
NC_("layers-action", "New from _Visible"), NULL,
NC_("layers-action", "New from _Visible"), NULL, { NULL },
NC_("layers-action",
"Create a new layer from what is visible in this image"),
layers_new_from_visible_cmd_callback,
GIMP_HELP_LAYER_NEW_FROM_VISIBLE },
{ "layers-new-group", GIMP_ICON_FOLDER_NEW,
NC_("layers-action", "New Layer _Group"), NULL,
NC_("layers-action", "New Layer _Group"), NULL, { NULL },
NC_("layers-action", "Create a new layer group and add it to the image"),
layers_new_group_cmd_callback,
GIMP_HELP_LAYER_NEW },
{ "layers-duplicate", GIMP_ICON_OBJECT_DUPLICATE,
NC_("layers-action", "D_uplicate Layer"), "<primary><shift>D",
NC_("layers-action", "D_uplicate Layer"), NULL, { "<primary><shift>D", NULL },
NC_("layers-action",
"Create duplicates of selected layers and add them to the image"),
layers_duplicate_cmd_callback,
GIMP_HELP_LAYER_DUPLICATE },
{ "layers-delete", GIMP_ICON_EDIT_DELETE,
NC_("layers-action", "_Delete Layers"), NULL,
NC_("layers-action", "_Delete Layers"), NULL, { NULL },
NC_("layers-action", "Delete selected layers"),
layers_delete_cmd_callback,
GIMP_HELP_LAYER_DELETE },
{ "layers-raise", GIMP_ICON_GO_UP,
NC_("layers-action", "_Raise Layer"), NULL,
NC_("layers-action", "_Raise Layer"), NULL, { NULL },
NC_("layers-action", "Raise this layer one step in the layer stack"),
layers_raise_cmd_callback,
GIMP_HELP_LAYER_RAISE },
{ "layers-raise-to-top", GIMP_ICON_GO_TOP,
NC_("layers-action", "Layer to _Top"), NULL,
NC_("layers-action", "Layer to _Top"), NULL, { NULL },
NC_("layers-action", "Move this layer to the top of the layer stack"),
layers_raise_to_top_cmd_callback,
GIMP_HELP_LAYER_RAISE_TO_TOP },
{ "layers-lower", GIMP_ICON_GO_DOWN,
NC_("layers-action", "_Lower Layer"), NULL,
NC_("layers-action", "_Lower Layer"), NULL, { NULL },
NC_("layers-action", "Lower this layer one step in the layer stack"),
layers_lower_cmd_callback,
GIMP_HELP_LAYER_LOWER },
{ "layers-lower-to-bottom", GIMP_ICON_GO_BOTTOM,
NC_("layers-action", "Layer to _Bottom"), NULL,
NC_("layers-action", "Layer to _Bottom"), NULL, { NULL },
NC_("layers-action", "Move this layer to the bottom of the layer stack"),
layers_lower_to_bottom_cmd_callback,
GIMP_HELP_LAYER_LOWER_TO_BOTTOM },
{ "layers-anchor", GIMP_ICON_LAYER_ANCHOR,
NC_("layers-action", "_Anchor Layer"), "<primary>H",
NC_("layers-action", "Anchor the floating layer"),
NC_("layers-action", "_Anchor Floating Layer or Mask"), NULL, { "<primary>H", NULL },
NC_("layers-action", "Anchor the floating layer or mask"),
layers_anchor_cmd_callback,
GIMP_HELP_LAYER_ANCHOR },
{ "layers-merge-down", GIMP_ICON_LAYER_MERGE_DOWN,
NC_("layers-action", "Merge Do_wn"), NULL,
NC_("layers-action", "Merge Do_wn"), NULL, { NULL },
NC_("layers-action", "Merge these layers with the first visible layer below each"),
layers_merge_down_cmd_callback,
GIMP_HELP_LAYER_MERGE_DOWN },
@@ -181,85 +144,85 @@ static const GimpActionEntry layers_actions[] =
* the layer can't be merged down
*/
{ "layers-merge-down-button", GIMP_ICON_LAYER_MERGE_DOWN,
NC_("layers-action", "Merge Do_wn"), NULL,
NC_("layers-action", "Merge Do_wn"), NULL, { NULL },
NC_("layers-action", "Merge these layers with the first visible layer below each"),
layers_merge_down_cmd_callback,
GIMP_HELP_LAYER_MERGE_DOWN },
{ "layers-merge-group", NULL,
NC_("layers-action", "Merge Layer Groups"), NULL,
NC_("layers-action", "Merge Layer Groups"), NULL, { NULL },
NC_("layers-action", "Merge the layer groups' layers into one normal layer"),
layers_merge_group_cmd_callback,
GIMP_HELP_LAYER_MERGE_GROUP },
{ "layers-merge-layers", NULL,
NC_("layers-action", "Merge _Visible Layers..."), NULL,
NC_("layers-action", "Merge _Visible Layers..."), NULL, { NULL },
NC_("layers-action", "Merge all visible layers into one layer"),
image_merge_layers_cmd_callback,
GIMP_HELP_IMAGE_MERGE_LAYERS },
{ "layers-merge-layers-last-values", NULL,
NC_("layers-action", "Merge _Visible Layers"), NULL,
NC_("layers-action", "Merge _Visible Layers"), NULL, { NULL },
NC_("layers-action", "Merge all visible layers with last used values"),
image_merge_layers_last_vals_cmd_callback,
GIMP_HELP_IMAGE_MERGE_LAYERS },
{ "layers-flatten-image", NULL,
NC_("layers-action", "_Flatten Image"), NULL,
NC_("layers-action", "_Flatten Image"), NULL, { NULL },
NC_("layers-action", "Merge all layers into one and remove transparency"),
image_flatten_image_cmd_callback,
GIMP_HELP_IMAGE_FLATTEN },
{ "layers-text-discard", GIMP_ICON_TOOL_TEXT,
NC_("layers-action", "_Discard Text Information"), NULL,
NC_("layers-action", "Turn this text layer into a normal layer"),
NC_("layers-action", "_Discard Text Information"), NULL, { NULL },
NC_("layers-action", "Turn these text layers into normal layers"),
layers_text_discard_cmd_callback,
GIMP_HELP_LAYER_TEXT_DISCARD },
{ "layers-text-to-vectors", GIMP_ICON_TOOL_TEXT,
NC_("layers-action", "Text to _Path"), NULL,
NC_("layers-action", "Create a path from this text layer"),
NC_("layers-action", "Text to _Path"), NULL, { NULL },
NC_("layers-action", "Create paths from text layers"),
layers_text_to_vectors_cmd_callback,
GIMP_HELP_LAYER_TEXT_TO_PATH },
{ "layers-text-along-vectors", GIMP_ICON_TOOL_TEXT,
NC_("layers-action", "Text alon_g Path"), NULL,
NC_("layers-action", "Text alon_g Path"), NULL, { NULL },
NC_("layers-action", "Warp this layer's text along the current path"),
layers_text_along_vectors_cmd_callback,
GIMP_HELP_LAYER_TEXT_ALONG_PATH },
{ "layers-resize", GIMP_ICON_OBJECT_RESIZE,
NC_("layers-action", "Layer B_oundary Size..."), NULL,
NC_("layers-action", "Layer B_oundary Size..."), NULL, { NULL },
NC_("layers-action", "Adjust the layer dimensions"),
layers_resize_cmd_callback,
GIMP_HELP_LAYER_RESIZE },
{ "layers-resize-to-image", GIMP_ICON_LAYER_TO_IMAGESIZE,
NC_("layers-action", "Layers to _Image Size"), NULL,
NC_("layers-action", "Layers to _Image Size"), NULL, { NULL },
NC_("layers-action", "Resize the layers to the size of the image"),
layers_resize_to_image_cmd_callback,
GIMP_HELP_LAYER_RESIZE_TO_IMAGE },
{ "layers-scale", GIMP_ICON_OBJECT_SCALE,
NC_("layers-action", "_Scale Layer..."), NULL,
NC_("layers-action", "_Scale Layer..."), NULL, { NULL },
NC_("layers-action", "Change the size of the layer content"),
layers_scale_cmd_callback,
GIMP_HELP_LAYER_SCALE },
{ "layers-crop-to-selection", GIMP_ICON_TOOL_CROP,
NC_("layers-action", "_Crop to Selection"), NULL,
NC_("layers-action", "Crop the layers to the extents of the selection"),
NC_("layers-action", "_Resize Layers to Selection"), NULL, { NULL },
NC_("layers-action", "Resize the layers to the extents of the selection"),
layers_crop_to_selection_cmd_callback,
GIMP_HELP_LAYER_CROP },
GIMP_HELP_LAYER_RESIZE_TO_SELECTION },
{ "layers-crop-to-content", GIMP_ICON_TOOL_CROP,
NC_("layers-action", "Crop to C_ontent"), NULL,
NC_("layers-action", "Crop Layers to C_ontent"), NULL, { NULL },
NC_("layers-action", "Crop the layers to the extents of their content (remove empty borders from the layer)"),
layers_crop_to_content_cmd_callback,
GIMP_HELP_LAYER_CROP },
GIMP_HELP_LAYER_CROP_TO_CONTENT },
{ "layers-mask-add", GIMP_ICON_LAYER_MASK,
NC_("layers-action", "Add La_yer Masks..."), NULL,
NC_("layers-action", "Add La_yer Masks..."), NULL, { NULL },
NC_("layers-action",
"Add masks to selected layers that allows non-destructive editing of transparency"),
layers_mask_add_cmd_callback,
@@ -269,27 +232,27 @@ static const GimpActionEntry layers_actions[] =
* there is a mask on the layer
*/
{ "layers-mask-add-button", GIMP_ICON_LAYER_MASK,
NC_("layers-action", "Add La_yer Masks..."), NULL,
NC_("layers-action", "Add La_yer Masks..."), NULL, { NULL },
NC_("layers-action",
"Add masks to selected layers that allows non-destructive editing of transparency"),
layers_mask_add_cmd_callback,
GIMP_HELP_LAYER_MASK_ADD },
{ "layers-mask-add-last-values", GIMP_ICON_LAYER_MASK,
NC_("layers-action", "Add La_yer Masks"), NULL,
NC_("layers-action", "Add La_yer Masks with Last Values"), NULL, { NULL },
NC_("layers-action",
"Add mask to selected layers with last used values"),
layers_mask_add_last_vals_cmd_callback,
GIMP_HELP_LAYER_MASK_ADD },
{ "layers-alpha-add", GIMP_ICON_TRANSPARENCY,
NC_("layers-action", "Add Alpha C_hannel"), NULL,
NC_("layers-action", "Add Alpha C_hannel"), NULL, { NULL },
NC_("layers-action", "Add transparency information to the layer"),
layers_alpha_add_cmd_callback,
GIMP_HELP_LAYER_ALPHA_ADD },
{ "layers-alpha-remove", NULL,
NC_("layers-action", "_Remove Alpha Channel"), NULL,
NC_("layers-action", "_Remove Alpha Channel"), NULL, { NULL },
NC_("layers-action", "Remove transparency information from the layer"),
layers_alpha_remove_cmd_callback,
GIMP_HELP_LAYER_ALPHA_REMOVE }
@@ -298,45 +261,45 @@ static const GimpActionEntry layers_actions[] =
static const GimpToggleActionEntry layers_toggle_actions[] =
{
{ "layers-mask-edit", GIMP_ICON_EDIT,
NC_("layers-action", "_Edit Layer Mask"), NULL,
NC_("layers-action", "_Edit Layer Mask"), NULL, { NULL },
NC_("layers-action", "Work on the layer mask"),
layers_mask_edit_cmd_callback,
FALSE,
GIMP_HELP_LAYER_MASK_EDIT },
{ "layers-mask-show", GIMP_ICON_VISIBLE,
NC_("layers-action", "S_how Layer Masks"), NULL, NULL,
NC_("layers-action", "S_how Layer Masks"), NULL, { NULL }, NULL,
layers_mask_show_cmd_callback,
FALSE,
GIMP_HELP_LAYER_MASK_SHOW },
{ "layers-mask-disable", NULL,
NC_("layers-action", "_Disable Layer Masks"), NULL,
NC_("layers-action", "_Disable Layer Masks"), NULL, { NULL },
NC_("layers-action", "Dismiss the effect of the layer mask"),
layers_mask_disable_cmd_callback,
FALSE,
GIMP_HELP_LAYER_MASK_DISABLE },
{ "layers-visible", GIMP_ICON_VISIBLE,
NC_("layers-action", "Toggle Layer _Visibility"), NULL, NULL,
NC_("layers-action", "Toggle Layer _Visibility"), NULL, { NULL }, NULL,
layers_visible_cmd_callback,
FALSE,
GIMP_HELP_LAYER_VISIBLE },
{ "layers-lock-content", GIMP_ICON_LOCK_CONTENT,
NC_("layers-action", "L_ock Pixels of Layer"), NULL, NULL,
NC_("layers-action", "L_ock Pixels of Layer"), NULL, { NULL }, NULL,
layers_lock_content_cmd_callback,
FALSE,
GIMP_HELP_LAYER_LOCK_PIXELS },
{ "layers-lock-position", GIMP_ICON_LOCK_POSITION,
NC_("layers-action", "L_ock Position of Layer"), NULL, NULL,
NC_("layers-action", "L_ock Position of Layer"), NULL, { NULL }, NULL,
layers_lock_position_cmd_callback,
FALSE,
GIMP_HELP_LAYER_LOCK_POSITION },
{ "layers-lock-alpha", GIMP_ICON_LOCK_ALPHA,
NC_("layers-action", "Lock Alph_a Channel"), NULL,
NC_("layers-action", "Lock Alph_a Channel"), NULL, { NULL },
NC_("layers-action",
"Keep transparency information on this layer from being modified"),
layers_lock_alpha_cmd_callback,
@@ -347,19 +310,19 @@ static const GimpToggleActionEntry layers_toggle_actions[] =
static const GimpRadioActionEntry layers_blend_space_actions[] =
{
{ "layers-blend-space-auto", NULL,
NC_("layers-action", "Auto"), NULL,
NC_("layers-action", "Auto"), NULL, { NULL },
NC_("layers-action", "Layer Blend Space: Auto"),
GIMP_LAYER_COLOR_SPACE_AUTO,
NULL },
{ "layers-blend-space-rgb-linear", NULL,
NC_("layers-action", "RGB (linear)"), NULL,
NC_("layers-action", "RGB (linear)"), NULL, { NULL },
NC_("layers-action", "Layer Blend Space: RGB (linear)"),
GIMP_LAYER_COLOR_SPACE_RGB_LINEAR,
NULL },
{ "layers-blend-space-rgb-perceptual", NULL,
NC_("layers-action", "RGB (perceptual)"), NULL,
NC_("layers-action", "RGB (perceptual)"), NULL, { NULL },
NC_("layers-action", "Layer Blend Space: RGB (perceptual)"),
GIMP_LAYER_COLOR_SPACE_RGB_PERCEPTUAL,
NULL }
@@ -368,19 +331,19 @@ static const GimpRadioActionEntry layers_blend_space_actions[] =
static const GimpRadioActionEntry layers_composite_space_actions[] =
{
{ "layers-composite-space-auto", NULL,
NC_("layers-action", "Auto"), NULL,
NC_("layers-action", "Auto"), NULL, { NULL },
NC_("layers-action", "Layer Composite Space: Auto"),
GIMP_LAYER_COLOR_SPACE_AUTO,
NULL },
{ "layers-composite-space-rgb-linear", NULL,
NC_("layers-action", "RGB (linear)"), NULL,
NC_("layers-action", "RGB (linear)"), NULL, { NULL },
NC_("layers-action", "Layer Composite Space: RGB (linear)"),
GIMP_LAYER_COLOR_SPACE_RGB_LINEAR,
NULL },
{ "layers-composite-space-rgb-perceptual", NULL,
NC_("layers-action", "RGB (perceptual)"), NULL,
NC_("layers-action", "RGB (perceptual)"), NULL, { NULL },
NC_("layers-action", "Layer Composite Space: RGB (perceptual)"),
GIMP_LAYER_COLOR_SPACE_RGB_PERCEPTUAL,
NULL }
@@ -389,31 +352,31 @@ static const GimpRadioActionEntry layers_composite_space_actions[] =
static const GimpRadioActionEntry layers_composite_mode_actions[] =
{
{ "layers-composite-mode-auto", NULL,
NC_("layers-action", "Auto"), NULL,
NC_("layers-action", "Auto"), NULL, { NULL },
NC_("layers-action", "Layer Composite Mode: Auto"),
GIMP_LAYER_COMPOSITE_AUTO,
NULL },
{ "layers-composite-mode-union", NULL,
NC_("layers-action", "Union"), NULL,
NC_("layers-action", "Union"), NULL, { NULL },
NC_("layers-action", "Layer Composite Mode: Union"),
GIMP_LAYER_COMPOSITE_UNION,
NULL },
{ "layers-composite-mode-clip-to-backdrop", NULL,
NC_("layers-action", "Clip to Backdrop"), NULL,
NC_("layers-action", "Clip to Backdrop"), NULL, { NULL },
NC_("layers-action", "Layer Composite Mode: Clip to Backdrop"),
GIMP_LAYER_COMPOSITE_CLIP_TO_BACKDROP,
NULL },
{ "layers-composite-mode-clip-to-layer", NULL,
NC_("layers-action", "Clip to Layer"), NULL,
NC_("layers-action", "Clip to Layer"), NULL, { NULL },
NC_("layers-action", "Layer Composite Mode: Clip to Layer"),
GIMP_LAYER_COMPOSITE_CLIP_TO_LAYER,
NULL },
{ "layers-composite-mode-intersection", NULL,
NC_("layers-action", "Intersection"), NULL,
NC_("layers-action", "Intersection"), NULL, { NULL },
NC_("layers-action", "Layer Composite Mode: Intersection"),
GIMP_LAYER_COMPOSITE_INTERSECTION,
NULL }
@@ -422,55 +385,55 @@ static const GimpRadioActionEntry layers_composite_mode_actions[] =
static const GimpEnumActionEntry layers_color_tag_actions[] =
{
{ "layers-color-tag-none", GIMP_ICON_EDIT_CLEAR,
NC_("layers-action", "None"), NULL,
NC_("layers-action", "None"), NULL, { NULL },
NC_("layers-action", "Layer Color Tag: Clear"),
GIMP_COLOR_TAG_NONE, FALSE,
GIMP_HELP_LAYER_COLOR_TAG },
{ "layers-color-tag-blue", NULL,
NC_("layers-action", "Blue"), NULL,
NC_("layers-action", "Blue"), NULL, { NULL },
NC_("layers-action", "Layer Color Tag: Set to Blue"),
GIMP_COLOR_TAG_BLUE, FALSE,
GIMP_HELP_LAYER_COLOR_TAG },
{ "layers-color-tag-green", NULL,
NC_("layers-action", "Green"), NULL,
NC_("layers-action", "Green"), NULL, { NULL },
NC_("layers-action", "Layer Color Tag: Set to Green"),
GIMP_COLOR_TAG_GREEN, FALSE,
GIMP_HELP_LAYER_COLOR_TAG },
{ "layers-color-tag-yellow", NULL,
NC_("layers-action", "Yellow"), NULL,
NC_("layers-action", "Yellow"), NULL, { NULL },
NC_("layers-action", "Layer Color Tag: Set to Yellow"),
GIMP_COLOR_TAG_YELLOW, FALSE,
GIMP_HELP_LAYER_COLOR_TAG },
{ "layers-color-tag-orange", NULL,
NC_("layers-action", "Orange"), NULL,
NC_("layers-action", "Orange"), NULL, { NULL },
NC_("layers-action", "Layer Color Tag: Set to Orange"),
GIMP_COLOR_TAG_ORANGE, FALSE,
GIMP_HELP_LAYER_COLOR_TAG },
{ "layers-color-tag-brown", NULL,
NC_("layers-action", "Brown"), NULL,
NC_("layers-action", "Brown"), NULL, { NULL },
NC_("layers-action", "Layer Color Tag: Set to Brown"),
GIMP_COLOR_TAG_BROWN, FALSE,
GIMP_HELP_LAYER_COLOR_TAG },
{ "layers-color-tag-red", NULL,
NC_("layers-action", "Red"), NULL,
NC_("layers-action", "Red"), NULL, { NULL },
NC_("layers-action", "Layer Color Tag: Set to Red"),
GIMP_COLOR_TAG_RED, FALSE,
GIMP_HELP_LAYER_COLOR_TAG },
{ "layers-color-tag-violet", NULL,
NC_("layers-action", "Violet"), NULL,
NC_("layers-action", "Violet"), NULL, { NULL },
NC_("layers-action", "Layer Color Tag: Set to Violet"),
GIMP_COLOR_TAG_VIOLET, FALSE,
GIMP_HELP_LAYER_COLOR_TAG },
{ "layers-color-tag-gray", NULL,
NC_("layers-action", "Gray"), NULL,
NC_("layers-action", "Gray"), NULL, { NULL },
NC_("layers-action", "Layer Color Tag: Set to Gray"),
GIMP_COLOR_TAG_GRAY, FALSE,
GIMP_HELP_LAYER_COLOR_TAG }
@@ -479,13 +442,13 @@ static const GimpEnumActionEntry layers_color_tag_actions[] =
static const GimpEnumActionEntry layers_mask_apply_actions[] =
{
{ "layers-mask-apply", NULL,
NC_("layers-action", "Apply Layer _Mask"), NULL,
NC_("layers-action", "Apply Layer _Mask"), NULL, { NULL },
NC_("layers-action", "Apply the effect of the layer mask and remove it"),
GIMP_MASK_APPLY, FALSE,
GIMP_HELP_LAYER_MASK_APPLY },
{ "layers-mask-delete", GIMP_ICON_EDIT_DELETE,
NC_("layers-action", "Delete Layer Mas_k"), NULL,
NC_("layers-action", "Delete Layer Mas_k"), NULL, { NULL },
NC_("layers-action", "Remove layer masks and their effect"),
GIMP_MASK_DISCARD, FALSE,
GIMP_HELP_LAYER_MASK_DELETE }
@@ -494,25 +457,25 @@ static const GimpEnumActionEntry layers_mask_apply_actions[] =
static const GimpEnumActionEntry layers_mask_to_selection_actions[] =
{
{ "layers-mask-selection-replace", GIMP_ICON_SELECTION_REPLACE,
NC_("layers-action", "_Masks to Selection"), NULL,
NC_("layers-action", "_Masks to Selection"), NULL, { NULL },
NC_("layers-action", "Replace the selection with the layer masks"),
GIMP_CHANNEL_OP_REPLACE, FALSE,
GIMP_HELP_LAYER_MASK_SELECTION_REPLACE },
{ "layers-mask-selection-add", GIMP_ICON_SELECTION_ADD,
NC_("layers-action", "_Add Masks to Selection"), NULL,
NC_("layers-action", "_Add Masks to Selection"), NULL, { NULL },
NC_("layers-action", "Add the layer masks to the current selection"),
GIMP_CHANNEL_OP_ADD, FALSE,
GIMP_HELP_LAYER_MASK_SELECTION_ADD },
{ "layers-mask-selection-subtract", GIMP_ICON_SELECTION_SUBTRACT,
NC_("layers-action", "_Subtract Masks from Selection"), NULL,
NC_("layers-action", "_Subtract Masks from Selection"), NULL, { NULL },
NC_("layers-action", "Subtract the layer masks from the current selection"),
GIMP_CHANNEL_OP_SUBTRACT, FALSE,
GIMP_HELP_LAYER_MASK_SELECTION_SUBTRACT },
{ "layers-mask-selection-intersect", GIMP_ICON_SELECTION_INTERSECT,
NC_("layers-action", "_Intersect Masks with Selection"), NULL,
NC_("layers-action", "_Intersect Masks with Selection"), NULL, { NULL },
NC_("layers-action", "Intersect the layer masks with the current selection"),
GIMP_CHANNEL_OP_INTERSECT, FALSE,
GIMP_HELP_LAYER_MASK_SELECTION_INTERSECT }
@@ -521,28 +484,28 @@ static const GimpEnumActionEntry layers_mask_to_selection_actions[] =
static const GimpEnumActionEntry layers_alpha_to_selection_actions[] =
{
{ "layers-alpha-selection-replace", GIMP_ICON_SELECTION_REPLACE,
NC_("layers-action", "Al_pha to Selection"), NULL,
NC_("layers-action", "Al_pha to Selection"), NULL, { NULL },
NC_("layers-action",
"Replace the selection with the layer's alpha channel"),
GIMP_CHANNEL_OP_REPLACE, FALSE,
GIMP_HELP_LAYER_ALPHA_SELECTION_REPLACE },
{ "layers-alpha-selection-add", GIMP_ICON_SELECTION_ADD,
NC_("layers-action", "A_dd Alpha to Selection"), NULL,
NC_("layers-action", "A_dd Alpha to Selection"), NULL, { NULL },
NC_("layers-action",
"Add the layer's alpha channel to the current selection"),
GIMP_CHANNEL_OP_ADD, FALSE,
GIMP_HELP_LAYER_ALPHA_SELECTION_ADD },
{ "layers-alpha-selection-subtract", GIMP_ICON_SELECTION_SUBTRACT,
NC_("layers-action", "_Subtract Alpha from Selection"), NULL,
NC_("layers-action", "_Subtract Alpha from Selection"), NULL, { NULL },
NC_("layers-action",
"Subtract the layer's alpha channel from the current selection"),
GIMP_CHANNEL_OP_SUBTRACT, FALSE,
GIMP_HELP_LAYER_ALPHA_SELECTION_SUBTRACT },
{ "layers-alpha-selection-intersect", GIMP_ICON_SELECTION_INTERSECT,
NC_("layers-action", "_Intersect Alpha with Selection"), NULL,
NC_("layers-action", "_Intersect Alpha with Selection"), NULL, { NULL },
NC_("layers-action",
"Intersect the layer's alpha channel with the current selection"),
GIMP_CHANNEL_OP_INTERSECT, FALSE,
@@ -552,25 +515,25 @@ static const GimpEnumActionEntry layers_alpha_to_selection_actions[] =
static const GimpEnumActionEntry layers_select_actions[] =
{
{ "layers-select-top", NULL,
NC_("layers-action", "Select _Top Layer"), "Home",
NC_("layers-action", "Select _Top Layer"), NULL, { "Home", NULL },
NC_("layers-action", "Select the topmost layer"),
GIMP_ACTION_SELECT_FIRST, FALSE,
GIMP_HELP_LAYER_TOP },
{ "layers-select-bottom", NULL,
NC_("layers-action", "Select _Bottom Layer"), "End",
NC_("layers-action", "Select _Bottom Layer"), NULL, { "End", NULL },
NC_("layers-action", "Select the bottommost layer"),
GIMP_ACTION_SELECT_LAST, FALSE,
GIMP_HELP_LAYER_BOTTOM },
{ "layers-select-previous", NULL,
NC_("layers-action", "Select _Previous Layers"), "Prior",
NC_("layers-action", "Select _Previous Layers"), NULL, { "Prior", NULL },
NC_("layers-action", "Select the layers above the current layers"),
GIMP_ACTION_SELECT_PREVIOUS, FALSE,
GIMP_HELP_LAYER_PREVIOUS },
{ "layers-select-next", NULL,
NC_("layers-action", "Select _Next Layers"), "Next",
NC_("layers-action", "Select _Next Layers"), NULL, { "Next", NULL },
NC_("layers-action", "Select the layers below the current layers"),
GIMP_ACTION_SELECT_NEXT, FALSE,
GIMP_HELP_LAYER_NEXT }
@@ -579,31 +542,31 @@ static const GimpEnumActionEntry layers_select_actions[] =
static const GimpEnumActionEntry layers_opacity_actions[] =
{
{ "layers-opacity-set", GIMP_ICON_TRANSPARENCY,
NC_("layers-action", "Layer Opacity: Set"), NULL, NULL,
NC_("layers-action", "Layer Opacity: Set"), NULL, { NULL }, NULL,
GIMP_ACTION_SELECT_SET, TRUE,
GIMP_HELP_LAYER_OPACITY },
{ "layers-opacity-transparent", GIMP_ICON_TRANSPARENCY,
NC_("layers-action", "Layer Opacity: Make Completely Transparent"), NULL, NULL,
NC_("layers-action", "Layer Opacity: Make Completely Transparent"), NULL, { NULL }, NULL,
GIMP_ACTION_SELECT_FIRST, FALSE,
GIMP_HELP_LAYER_OPACITY },
{ "layers-opacity-opaque", GIMP_ICON_TRANSPARENCY,
NC_("layers-action", "Layer Opacity: Make Completely Opaque"), NULL, NULL,
NC_("layers-action", "Layer Opacity: Make Completely Opaque"), NULL, { NULL }, NULL,
GIMP_ACTION_SELECT_LAST, FALSE,
GIMP_HELP_LAYER_OPACITY },
{ "layers-opacity-decrease", GIMP_ICON_TRANSPARENCY,
NC_("layers-action", "Layer Opacity: Make More Transparent"), NULL, NULL,
NC_("layers-action", "Layer Opacity: Make More Transparent"), NULL, { NULL }, NULL,
GIMP_ACTION_SELECT_PREVIOUS, FALSE,
GIMP_HELP_LAYER_OPACITY },
{ "layers-opacity-increase", GIMP_ICON_TRANSPARENCY,
NC_("layers-action", "Layer Opacity: Make More Opaque"), NULL, NULL,
NC_("layers-action", "Layer Opacity: Make More Opaque"), NULL, { NULL }, NULL,
GIMP_ACTION_SELECT_NEXT, FALSE,
GIMP_HELP_LAYER_OPACITY },
{ "layers-opacity-decrease-skip", GIMP_ICON_TRANSPARENCY,
NC_("layers-action", "Layer Opacity: Make 10% More Transparent"), NULL, NULL,
NC_("layers-action", "Layer Opacity: Make 10% More Transparent"), NULL, { NULL }, NULL,
GIMP_ACTION_SELECT_SKIP_PREVIOUS, FALSE,
GIMP_HELP_LAYER_OPACITY },
{ "layers-opacity-increase-skip", GIMP_ICON_TRANSPARENCY,
NC_("layers-action", "Layer Opacity: Make 10% More Opaque"), NULL, NULL,
NC_("layers-action", "Layer Opacity: Make 10% More Opaque"), NULL, { NULL }, NULL,
GIMP_ACTION_SELECT_SKIP_NEXT, FALSE,
GIMP_HELP_LAYER_OPACITY }
};
@@ -611,19 +574,19 @@ static const GimpEnumActionEntry layers_opacity_actions[] =
static const GimpEnumActionEntry layers_mode_actions[] =
{
{ "layers-mode-first", GIMP_ICON_TOOL_PENCIL,
NC_("layers-action", "Layer Mode: Select First"), NULL, NULL,
NC_("layers-action", "Layer Mode: Select First"), NULL, { NULL }, NULL,
GIMP_ACTION_SELECT_FIRST, FALSE,
GIMP_HELP_LAYER_MODE },
{ "layers-mode-last", GIMP_ICON_TOOL_PENCIL,
NC_("layers-action", "Layer Mode: Select Last"), NULL, NULL,
NC_("layers-action", "Layer Mode: Select Last"), NULL, { NULL }, NULL,
GIMP_ACTION_SELECT_LAST, FALSE,
GIMP_HELP_LAYER_MODE },
{ "layers-mode-previous", GIMP_ICON_TOOL_PENCIL,
NC_("layers-action", "Layer Mode: Select Previous"), NULL, NULL,
NC_("layers-action", "Layer Mode: Select Previous"), NULL, { NULL }, NULL,
GIMP_ACTION_SELECT_PREVIOUS, FALSE,
GIMP_HELP_LAYER_MODE },
{ "layers-mode-next", GIMP_ICON_TOOL_PENCIL,
NC_("layers-action", "Layer Mode: Select Next"), NULL, NULL,
NC_("layers-action", "Layer Mode: Select Next"), NULL, { NULL }, NULL,
GIMP_ACTION_SELECT_NEXT, FALSE,
GIMP_HELP_LAYER_MODE }
};
@@ -793,6 +756,7 @@ layers_actions_update (GimpActionGroup *group,
gint n_selected_layers = 0;
gint n_layers = 0;
gint n_text_layers = 0;
if (image)
{
@@ -916,19 +880,8 @@ layers_actions_update (GimpActionGroup *group,
else
have_no_alpha = TRUE;
if (have_masks && have_no_masks &&
have_groups && have_no_groups &&
have_writable && ! all_writable &&
! all_movable &&
! all_masks_shown &&
! all_masks_disabled &&
! lock_alpha && can_lock_alpha &&
! prev_mode && ! next_mode &&
have_prev && have_next &&
bs_mutable && cs_mutable && cm_mutable &&
! all_visible && ! all_next_visible &&
have_alpha && have_no_alpha)
break;
if (GIMP_IS_TEXT_LAYER (iter->data))
n_text_layers++;
}
if (n_selected_layers == 1)
@@ -1015,7 +968,7 @@ layers_actions_update (GimpActionGroup *group,
SET_SENSITIVE ("layers-new", image);
SET_SENSITIVE ("layers-new-last-values", image);
SET_SENSITIVE ("layers-new-from-visible", image);
SET_SENSITIVE ("layers-new-group", image && !indexed);
SET_SENSITIVE ("layers-new-group", image && !indexed && !fs);
SET_SENSITIVE ("layers-duplicate", n_selected_layers > 0 && !fs && !ac);
SET_SENSITIVE ("layers-delete", n_selected_layers > 0 && !ac);
@@ -1044,8 +997,8 @@ layers_actions_update (GimpActionGroup *group,
SET_SENSITIVE ("layers-merge-layers", n_selected_layers > 0 && !fs && !ac);
SET_SENSITIVE ("layers-flatten-image", !fs && !ac);
SET_VISIBLE ("layers-text-discard", text_layer && !ac);
SET_VISIBLE ("layers-text-to-vectors", text_layer && !ac);
SET_VISIBLE ("layers-text-discard", n_text_layers > 0 && !ac);
SET_VISIBLE ("layers-text-to-vectors", n_text_layers > 0 && !ac);
SET_VISIBLE ("layers-text-along-vectors", text_layer && !ac);
SET_SENSITIVE ("layers-resize", n_selected_layers == 1 && all_writable && all_movable && !ac);

View File

@@ -39,6 +39,8 @@
#include "core/gimpcontainer.h"
#include "core/gimpcontext.h"
#include "core/gimpdrawable-fill.h"
#include "core/gimpdrawable-filters.h"
#include "core/gimpdrawablefilter.h"
#include "core/gimpgrouplayer.h"
#include "core/gimpimage.h"
#include "core/gimpimage-merge.h"
@@ -48,6 +50,7 @@
#include "core/gimplayerpropundo.h"
#include "core/gimplayer-floating-selection.h"
#include "core/gimplayer-new.h"
#include "core/gimplist.h"
#include "core/gimppickable.h"
#include "core/gimppickable-auto-shrink.h"
#include "core/gimptoolinfo.h"
@@ -108,6 +111,7 @@ static void layers_new_callback (GtkWidget *dialog,
GimpColorTag layer_color_tag,
gboolean layer_lock_pixels,
gboolean layer_lock_position,
gboolean layer_lock_visibility,
gboolean layer_lock_alpha,
gboolean rename_text_layer,
gpointer user_data);
@@ -130,6 +134,7 @@ static void layers_edit_attributes_callback (GtkWidget *dialog,
GimpColorTag layer_color_tag,
gboolean layer_lock_pixels,
gboolean layer_lock_position,
gboolean layer_lock_visibility,
gboolean layer_lock_alpha,
gboolean rename_text_layer,
gpointer user_data);
@@ -185,12 +190,15 @@ layers_edit_cmd_callback (GimpAction *action,
gpointer data)
{
GimpImage *image;
GimpLayer *layer;
GList *layers;
GtkWidget *widget;
return_if_no_layer (image, layer, data);
return_if_no_layers (image, layers, data);
return_if_no_widget (widget, data);
if (gimp_item_is_text_layer (GIMP_ITEM (layer)))
if (g_list_length (layers) != 1)
return;
if (gimp_item_is_text_layer (GIMP_ITEM (layers->data)))
{
layers_edit_text_cmd_callback (action, value, data);
}
@@ -207,11 +215,16 @@ layers_edit_text_cmd_callback (GimpAction *action,
{
GimpImage *image;
GimpLayer *layer;
GList *layers;
GtkWidget *widget;
GimpTool *active_tool;
return_if_no_layer (image, layer, data);
return_if_no_layers (image, layers, data);
return_if_no_widget (widget, data);
if (g_list_length (layers) != 1)
return;
layer = layers->data;
g_return_if_fail (gimp_item_is_text_layer (GIMP_ITEM (layer)));
active_tool = tool_manager_get_active (image->gimp);
@@ -247,11 +260,17 @@ layers_edit_attributes_cmd_callback (GimpAction *action,
{
GimpImage *image;
GimpLayer *layer;
GList *layers;
GtkWidget *widget;
GtkWidget *dialog;
return_if_no_layer (image, layer, data);
return_if_no_layers (image, layers, data);
return_if_no_widget (widget, data);
if (g_list_length (layers) != 1)
return;
layer = layers->data;
#define EDIT_DIALOG_KEY "gimp-layer-edit-attributes-dialog"
dialog = dialogs_get_dialog (G_OBJECT (layer), EDIT_DIALOG_KEY);
@@ -280,6 +299,7 @@ layers_edit_attributes_cmd_callback (GimpAction *action,
gimp_item_get_color_tag (item),
gimp_item_get_lock_content (item),
gimp_item_get_lock_position (item),
gimp_item_get_lock_visibility (item),
gimp_layer_get_lock_alpha (layer),
layers_edit_attributes_callback,
NULL);
@@ -365,6 +385,7 @@ layers_new_cmd_callback (GimpAction *action,
FALSE,
FALSE,
FALSE,
FALSE,
layers_new_callback,
NULL);
g_free (desc);
@@ -793,6 +814,35 @@ layers_duplicate_cmd_callback (GimpAction *action,
gimp_item_get_index (iter->data),
TRUE);
new_layers = g_list_prepend (new_layers, new_layer);
/* Import any attached layer effects */
if (gimp_drawable_has_filters (GIMP_DRAWABLE (iter->data)))
{
GList *filter_list;
GimpContainer *filters;
filters = gimp_drawable_get_filters (GIMP_DRAWABLE (iter->data));
for (filter_list = GIMP_LIST (filters)->queue->tail; filter_list;
filter_list = g_list_previous (filter_list))
{
if (GIMP_IS_DRAWABLE_FILTER (filter_list->data))
{
GimpDrawableFilter *old_filter = filter_list->data;
GimpDrawableFilter *filter;
filter =
gimp_drawable_filter_duplicate (GIMP_DRAWABLE (new_layer),
old_filter);
gimp_drawable_filter_apply (filter, NULL);
gimp_drawable_filter_commit (filter, TRUE, NULL, FALSE);
gimp_drawable_filter_layer_mask_freeze (filter);
g_object_unref (filter);
}
}
}
}
gimp_image_set_selected_layers (image, new_layers);
@@ -968,11 +1018,16 @@ layers_text_discard_cmd_callback (GimpAction *action,
gpointer data)
{
GimpImage *image;
GimpLayer *layer;
return_if_no_layer (image, layer, data);
GList *layers;
GList *iter;
return_if_no_layers (image, layers, data);
if (GIMP_IS_TEXT_LAYER (layer))
gimp_text_layer_discard (GIMP_TEXT_LAYER (layer));
gimp_image_undo_group_start (image, GIMP_UNDO_GROUP_TEXT,
_("Discard Text Information"));
for (iter = layers; iter; iter = iter->next)
if (GIMP_IS_TEXT_LAYER (iter->data))
gimp_text_layer_discard (GIMP_TEXT_LAYER (iter->data));
gimp_image_undo_group_end (image);
}
void
@@ -981,23 +1036,33 @@ layers_text_to_vectors_cmd_callback (GimpAction *action,
gpointer data)
{
GimpImage *image;
GimpLayer *layer;
return_if_no_layer (image, layer, data);
GList *layers;
GList *iter;
return_if_no_layers (image, layers, data);
if (GIMP_IS_TEXT_LAYER (layer))
/* TODO: have the proper undo group. */
gimp_image_undo_group_start (image, GIMP_UNDO_GROUP_VECTORS_IMPORT,
_("Add Paths"));
for (iter = layers; iter; iter = iter->next)
{
GimpVectors *vectors;
gint x, y;
GimpLayer *layer = iter->data;
vectors = gimp_text_vectors_new (image, GIMP_TEXT_LAYER (layer)->text);
if (GIMP_IS_TEXT_LAYER (layer))
{
GimpVectors *vectors;
gint x, y;
gimp_item_get_offset (GIMP_ITEM (layer), &x, &y);
gimp_item_translate (GIMP_ITEM (vectors), x, y, FALSE);
vectors = gimp_text_vectors_new (image, GIMP_TEXT_LAYER (layer)->text);
gimp_image_add_vectors (image, vectors,
GIMP_IMAGE_ACTIVE_PARENT, -1, TRUE);
gimp_image_flush (image);
gimp_item_get_offset (GIMP_ITEM (layer), &x, &y);
gimp_item_translate (GIMP_ITEM (vectors), x, y, FALSE);
gimp_image_add_vectors (image, vectors,
GIMP_IMAGE_ACTIVE_PARENT, -1, TRUE);
gimp_image_flush (image);
}
}
gimp_image_undo_group_end (image);
}
void
@@ -1006,11 +1071,18 @@ layers_text_along_vectors_cmd_callback (GimpAction *action,
gpointer data)
{
GimpImage *image;
GList *layers;
GList *paths;
GimpLayer *layer;
GimpVectors *vectors;
return_if_no_layer (image, layer, data);
return_if_no_vectors (image, vectors, data);
return_if_no_layers (image, layers, data);
return_if_no_vectors_list (image, paths, data);
if (g_list_length (layers) != 1 || g_list_length (paths) != 1)
return;
layer = layers->data;
vectors = paths->data;
if (GIMP_IS_TEXT_LAYER (layer))
{
gdouble box_width;
@@ -2017,13 +2089,13 @@ layers_composite_mode_cmd_callback (GimpAction *action,
void
layers_visible_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data)
gpointer data)
{
GimpImage *image;
GimpLayer *layer;
return_if_no_layer (image, layer, data);
GList *layers;
return_if_no_layers (image, layers, data);
items_visible_cmd_callback (action, value, image, GIMP_ITEM (layer));
items_visible_cmd_callback (action, value, image, layers);
}
void
@@ -2033,46 +2105,9 @@ layers_lock_content_cmd_callback (GimpAction *action,
{
GimpImage *image;
GList *layers;
GList *iter;
GList *locked_layers = NULL;
gboolean locked = g_variant_get_boolean (value);
gchar *undo_label;
return_if_no_layers (image, layers, data);
for (iter = layers; iter; iter = iter->next)
if (gimp_item_can_lock_content (iter->data))
{
if (! locked && ! gimp_item_get_lock_content (iter->data))
{
/* When unlocking, we expect all selected layers to be locked. */
g_list_free (locked_layers);
return;
}
else if (locked != gimp_item_get_lock_content (iter->data))
{
locked_layers = g_list_prepend (locked_layers, iter->data);
}
}
if (! locked_layers)
return;
if (locked)
undo_label = _("Lock content");
else
undo_label = _("Unlock content");
gimp_image_undo_group_start (image,
GIMP_UNDO_GROUP_ITEM_LOCK_CONTENTS,
undo_label);
for (iter = locked_layers; iter; iter = iter->next)
gimp_item_set_lock_content (iter->data, locked, TRUE);
gimp_image_flush (image);
gimp_image_undo_group_end (image);
g_list_free (locked_layers);
items_lock_content_cmd_callback (action, value, image, layers);
}
void
@@ -2082,46 +2117,9 @@ layers_lock_position_cmd_callback (GimpAction *action,
{
GimpImage *image;
GList *layers;
GList *iter;
GList *locked_layers = NULL;
gboolean locked = g_variant_get_boolean (value);
gchar *undo_label;
return_if_no_layers (image, layers, data);
for (iter = layers; iter; iter = iter->next)
if (gimp_item_can_lock_position (iter->data))
{
if (! locked && ! gimp_item_get_lock_position (iter->data))
{
/* When unlocking, we expect all selected layers to be locked. */
g_list_free (locked_layers);
return;
}
else if (locked != gimp_item_get_lock_position (iter->data))
{
locked_layers = g_list_prepend (locked_layers, iter->data);
}
}
if (! locked_layers)
return;
if (locked)
undo_label = _("Lock position");
else
undo_label = _("Unlock position");
gimp_image_undo_group_start (image,
GIMP_UNDO_GROUP_ITEM_LOCK_POSITION,
undo_label);
for (iter = locked_layers; iter; iter = iter->next)
gimp_item_set_lock_position (iter->data, locked, TRUE);
gimp_image_flush (image);
gimp_image_undo_group_end (image);
g_list_free (locked_layers);
items_lock_position_cmd_callback (action, value, image, layers);
}
void
@@ -2179,15 +2177,12 @@ layers_color_tag_cmd_callback (GimpAction *action,
{
GimpImage *image;
GList *layers;
GList *iter;
GimpColorTag color_tag;
return_if_no_layers (image, layers, data);
color_tag = (GimpColorTag) g_variant_get_int32 (value);
for (iter = layers; iter; iter = iter->next)
items_color_tag_cmd_callback (action, image, GIMP_ITEM (iter->data),
color_tag);
items_color_tag_cmd_callback (action, image, layers, color_tag);
}
@@ -2213,6 +2208,7 @@ layers_new_callback (GtkWidget *dialog,
GimpColorTag layer_color_tag,
gboolean layer_lock_pixels,
gboolean layer_lock_position,
gboolean layer_lock_visibility,
gboolean layer_lock_alpha,
gboolean rename_text_layer, /* unused */
gpointer user_data)
@@ -2282,6 +2278,8 @@ layers_new_callback (GtkWidget *dialog,
FALSE);
gimp_item_set_lock_position (GIMP_ITEM (layer), layer_lock_position,
FALSE);
gimp_item_set_lock_visibility (GIMP_ITEM (layer), layer_lock_visibility,
FALSE);
gimp_layer_set_lock_alpha (layer, layer_lock_alpha, FALSE);
gimp_layer_set_blend_space (layer, layer_blend_space, FALSE);
gimp_layer_set_composite_space (layer, layer_composite_space, FALSE);
@@ -2326,6 +2324,7 @@ layers_edit_attributes_callback (GtkWidget *dialog,
GimpColorTag layer_color_tag,
gboolean layer_lock_pixels,
gboolean layer_lock_position,
gboolean layer_lock_visibility,
gboolean layer_lock_alpha,
gboolean rename_text_layer,
gpointer user_data)
@@ -2344,6 +2343,7 @@ layers_edit_attributes_callback (GtkWidget *dialog,
layer_color_tag != gimp_item_get_color_tag (item) ||
layer_lock_pixels != gimp_item_get_lock_content (item) ||
layer_lock_position != gimp_item_get_lock_position (item) ||
layer_lock_visibility != gimp_item_get_lock_visibility (item) ||
layer_lock_alpha != gimp_layer_get_lock_alpha (layer))
{
gimp_image_undo_group_start (image,
@@ -2399,6 +2399,9 @@ layers_edit_attributes_callback (GtkWidget *dialog,
if (layer_lock_position != gimp_item_get_lock_position (item))
gimp_item_set_lock_position (item, layer_lock_position, TRUE);
if (layer_lock_visibility != gimp_item_get_lock_visibility (item))
gimp_item_set_lock_visibility (item, layer_lock_visibility, TRUE);
if (layer_lock_alpha != gimp_layer_get_lock_alpha (layer))
gimp_layer_set_lock_alpha (layer, layer_lock_alpha, TRUE);

View File

@@ -39,42 +39,38 @@
static const GimpActionEntry mypaint_brushes_actions[] =
{
{ "mypaint-brushes-popup", GIMP_ICON_MYPAINT_BRUSH,
NC_("mypaint-brushes-action", "MyPaint Brushes Menu"), NULL, NULL, NULL,
GIMP_HELP_MYPAINT_BRUSH_DIALOG },
{ "mypaint-brushes-new", GIMP_ICON_DOCUMENT_NEW,
NC_("mypaint-brushes-action", "_New MyPaint Brush"), NULL,
NC_("mypaint-brushes-action", "_New MyPaint Brush"), NULL, { NULL },
NC_("mypaint-brushes-action", "Create a new MyPaint brush"),
data_new_cmd_callback,
GIMP_HELP_MYPAINT_BRUSH_NEW },
{ "mypaint-brushes-duplicate", GIMP_ICON_OBJECT_DUPLICATE,
NC_("mypaint-brushes-action", "D_uplicate MyPaint Brush"), NULL,
NC_("mypaint-brushes-action", "D_uplicate MyPaint Brush"), NULL, { NULL },
NC_("mypaint-brushes-action", "Duplicate this MyPaint brush"),
data_duplicate_cmd_callback,
GIMP_HELP_MYPAINT_BRUSH_DUPLICATE },
{ "mypaint-brushes-copy-location", GIMP_ICON_EDIT_COPY,
NC_("mypaint-brushes-action", "Copy MyPaint Brush _Location"), NULL,
NC_("mypaint-brushes-action", "Copy MyPaint Brush _Location"), NULL, { NULL },
NC_("mypaint-brushes-action", "Copy MyPaint brush file location to clipboard"),
data_copy_location_cmd_callback,
GIMP_HELP_MYPAINT_BRUSH_COPY_LOCATION },
{ "mypaint-brushes-show-in-file-manager", GIMP_ICON_FILE_MANAGER,
NC_("mypaint-brushes-action", "Show in _File Manager"), NULL,
NC_("mypaint-brushes-action", "Show in _File Manager"), NULL, { NULL },
NC_("mypaint-brushes-action", "Show MyPaint brush file location in the file manager"),
data_show_in_file_manager_cmd_callback,
GIMP_HELP_MYPAINT_BRUSH_SHOW_IN_FILE_MANAGER },
{ "mypaint-brushes-delete", GIMP_ICON_EDIT_DELETE,
NC_("mypaint-brushes-action", "_Delete MyPaint Brush"), NULL,
NC_("mypaint-brushes-action", "_Delete MyPaint Brush"), NULL, { NULL },
NC_("mypaint-brushes-action", "Delete this MyPaint brush"),
data_delete_cmd_callback,
GIMP_HELP_MYPAINT_BRUSH_DELETE },
{ "mypaint-brushes-refresh", GIMP_ICON_VIEW_REFRESH,
NC_("mypaint-brushes-action", "_Refresh MyPaint Brushes"), NULL,
NC_("mypaint-brushes-action", "_Refresh MyPaint Brushes"), NULL, { NULL },
NC_("mypaint-brushes-action", "Refresh MyPaint brushes"),
data_refresh_cmd_callback,
GIMP_HELP_MYPAINT_BRUSH_REFRESH }
@@ -83,7 +79,7 @@ static const GimpActionEntry mypaint_brushes_actions[] =
static const GimpStringActionEntry mypaint_brushes_edit_actions[] =
{
{ "mypaint-brushes-edit", GIMP_ICON_EDIT,
NC_("mypaint-brushes-action", "_Edit MyPaint Brush..."), NULL,
NC_("mypaint-brushes-action", "_Edit MyPaint Brush..."), NULL, { NULL },
NC_("mypaint-brushes-action", "Edit MyPaint brush"),
"gimp-mybrush-editor",
GIMP_HELP_MYPAINT_BRUSH_EDIT }

View File

@@ -40,18 +40,14 @@
static const GimpActionEntry palette_editor_actions[] =
{
{ "palette-editor-popup", GIMP_ICON_PALETTE,
NC_("palette-editor-action", "Palette Editor Menu"), NULL, NULL, NULL,
GIMP_HELP_PALETTE_EDITOR_DIALOG },
{ "palette-editor-edit-color", GIMP_ICON_EDIT,
NC_("palette-editor-action", "_Edit Color..."), NULL,
NC_("palette-editor-action", "_Edit Color..."), NULL, { NULL },
NC_("palette-editor-action", "Edit this entry"),
palette_editor_edit_color_cmd_callback,
GIMP_HELP_PALETTE_EDITOR_EDIT },
{ "palette-editor-delete-color", GIMP_ICON_EDIT_DELETE,
NC_("palette-editor-action", "_Delete Color"), NULL,
NC_("palette-editor-action", "_Delete Color"), NULL, { NULL },
NC_("palette-editor-action", "Delete this entry"),
palette_editor_delete_color_cmd_callback,
GIMP_HELP_PALETTE_EDITOR_DELETE }
@@ -60,7 +56,7 @@ static const GimpActionEntry palette_editor_actions[] =
static const GimpToggleActionEntry palette_editor_toggle_actions[] =
{
{ "palette-editor-edit-active", GIMP_ICON_LINKED,
NC_("palette-editor-action", "Edit Active Palette"), NULL, NULL,
NC_("palette-editor-action", "Edit Active Palette"), NULL, { NULL }, NULL,
data_editor_edit_active_cmd_callback,
FALSE,
GIMP_HELP_PALETTE_EDITOR_EDIT_ACTIVE }
@@ -69,14 +65,14 @@ static const GimpToggleActionEntry palette_editor_toggle_actions[] =
static const GimpEnumActionEntry palette_editor_new_actions[] =
{
{ "palette-editor-new-color-fg", GIMP_ICON_DOCUMENT_NEW,
NC_("palette-editor-action", "New Color from _FG"), NULL,
NC_("palette-editor-action", "New Color from _FG"), NULL, { NULL },
NC_("palette-editor-action",
"Create a new entry from the foreground color"),
FALSE, FALSE,
GIMP_HELP_PALETTE_EDITOR_NEW },
{ "palette-editor-new-color-bg", GIMP_ICON_DOCUMENT_NEW,
NC_("palette-editor-action", "New Color from _BG"), NULL,
NC_("palette-editor-action", "New Color from _BG"), NULL, { NULL },
NC_("palette-editor-action",
"Create a new entry from the background color"),
TRUE, FALSE,
@@ -86,19 +82,19 @@ static const GimpEnumActionEntry palette_editor_new_actions[] =
static const GimpEnumActionEntry palette_editor_zoom_actions[] =
{
{ "palette-editor-zoom-in", GIMP_ICON_ZOOM_IN,
N_("Zoom _In"), NULL,
N_("Zoom _In"), NULL, { NULL },
N_("Zoom in"),
GIMP_ZOOM_IN, FALSE,
GIMP_HELP_PALETTE_EDITOR_ZOOM_IN },
{ "palette-editor-zoom-out", GIMP_ICON_ZOOM_OUT,
N_("Zoom _Out"), NULL,
N_("Zoom _Out"), NULL, { NULL },
N_("Zoom out"),
GIMP_ZOOM_OUT, FALSE,
GIMP_HELP_PALETTE_EDITOR_ZOOM_OUT },
{ "palette-editor-zoom-all", GIMP_ICON_ZOOM_FIT_BEST,
N_("Zoom _All"), NULL,
N_("Zoom _All"), NULL, { NULL },
N_("Zoom all"),
GIMP_ZOOM_OUT_MAX, FALSE,
GIMP_HELP_PALETTE_EDITOR_ZOOM_ALL }
@@ -135,8 +131,6 @@ palette_editor_actions_update (GimpActionGroup *group,
GimpDataEditor *data_editor = GIMP_DATA_EDITOR (user_data);
GimpData *data;
gboolean editable = FALSE;
GimpRGB fg;
GimpRGB bg;
gboolean edit_active = FALSE;
data = data_editor->data;
@@ -147,12 +141,6 @@ palette_editor_actions_update (GimpActionGroup *group,
editable = TRUE;
}
if (data_editor->context)
{
gimp_context_get_foreground (data_editor->context, &fg);
gimp_context_get_background (data_editor->context, &bg);
}
edit_active = gimp_data_editor_get_edit_active (data_editor);
#define SET_SENSITIVE(action,condition) \
@@ -168,8 +156,8 @@ palette_editor_actions_update (GimpActionGroup *group,
SET_SENSITIVE ("palette-editor-new-color-fg", editable);
SET_SENSITIVE ("palette-editor-new-color-bg", editable);
SET_COLOR ("palette-editor-new-color-fg", data_editor->context ? &fg : NULL);
SET_COLOR ("palette-editor-new-color-bg", data_editor->context ? &bg : NULL);
SET_COLOR ("palette-editor-new-color-fg", data_editor->context ? gimp_context_get_foreground (data_editor->context) : NULL);
SET_COLOR ("palette-editor-new-color-bg", data_editor->context ? gimp_context_get_background (data_editor->context) : NULL);
SET_SENSITIVE ("palette-editor-zoom-out", data);
SET_SENSITIVE ("palette-editor-zoom-in", data);

View File

@@ -56,14 +56,14 @@ palette_editor_new_color_cmd_callback (GimpAction *action,
{
GimpPalette *palette = GIMP_PALETTE (data_editor->data);
GimpPaletteEntry *entry;
GimpRGB color;
GeglColor *color;
if (background)
gimp_context_get_background (data_editor->context, &color);
color = gimp_context_get_background (data_editor->context);
else
gimp_context_get_foreground (data_editor->context, &color);
color = gimp_context_get_foreground (data_editor->context);
entry = gimp_palette_add_entry (palette, -1, NULL, &color);
entry = gimp_palette_add_entry (palette, -1, NULL, color);
gimp_palette_view_select_entry (GIMP_PALETTE_VIEW (editor->view), entry);
}
}

View File

@@ -40,54 +40,50 @@
static const GimpActionEntry palettes_actions[] =
{
{ "palettes-popup", GIMP_ICON_PALETTE,
NC_("palettes-action", "Palettes Menu"), NULL, NULL, NULL,
GIMP_HELP_PALETTE_DIALOG },
{ "palettes-new", GIMP_ICON_DOCUMENT_NEW,
NC_("palettes-action", "_New Palette"), NULL,
NC_("palettes-action", "_New Palette"), NULL, { NULL },
NC_("palettes-action", "Create a new palette"),
data_new_cmd_callback,
GIMP_HELP_PALETTE_NEW },
{ "palettes-import", "gtk-convert",
NC_("palettes-action", "_Import Palette..."), NULL,
NC_("palettes-action", "_Import Palette..."), NULL, { NULL },
NC_("palettes-action", "Import palette"),
palettes_import_cmd_callback,
GIMP_HELP_PALETTE_IMPORT },
{ "palettes-duplicate", GIMP_ICON_OBJECT_DUPLICATE,
NC_("palettes-action", "D_uplicate Palette"), NULL,
NC_("palettes-action", "D_uplicate Palette"), NULL, { NULL },
NC_("palettes-action", "Duplicate this palette"),
data_duplicate_cmd_callback,
GIMP_HELP_PALETTE_DUPLICATE },
{ "palettes-merge", NULL,
NC_("palettes-action", "_Merge Palettes..."), NULL,
NC_("palettes-action", "_Merge Palettes..."), NULL, { NULL },
NC_("palettes-action", "Merge palettes"),
palettes_merge_cmd_callback,
GIMP_HELP_PALETTE_MERGE },
{ "palettes-copy-location", GIMP_ICON_EDIT_COPY,
NC_("palettes-action", "Copy Palette _Location"), NULL,
NC_("palettes-action", "Copy Palette _Location"), NULL, { NULL },
NC_("palettes-action", "Copy palette file location to clipboard"),
data_copy_location_cmd_callback,
GIMP_HELP_PALETTE_COPY_LOCATION },
{ "palettes-show-in-file-manager", GIMP_ICON_FILE_MANAGER,
NC_("palettes-action", "Show in _File Manager"), NULL,
NC_("palettes-action", "Show in _File Manager"), NULL, { NULL },
NC_("palettes-action", "Show palette file location in the file manager"),
data_show_in_file_manager_cmd_callback,
GIMP_HELP_PALETTE_SHOW_IN_FILE_MANAGER },
{ "palettes-delete", GIMP_ICON_EDIT_DELETE,
NC_("palettes-action", "_Delete Palette"), NULL,
NC_("palettes-action", "_Delete Palette"), NULL, { NULL },
NC_("palettes-action", "Delete this palette"),
data_delete_cmd_callback,
GIMP_HELP_PALETTE_DELETE },
{ "palettes-refresh", GIMP_ICON_VIEW_REFRESH,
NC_("palettes-action", "_Refresh Palettes"), NULL,
NC_("palettes-action", "_Refresh Palettes"), NULL, { NULL },
NC_("palettes-action", "Refresh palettes"),
data_refresh_cmd_callback,
GIMP_HELP_PALETTE_REFRESH }
@@ -96,7 +92,7 @@ static const GimpActionEntry palettes_actions[] =
static const GimpStringActionEntry palettes_edit_actions[] =
{
{ "palettes-edit", GIMP_ICON_EDIT,
NC_("palettes-action", "_Edit Palette..."), NULL,
NC_("palettes-action", "_Edit Palette..."), NULL, { NULL },
NC_("palettes-action", "Edit this palette"),
"gimp-palette-editor",
GIMP_HELP_PALETTE_EDIT }

View File

@@ -145,7 +145,7 @@ palettes_merge_callback (GtkWidget *widget,
gimp_palette_add_entry (new_palette, -1,
entry->name,
&entry->color);
entry->color);
}
}

View File

@@ -39,48 +39,44 @@
static const GimpActionEntry patterns_actions[] =
{
{ "patterns-popup", GIMP_ICON_PATTERN,
NC_("patterns-action", "Patterns Menu"), NULL, NULL, NULL,
GIMP_HELP_PATTERN_DIALOG },
{ "patterns-open-as-image", GIMP_ICON_DOCUMENT_OPEN,
NC_("patterns-action", "_Open Pattern as Image"), NULL,
NC_("patterns-action", "_Open Pattern as Image"), NULL, { NULL },
NC_("patterns-action", "Open this pattern as an image"),
data_open_as_image_cmd_callback,
GIMP_HELP_PATTERN_OPEN_AS_IMAGE },
{ "patterns-new", GIMP_ICON_DOCUMENT_NEW,
NC_("patterns-action", "_New Pattern"), NULL,
NC_("patterns-action", "_New Pattern"), NULL, { NULL },
NC_("patterns-action", "Create a new pattern"),
data_new_cmd_callback,
GIMP_HELP_PATTERN_NEW },
{ "patterns-duplicate", GIMP_ICON_OBJECT_DUPLICATE,
NC_("patterns-action", "D_uplicate Pattern"), NULL,
NC_("patterns-action", "D_uplicate Pattern"), NULL, { NULL },
NC_("patterns-action", "Duplicate this pattern"),
data_duplicate_cmd_callback,
GIMP_HELP_PATTERN_DUPLICATE },
{ "patterns-copy-location", GIMP_ICON_EDIT_COPY,
NC_("patterns-action", "Copy Pattern _Location"), NULL,
NC_("patterns-action", "Copy Pattern _Location"), NULL, { NULL },
NC_("patterns-action", "Copy pattern file location to clipboard"),
data_copy_location_cmd_callback,
GIMP_HELP_PATTERN_COPY_LOCATION },
{ "patterns-show-in-file-manager", GIMP_ICON_FILE_MANAGER,
NC_("patterns-action", "Show in _File Manager"), NULL,
NC_("patterns-action", "Show in _File Manager"), NULL, { NULL },
NC_("patterns-action", "Show pattern file location in the file manager"),
data_show_in_file_manager_cmd_callback,
GIMP_HELP_PATTERN_SHOW_IN_FILE_MANAGER },
{ "patterns-delete", GIMP_ICON_EDIT_DELETE,
NC_("patterns-action", "_Delete Pattern"), NULL,
NC_("patterns-action", "_Delete Pattern"), NULL, { NULL },
NC_("patterns-action", "Delete this pattern"),
data_delete_cmd_callback,
GIMP_HELP_PATTERN_DELETE },
{ "patterns-refresh", GIMP_ICON_VIEW_REFRESH,
NC_("patterns-action", "_Refresh Patterns"), NULL,
NC_("patterns-action", "_Refresh Patterns"), NULL, { NULL },
NC_("patterns-action", "Refresh patterns"),
data_refresh_cmd_callback,
GIMP_HELP_PATTERN_REFRESH }
@@ -89,7 +85,7 @@ static const GimpActionEntry patterns_actions[] =
static const GimpStringActionEntry patterns_edit_actions[] =
{
{ "patterns-edit", GIMP_ICON_EDIT,
NC_("patterns-action", "_Edit Pattern..."), NULL,
NC_("patterns-action", "_Edit Pattern..."), NULL, { NULL },
NC_("patterns-action", "Edit pattern"),
"gimp-pattern-editor",
GIMP_HELP_PATTERN_EDIT }

View File

@@ -51,33 +51,22 @@
/* local function prototypes */
static void plug_in_actions_menu_branch_added (GimpPlugInManager *manager,
GFile *file,
const gchar *menu_path,
const gchar *menu_label,
GimpActionGroup *group);
static void plug_in_actions_register_procedure (GimpPDB *pdb,
GimpProcedure *procedure,
GimpActionGroup *group);
static void plug_in_actions_unregister_procedure (GimpPDB *pdb,
GimpProcedure *procedure,
GimpActionGroup *group);
static void plug_in_actions_menu_path_added (GimpPlugInProcedure *proc,
const gchar *menu_path,
GimpActionGroup *group);
static void plug_in_actions_add_proc (GimpActionGroup *group,
GimpPlugInProcedure *proc);
static void plug_in_actions_build_path (GimpActionGroup *group,
const gchar *translated);
/* private variables */
static const GimpActionEntry plug_in_actions[] =
{
{ "plug-in-reset-all", GIMP_ICON_RESET,
NC_("plug-in-action", "Reset all _Filters"), NULL,
NC_("plug-in-action", "Reset all _Filters"), NULL, { NULL },
NC_("plug-in-action", "Reset all plug-ins to their default settings"),
plug_in_reset_all_cmd_callback,
GIMP_HELP_FILTER_RESET_ALL }
@@ -96,24 +85,6 @@ plug_in_actions_setup (GimpActionGroup *group)
plug_in_actions,
G_N_ELEMENTS (plug_in_actions));
for (list = gimp_plug_in_manager_get_menu_branches (manager);
list;
list = g_slist_next (list))
{
GimpPlugInMenuBranch *branch = list->data;
plug_in_actions_menu_branch_added (manager,
branch->file,
branch->menu_path,
branch->menu_label,
group);
}
g_signal_connect_object (manager,
"menu-branch-added",
G_CALLBACK (plug_in_actions_menu_branch_added),
group, 0);
for (list = manager->plug_in_procedures;
list;
list = g_slist_next (list))
@@ -153,7 +124,7 @@ plug_in_actions_update (GimpActionGroup *group,
GimpProcedure *procedure = GIMP_PROCEDURE (proc);
gboolean sensitive;
const gchar *tooltip;
const gchar *reason;
const gchar *reason = NULL;
sensitive = gimp_procedure_get_sensitive (procedure,
GIMP_OBJECT (image),
@@ -175,21 +146,6 @@ plug_in_actions_update (GimpActionGroup *group,
/* private functions */
static void
plug_in_actions_menu_branch_added (GimpPlugInManager *manager,
GFile *file,
const gchar *menu_path,
const gchar *menu_label,
GimpActionGroup *group)
{
gchar *full;
full = g_strconcat (menu_path, "/", menu_label, NULL);
plug_in_actions_build_path (group, full);
g_free (full);
}
static void
plug_in_actions_register_procedure (GimpPDB *pdb,
GimpProcedure *procedure,
@@ -199,10 +155,6 @@ plug_in_actions_register_procedure (GimpPDB *pdb,
{
GimpPlugInProcedure *plug_in_proc = GIMP_PLUG_IN_PROCEDURE (procedure);
g_signal_connect_object (plug_in_proc, "menu-path-added",
G_CALLBACK (plug_in_actions_menu_path_added),
group, 0);
if (plug_in_proc->menu_label &&
! plug_in_proc->file_proc)
{
@@ -225,10 +177,6 @@ plug_in_actions_unregister_procedure (GimpPDB *pdb,
{
GimpPlugInProcedure *plug_in_proc = GIMP_PLUG_IN_PROCEDURE (procedure);
g_signal_handlers_disconnect_by_func (plug_in_proc,
plug_in_actions_menu_path_added,
group);
if (plug_in_proc->menu_label &&
! plug_in_proc->file_proc)
{
@@ -248,25 +196,11 @@ plug_in_actions_unregister_procedure (GimpPDB *pdb,
}
}
static void
plug_in_actions_menu_path_added (GimpPlugInProcedure *plug_in_proc,
const gchar *menu_path,
GimpActionGroup *group)
{
#if 0
g_print ("%s: %s (%s)\n", G_STRFUNC,
gimp_object_get_name (plug_in_proc), menu_path);
#endif
plug_in_actions_build_path (group, menu_path);
}
static void
plug_in_actions_add_proc (GimpActionGroup *group,
GimpPlugInProcedure *proc)
{
GimpProcedureActionEntry entry;
GList *list;
entry.name = gimp_object_get_name (proc);
entry.icon_name = gimp_viewable_get_icon_name (GIMP_VIEWABLE (proc));
@@ -279,13 +213,6 @@ plug_in_actions_add_proc (GimpActionGroup *group,
gimp_action_group_add_procedure_actions (group, &entry, 1,
plug_in_run_cmd_callback);
for (list = proc->menu_paths; list; list = g_list_next (list))
{
const gchar *original = list->data;
plug_in_actions_build_path (group, original);
}
if (proc->image_types_val)
{
GimpContext *context = gimp_get_user_context (group->gimp);
@@ -309,54 +236,3 @@ plug_in_actions_add_proc (GimpActionGroup *group,
tooltip);
}
}
static void
plug_in_actions_build_path (GimpActionGroup *group,
const gchar *path_translated)
{
GHashTable *path_table;
gchar *copy_translated;
gchar *p2;
path_table = g_object_get_data (G_OBJECT (group), "plug-in-path-table");
if (! path_table)
{
path_table = g_hash_table_new_full (g_str_hash, g_str_equal,
g_free, NULL);
g_object_set_data_full (G_OBJECT (group), "plug-in-path-table",
path_table,
(GDestroyNotify) g_hash_table_destroy);
}
copy_translated = g_strdup (path_translated);
p2 = strrchr (copy_translated, '/');
if (p2 && ! g_hash_table_lookup (path_table, copy_translated))
{
GimpAction *action;
gchar *label;
label = p2 + 1;
#if 0
g_print ("adding plug-in submenu '%s' (%s)\n",
copy_translated, label);
#endif
action = gimp_action_impl_new (copy_translated, label, NULL, NULL, NULL);
gimp_action_group_add_action (group, action);
g_object_unref (action);
g_hash_table_insert (path_table, g_strdup (copy_translated), action);
*p2 = '\0';
/* recursively call ourselves with the last part of the path removed */
plug_in_actions_build_path (group, copy_translated);
}
g_free (copy_translated);
}

View File

@@ -119,16 +119,16 @@ plug_in_run_cmd_callback (GimpAction *action,
{
GimpItemTreeView *view = GIMP_ITEM_TREE_VIEW (data);
GimpImage *image;
GimpItem *item;
GList *items;
image = gimp_item_tree_view_get_image (view);
if (image)
item = GIMP_ITEM_TREE_VIEW_GET_CLASS (view)->get_active_item (image);
items = GIMP_ITEM_TREE_VIEW_GET_CLASS (view)->get_selected_items (image);
else
item = NULL;
items = NULL;
args = procedure_commands_get_item_args (procedure, image, item);
args = procedure_commands_get_items_args (procedure, image, items);
}
else
{

View File

@@ -149,9 +149,9 @@ procedure_commands_get_image_args (GimpProcedure *procedure,
}
GimpValueArray *
procedure_commands_get_item_args (GimpProcedure *procedure,
GimpImage *image,
GimpItem *item)
procedure_commands_get_items_args (GimpProcedure *procedure,
GimpImage *image,
GList *items_list)
{
GimpValueArray *args;
gint n_args = 0;
@@ -178,21 +178,49 @@ procedure_commands_get_item_args (GimpProcedure *procedure,
if (gimp_value_array_length (args) > n_args &&
GIMP_IS_PARAM_SPEC_ITEM (procedure->args[n_args]))
{
if (item &&
g_type_is_a (G_TYPE_FROM_INSTANCE (item),
G_PARAM_SPEC_VALUE_TYPE (procedure->args[n_args])))
if (items_list)
{
g_printerr ("%s: plug-in procedures expecting a single item are deprecated!\n",
G_STRFUNC);
g_value_set_object (gimp_value_array_index (args, n_args),
item);
items_list->data);
n_args++;
}
else
{
g_warning ("Uh-oh, no active item for the plug-in!");
g_warning ("Uh-oh, no selected items for the plug-in!");
gimp_value_array_unref (args);
return NULL;
}
}
else if (gimp_value_array_length (args) > n_args + 1 &&
G_IS_PARAM_SPEC_INT (procedure->args[n_args]) &&
GIMP_IS_PARAM_SPEC_OBJECT_ARRAY (procedure->args[n_args + 1]))
{
GimpItem **items = NULL;
gint n_items;
n_items = g_list_length (items_list);
g_value_set_int (gimp_value_array_index (args, n_args++),
n_items);
if (items_list)
{
GList *iter;
gint i;
items = g_new (GimpItem *, n_items);
for (iter = items_list, i = 0; iter; iter = iter->next, i++)
items[i] = iter->data;
}
gimp_value_set_object_array (gimp_value_array_index (args, n_args++),
GIMP_TYPE_ITEM,
(GObject **) items, n_items);
g_free (items);
}
}
}
@@ -262,7 +290,7 @@ procedure_commands_get_display_args (GimpProcedure *procedure,
}
else
{
g_warning ("Uh-oh, no active drawable for the plug-in!");
g_warning ("Uh-oh, no selected drawables for the plug-in!");
gimp_value_array_unref (args);
g_list_free (drawables_list);

View File

@@ -24,9 +24,9 @@ GimpValueArray * procedure_commands_get_data_args (GimpProcedure *procedure,
GimpObject *object);
GimpValueArray * procedure_commands_get_image_args (GimpProcedure *procedure,
GimpImage *image);
GimpValueArray * procedure_commands_get_item_args (GimpProcedure *procedure,
GimpValueArray * procedure_commands_get_items_args (GimpProcedure *procedure,
GimpImage *image,
GimpItem *item);
GList *items);
GimpValueArray * procedure_commands_get_display_args (GimpProcedure *procedure,
GimpDisplay *display,
GimpObject *settings);

View File

@@ -39,12 +39,8 @@
static const GimpActionEntry quick_mask_actions[] =
{
{ "quick-mask-popup", NULL,
NC_("quick-mask-action", "Quick Mask Menu"), NULL, NULL, NULL,
GIMP_HELP_QUICK_MASK },
{ "quick-mask-configure", NULL,
NC_("quick-mask-action", "_Configure Color and Opacity..."), NULL, NULL,
NC_("quick-mask-action", "_Configure Color and Opacity..."), NULL, { NULL }, NULL,
quick_mask_configure_cmd_callback,
GIMP_HELP_QUICK_MASK_EDIT }
};
@@ -52,7 +48,7 @@ static const GimpActionEntry quick_mask_actions[] =
static const GimpToggleActionEntry quick_mask_toggle_actions[] =
{
{ "quick-mask-toggle", GIMP_ICON_QUICK_MASK_ON,
NC_("quick-mask-action", "Toggle _Quick Mask"), "<shift>Q",
NC_("quick-mask-action", "Toggle _Quick Mask"), NULL, { "<shift>Q", NULL },
NC_("quick-mask-action", "Toggle Quick Mask on/off"),
quick_mask_toggle_cmd_callback,
FALSE,
@@ -62,12 +58,12 @@ static const GimpToggleActionEntry quick_mask_toggle_actions[] =
static const GimpRadioActionEntry quick_mask_invert_actions[] =
{
{ "quick-mask-invert-on", NULL,
NC_("quick-mask-action", "Mask _Selected Areas"), NULL, NULL,
NC_("quick-mask-action", "Mask _Selected Areas"), NULL, { NULL }, NULL,
TRUE,
GIMP_HELP_QUICK_MASK_INVERT },
{ "quick-mask-invert-off", NULL,
NC_("quick-mask-action", "Mask _Unselected Areas"), NULL, NULL,
NC_("quick-mask-action", "Mask _Unselected Areas"), NULL, { NULL }, NULL,
FALSE,
GIMP_HELP_QUICK_MASK_INVERT }
};
@@ -99,14 +95,14 @@ quick_mask_actions_update (GimpActionGroup *group,
GimpImage *image = action_data_get_image (data);
gboolean quick_mask_state = FALSE;
gboolean quick_mask_inverted = FALSE;
GimpRGB quick_mask_color;
GeglColor *quick_mask_color = NULL;
if (image)
{
quick_mask_state = gimp_image_get_quick_mask_state (image);
quick_mask_inverted = gimp_image_get_quick_mask_inverted (image);
gimp_image_get_quick_mask_color (image, &quick_mask_color);
quick_mask_color = gimp_image_get_quick_mask_color (image);
}
#define SET_SENSITIVE(action,sensitive) \
@@ -129,8 +125,8 @@ quick_mask_actions_update (GimpActionGroup *group,
SET_SENSITIVE ("quick-mask-configure", image);
if (image)
SET_COLOR ("quick-mask-configure", &quick_mask_color);
if (quick_mask_color)
SET_COLOR ("quick-mask-configure", quick_mask_color);
#undef SET_SENSITIVE
#undef SET_ACTIVE

View File

@@ -52,12 +52,13 @@ static void quick_mask_configure_callback (GtkWidget *dialog,
GimpChannel *channel,
GimpContext *context,
const gchar *channel_name,
const GimpRGB *channel_color,
GeglColor *channel_color,
gboolean save_selection,
gboolean channel_visible,
GimpColorTag channel_color_tag,
gboolean channel_lock_content,
gboolean channel_lock_position,
gboolean channel_lock_visibility,
gpointer user_data);
@@ -116,9 +117,9 @@ quick_mask_configure_cmd_callback (GimpAction *action,
if (! dialog)
{
GimpRGB color;
GeglColor *color;
gimp_image_get_quick_mask_color (image, &color);
color = gimp_image_get_quick_mask_color (image);
dialog = channel_options_dialog_new (image, NULL,
action_data_get_context (data),
@@ -132,11 +133,12 @@ quick_mask_configure_cmd_callback (GimpAction *action,
_("_Mask opacity:"),
FALSE,
NULL,
&color,
color,
FALSE,
GIMP_COLOR_TAG_NONE,
FALSE,
FALSE,
FALSE,
quick_mask_configure_callback,
NULL);
@@ -157,19 +159,20 @@ quick_mask_configure_callback (GtkWidget *dialog,
GimpChannel *channel,
GimpContext *context,
const gchar *channel_name,
const GimpRGB *channel_color,
GeglColor *channel_color,
gboolean save_selection,
gboolean channel_visible,
GimpColorTag channel_color_tag,
gboolean channel_lock_content,
gboolean channel_lock_position,
gboolean channel_lock_visibility,
gpointer user_data)
{
GimpRGB old_color;
GeglColor *old_color;
gimp_image_get_quick_mask_color (image, &old_color);
old_color = gimp_image_get_quick_mask_color (image);
if (gimp_rgba_distance (&old_color, channel_color) > RGBA_EPSILON)
if (! gimp_color_is_perceptually_identical (old_color, channel_color))
{
gimp_image_set_quick_mask_color (image, channel_color);
gimp_image_flush (image);

View File

@@ -34,17 +34,10 @@
#include "gimp-intl.h"
static const GimpActionEntry sample_points_actions[] =
{
{ "sample-points-popup", GIMP_ICON_SAMPLE_POINT,
NC_("sample-points-action", "Sample Point Menu"), NULL, NULL, NULL,
GIMP_HELP_SAMPLE_POINT_DIALOG }
};
static const GimpToggleActionEntry sample_points_toggle_actions[] =
{
{ "sample-points-sample-merged", NULL,
NC_("sample-points-action", "_Sample Merged"), "",
NC_("sample-points-action", "_Sample Merged"), NULL, { NULL },
NC_("sample-points-action",
"Use the composite color of all visible layers"),
sample_points_sample_merged_cmd_callback,
@@ -56,10 +49,6 @@ static const GimpToggleActionEntry sample_points_toggle_actions[] =
void
sample_points_actions_setup (GimpActionGroup *group)
{
gimp_action_group_add_actions (group, "sample-points-action",
sample_points_actions,
G_N_ELEMENTS (sample_points_actions));
gimp_action_group_add_toggle_actions (group, "sample-points-action",
sample_points_toggle_actions,
G_N_ELEMENTS (sample_points_toggle_actions));

View File

@@ -40,99 +40,99 @@
static const GimpActionEntry select_actions[] =
{
{ "selection-popup", GIMP_ICON_SELECTION,
NC_("select-action", "Selection Editor Menu"), NULL, NULL, NULL,
GIMP_HELP_SELECTION_DIALOG },
{ "select-menu", NULL, NC_("select-action", "_Select") },
{ "select-all", GIMP_ICON_SELECTION_ALL,
NC_("select-action", "_All"), "<primary>A",
NC_("select-action", "_All"), NULL, { "<primary>A", NULL },
NC_("select-action", "Select everything"),
select_all_cmd_callback,
GIMP_HELP_SELECTION_ALL },
{ "select-none", GIMP_ICON_SELECTION_NONE,
NC_("select-action", "_None"), "<primary><shift>A",
NC_("select-action", "_None"), NULL, { "<primary><shift>A", NULL },
NC_("select-action", "Dismiss the selection"),
select_none_cmd_callback,
GIMP_HELP_SELECTION_NONE },
{ "select-invert", GIMP_ICON_INVERT,
NC_("select-action", "_Invert"), "<primary>I",
NC_("select-action", "_Invert"), NULL, { "<primary>I", NULL },
NC_("select-action", "Invert the selection"),
select_invert_cmd_callback,
GIMP_HELP_SELECTION_INVERT },
{ "select-float", GIMP_ICON_LAYER_FLOATING_SELECTION,
NC_("select-action", "_Float"), "<primary><shift>L",
NC_("select-action", "Create a floating selection"),
select_float_cmd_callback,
{ "select-cut-float", GIMP_ICON_LAYER_FLOATING_SELECTION,
NC_("select-action", "Cu_t and Float"), NULL, { "<primary><shift>L", NULL },
NC_("select-action", "Cut the selection directly into a floating selection"),
select_cut_float_cmd_callback,
GIMP_HELP_SELECTION_FLOAT },
{ "select-copy-float", GIMP_ICON_LAYER_FLOATING_SELECTION,
NC_("select-action", "_Copy and Float"), NULL, { NULL },
NC_("select-action", "Copy the selection directly into a floating selection"),
select_copy_float_cmd_callback,
GIMP_HELP_SELECTION_FLOAT },
{ "select-feather", NULL,
NC_("select-action", "Fea_ther..."), NULL,
NC_("select-action", "Fea_ther..."), NULL, { NULL },
NC_("select-action",
"Blur the selection border so that it fades out smoothly"),
select_feather_cmd_callback,
GIMP_HELP_SELECTION_FEATHER },
{ "select-sharpen", NULL,
NC_("select-action", "_Sharpen"), NULL,
NC_("select-action", "_Sharpen"), NULL, { NULL },
NC_("select-action", "Remove fuzziness from the selection"),
select_sharpen_cmd_callback,
GIMP_HELP_SELECTION_SHARPEN },
{ "select-shrink", GIMP_ICON_SELECTION_SHRINK,
NC_("select-action", "S_hrink..."), NULL,
NC_("select-action", "S_hrink..."), NULL, { NULL },
NC_("select-action", "Contract the selection"),
select_shrink_cmd_callback,
GIMP_HELP_SELECTION_SHRINK },
{ "select-grow", GIMP_ICON_SELECTION_GROW,
NC_("select-action", "_Grow..."), NULL,
NC_("select-action", "_Grow..."), NULL, { NULL },
NC_("select-action", "Enlarge the selection"),
select_grow_cmd_callback,
GIMP_HELP_SELECTION_GROW },
{ "select-border", GIMP_ICON_SELECTION_BORDER,
NC_("select-action", "Bo_rder..."), NULL,
NC_("select-action", "Bo_rder..."), NULL, { NULL },
NC_("select-action", "Replace the selection by its border"),
select_border_cmd_callback,
GIMP_HELP_SELECTION_BORDER },
{ "select-flood", NULL,
NC_("select-action", "Re_move Holes"), NULL,
NC_("select-action", "Re_move Holes"), NULL, { NULL },
NC_("select-action", "Remove holes from the selection"),
select_flood_cmd_callback,
GIMP_HELP_SELECTION_FLOOD },
{ "select-save", GIMP_ICON_SELECTION_TO_CHANNEL,
NC_("select-action", "Save to _Channel"), NULL,
NC_("select-action", "Save to _Channel"), NULL, { NULL },
NC_("select-action", "Save the selection to a channel"),
select_save_cmd_callback,
GIMP_HELP_SELECTION_TO_CHANNEL },
{ "select-fill", GIMP_ICON_TOOL_BUCKET_FILL,
NC_("select-action", "_Fill Selection Outline..."), NULL,
NC_("select-action", "_Fill Selection Outline..."), NULL, { NULL },
NC_("select-action", "Fill the selection outline"),
select_fill_cmd_callback,
GIMP_HELP_SELECTION_FILL },
{ "select-fill-last-values", GIMP_ICON_TOOL_BUCKET_FILL,
NC_("select-action", "_Fill Selection Outline with last values"), NULL,
NC_("select-action", "_Fill Selection Outline with last values"), NULL, { NULL },
NC_("select-action", "Fill the selection outline with last used values"),
select_fill_last_vals_cmd_callback,
GIMP_HELP_SELECTION_FILL },
{ "select-stroke", GIMP_ICON_SELECTION_STROKE,
NC_("select-action", "_Stroke Selection..."), NULL,
NC_("select-action", "_Stroke Selection..."), NULL, { NULL },
NC_("select-action", "Paint along the selection outline"),
select_stroke_cmd_callback,
GIMP_HELP_SELECTION_STROKE },
{ "select-stroke-last-values", GIMP_ICON_SELECTION_STROKE,
NC_("select-action", "_Stroke Selection with last values"), NULL,
NC_("select-action", "_Stroke Selection with last values"), NULL, { NULL },
NC_("select-action", "Stroke the selection with last used values"),
select_stroke_last_vals_cmd_callback,
GIMP_HELP_SELECTION_STROKE }
@@ -152,11 +152,9 @@ select_actions_update (GimpActionGroup *group,
gpointer data)
{
GimpImage *image = action_data_get_image (data);
GimpDrawable *drawable = NULL;
gboolean fs = FALSE;
gboolean sel = FALSE;
gboolean writable = FALSE;
gboolean children = FALSE;
gboolean sel_all = FALSE;
GList *drawables = NULL;
GList *iter;
@@ -165,7 +163,6 @@ select_actions_update (GimpActionGroup *group,
if (image)
{
drawable = gimp_image_get_active_drawable (image);
drawables = gimp_image_get_selected_drawables (image);
for (iter = drawables; iter; iter = iter->next)
@@ -180,25 +177,24 @@ select_actions_update (GimpActionGroup *group,
break;
}
if (drawable)
{
writable = ! gimp_item_is_content_locked (GIMP_ITEM (drawable), NULL);
if (gimp_viewable_get_children (GIMP_VIEWABLE (drawable)))
children = TRUE;
}
fs = (gimp_image_get_floating_selection (image) != NULL);
sel = ! gimp_channel_is_empty (gimp_image_get_mask (image));
fs = (gimp_image_get_floating_selection (image) != NULL);
sel = ! gimp_channel_is_empty (gimp_image_get_mask (image));
sel_all = gimp_channel_is_full (gimp_image_get_mask (image));
}
#define SET_SENSITIVE(action,condition) \
gimp_action_group_set_action_sensitive (group, action, (condition) != 0, NULL)
SET_SENSITIVE ("select-all", image);
SET_SENSITIVE ("select-all", image && ! sel_all);
SET_SENSITIVE ("select-none", image && sel);
SET_SENSITIVE ("select-invert", image);
SET_SENSITIVE ("select-float", writable && !children && sel);
SET_SENSITIVE ("select-cut-float", g_list_length (drawables) == 1 && sel &&
! gimp_item_is_content_locked (drawables->data, NULL) &&
! gimp_viewable_get_children (drawables->data));
SET_SENSITIVE ("select-copy-float", g_list_length (drawables) == 1 && sel &&
! gimp_item_is_content_locked (drawables->data, NULL) &&
! gimp_viewable_get_children (drawables->data));
SET_SENSITIVE ("select-feather", image && sel);
SET_SENSITIVE ("select-sharpen", image && sel);

View File

@@ -67,6 +67,10 @@ static void select_shrink_callback (GtkWidget *widget,
gdouble size,
GimpUnit unit,
gpointer data);
static void select_float (GimpAction *action,
GVariant *value,
gboolean cut,
gpointer data);
/* public functions */
@@ -108,33 +112,19 @@ select_invert_cmd_callback (GimpAction *action,
}
void
select_float_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data)
select_cut_float_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data)
{
GimpImage *image;
GtkWidget *widget;
GList *drawables;
GError *error = NULL;
return_if_no_image (image, data);
return_if_no_widget (widget, data);
select_float (action, value, TRUE, data);
}
drawables = gimp_image_get_selected_drawables (image);
if (gimp_selection_float (GIMP_SELECTION (gimp_image_get_mask (image)),
drawables,
action_data_get_context (data),
TRUE, 0, 0, &error))
{
gimp_image_flush (image);
}
else
{
gimp_message_literal (image->gimp,
G_OBJECT (widget), GIMP_MESSAGE_WARNING,
error->message);
g_clear_error (&error);
}
g_list_free (drawables);
void
select_copy_float_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data)
{
select_float (action, value, FALSE, data);
}
void
@@ -447,15 +437,17 @@ select_fill_cmd_callback (GimpAction *action,
gpointer data)
{
GimpImage *image;
GList *selection;
return_if_no_image (image, data);
selection = g_list_prepend (NULL, gimp_image_get_mask (image)),
items_fill_cmd_callback (action,
image, GIMP_ITEM (gimp_image_get_mask (image)),
"gimp-selection-fill-dialog",
image, selection,
_("Fill Selection Outline"),
GIMP_ICON_TOOL_BUCKET_FILL,
GIMP_HELP_SELECTION_FILL,
data);
g_list_free (selection);
}
void
@@ -464,12 +456,12 @@ select_fill_last_vals_cmd_callback (GimpAction *action,
gpointer data)
{
GimpImage *image;
GList *selection;
return_if_no_image (image, data);
items_fill_last_vals_cmd_callback (action,
image,
GIMP_ITEM (gimp_image_get_mask (image)),
data);
selection = g_list_prepend (NULL, gimp_image_get_mask (image)),
items_fill_last_vals_cmd_callback (action, image, selection, data);
g_list_free (selection);
}
void
@@ -478,15 +470,16 @@ select_stroke_cmd_callback (GimpAction *action,
gpointer data)
{
GimpImage *image;
GList *selection;
return_if_no_image (image, data);
items_stroke_cmd_callback (action,
image, GIMP_ITEM (gimp_image_get_mask (image)),
"gimp-selection-stroke-dialog",
selection = g_list_prepend (NULL, gimp_image_get_mask (image)),
items_stroke_cmd_callback (action, image, selection,
_("Stroke Selection"),
GIMP_ICON_SELECTION_STROKE,
GIMP_HELP_SELECTION_STROKE,
data);
g_list_free (selection);
}
void
@@ -495,12 +488,12 @@ select_stroke_last_vals_cmd_callback (GimpAction *action,
gpointer data)
{
GimpImage *image;
GList *selection;
return_if_no_image (image, data);
items_stroke_last_vals_cmd_callback (action,
image,
GIMP_ITEM (gimp_image_get_mask (image)),
data);
selection = g_list_prepend (NULL, gimp_image_get_mask (image)),
items_stroke_last_vals_cmd_callback (action, image, selection, data);
g_list_free (selection);
}
@@ -689,3 +682,34 @@ select_shrink_callback (GtkWidget *widget,
TRUE);
gimp_image_flush (image);
}
static void
select_float (GimpAction *action,
GVariant *value,
gboolean cut,
gpointer data)
{
GimpImage *image;
GtkWidget *widget;
GList *drawables;
GError *error = NULL;
return_if_no_image (image, data);
return_if_no_widget (widget, data);
drawables = gimp_image_get_selected_drawables (image);
if (gimp_selection_float (GIMP_SELECTION (gimp_image_get_mask (image)),
drawables,
action_data_get_context (data),
cut, 0, 0, &error))
{
gimp_image_flush (image);
}
else
{
gimp_message_literal (image->gimp,
G_OBJECT (widget), GIMP_MESSAGE_WARNING,
error->message);
g_clear_error (&error);
}
g_list_free (drawables);
}

View File

@@ -28,7 +28,10 @@ void select_none_cmd_callback (GimpAction *action,
void select_invert_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data);
void select_float_cmd_callback (GimpAction *action,
void select_cut_float_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data);
void select_copy_float_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data);
void select_feather_cmd_callback (GimpAction *action,

View File

@@ -38,36 +38,32 @@
static const GimpActionEntry templates_actions[] =
{
{ "templates-popup", GIMP_ICON_TEMPLATE,
NC_("templates-action", "Templates Menu"), NULL, NULL, NULL,
GIMP_HELP_TEMPLATE_DIALOG },
{ "templates-create-image", GIMP_ICON_IMAGE,
NC_("templates-action", "_Create Image from Template"), "",
NC_("templates-action", "_Create Image from Template"), NULL, { NULL },
NC_("templates-action", "Create a new image from the selected template"),
templates_create_image_cmd_callback,
GIMP_HELP_TEMPLATE_IMAGE_NEW },
{ "templates-new", GIMP_ICON_DOCUMENT_NEW,
NC_("templates-action", "_New Template..."), NULL,
NC_("templates-action", "_New Template..."), NULL, { NULL },
NC_("templates-action", "Create a new template"),
templates_new_cmd_callback,
GIMP_HELP_TEMPLATE_NEW },
{ "templates-duplicate", GIMP_ICON_OBJECT_DUPLICATE,
NC_("templates-action", "D_uplicate Template..."), "",
NC_("templates-action", "D_uplicate Template..."), NULL, { NULL },
NC_("templates-action", "Duplicate this template"),
templates_duplicate_cmd_callback,
GIMP_HELP_TEMPLATE_DUPLICATE },
{ "templates-edit", GIMP_ICON_EDIT,
NC_("templates-action", "_Edit Template..."), NULL,
NC_("templates-action", "_Edit Template..."), NULL, { NULL },
NC_("templates-action", "Edit this template"),
templates_edit_cmd_callback,
GIMP_HELP_TEMPLATE_EDIT },
{ "templates-delete", GIMP_ICON_EDIT_DELETE,
NC_("templates-action", "_Delete Template"), NULL,
NC_("templates-action", "_Delete Template"), NULL, { NULL },
NC_("templates-action", "Delete this template"),
templates_delete_cmd_callback,
GIMP_HELP_TEMPLATE_DELETE }

View File

@@ -241,7 +241,7 @@ templates_delete_cmd_callback (GimpAction *action,
delete_data->template = template;
dialog =
gimp_message_dialog_new (_("Delete Template"), "edit-delete",
gimp_message_dialog_new (_("Delete Template"), GIMP_ICON_EDIT_DELETE,
GTK_WIDGET (editor), 0,
gimp_standard_help_func, NULL,

View File

@@ -37,17 +37,18 @@
static const GimpActionEntry text_editor_actions[] =
{
{ "text-editor-toolbar", GIMP_ICON_EDIT,
"Text Editor Toolbar", NULL, NULL, NULL,
NC_("text-editor-action", "Text Editor Toolbar"),
NULL, { NULL }, NULL, NULL,
GIMP_HELP_TEXT_EDITOR_DIALOG },
{ "text-editor-load", GIMP_ICON_DOCUMENT_OPEN,
NC_("text-editor-action", "Open"), NULL,
NC_("text-editor-action", "Open"), NULL, { NULL },
NC_("text-editor-action", "Load text from file"),
text_editor_load_cmd_callback,
NULL },
{ "text-editor-clear", GIMP_ICON_EDIT_CLEAR,
NC_("text-editor-action", "Clear"), NULL,
NC_("text-editor-action", "Clear"), NULL, { NULL },
NC_("text-editor-action", "Clear all text"),
text_editor_clear_cmd_callback,
NULL }
@@ -56,37 +57,37 @@ static const GimpActionEntry text_editor_actions[] =
static const GimpRadioActionEntry text_editor_direction_actions[] =
{
{ "text-editor-direction-ltr", GIMP_ICON_FORMAT_TEXT_DIRECTION_LTR,
NC_("text-editor-action", "LTR"), NULL,
NC_("text-editor-action", "LTR"), NULL, { NULL },
NC_("text-editor-action", "From left to right"),
GIMP_TEXT_DIRECTION_LTR,
NULL },
{ "text-editor-direction-rtl", GIMP_ICON_FORMAT_TEXT_DIRECTION_RTL,
NC_("text-editor-action", "RTL"), NULL,
NC_("text-editor-action", "RTL"), NULL, { NULL },
NC_("text-editor-action", "From right to left"),
GIMP_TEXT_DIRECTION_RTL,
NULL },
{ "text-editor-direction-ttb-rtl", GIMP_ICON_FORMAT_TEXT_DIRECTION_TTB_RTL,
NC_("text-editor-action", "TTB-RTL"), NULL,
NC_("text-editor-action", "TTB-RTL"), NULL, { NULL },
NC_("text-editor-action", "Vertical, right to left (mixed orientation)"),
GIMP_TEXT_DIRECTION_TTB_RTL,
NULL },
{ "text-editor-direction-ttb-rtl-upright", GIMP_ICON_FORMAT_TEXT_DIRECTION_TTB_RTL_UPRIGHT,
NC_("text-editor-action", "TTB-RTL-UPRIGHT"), NULL,
NC_("text-editor-action", "TTB-RTL-UPRIGHT"), NULL, { NULL },
NC_("text-editor-action", "Vertical, right to left (upright orientation)"),
GIMP_TEXT_DIRECTION_TTB_RTL_UPRIGHT,
NULL },
{ "text-editor-direction-ttb-ltr", GIMP_ICON_FORMAT_TEXT_DIRECTION_TTB_LTR,
NC_("text-editor-action", "TTB-LTR"), NULL,
NC_("text-editor-action", "TTB-LTR"), NULL, { NULL },
NC_("text-editor-action", "Vertical, left to right (mixed orientation)"),
GIMP_TEXT_DIRECTION_TTB_LTR,
NULL },
{ "text-editor-direction-ttb-ltr-upright", GIMP_ICON_FORMAT_TEXT_DIRECTION_TTB_LTR_UPRIGHT,
NC_("text-editor-action", "TTB-LTR-UPRIGHT"), NULL,
NC_("text-editor-action", "TTB-LTR-UPRIGHT"), NULL, { NULL },
NC_("text-editor-action", "Vertical, left to right (upright orientation)"),
GIMP_TEXT_DIRECTION_TTB_LTR_UPRIGHT,
NULL },

View File

@@ -77,8 +77,7 @@ text_editor_load_cmd_callback (GimpAction *action,
gtk_window_set_position (GTK_WINDOW (dialog), GTK_WIN_POS_MOUSE);
gtk_window_set_destroy_with_parent (GTK_WINDOW (dialog), TRUE);
g_object_add_weak_pointer (G_OBJECT (dialog),
(gpointer) &editor->file_dialog);
g_set_weak_pointer (&editor->file_dialog, dialog);
g_signal_connect (dialog, "response",
G_CALLBACK (text_editor_load_response),

View File

@@ -46,50 +46,46 @@
static const GimpActionEntry text_tool_actions[] =
{
{ "text-tool-popup", NULL,
NC_("text-tool-action", "Text Tool Menu"), NULL, NULL, NULL,
NULL },
{ "text-tool-cut", GIMP_ICON_EDIT_CUT,
NC_("text-tool-action", "Cu_t"), NULL, "<primary>X",
NC_("text-tool-action", "Cu_t"), NULL, { "<primary>X", NULL }, NULL,
text_tool_cut_cmd_callback,
NULL },
{ "text-tool-copy", GIMP_ICON_EDIT_COPY,
NC_("text-tool-action", "_Copy"), NULL, "<primary>C",
NC_("text-tool-action", "_Copy"), NULL, { "<primary>C", NULL }, NULL,
text_tool_copy_cmd_callback,
NULL },
{ "text-tool-paste", GIMP_ICON_EDIT_PASTE,
NC_("text-tool-action", "_Paste"), NULL, "<primary>V",
NC_("text-tool-action", "_Paste"), NULL, { "<primary>V", NULL }, NULL,
text_tool_paste_cmd_callback,
NULL },
{ "text-tool-delete", GIMP_ICON_EDIT_DELETE,
NC_("text-tool-action", "_Delete"), NULL, NULL,
NC_("text-tool-action", "_Delete"), NULL, { NULL }, NULL,
text_tool_delete_cmd_callback,
NULL },
{ "text-tool-load", GIMP_ICON_DOCUMENT_OPEN,
NC_("text-tool-action", "_Open text file..."), NULL, NULL,
NC_("text-tool-action", "_Open text file..."), NULL, { NULL }, NULL,
text_tool_load_cmd_callback,
NULL },
{ "text-tool-clear", GIMP_ICON_EDIT_CLEAR,
NC_("text-tool-action", "Cl_ear"), NULL,
NC_("text-tool-action", "Cl_ear"), NULL, { NULL },
NC_("text-tool-action", "Clear all text"),
text_tool_clear_cmd_callback,
NULL },
{ "text-tool-text-to-path", GIMP_ICON_PATH,
NC_("text-tool-action", "_Path from Text"), "",
NC_("text-tool-action", "_Path from Text"), NULL, { NULL },
NC_("text-tool-action",
"Create a path from the outlines of the current text"),
text_tool_text_to_path_cmd_callback,
NULL },
{ "text-tool-text-along-path", GIMP_ICON_PATH,
NC_("text-tool-action", "Text _along Path"), "",
NC_("text-tool-action", "Text _along Path"), NULL, { NULL },
NC_("text-tool-action",
"Bend the text along the currently active path"),
text_tool_text_along_path_cmd_callback,
@@ -99,32 +95,32 @@ static const GimpActionEntry text_tool_actions[] =
static const GimpRadioActionEntry text_tool_direction_actions[] =
{
{ "text-tool-direction-ltr", GIMP_ICON_FORMAT_TEXT_DIRECTION_LTR,
NC_("text-tool-action", "From left to right"), NULL, NULL,
NC_("text-tool-action", "From left to right"), NULL, { NULL }, NULL,
GIMP_TEXT_DIRECTION_LTR,
NULL },
{ "text-tool-direction-rtl", GIMP_ICON_FORMAT_TEXT_DIRECTION_RTL,
NC_("text-tool-action", "From right to left"), NULL, NULL,
NC_("text-tool-action", "From right to left"), NULL, { NULL }, NULL,
GIMP_TEXT_DIRECTION_RTL,
NULL },
{ "text-tool-direction-ttb-rtl", GIMP_ICON_FORMAT_TEXT_DIRECTION_TTB_RTL,
NC_("text-tool-action", "Vertical, right to left (mixed orientation)"), NULL, NULL,
NC_("text-tool-action", "Vertical, right to left (mixed orientation)"), NULL, { NULL }, NULL,
GIMP_TEXT_DIRECTION_TTB_RTL,
NULL },
{ "text-tool-direction-ttb-rtl-upright", GIMP_ICON_FORMAT_TEXT_DIRECTION_TTB_RTL_UPRIGHT,
NC_("text-tool-action", "Vertical, right to left (upright orientation)"), NULL, NULL,
NC_("text-tool-action", "Vertical, right to left (upright orientation)"), NULL, { NULL }, NULL,
GIMP_TEXT_DIRECTION_TTB_RTL_UPRIGHT,
NULL },
{ "text-tool-direction-ttb-ltr", GIMP_ICON_FORMAT_TEXT_DIRECTION_TTB_LTR,
NC_("text-tool-action", "Vertical, left to right (mixed orientation)"), NULL, NULL,
NC_("text-tool-action", "Vertical, left to right (mixed orientation)"), NULL, { NULL }, NULL,
GIMP_TEXT_DIRECTION_TTB_LTR,
NULL },
{ "text-tool-direction-ttb-ltr-upright", GIMP_ICON_FORMAT_TEXT_DIRECTION_TTB_LTR_UPRIGHT,
NC_("text-tool-action", "Vertical, left to right (upright orientation)"), NULL, NULL,
NC_("text-tool-action", "Vertical, left to right (upright orientation)"), NULL, { NULL }, NULL,
GIMP_TEXT_DIRECTION_TTB_LTR_UPRIGHT,
NULL }
};
@@ -162,7 +158,7 @@ text_tool_actions_update (GimpActionGroup *group,
GimpDisplay *display = GIMP_TOOL (text_tool)->display;
GimpImage *image = gimp_display_get_image (display);
GList *layers;
GimpVectors *vectors;
GList *paths;
GimpDisplayShell *shell;
GtkClipboard *clipboard;
gboolean text_layer = FALSE;
@@ -176,7 +172,7 @@ text_tool_actions_update (GimpActionGroup *group,
if (g_list_length (layers) == 1)
text_layer = gimp_item_is_text_layer (GIMP_ITEM (layers->data));
vectors = gimp_image_get_active_vectors (image);
paths = gimp_image_get_selected_vectors (image);
text_sel = gimp_text_tool_get_has_text_selection (text_tool);
@@ -200,7 +196,7 @@ text_tool_actions_update (GimpActionGroup *group,
SET_SENSITIVE ("text-tool-clear", text_layer);
SET_SENSITIVE ("text-tool-load", image);
SET_SENSITIVE ("text-tool-text-to-path", text_layer);
SET_SENSITIVE ("text-tool-text-along-path", text_layer && vectors);
SET_SENSITIVE ("text-tool-text-along-path", text_layer && g_list_length (paths) == 1);
direction = gimp_text_tool_get_direction (text_tool);
for (i = 0; i < G_N_ELEMENTS (text_tool_direction_actions); i++)

View File

@@ -54,39 +54,19 @@ static void tool_options_actions_update_presets (GimpActionGroup *group,
static const GimpActionEntry tool_options_actions[] =
{
{ "tool-options-popup", GIMP_ICON_DIALOG_TOOL_OPTIONS,
NC_("tool-options-action", "Tool Options Menu"), NULL, NULL, NULL,
GIMP_HELP_TOOL_OPTIONS_DIALOG },
{ "tool-options-save-preset-menu", GIMP_ICON_DOCUMENT_SAVE,
NC_("tool-options-action", "_Save Tool Preset"), "", NULL, NULL,
GIMP_HELP_TOOL_OPTIONS_SAVE },
{ "tool-options-restore-preset-menu", GIMP_ICON_DOCUMENT_REVERT,
NC_("tool-options-action", "_Restore Tool Preset"), "", NULL, NULL,
GIMP_HELP_TOOL_OPTIONS_RESTORE },
{ "tool-options-edit-preset-menu", GIMP_ICON_EDIT,
NC_("tool-options-action", "E_dit Tool Preset"), NULL, NULL, NULL,
GIMP_HELP_TOOL_OPTIONS_EDIT },
{ "tool-options-delete-preset-menu", GIMP_ICON_EDIT_DELETE,
NC_("tool-options-action", "_Delete Tool Preset"), "", NULL, NULL,
GIMP_HELP_TOOL_OPTIONS_DELETE },
{ "tool-options-save-new-preset", GIMP_ICON_DOCUMENT_NEW,
NC_("tool-options-action", "_New Tool Preset..."), "", NULL,
NC_("tool-options-action", "_New Tool Preset..."), NULL, { NULL }, NULL,
tool_options_save_new_preset_cmd_callback,
GIMP_HELP_TOOL_OPTIONS_SAVE },
{ "tool-options-reset", GIMP_ICON_RESET,
NC_("tool-options-action", "R_eset Tool Options"), NULL,
NC_("tool-options-action", "R_eset Tool Options"), NULL, { NULL },
NC_("tool-options-action", "Reset to default values"),
tool_options_reset_cmd_callback,
GIMP_HELP_TOOL_OPTIONS_RESET },
{ "tool-options-reset-all", GIMP_ICON_RESET,
NC_("tool-options-action", "Reset _all Tool Options"), NULL,
NC_("tool-options-action", "Reset _all Tool Options"), NULL, { NULL },
NC_("tool-options-action", "Reset all tool options"),
tool_options_reset_all_cmd_callback,
GIMP_HELP_TOOL_OPTIONS_RESET }
@@ -108,10 +88,6 @@ tool_options_actions_setup (GimpActionGroup *group)
gimp_action_group_add_actions (group, "tool-options-action",
tool_options_actions,
G_N_ELEMENTS (tool_options_actions));
SET_HIDE_EMPTY ("tool-options-restore-preset-menu", FALSE);
SET_HIDE_EMPTY ("tool-options-edit-preset-menu", FALSE);
SET_HIDE_EMPTY ("tool-options-delete-preset-menu", FALSE);
}
void
@@ -121,11 +97,6 @@ tool_options_actions_update (GimpActionGroup *group,
GimpContext *context = gimp_get_user_context (group->gimp);
GimpToolInfo *tool_info = gimp_context_get_tool (context);
SET_VISIBLE ("tool-options-save-preset-menu", tool_info->presets);
SET_VISIBLE ("tool-options-restore-preset-menu", tool_info->presets);
SET_VISIBLE ("tool-options-edit-preset-menu", tool_info->presets);
SET_VISIBLE ("tool-options-delete-preset-menu", tool_info->presets);
tool_options_actions_update_presets (group, "tool-options-save-preset",
tool_options_save_preset_cmd_callback,
GIMP_HELP_TOOL_OPTIONS_SAVE,
@@ -191,11 +162,10 @@ tool_options_actions_update_presets (GimpActionGroup *group,
if (n_children > 0)
{
GimpEnumActionEntry entry;
GimpEnumActionEntry entry = { 0 };
entry.name = NULL;
entry.label = NULL;
entry.accelerator = "";
entry.tooltip = NULL;
entry.value = 0;
entry.value_variable = FALSE;

View File

@@ -40,19 +40,15 @@
static const GimpActionEntry tool_preset_editor_actions[] =
{
{ "tool-preset-editor-popup", GIMP_ICON_TOOL_PRESET,
NC_("tool-preset-editor-action", "Tool Preset Editor Menu"), NULL, NULL, NULL,
GIMP_HELP_TOOL_PRESET_EDITOR_DIALOG },
{ "tool-preset-editor-save", GIMP_ICON_DOCUMENT_SAVE,
NC_("tool-preset-editor-action", "_Save Tool Options to Preset"), NULL,
NC_("tool-preset-editor-action", "_Save Tool Options to Preset"), NULL, { NULL },
NC_("tool-preset-editor-action", "Save the active tool options to this "
"tool preset"),
tool_preset_editor_save_cmd_callback,
GIMP_HELP_TOOL_PRESET_SAVE },
{ "tool-preset-editor-restore", GIMP_ICON_DOCUMENT_REVERT,
NC_("tool-preset-editor-action", "_Restore Tool Preset"), NULL,
NC_("tool-preset-editor-action", "_Restore Tool Preset"), NULL, { NULL },
NC_("tool-preset-editor-action", "Restore this tool preset"),
tool_preset_editor_restore_cmd_callback,
GIMP_HELP_TOOL_PRESET_RESTORE }
@@ -62,7 +58,7 @@ static const GimpActionEntry tool_preset_editor_actions[] =
static const GimpToggleActionEntry tool_preset_editor_toggle_actions[] =
{
{ "tool-preset-editor-edit-active", GIMP_ICON_LINKED,
NC_("tool-preset-editor-action", "Edit Active Tool Preset"), NULL, NULL,
NC_("tool-preset-editor-action", "Edit Active Tool Preset"), NULL, { NULL }, NULL,
data_editor_edit_active_cmd_callback,
FALSE,
GIMP_HELP_TOOL_PRESET_EDITOR_EDIT_ACTIVE }

View File

@@ -42,55 +42,51 @@
static const GimpActionEntry tool_presets_actions[] =
{
{ "tool-presets-popup", GIMP_ICON_TOOL_PRESET,
NC_("tool-presets-action", "Tool Presets Menu"), NULL, NULL, NULL,
GIMP_HELP_TOOL_PRESET_DIALOG },
{ "tool-presets-new", GIMP_ICON_DOCUMENT_NEW,
NC_("tool-presets-action", "_New Tool Preset"), NULL,
NC_("tool-presets-action", "_New Tool Preset"), NULL, { NULL },
NC_("tool-presets-action", "Create a new tool preset"),
data_new_cmd_callback,
GIMP_HELP_TOOL_PRESET_NEW },
{ "tool-presets-duplicate", GIMP_ICON_OBJECT_DUPLICATE,
NC_("tool-presets-action", "D_uplicate Tool Preset"), NULL,
NC_("tool-presets-action", "D_uplicate Tool Preset"), NULL, { NULL },
NC_("tool-presets-action", "Duplicate this tool preset"),
data_duplicate_cmd_callback,
GIMP_HELP_TOOL_PRESET_DUPLICATE },
{ "tool-presets-copy-location", GIMP_ICON_EDIT_COPY,
NC_("tool-presets-action", "Copy Tool Preset _Location"), NULL,
NC_("tool-presets-action", "Copy Tool Preset _Location"), NULL, { NULL },
NC_("tool-presets-action", "Copy tool preset file location to clipboard"),
data_copy_location_cmd_callback,
GIMP_HELP_TOOL_PRESET_COPY_LOCATION },
{ "tool-presets-show-in-file-manager", GIMP_ICON_FILE_MANAGER,
NC_("tool-presets-action", "Show in _File Manager"), NULL,
NC_("tool-presets-action", "Show in _File Manager"), NULL, { NULL },
NC_("tool-presets-action", "Show tool preset file location in the file manager"),
data_show_in_file_manager_cmd_callback,
GIMP_HELP_TOOL_PRESET_SHOW_IN_FILE_MANAGER },
{ "tool-presets-save", GIMP_ICON_DOCUMENT_SAVE,
NC_("tool-presets-action", "_Save Tool Options to Preset"), NULL,
NC_("tool-presets-action", "_Save Tool Options to Preset"), NULL, { NULL },
NC_("tool-presets-action", "Save the active tool options to this "
"tool preset"),
tool_presets_save_cmd_callback,
GIMP_HELP_TOOL_PRESET_SAVE },
{ "tool-presets-restore", GIMP_ICON_DOCUMENT_REVERT,
NC_("tool-presets-action", "_Restore Tool Preset"), NULL,
NC_("tool-presets-action", "_Restore Tool Preset"), NULL, { NULL },
NC_("tool-presets-action", "Restore this tool preset"),
tool_presets_restore_cmd_callback,
GIMP_HELP_TOOL_PRESET_RESTORE },
{ "tool-presets-delete", GIMP_ICON_EDIT_DELETE,
NC_("tool-presets-action", "_Delete Tool Preset"), NULL,
NC_("tool-presets-action", "_Delete Tool Preset"), NULL, { NULL },
NC_("tool-presets-action", "Delete this tool preset"),
data_delete_cmd_callback,
GIMP_HELP_TOOL_PRESET_DELETE },
{ "tool-presets-refresh", GIMP_ICON_VIEW_REFRESH,
NC_("tool-presets-action", "_Refresh Tool Presets"), NULL,
NC_("tool-presets-action", "_Refresh Tool Presets"), NULL, { NULL },
NC_("tool-presets-action", "Refresh tool presets"),
data_refresh_cmd_callback,
GIMP_HELP_TOOL_PRESET_REFRESH }
@@ -99,7 +95,7 @@ static const GimpActionEntry tool_presets_actions[] =
static const GimpStringActionEntry tool_presets_edit_actions[] =
{
{ "tool-presets-edit", GIMP_ICON_EDIT,
NC_("tool-presets-action", "_Edit Tool Preset..."), NULL,
NC_("tool-presets-action", "_Edit Tool Preset..."), NULL, { NULL },
NC_("tool-presets-action", "Edit this tool preset"),
"gimp-tool-preset-editor",
GIMP_HELP_TOOL_PRESET_EDIT }

View File

@@ -42,31 +42,22 @@
#include "gimp-intl.h"
static const GimpActionEntry tools_actions[] =
{
{ "tools-menu", NULL, NC_("tools-action", "_Tools") },
{ "tools-select-menu", NULL, NC_("tools-action", "_Selection Tools") },
{ "tools-paint-menu", NULL, NC_("tools-action", "_Paint Tools") },
{ "tools-transform-menu", NULL, NC_("tools-action", "_Transform Tools") },
{ "tools-color-menu", NULL, NC_("tools-action", "_Color Tools") },
};
static const GimpStringActionEntry tools_alternative_actions[] =
{
{ "tools-by-color-select-short", GIMP_ICON_TOOL_BY_COLOR_SELECT,
NC_("tools-action", "_By Color"), NULL,
NC_("tools-action", "_By Color"), NULL, { NULL },
NC_("tools-action", "Select regions with similar colors"),
"gimp-by-color-select-tool",
GIMP_HELP_TOOL_BY_COLOR_SELECT },
{ "tools-rotate-arbitrary", GIMP_ICON_TOOL_ROTATE,
NC_("tools-action", "_Arbitrary Rotation..."), "",
NC_("tools-action", "_Arbitrary Rotation..."), NULL, { NULL },
NC_("tools-action", "Rotate drawable by an arbitrary angle"),
"gimp-rotate-layer",
GIMP_HELP_TOOL_ROTATE },
{ "tools-rotate-image-arbitrary", GIMP_ICON_TOOL_ROTATE,
NC_("tools-action", "_Arbitrary Rotation..."), "",
NC_("tools-action", "_Arbitrary Rotation..."), NULL, { NULL },
NC_("tools-action", "Rotate image by an arbitrary angle"),
"gimp-rotate-image",
GIMP_HELP_TOOL_ROTATE }
@@ -75,7 +66,7 @@ static const GimpStringActionEntry tools_alternative_actions[] =
static const GimpEnumActionEntry tools_color_average_radius_actions[] =
{
{ "tools-color-average-radius-set", GIMP_ICON_TOOL_COLOR_PICKER,
"Set Color Picker Radius", NULL, NULL,
"Set Color Picker Radius", NULL, { NULL }, NULL,
GIMP_ACTION_SELECT_SET, TRUE,
NULL }
};
@@ -83,14 +74,14 @@ static const GimpEnumActionEntry tools_color_average_radius_actions[] =
static const GimpDoubleActionEntry tools_paintbrush_pixel_size_actions[] =
{
{ "tools-paintbrush-pixel-size-set", GIMP_ICON_TOOL_MYPAINT_BRUSH,
"Set Brush Size in Pixel", NULL, NULL,
"Set Brush Size in Pixel", NULL, { NULL }, NULL,
1.0, NULL }
};
static const GimpEnumActionEntry tools_paintbrush_size_actions[] =
{
{ "tools-paintbrush-size-set", GIMP_ICON_TOOL_PAINTBRUSH,
"Set Brush Size", NULL, NULL,
"Set Brush Size", NULL, { NULL }, NULL,
GIMP_ACTION_SELECT_SET, TRUE,
NULL }
};
@@ -98,7 +89,7 @@ static const GimpEnumActionEntry tools_paintbrush_size_actions[] =
static const GimpEnumActionEntry tools_paintbrush_aspect_ratio_actions[] =
{
{ "tools-paintbrush-aspect-ratio-set", GIMP_ICON_TOOL_PAINTBRUSH,
"Set Brush Aspect Ratio", NULL, NULL,
"Set Brush Aspect Ratio", NULL, { NULL }, NULL,
GIMP_ACTION_SELECT_SET, TRUE,
NULL }
};
@@ -106,7 +97,7 @@ static const GimpEnumActionEntry tools_paintbrush_aspect_ratio_actions[] =
static const GimpEnumActionEntry tools_paintbrush_angle_actions[] =
{
{ "tools-paintbrush-angle-set", GIMP_ICON_TOOL_PAINTBRUSH,
"Set Brush Angle", NULL, NULL,
"Set Brush Angle", NULL, { NULL }, NULL,
GIMP_ACTION_SELECT_SET, TRUE,
NULL }
};
@@ -114,7 +105,7 @@ static const GimpEnumActionEntry tools_paintbrush_angle_actions[] =
static const GimpEnumActionEntry tools_paintbrush_spacing_actions[] =
{
{ "tools-paintbrush-spacing-set", GIMP_ICON_TOOL_PAINTBRUSH,
"Set Brush Spacing", NULL, NULL,
"Set Brush Spacing", NULL, { NULL }, NULL,
GIMP_ACTION_SELECT_SET, TRUE,
NULL }
};
@@ -122,7 +113,7 @@ static const GimpEnumActionEntry tools_paintbrush_spacing_actions[] =
static const GimpEnumActionEntry tools_paintbrush_hardness_actions[] =
{
{ "tools-paintbrush-hardness-set", GIMP_ICON_TOOL_PAINTBRUSH,
"Set Brush Hardness", NULL, NULL,
"Set Brush Hardness", NULL, { NULL }, NULL,
GIMP_ACTION_SELECT_SET, TRUE,
NULL }
};
@@ -130,7 +121,7 @@ static const GimpEnumActionEntry tools_paintbrush_hardness_actions[] =
static const GimpEnumActionEntry tools_paintbrush_force_actions[] =
{
{ "tools-paintbrush-force-set", GIMP_ICON_TOOL_PAINTBRUSH,
"Set Brush Force", NULL, NULL,
"Set Brush Force", NULL, { NULL }, NULL,
GIMP_ACTION_SELECT_SET, TRUE,
NULL }
};
@@ -138,14 +129,14 @@ static const GimpEnumActionEntry tools_paintbrush_force_actions[] =
static const GimpDoubleActionEntry tools_ink_blob_pixel_size_actions[] =
{
{ "tools-ink-blob-pixel-size-set", GIMP_ICON_TOOL_INK,
"Set Ink Blob Size in Pixel", NULL, NULL,
"Set Ink Blob Size in Pixel", NULL, { NULL }, NULL,
1.0, NULL }
};
static const GimpEnumActionEntry tools_ink_blob_size_actions[] =
{
{ "tools-ink-blob-size-set", GIMP_ICON_TOOL_INK,
"Set Ink Blob Size", NULL, NULL,
"Set Ink Blob Size", NULL, { NULL }, NULL,
GIMP_ACTION_SELECT_SET, TRUE,
NULL }
};
@@ -153,7 +144,7 @@ static const GimpEnumActionEntry tools_ink_blob_size_actions[] =
static const GimpEnumActionEntry tools_ink_blob_aspect_actions[] =
{
{ "tools-ink-blob-aspect-set", GIMP_ICON_TOOL_INK,
"Set Ink Blob Aspect", NULL, NULL,
"Set Ink Blob Aspect", NULL, { NULL }, NULL,
GIMP_ACTION_SELECT_SET, TRUE,
NULL }
};
@@ -161,7 +152,7 @@ static const GimpEnumActionEntry tools_ink_blob_aspect_actions[] =
static const GimpEnumActionEntry tools_ink_blob_angle_actions[] =
{
{ "tools-ink-blob-angle-set", GIMP_ICON_TOOL_INK,
"Set Ink Blob Angle", NULL, NULL,
"Set Ink Blob Angle", NULL, { NULL }, NULL,
GIMP_ACTION_SELECT_SET, TRUE,
NULL }
};
@@ -169,31 +160,31 @@ static const GimpEnumActionEntry tools_ink_blob_angle_actions[] =
static const GimpEnumActionEntry tools_airbrush_rate_actions[] =
{
{ "tools-airbrush-rate-set", GIMP_ICON_TOOL_AIRBRUSH,
NC_("tools-action", "Airbrush Rate: Set"), NULL, NULL,
NC_("tools-action", "Airbrush Rate: Set"), NULL, { NULL }, NULL,
GIMP_ACTION_SELECT_SET, TRUE,
NULL },
{ "tools-airbrush-rate-minimum", GIMP_ICON_TOOL_AIRBRUSH,
NC_("tools-action", "Airbrush Rate: Set to Minimum"), NULL, NULL,
NC_("tools-action", "Airbrush Rate: Set to Minimum"), NULL, { NULL }, NULL,
GIMP_ACTION_SELECT_FIRST, FALSE,
NULL },
{ "tools-airbrush-rate-maximum", GIMP_ICON_TOOL_AIRBRUSH,
NC_("tools-action", "Airbrush Rate: Set to Maximum"), NULL, NULL,
NC_("tools-action", "Airbrush Rate: Set to Maximum"), NULL, { NULL }, NULL,
GIMP_ACTION_SELECT_LAST, FALSE,
NULL },
{ "tools-airbrush-rate-decrease", GIMP_ICON_TOOL_AIRBRUSH,
NC_("tools-action", "Airbrush Rate: Decrease by 1"), NULL, NULL,
NC_("tools-action", "Airbrush Rate: Decrease by 1"), NULL, { NULL }, NULL,
GIMP_ACTION_SELECT_PREVIOUS, FALSE,
NULL },
{ "tools-airbrush-rate-increase", GIMP_ICON_TOOL_AIRBRUSH,
NC_("tools-action", "Airbrush Rate: Increase by 1"), NULL, NULL,
NC_("tools-action", "Airbrush Rate: Increase by 1"), NULL, { NULL }, NULL,
GIMP_ACTION_SELECT_NEXT, FALSE,
NULL },
{ "tools-airbrush-rate-decrease-skip", GIMP_ICON_TOOL_AIRBRUSH,
NC_("tools-action", "Airbrush Rate: Decrease by 10"), NULL, NULL,
NC_("tools-action", "Airbrush Rate: Decrease by 10"), NULL, { NULL }, NULL,
GIMP_ACTION_SELECT_SKIP_PREVIOUS, FALSE,
NULL },
{ "tools-airbrush-rate-increase-skip", GIMP_ICON_TOOL_AIRBRUSH,
NC_("tools-action", "Airbrush Rate: Increase by 10"), NULL, NULL,
NC_("tools-action", "Airbrush Rate: Increase by 10"), NULL, { NULL }, NULL,
GIMP_ACTION_SELECT_SKIP_NEXT, FALSE,
NULL }
};
@@ -201,31 +192,31 @@ static const GimpEnumActionEntry tools_airbrush_rate_actions[] =
static const GimpEnumActionEntry tools_airbrush_flow_actions[] =
{
{ "tools-airbrush-flow-set", GIMP_ICON_TOOL_AIRBRUSH,
NC_("tools-action", "Airbrush Flow: Set"), NULL, NULL,
NC_("tools-action", "Airbrush Flow: Set"), NULL, { NULL }, NULL,
GIMP_ACTION_SELECT_SET, TRUE,
NULL },
{ "tools-airbrush-flow-minimum", GIMP_ICON_TOOL_AIRBRUSH,
NC_("tools-action", "Airbrush Flow: Set to Minimum"), NULL, NULL,
NC_("tools-action", "Airbrush Flow: Set to Minimum"), NULL, { NULL }, NULL,
GIMP_ACTION_SELECT_FIRST, FALSE,
NULL },
{ "tools-airbrush-flow-maximum", GIMP_ICON_TOOL_AIRBRUSH,
NC_("tools-action", "Airbrush Flow: Set to Maximum"), NULL, NULL,
NC_("tools-action", "Airbrush Flow: Set to Maximum"), NULL, { NULL }, NULL,
GIMP_ACTION_SELECT_LAST, FALSE,
NULL },
{ "tools-airbrush-flow-decrease", GIMP_ICON_TOOL_AIRBRUSH,
NC_("tools-action", "Airbrush Flow: Decrease by 1"), NULL, NULL,
NC_("tools-action", "Airbrush Flow: Decrease by 1"), NULL, { NULL }, NULL,
GIMP_ACTION_SELECT_PREVIOUS, FALSE,
NULL },
{ "tools-airbrush-flow-increase", GIMP_ICON_TOOL_AIRBRUSH,
NC_("tools-action", "Airbrush Flow: Increase by 1"), NULL, NULL,
NC_("tools-action", "Airbrush Flow: Increase by 1"), NULL, { NULL }, NULL,
GIMP_ACTION_SELECT_NEXT, FALSE,
NULL },
{ "tools-airbrush-flow-decrease-skip", GIMP_ICON_TOOL_AIRBRUSH,
NC_("tools-action", "Airbrush Flow: Decrease by 10"), NULL, NULL,
NC_("tools-action", "Airbrush Flow: Decrease by 10"), NULL, { NULL }, NULL,
GIMP_ACTION_SELECT_SKIP_PREVIOUS, FALSE,
NULL },
{ "tools-airbrush-flow-increase-skip", GIMP_ICON_TOOL_AIRBRUSH,
NC_("tools-action", "Airbrush Flow: Increase by 10"), NULL, NULL,
NC_("tools-action", "Airbrush Flow: Increase by 10"), NULL, { NULL }, NULL,
GIMP_ACTION_SELECT_SKIP_NEXT, FALSE,
NULL }
};
@@ -233,7 +224,7 @@ static const GimpEnumActionEntry tools_airbrush_flow_actions[] =
static const GimpEnumActionEntry tools_mybrush_radius_actions[] =
{
{ "tools-mypaint-brush-radius-set", GIMP_ICON_TOOL_MYPAINT_BRUSH,
"Set MyPaint Brush Radius", NULL, NULL,
"Set MyPaint Brush Radius", NULL, { NULL }, NULL,
GIMP_ACTION_SELECT_SET, TRUE,
NULL }
};
@@ -241,14 +232,14 @@ static const GimpEnumActionEntry tools_mybrush_radius_actions[] =
static const GimpDoubleActionEntry tools_mybrush_pixel_size_actions[] =
{
{ "tools-mypaint-brush-pixel-size-set", GIMP_ICON_TOOL_MYPAINT_BRUSH,
"Set MyPaint Brush Diameter in Pixel", NULL, NULL,
"Set MyPaint Brush Diameter in Pixel", NULL, { NULL }, NULL,
1.0, NULL }
};
static const GimpEnumActionEntry tools_mybrush_hardness_actions[] =
{
{ "tools-mypaint-brush-hardness-set", GIMP_ICON_TOOL_MYPAINT_BRUSH,
"Set MyPaint Brush Hardness", NULL, NULL,
"Set MyPaint Brush Hardness", NULL, { NULL }, NULL,
GIMP_ACTION_SELECT_SET, TRUE,
NULL }
};
@@ -257,7 +248,7 @@ static const GimpEnumActionEntry tools_foreground_select_brush_size_actions[] =
{
{ "tools-foreground-select-brush-size-set",
GIMP_ICON_TOOL_FOREGROUND_SELECT,
"Set Foreground Select Brush Size", NULL, NULL,
"Set Foreground Select Brush Size", NULL, { NULL }, NULL,
GIMP_ACTION_SELECT_SET, TRUE,
NULL }
};
@@ -265,7 +256,7 @@ static const GimpEnumActionEntry tools_foreground_select_brush_size_actions[] =
static const GimpEnumActionEntry tools_transform_preview_opacity_actions[] =
{
{ "tools-transform-preview-opacity-set", GIMP_ICON_TOOL_PERSPECTIVE,
"Set Transform Tool Preview Opacity", NULL, NULL,
"Set Transform Tool Preview Opacity", NULL, { NULL }, NULL,
GIMP_ACTION_SELECT_SET, TRUE,
NULL }
};
@@ -273,14 +264,14 @@ static const GimpEnumActionEntry tools_transform_preview_opacity_actions[] =
static const GimpDoubleActionEntry tools_warp_effect_pixel_size_actions[] =
{
{ "tools-warp-effect-pixel-size-set", GIMP_ICON_TOOL_WARP,
"Set Warp Effect Size in Pixel", NULL, NULL,
"Set Warp Effect Size in Pixel", NULL, { NULL }, NULL,
1.0, NULL }
};
static const GimpEnumActionEntry tools_warp_effect_size_actions[] =
{
{ "tools-warp-effect-size-set", GIMP_ICON_TOOL_WARP,
"Set Warp Effect Size", NULL, NULL,
"Set Warp Effect Size", NULL, { NULL }, NULL,
GIMP_ACTION_SELECT_SET, TRUE,
NULL }
};
@@ -288,7 +279,7 @@ static const GimpEnumActionEntry tools_warp_effect_size_actions[] =
static const GimpEnumActionEntry tools_warp_effect_hardness_actions[] =
{
{ "tools-warp-effect-hardness-set", GIMP_ICON_TOOL_WARP,
"Set Warp Effect Hardness", NULL, NULL,
"Set Warp Effect Hardness", NULL, { NULL }, NULL,
GIMP_ACTION_SELECT_SET, TRUE,
NULL }
};
@@ -296,43 +287,43 @@ static const GimpEnumActionEntry tools_warp_effect_hardness_actions[] =
static const GimpEnumActionEntry tools_opacity_actions[] =
{
{ "tools-opacity-set", GIMP_ICON_DIALOG_TOOL_OPTIONS,
NC_("tools-action", "Tool's Opacity: Set"), NULL, NULL,
NC_("tools-action", "Tool's Opacity: Set"), NULL, { NULL }, NULL,
GIMP_ACTION_SELECT_SET, TRUE,
NULL },
{ "tools-opacity-set-to-default", GIMP_ICON_DIALOG_TOOL_OPTIONS,
NC_("tools-action", "Tool's Opacity: Set to Default Value"), NULL, NULL,
NC_("tools-action", "Tool's Opacity: Set to Default Value"), NULL, { NULL }, NULL,
GIMP_ACTION_SELECT_SET_TO_DEFAULT, FALSE,
NULL },
{ "tools-opacity-minimum", GIMP_ICON_DIALOG_TOOL_OPTIONS,
NC_("tools-action", "Tool's Opacity: Minimize"), NULL, NULL,
NC_("tools-action", "Tool's Opacity: Minimize"), NULL, { NULL }, NULL,
GIMP_ACTION_SELECT_FIRST, FALSE,
NULL },
{ "tools-opacity-maximum", GIMP_ICON_DIALOG_TOOL_OPTIONS,
NC_("tools-action", "Tool's Opacity: Maximize"), NULL, NULL,
NC_("tools-action", "Tool's Opacity: Maximize"), NULL, { NULL }, NULL,
GIMP_ACTION_SELECT_LAST, FALSE,
NULL },
{ "tools-opacity-decrease", GIMP_ICON_DIALOG_TOOL_OPTIONS,
NC_("tools-action", "Tool's Opacity: Decrease by 1"), "less", NULL,
NC_("tools-action", "Tool's Opacity: Decrease by 1"), NULL, { "less", NULL }, NULL,
GIMP_ACTION_SELECT_PREVIOUS, FALSE,
NULL },
{ "tools-opacity-increase", GIMP_ICON_DIALOG_TOOL_OPTIONS,
NC_("tools-action", "Tool's Opacity: Increase by 1"), "greater", NULL,
NC_("tools-action", "Tool's Opacity: Increase by 1"), NULL, { "greater", NULL }, NULL,
GIMP_ACTION_SELECT_NEXT, FALSE,
NULL },
{ "tools-opacity-decrease-skip", GIMP_ICON_DIALOG_TOOL_OPTIONS,
NC_("tools-action", "Tool's Opacity: Decrease by 10"), "<primary>less", NULL,
NC_("tools-action", "Tool's Opacity: Decrease by 10"), NULL, { "<primary>less", NULL }, NULL,
GIMP_ACTION_SELECT_SKIP_PREVIOUS, FALSE,
NULL },
{ "tools-opacity-increase-skip", GIMP_ICON_DIALOG_TOOL_OPTIONS,
NC_("tools-action", "Tool's Opacity: Increase by 10"), "<primary>greater", NULL,
NC_("tools-action", "Tool's Opacity: Increase by 10"), NULL, { "<primary>greater", NULL }, NULL,
GIMP_ACTION_SELECT_SKIP_NEXT, FALSE,
NULL },
{ "tools-opacity-decrease-percent", GIMP_ICON_DIALOG_TOOL_OPTIONS,
NC_("tools-action", "Tool's Opacity: Decrease Relative"), NULL, NULL,
NC_("tools-action", "Tool's Opacity: Decrease Relative"), NULL, { NULL }, NULL,
GIMP_ACTION_SELECT_PERCENT_PREVIOUS, FALSE,
NULL },
{ "tools-opacity-increase-percent", GIMP_ICON_DIALOG_TOOL_OPTIONS,
NC_("tools-action", "Tool's Opacity: Increase Relative"), NULL, NULL,
NC_("tools-action", "Tool's Opacity: Increase Relative"), NULL, { NULL }, NULL,
GIMP_ACTION_SELECT_PERCENT_NEXT, FALSE,
NULL },
};
@@ -340,43 +331,43 @@ static const GimpEnumActionEntry tools_opacity_actions[] =
static const GimpEnumActionEntry tools_size_actions[] =
{
{ "tools-size-set", GIMP_ICON_DIALOG_TOOL_OPTIONS,
NC_("tools-action", "Tool's Size: Set"), NULL, NULL,
NC_("tools-action", "Tool's Size: Set"), NULL, { NULL }, NULL,
GIMP_ACTION_SELECT_SET, TRUE,
NULL },
{ "tools-size-set-to-default", GIMP_ICON_DIALOG_TOOL_OPTIONS,
NC_("tools-action", "Tool's Size: Set to Default Value"), "backslash", NULL,
NC_("tools-action", "Tool's Size: Set to Default Value"), NULL, { "backslash", NULL }, NULL,
GIMP_ACTION_SELECT_SET_TO_DEFAULT, FALSE,
NULL },
{ "tools-size-minimum", GIMP_ICON_DIALOG_TOOL_OPTIONS,
NC_("tools-action", "Tool's Size: Minimize"), NULL, NULL,
NC_("tools-action", "Tool's Size: Minimize"), NULL, { NULL }, NULL,
GIMP_ACTION_SELECT_FIRST, FALSE,
NULL },
{ "tools-size-maximum", GIMP_ICON_DIALOG_TOOL_OPTIONS,
NC_("tools-action", "Tool's Size: Maximize"), NULL, NULL,
NC_("tools-action", "Tool's Size: Maximize"), NULL, { NULL }, NULL,
GIMP_ACTION_SELECT_LAST, FALSE,
NULL },
{ "tools-size-decrease", GIMP_ICON_DIALOG_TOOL_OPTIONS,
NC_("tools-action", "Tool's Size: Decrease by 1"), "bracketleft", NULL,
NC_("tools-action", "Tool's Size: Decrease by 1"), NULL, { "bracketleft", NULL }, NULL,
GIMP_ACTION_SELECT_PREVIOUS, FALSE,
NULL },
{ "tools-size-increase", GIMP_ICON_DIALOG_TOOL_OPTIONS,
NC_("tools-action", "Tool's Size: Increase by 1"), "bracketright", NULL,
NC_("tools-action", "Tool's Size: Increase by 1"), NULL, { "bracketright", NULL }, NULL,
GIMP_ACTION_SELECT_NEXT, FALSE,
NULL },
{ "tools-size-decrease-skip", GIMP_ICON_DIALOG_TOOL_OPTIONS,
NC_("tools-action", "Tool's Size: Decrease by 10"), "braceleft", NULL,
NC_("tools-action", "Tool's Size: Decrease by 10"), NULL, { "braceleft", NULL }, NULL,
GIMP_ACTION_SELECT_SKIP_PREVIOUS, FALSE,
NULL },
{ "tools-size-increase-skip", GIMP_ICON_DIALOG_TOOL_OPTIONS,
NC_("tools-action", "Tool's Size: Increase by 10"), "braceright", NULL,
NC_("tools-action", "Tool's Size: Increase by 10"), NULL, { "braceright", NULL }, NULL,
GIMP_ACTION_SELECT_SKIP_NEXT, FALSE,
NULL },
{ "tools-size-decrease-percent", GIMP_ICON_DIALOG_TOOL_OPTIONS,
NC_("tools-action", "Tool's Size: Decrease Relative"), NULL, NULL,
NC_("tools-action", "Tool's Size: Decrease Relative"), NULL, { NULL }, NULL,
GIMP_ACTION_SELECT_PERCENT_PREVIOUS, FALSE,
NULL },
{ "tools-size-increase-percent", GIMP_ICON_DIALOG_TOOL_OPTIONS,
NC_("tools-action", "Tool's Size: Increase Relative"), NULL, NULL,
NC_("tools-action", "Tool's Size: Increase Relative"), NULL, { NULL }, NULL,
GIMP_ACTION_SELECT_PERCENT_NEXT, FALSE,
NULL },
};
@@ -384,43 +375,43 @@ static const GimpEnumActionEntry tools_size_actions[] =
static const GimpEnumActionEntry tools_aspect_actions[] =
{
{ "tools-aspect-set", GIMP_ICON_DIALOG_TOOL_OPTIONS,
NC_("tools-action", "Tool's Aspect Ratio: Set"), NULL, NULL,
NC_("tools-action", "Tool's Aspect Ratio: Set"), NULL, { NULL }, NULL,
GIMP_ACTION_SELECT_SET, TRUE,
NULL },
{ "tools-aspect-set-to-default", GIMP_ICON_DIALOG_TOOL_OPTIONS,
NC_("tools-action", "Tool's Aspect Ratio: Set To Default Value"), NULL, NULL,
NC_("tools-action", "Tool's Aspect Ratio: Set To Default Value"), NULL, { NULL }, NULL,
GIMP_ACTION_SELECT_SET_TO_DEFAULT, FALSE,
NULL },
{ "tools-aspect-minimum", GIMP_ICON_DIALOG_TOOL_OPTIONS,
NC_("tools-action", "Tool's Aspect Ratio: Minimize"), NULL, NULL,
NC_("tools-action", "Tool's Aspect Ratio: Minimize"), NULL, { NULL }, NULL,
GIMP_ACTION_SELECT_FIRST, FALSE,
NULL },
{ "tools-aspect-maximum", GIMP_ICON_DIALOG_TOOL_OPTIONS,
NC_("tools-action", "Tool's Aspect Ratio: Maximize"), NULL, NULL,
NC_("tools-action", "Tool's Aspect Ratio: Maximize"), NULL, { NULL }, NULL,
GIMP_ACTION_SELECT_LAST, FALSE,
NULL },
{ "tools-aspect-decrease", GIMP_ICON_DIALOG_TOOL_OPTIONS,
NC_("tools-action", "Tool's Aspect Ratio: Decrease by 0.1"), NULL, NULL,
NC_("tools-action", "Tool's Aspect Ratio: Decrease by 0.1"), NULL, { NULL }, NULL,
GIMP_ACTION_SELECT_PREVIOUS, FALSE,
NULL },
{ "tools-aspect-increase", GIMP_ICON_DIALOG_TOOL_OPTIONS,
NC_("tools-action", "Tool's Aspect Ratio: Increase by 0.1"), NULL, NULL,
NC_("tools-action", "Tool's Aspect Ratio: Increase by 0.1"), NULL, { NULL }, NULL,
GIMP_ACTION_SELECT_NEXT, FALSE,
NULL },
{ "tools-aspect-decrease-skip", GIMP_ICON_DIALOG_TOOL_OPTIONS,
NC_("tools-action", "Tool's Aspect Ratio: Decrease by 1"), NULL, NULL,
NC_("tools-action", "Tool's Aspect Ratio: Decrease by 1"), NULL, { NULL }, NULL,
GIMP_ACTION_SELECT_SKIP_PREVIOUS, FALSE,
NULL },
{ "tools-aspect-increase-skip", GIMP_ICON_DIALOG_TOOL_OPTIONS,
NC_("tools-action", "Tool's Aspect Ratio: Increase by 1"), NULL, NULL,
NC_("tools-action", "Tool's Aspect Ratio: Increase by 1"), NULL, { NULL }, NULL,
GIMP_ACTION_SELECT_SKIP_NEXT, FALSE,
NULL },
{ "tools-aspect-decrease-percent", GIMP_ICON_DIALOG_TOOL_OPTIONS,
NC_("tools-action", "Tool's Aspect Ratio: Decrease Relative"), NULL, NULL,
NC_("tools-action", "Tool's Aspect Ratio: Decrease Relative"), NULL, { NULL }, NULL,
GIMP_ACTION_SELECT_PERCENT_PREVIOUS, FALSE,
NULL },
{ "tools-aspect-increase-percent", GIMP_ICON_DIALOG_TOOL_OPTIONS,
NC_("tools-action", "Tool's Aspect Ratio: Increase Relative"), NULL, NULL,
NC_("tools-action", "Tool's Aspect Ratio: Increase Relative"), NULL, { NULL }, NULL,
GIMP_ACTION_SELECT_PERCENT_NEXT, FALSE,
NULL },
};
@@ -428,43 +419,43 @@ static const GimpEnumActionEntry tools_aspect_actions[] =
static const GimpEnumActionEntry tools_angle_actions[] =
{
{ "tools-angle-set", GIMP_ICON_DIALOG_TOOL_OPTIONS,
NC_("tools-action", "Tool's Angle: Set"), NULL, NULL,
NC_("tools-action", "Tool's Angle: Set"), NULL, { NULL }, NULL,
GIMP_ACTION_SELECT_SET, TRUE,
NULL },
{ "tools-angle-set-to-default", GIMP_ICON_DIALOG_TOOL_OPTIONS,
NC_("tools-action", "Tool's Angle: Set Angle To Default Value"), NULL, NULL,
NC_("tools-action", "Tool's Angle: Set Angle To Default Value"), NULL, { NULL }, NULL,
GIMP_ACTION_SELECT_SET_TO_DEFAULT, FALSE,
NULL },
{ "tools-angle-minimum", GIMP_ICON_DIALOG_TOOL_OPTIONS,
NC_("tools-action", "Tool's Angle: Minimize"), NULL, NULL,
NC_("tools-action", "Tool's Angle: Minimize"), NULL, { NULL }, NULL,
GIMP_ACTION_SELECT_FIRST, FALSE,
NULL },
{ "tools-angle-maximum", GIMP_ICON_DIALOG_TOOL_OPTIONS,
NC_("tools-action", "Tool's Angle: Maximize"), NULL, NULL,
NC_("tools-action", "Tool's Angle: Maximize"), NULL, { NULL }, NULL,
GIMP_ACTION_SELECT_LAST, FALSE,
NULL },
{ "tools-angle-decrease", GIMP_ICON_DIALOG_TOOL_OPTIONS,
NC_("tools-action", "Tool's Angle: Decrease by 1°"), NULL, NULL,
NC_("tools-action", "Tool's Angle: Decrease by 1°"), NULL, { NULL }, NULL,
GIMP_ACTION_SELECT_PREVIOUS, FALSE,
NULL },
{ "tools-angle-increase", GIMP_ICON_DIALOG_TOOL_OPTIONS,
NC_("tools-action", "Tool's Angle: Increase by 1°"), NULL, NULL,
NC_("tools-action", "Tool's Angle: Increase by 1°"), NULL, { NULL }, NULL,
GIMP_ACTION_SELECT_NEXT, FALSE,
NULL },
{ "tools-angle-decrease-skip", GIMP_ICON_DIALOG_TOOL_OPTIONS,
NC_("tools-action", "Tool's Angle: Decrease by 15°"), NULL, NULL,
NC_("tools-action", "Tool's Angle: Decrease by 15°"), NULL, { NULL }, NULL,
GIMP_ACTION_SELECT_SKIP_PREVIOUS, FALSE,
NULL },
{ "tools-angle-increase-skip", GIMP_ICON_DIALOG_TOOL_OPTIONS,
NC_("tools-action", "Tool's Angle: Increase by 15°"), NULL, NULL,
NC_("tools-action", "Tool's Angle: Increase by 15°"), NULL, { NULL }, NULL,
GIMP_ACTION_SELECT_SKIP_NEXT, FALSE,
NULL },
{ "tools-angle-decrease-percent", GIMP_ICON_DIALOG_TOOL_OPTIONS,
NC_("tools-action", "Tool's Angle: Decrease Relative"), NULL, NULL,
NC_("tools-action", "Tool's Angle: Decrease Relative"), NULL, { NULL }, NULL,
GIMP_ACTION_SELECT_PERCENT_PREVIOUS, FALSE,
NULL },
{ "tools-angle-increase-percent", GIMP_ICON_DIALOG_TOOL_OPTIONS,
NC_("tools-action", "Tool's Angle: Increase Relative"), NULL, NULL,
NC_("tools-action", "Tool's Angle: Increase Relative"), NULL, { NULL }, NULL,
GIMP_ACTION_SELECT_PERCENT_NEXT, FALSE,
NULL },
};
@@ -472,43 +463,43 @@ static const GimpEnumActionEntry tools_angle_actions[] =
static const GimpEnumActionEntry tools_spacing_actions[] =
{
{ "tools-spacing-set", GIMP_ICON_DIALOG_TOOL_OPTIONS,
NC_("tools-action", "Tool's Spacing: Set"), NULL, NULL,
NC_("tools-action", "Tool's Spacing: Set"), NULL, { NULL }, NULL,
GIMP_ACTION_SELECT_SET, TRUE,
NULL },
{ "tools-spacing-set-to-default", GIMP_ICON_DIALOG_TOOL_OPTIONS,
NC_("tools-action", "Tool's Spacing: Set To Default Value"), NULL, NULL,
NC_("tools-action", "Tool's Spacing: Set To Default Value"), NULL, { NULL }, NULL,
GIMP_ACTION_SELECT_SET_TO_DEFAULT, FALSE,
NULL },
{ "tools-spacing-minimum", GIMP_ICON_DIALOG_TOOL_OPTIONS,
NC_("tools-action", "Tool's Spacing: Minimize"), NULL, NULL,
NC_("tools-action", "Tool's Spacing: Minimize"), NULL, { NULL }, NULL,
GIMP_ACTION_SELECT_FIRST, FALSE,
NULL },
{ "tools-spacing-maximum", GIMP_ICON_DIALOG_TOOL_OPTIONS,
NC_("tools-action", "Tool's Spacing: Maximize"), NULL, NULL,
NC_("tools-action", "Tool's Spacing: Maximize"), NULL, { NULL }, NULL,
GIMP_ACTION_SELECT_LAST, FALSE,
NULL },
{ "tools-spacing-decrease", GIMP_ICON_DIALOG_TOOL_OPTIONS,
NC_("tools-action", "Tool's Spacing: Decrease by 1"), NULL, NULL,
NC_("tools-action", "Tool's Spacing: Decrease by 1"), NULL, { NULL }, NULL,
GIMP_ACTION_SELECT_PREVIOUS, FALSE,
NULL },
{ "tools-spacing-increase", GIMP_ICON_DIALOG_TOOL_OPTIONS,
NC_("tools-action", "Tool's Spacing: Increase by 1"), NULL, NULL,
NC_("tools-action", "Tool's Spacing: Increase by 1"), NULL, { NULL }, NULL,
GIMP_ACTION_SELECT_NEXT, FALSE,
NULL },
{ "tools-spacing-decrease-skip", GIMP_ICON_DIALOG_TOOL_OPTIONS,
NC_("tools-action", "Tool's Spacing: Decrease by 10"), NULL, NULL,
NC_("tools-action", "Tool's Spacing: Decrease by 10"), NULL, { NULL }, NULL,
GIMP_ACTION_SELECT_SKIP_PREVIOUS, FALSE,
NULL },
{ "tools-spacing-increase-skip", GIMP_ICON_DIALOG_TOOL_OPTIONS,
NC_("tools-action", "Tool's Spacing: Increase by 10"), NULL, NULL,
NC_("tools-action", "Tool's Spacing: Increase by 10"), NULL, { NULL }, NULL,
GIMP_ACTION_SELECT_SKIP_NEXT, FALSE,
NULL },
{ "tools-spacing-decrease-percent", GIMP_ICON_DIALOG_TOOL_OPTIONS,
NC_("tools-action", "Tool's Spacing: Decrease Relative"), NULL, NULL,
NC_("tools-action", "Tool's Spacing: Decrease Relative"), NULL, { NULL }, NULL,
GIMP_ACTION_SELECT_PERCENT_PREVIOUS, FALSE,
NULL },
{ "tools-spacing-increase-percent", GIMP_ICON_DIALOG_TOOL_OPTIONS,
NC_("tools-action", "Tool's Spacing: Increase Relative"), NULL, NULL,
NC_("tools-action", "Tool's Spacing: Increase Relative"), NULL, { NULL }, NULL,
GIMP_ACTION_SELECT_PERCENT_NEXT, FALSE,
NULL },
};
@@ -516,43 +507,43 @@ static const GimpEnumActionEntry tools_spacing_actions[] =
static const GimpEnumActionEntry tools_hardness_actions[] =
{
{ "tools-hardness-set", GIMP_ICON_DIALOG_TOOL_OPTIONS,
NC_("tools-action", "Tool's Hardness: Set"), NULL, NULL,
NC_("tools-action", "Tool's Hardness: Set"), NULL, { NULL }, NULL,
GIMP_ACTION_SELECT_SET, TRUE,
NULL },
{ "tools-hardness-set-to-default", GIMP_ICON_DIALOG_TOOL_OPTIONS,
NC_("tools-action", "Tool's Hardness: Set to Default Value"), NULL, NULL,
NC_("tools-action", "Tool's Hardness: Set to Default Value"), NULL, { NULL }, NULL,
GIMP_ACTION_SELECT_SET_TO_DEFAULT, FALSE,
NULL },
{ "tools-hardness-minimum", GIMP_ICON_DIALOG_TOOL_OPTIONS,
NC_("tools-action", "Tool's Hardness: Minimize"), NULL, NULL,
NC_("tools-action", "Tool's Hardness: Minimize"), NULL, { NULL }, NULL,
GIMP_ACTION_SELECT_FIRST, FALSE,
NULL },
{ "tools-hardness-maximum", GIMP_ICON_DIALOG_TOOL_OPTIONS,
NC_("tools-action", "Tool's Hardness: Maximize"), NULL, NULL,
NC_("tools-action", "Tool's Hardness: Maximize"), NULL, { NULL }, NULL,
GIMP_ACTION_SELECT_LAST, FALSE,
NULL },
{ "tools-hardness-decrease", GIMP_ICON_DIALOG_TOOL_OPTIONS,
NC_("tools-action", "Tool's Hardness: Decrease by 1"), NULL, NULL,
NC_("tools-action", "Tool's Hardness: Decrease by 1"), NULL, { NULL }, NULL,
GIMP_ACTION_SELECT_PREVIOUS, FALSE,
NULL },
{ "tools-hardness-increase", GIMP_ICON_DIALOG_TOOL_OPTIONS,
NC_("tools-action", "Tool's Hardness: Increase by 1"), NULL, NULL,
NC_("tools-action", "Tool's Hardness: Increase by 1"), NULL, { NULL }, NULL,
GIMP_ACTION_SELECT_NEXT, FALSE,
NULL },
{ "tools-hardness-decrease-skip", GIMP_ICON_DIALOG_TOOL_OPTIONS,
NC_("tools-action", "Tool's Hardness: Decrease by 10"), NULL, NULL,
NC_("tools-action", "Tool's Hardness: Decrease by 10"), NULL, { NULL }, NULL,
GIMP_ACTION_SELECT_SKIP_PREVIOUS, FALSE,
NULL },
{ "tools-hardness-increase-skip", GIMP_ICON_DIALOG_TOOL_OPTIONS,
NC_("tools-action", "Tool's Hardness: Increase by 10"), NULL, NULL,
NC_("tools-action", "Tool's Hardness: Increase by 10"), NULL, { NULL }, NULL,
GIMP_ACTION_SELECT_SKIP_NEXT, FALSE,
NULL },
{ "tools-hardness-decrease-percent", GIMP_ICON_DIALOG_TOOL_OPTIONS,
NC_("tools-action", "Tool's Hardness: Decrease Relative"), NULL, NULL,
NC_("tools-action", "Tool's Hardness: Decrease Relative"), NULL, { NULL }, NULL,
GIMP_ACTION_SELECT_PERCENT_PREVIOUS, FALSE,
NULL },
{ "tools-hardness-increase-percent", GIMP_ICON_DIALOG_TOOL_OPTIONS,
NC_("tools-action", "Tool's Hardness: Increase Relative"), NULL, NULL,
NC_("tools-action", "Tool's Hardness: Increase Relative"), NULL, { NULL }, NULL,
GIMP_ACTION_SELECT_PERCENT_NEXT, FALSE,
NULL },
};
@@ -560,43 +551,43 @@ static const GimpEnumActionEntry tools_hardness_actions[] =
static const GimpEnumActionEntry tools_force_actions[] =
{
{ "tools-force-set", GIMP_ICON_DIALOG_TOOL_OPTIONS,
NC_("tools-action", "Tool's Force: Set"), NULL, NULL,
NC_("tools-action", "Tool's Force: Set"), NULL, { NULL }, NULL,
GIMP_ACTION_SELECT_SET, TRUE,
NULL },
{ "tools-force-set-to-default", GIMP_ICON_DIALOG_TOOL_OPTIONS,
NC_("tools-action", "Tool's Force: Set to Default Value"), NULL, NULL,
NC_("tools-action", "Tool's Force: Set to Default Value"), NULL, { NULL }, NULL,
GIMP_ACTION_SELECT_SET_TO_DEFAULT, FALSE,
NULL },
{ "tools-force-minimum", GIMP_ICON_DIALOG_TOOL_OPTIONS,
NC_("tools-action", "Tool's Force: Minimize"), NULL, NULL,
NC_("tools-action", "Tool's Force: Minimize"), NULL, { NULL }, NULL,
GIMP_ACTION_SELECT_FIRST, FALSE,
NULL },
{ "tools-force-maximum", GIMP_ICON_DIALOG_TOOL_OPTIONS,
NC_("tools-action", "Tool's Force: Maximize"), NULL, NULL,
NC_("tools-action", "Tool's Force: Maximize"), NULL, { NULL }, NULL,
GIMP_ACTION_SELECT_LAST, FALSE,
NULL },
{ "tools-force-decrease", GIMP_ICON_DIALOG_TOOL_OPTIONS,
NC_("tools-action", "Tool's Force: Decrease by 1"), NULL, NULL,
NC_("tools-action", "Tool's Force: Decrease by 1"), NULL, { NULL }, NULL,
GIMP_ACTION_SELECT_PREVIOUS, FALSE,
NULL },
{ "tools-force-increase", GIMP_ICON_DIALOG_TOOL_OPTIONS,
NC_("tools-action", "Tool's Force: Increase by 1"), NULL, NULL,
NC_("tools-action", "Tool's Force: Increase by 1"), NULL, { NULL }, NULL,
GIMP_ACTION_SELECT_NEXT, FALSE,
NULL },
{ "tools-force-decrease-skip", GIMP_ICON_DIALOG_TOOL_OPTIONS,
NC_("tools-action", "Tool's Force: Decrease by 10"), NULL, NULL,
NC_("tools-action", "Tool's Force: Decrease by 10"), NULL, { NULL }, NULL,
GIMP_ACTION_SELECT_SKIP_PREVIOUS, FALSE,
NULL },
{ "tools-force-increase-skip", GIMP_ICON_DIALOG_TOOL_OPTIONS,
NC_("tools-action", "Tool's Force: Increase by 10"), NULL, NULL,
NC_("tools-action", "Tool's Force: Increase by 10"), NULL, { NULL }, NULL,
GIMP_ACTION_SELECT_SKIP_NEXT, FALSE,
NULL },
{ "tools-force-decrease-percent", GIMP_ICON_DIALOG_TOOL_OPTIONS,
NC_("tools-action", "Tool's Force: Decrease Relative"), NULL, NULL,
NC_("tools-action", "Tool's Force: Decrease Relative"), NULL, { NULL }, NULL,
GIMP_ACTION_SELECT_PERCENT_PREVIOUS, FALSE,
NULL },
{ "tools-force-increase-percent", GIMP_ICON_DIALOG_TOOL_OPTIONS,
NC_("tools-action", "Tool's Force: Increase Relative"), NULL, NULL,
NC_("tools-action", "Tool's Force: Increase Relative"), NULL, { NULL }, NULL,
GIMP_ACTION_SELECT_PERCENT_NEXT, FALSE,
NULL },
};
@@ -604,30 +595,30 @@ static const GimpEnumActionEntry tools_force_actions[] =
static const GimpDoubleActionEntry tools_paint_select_pixel_size_actions[] =
{
{ "tools-paint-select-pixel-size-set", GIMP_ICON_TOOL_PAINT_SELECT,
"Set Paint Select Brush Size in Pixel", NULL, NULL,
"Set Paint Select Brush Size in Pixel", NULL, { NULL }, NULL,
1.0, NULL }
};
static const GimpEnumActionEntry tools_object_1_actions[] =
{
{ "tools-object-1-set", GIMP_ICON_DIALOG_TOOL_OPTIONS,
"Select Object 1 by Index", NULL, NULL,
"Select Object 1 by Index", NULL, { NULL }, NULL,
GIMP_ACTION_SELECT_SET, TRUE,
NULL },
{ "tools-object-1-first", GIMP_ICON_DIALOG_TOOL_OPTIONS,
"First Object 1", NULL, NULL,
"First Object 1", NULL, { NULL }, NULL,
GIMP_ACTION_SELECT_FIRST, FALSE,
NULL },
{ "tools-object-1-last", GIMP_ICON_DIALOG_TOOL_OPTIONS,
"Last Object 1", NULL, NULL,
"Last Object 1", NULL, { NULL }, NULL,
GIMP_ACTION_SELECT_LAST, FALSE,
NULL },
{ "tools-object-1-previous", GIMP_ICON_DIALOG_TOOL_OPTIONS,
"Previous Object 1", NULL, NULL,
"Previous Object 1", NULL, { NULL }, NULL,
GIMP_ACTION_SELECT_PREVIOUS, FALSE,
NULL },
{ "tools-object-1-next", GIMP_ICON_DIALOG_TOOL_OPTIONS,
"Next Object 1", NULL, NULL,
"Next Object 1", NULL, { NULL }, NULL,
GIMP_ACTION_SELECT_NEXT, FALSE,
NULL }
};
@@ -635,23 +626,23 @@ static const GimpEnumActionEntry tools_object_1_actions[] =
static const GimpEnumActionEntry tools_object_2_actions[] =
{
{ "tools-object-2-set", GIMP_ICON_DIALOG_TOOL_OPTIONS,
"Select Object 2 by Index", NULL, NULL,
"Select Object 2 by Index", NULL, { NULL }, NULL,
GIMP_ACTION_SELECT_SET, TRUE,
NULL },
{ "tools-object-2-first", GIMP_ICON_DIALOG_TOOL_OPTIONS,
"First Object 2", NULL, NULL,
"First Object 2", NULL, { NULL }, NULL,
GIMP_ACTION_SELECT_FIRST, FALSE,
NULL },
{ "tools-object-2-last", GIMP_ICON_DIALOG_TOOL_OPTIONS,
"Last Object 2", NULL, NULL,
"Last Object 2", NULL, { NULL }, NULL,
GIMP_ACTION_SELECT_LAST, FALSE,
NULL },
{ "tools-object-2-previous", GIMP_ICON_DIALOG_TOOL_OPTIONS,
"Previous Object 2", NULL, NULL,
"Previous Object 2", NULL, { NULL }, NULL,
GIMP_ACTION_SELECT_PREVIOUS, FALSE,
NULL },
{ "tools-object-2-next", GIMP_ICON_DIALOG_TOOL_OPTIONS,
"Next Object 2", NULL, NULL,
"Next Object 2", NULL, { NULL }, NULL,
GIMP_ACTION_SELECT_NEXT, FALSE,
NULL }
};
@@ -660,22 +651,13 @@ static const GimpEnumActionEntry tools_object_2_actions[] =
void
tools_actions_setup (GimpActionGroup *group)
{
GimpAction *action;
GList *list;
gimp_action_group_add_actions (group, "tools-action",
tools_actions,
G_N_ELEMENTS (tools_actions));
GList *list;
gimp_action_group_add_string_actions (group, "tools-action",
tools_alternative_actions,
G_N_ELEMENTS (tools_alternative_actions),
tools_select_cmd_callback);
action = gimp_action_group_get_action (group,
"tools-by-color-select-short");
gimp_action_set_accel_path (action, "<Actions>/tools/tools-by-color-select");
gimp_action_group_add_enum_actions (group, NULL,
tools_color_average_radius_actions,
G_N_ELEMENTS (tools_color_average_radius_actions),
@@ -823,28 +805,32 @@ tools_actions_setup (GimpActionGroup *group)
if (tool_info->menu_label)
{
GimpStringActionEntry entry;
GimpStringActionEntry entry = { 0 };
gchar *name;
gchar *long_label;
const gchar *icon_name;
const gchar *identifier;
name = gimp_tool_info_get_action_name (tool_info);
icon_name = gimp_viewable_get_icon_name (GIMP_VIEWABLE (tool_info));
identifier = gimp_object_get_name (tool_info);
long_label = g_strdup_printf (_("Activate tool \"%s\""), tool_info->label);
entry.name = name;
entry.icon_name = icon_name;
entry.label = tool_info->menu_label;
entry.accelerator = tool_info->menu_accel;
entry.tooltip = tool_info->tooltip;
entry.help_id = tool_info->help_id;
entry.value = identifier;
entry.name = name;
entry.icon_name = icon_name;
entry.label = long_label;
entry.short_label = tool_info->menu_label;
entry.accelerator[0] = tool_info->menu_accel;
entry.tooltip = tool_info->tooltip;
entry.help_id = tool_info->help_id;
entry.value = identifier;
gimp_action_group_add_string_actions (group, NULL,
&entry, 1,
tools_select_cmd_callback);
g_free (name);
g_free (long_label);
}
}
}
@@ -859,6 +845,11 @@ tools_actions_update (GimpActionGroup *group,
gimp_action_group_set_action_sensitive (group, action, (condition) != 0, NULL)
SET_SENSITIVE ("tools-gegl", image);
/* Since these are listed under the Image and Layer menus,
* they are disabled without an image to keep consistency
*/
SET_SENSITIVE ("tools-rotate-arbitrary", image);
SET_SENSITIVE ("tools-rotate-image-arbitrary", image);
#undef SET_SENSITIVE
}

View File

@@ -63,14 +63,6 @@ static void tools_activate_enum_action (const gchar *action_desc,
GVariant *value);
/* local variables */
/* this is a hack to allow GimpToolButton to activate a tool-selection action
* without initializing the tool
*/
static gint tools_select_cmd_initialize_blocked = 0;
/* public functions */
void
@@ -81,7 +73,6 @@ tools_select_cmd_callback (GimpAction *action,
Gimp *gimp;
GimpToolInfo *tool_info;
GimpContext *context;
GimpDisplay *display;
const gchar *tool_name;
gboolean set_transform_type = FALSE;
GimpTransformType transform_type;
@@ -111,8 +102,7 @@ tools_select_cmd_callback (GimpAction *action,
/* always allocate a new tool when selected from the image menu
*/
if (gimp_context_get_tool (context) != tool_info ||
tools_select_cmd_initialize_blocked)
if (gimp_context_get_tool (context) != tool_info)
{
gimp_context_set_tool (context, tool_info);
}
@@ -128,28 +118,6 @@ tools_select_cmd_callback (GimpAction *action,
gimp_transform_tool_set_type (GIMP_TRANSFORM_TOOL (tool),
transform_type);
}
if (! tools_select_cmd_initialize_blocked)
{
display = gimp_context_get_display (context);
if (display && gimp_display_get_image (display))
tool_manager_initialize_active (gimp, display);
}
}
void
tools_select_cmd_block_initialize (void)
{
tools_select_cmd_initialize_blocked++;
}
void
tools_select_cmd_unblock_initialize (void)
{
g_return_if_fail (tools_select_cmd_initialize_blocked > 0);
tools_select_cmd_initialize_blocked--;
}
void
@@ -944,23 +912,15 @@ static void
tools_activate_enum_action (const gchar *action_desc,
GVariant *value)
{
gchar *group_name;
gchar *action_name;
group_name = g_strdup (action_desc);
action_name = strchr (group_name, '/');
if (action_name)
if (action_desc)
{
GList *managers;
GimpAction *action;
*action_name++ = '\0';
managers = gimp_ui_managers_from_name ("<Image>");
action = gimp_ui_manager_find_action (managers->data,
group_name, action_name);
NULL, action_desc);
if (GIMP_IS_ENUM_ACTION (action) &&
GIMP_ENUM_ACTION (action)->value_variable)
@@ -968,6 +928,4 @@ tools_activate_enum_action (const gchar *action_desc,
gimp_action_emit_activate (GIMP_ACTION (action), value);
}
}
g_free (group_name);
}

Some files were not shown because too many files have changed in this diff Show More