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

Compare commits

...

1264 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
2235 changed files with 365187 additions and 276996 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.

6
.gitignore vendored
View File

@@ -1,6 +1,2 @@
# Meson
/_build
/compile_commands.json
# Atom editor
/.vscode
/compile_commands.json

File diff suppressed because it is too large Load Diff

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 -->

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"
}

546
NEWS
View File

@@ -6,6 +6,49 @@
This is the unstable branch of GIMP.
Overview of Changes from GIMP 2.99.18 to GIMP 3.0.0-RC1
=======================================================
Core:
- Conversion to Indexed:
* color precision increased;
* error diffusion in linear RGB while keeping palette generation as
CIE Lab.
- GIMP's GEGL operations:
* Posterize operates with a perceptual gamma;
* Threshold: processing with non-linear RGB;
* Hue-Saturation: using HSLA float as processing space which should be
quicker than previous implementation.
- Welcome dialog:
* Multiple images can be selected and opened at once with Enter key.
* "Show on Start" is now displayed specifically in the "Create" tab.
- Group layers can now have non-destructive layer effects.
Tools:
- Gradient tool: the "Repeat" mode "Truncate" has been renamed "None
(truncate)" and reordered to be second in the list, just after "None
(extend)".
Plug-ins:
- Plug-ins ported to GimpProcedureDialog: Warp, decompose.
API:
- Changes in libgimp:
* gimp_procedure_run_config() can run with no config objects (equivalent to
run the prodcedure with default arguments).
Build:
- Minimum dependency version bumps:
* babl 0.1.108
- Started a skeleton for unit testing framework for libgimp (only a few tests
so far but we eventually target exhaustivity).
Overview of Changes from GIMP 2.99.16 to GIMP 2.99.18
=====================================================
@@ -26,8 +69,70 @@ Core:
for internal data, or a string constructed from the local file path for
external data. This will be used to serialize data objects hence easily
retrieve the proper data even when some data may have duplicate names.
- New "FG to Transparent (Hardedge)" gradient.
- New Adobe Swatch Exchange palette import support.
- New palette import support: SwatchBooker.
- Artificially set PANGOCAIRO_BACKEND=fc when running on Windows to use the
fontconfig backend, which enables anti-aliasing on Windows, unlike the
default pangocairo backend.
- XCF:
* Font information are more accurately stored (not only the font name, but
also storing various other attributes and even a file hash in the ideal
case where the exact same font file is available), allowing to find the
right font (if installed) on load with less errors.
* As a consequence of the previous point, new files with text layers will be
saved as a bumped XCF 19 version.
* Older XCF versions with text layers can still be saved using older XCF
versions as long as the text layers are untouched in an edit session.
- "view-zoom-*" actions are not radio actions anymore.
- Improve thumbnail loading algorithm:
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.
- Generic inter-process transient window reimplemented using opaque GBytes
window identifiers instead of guint32. The goal is to have windows created
by plug-ins be transient to the calling core image window, but also the
other way around: some core dialogs are generated through PDB calls (in
particular resource and drawable chooser dialogs created by gimp_*_popup()
functions) and should be transient to plug-in dialogs.
This works on X11 and Wayland (the Wayland implementation is new, previous
code was X11-only). It should work on Windows too (code exists) but this was
left disabled as it leads to core process hanging (as described in
https://bugzilla.gnome.org/show_bug.cgi?id=359538) and is pending debugging.
There is no macOS implementation yet, and it seems to be missing from GDK as
well.
- Indexed images' colormap:
* Now possible to delete colors if unused.
- Updates for floating data's actions:
* New actions "edit-paste-float" and "edit-paste-float-in-place" for pasting
the contents of the clipboard as floating data with default positioning
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".
- GEGL operation filters are now non-destructive by default: running these
filters create layer effects. The UI is still basic and will be improved
through iterations after GIMP 3 release.
- FG/BG color action code (e.g. "Increase the red channel") are made
contextual, relatively to the active image, working relatively to the
correct color space and TRC.
- Device Status dockable shows context-sensitive colors (the color profile's
name is displayed as tooltip when hovering a fg/bg color status).
- Palettes are now GeglColor-based and are stored with a lot more precision.
Older low-precision palettes are still loaded fine. A single palette can
contain mixed formats (different models and space). A concept of format
restriction was added, yet is currently only used for indexed images'
palettes (whose colors are always and only in the image's format).
- Color History is now space-invaded (colors are stored in their original
format and space).
- Various color selectors (core or modules) are now space-invaded when
relevant. For instance, they show colors in the active image space (not just
sRGB) and display the profile's name when relevant. Also when simulation is
active, some of the color selectors will update their out-of-gamut zone, not
only to be within the image's gamut, but also the soft-proof gamut.
Graphical User Interface:
@@ -59,6 +164,76 @@ Graphical User Interface:
and gimp-tool-dodge in Color theme.
- Help menu rearranged to be better organized and also to move "About GIMP" as
the last item, which is its more conventional position.
- Many fixes to the default themes (including several cases of CSS rules
leaking from system themes).
- New settings in Preferences to set the interface base font size (this won't
work as well, or at all, for themes which would set absolute font sizes).
- "gimp-wilber-eek" icon is now reused as generic "image-missing" icon too.
- In dockables' grid view, the hovered icon is now highlighted with a
contrasted border.
- GimpPdbDialog (e.g. resource chooser dialogs) are now set to system defaults
for whether or not they use a header bar.
- Shift+Number-row default shortcuts are now transformed into the actual key
in the currently used layout (reciprocally, if numbers are direct access
key, their counterpart shortcuts are similarly updated).
- Colormap dockable:
* New "Delete" button available and sensitive only when selecting an unused
color in the palette.
- Windows: title bar will be switched to light or dark mode based on the
current theme.
- The quit dialog now adjusts its size relatively to monitor height.
- The heuristic to set a cursor when single or multi-selecting items in a tree
view got reviewed in order to avoid unnecessary scroll. As a general rule,
the cursor is always set to one of the selected elements, ideally the last
clicked element unless it is not selected (e.g. removed with Ctrl-click),
then a closest selected element is chosen to avoid unnecessarily scroll of
the item list.
- Pad buttons can now be configured in the "Input Devices" configuration dialog
to run any actions directly (without mapping shortcut key combinations as
intermediate). This only works on Wayland for the time being (yet may work on
more platforms in the future, depending on GTK evolution).
- Themes can now be proposed with up to 3 variants: dark, light and middle
gray, through gimp-dark.css, gimp-light.css and gimp-gray.css CSS files
respectively.
- As a consequence of the previous point, our Default and Gray themes are
merged as one with 3 possible variants.
- Our Color and Symbolic icon themes are merged as a single icon theme named
"Default".
- The "prefer-symbolic-icons" property which can be set in Preferences is only
used when the selected icon theme has both Color and Symbolic styles.
Otherwise the chosen icon theme style prevails. The presence of a style is
determined by the presence of the "gimp-wilber" icon (which becomes
therefore a de-facto mandatory icon in an icon theme) and/or its symbolic
variant.
- When "Override icon sizes" is checked, a few padding values are also
overridden by code in the loaded CSS.
- As a consequence of the previous point, we removed the "Compact" theme which
is now simply possible by overriding sizes to "Small" in Preferences (when
the theme is "Default", it will display the same as the former "Compact"
theme, though it will also work with any other theme).
- "Darker" theme is removed for lack of contributors actually caring for it.
It could be revived in the future as a "Contrast" theme with both a dark and
light variants at the very least.
- The search function in Layers dockable was moved over the Layers list (with
headers), the "link" icon replaced by "search" icon, and is now available
for both Layers, Channels and Vectors dockables (though unsaved for Vectors
because of lack in XCF support).
- The Welcome dialog was improved and its cases extended:
* A new "Personalize" tab contains duplicate settings taken from the
Preferences, in particular the more controversial settings, such as theme
or icon themes, HiPPI support (icon/font sizing), merged menu and title
bar, tool groups or update check.
* A new "Contribute" tab displays a few of the main links for people to
contribute to GIMP.
* A new "Create" tab proposes buttons to create new images or open existing
ones, as well as displaying a list of the last 8 opened images for easy
re-opening.
* A new checkbox (checked by default) allows the welcome dialog to be shown
at each and every startup. Except on new installations or version updates,
the first shown tab will be the new "Create" tab, which is probably the
most useful for day-to-day first dialog shown at startup (on updates, the
"Welcome" tab featuring the new splash screen and a small welcome text is
shown).
Tools:
@@ -68,6 +243,24 @@ Tools:
features.
* Alignment for RTL languages is now more consistent with how it works in
other software (such as LibreOffice or Scribus).
* Text layers can now be rendered in the full image's gamut (not sRGB only
anymore), though colors are trimmed to the gamut and are always 8-bit.
* Text outline colors are now rendered in float in the full image's gamut,
without precision loss.
- Paint tools: all painting tools now have an "Expand Layers" option
allowing to auto-expand layers when painting across layer
boundaries. A few additional sub-options customize how this
expansion happens (by how many pixels, filling with transparency,
color, pattern).
Expansion does not grow over canvas boundaries, unless "Show All" is
checked too.
- Color Picker:
* Picked color is internally kept as a GeglColor, doing only last-minute
conversion to the output model/space, hence with better precision.
* RGB, Grayscale and Pixel modes display the profile name of the output
color space (the active image's color space if relevant).
- The Gradient tool now uses GeglColor internally, though GIMP's gradient
format (GGR) still uses old RGB format.
Plug-ins:
@@ -92,12 +285,81 @@ Plug-ins:
* New test scripts.
- New gimp-help-main script to link to the "Table of Contents" of the manual,
added to the "Help > User Manual" submenu.
- PSP: added support to load PSP ICC Profile data.
- PSP:
* added support to load PSP ICC Profile data.
* fixed vulnerabilities: ZDI-CAN-22096, ZDI-CAN-22097.
* load active selection from PSP file.
* Load guides and grid info.
- Image Map: two new fields to the HTML Link tab and one new field to the
Javascript tab for area properties:
* accesskey: The same as the mnemonic key shortcuts in GTK, to activate an
area of the image map. Depending on the OS, you either hold ALT or
ALT+SHIFT and this key.
* tabindex: What order to select the area when the user presses Tab.
* onClick: Run a Javascript function when the user clicks on the area.
- Esm Software PIX: new import support.
- All plug-ins were ported to the new Gimp*Procedure API using
GimpProcedureConfig instead of GimpValueArray arguments.
- Add Border (script-fu): add a 'Allow resizing' toggle.
- Plug-ins ported to GimpProcedureDialog: van-gogh-lic, dds-write, flame,
histogram-export, lighting, fractal-explorer, map-object, sample-colorize,
compose, curve-bend, depth-merge, selection-to-path, pagecurl, file-cel,
file-svg, file-wmf, smooth-palette, small-tile, film, gradient-flare, tile,
web-page, screenshot.
- JPEG-XL:
* Load metadata via libjxl exclusively.
* Disable GIMP EXIF orientation support, using orientation stored in
codestream instead.
- HEIF:
* Load metadata via libheif exclusively.
* Disable GIMP EXIF orientation support.
- PDF:
* "Layers as Pages" works now for a single layer group with multiple
sub-layers.
- DDS:
* Add support for loading DDS 16- and 32-bit per channel RGBA. 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.
* Add DDS support for loading R8G8, R16 and R16G16 formats.
GIMP can load DXGI variants as well as the older D3DF versions, including
handling of the signed versions.
We also set signed when the pixelformat flag DDPF_BUMPDUDV is set.
* New option to vertically flip dds image on import. This is needed by some
game engines.
* 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.
* Better handling of DX10+ files in ddsread.
* Always interpret BC1 cutout pixels as black pixels with 0 alpha,
per the official format specification.
* Import code was rewritten and improved for maintainability and
readability. Importer now supports nearly all non-video
uncompressed formats.
- GIF:
* Remember when a file was stored as a GIF animation to be reused when
overwriting.
- PNG:
* Import/export safe-to-copy PNG chunks.
- HEJ2: new import support. HEJ2 is JPEG 2000 image coded images in HEIF
containers.
- PSD: better wording of the export warning for the path of less surprise.
- Python Console uses theme colors for font colors instead of hardcoded
colors which don't work well on darker themes.
Data:
- Clarified our capitalization rule for data titles: part of titles
inside parentheses also follow title casing.
- "(Hardedge)" generated gradients got renamed "(Hard Edge)".
Translations:
- Many non-translatable strings were made translatable. Various other
localization bugs were handled.
- New Belarusian translation in the Windows installer.
API:
@@ -106,10 +368,268 @@ API:
serialization fails. GIMP will now continue to serialize the rest. In
particular, it will allow to retrieve as many arguments as possible
between plug-in runs.
* GBytes (de)serialization support added. It supports gracefully a NULL
GBytes value.
* GeglColor (de)serialization support added. Former GimpRGB properties can
be gracefully converted to GeglColor properties when needed (e.g. to be
able to convert old property or resource files, containing GimpRGB values,
to newer GeglColor).
- Changes in libgimp:
* GimpResource can now be (de)serialized using the data name and collection
so that we are now able to retrieve a used resource quite reliably between
runs.
* For GimpProcedure with no run-mode parameter, the run-mode is considered
non-interactive (e.g. for decision algorithm about whether to reuse
previous settings or not).
* Arguments of type GimpResource and its subtypes are now supported and
GimpProcedureDialog will generate appropriate chooser widgets.
* Arguments of type GimpLayer and GimpChannel will have a proper widget
generated (GimpDrawableChooser) by GimpProcedureDialog, limited to only
the proper drawable subtype.
* All GimpProcedure and its subtypes now have a run() method using a
GimpConfig instead of a GimpValueArray. In particular, the type of the run
argument changed in gimp_procedure_new(), gimp_batch_procedure_new(),
gimp_image_procedure_new(), gimp_load_procedure_new(),
gimp_save_procedure_new() and gimp_thumbnail_procedure_new().
The following 2 run function types had further evolutions:
+ GimpRunLoadFunc: 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.
+ GimpRunSaveFunc: metadata handling is integrated in this new version of
the API, since the run() function will pass a prepared metadata object,
which can be modified by plug-in code (if needed). This GimpMetadata
object will be stored automatically by the GimpSaveProcedure
infrastructure if the mimetype argument is set in
gimp_save_procedure_new().
* On plug-in exit, we do not display memory reference hold warnings for Lua,
Javascript and Python plug-ins anymore. The GObject-Introspection bindings
for these languages seem to hold references of their own in some
conditions and anyway plug-in developers don't have any memory management
capabilities available in the chosen languages. It's not like they can do
anything.
* New functions:
+ gimp_procedure_dialog_set_sensitive_if_in()
+ gimp_procedure_dialog_set_ok_label()
+ gimp_procedure_dialog_fill_notebook()
+ gimp_procedure_dialog_fill_notebook_list()
+ gimp_procedure_dialog_fill_paned()
+ gimp_procedure_config_get_choice_id()
+ gimp_prop_brush_chooser_new()
+ gimp_prop_font_chooser_new()
+ gimp_prop_gradient_chooser_new()
+ gimp_prop_palette_chooser_new()
+ gimp_prop_pattern_chooser_new()
+ gimp_resource_select_button_get_label()
+ gimp_pattern_get_buffer()
+ gimp_drawables_close_popup()
+ gimp_drawables_popup()
+ gimp_drawables_set_popup()
+ gimp_prop_drawable_chooser_new()
+ gimp_font_get_pango_font_description()
+ gimp_fonts_get_by_name()
+ gimp_image_get_palette()
+ gimp_procedure_run_config()
+ gimp_procedure_run_valist()
+ gimp_procedure_dialog_get_drawable_preview()
* Removed functions:
+ gimp_procedure_config_begin_run()
+ gimp_procedure_config_end_run()
+ gimp_procedure_config_begin_export()
+ gimp_procedure_config_end_export()
+ gimp_procedure_config_get_values()
+ gimp_procedure_config_set_values()
+ gimp_pdb_run_procedure_argv()
+ gimp_pdb_run_procedure()
+ gimp_pdb_run_procedure_valist()
+ gimp_pdb_run_procedure_array()
+ gimp_pdb_run_procedure_config()
+ gimp_procedure_new_arguments()
+ gimp_pdb_set_data() a.k.a. gimp_set_data()
+ gimp_pdb_get_data() a.k.a. gimp_get_data()
+ gimp_pdb_get_data_size() a.k.a. gimp_get_data_size()
* Modified functions:
+ gimp_procedure_dialog_get_label():
1. Added `is_markup` and `with_mnemonic` boolean arguments.
2. `label_id` argument can be a string property to sync to, or a new
widget ID to create, using `text` as initialization contents.
+ gimp_label_spin_set_increments(): made more generic and robust to handle
integer spin or modifiable min/max.
+ gimp_param_spec_get_desc():
- Also handles new GimpChoice arguments by listing all valid string
values for a given argument.
- Returned string is now pango-markup formatted.
+ gimp_display_get_window_handle() and gimp_progress_get_window_handle():
the return value is now an opaque GBytes which is to be interpreted
differently depending on the running platform.
+ All gimp_*_popup() functions now have a `parent_window` argument which
is the opaque window handle of the calling plug-in dialog, such as can
be returned by gimp_dialog_get_native_handle().
+ gimp_brush_get_pixels() replaced by gimp_brush_get_buffer() and
gimp_brush_get_mask().
+ gimp_text_layer_set_font() now uses a GimpFont.
+ gimp_text_layer_get_font() now returns a GimpFont.
+ gimp_text_layer_new() now uses a GimpFont.
+ gimp_text_fontname() renamed gimp_text_font().
+ gimp_text_get_extents_fontname() renamed gimp_text_get_extents_font().
+ gimp_ui_init() now implies a gegl_init().
+ gimp_procedure_run() now uses a variable argument list of (name, value)
pairs.
* New classes:
+ GimpPickableSelect
+ GimpDrawableChooser
* Modified classes or structure:
+ GimpProgress:
- GimpProgressVtableGetWindowFunc function type now returns GBytes.
- get_window() abstract method is renamed get_window_handle().
+ GimpResourceSelectButton:
- Class made abstract.
- It now has a label which is used in the size group in
GimpProcedureDialog.
+ GimpBrushSelectButton: big UX improvements.
+ GimpPatternSelectButton: big UX improvements.
+ All Gimp*SelectButton widgets were renamed to Gimp*Chooser.
* New GimpProcedure argument types:
+ GimpChoice: this will replace cases when we used to use int arguments to
represent custom enum types, which was particularly non-usable when the
list of valid choices was long and the string docs was not kept
up-to-date.
It comes with GIMP_PROC_ARG_CHOICE(), GIMP_PROC_AUX_ARG_CHOICE(),
GIMP_PROC_VAL_CHOICE(), GIMP_VALUES_GET_CHOICE() and
GIMP_VALUES_SET_CHOICE() macros.
The advantages of this new type:
- No need to keep the list of valid choices up-to-date anymore within
the docs string.
- Since the docs string doesn't contain long list of arguments, we don't
have long opaque and non-understandable tooltips assigned to graphical
interface widgets.
- Calling a PDB procedure with a human-readable string is much more
understandable than with an opaque int.
- This type handles invalid input for generic error handling.
- We can easily generate a list of the valid string values. E.g. this is
now used in the Procedure Browser through gimp_param_spec_get_desc().
- Choices can be made insensitive if needed.
- A proper widget (GimpStringComboBox) will be generated by
GimpProcedureDialog by default.
* PDB: the big change in the PDB is that we decided not to warrant argument
orders anymore. In particular, it means that the libgimp functions to run
PDB procedures are not based on an ordered array of arguments anymore but
on named arguments only.
+ The first consequence is that it will be possible to add arguments, and
even order them however we want in the list of arguments. For
backward-compatibility, what will matter is only that the procedure
using the default values for the new arguments will behave the same way
it did when it used not to have said arguments. Then scripts won't break
as we add new arguments and we won't have to create alternative v2 or v3
PDB procedures each time we wish to add a new feature.
+ The second consequence is that calling PDB procedures is now much more
semantic. Firstly we can ignore arguments for which we keep the default
values; secondly every argument will be accompanied by a name instead of
being a long list of int or boolean values.
Typically while we used to call a PDB like this:
```C
gimp_pdb_run_procedure (gimp_get_pdb (),
"file-png-save",
GIMP_TYPE_RUN_MODE, GIMP_RUN_NONINTERACTIVE,
GIMP_TYPE_IMAGE, image,
G_TYPE_INT, 1,
GIMP_TYPE_OBJECT_ARRAY, args,
G_TYPE_FILE, file,
G_TYPE_BOOLEAN, FALSE,
G_TYPE_INT, 9,
G_TYPE_BOOLEAN, FALSE,
G_TYPE_BOOLEAN, FALSE,
G_TYPE_BOOLEAN, FALSE,
G_TYPE_BOOLEAN, FALSE,
G_TYPE_BOOLEAN, FALSE,
G_TYPE_BOOLEAN, FALSE,
G_TYPE_NONE);
```
We can now call it like this (with a shorter list of arguments, ignoring
all the ones which we keep default, not bothering about arg order and
tagging each arg with a semantic name):
```C
gimp_procedure_run (gimp_pdb_lookup_procedure (gimp_get_pdb (),
"file-png-save"),
"run-mode", GIMP_RUN_NONINTERACTIVE,
"image", image,
"num-drawables", 1,
"drawables", drawables,
"file", file,
"bkgd", FALSE,
"phys", FALSE,
"time", FALSE,
NULL);
```
+ The few libgimp functions of the form `gimp_pdb_run_procedure*()` were
removed and moved directly to `gimp_procedure_run*()` variant. The
presence of both interfaces was making it confusing.
+ For bindings not able to replicate variable arguments functions, the
bindable function will be gimp_procedure_run_config() only, which will
be renamed to gimp_procedure_run() in bindings.
+ Note that internally the argument order is still relevant for any system
which interfaces directly with the PDB instead of libgimp. In other
words, it is still relevant for script-fu which generates functions out
of PDB procedures directly (not libgimp).
+ GimpObjectArray arguments now allow NULL through the pipe as meaning an
empty array.
- Changes in libgimpbase:
* New classes:
+ GimpChoice: meant to represent a list of allowed strings values.
* GimpRotationType values were changed by prepending "DEGREES" without
hyphen before the numeric value (e.g.: GIMP_ROTATE_90 becomes
GIMP_ROTATE_DEGREES90), because the older naming breaks introspection for
some languages, such as Python where Gimp.RotationType.90 syntax would be
forbidden.
* GIMP Protocol can now exchange GeglColor values across the wire.
- Changes in libgimpwidgets:
* New functions:
+ gimp_widget_set_native_handle()
+ gimp_dialog_get_native_handle()
+ gimp_preview_area_reset()
+ gimp_cairo_set_source_color()
+ gimp_color_selection_set_format()
* New classes:
+ GimpLabelStringWidget: makes any widget with a "value" string property
into a GimpLabeled.
* Modified classes:
+ GimpStringComboBox:
- add a "value" string property to GimpStringComboBox (which makes it
usable by GimpLabelStringWidget).
- New method gimp_string_combo_box_set_sensitivity()
* Several widgets are now space-invaded, using GeglColor instead of GimpRGB:
+ GimpColorArea
+ GimpColorScale
+ GimpColorScales
+ GimpColorSelect
+ GimpLabelColor
+ GimpPreviewArea
+ GimpColorButton
+ GimpColorHexEntry
+ GimpColorSelection
+ GimpColorNotebook
+ GimpColorSelect
+ GimpColorSelector
+ GimpColorNotebook
- Changes in libgimpui:
* Modified functions:
+ 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).
* Removed functions:
- gimp_ui_get_progress_window()
- gimp_ui_get_display_window()
- Changes in libgimpcolor:
* New functions:
+ gimp_color_set_alpha()
+ gimp_color_is_perceptually_identical()
+ gimp_color_is_out_of_gamut()
+ gimp_color_is_out_of_self_gamut()
+ gimp_color_parse_hex()
+ gimp_color_parse_name()
Build:
@@ -117,6 +637,26 @@ Build:
Windows. This bump happens because of end-of-support by Microsoft itself,
and also by MSYS2 project which is our base for the official installers.
- CI now generates babl and GEGL API reference HTML as artifact tarballs.
- New meson options -Dfits and -Dopenmp to enable/disable respectively FITS or
OpenMP support more explicitly (allowing to bypass auto-detection).
- Pango 1.50 or higher is now required as a result of using
pango_attribute_as_font_desc(). Also pango, pangocairo and pangoft2 now use
the same minimum version requirement.
- New Aarch64/Windows build jobs in CI.
- The universal Windows installer generated by the CI now detects and installs
a native Aarch64 build on ARM 64-bit architecture.
- Meson: alternatively to luajit, we now search also lua5.1, then 5.2 and 5.3
(5.1 first, because apart luajit, it is the only one with lua-lgi support in
MSYS2 right now).
- CI: unify jobs naming and order.
- Windows builds: various cleanups, code factorization and more.
- Windows installer: the desktop shortcut option is now checked by default
because of the fact too many people could not find GIMP after installation.
- New .vscode/ config folder for Visual Studio Code settings to follow our
coding style.
- 'gegl.exe' binary is now installed by the Windows installer.
- Minimum libheif requirement bumped: libheif >= 1.15.1.
- GEGL requirement bumped to GEGL 0.4.48.
Overview of Changes from GIMP 2.99.14 to GIMP 2.99.16

26
README
View File

@@ -30,6 +30,10 @@ The latest version of GIMP can be found at:
https://www.gimp.org/downloads/
We also have a website dedicated to documentation at:
https://docs.gimp.org/
2. Contributing
===============
@@ -58,28 +62,18 @@ 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.
4. Customizing
==============

View File

@@ -65,7 +65,7 @@ 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,
@@ -78,7 +78,7 @@ static void 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,
@@ -127,7 +127,7 @@ 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),
@@ -173,7 +173,7 @@ 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,
@@ -204,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),
@@ -613,7 +613,7 @@ 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,
@@ -638,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
{
@@ -646,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);
@@ -671,7 +671,7 @@ 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,
@@ -682,12 +682,12 @@ channels_edit_attributes_callback (GtkWidget *dialog,
{
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,
@@ -697,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))

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"
@@ -45,6 +47,12 @@ static const GimpActionEntry colormap_actions[] =
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 }
};
@@ -112,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)
{
@@ -128,7 +135,7 @@ colormap_actions_update (GimpActionGroup *group,
{
GList *drawables = gimp_image_get_selected_drawables (image);
num_colors = gimp_image_get_colormap_size (image);
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);
@@ -137,12 +144,6 @@ colormap_actions_update (GimpActionGroup *group,
}
}
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);
}
}

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);

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

@@ -372,12 +372,14 @@ static const GimpStringActionEntry dialogs_toplevel_actions[] =
"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

@@ -99,19 +99,19 @@ static const GimpEnumActionEntry drawable_rotate_actions[] =
{ "drawable-rotate-90", GIMP_ICON_OBJECT_ROTATE_90,
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, { 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, { NULL },
NC_("drawable-action", "Rotate drawable 90 degrees to the left"),
GIMP_ROTATE_270, FALSE,
GIMP_ROTATE_DEGREES270, FALSE,
GIMP_HELP_LAYER_ROTATE_270 }
};

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,
@@ -180,19 +180,31 @@ static const GimpEnumActionEntry edit_paste_actions[] =
GIMP_HELP_EDIT_PASTE_IN_PLACE },
{ "edit-paste-into", GIMP_ICON_EDIT_PASTE_INTO,
NC_("edit-action", "Paste _Into Selection"), NULL, { 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, { 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 }
GIMP_HELP_EDIT_PASTE_INTO_IN_PLACE },
{ "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-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[] =
@@ -221,7 +233,7 @@ void
edit_actions_setup (GimpActionGroup *group)
{
GimpContext *context = gimp_get_user_context (group->gimp);
GimpRGB color;
GeglColor *color;
GimpPattern *pattern;
gimp_action_group_add_actions (group, "edit-action",
@@ -248,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);
@@ -368,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);
@@ -376,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

@@ -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,9 +105,9 @@ 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;
@@ -132,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

@@ -278,7 +278,7 @@ static const GimpStringActionEntry filters_interactive_actions[] =
GIMP_HELP_FILTER_EDGE },
{ "filters-edge-laplace", GIMP_ICON_GEGL,
NC_("filters-action", "_Laplace"), NULL, { NULL }, NULL,
NC_("filters-action", "_Laplace..."), NULL, { NULL }, NULL,
"gegl:edge-laplace",
GIMP_HELP_FILTER_EDGE_LAPLACE },
@@ -911,6 +911,7 @@ filters_actions_update (GimpActionGroup *group,
gboolean gray = FALSE;
gboolean alpha = FALSE;
gboolean supports_alpha = FALSE;
gboolean is_group = FALSE;
image = action_data_get_image (data);
@@ -937,7 +938,7 @@ filters_actions_update (GimpActionGroup *group,
writable = ! gimp_item_is_content_locked (item, NULL);
if (gimp_viewable_get_children (GIMP_VIEWABLE (drawable)))
writable = FALSE;
is_group = TRUE;
}
g_list_free (drawables);
@@ -947,7 +948,7 @@ filters_actions_update (GimpActionGroup *group,
gimp_action_group_set_action_sensitive (group, action, (condition) != 0, NULL)
SET_SENSITIVE ("filters-alien-map", writable);
SET_SENSITIVE ("filters-antialias", writable);
SET_SENSITIVE ("filters-antialias", writable && !is_group);
SET_SENSITIVE ("filters-apply-canvas", writable);
SET_SENSITIVE ("filters-apply-lens", writable);
SET_SENSITIVE ("filters-bayer-matrix", writable);
@@ -974,11 +975,11 @@ filters_actions_update (GimpActionGroup *group,
SET_SENSITIVE ("filters-desaturate", writable && !gray);
SET_SENSITIVE ("filters-difference-of-gaussians", writable);
SET_SENSITIVE ("filters-diffraction-patterns", writable);
SET_SENSITIVE ("filters-dilate", writable);
SET_SENSITIVE ("filters-dilate", writable && !is_group);
SET_SENSITIVE ("filters-displace", writable);
SET_SENSITIVE ("filters-distance-map", writable);
SET_SENSITIVE ("filters-dropshadow", writable && alpha);
SET_SENSITIVE ("filters-edge", writable);
SET_SENSITIVE ("filters-edge", writable && !is_group);
SET_SENSITIVE ("filters-edge-laplace", writable);
SET_SENSITIVE ("filters-edge-neon", writable);
SET_SENSITIVE ("filters-edge-sobel", writable);
@@ -997,9 +998,9 @@ filters_actions_update (GimpActionGroup *group,
SET_SENSITIVE ("filters-hue-chroma", writable);
SET_SENSITIVE ("filters-hue-saturation", writable && !gray);
SET_SENSITIVE ("filters-illusion", writable);
SET_SENSITIVE ("filters-invert-linear", writable);
SET_SENSITIVE ("filters-invert-perceptual", writable);
SET_SENSITIVE ("filters-invert-value", writable);
SET_SENSITIVE ("filters-invert-linear", writable && !is_group);
SET_SENSITIVE ("filters-invert-perceptual", writable && !is_group);
SET_SENSITIVE ("filters-invert-value", writable && !is_group);
SET_SENSITIVE ("filters-image-gradient", writable);
SET_SENSITIVE ("filters-kaleidoscope", writable);
SET_SENSITIVE ("filters-lens-blur", writable);

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
@@ -86,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),
@@ -130,6 +125,7 @@ filters_apply_interactive_cmd_callback (GimpAction *action,
}
procedure = gimp_gegl_procedure_new (image->gimp,
NULL,
GIMP_RUN_INTERACTIVE, NULL,
g_variant_get_string (value, NULL),
gimp_action_get_name (action),
@@ -240,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

@@ -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"
@@ -366,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),
@@ -376,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));
@@ -386,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;
@@ -412,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);
@@ -442,7 +514,7 @@ gimp_gegl_procedure_new (Gimp *gimp,
FALSE,
GIMP_PARAM_READWRITE));
gimp_procedure_add_argument (procedure,
g_param_spec_int ("n-drawables",
g_param_spec_int ("num-drawables",
"N drawables",
"The number of drawables",
0, G_MAXINT32, 0,

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

@@ -461,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);
@@ -492,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);
@@ -546,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
@@ -613,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);
@@ -642,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);
@@ -664,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);
@@ -709,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);
@@ -736,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);
@@ -758,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);
@@ -902,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

@@ -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

@@ -277,19 +277,19 @@ static const GimpEnumActionEntry image_rotate_actions[] =
{ "image-rotate-90", GIMP_ICON_OBJECT_ROTATE_90,
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, { 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, { 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 }
};

View File

@@ -55,10 +55,14 @@ items_actions_setup (GimpActionGroup *group,
}
else
{
GimpRGB color;
GeglColor *color;
GimpRGB rgb;
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);
}
}

View File

@@ -968,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);

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"
@@ -811,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);

View File

@@ -131,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;
@@ -143,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) \
@@ -164,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

@@ -145,7 +145,7 @@ palettes_merge_callback (GtkWidget *widget,
gimp_palette_add_entry (new_palette, -1,
entry->name,
&entry->color);
entry->color);
}
}

View File

@@ -124,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),

View File

@@ -95,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) \
@@ -125,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,7 +52,7 @@ 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,
@@ -117,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),
@@ -133,7 +133,7 @@ quick_mask_configure_cmd_callback (GimpAction *action,
_("_Mask opacity:"),
FALSE,
NULL,
&color,
color,
FALSE,
GIMP_COLOR_TAG_NONE,
FALSE,
@@ -159,7 +159,7 @@ 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,
@@ -168,11 +168,11 @@ quick_mask_configure_callback (GtkWidget *dialog,
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

@@ -58,10 +58,16 @@ static const GimpActionEntry select_actions[] =
select_invert_cmd_callback,
GIMP_HELP_SELECTION_INVERT },
{ "select-float", GIMP_ICON_LAYER_FLOATING_SELECTION,
NC_("select-action", "_Float"), NULL, { "<primary><shift>L", NULL },
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,
@@ -182,9 +188,13 @@ select_actions_update (GimpActionGroup *group,
SET_SENSITIVE ("select-all", image && ! sel_all);
SET_SENSITIVE ("select-none", image && sel);
SET_SENSITIVE ("select-invert", image);
SET_SENSITIVE ("select-float", g_list_length (drawables) == 1 && sel &&
! gimp_item_is_content_locked (drawables->data, NULL) &&
! gimp_viewable_get_children (drawables->data));
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
@@ -692,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

@@ -367,66 +367,86 @@ static const GimpEnumActionEntry view_zoom_actions[] =
GIMP_HELP_VIEW_ZOOM_IN }
};
static const GimpRadioActionEntry view_zoom_explicit_actions[] =
static const GimpEnumActionEntry view_zoom_explicit_actions[] =
{
{ "view-zoom-16-1", NULL,
NC_("view-zoom-action", "1_6:1 (1600%)"), NULL, { "5", "KP_5", NULL },
NC_("view-zoom-action", "Zoom 16:1 (1600%)"),
NC_("view-zoom-action", "1_6:1 (1600%)"),
{ "5", "KP_5", NULL },
NC_("view-zoom-action", "Zoom 16:1"),
160000,
160000, FALSE,
GIMP_HELP_VIEW_ZOOM_IN },
{ "view-zoom-8-1", NULL,
NC_("view-zoom-action", "_8:1 (800%)"), NULL, { "4", "KP_4", NULL },
NC_("view-zoom-action", "Zoom 8:1 (800%)"),
NC_("view-zoom-action", "_8:1 (800%)"),
{ "4", "KP_4", NULL },
NC_("view-zoom-action", "Zoom 8:1"),
80000,
80000, FALSE,
GIMP_HELP_VIEW_ZOOM_IN },
{ "view-zoom-4-1", NULL,
NC_("view-zoom-action", "_4:1 (400%)"), NULL, { "3", "KP_3", NULL },
NC_("view-zoom-action", "Zoom 4:1 (400%)"),
NC_("view-zoom-action", "_4:1 (400%)"),
{ "3", "KP_3", NULL },
NC_("view-zoom-action", "Zoom 4:1"),
40000,
40000, FALSE,
GIMP_HELP_VIEW_ZOOM_IN },
{ "view-zoom-2-1", NULL,
NC_("view-zoom-action", "_2:1 (200%)"), NULL, { "2", "KP_2", NULL },
NC_("view-zoom-action", "Zoom 2:1 (200%)"),
NC_("view-zoom-action", "_2:1 (200%)"),
{ "2", "KP_2", NULL },
NC_("view-zoom-action", "Zoom 2:1"),
20000,
20000, FALSE,
GIMP_HELP_VIEW_ZOOM_IN },
{ "view-zoom-1-1", GIMP_ICON_ZOOM_ORIGINAL,
NC_("view-zoom-action", "_1:1 (100%)"), NULL, { "1", "KP_1", NULL },
NC_("view-zoom-action", "Zoom 1:1 (100%)"),
NC_("view-zoom-action", "_1:1 (100%)"),
{ "1", "KP_1", NULL },
NC_("view-zoom-action", "Zoom 1:1"),
10000,
10000, FALSE,
GIMP_HELP_VIEW_ZOOM_100 },
{ "view-zoom-1-2", NULL,
NC_("view-zoom-action", "1:_2 (50%)"), NULL, { "<shift>2", "<shift>KP_2", NULL },
NC_("view-zoom-action", "Zoom 1:2 (50%)"),
NC_("view-zoom-action", "1:_2 (50%)"),
{ "<shift>2", "<shift>KP_2", NULL },
NC_("view-zoom-action", "Zoom 1:2"),
5000,
5000, FALSE,
GIMP_HELP_VIEW_ZOOM_OUT },
{ "view-zoom-1-4", NULL,
NC_("view-zoom-action", "1:_4 (25%)"), NULL, { "<shift>3", "<shift>KP_3", NULL },
NC_("view-zoom-action", "Zoom 1:4 (25%)"),
NC_("view-zoom-action", "1:_4 (25%)"),
{ "<shift>3", "<shift>KP_3", NULL },
NC_("view-zoom-action", "Zoom 1:4"),
2500,
2500, FALSE,
GIMP_HELP_VIEW_ZOOM_OUT },
{ "view-zoom-1-8", NULL,
NC_("view-zoom-action", "1:_8 (12.5%)"), NULL, { "<shift>4", "<shift>KP_4", NULL },
NC_("view-zoom-action", "Zoom 1:8 (12.5%)"),
NC_("view-zoom-action", "1:_8 (12.5%)"),
{ "<shift>4", "<shift>KP_4", NULL },
NC_("view-zoom-action", "Zoom 1:8"),
1250,
1250, FALSE,
GIMP_HELP_VIEW_ZOOM_OUT },
{ "view-zoom-1-16", NULL,
NC_("view-zoom-action", "1:1_6 (6.25%)"), NULL, { "<shift>5", "<shift>KP_5", NULL },
NC_("view-zoom-action", "Zoom 1:16 (6.25%)"),
NC_("view-zoom-action", "1:1_6 (6.25%)"),
{ "<shift>5", "<shift>KP_5", NULL },
NC_("view-zoom-action", "Zoom 1:16"),
625,
625, FALSE,
GIMP_HELP_VIEW_ZOOM_OUT },
{ "view-zoom-other", NULL,
NC_("view-zoom-action", "Othe_r zoom factor..."), NULL, { NULL },
NC_("view-zoom-action", "Set a custom zoom factor"),
0,
NC_("view-zoom-action", "Othe_r zoom factor..."),
{ NULL },
NC_("view-zoom-action", "Set a custom zoom factor"),
0, TRUE,
GIMP_HELP_VIEW_ZOOM_OTHER }
};
@@ -648,8 +668,6 @@ static const GimpEnumActionEntry view_scroll_vertical_actions[] =
void
view_actions_setup (GimpActionGroup *group)
{
GimpAction *action;
gimp_action_group_add_actions (group, "view-action",
view_actions,
G_N_ELEMENTS (view_actions));
@@ -663,12 +681,10 @@ view_actions_setup (GimpActionGroup *group)
G_N_ELEMENTS (view_zoom_actions),
view_zoom_cmd_callback);
gimp_action_group_add_radio_actions (group, "view-zoom-action",
view_zoom_explicit_actions,
G_N_ELEMENTS (view_zoom_explicit_actions),
NULL,
10000,
view_zoom_explicit_cmd_callback);
gimp_action_group_add_enum_actions (group, "view-zoom-action",
view_zoom_explicit_actions,
G_N_ELEMENTS (view_zoom_explicit_actions),
view_zoom_explicit_cmd_callback);
gimp_action_group_add_toggle_actions (group, "view-action",
view_flip_actions,
@@ -710,15 +726,6 @@ view_actions_setup (GimpActionGroup *group)
G_N_ELEMENTS (view_scroll_vertical_actions),
view_scroll_vertical_cmd_callback);
/* connect "activate" of view-zoom-other manually so it can be
* selected even if it's the active item of the radio group
*/
action = gimp_action_group_get_action (group, "view-zoom-other");
g_signal_connect (action, "activate",
G_CALLBACK (view_zoom_other_cmd_callback),
group->user_data);
g_signal_connect_object (group->gimp->config, "notify::check-type",
G_CALLBACK (view_actions_check_type_notify),
group, 0);
@@ -983,55 +990,20 @@ static void
view_actions_set_zoom (GimpActionGroup *group,
GimpDisplayShell *shell)
{
const gchar *action = NULL;
GimpImageWindow *window;
GimpMenuModel *model;
gchar *str;
gchar *label;
guint scale;
g_object_get (shell->zoom,
"percentage", &str,
NULL);
scale = ROUND (gimp_zoom_model_get_factor (shell->zoom) * 1000);
switch (scale)
{
case 16000: action = "view-zoom-16-1"; break;
case 8000: action = "view-zoom-8-1"; break;
case 4000: action = "view-zoom-4-1"; break;
case 2000: action = "view-zoom-2-1"; break;
case 1000: action = "view-zoom-1-1"; break;
case 500: action = "view-zoom-1-2"; break;
case 250: action = "view-zoom-1-4"; break;
case 125: action = "view-zoom-1-8"; break;
case 63:
case 62: action = "view-zoom-1-16"; break;
}
if (! action)
{
action = "view-zoom-other";
label = g_strdup_printf (_("Othe_r (%s)..."), str);
gimp_action_group_set_action_label (group, action, label);
g_free (label);
shell->other_scale = gimp_zoom_model_get_factor (shell->zoom);
}
gimp_action_group_set_action_active (group, action, TRUE);
window = gimp_display_shell_get_window (shell);
model = gimp_image_window_get_menubar_model (window);
label = g_strdup_printf (_("_Zoom (%s)"), str);
gimp_menu_model_set_title (model, "/View/Zoom", label);
g_free (label);
/* flag as dirty */
shell->other_scale = - fabs (shell->other_scale);
g_free (str);
}
@@ -1082,9 +1054,7 @@ view_actions_check_type_notify (GimpDisplayConfig *config,
GimpActionGroup *group)
{
gimp_action_group_set_action_color (group, "view-padding-color-light-check",
gimp_render_check_color1 (),
FALSE);
(GeglColor *) gimp_render_check_color1 (), FALSE);
gimp_action_group_set_action_color (group, "view-padding-color-dark-check",
gimp_render_check_color2 (),
FALSE);
(GeglColor *) gimp_render_check_color2 (), FALSE);
}

View File

@@ -80,7 +80,7 @@
/* local function prototypes */
static void view_padding_color_dialog_update (GimpColorDialog *dialog,
const GimpRGB *color,
GeglColor *color,
GimpColorDialogState state,
GimpDisplayShell *shell);
@@ -284,22 +284,7 @@ view_zoom_explicit_cmd_callback (GimpAction *action,
(gdouble) factor / 10000,
GIMP_ZOOM_FOCUS_RETAIN_CENTERING_ELSE_BEST_GUESS);
}
}
/* not a GimpActionCallback */
void
view_zoom_other_cmd_callback (GimpAction *action,
gpointer data)
{
GimpDisplayShell *shell;
return_if_no_shell (shell, data);
/* check if we are activated by the user or from
* view_actions_set_zoom(), also this is really a GtkToggleAction
* NOT a GimpToggleAction
*/
if (gimp_toggle_action_get_active (GIMP_TOGGLE_ACTION (action)) &&
shell->other_scale != gimp_zoom_model_get_factor (shell->zoom))
else
{
gimp_display_shell_scale_dialog (shell);
}
@@ -1066,13 +1051,13 @@ view_padding_color_cmd_callback (GimpAction *action,
options->padding_mode_set = TRUE;
gimp_display_shell_set_padding (shell, padding_mode,
&options->padding_color);
options->padding_color);
break;
case GIMP_CANVAS_PADDING_MODE_CUSTOM:
{
GtkWidget *dialog;
GimpRGB *old_color = g_new (GimpRGB, 1);
GeglColor *old_color;
GimpCanvasPaddingMode old_padding_mode;
dialog = dialogs_get_dialog (G_OBJECT (shell), PADDING_COLOR_DIALOG_KEY);
@@ -1091,7 +1076,7 @@ view_padding_color_cmd_callback (GimpAction *action,
_("Set Custom Canvas Padding Color"),
GTK_WIDGET (shell),
NULL, NULL,
&options->padding_color,
options->padding_color,
TRUE, FALSE);
g_signal_connect (dialog, "update",
@@ -1101,10 +1086,10 @@ view_padding_color_cmd_callback (GimpAction *action,
dialogs_attach_dialog (G_OBJECT (shell),
PADDING_COLOR_DIALOG_KEY, dialog);
}
*old_color = options->padding_color;
old_color = gegl_color_duplicate (options->padding_color);
old_padding_mode = options->padding_mode;
g_object_set_data_full (G_OBJECT (dialog), "old-color",
old_color, g_free);
old_color, g_object_unref);
g_object_set_data (G_OBJECT (dialog), "old-padding-mode",
GINT_TO_POINTER (old_padding_mode));
@@ -1127,7 +1112,7 @@ view_padding_color_cmd_callback (GimpAction *action,
gimp_display_shell_set_padding (shell,
default_options->padding_mode,
&default_options->padding_color);
default_options->padding_color);
gimp_display_shell_set_padding_in_show_all (shell,
default_options->padding_in_show_all);
}
@@ -1189,13 +1174,13 @@ view_fullscreen_cmd_callback (GimpAction *action,
static void
view_padding_color_dialog_update (GimpColorDialog *dialog,
const GimpRGB *color,
GeglColor *color,
GimpColorDialogState state,
GimpDisplayShell *shell)
{
GimpImageWindow *window;
GimpDisplayOptions *options;
GimpRGB *old_color;
GeglColor *old_color;
GimpCanvasPaddingMode old_padding_mode;
gboolean fullscreen;

View File

@@ -49,10 +49,6 @@ void view_zoom_explicit_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data);
/* not a GimpActionCallback */
void view_zoom_other_cmd_callback (GimpAction *action,
gpointer data);
void view_show_all_cmd_callback (GimpAction *action,
GVariant *value,
gpointer data);

View File

@@ -70,7 +70,7 @@ window_open_display_cmd_callback (GimpAction *action,
GtkWidget *entry;
return_if_no_widget (widget, data);
dialog = gimp_message_dialog_new ("Open Display", GIMP_ICON_WILBER_EEK,
dialog = gimp_message_dialog_new (_("Open Display"), GIMP_ICON_WILBER_EEK,
widget, GTK_DIALOG_MODAL,
NULL, NULL,
@@ -85,11 +85,11 @@ window_open_display_cmd_callback (GimpAction *action,
-1);
gimp_message_box_set_primary_text (GIMP_MESSAGE_DIALOG (dialog)->box,
"Experimental multi-display stuff!\n"
"Click OK and have fun crashing GIMP...");
_("Experimental multi-display stuff!\n"
"Click OK and have fun crashing GIMP..."));
gimp_message_box_set_text (GIMP_MESSAGE_DIALOG (dialog)->box,
"Please enter the name of the new display:");
_("Please enter the name of the new display:"));
entry = gtk_entry_new ();
gtk_entry_set_activates_default (GTK_ENTRY (entry), TRUE);
@@ -115,8 +115,8 @@ window_open_display_cmd_callback (GimpAction *action,
if (! display)
gimp_message_box_set_text (GIMP_MESSAGE_DIALOG (dialog)->box,
"Can't open display '%s'. "
"Please try another one:",
_("Can't open display '%s'. "
"Please try another one:"),
screen_name);
g_free (screen_name);

View File

@@ -401,19 +401,6 @@ app_activate_callback (GimpCoreApp *app,
*/
gimp_rc_set_autosave (GIMP_RC (gimp->edit_config), TRUE);
/* check for updates *after* enabling config autosave, so that the timestamp
* is saved
*/
gimp_update_auto_check (gimp->edit_config, gimp);
/* Setting properties to be used for the next run. */
g_object_set (gimp->edit_config,
/* Set this after gimp_update_auto_check(). */
"config-version", GIMP_VERSION,
/* Set this after gimp_restore(). */
"prev-language", current_language,
NULL);
#ifndef GIMP_CONSOLE_COMPILATION
if (! gimp->no_interface)
{
@@ -471,6 +458,19 @@ app_activate_callback (GimpCoreApp *app,
}
#endif
/* check for updates *after* enabling config autosave, so that the timestamp
* is saved
*/
gimp_update_auto_check (gimp->edit_config, gimp);
/* Setting properties to be used for the next run. */
g_object_set (gimp->edit_config,
/* Set this after gimp_update_auto_check(). */
"config-version", GIMP_VERSION,
/* Set this after gimp_restore(). */
"prev-language", current_language,
NULL);
/* Load the images given on the command-line. */
filenames = gimp_core_app_get_filenames (app);
if (filenames != NULL)

View File

@@ -387,6 +387,37 @@ gimp_zoom_quality_get_type (void)
return type;
}
GType
gimp_theme_scheme_get_type (void)
{
static const GEnumValue values[] =
{
{ GIMP_THEME_LIGHT, "GIMP_THEME_LIGHT", "light" },
{ GIMP_THEME_GRAY, "GIMP_THEME_GRAY", "gray" },
{ GIMP_THEME_DARK, "GIMP_THEME_DARK", "dark" },
{ 0, NULL, NULL }
};
static const GimpEnumDesc descs[] =
{
{ GIMP_THEME_LIGHT, NC_("theme-scheme", "Light Colors"), NULL },
{ GIMP_THEME_GRAY, NC_("theme-scheme", "Middle Gray"), NULL },
{ GIMP_THEME_DARK, NC_("theme-scheme", "Dark Colors"), NULL },
{ 0, NULL, NULL }
};
static GType type = 0;
if (G_UNLIKELY (! type))
{
type = g_enum_register_static ("GimpThemeScheme", values);
gimp_type_set_translation_context (type, "theme-scheme");
gimp_enum_set_value_descriptions (type, descs);
}
return type;
}
/* Generated data ends here */

View File

@@ -164,5 +164,19 @@ typedef enum
GIMP_ZOOM_QUALITY_HIGH /*< desc="High" >*/
} GimpZoomQuality;
#define GIMP_TYPE_THEME_SCHEME (gimp_theme_scheme_get_type ())
GType gimp_theme_scheme_get_type (void) G_GNUC_CONST;
typedef enum
{
GIMP_THEME_LIGHT, /*< desc="Light Colors" >*/
GIMP_THEME_GRAY, /*< desc="Middle Gray" >*/
GIMP_THEME_DARK, /*< desc="Dark Colors" >*/
/* TODO: it might be interesting eventually to add a GIMP_THEME_SYSTEM
* following up the system-wide color scheme preference. See #8675.
*/
} GimpThemeScheme;
#endif /* __CONFIG_ENUMS_H__ */

View File

@@ -94,6 +94,7 @@ enum
PROP_GLOBAL_PALETTE,
PROP_GLOBAL_GRADIENT,
PROP_GLOBAL_FONT,
PROP_GLOBAL_EXPAND,
PROP_DEFAULT_IMAGE,
PROP_DEFAULT_GRID,
PROP_UNDO_LEVELS,
@@ -169,9 +170,11 @@ gimp_core_config_class_init (GimpCoreConfigClass *klass)
GObjectClass *object_class = G_OBJECT_CLASS (klass);
gchar *path;
gchar *mypaint_brushes;
GimpRGB red = { 1.0, 0, 0, 0.5 };
GeglColor *red = gegl_color_new ("red");
guint64 undo_size;
gimp_color_set_alpha (red, 0.5);
object_class->finalize = gimp_core_config_finalize;
object_class->set_property = gimp_core_config_set_property;
object_class->get_property = gimp_core_config_get_property;
@@ -536,6 +539,13 @@ gimp_core_config_class_init (GimpCoreConfigClass *klass)
TRUE,
GIMP_PARAM_STATIC_STRINGS);
GIMP_CONFIG_PROP_BOOLEAN (object_class, PROP_GLOBAL_EXPAND,
"global-expand",
"Global expand",
GLOBAL_EXPAND_BLURB,
TRUE,
GIMP_PARAM_STATIC_STRINGS);
GIMP_CONFIG_PROP_OBJECT (object_class, PROP_DEFAULT_IMAGE,
"default-image",
"Default image",
@@ -696,12 +706,12 @@ gimp_core_config_class_init (GimpCoreConfigClass *klass)
TRUE,
GIMP_PARAM_STATIC_STRINGS);
GIMP_CONFIG_PROP_RGB (object_class, PROP_QUICK_MASK_COLOR,
"quick-mask-color",
"Quick mask color",
QUICK_MASK_COLOR_BLURB,
TRUE, &red,
GIMP_PARAM_STATIC_STRINGS);
GIMP_CONFIG_PROP_COLOR (object_class, PROP_QUICK_MASK_COLOR,
"quick-mask-color",
"Quick mask color",
QUICK_MASK_COLOR_BLURB,
red,
GIMP_PARAM_STATIC_STRINGS);
GIMP_CONFIG_PROP_BOOLEAN (object_class, PROP_IMPORT_PROMOTE_FLOAT,
"import-promote-float",
@@ -828,11 +838,18 @@ gimp_core_config_class_init (GimpCoreConfigClass *klass)
27, 256, 144,
GIMP_PARAM_STATIC_STRINGS |
GIMP_CONFIG_PARAM_IGNORE);
g_object_unref (red);
}
static void
gimp_core_config_init (GimpCoreConfig *config)
{
GeglColor *red = gegl_color_new ("red");
gimp_color_set_alpha (red, 0.5);
config->quick_mask_color = red;
config->default_image = g_object_new (GIMP_TYPE_TEMPLATE,
"name", "Default Image",
"comment", GIMP_DEFAULT_COMMENT,
@@ -899,6 +916,7 @@ gimp_core_config_finalize (GObject *object)
g_clear_object (&core_config->default_image);
g_clear_object (&core_config->default_grid);
g_clear_object (&core_config->color_management);
g_clear_object (&core_config->quick_mask_color);
G_OBJECT_CLASS (parent_class)->finalize (object);
}
@@ -1057,6 +1075,9 @@ gimp_core_config_set_property (GObject *object,
case PROP_GLOBAL_FONT:
core_config->global_font = g_value_get_boolean (value);
break;
case PROP_GLOBAL_EXPAND:
core_config->global_expand = g_value_get_boolean (value);
break;
case PROP_DEFAULT_IMAGE:
if (g_value_get_object (value))
gimp_config_sync (g_value_get_object (value) ,
@@ -1131,7 +1152,8 @@ gimp_core_config_set_property (GObject *object,
core_config->save_document_history = g_value_get_boolean (value);
break;
case PROP_QUICK_MASK_COLOR:
gimp_value_get_rgb (value, &core_config->quick_mask_color);
g_clear_object (&core_config->quick_mask_color);
core_config->quick_mask_color = gegl_color_duplicate (g_value_get_object (value));
break;
case PROP_IMPORT_PROMOTE_FLOAT:
core_config->import_promote_float = g_value_get_boolean (value);
@@ -1333,6 +1355,9 @@ gimp_core_config_get_property (GObject *object,
case PROP_GLOBAL_FONT:
g_value_set_boolean (value, core_config->global_font);
break;
case PROP_GLOBAL_EXPAND:
g_value_set_boolean (value, core_config->global_expand);
break;
case PROP_DEFAULT_IMAGE:
g_value_set_object (value, core_config->default_image);
break;
@@ -1397,7 +1422,7 @@ gimp_core_config_get_property (GObject *object,
g_value_set_boolean (value, core_config->save_document_history);
break;
case PROP_QUICK_MASK_COLOR:
gimp_value_set_rgb (value, &core_config->quick_mask_color);
g_value_set_object (value, core_config->quick_mask_color);
break;
case PROP_IMPORT_PROMOTE_FLOAT:
g_value_set_boolean (value, core_config->import_promote_float);

View File

@@ -78,6 +78,7 @@ struct _GimpCoreConfig
gboolean global_palette;
gboolean global_gradient;
gboolean global_font;
gboolean global_expand;
GimpTemplate *default_image;
GimpGrid *default_grid;
gint levels_of_undo;
@@ -92,7 +93,7 @@ struct _GimpCoreConfig
guint64 thumbnail_filesize_limit;
GimpColorConfig *color_management;
gboolean save_document_history;
GimpRGB quick_mask_color;
GeglColor *quick_mask_color;
gboolean import_promote_float;
gboolean import_promote_dither;
gboolean import_add_alpha;

View File

@@ -155,7 +155,9 @@ static void
gimp_dialog_config_class_init (GimpDialogConfigClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
GimpRGB half_transparent = { 0.0, 0.0, 0.0, 0.5 };
GeglColor *half_transparent = gegl_color_new ("black");
gimp_color_set_alpha (half_transparent, 0.5);
object_class->constructed = gimp_dialog_config_constructed;
object_class->finalize = gimp_dialog_config_finalize;
@@ -416,13 +418,12 @@ gimp_dialog_config_class_init (GimpDialogConfigClass *klass)
_("Channel"),
GIMP_PARAM_STATIC_STRINGS);
GIMP_CONFIG_PROP_RGB (object_class, PROP_CHANNEL_NEW_COLOR,
"channel-new-color",
"Default new channel color and opacity",
CHANNEL_NEW_COLOR_BLURB,
TRUE,
&half_transparent,
GIMP_PARAM_STATIC_STRINGS);
GIMP_CONFIG_PROP_COLOR (object_class, PROP_CHANNEL_NEW_COLOR,
"channel-new-color",
"Default new channel color and opacity",
CHANNEL_NEW_COLOR_BLURB,
half_transparent,
GIMP_PARAM_STATIC_STRINGS);
GIMP_CONFIG_PROP_STRING (object_class, PROP_VECTORS_NEW_NAME,
"path-new-name",
@@ -540,11 +541,17 @@ gimp_dialog_config_class_init (GimpDialogConfigClass *klass)
GIMP_TYPE_STROKE_OPTIONS,
GIMP_PARAM_STATIC_STRINGS |
GIMP_CONFIG_PARAM_AGGREGATE);
g_object_unref (half_transparent);
}
static void
gimp_dialog_config_init (GimpDialogConfig *config)
{
GeglColor *half_transparent = gegl_color_new ("black");
gimp_color_set_alpha (half_transparent, 0.5);
config->channel_new_color = half_transparent;
}
static void
@@ -591,6 +598,7 @@ gimp_dialog_config_finalize (GObject *object)
g_clear_object (&config->fill_options);
g_clear_object (&config->stroke_options);
g_clear_object (&config->channel_new_color);
G_OBJECT_CLASS (parent_class)->finalize (object);
}
@@ -723,7 +731,8 @@ gimp_dialog_config_set_property (GObject *object,
config->channel_new_name = g_value_dup_string (value);
break;
case PROP_CHANNEL_NEW_COLOR:
gimp_value_get_rgb (value, &config->channel_new_color);
g_clear_object (&config->channel_new_color);
config->channel_new_color = gegl_color_duplicate (g_value_get_object (value));
break;
case PROP_VECTORS_NEW_NAME:
@@ -920,7 +929,7 @@ gimp_dialog_config_get_property (GObject *object,
g_value_set_string (value, config->channel_new_name);
break;
case PROP_CHANNEL_NEW_COLOR:
gimp_value_set_rgb (value, &config->channel_new_color);
g_value_set_object (value, config->channel_new_color);
break;
case PROP_VECTORS_NEW_NAME:

View File

@@ -85,7 +85,7 @@ struct _GimpDialogConfig
gboolean layer_merge_discard_invisible;
gchar *channel_new_name;
GimpRGB channel_new_color;
GeglColor *channel_new_color;
gchar *vectors_new_name;

View File

@@ -115,7 +115,8 @@ static void
gimp_display_config_class_init (GimpDisplayConfigClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
GimpRGB color = { 0, 0, 0, 0 };
GimpRGB xor_rgb = { 0, 0, 0, 0 };
GeglColor *color = gegl_color_new (NULL);
object_class->finalize = gimp_display_config_finalize;
object_class->set_property = gimp_display_config_set_property;
@@ -137,19 +138,21 @@ gimp_display_config_class_init (GimpDisplayConfigClass *klass)
GIMP_CHECK_TYPE_GRAY_CHECKS,
GIMP_PARAM_STATIC_STRINGS);
GIMP_CONFIG_PROP_RGB (object_class, PROP_TRANSPARENCY_CUSTOM_COLOR1,
"transparency-custom-color1",
"Transparency custom color 1",
TRANSPARENCY_CUSTOM_COLOR1_BLURB,
FALSE, &GIMP_CHECKS_CUSTOM_COLOR1,
GIMP_PARAM_STATIC_STRINGS);
gegl_color_set_pixel (color, babl_format ("R'G'B'A double"), GIMP_CHECKS_CUSTOM_COLOR1);
GIMP_CONFIG_PROP_COLOR (object_class, PROP_TRANSPARENCY_CUSTOM_COLOR1,
"transparency-custom-color1",
_("Transparency custom color 1"),
TRANSPARENCY_CUSTOM_COLOR1_BLURB,
color,
GIMP_PARAM_STATIC_STRINGS);
GIMP_CONFIG_PROP_RGB (object_class, PROP_TRANSPARENCY_CUSTOM_COLOR2,
"transparency-custom-color2",
"Transparency custom color 2",
TRANSPARENCY_CUSTOM_COLOR2_BLURB,
FALSE, &GIMP_CHECKS_CUSTOM_COLOR2,
GIMP_PARAM_STATIC_STRINGS);
gegl_color_set_pixel (color, babl_format ("R'G'B'A double"), GIMP_CHECKS_CUSTOM_COLOR2);
GIMP_CONFIG_PROP_COLOR (object_class, PROP_TRANSPARENCY_CUSTOM_COLOR2,
"transparency-custom-color2",
_("Transparency custom color 2"),
TRANSPARENCY_CUSTOM_COLOR2_BLURB,
color,
GIMP_PARAM_STATIC_STRINGS);
GIMP_CONFIG_PROP_INT (object_class, PROP_SNAP_DISTANCE,
"snap-distance",
@@ -379,7 +382,7 @@ gimp_display_config_class_init (GimpDisplayConfigClass *klass)
GIMP_CONFIG_PROP_RGB (object_class, PROP_XOR_COLOR,
"xor-color",
NULL, NULL,
FALSE, &color,
FALSE, &xor_rgb,
GIMP_PARAM_STATIC_STRINGS |
GIMP_CONFIG_PARAM_IGNORE);
@@ -400,11 +403,23 @@ gimp_display_config_class_init (GimpDisplayConfigClass *klass)
NULL, NULL,
G_TYPE_OBJECT,
GIMP_PARAM_READWRITE));
g_object_unref (color);
}
static void
gimp_display_config_init (GimpDisplayConfig *config)
{
GeglColor *color;
color = gegl_color_new (NULL);
gegl_color_set_pixel (color, babl_format ("R'G'B'A double"), GIMP_CHECKS_CUSTOM_COLOR1);
config->transparency_custom_color1 = color;
color = gegl_color_new (NULL);
gegl_color_set_pixel (color, babl_format ("R'G'B'A double"), GIMP_CHECKS_CUSTOM_COLOR2);
config->transparency_custom_color2 = color;
config->default_view =
g_object_new (GIMP_TYPE_DISPLAY_OPTIONS, NULL);
@@ -431,6 +446,8 @@ gimp_display_config_finalize (GObject *object)
g_clear_object (&display_config->default_view);
g_clear_object (&display_config->default_fullscreen_view);
g_clear_object (&display_config->modifiers_manager);
g_clear_object (&display_config->transparency_custom_color1);
g_clear_object (&display_config->transparency_custom_color2);
G_OBJECT_CLASS (parent_class)->finalize (object);
}
@@ -452,10 +469,12 @@ gimp_display_config_set_property (GObject *object,
display_config->transparency_type = g_value_get_enum (value);
break;
case PROP_TRANSPARENCY_CUSTOM_COLOR1:
display_config->transparency_custom_color1 = *(GimpRGB *) g_value_get_boxed (value);
g_clear_object (&display_config->transparency_custom_color1);
display_config->transparency_custom_color1 = gegl_color_duplicate (g_value_get_object (value));
break;
case PROP_TRANSPARENCY_CUSTOM_COLOR2:
display_config->transparency_custom_color2 = *(GimpRGB *) g_value_get_boxed (value);
g_clear_object (&display_config->transparency_custom_color2);
display_config->transparency_custom_color2 = gegl_color_duplicate (g_value_get_object (value));
break;
case PROP_SNAP_DISTANCE:
display_config->snap_distance = g_value_get_int (value);
@@ -579,10 +598,10 @@ gimp_display_config_get_property (GObject *object,
g_value_set_enum (value, display_config->transparency_type);
break;
case PROP_TRANSPARENCY_CUSTOM_COLOR1:
g_value_set_boxed (value, &display_config->transparency_custom_color1);
g_value_set_object (value, display_config->transparency_custom_color1);
break;
case PROP_TRANSPARENCY_CUSTOM_COLOR2:
g_value_set_boxed (value, &display_config->transparency_custom_color2);
g_value_set_object (value, display_config->transparency_custom_color2);
break;
case PROP_SNAP_DISTANCE:
g_value_set_int (value, display_config->snap_distance);

View File

@@ -43,8 +43,8 @@ struct _GimpDisplayConfig
GimpCheckSize transparency_size;
GimpCheckType transparency_type;
GimpRGB transparency_custom_color1;
GimpRGB transparency_custom_color2;
GeglColor *transparency_custom_color1;
GeglColor *transparency_custom_color2;
gint snap_distance;
gint marching_ants_speed;
gboolean resize_windows_on_zoom;

View File

@@ -63,6 +63,7 @@ enum
};
static void gimp_display_options_finalize (GObject *object);
static void gimp_display_options_set_property (GObject *object,
guint property_id,
const GValue *value,
@@ -103,10 +104,9 @@ static void
gimp_display_options_class_init (GimpDisplayOptionsClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
GimpRGB white;
gimp_rgba_set (&white, 1.0, 1.0, 1.0, GIMP_OPACITY_OPAQUE);
GeglColor *white = gegl_color_new ("white");
object_class->finalize = gimp_display_options_finalize;
object_class->set_property = gimp_display_options_set_property;
object_class->get_property = gimp_display_options_get_property;
@@ -230,12 +230,12 @@ gimp_display_options_class_init (GimpDisplayOptionsClass *klass)
GIMP_CANVAS_PADDING_MODE_DEFAULT,
GIMP_PARAM_STATIC_STRINGS);
GIMP_CONFIG_PROP_RGB (object_class, PROP_PADDING_COLOR,
"padding-color",
"Padding color",
CANVAS_PADDING_COLOR_BLURB,
FALSE, &white,
GIMP_PARAM_STATIC_STRINGS);
GIMP_CONFIG_PROP_COLOR (object_class, PROP_PADDING_COLOR,
"padding-color",
"Padding color",
CANVAS_PADDING_COLOR_BLURB,
white,
GIMP_PARAM_STATIC_STRINGS);
GIMP_CONFIG_PROP_BOOLEAN (object_class, PROP_PADDING_IN_SHOW_ALL,
"padding-in-show-all",
@@ -243,16 +243,17 @@ gimp_display_options_class_init (GimpDisplayOptionsClass *klass)
CANVAS_PADDING_IN_SHOW_ALL_BLURB,
FALSE,
GIMP_PARAM_STATIC_STRINGS);
g_object_unref (white);
}
static void
gimp_display_options_fullscreen_class_init (GimpDisplayOptionsFullscreenClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
GimpRGB black;
gimp_rgba_set (&black, 0.0, 0.0, 0.0, GIMP_OPACITY_OPAQUE);
GeglColor *black = gegl_color_new ("black");
object_class->finalize = gimp_display_options_finalize;
object_class->set_property = gimp_display_options_set_property;
object_class->get_property = gimp_display_options_get_property;
@@ -376,12 +377,12 @@ gimp_display_options_fullscreen_class_init (GimpDisplayOptionsFullscreenClass *k
GIMP_CANVAS_PADDING_MODE_CUSTOM,
GIMP_PARAM_STATIC_STRINGS);
GIMP_CONFIG_PROP_RGB (object_class, PROP_PADDING_COLOR,
"padding-color",
"Padding color",
CANVAS_PADDING_COLOR_BLURB,
FALSE, &black,
GIMP_PARAM_STATIC_STRINGS);
GIMP_CONFIG_PROP_COLOR (object_class, PROP_PADDING_COLOR,
"padding-color",
"Padding color",
CANVAS_PADDING_COLOR_BLURB,
black,
GIMP_PARAM_STATIC_STRINGS);
GIMP_CONFIG_PROP_BOOLEAN (object_class, PROP_PADDING_IN_SHOW_ALL,
"padding-in-show-all",
@@ -389,6 +390,8 @@ gimp_display_options_fullscreen_class_init (GimpDisplayOptionsFullscreenClass *k
CANVAS_PADDING_IN_SHOW_ALL_BLURB,
FALSE,
GIMP_PARAM_STATIC_STRINGS);
g_object_unref (black);
}
static void
@@ -501,9 +504,33 @@ gimp_display_options_no_image_class_init (GimpDisplayOptionsNoImageClass *klass)
static void
gimp_display_options_init (GimpDisplayOptions *options)
{
GeglColor *color;
if (G_TYPE_CHECK_INSTANCE_TYPE ((options), GIMP_TYPE_DISPLAY_OPTIONS_FULLSCREEN))
color = gegl_color_new ("black");
else
color = gegl_color_new ("white");
gimp_color_set_alpha (color, GIMP_OPACITY_OPAQUE);
options->padding_color = color;
options->padding_mode_set = FALSE;
}
static void
gimp_display_options_finalize (GObject *object)
{
GimpDisplayOptions *options = GIMP_DISPLAY_OPTIONS (object);
g_clear_object (&options->padding_color);
/* Since we share the finalize for both GimpDisplayOptions and its child
* GimpDisplayOptionsFullscreen, we run the (grand-)parent finalize() function
* directly. We don't want to end up in some infinite loop by recognizing the
* exact type of object.
*/
G_OBJECT_CLASS (gimp_display_options_parent_class)->finalize (object);
}
static void
gimp_display_options_set_property (GObject *object,
guint property_id,
@@ -566,7 +593,8 @@ gimp_display_options_set_property (GObject *object,
options->padding_mode = g_value_get_enum (value);
break;
case PROP_PADDING_COLOR:
options->padding_color = *(GimpRGB *) g_value_get_boxed (value);
g_clear_object (&options->padding_color);
options->padding_color = gegl_color_duplicate (g_value_get_object (value));
break;
case PROP_PADDING_IN_SHOW_ALL:
options->padding_in_show_all = g_value_get_boolean (value);
@@ -640,7 +668,7 @@ gimp_display_options_get_property (GObject *object,
g_value_set_enum (value, options->padding_mode);
break;
case PROP_PADDING_COLOR:
g_value_set_boxed (value, &options->padding_color);
g_value_set_object (value, options->padding_color);
break;
case PROP_PADDING_IN_SHOW_ALL:
g_value_set_boolean (value, options->padding_in_show_all);

View File

@@ -61,7 +61,7 @@ struct _GimpDisplayOptions
gboolean snap_to_equidistance;
GimpCanvasPaddingMode padding_mode;
GimpRGB padding_color;
GeglColor *padding_color;
gboolean padding_mode_set;
gboolean padding_in_show_all;
};

View File

@@ -20,6 +20,7 @@
#include "config.h"
#include <gegl.h>
#include <gio/gio.h>
#include "libgimpbase/gimpbase.h"
@@ -70,12 +71,13 @@ enum
PROP_TOOLBOX_GROUPS,
PROP_THEME_PATH,
PROP_THEME,
PROP_PREFER_DARK_THEME,
PROP_THEME_SCHEME,
PROP_OVERRIDE_THEME_ICON_SIZE,
PROP_CUSTOM_ICON_SIZE,
PROP_ICON_THEME_PATH,
PROP_ICON_THEME,
PROP_PREFER_SYMBOLIC_ICONS,
PROP_FONT_RELATIVE_SIZE,
PROP_USE_HELP,
PROP_SHOW_HELP_BUTTON,
PROP_HELP_LOCALES,
@@ -96,6 +98,7 @@ enum
PROP_SHOW_TABS,
PROP_TABS_POSITION,
PROP_LAST_TIP_SHOWN,
PROP_SHOW_WELCOME_DIALOG,
/* ignored, only for backward compatibility: */
PROP_CURSOR_FORMAT,
@@ -314,11 +317,12 @@ gimp_gui_config_class_init (GimpGuiConfigClass *klass)
THEME_BLURB,
GIMP_CONFIG_DEFAULT_THEME,
GIMP_PARAM_STATIC_STRINGS);
GIMP_CONFIG_PROP_BOOLEAN (object_class, PROP_PREFER_DARK_THEME,
"prefer-dark-theme",
"Prefer Dark Theme",
THEME_BLURB,
TRUE,
GIMP_CONFIG_PROP_ENUM (object_class, PROP_THEME_SCHEME,
"theme-color-scheme",
"Theme's Color Scheme",
THEME_SCHEME_BLURB,
GIMP_TYPE_THEME_SCHEME,
GIMP_THEME_DARK,
GIMP_PARAM_STATIC_STRINGS);
GIMP_CONFIG_PROP_BOOLEAN (object_class, PROP_OVERRIDE_THEME_ICON_SIZE,
"override-theme-icon-size",
@@ -358,6 +362,13 @@ gimp_gui_config_class_init (GimpGuiConfigClass *klass)
TRUE,
GIMP_PARAM_STATIC_STRINGS);
GIMP_CONFIG_PROP_DOUBLE (object_class, PROP_FONT_RELATIVE_SIZE,
"font-relative-size",
"Tweak font-size from the theme",
FONT_SIZE_BLURB,
0.5, 2.0, 1.0,
GIMP_PARAM_STATIC_STRINGS);
GIMP_CONFIG_PROP_BOOLEAN (object_class, PROP_USE_HELP,
"use-help",
"Use help",
@@ -502,6 +513,14 @@ gimp_gui_config_class_init (GimpGuiConfigClass *klass)
G_PARAM_CONSTRUCT |
GIMP_PARAM_STATIC_STRINGS));
GIMP_CONFIG_PROP_BOOLEAN (object_class, PROP_SHOW_WELCOME_DIALOG,
"show-welcome-dialog",
"Show Welcome Dialog each time",
NULL, TRUE,
G_PARAM_READWRITE |
G_PARAM_CONSTRUCT |
GIMP_PARAM_STATIC_STRINGS);
/* only for backward compatibility: */
GIMP_CONFIG_PROP_ENUM (object_class, PROP_CURSOR_FORMAT,
"cursor-format",
@@ -675,8 +694,8 @@ gimp_gui_config_set_property (GObject *object,
g_free (gui_config->theme);
gui_config->theme = g_value_dup_string (value);
break;
case PROP_PREFER_DARK_THEME:
gui_config->prefer_dark_theme = g_value_get_boolean (value);
case PROP_THEME_SCHEME:
gui_config->theme_scheme = g_value_get_enum (value);
break;
case PROP_OVERRIDE_THEME_ICON_SIZE:
gui_config->override_icon_size = g_value_get_boolean (value);
@@ -695,6 +714,9 @@ gimp_gui_config_set_property (GObject *object,
case PROP_PREFER_SYMBOLIC_ICONS:
gui_config->prefer_symbolic_icons = g_value_get_boolean (value);
break;
case PROP_FONT_RELATIVE_SIZE:
gui_config->font_relative_size = g_value_get_double (value);
break;
case PROP_USE_HELP:
gui_config->use_help = g_value_get_boolean (value);
break;
@@ -753,6 +775,9 @@ gimp_gui_config_set_property (GObject *object,
case PROP_LAST_TIP_SHOWN:
gui_config->last_tip_shown = g_value_get_int (value);
break;
case PROP_SHOW_WELCOME_DIALOG:
gui_config->show_welcome_dialog = g_value_get_boolean (value);
break;
case PROP_CURSOR_FORMAT:
case PROP_INFO_WINDOW_PER_DISPLAY:
@@ -854,8 +879,8 @@ gimp_gui_config_get_property (GObject *object,
case PROP_THEME:
g_value_set_string (value, gui_config->theme);
break;
case PROP_PREFER_DARK_THEME:
g_value_set_boolean (value, gui_config->prefer_dark_theme);
case PROP_THEME_SCHEME:
g_value_set_enum (value, gui_config->theme_scheme);
break;
case PROP_OVERRIDE_THEME_ICON_SIZE:
g_value_set_boolean (value, gui_config->override_icon_size);
@@ -872,6 +897,9 @@ gimp_gui_config_get_property (GObject *object,
case PROP_PREFER_SYMBOLIC_ICONS:
g_value_set_boolean (value, gui_config->prefer_symbolic_icons);
break;
case PROP_FONT_RELATIVE_SIZE:
g_value_set_double (value, gui_config->font_relative_size);
break;
case PROP_USE_HELP:
g_value_set_boolean (value, gui_config->use_help);
break;
@@ -928,6 +956,9 @@ gimp_gui_config_get_property (GObject *object,
case PROP_LAST_TIP_SHOWN:
g_value_set_int (value, gui_config->last_tip_shown);
break;
case PROP_SHOW_WELCOME_DIALOG:
g_value_set_boolean (value, gui_config->show_welcome_dialog);
break;
case PROP_CURSOR_FORMAT:
case PROP_INFO_WINDOW_PER_DISPLAY:

View File

@@ -25,7 +25,7 @@
#define GIMP_CONFIG_DEFAULT_THEME "Default"
#define GIMP_CONFIG_DEFAULT_ICON_THEME "Symbolic"
#define GIMP_CONFIG_DEFAULT_ICON_THEME "Default"
#define GIMP_TYPE_GUI_CONFIG (gimp_gui_config_get_type ())
@@ -64,10 +64,11 @@ struct _GimpGuiConfig
gboolean toolbox_groups;
gchar *theme_path;
gchar *theme;
gboolean prefer_dark_theme;
GimpThemeScheme theme_scheme;
gchar *icon_theme_path;
gchar *icon_theme;
gboolean prefer_symbolic_icons;
gdouble font_relative_size;
gboolean override_icon_size;
GimpIconSize custom_icon_size;
gboolean use_help;
@@ -80,6 +81,7 @@ struct _GimpGuiConfig
GimpWindowHint dock_window_hint;
GimpHandedness cursor_handedness;
gboolean custom_title_bar;
gboolean show_welcome_dialog;
/* experimental playground */
gboolean playground_npd_tool;
@@ -93,7 +95,7 @@ struct _GimpGuiConfig
GimpPosition tabs_position;
gint last_tip_shown;
/* Currently ignored snce "gtk-can-change-accels" settings got deprecated in
/* Currently ignored since "gtk-can-change-accels" settings got deprecated in
* GTK+ 3.10.
*/
gboolean can_change_accels;

View File

@@ -50,7 +50,7 @@ _("Timestamp of the last update check.")
"Defines the color management behavior."
#define COLOR_PROFILE_POLICY_BLURB \
_("How to handle embedded color profiles when opening a file.")
_("What to do when opening a file with an embedded ICC color profile.")
#define COLOR_PROFILE_PATH_BLURB \
_("Sets the default folder path for all color profile file dialogs.")
@@ -181,6 +181,9 @@ _("When enabled, the selected pattern will be used for all tools.")
#define GLOBAL_PALETTE_BLURB \
"When enabled, the selected palette will be used for all tools."
#define GLOBAL_EXPAND_BLURB \
_("When enabled, the selected auto expand layer settings will be used for all tools.")
#define GRADIENT_PATH_BLURB \
"Sets the gradient search path."
@@ -543,6 +546,9 @@ _("Sets the folder for temporary storage. Files will appear here " \
#define THEME_BLURB \
_("The name of the theme to use.")
#define THEME_SCHEME_BLURB \
_("Chooses the color scheme variant of the theme.")
#define THEME_PATH_BLURB \
"Sets the theme search path."
@@ -561,6 +567,9 @@ _("When enabled, symbolic icons will be preferred if available.")
#define ICON_THEME_PATH_BLURB \
"Sets the icon theme search path."
#define FONT_SIZE_BLURB \
_("Tweak font size of the graphical interface.")
#define IMAGE_CONVERT_PROFILE_INTENT_BLURB \
_("Sets the default rendering intent for the 'Convert to Color Profile' dialog.")
@@ -776,7 +785,7 @@ _("When enabled, uses OpenCL for some operations.")
"'user-manual-online' is enabled."
#define ZOOM_QUALITY_BLURB \
"There's a tradeoff between speed and quality of the zoomed-out display."
_("There's a tradeoff between speed and quality of the zoomed-out display.")
#define DEFAULT_USE_EVENT_HISTORY_BLURB \
"Bugs in event history buffer are frequent so in case of cursor " \

View File

@@ -23,6 +23,7 @@
#include "stdlib.h"
#include "string.h"
#include <gegl.h>
#include <gio/gio.h>
#include "libgimpbase/gimpbase.h"
@@ -70,6 +71,7 @@ main (int argc,
}
units_init ();
gegl_init (&argc, &argv);
g_print ("\nTesting GimpConfig ...\n");

View File

@@ -1195,6 +1195,7 @@ gimp_undo_type_get_type (void)
{ GIMP_UNDO_GROUP_IMAGE_VECTORS_MERGE, "GIMP_UNDO_GROUP_IMAGE_VECTORS_MERGE", "group-image-vectors-merge" },
{ GIMP_UNDO_GROUP_IMAGE_QUICK_MASK, "GIMP_UNDO_GROUP_IMAGE_QUICK_MASK", "group-image-quick-mask" },
{ GIMP_UNDO_GROUP_IMAGE_GRID, "GIMP_UNDO_GROUP_IMAGE_GRID", "group-image-grid" },
{ GIMP_UNDO_GROUP_IMAGE_COLORMAP_REMAP, "GIMP_UNDO_GROUP_IMAGE_COLORMAP_REMAP", "group-image-colormap-remap" },
{ GIMP_UNDO_GROUP_GUIDE, "GIMP_UNDO_GROUP_GUIDE", "group-guide" },
{ GIMP_UNDO_GROUP_SAMPLE_POINT, "GIMP_UNDO_GROUP_SAMPLE_POINT", "group-sample-point" },
{ GIMP_UNDO_GROUP_DRAWABLE, "GIMP_UNDO_GROUP_DRAWABLE", "group-drawable" },
@@ -1283,6 +1284,9 @@ gimp_undo_type_get_type (void)
{ GIMP_UNDO_FOREGROUND_SELECT, "GIMP_UNDO_FOREGROUND_SELECT", "foreground-select" },
{ GIMP_UNDO_PARASITE_ATTACH, "GIMP_UNDO_PARASITE_ATTACH", "parasite-attach" },
{ GIMP_UNDO_PARASITE_REMOVE, "GIMP_UNDO_PARASITE_REMOVE", "parasite-remove" },
{ GIMP_UNDO_FILTER_ADD, "GIMP_UNDO_FILTER_ADD", "filter-add" },
{ GIMP_UNDO_FILTER_REMOVE, "GIMP_UNDO_FILTER_REMOVE", "filter-remove" },
{ GIMP_UNDO_FILTER_REORDER, "GIMP_UNDO_FILTER_REORDER", "filter-reorder" },
{ GIMP_UNDO_CANT, "GIMP_UNDO_CANT", "cant" },
{ 0, NULL, NULL }
};
@@ -1303,6 +1307,7 @@ gimp_undo_type_get_type (void)
{ GIMP_UNDO_GROUP_IMAGE_VECTORS_MERGE, NC_("undo-type", "Merge paths"), NULL },
{ GIMP_UNDO_GROUP_IMAGE_QUICK_MASK, NC_("undo-type", "Quick Mask"), NULL },
{ GIMP_UNDO_GROUP_IMAGE_GRID, NC_("undo-type", "Grid"), NULL },
{ GIMP_UNDO_GROUP_IMAGE_COLORMAP_REMAP, NC_("undo-type", "Colormap remapping"), NULL },
{ GIMP_UNDO_GROUP_GUIDE, NC_("undo-type", "Guide"), NULL },
{ GIMP_UNDO_GROUP_SAMPLE_POINT, NC_("undo-type", "Sample Point"), NULL },
{ GIMP_UNDO_GROUP_DRAWABLE, NC_("undo-type", "Layer/Channel"), NULL },
@@ -1391,6 +1396,9 @@ gimp_undo_type_get_type (void)
{ GIMP_UNDO_FOREGROUND_SELECT, NC_("undo-type", "Select foreground"), NULL },
{ GIMP_UNDO_PARASITE_ATTACH, NC_("undo-type", "Attach parasite"), NULL },
{ GIMP_UNDO_PARASITE_REMOVE, NC_("undo-type", "Remove parasite"), NULL },
{ GIMP_UNDO_FILTER_ADD, NC_("undo-type", "Add effect"), NULL },
{ GIMP_UNDO_FILTER_REMOVE, NC_("undo-type", "Remove effect"), NULL },
{ GIMP_UNDO_FILTER_REORDER, NC_("undo-type", "Reorder effect"), NULL },
{ GIMP_UNDO_CANT, NC_("undo-type", "Not undoable"), NULL },
{ 0, NULL, NULL }
};

View File

@@ -544,6 +544,7 @@ typedef enum /*< pdb-skip >*/
GIMP_UNDO_GROUP_IMAGE_VECTORS_MERGE, /*< desc="Merge paths" >*/
GIMP_UNDO_GROUP_IMAGE_QUICK_MASK, /*< desc="Quick Mask" >*/
GIMP_UNDO_GROUP_IMAGE_GRID, /*< desc="Grid" >*/
GIMP_UNDO_GROUP_IMAGE_COLORMAP_REMAP, /*< desc="Colormap remapping" >*/
GIMP_UNDO_GROUP_GUIDE, /*< desc="Guide" >*/
GIMP_UNDO_GROUP_SAMPLE_POINT, /*< desc="Sample Point" >*/
GIMP_UNDO_GROUP_DRAWABLE, /*< desc="Layer/Channel" >*/
@@ -604,7 +605,7 @@ typedef enum /*< pdb-skip >*/
GIMP_UNDO_ITEM_COLOR_TAG, /*< desc="Item color tag" >*/
GIMP_UNDO_ITEM_LOCK_CONTENT, /*< desc="Lock/Unlock content" >*/
GIMP_UNDO_ITEM_LOCK_POSITION, /*< desc="Lock/Unlock position" >*/
GIMP_UNDO_ITEM_LOCK_VISIBILITY, /*< desc="Lock/Unlock visibility" >*/
GIMP_UNDO_ITEM_LOCK_VISIBILITY, /*< desc="Lock/Unlock visibility" >*/
GIMP_UNDO_LAYER_ADD, /*< desc="New layer" >*/
GIMP_UNDO_LAYER_REMOVE, /*< desc="Delete layer" >*/
GIMP_UNDO_LAYER_MODE, /*< desc="Set layer mode" >*/
@@ -637,6 +638,9 @@ typedef enum /*< pdb-skip >*/
GIMP_UNDO_FOREGROUND_SELECT, /*< desc="Select foreground" >*/
GIMP_UNDO_PARASITE_ATTACH, /*< desc="Attach parasite" >*/
GIMP_UNDO_PARASITE_REMOVE, /*< desc="Remove parasite" >*/
GIMP_UNDO_FILTER_ADD, /*< desc="Add effect" >*/
GIMP_UNDO_FILTER_REMOVE, /*< desc="Remove effect" >*/
GIMP_UNDO_FILTER_REORDER, /*< desc="Reorder effect" >*/
GIMP_UNDO_CANT /*< desc="Not undoable" >*/
} GimpUndoType;
@@ -710,6 +714,7 @@ typedef enum /*< pdb-skip, skip >*/
GIMP_CONTEXT_PROP_BUFFER = 18,
GIMP_CONTEXT_PROP_IMAGEFILE = 19,
GIMP_CONTEXT_PROP_TEMPLATE = 20,
GIMP_CONTEXT_PROP_EXPAND = 21,
GIMP_CONTEXT_PROP_LAST = GIMP_CONTEXT_PROP_TEMPLATE
} GimpContextPropType;
@@ -736,6 +741,7 @@ typedef enum /*< pdb-skip, skip >*/
GIMP_CONTEXT_PROP_MASK_BUFFER = 1 << 18,
GIMP_CONTEXT_PROP_MASK_IMAGEFILE = 1 << 19,
GIMP_CONTEXT_PROP_MASK_TEMPLATE = 1 << 20,
GIMP_CONTEXT_PROP_MASK_EXPAND = 1 << 21,
/* aliases */
GIMP_CONTEXT_PROP_MASK_PAINT = (GIMP_CONTEXT_PROP_MASK_FOREGROUND |
@@ -745,7 +751,8 @@ typedef enum /*< pdb-skip, skip >*/
GIMP_CONTEXT_PROP_MASK_BRUSH |
GIMP_CONTEXT_PROP_MASK_DYNAMICS |
GIMP_CONTEXT_PROP_MASK_PATTERN |
GIMP_CONTEXT_PROP_MASK_GRADIENT),
GIMP_CONTEXT_PROP_MASK_GRADIENT |
GIMP_CONTEXT_PROP_MASK_EXPAND),
GIMP_CONTEXT_PROP_MASK_ALL = (GIMP_CONTEXT_PROP_MASK_IMAGE |
GIMP_CONTEXT_PROP_MASK_DISPLAY |

View File

@@ -151,6 +151,7 @@ typedef struct _GimpDynamics GimpDynamics;
typedef struct _GimpDynamicsOutput GimpDynamicsOutput;
typedef struct _GimpGradient GimpGradient;
typedef struct _GimpMybrush GimpMybrush;
typedef struct _GimpPadActions GimpPadActions;
typedef struct _GimpPalette GimpPalette;
typedef struct _GimpPaletteMru GimpPaletteMru;
typedef struct _GimpPattern GimpPattern;

View File

@@ -42,27 +42,28 @@ static cairo_user_data_key_t surface_data_key = { 0, };
cairo_pattern_t *
gimp_cairo_pattern_create_stipple (const GimpRGB *fg,
const GimpRGB *bg,
gint index,
gdouble offset_x,
gdouble offset_y)
gimp_cairo_pattern_create_stipple (GeglColor *fg,
GeglColor *bg,
gint index,
gdouble offset_x,
gdouble offset_y,
const Babl *render_space)
{
cairo_surface_t *surface;
cairo_pattern_t *pattern;
guchar *data;
guchar *d;
guchar fg_r, fg_g, fg_b, fg_a;
guchar bg_r, bg_g, bg_b, bg_a;
guchar fg_rgba[4];
guchar bg_rgba[4];
gint x, y;
g_return_val_if_fail (fg != NULL, NULL);
g_return_val_if_fail (bg != NULL, NULL);
g_return_val_if_fail (GEGL_IS_COLOR (fg), NULL);
g_return_val_if_fail (GEGL_IS_COLOR (bg), NULL);
data = g_malloc (8 * 8 * 4);
gimp_rgba_get_uchar (fg, &fg_r, &fg_g, &fg_b, &fg_a);
gimp_rgba_get_uchar (bg, &bg_r, &bg_g, &bg_b, &bg_a);
gegl_color_get_pixel (fg, babl_format_with_space ("R'G'B'A u8", render_space), fg_rgba);
gegl_color_get_pixel (bg, babl_format_with_space ("R'G'B'A u8", render_space), bg_rgba);
d = data;
@@ -71,9 +72,9 @@ gimp_cairo_pattern_create_stipple (const GimpRGB *fg,
for (x = 0; x < 8; x++)
{
if ((x + y + index) % 8 >= 4)
GIMP_CAIRO_ARGB32_SET_PIXEL (d, fg_r, fg_g, fg_b, fg_a);
GIMP_CAIRO_ARGB32_SET_PIXEL (d, fg_rgba[0], fg_rgba[1], fg_rgba[2], fg_rgba[3]);
else
GIMP_CAIRO_ARGB32_SET_PIXEL (d, bg_r, bg_g, bg_b, bg_a);
GIMP_CAIRO_ARGB32_SET_PIXEL (d, bg_rgba[0], bg_rgba[1], bg_rgba[2], bg_rgba[3]);
d += 4;
}

View File

@@ -25,27 +25,28 @@
#define __APP_GIMP_CAIRO_H__
cairo_pattern_t * gimp_cairo_pattern_create_stipple (const GimpRGB *fg,
const GimpRGB *bg,
gint index,
gdouble offset_x,
gdouble offset_y);
cairo_pattern_t * gimp_cairo_pattern_create_stipple (GeglColor *fg,
GeglColor *bg,
gint index,
gdouble offset_x,
gdouble offset_y,
const Babl *render_space);
void gimp_cairo_arc (cairo_t *cr,
gdouble center_x,
gdouble center_y,
gdouble radius,
gdouble start_angle,
gdouble slice_angle);
void gimp_cairo_rounded_rectangle (cairo_t *cr,
gdouble x,
gdouble y,
gdouble width,
gdouble height,
gdouble corner_radius);
void gimp_cairo_segments (cairo_t *cr,
GimpSegment *segs,
gint n_segs);
void gimp_cairo_arc (cairo_t *cr,
gdouble center_x,
gdouble center_y,
gdouble radius,
gdouble start_angle,
gdouble slice_angle);
void gimp_cairo_rounded_rectangle (cairo_t *cr,
gdouble x,
gdouble y,
gdouble width,
gdouble height,
gdouble corner_radius);
void gimp_cairo_segments (cairo_t *cr,
GimpSegment *segs,
gint n_segs);
#endif /* __APP_GIMP_CAIRO_H__ */

View File

@@ -509,8 +509,24 @@ gimp_edit_paste_get_layers (GimpImage *image,
if (GIMP_IS_IMAGE (paste))
{
GimpImageBaseType base_type;
GimpPrecision precision;
layers = gimp_image_get_layer_iter (GIMP_IMAGE (paste));
/* If pasting into an empty image, use the image information.
* Otherwise, get it from the selected drawables */
if (drawables && drawables->data)
{
base_type = gimp_drawable_get_base_type (drawables->data);
precision = gimp_drawable_get_precision (drawables->data);
}
else
{
base_type = gimp_image_get_base_type (image);
precision = gimp_image_get_precision (image);
}
if (g_list_length (layers) > 1)
{
if (gimp_edit_paste_is_in_place (*paste_type))
@@ -520,8 +536,7 @@ gimp_edit_paste_get_layers (GimpImage *image,
}
layers = gimp_edit_paste_get_tagged_layers (image, layers, NULL, floating_format,
gimp_drawable_get_base_type (drawables->data),
gimp_drawable_get_precision (drawables->data),
base_type, precision,
*paste_type);
layers = g_list_reverse (layers);
}

View File

@@ -78,25 +78,25 @@ gimp_gradients_init (Gimp *gimp)
gradient->segments->right_color_type = GIMP_GRADIENT_COLOR_BACKGROUND;
gimp_context_set_gradient (gimp->user_context, gradient);
/* FG to BG (Hardedge) */
/* FG to BG (Hard Edge) */
gradient = gimp_gradients_add_gradient (gimp,
_("FG to BG (Hardedge)"),
_("FG to BG (Hard Edge)"),
FG_BG_HARDEDGE_KEY);
gradient->segments->left_color_type = GIMP_GRADIENT_COLOR_FOREGROUND;
gradient->segments->right_color_type = GIMP_GRADIENT_COLOR_BACKGROUND;
gradient->segments->type = GIMP_GRADIENT_SEGMENT_STEP;
/* FG to BG (HSV counter-clockwise) */
/* FG to BG (HSV Counter-Clockwise) */
gradient = gimp_gradients_add_gradient (gimp,
_("FG to BG (HSV counter-clockwise)"),
_("FG to BG (HSV Counter-Clockwise)"),
FG_BG_HSV_CCW_KEY);
gradient->segments->left_color_type = GIMP_GRADIENT_COLOR_FOREGROUND;
gradient->segments->right_color_type = GIMP_GRADIENT_COLOR_BACKGROUND;
gradient->segments->color = GIMP_GRADIENT_SEGMENT_HSV_CCW;
/* FG to BG (HSV clockwise hue) */
/* FG to BG (HSV Clockwise Hue) */
gradient = gimp_gradients_add_gradient (gimp,
_("FG to BG (HSV clockwise hue)"),
_("FG to BG (HSV Clockwise Hue)"),
FG_BG_HSV_CW_KEY);
gradient->segments->left_color_type = GIMP_GRADIENT_COLOR_FOREGROUND;
gradient->segments->right_color_type = GIMP_GRADIENT_COLOR_BACKGROUND;
@@ -109,9 +109,9 @@ gimp_gradients_init (Gimp *gimp)
gradient->segments->left_color_type = GIMP_GRADIENT_COLOR_FOREGROUND;
gradient->segments->right_color_type = GIMP_GRADIENT_COLOR_FOREGROUND_TRANSPARENT;
/* FG to Transparent (Hardedge) */
/* FG to Transparent (Hard Edge) */
gradient = gimp_gradients_add_gradient (gimp,
_("FG to Transparent (Hardedge)"),
_("FG to Transparent (Hard Edge)"),
FG_TRANSPARENT_HARDEDGE_KEY);
gradient->segments->left_color_type = GIMP_GRADIENT_COLOR_FOREGROUND;
gradient->segments->right_color_type = GIMP_GRADIENT_COLOR_FOREGROUND_TRANSPARENT;

View File

@@ -29,8 +29,10 @@
#include "gimpcontainer.h"
#include "gimpcontext.h"
#include "gimpdisplay.h"
#include "gimpdrawable.h"
#include "gimpimage.h"
#include "gimpprogress.h"
#include "gimpresource.h"
#include "gimpwaitable.h"
#include "about.h"
@@ -321,17 +323,17 @@ gimp_get_empty_display (Gimp *gimp)
return NULL;
}
guint32
GBytes *
gimp_get_display_window_id (Gimp *gimp,
GimpDisplay *display)
{
g_return_val_if_fail (GIMP_IS_GIMP (gimp), -1);
g_return_val_if_fail (GIMP_IS_DISPLAY (display), -1);
g_return_val_if_fail (GIMP_IS_GIMP (gimp), NULL);
g_return_val_if_fail (GIMP_IS_DISPLAY (display), NULL);
if (gimp->gui.display_get_window_id)
return gimp->gui.display_get_window_id (display);
return -1;
return NULL;
}
GimpDisplay *
@@ -403,10 +405,11 @@ gboolean
gimp_pdb_dialog_new (Gimp *gimp,
GimpContext *context,
GimpProgress *progress,
GimpContainer *container,
GType contents_type,
GBytes *parent_handle,
const gchar *title,
const gchar *callback_name,
const gchar *object_name,
GimpObject *object,
...)
{
gboolean retval = FALSE;
@@ -414,7 +417,10 @@ gimp_pdb_dialog_new (Gimp *gimp,
g_return_val_if_fail (GIMP_IS_GIMP (gimp), FALSE);
g_return_val_if_fail (GIMP_IS_CONTEXT (context), FALSE);
g_return_val_if_fail (progress == NULL || GIMP_IS_PROGRESS (progress), FALSE);
g_return_val_if_fail (GIMP_IS_CONTAINER (container), FALSE);
g_return_val_if_fail (g_type_is_a (contents_type, GIMP_TYPE_RESOURCE) ||
g_type_is_a (contents_type, GIMP_TYPE_DRAWABLE), FALSE);
g_return_val_if_fail (object == NULL ||
g_type_is_a (G_TYPE_FROM_INSTANCE (object), contents_type), FALSE);
g_return_val_if_fail (title != NULL, FALSE);
g_return_val_if_fail (callback_name != NULL, FALSE);
@@ -422,12 +428,11 @@ gimp_pdb_dialog_new (Gimp *gimp,
{
va_list args;
va_start (args, object_name);
va_start (args, object);
retval = gimp->gui.pdb_dialog_new (gimp, context, progress,
container, title,
callback_name, object_name,
args);
contents_type, parent_handle, title,
callback_name, object, args);
va_end (args);
}
@@ -436,27 +441,28 @@ gimp_pdb_dialog_new (Gimp *gimp,
}
gboolean
gimp_pdb_dialog_set (Gimp *gimp,
GimpContainer *container,
const gchar *callback_name,
const gchar *object_name,
gimp_pdb_dialog_set (Gimp *gimp,
GType contents_type,
const gchar *callback_name,
GimpObject *object,
...)
{
gboolean retval = FALSE;
g_return_val_if_fail (GIMP_IS_GIMP (gimp), FALSE);
g_return_val_if_fail (GIMP_IS_CONTAINER (container), FALSE);
g_return_val_if_fail (g_type_is_a (contents_type, GIMP_TYPE_RESOURCE) ||
contents_type == GIMP_TYPE_DRAWABLE, FALSE);
g_return_val_if_fail (callback_name != NULL, FALSE);
g_return_val_if_fail (object_name != NULL, FALSE);
g_return_val_if_fail (object == NULL || g_type_is_a (G_TYPE_FROM_INSTANCE (object), contents_type), FALSE);
if (gimp->gui.pdb_dialog_set)
{
va_list args;
va_start (args, object_name);
va_start (args, object);
retval = gimp->gui.pdb_dialog_set (gimp, container, callback_name,
object_name, args);
retval = gimp->gui.pdb_dialog_set (gimp, contents_type, callback_name,
object, args);
va_end (args);
}
@@ -466,15 +472,16 @@ gimp_pdb_dialog_set (Gimp *gimp,
gboolean
gimp_pdb_dialog_close (Gimp *gimp,
GimpContainer *container,
GType contents_type,
const gchar *callback_name)
{
g_return_val_if_fail (GIMP_IS_GIMP (gimp), FALSE);
g_return_val_if_fail (GIMP_IS_CONTAINER (container), FALSE);
g_return_val_if_fail (g_type_is_a (contents_type, GIMP_TYPE_RESOURCE) ||
contents_type == GIMP_TYPE_DRAWABLE, FALSE);
g_return_val_if_fail (callback_name != NULL, FALSE);
if (gimp->gui.pdb_dialog_close)
return gimp->gui.pdb_dialog_close (gimp, container, callback_name);
return gimp->gui.pdb_dialog_close (gimp, contents_type, callback_name);
return FALSE;
}

View File

@@ -54,7 +54,7 @@ struct _GimpGui
GimpObject * (* get_window_strategy) (Gimp *gimp);
GimpDisplay * (* get_empty_display) (Gimp *gimp);
guint32 (* display_get_window_id) (GimpDisplay *display);
GBytes * (* display_get_window_id) (GimpDisplay *display);
GimpDisplay * (* display_create) (Gimp *gimp,
GimpImage *image,
GimpUnit unit,
@@ -73,18 +73,19 @@ struct _GimpGui
gboolean (* pdb_dialog_new) (Gimp *gimp,
GimpContext *context,
GimpProgress *progress,
GimpContainer *container,
GType contents_type,
GBytes *parent_handle,
const gchar *title,
const gchar *callback_name,
const gchar *object_name,
GimpObject *object,
va_list args);
gboolean (* pdb_dialog_set) (Gimp *gimp,
GimpContainer *container,
GType contents_type,
const gchar *callback_name,
const gchar *object_name,
GimpObject *object,
va_list args);
gboolean (* pdb_dialog_close) (Gimp *gimp,
GimpContainer *container,
GType contents_type,
const gchar *callback_name);
gboolean (* recent_list_add_file) (Gimp *gimp,
GFile *file,
@@ -122,7 +123,7 @@ GimpDisplay * gimp_get_display_by_id (Gimp *gimp,
gint ID);
gint gimp_get_display_id (Gimp *gimp,
GimpDisplay *display);
guint32 gimp_get_display_window_id (Gimp *gimp,
GBytes * gimp_get_display_window_id (Gimp *gimp,
GimpDisplay *display);
GimpDisplay * gimp_create_display (Gimp *gimp,
GimpImage *image,
@@ -171,19 +172,21 @@ GFile * gimp_get_icon_theme_dir (Gimp *gimp);
gboolean gimp_pdb_dialog_new (Gimp *gimp,
GimpContext *context,
GimpProgress *progress,
GimpContainer *container,
GType contents_type,
GBytes *parent_handle,
const gchar *title,
const gchar *callback_name,
const gchar *object_name,
GimpObject *object,
...) G_GNUC_NULL_TERMINATED;
gboolean gimp_pdb_dialog_set (Gimp *gimp,
GimpContainer *container,
GType contents_type,
const gchar *callback_name,
const gchar *object_name,
GimpObject *object,
...) G_GNUC_NULL_TERMINATED;
gboolean gimp_pdb_dialog_close (Gimp *gimp,
GimpContainer *container,
GType contents_type,
const gchar *callback_name);
gboolean gimp_recent_list_add_file (Gimp *gimp,
GFile *file,
const gchar *mime_type);

View File

@@ -277,6 +277,9 @@ gimp_g_value_get_memsize (GValue *value)
memsize += gimp_g_object_get_memsize (g_value_get_object (value));
else if (strcmp ("GimpFont", G_VALUE_TYPE_NAME (value)) == 0)
memsize += gimp_g_object_get_memsize (g_value_get_object (value));
else if (strcmp ("GeglColor", G_VALUE_TYPE_NAME (value)) == 0)
/* Internal knowledge of contents of private data. */
memsize += sizeof (GeglColor) + sizeof (const Babl *) + 48;
else
g_printerr ("%s: unhandled object value type: %s\n",
G_STRFUNC, G_VALUE_TYPE_NAME (value));

View File

@@ -111,8 +111,8 @@ gimp_palettes_get_color_history (Gimp *gimp)
}
void
gimp_palettes_add_color_history (Gimp *gimp,
const GimpRGB *color)
gimp_palettes_add_color_history (Gimp *gimp,
GeglColor *color)
{
GimpPalette *history;

View File

@@ -22,14 +22,14 @@
#define __GIMP_PALETTES__
void gimp_palettes_init (Gimp *gimp);
void gimp_palettes_init (Gimp *gimp);
void gimp_palettes_load (Gimp *gimp);
void gimp_palettes_save (Gimp *gimp);
void gimp_palettes_load (Gimp *gimp);
void gimp_palettes_save (Gimp *gimp);
GimpPalette * gimp_palettes_get_color_history (Gimp *gimp);
void gimp_palettes_add_color_history (Gimp *gimp,
const GimpRGB *color);
GimpPalette * gimp_palettes_get_color_history (Gimp *gimp);
void gimp_palettes_add_color_history (Gimp *gimp,
GeglColor *color);
#endif /* __GIMP_PALETTES__ */

View File

@@ -139,13 +139,13 @@ gimp_transform_matrix_rotate (GimpMatrix3 *matrix,
switch (rotate_type)
{
case GIMP_ROTATE_90:
case GIMP_ROTATE_DEGREES90:
angle = G_PI_2;
break;
case GIMP_ROTATE_180:
case GIMP_ROTATE_DEGREES180:
angle = G_PI;
break;
case GIMP_ROTATE_270:
case GIMP_ROTATE_DEGREES270:
angle = - G_PI_2;
break;
}

View File

@@ -553,6 +553,9 @@ user_update_menurc_over20 (const GMatchInfo *matched_value,
else if (g_strcmp0 (action_match, "view-rotate-reset") == 0 &&
install->old_major == 2)
new_action_name = g_strdup ("view-reset");
/* select-float became select-cut-float in 3.0 (select-copy-float added). */
else if (g_strcmp0 (action_match, "select-float") == 0)
new_action_name = g_strdup ("select-cut-float");
if (new_action_name == NULL)
new_action_name = g_strdup (action_match);

View File

@@ -33,9 +33,7 @@
#include <glib.h>
#ifdef G_OS_WIN32
#define _WIN32_WINNT 0x0500
#include <windows.h>
#include <process.h>
#endif
#include <cairo.h>
@@ -529,7 +527,7 @@ gimp_enum_get_value_name (GType enum_type,
gboolean
gimp_get_fill_params (GimpContext *context,
GimpFillType fill_type,
GimpRGB *color,
GeglColor **color,
GimpPattern **pattern,
GError **error)
@@ -539,47 +537,34 @@ gimp_get_fill_params (GimpContext *context,
g_return_val_if_fail (pattern != NULL, FALSE);
g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
*color = NULL;
*pattern = NULL;
switch (fill_type)
{
case GIMP_FILL_FOREGROUND:
gimp_context_get_foreground (context, color);
*color = gegl_color_duplicate (gimp_context_get_foreground (context));
break;
case GIMP_FILL_BACKGROUND:
gimp_context_get_background (context, color);
*color = gegl_color_duplicate (gimp_context_get_background (context));
break;
case GIMP_FILL_CIELAB_MIDDLE_GRAY:
{
const float cielab_pixel[3] = {50, 0, 0};
float pixel[3] = {0, 0, 0};
GimpImage *image = gimp_context_get_image (context);
GimpImageBaseType base_type;
const Babl *format;
const float cielab_pixel[3] = {50.f, 0.f, 0.f};
base_type = gimp_image_get_base_type (image);
if (base_type == GIMP_INDEXED)
base_type = GIMP_RGB;
format = gimp_image_get_format (image, base_type,
GIMP_PRECISION_FLOAT_NON_LINEAR, FALSE,
gimp_image_get_layer_space (image));
babl_process (babl_fish (babl_format ("CIE Lab float"), format),
cielab_pixel, pixel, 1);
gimp_rgba_set (color, pixel[0], pixel[1], pixel[2], GIMP_OPACITY_OPAQUE);
*color = gegl_color_new (NULL);
gegl_color_set_pixel (*color, babl_format ("CIE Lab float"), cielab_pixel);
}
break;
case GIMP_FILL_WHITE:
gimp_rgba_set (color, 1.0, 1.0, 1.0, GIMP_OPACITY_OPAQUE);
*color = gegl_color_new ("white");
break;
case GIMP_FILL_TRANSPARENT:
gimp_rgba_set (color, 0.0, 0.0, 0.0, GIMP_OPACITY_TRANSPARENT);
*color = gegl_color_new ("transparent");
break;
case GIMP_FILL_PATTERN:
@@ -591,9 +576,9 @@ gimp_get_fill_params (GimpContext *context,
_("No patterns available for this operation."));
/* fall back to BG fill */
gimp_context_get_background (context, color);
*color = gegl_color_duplicate (gimp_context_get_background (context));
return FALSE;
return TRUE;
}
break;
@@ -730,7 +715,7 @@ gimp_file_is_executable (GFile *file)
if (info)
{
GFileType file_type = g_file_info_get_file_type (info);
GFileType file_type = g_file_info_get_attribute_uint32 (info, G_FILE_ATTRIBUTE_STANDARD_TYPE);
const gchar *filename = g_file_info_get_name (info);
if (file_type == G_FILE_TYPE_REGULAR &&

View File

@@ -63,7 +63,7 @@ const gchar* gimp_enum_get_value_name (GType enum_type,
gboolean gimp_get_fill_params (GimpContext *context,
GimpFillType fill_type,
GimpRGB *color,
GeglColor **color,
GimpPattern **pattern,
GError **error);

View File

@@ -282,7 +282,8 @@ gimp_brush_get_new_preview (GimpViewable *viewable,
guchar *mask;
guchar *buf;
gint x, y;
gboolean scaled = FALSE;
gboolean free_mask = FALSE;
gdouble scale = 1.0;
mask_width = gimp_temp_buf_get_width (mask_buf);
mask_height = gimp_temp_buf_get_height (mask_buf);
@@ -291,45 +292,47 @@ gimp_brush_get_new_preview (GimpViewable *viewable,
{
gdouble ratio_x = (gdouble) width / (gdouble) mask_width;
gdouble ratio_y = (gdouble) height / (gdouble) mask_height;
gdouble scale = MIN (ratio_x, ratio_y);
if (scale != 1.0)
scale = MIN (ratio_x, ratio_y);
}
if (GIMP_IS_BRUSH_GENERATED (brush) || scale != 1.0)
{
gimp_brush_begin_use (brush);
if (GIMP_IS_BRUSH_GENERATED (brush))
{
gimp_brush_begin_use (brush);
GimpBrushGenerated *gen_brush = GIMP_BRUSH_GENERATED (brush);
if (GIMP_IS_BRUSH_GENERATED (brush))
{
GimpBrushGenerated *gen_brush = GIMP_BRUSH_GENERATED (brush);
mask_buf = gimp_brush_transform_mask (brush, scale,
(gimp_brush_generated_get_aspect_ratio (gen_brush) - 1.0) * 20.0 / 19.0,
gimp_brush_generated_get_angle (gen_brush) / -360.0,
FALSE,
gimp_brush_generated_get_hardness (gen_brush));
}
else
{
mask_buf = gimp_brush_transform_mask (brush, scale, 0.0, 0.0, FALSE, 1.0);
}
mask_buf = gimp_brush_transform_mask (brush, scale,
(gimp_brush_generated_get_aspect_ratio (gen_brush) - 1.0) * 20.0 / 19.0,
gimp_brush_generated_get_angle (gen_brush) / 360.0,
FALSE,
gimp_brush_generated_get_hardness (gen_brush));
}
else
mask_buf = gimp_brush_transform_mask (brush, scale,
if (! mask_buf)
{
mask_buf = gimp_temp_buf_new (1, 1, babl_format ("Y u8"));
gimp_temp_buf_data_clear ((GimpTempBuf *) mask_buf);
}
else
{
gimp_temp_buf_ref ((GimpTempBuf *) mask_buf);
}
if (pixmap_buf)
pixmap_buf = gimp_brush_transform_pixmap (brush, scale,
0.0, 0.0, FALSE, 1.0);
if (! mask_buf)
{
mask_buf = gimp_temp_buf_new (1, 1, babl_format ("Y u8"));
gimp_temp_buf_data_clear ((GimpTempBuf *) mask_buf);
}
else
{
gimp_temp_buf_ref ((GimpTempBuf *) mask_buf);
}
mask_width = gimp_temp_buf_get_width (mask_buf);
mask_height = gimp_temp_buf_get_height (mask_buf);
if (pixmap_buf)
pixmap_buf = gimp_brush_transform_pixmap (brush, scale,
0.0, 0.0, FALSE, 1.0);
mask_width = gimp_temp_buf_get_width (mask_buf);
mask_height = gimp_temp_buf_get_height (mask_buf);
scaled = TRUE;
}
free_mask = TRUE;
}
return_buf = gimp_temp_buf_new (mask_width, mask_height,
@@ -377,7 +380,7 @@ gimp_brush_get_new_preview (GimpViewable *viewable,
gimp_temp_buf_unlock (mask_buf, mask_data);
if (scaled)
if (free_mask)
{
gimp_temp_buf_unref ((GimpTempBuf *) mask_buf);

View File

@@ -542,7 +542,7 @@ void
gimp_channel_select_by_color (GimpChannel *channel,
GList *drawables,
gboolean sample_merged,
const GimpRGB *color,
GeglColor *color,
gfloat threshold,
gboolean select_transparent,
GimpSelectCriterion select_criterion,

View File

@@ -139,7 +139,7 @@ void gimp_channel_select_fuzzy (GimpChannel *channel,
void gimp_channel_select_by_color (GimpChannel *channel,
GList *drawables,
gboolean sample_merged,
const GimpRGB *color,
GeglColor *color,
gfloat threshold,
gboolean select_transparent,
GimpSelectCriterion select_criterion,

View File

@@ -304,7 +304,7 @@ gimp_channel_class_init (GimpChannelClass *klass)
static void
gimp_channel_init (GimpChannel *channel)
{
gimp_rgba_set (&channel->color, 0.0, 0.0, 0.0, GIMP_OPACITY_OPAQUE);
channel->color = gegl_color_new ("black");
channel->show_masked = FALSE;
@@ -335,6 +335,7 @@ gimp_channel_finalize (GObject *object)
g_clear_pointer (&channel->segs_in, g_free);
g_clear_pointer (&channel->segs_out, g_free);
g_clear_object (&channel->color);
G_OBJECT_CLASS (parent_class)->finalize (object);
}
@@ -392,8 +393,7 @@ gimp_channel_get_node (GimpFilter *filter)
"operation", "gegl:color",
"format", color_format,
NULL);
gimp_gegl_node_set_color (channel->color_node,
&channel->color, NULL);
gimp_gegl_node_set_color (channel->color_node, channel->color);
g_warn_if_fail (channel->mask_node == NULL);
@@ -496,7 +496,8 @@ gimp_channel_duplicate (GimpItem *item,
GimpChannel *channel = GIMP_CHANNEL (item);
GimpChannel *new_channel = GIMP_CHANNEL (new_item);
new_channel->color = channel->color;
g_clear_object (&new_channel->color);
new_channel->color = gegl_color_duplicate (channel->color);
new_channel->show_masked = channel->show_masked;
/* selection mask variables */
@@ -566,7 +567,7 @@ gimp_channel_convert (GimpItem *item,
{
GeglBuffer *new_buffer;
const Babl *format;
GimpRGB background;
GeglColor *background = gegl_color_new ("transparent");
format = gimp_drawable_get_format_without_alpha (drawable);
@@ -576,11 +577,9 @@ gimp_channel_convert (GimpItem *item,
gimp_item_get_height (item)),
format);
gimp_rgba_set (&background, 0.0, 0.0, 0.0, 0.0);
gimp_gegl_apply_flatten (gimp_drawable_get_buffer (drawable),
NULL, NULL,
new_buffer, &background, NULL,
new_buffer, background,
GIMP_LAYER_COLOR_SPACE_RGB_LINEAR);
gimp_drawable_set_buffer_full (drawable, FALSE, NULL,
@@ -591,6 +590,7 @@ gimp_channel_convert (GimpItem *item,
0, 0),
TRUE);
g_object_unref (new_buffer);
g_object_unref (background);
}
if (G_TYPE_FROM_INSTANCE (channel) == GIMP_TYPE_CHANNEL)
@@ -743,7 +743,7 @@ gimp_channel_resize (GimpItem *item,
gint offset_x,
gint offset_y)
{
GIMP_ITEM_CLASS (parent_class)->resize (item, context, GIMP_FILL_TRANSPARENT,
GIMP_ITEM_CLASS (parent_class)->resize (item, context, fill_type,
new_width, new_height,
offset_x, offset_y);
@@ -1513,11 +1513,11 @@ gimp_channel_buffer_changed (GeglBuffer *buffer,
/* public functions */
GimpChannel *
gimp_channel_new (GimpImage *image,
gint width,
gint height,
const gchar *name,
const GimpRGB *color)
gimp_channel_new (GimpImage *image,
gint width,
gint height,
const gchar *name,
GeglColor *color)
{
GimpChannel *channel;
@@ -1530,7 +1530,10 @@ gimp_channel_new (GimpImage *image,
gimp_image_get_channel_format (image)));
if (color)
channel->color = *color;
{
g_clear_object (&channel->color);
channel->color = gegl_color_duplicate (color);
}
channel->show_masked = TRUE;
@@ -1542,10 +1545,10 @@ gimp_channel_new (GimpImage *image,
}
GimpChannel *
gimp_channel_new_from_buffer (GimpImage *image,
GeglBuffer *buffer,
const gchar *name,
const GimpRGB *color)
gimp_channel_new_from_buffer (GimpImage *image,
GeglBuffer *buffer,
const gchar *name,
GeglColor *color)
{
GimpChannel *channel;
GeglBuffer *dest;
@@ -1565,10 +1568,10 @@ gimp_channel_new_from_buffer (GimpImage *image,
}
GimpChannel *
gimp_channel_new_from_alpha (GimpImage *image,
GimpDrawable *drawable,
const gchar *name,
const GimpRGB *color)
gimp_channel_new_from_alpha (GimpImage *image,
GimpDrawable *drawable,
const gchar *name,
GeglColor *color)
{
GimpChannel *channel;
GeglBuffer *dest_buffer;
@@ -1603,7 +1606,7 @@ GimpChannel *
gimp_channel_new_from_component (GimpImage *image,
GimpChannelType type,
const gchar *name,
const GimpRGB *color)
GeglColor *color)
{
GimpChannel *channel;
GeglBuffer *src_buffer;
@@ -1644,14 +1647,14 @@ gimp_channel_get_parent (GimpChannel *channel)
}
void
gimp_channel_set_color (GimpChannel *channel,
const GimpRGB *color,
gboolean push_undo)
gimp_channel_set_color (GimpChannel *channel,
GeglColor *color,
gboolean push_undo)
{
g_return_if_fail (GIMP_IS_CHANNEL (channel));
g_return_if_fail (color != NULL);
g_return_if_fail (GEGL_IS_COLOR (color));
if (gimp_rgba_distance (&channel->color, color) > RGBA_EPSILON)
if (! gimp_color_is_perceptually_identical (channel->color, (GeglColor *) color))
{
if (push_undo && gimp_item_is_attached (GIMP_ITEM (channel)))
{
@@ -1661,13 +1664,11 @@ gimp_channel_set_color (GimpChannel *channel,
channel);
}
channel->color = *color;
g_clear_object (&channel->color);
channel->color = gegl_color_duplicate (color);
if (gimp_filter_peek_node (GIMP_FILTER (channel)))
{
gimp_gegl_node_set_color (channel->color_node,
&channel->color, NULL);
}
gimp_gegl_node_set_color (channel->color_node, channel->color);
gimp_drawable_update (GIMP_DRAWABLE (channel), 0, 0, -1, -1);
@@ -1675,22 +1676,24 @@ gimp_channel_set_color (GimpChannel *channel,
}
}
void
gimp_channel_get_color (GimpChannel *channel,
GimpRGB *color)
GeglColor *
gimp_channel_get_color (GimpChannel *channel)
{
g_return_if_fail (GIMP_IS_CHANNEL (channel));
g_return_if_fail (color != NULL);
g_return_val_if_fail (GIMP_IS_CHANNEL (channel), NULL);
*color = channel->color;
return channel->color;
}
gdouble
gimp_channel_get_opacity (GimpChannel *channel)
{
gdouble opacity;
g_return_val_if_fail (GIMP_IS_CHANNEL (channel), GIMP_OPACITY_TRANSPARENT);
return channel->color.a;
gegl_color_get_rgba (channel->color, NULL, NULL, NULL, &opacity);
return opacity;
}
void
@@ -1698,11 +1701,14 @@ gimp_channel_set_opacity (GimpChannel *channel,
gdouble opacity,
gboolean push_undo)
{
gdouble current_opacity;
g_return_if_fail (GIMP_IS_CHANNEL (channel));
gegl_color_get_rgba (channel->color, NULL, NULL, NULL, &current_opacity);
opacity = CLAMP (opacity, GIMP_OPACITY_TRANSPARENT, GIMP_OPACITY_OPAQUE);
if (channel->color.a != opacity)
if (current_opacity != opacity)
{
if (push_undo && gimp_item_is_attached (GIMP_ITEM (channel)))
{
@@ -1712,13 +1718,10 @@ gimp_channel_set_opacity (GimpChannel *channel,
channel);
}
channel->color.a = opacity;
gimp_color_set_alpha (channel->color, opacity);
if (gimp_filter_peek_node (GIMP_FILTER (channel)))
{
gimp_gegl_node_set_color (channel->color_node,
&channel->color, NULL);
}
gimp_gegl_node_set_color (channel->color_node, channel->color);
gimp_drawable_update (GIMP_DRAWABLE (channel), 0, 0, -1, -1);

View File

@@ -35,7 +35,7 @@ struct _GimpChannel
{
GimpDrawable parent_instance;
GimpRGB color; /* Also stores the opacity */
GeglColor *color; /* Also stores the opacity */
gboolean show_masked; /* Show masked areas--as */
/* opposed to selected areas */
@@ -127,19 +127,19 @@ GimpChannel * gimp_channel_new (GimpImage *image,
gint width,
gint height,
const gchar *name,
const GimpRGB *color);
GeglColor *color);
GimpChannel * gimp_channel_new_from_buffer (GimpImage *image,
GeglBuffer *buffer,
const gchar *name,
const GimpRGB *color);
GeglColor *color);
GimpChannel * gimp_channel_new_from_alpha (GimpImage *image,
GimpDrawable *drawable,
const gchar *name,
const GimpRGB *color);
GeglColor *color);
GimpChannel * gimp_channel_new_from_component (GimpImage *image,
GimpChannelType type,
const gchar *name,
const GimpRGB *color);
GeglColor *color);
GimpChannel * gimp_channel_get_parent (GimpChannel *channel);
@@ -148,10 +148,9 @@ void gimp_channel_set_opacity (GimpChannel *channel,
gdouble opacity,
gboolean push_undo);
void gimp_channel_get_color (GimpChannel *channel,
GimpRGB *color);
GeglColor * gimp_channel_get_color (GimpChannel *channel);
void gimp_channel_set_color (GimpChannel *channel,
const GimpRGB *color,
GeglColor *color,
gboolean push_undo);
gboolean gimp_channel_get_show_masked (GimpChannel *channel);

View File

@@ -30,6 +30,7 @@
static void gimp_channel_prop_undo_constructed (GObject *object);
static void gimp_channel_prop_undo_finalize (GObject *object);
static void gimp_channel_prop_undo_pop (GimpUndo *undo,
GimpUndoMode undo_mode,
@@ -48,6 +49,7 @@ gimp_channel_prop_undo_class_init (GimpChannelPropUndoClass *klass)
GimpUndoClass *undo_class = GIMP_UNDO_CLASS (klass);
object_class->constructed = gimp_channel_prop_undo_constructed;
object_class->finalize = gimp_channel_prop_undo_finalize;
undo_class->pop = gimp_channel_prop_undo_pop;
}
@@ -72,7 +74,7 @@ gimp_channel_prop_undo_constructed (GObject *object)
switch (GIMP_UNDO (object)->undo_type)
{
case GIMP_UNDO_CHANNEL_COLOR:
gimp_channel_get_color (channel, &channel_prop_undo->color);
channel_prop_undo->color = gegl_color_duplicate (gimp_channel_get_color (channel));
break;
default:
@@ -80,6 +82,16 @@ gimp_channel_prop_undo_constructed (GObject *object)
}
}
static void
gimp_channel_prop_undo_finalize (GObject *object)
{
GimpChannelPropUndo *channel_prop_undo = GIMP_CHANNEL_PROP_UNDO (object);
g_clear_object (&channel_prop_undo->color);
G_OBJECT_CLASS (parent_class)->finalize (object);
}
static void
gimp_channel_prop_undo_pop (GimpUndo *undo,
GimpUndoMode undo_mode,
@@ -94,10 +106,11 @@ gimp_channel_prop_undo_pop (GimpUndo *undo,
{
case GIMP_UNDO_CHANNEL_COLOR:
{
GimpRGB color;
GeglColor *color;
gimp_channel_get_color (channel, &color);
gimp_channel_set_color (channel, &channel_prop_undo->color, FALSE);
color = gegl_color_duplicate (gimp_channel_get_color (channel));
gimp_channel_set_color (channel, channel_prop_undo->color, FALSE);
g_clear_object (&channel_prop_undo->color);
channel_prop_undo->color = color;
}
break;

View File

@@ -37,7 +37,7 @@ struct _GimpChannelPropUndo
{
GimpItemUndo parent_instance;
GimpRGB color;
GeglColor *color;
};
struct _GimpChannelPropUndoClass

View File

@@ -198,6 +198,7 @@ gimp_container_class_init (GimpContainerClass *klass)
klass->search = NULL;
klass->get_unique_names = NULL;
klass->get_child_by_name = NULL;
klass->get_children_by_name = NULL;
klass->get_child_by_index = NULL;
klass->get_child_index = NULL;
@@ -881,6 +882,34 @@ gimp_container_get_unique_names (GimpContainer *container)
return FALSE;
}
GList *
gimp_container_get_children_by_name (GimpContainer *container,
const gchar *name)
{
g_return_val_if_fail (GIMP_IS_CONTAINER (container), NULL);
if (!name)
return NULL;
if (GIMP_CONTAINER_GET_CLASS (container)->get_children_by_name != NULL &&
! gimp_container_get_unique_names (container))
{
return GIMP_CONTAINER_GET_CLASS (container)->get_children_by_name (container,
name);
}
else
{
GimpObject *child;
child = GIMP_CONTAINER_GET_CLASS (container)->get_child_by_name (container, name);
if (child != NULL)
return g_list_prepend (NULL, child);
else
return NULL;
}
}
GimpObject *
gimp_container_get_child_by_name (GimpContainer *container,
const gchar *name)

View File

@@ -75,6 +75,8 @@ struct _GimpContainerClass
gboolean (* get_unique_names) (GimpContainer *container);
GimpObject * (* get_child_by_name) (GimpContainer *container,
const gchar *name);
GList * (* get_children_by_name) (GimpContainer *container,
const gchar *name);
GimpObject * (* get_child_by_index) (GimpContainer *container,
gint index);
gint (* get_child_index) (GimpContainer *container,
@@ -117,6 +119,8 @@ GimpObject * gimp_container_search (GimpContainer *contain
gboolean gimp_container_get_unique_names (GimpContainer *container);
GList * gimp_container_get_children_by_name (GimpContainer *container,
const gchar *name);
GimpObject * gimp_container_get_child_by_name (GimpContainer *container,
const gchar *name);
GimpObject * gimp_container_get_child_by_index (GimpContainer *container,

View File

@@ -32,6 +32,8 @@
#include "config/gimpcoreconfig.h"
#include "gegl/gimp-babl.h"
#include "gimp.h"
#include "gimp-memsize.h"
#include "gimpbrush.h"
@@ -58,8 +60,6 @@
#include "gimp-intl.h"
#define RGBA_EPSILON 1e-10
typedef void (* GimpContextCopyPropFunc) (GimpContext *src,
GimpContext *dest);
@@ -114,6 +114,8 @@ static gboolean gimp_context_copy (GimpConfig *src,
GParamFlags flags);
/* image */
static void gimp_context_image_disconnect (GimpImage *image,
GimpContext *context);
static void gimp_context_image_removed (GimpContainer *container,
GimpImage *image,
GimpContext *context);
@@ -151,11 +153,11 @@ static void gimp_context_real_set_paint_info (GimpContext *context,
/* foreground */
static void gimp_context_real_set_foreground (GimpContext *context,
const GimpRGB *color);
GeglColor *color);
/* background */
static void gimp_context_real_set_background (GimpContext *context,
const GimpRGB *color);
GeglColor *color);
/* opacity */
static void gimp_context_real_set_opacity (GimpContext *context,
@@ -403,11 +405,8 @@ gimp_context_class_init (GimpContextClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
GimpObjectClass *gimp_object_class = GIMP_OBJECT_CLASS (klass);
GimpRGB black;
GimpRGB white;
gimp_rgba_set (&black, 0.0, 0.0, 0.0, GIMP_OPACITY_OPAQUE);
gimp_rgba_set (&white, 1.0, 1.0, 1.0, GIMP_OPACITY_OPAQUE);
GeglColor *black = gegl_color_new ("black");
GeglColor *white = gegl_color_new ("white");
gimp_context_signals[IMAGE_CHANGED] =
g_signal_new ("image-changed",
@@ -452,7 +451,7 @@ gimp_context_class_init (GimpContextClass *klass)
G_STRUCT_OFFSET (GimpContextClass, foreground_changed),
NULL, NULL, NULL,
G_TYPE_NONE, 1,
GIMP_TYPE_RGB | G_SIGNAL_TYPE_STATIC_SCOPE);
GEGL_TYPE_COLOR);
gimp_context_signals[BACKGROUND_CHANGED] =
g_signal_new ("background-changed",
@@ -461,7 +460,7 @@ gimp_context_class_init (GimpContextClass *klass)
G_STRUCT_OFFSET (GimpContextClass, background_changed),
NULL, NULL, NULL,
G_TYPE_NONE, 1,
GIMP_TYPE_RGB | G_SIGNAL_TYPE_STATIC_SCOPE);
GEGL_TYPE_COLOR);
gimp_context_signals[OPACITY_CHANGED] =
g_signal_new ("opacity-changed",
@@ -664,19 +663,19 @@ gimp_context_class_init (GimpContextClass *klass)
GIMP_TYPE_PAINT_INFO,
GIMP_PARAM_STATIC_STRINGS);
GIMP_CONFIG_PROP_RGB (object_class, GIMP_CONTEXT_PROP_FOREGROUND,
gimp_context_prop_names[GIMP_CONTEXT_PROP_FOREGROUND],
_("Foreground"),
_("Foreground color"),
FALSE, &black,
GIMP_PARAM_STATIC_STRINGS);
GIMP_CONFIG_PROP_COLOR (object_class, GIMP_CONTEXT_PROP_FOREGROUND,
gimp_context_prop_names[GIMP_CONTEXT_PROP_FOREGROUND],
_("Foreground"),
_("Foreground color"),
black,
GIMP_PARAM_STATIC_STRINGS);
GIMP_CONFIG_PROP_RGB (object_class, GIMP_CONTEXT_PROP_BACKGROUND,
gimp_context_prop_names[GIMP_CONTEXT_PROP_BACKGROUND],
_("Background"),
_("Background color"),
FALSE, &white,
GIMP_PARAM_STATIC_STRINGS);
GIMP_CONFIG_PROP_COLOR (object_class, GIMP_CONTEXT_PROP_BACKGROUND,
gimp_context_prop_names[GIMP_CONTEXT_PROP_BACKGROUND],
_("Background"),
_("Background color"),
white,
GIMP_PARAM_STATIC_STRINGS);
GIMP_CONFIG_PROP_DOUBLE (object_class, GIMP_CONTEXT_PROP_OPACITY,
gimp_context_prop_names[GIMP_CONTEXT_PROP_OPACITY],
@@ -768,6 +767,9 @@ gimp_context_class_init (GimpContextClass *klass)
NULL, NULL,
GIMP_TYPE_TEMPLATE,
GIMP_PARAM_READWRITE));
g_object_unref (black);
g_object_unref (white);
}
static void
@@ -824,6 +826,9 @@ gimp_context_init (GimpContext *context)
context->line_art = NULL;
context->line_art_timeout_id = 0;
context->foreground = gegl_color_new ("black");
context->background = gegl_color_new ("white");
}
static void
@@ -1021,6 +1026,8 @@ gimp_context_finalize (GObject *object)
g_clear_pointer (&context->template_name, g_free);
g_clear_object (&context->line_art);
g_clear_object (&context->foreground);
g_clear_object (&context->background);
G_OBJECT_CLASS (parent_class)->finalize (object);
}
@@ -1051,10 +1058,10 @@ gimp_context_set_property (GObject *object,
gimp_context_set_paint_info (context, g_value_get_object (value));
break;
case GIMP_CONTEXT_PROP_FOREGROUND:
gimp_context_set_foreground (context, g_value_get_boxed (value));
gimp_context_set_foreground (context, g_value_get_object (value));
break;
case GIMP_CONTEXT_PROP_BACKGROUND:
gimp_context_set_background (context, g_value_get_boxed (value));
gimp_context_set_background (context, g_value_get_object (value));
break;
case GIMP_CONTEXT_PROP_OPACITY:
gimp_context_set_opacity (context, g_value_get_double (value));
@@ -1127,20 +1134,10 @@ gimp_context_get_property (GObject *object,
g_value_set_object (value, gimp_context_get_paint_info (context));
break;
case GIMP_CONTEXT_PROP_FOREGROUND:
{
GimpRGB color;
gimp_context_get_foreground (context, &color);
g_value_set_boxed (value, &color);
}
g_value_take_object (value, gegl_color_duplicate (gimp_context_get_foreground (context)));
break;
case GIMP_CONTEXT_PROP_BACKGROUND:
{
GimpRGB color;
gimp_context_get_background (context, &color);
g_value_set_boxed (value, &color);
}
g_value_take_object (value, gegl_color_duplicate (gimp_context_get_background (context)));
break;
case GIMP_CONTEXT_PROP_OPACITY:
g_value_set_double (value, gimp_context_get_opacity (context));
@@ -1662,11 +1659,11 @@ gimp_context_copy_property (GimpContext *src,
break;
case GIMP_CONTEXT_PROP_FOREGROUND:
gimp_context_real_set_foreground (dest, &src->foreground);
gimp_context_real_set_foreground (dest, src->foreground);
break;
case GIMP_CONTEXT_PROP_BACKGROUND:
gimp_context_real_set_background (dest, &src->background);
gimp_context_real_set_background (dest, src->background);
break;
case GIMP_CONTEXT_PROP_OPACITY:
@@ -1918,6 +1915,107 @@ gimp_context_image_changed (GimpContext *context)
context->image);
}
/* This is a utility function to share, across the program, some common logic of
* "which format to use when you are not sure and you need to give generic color
* information" in RGBA.
* @babl_type must be a valid babl type name such as "u8", "double", "float".
* If @space_image is not NULL, it will be used to return the GimpImage
* associated to the returned format (if the returned format is indeed using the
* image's space).
*
* The logic for the format to use in RGB color actions is as follows:
* - The space we navigate through is the active image's space.
* - Increasing/decreasing follows the image TRC (in particular, if the image is
* linear or perceptual, we care about chromaticities yet don't follow the
* space TRC).
* - If there is no active image or if its space is non-sRGB, we use the context
* color's space (if set).
* - We discard non-RGB spaces and fallback to sRGB.
*/
const Babl *
gimp_context_get_rgba_format (GimpContext *context,
GeglColor *color,
const gchar *babl_type,
GimpImage **space_image)
{
GimpImage *image = NULL;
const Babl *format = NULL;
const Babl *space = NULL;
gchar *format_name;
GimpTRCType trc = GIMP_TRC_NON_LINEAR;
g_return_val_if_fail (GIMP_IS_CONTEXT (context), NULL);
g_return_val_if_fail (babl_type != NULL , NULL);
g_return_val_if_fail (space_image == NULL || *space_image == NULL, NULL);
image = gimp_context_get_image (context);
if (image)
{
format = gimp_image_get_layer_format (image, FALSE);
space = babl_format_get_space (format);
if (space_image)
*space_image = image;
}
if (color != NULL && (space == NULL || ! babl_space_is_rgb (space)))
{
format = gegl_color_get_format (color);
space = babl_format_get_space (format);
if (space_image)
*space_image = NULL;
}
if (! babl_space_is_rgb (space))
{
format = NULL;
space = NULL;
if (space_image)
*space_image = NULL;
}
if (format != NULL)
{
if (image != NULL)
{
GimpPrecision precision;
precision = gimp_image_get_precision (image);
trc = gimp_babl_trc (precision);
}
else
{
trc = gimp_babl_format_get_trc (format);
}
}
switch (trc)
{
case GIMP_TRC_LINEAR:
format_name = g_strdup_printf ("RGBA %s", babl_type);
break;
case GIMP_TRC_NON_LINEAR:
format_name = g_strdup_printf ("R'G'B'A %s", babl_type);
break;
case GIMP_TRC_PERCEPTUAL:
format_name = g_strdup_printf ("R~G~B~A %s", babl_type);
break;
default:
g_return_val_if_reached (NULL);
}
format = babl_format_with_space (format_name, space);
g_free (format_name);
return format;
}
static void
gimp_context_image_disconnect (GimpImage *image,
GimpContext *context)
{
if (image == context->image)
gimp_context_real_set_image (context, NULL);
}
static void
gimp_context_image_removed (GimpContainer *container,
GimpImage *image,
@@ -1934,8 +2032,18 @@ gimp_context_real_set_image (GimpContext *context,
if (context->image == image)
return;
if (context->image)
g_signal_handlers_disconnect_by_func (context->image,
G_CALLBACK (gimp_context_image_disconnect),
context);
context->image = image;
if (image)
g_signal_connect_object (image, "disconnect",
G_CALLBACK (gimp_context_image_disconnect),
context, 0);
g_object_notify (G_OBJECT (context), "image");
gimp_context_image_changed (context);
}
@@ -2268,22 +2376,20 @@ gimp_context_real_set_paint_info (GimpContext *context,
/*****************************************************************************/
/* foreground color ********************************************************/
void
gimp_context_get_foreground (GimpContext *context,
GimpRGB *color)
GeglColor *
gimp_context_get_foreground (GimpContext *context)
{
g_return_if_fail (GIMP_IS_CONTEXT (context));
g_return_if_fail (color != NULL);
g_return_val_if_fail (GIMP_IS_CONTEXT (context), NULL);
*color = context->foreground;
return context->foreground;
}
void
gimp_context_set_foreground (GimpContext *context,
const GimpRGB *color)
gimp_context_set_foreground (GimpContext *context,
GeglColor *color)
{
g_return_if_fail (GIMP_IS_CONTEXT (context));
g_return_if_fail (color != NULL);
g_return_if_fail (GEGL_IS_COLOR (color));
context_find_defined (context, GIMP_CONTEXT_PROP_FOREGROUND);
@@ -2297,18 +2403,20 @@ gimp_context_foreground_changed (GimpContext *context)
g_signal_emit (context,
gimp_context_signals[FOREGROUND_CHANGED], 0,
&context->foreground);
context->foreground);
}
static void
gimp_context_real_set_foreground (GimpContext *context,
const GimpRGB *color)
gimp_context_real_set_foreground (GimpContext *context,
GeglColor *color)
{
if (gimp_rgba_distance (&context->foreground, color) < RGBA_EPSILON)
if (context->foreground != NULL &&
gimp_color_is_perceptually_identical (context->foreground, color))
return;
context->foreground = *color;
gimp_rgb_set_alpha (&context->foreground, GIMP_OPACITY_OPAQUE);
g_clear_object (&context->foreground);
context->foreground = gegl_color_duplicate (color);
gimp_color_set_alpha (context->foreground, GIMP_OPACITY_OPAQUE);
g_object_notify (G_OBJECT (context), "foreground");
gimp_context_foreground_changed (context);
@@ -2318,23 +2426,20 @@ gimp_context_real_set_foreground (GimpContext *context,
/*****************************************************************************/
/* background color ********************************************************/
void
gimp_context_get_background (GimpContext *context,
GimpRGB *color)
GeglColor *
gimp_context_get_background (GimpContext *context)
{
g_return_if_fail (GIMP_IS_CONTEXT (context));
g_return_val_if_fail (GIMP_IS_CONTEXT (context), NULL);
g_return_if_fail (color != NULL);
*color = context->background;
return context->background;
}
void
gimp_context_set_background (GimpContext *context,
const GimpRGB *color)
gimp_context_set_background (GimpContext *context,
GeglColor *color)
{
g_return_if_fail (GIMP_IS_CONTEXT (context));
g_return_if_fail (color != NULL);
g_return_if_fail (GEGL_IS_COLOR (color));
context_find_defined (context, GIMP_CONTEXT_PROP_BACKGROUND);
@@ -2348,18 +2453,20 @@ gimp_context_background_changed (GimpContext *context)
g_signal_emit (context,
gimp_context_signals[BACKGROUND_CHANGED], 0,
&context->background);
context->background);
}
static void
gimp_context_real_set_background (GimpContext *context,
const GimpRGB *color)
gimp_context_real_set_background (GimpContext *context,
GeglColor *color)
{
if (gimp_rgba_distance (&context->background, color) < RGBA_EPSILON)
if (context->background != NULL &&
gimp_color_is_perceptually_identical (context->background, color))
return;
context->background = *color;
gimp_rgb_set_alpha (&context->background, GIMP_OPACITY_OPAQUE);
g_clear_object (&context->background);
context->background = gegl_color_duplicate (color);
gimp_color_set_alpha (context->background, GIMP_OPACITY_OPAQUE);
g_object_notify (G_OBJECT (context), "background");
gimp_context_background_changed (context);
@@ -2373,8 +2480,8 @@ void
gimp_context_set_default_colors (GimpContext *context)
{
GimpContext *bg_context;
GimpRGB fg;
GimpRGB bg;
GeglColor *fg;
GeglColor *bg;
g_return_if_fail (GIMP_IS_CONTEXT (context));
@@ -2383,19 +2490,22 @@ gimp_context_set_default_colors (GimpContext *context)
context_find_defined (context, GIMP_CONTEXT_PROP_FOREGROUND);
context_find_defined (bg_context, GIMP_CONTEXT_PROP_BACKGROUND);
gimp_rgba_set (&fg, 0.0, 0.0, 0.0, GIMP_OPACITY_OPAQUE);
gimp_rgba_set (&bg, 1.0, 1.0, 1.0, GIMP_OPACITY_OPAQUE);
fg = gegl_color_new ("black");
bg = gegl_color_new ("white");
gimp_context_real_set_foreground (context, &fg);
gimp_context_real_set_background (bg_context, &bg);
gimp_context_real_set_foreground (context, fg);
gimp_context_real_set_background (bg_context, bg);
g_object_unref (fg);
g_object_unref (bg);
}
void
gimp_context_swap_colors (GimpContext *context)
{
GimpContext *bg_context;
GimpRGB fg;
GimpRGB bg;
GeglColor *fg;
GeglColor *bg;
g_return_if_fail (GIMP_IS_CONTEXT (context));
@@ -2404,11 +2514,14 @@ gimp_context_swap_colors (GimpContext *context)
context_find_defined (context, GIMP_CONTEXT_PROP_FOREGROUND);
context_find_defined (bg_context, GIMP_CONTEXT_PROP_BACKGROUND);
gimp_context_get_foreground (context, &fg);
gimp_context_get_background (bg_context, &bg);
fg = g_object_ref (context->foreground);
bg = g_object_ref (context->background);
gimp_context_real_set_foreground (context, &bg);
gimp_context_real_set_background (bg_context, &fg);
gimp_context_real_set_foreground (context, bg);
gimp_context_real_set_background (bg_context, fg);
g_object_unref (fg);
g_object_unref (bg);
}

View File

@@ -64,8 +64,8 @@ struct _GimpContext
GimpPaintInfo *paint_info;
gchar *paint_name;
GimpRGB foreground;
GimpRGB background;
GeglColor *foreground;
GeglColor *background;
gdouble opacity;
GimpLayerMode paint_mode;
@@ -122,9 +122,9 @@ struct _GimpContextClass
GimpPaintInfo *paint_info);
void (* foreground_changed) (GimpContext *context,
GimpRGB *color);
GeglColor *color);
void (* background_changed) (GimpContext *context,
GimpRGB *color);
GeglColor *color);
void (* opacity_changed) (GimpContext *context,
gdouble opacity);
void (* paint_mode_changed) (GimpContext *context,
@@ -224,6 +224,12 @@ void gimp_context_set_image (GimpContext *context,
void gimp_context_image_changed (GimpContext *context);
const Babl * gimp_context_get_rgba_format (GimpContext *context,
GeglColor *color,
const gchar *babl_type,
GimpImage **space_image);
/* display */
GimpDisplay * gimp_context_get_display (GimpContext *context);
void gimp_context_set_display (GimpContext *context,
@@ -246,18 +252,16 @@ void gimp_context_paint_info_changed (GimpContext *context);
/* foreground color */
void gimp_context_get_foreground (GimpContext *context,
GimpRGB *color);
GeglColor * gimp_context_get_foreground (GimpContext *context);
void gimp_context_set_foreground (GimpContext *context,
const GimpRGB *color);
GeglColor *color);
void gimp_context_foreground_changed (GimpContext *context);
/* background color */
void gimp_context_get_background (GimpContext *context,
GimpRGB *color);
GeglColor * gimp_context_get_background (GimpContext *context);
void gimp_context_set_background (GimpContext *context,
const GimpRGB *color);
GeglColor *color);
void gimp_context_background_changed (GimpContext *context);

View File

@@ -30,6 +30,7 @@
#include "gimp-memsize.h"
#include "gimpdata.h"
#include "gimpidtable.h"
#include "gimpimage.h"
#include "gimptag.h"
#include "gimptagged.h"
@@ -47,6 +48,7 @@ enum
PROP_0,
PROP_ID,
PROP_FILE,
PROP_IMAGE,
PROP_WRITABLE,
PROP_DELETABLE,
PROP_MIME_TYPE
@@ -55,8 +57,10 @@ enum
struct _GimpDataPrivate
{
gint ID;
GFile *file;
gint ID;
GFile *file;
GimpImage *image;
GQuark mime_type;
guint writable : 1;
guint deletable : 1;
@@ -168,6 +172,11 @@ gimp_data_class_init (GimpDataClass *klass)
G_TYPE_FILE,
GIMP_PARAM_READWRITE));
g_object_class_install_property (object_class, PROP_IMAGE,
g_param_spec_object ("image", NULL, NULL,
GIMP_TYPE_IMAGE,
GIMP_PARAM_READWRITE));
g_object_class_install_property (object_class, PROP_WRITABLE,
g_param_spec_boolean ("writable", NULL, NULL,
FALSE,
@@ -264,6 +273,12 @@ gimp_data_set_property (GObject *object,
private->deletable);
break;
case PROP_IMAGE:
gimp_data_set_image (data,
g_value_get_object (value),
private->writable,
private->deletable);
break;
case PROP_WRITABLE:
private->writable = g_value_get_boolean (value);
break;
@@ -303,6 +318,10 @@ gimp_data_get_property (GObject *object,
g_value_set_object (value, private->file);
break;
case PROP_IMAGE:
g_value_set_object (value, private->image);
break;
case PROP_WRITABLE:
g_value_set_boolean (value, private->writable);
break;
@@ -458,7 +477,7 @@ gimp_data_get_identifier (GimpTagged *tagged)
gchar *identifier = NULL;
gchar *collection = NULL;
g_return_val_if_fail (private->internal || private->file != NULL, NULL);
g_return_val_if_fail (private->internal || private->file != NULL || private->image != NULL, NULL);
collection = gimp_data_get_collection (data);
/* The identifier is guaranteed to be unique because we use 2 directory
@@ -499,7 +518,7 @@ gimp_data_get_collection (GimpData *data)
GimpDataPrivate *private = GIMP_DATA_GET_PRIVATE (data);
gchar *collection = NULL;
g_return_val_if_fail (private->internal || private->file != NULL, NULL);
g_return_val_if_fail (private->internal || private->file != NULL || private->image != NULL, NULL);
if (private->file)
{
@@ -547,6 +566,10 @@ gimp_data_get_collection (GimpData *data)
g_free (path);
}
else if (private->image)
{
collection = g_strdup_printf ("[image-id-%d]", gimp_image_get_id (private->image));
}
else if (private->internal)
{
collection = g_strdup (private->collection);
@@ -599,7 +622,7 @@ gimp_data_save (GimpData *data,
g_return_val_if_fail (private->writable == TRUE, FALSE);
if (private->internal)
if (private->internal || private->image != NULL)
{
private->dirty = FALSE;
return TRUE;
@@ -858,6 +881,8 @@ gimp_data_set_file (GimpData *data,
if (private->internal)
return;
g_return_if_fail (private->image == NULL);
g_set_object (&private->file, file);
private->writable = FALSE;
@@ -933,6 +958,53 @@ gimp_data_get_file (GimpData *data)
return private->file;
}
/**
* gimp_data_set_image:
* @data: A #GimpData object
* @image: Image to assign to @data.
* @writable: %TRUE if we want to be able to write to this file.
* @deletable: %TRUE if we want to be able to delete this file.
*
* This function assigns an image to @data. This can only be done if no file has
* been assigned (a non-internal data can be attached either to a file or to an
* image).
**/
void
gimp_data_set_image (GimpData *data,
GimpImage *image,
gboolean writable,
gboolean deletable)
{
GimpDataPrivate *private;
g_return_if_fail (GIMP_IS_DATA (data));
g_return_if_fail (GIMP_IS_IMAGE (image));
private = GIMP_DATA_GET_PRIVATE (data);
if (private->internal)
return;
g_return_if_fail (private->file == NULL);
g_set_object (&private->image, image);
private->writable = writable ? TRUE : FALSE;
private->deletable = deletable ? TRUE : FALSE;
}
GimpImage *
gimp_data_get_image (GimpData *data)
{
GimpDataPrivate *private;
g_return_val_if_fail (GIMP_IS_DATA (data), NULL);
private = GIMP_DATA_GET_PRIVATE (data);
return private->image;
}
/**
* gimp_data_create_filename:
* @data: a #Gimpdata object.

View File

@@ -98,6 +98,11 @@ void gimp_data_set_file (GimpData *data,
gboolean writable,
gboolean deletable);
GFile * gimp_data_get_file (GimpData *data);
void gimp_data_set_image (GimpData *data,
GimpImage *image,
gboolean writable,
gboolean deletable);
GimpImage * gimp_data_get_image (GimpData *data);
void gimp_data_create_filename (GimpData *data,
GFile *dest_dir);

View File

@@ -399,6 +399,9 @@ gimp_data_factory_real_data_save (GimpDataFactory *factory)
GimpData *data = list->data;
GError *error = NULL;
if (gimp_data_get_image (data))
continue;
if (! gimp_data_get_file (data))
gimp_data_create_filename (data, writable_dir);
@@ -456,6 +459,7 @@ gimp_data_factory_real_data_duplicate (GimpDataFactory *factory,
gint copy_len;
gint number;
gchar *new_name;
GError *error = NULL;
ext = strrchr (name, '#');
copy_len = strlen (_("copy"));
@@ -475,8 +479,12 @@ gimp_data_factory_real_data_duplicate (GimpDataFactory *factory,
gimp_object_take_name (GIMP_OBJECT (new_data), new_name);
if (! gimp_data_factory_data_save_single (factory, new_data, &error))
g_critical ("%s: data saving failed: %s", G_STRFUNC, error->message);
gimp_container_add (priv->container, GIMP_OBJECT (new_data));
g_object_unref (new_data);
g_clear_error (&error);
}
return new_data;
@@ -670,8 +678,14 @@ gimp_data_factory_data_new (GimpDataFactory *factory,
if (data)
{
GError *error = NULL;
if (! gimp_data_factory_data_save_single (factory, data, &error))
g_critical ("%s: data saving failed: %s", G_STRFUNC, error->message);
gimp_container_add (priv->container, GIMP_OBJECT (data));
g_object_unref (data);
g_clear_error (&error);
return data;
}
@@ -746,7 +760,7 @@ gimp_data_factory_data_save_single (GimpDataFactory *factory,
g_return_val_if_fail (GIMP_IS_DATA (data), FALSE);
g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
if (! gimp_data_is_dirty (data))
if (! gimp_data_is_dirty (data) || gimp_data_get_image (data))
return TRUE;
if (! gimp_data_get_file (data))

View File

@@ -382,13 +382,13 @@ gimp_data_loader_factory_load_directory (GimpDataFactory *factory,
GFileType file_type;
GFile *child;
if (g_file_info_get_is_hidden (info))
if (g_file_info_get_attribute_boolean (info, G_FILE_ATTRIBUTE_STANDARD_IS_HIDDEN))
{
g_object_unref (info);
continue;
}
file_type = g_file_info_get_file_type (info);
file_type = g_file_info_get_attribute_uint32 (info, G_FILE_ATTRIBUTE_STANDARD_TYPE);
child = g_file_enumerator_get_child (enumerator, info);
if (file_type == G_FILE_TYPE_DIRECTORY)

View File

@@ -370,7 +370,7 @@ gimp_drawable_get_line_art_fill_buffer (GimpDrawable *drawable,
GeglBuffer *new_mask;
GeglBuffer *rendered_mask;
GeglBuffer *fill_buffer = NULL;
GimpRGB fill_color;
GeglColor *fill_color = NULL;
gint fill_offset_x = 0;
gint fill_offset_y = 0;
gint x, y, width, height;
@@ -418,9 +418,11 @@ gimp_drawable_get_line_art_fill_buffer (GimpDrawable *drawable,
g_return_val_if_fail (GIMP_IS_DRAWABLE (pickable), NULL);
if (gimp_fill_options_get_style (options) == GIMP_FILL_STYLE_FG_COLOR)
gimp_context_get_foreground (GIMP_CONTEXT (options), &fill_color);
fill_color = gimp_context_get_foreground (GIMP_CONTEXT (options));
else if (gimp_fill_options_get_style (options) == GIMP_FILL_STYLE_BG_COLOR)
gimp_context_get_background (GIMP_CONTEXT (options), &fill_color);
fill_color = gimp_context_get_background (GIMP_CONTEXT (options));
g_return_val_if_fail (fill_color != NULL, NULL);
fill_buffer = gimp_drawable_get_buffer (drawable);
fill_offset_x = gimp_item_get_offset_x (GIMP_ITEM (drawable)) -
@@ -430,7 +432,7 @@ gimp_drawable_get_line_art_fill_buffer (GimpDrawable *drawable,
}
new_mask = gimp_pickable_contiguous_region_by_line_art (NULL, line_art,
fill_buffer,
&fill_color,
fill_color,
fill_color_threshold,
fill_offset_x,
fill_offset_y,
@@ -468,12 +470,12 @@ gimp_drawable_get_line_art_fill_buffer (GimpDrawable *drawable,
GList *drawables;
GimpContext *context = gimp_get_user_context (image->gimp);
GError *error = NULL;
const GimpRGB white = {1.0, 1.0, 1.0, 1.0};
GeglColor *white = gegl_color_new ("white");
context = gimp_config_duplicate (GIMP_CONFIG (context));
/* As we are stroking a mask, we need to set color to white. */
gimp_context_set_foreground (GIMP_CONTEXT (context),
&white);
gimp_context_set_foreground (GIMP_CONTEXT (context), white);
g_object_unref (white);
channel = gimp_channel_new_from_buffer (image, new_mask, NULL, NULL);
stroked = gimp_channel_new_from_buffer (image, rendered_mask, NULL, NULL);

View File

@@ -224,7 +224,7 @@ gimp_drawable_edit_fill (GimpDrawable *drawable,
composite_mode);
gimp_drawable_filter_apply (filter, NULL);
gimp_drawable_filter_commit (filter, NULL, FALSE);
gimp_drawable_filter_commit (filter, FALSE, NULL, FALSE);
g_object_unref (filter);
g_object_unref (operation);

View File

@@ -55,7 +55,7 @@ gimp_drawable_fill (GimpDrawable *drawable,
GimpContext *context,
GimpFillType fill_type)
{
GimpRGB color;
GeglColor *color;
GimpPattern *pattern;
g_return_if_fail (GIMP_IS_DRAWABLE (drawable));
@@ -72,22 +72,24 @@ gimp_drawable_fill (GimpDrawable *drawable,
gimp_drawable_fill_buffer (drawable,
gimp_drawable_get_buffer (drawable),
&color, pattern, 0, 0);
color, pattern, 0, 0);
gimp_drawable_update (drawable, 0, 0, -1, -1);
g_clear_object (&color);
}
void
gimp_drawable_fill_buffer (GimpDrawable *drawable,
GeglBuffer *buffer,
const GimpRGB *color,
GeglColor *color,
GimpPattern *pattern,
gint pattern_offset_x,
gint pattern_offset_y)
{
g_return_if_fail (GIMP_IS_DRAWABLE (drawable));
g_return_if_fail (GEGL_IS_BUFFER (buffer));
g_return_if_fail (color != NULL || pattern != NULL);
g_return_if_fail (GEGL_IS_COLOR (color) || pattern != NULL);
g_return_if_fail (pattern == NULL || GIMP_IS_PATTERN (pattern));
if (pattern)
@@ -131,19 +133,16 @@ gimp_drawable_fill_buffer (GimpDrawable *drawable,
}
else
{
GimpRGB image_color;
GeglColor *gegl_color;
if (! gimp_drawable_has_alpha (drawable))
{
color = gegl_color_duplicate (color);
gimp_color_set_alpha (color, 1.0);
}
gimp_pickable_srgb_to_image_color (GIMP_PICKABLE (drawable),
color, &image_color);
gegl_buffer_set_color (buffer, NULL, color);
if (! gimp_drawable_has_alpha (drawable))
gimp_rgb_set_alpha (&image_color, 1.0);
gegl_color = gimp_gegl_color_new (&image_color,
gimp_drawable_get_space (drawable));
gegl_buffer_set_color (buffer, NULL, gegl_color);
g_object_unref (gegl_color);
g_object_unref (color);
}
}

View File

@@ -28,7 +28,7 @@ void gimp_drawable_fill (GimpDrawable *drawable,
GimpFillType fill_type);
void gimp_drawable_fill_buffer (GimpDrawable *drawable,
GeglBuffer *buffer,
const GimpRGB *color,
GeglColor *color,
GimpPattern *pattern,
gint pattern_offset_x,
gint pattern_offset_y);

View File

@@ -28,20 +28,26 @@
#include "gegl/gimpapplicator.h"
#include "gegl/gimp-gegl-apply-operation.h"
#include "gegl/gimp-gegl-loops.h"
#include "gegl/gimp-gegl-utils.h"
#include "gimp.h"
#include "gimp-utils.h"
#include "gimpchannel.h"
#include "gimpdrawable.h"
#include "gimpdrawable-filters.h"
#include "gimpdrawable-private.h"
#include "gimpdrawablefilter.h"
#include "gimpdrawablefilterundo.h"
#include "gimpfilter.h"
#include "gimpfilterstack.h"
#include "gimpimage.h"
#include "gimpimage-undo.h"
#include "core/gimpimage-undo-push.h"
#include "gimplayer.h"
#include "gimpprogress.h"
#include "gimpprojection.h"
#include "gimp-intl.h"
GimpContainer *
gimp_drawable_get_filters (GimpDrawable *drawable)
@@ -81,6 +87,8 @@ gimp_drawable_add_filter (GimpDrawable *drawable,
gimp_container_add (drawable->private->filter_stack,
GIMP_OBJECT (filter));
gimp_drawable_filters_changed (drawable);
}
void
@@ -93,17 +101,106 @@ gimp_drawable_remove_filter (GimpDrawable *drawable,
gimp_container_remove (drawable->private->filter_stack,
GIMP_OBJECT (filter));
gimp_drawable_filters_changed (drawable);
}
void
gimp_drawable_clear_filters (GimpDrawable *drawable)
{
g_return_if_fail (GIMP_IS_DRAWABLE (drawable));
gimp_container_clear (drawable->private->filter_stack);
gimp_drawable_filters_changed (drawable);
}
void
gimp_drawable_remove_last_filter (GimpDrawable *drawable)
{
GimpDrawableFilter *filter = NULL;
if (! GIMP_IS_DRAWABLE (drawable))
return;
if (gimp_drawable_has_filters (drawable))
{
filter = GIMP_LIST (drawable->private->filter_stack)->queue->head->data;
if (GIMP_IS_DRAWABLE_FILTER (filter))
{
gimp_drawable_remove_filter (drawable,
GIMP_FILTER (filter));
gimp_drawable_filters_changed (drawable);
}
}
}
void
gimp_drawable_merge_filters (GimpDrawable *drawable)
{
GList *list;
GimpImage *image;
GimpChannel *selection = NULL;
GeglBuffer *buffer = NULL;
if (! GIMP_IS_DRAWABLE (drawable))
return;
image = gimp_item_get_image (GIMP_ITEM (drawable));
/* Temporarily remove selection so filters can be merged down correctly */
selection =
GIMP_CHANNEL (gimp_item_duplicate (GIMP_ITEM (gimp_image_get_mask (image)),
GIMP_TYPE_CHANNEL));
gimp_channel_clear (gimp_image_get_mask (image), NULL, TRUE);
gimp_image_undo_group_start (image, GIMP_UNDO_GROUP_DRAWABLE,
_("Rasterize filters"));
while ((list = GIMP_LIST (drawable->private->filter_stack)->queue->tail))
{
if (GIMP_IS_DRAWABLE_FILTER (list->data))
{
GimpDrawableFilter *filter = list->data;
gimp_image_undo_push_filter_remove (gimp_item_get_image (GIMP_ITEM (drawable)),
_("Merge filter"), drawable, filter);
if (gimp_filter_get_active (GIMP_FILTER (filter)))
gimp_drawable_filter_commit (filter, FALSE, NULL, TRUE);
else
gimp_drawable_remove_filter (drawable, GIMP_FILTER (filter));
}
}
gimp_image_undo_group_end (gimp_item_get_image (GIMP_ITEM (drawable)));
/* Restore selection after merging down */
buffer = gimp_gegl_buffer_dup (gimp_drawable_get_buffer (GIMP_DRAWABLE (selection)));
gimp_drawable_set_buffer (GIMP_DRAWABLE (gimp_image_get_mask (image)),
FALSE, NULL, buffer);
g_object_unref (buffer);
g_object_ref_sink (selection);
g_object_unref (selection);
gimp_drawable_filters_changed (drawable);
}
gboolean
gimp_drawable_has_filter (GimpDrawable *drawable,
GimpFilter *filter)
{
gboolean filter_exists = FALSE;
g_return_val_if_fail (GIMP_IS_DRAWABLE (drawable), FALSE);
g_return_val_if_fail (GIMP_IS_FILTER (filter), FALSE);
return gimp_container_have (drawable->private->filter_stack,
GIMP_OBJECT (filter));
filter_exists = gimp_container_have (drawable->private->filter_stack,
GIMP_OBJECT (filter));
return filter_exists;
}
gboolean
@@ -339,5 +436,8 @@ gimp_drawable_merge_filter (GimpDrawable *drawable,
rect.width, rect.height);
}
if (success)
gimp_drawable_filters_changed (drawable);
return success;
}

View File

@@ -29,6 +29,10 @@ void gimp_drawable_add_filter (GimpDrawable *drawable,
GimpFilter *filter);
void gimp_drawable_remove_filter (GimpDrawable *drawable,
GimpFilter *filter);
void gimp_drawable_clear_filters (GimpDrawable *drawable);
void gimp_drawable_remove_last_filter
(GimpDrawable *drawable);
void gimp_drawable_merge_filters (GimpDrawable *drawable);
gboolean gimp_drawable_has_filter (GimpDrawable *drawable,
GimpFilter *filter);

View File

@@ -89,7 +89,7 @@ gimp_drawable_apply_operation_with_config (GimpDrawable *drawable,
}
gimp_drawable_filter_apply (filter, NULL);
gimp_drawable_filter_commit (filter, progress, TRUE);
gimp_drawable_filter_commit (filter, FALSE, progress, TRUE);
g_object_unref (filter);

View File

@@ -83,7 +83,8 @@ sub_preview_data_new (const Babl *format,
SubPreviewData *data = g_slice_new (SubPreviewData);
data->format = format;
data->buffer = g_object_ref (buffer);
/* We take ownership if the buffer reference. */
data->buffer = buffer;
data->rect = *rect;
data->scale = scale;
@@ -214,7 +215,7 @@ gimp_drawable_get_sub_preview (GimpDrawable *drawable,
if (! image->gimp->config->layer_previews)
return NULL;
buffer = gimp_drawable_get_buffer (drawable);
buffer = gimp_drawable_get_buffer_with_effects (drawable);
preview = gimp_temp_buf_new (dest_width, dest_height,
gimp_drawable_get_preview_format (drawable));
@@ -231,6 +232,7 @@ gimp_drawable_get_sub_preview (GimpDrawable *drawable,
gimp_temp_buf_get_format (preview),
gimp_temp_buf_get_data (preview),
GEGL_AUTO_ROWSTRIDE, GEGL_ABYSS_CLAMP);
g_object_unref (buffer);
return preview;
}
@@ -271,7 +273,7 @@ gimp_drawable_get_sub_pixbuf (GimpDrawable *drawable,
if (! image->gimp->config->layer_previews)
return NULL;
buffer = gimp_drawable_get_buffer (drawable);
buffer = gimp_drawable_get_buffer_with_effects (drawable);
pixbuf = gdk_pixbuf_new (GDK_COLORSPACE_RGB, TRUE, 8,
dest_width, dest_height);
@@ -328,6 +330,8 @@ gimp_drawable_get_sub_pixbuf (GimpDrawable *drawable,
GEGL_ABYSS_CLAMP);
}
g_object_unref (buffer);
return pixbuf;
}
@@ -433,7 +437,7 @@ gimp_drawable_get_sub_preview_async (GimpDrawable *drawable,
if (! image->gimp->config->layer_previews)
return NULL;
buffer = gimp_drawable_get_buffer (drawable);
buffer = gimp_drawable_get_buffer_with_effects (drawable);
if (no_async_drawable_previews < 0)
{

View File

@@ -41,6 +41,8 @@ struct _GimpDrawablePrivate
GeglBuffer *paint_buffer;
cairo_region_t *paint_copy_region;
cairo_region_t *paint_update_region;
gboolean push_resize_undo;
};
#endif /* __GIMP_DRAWABLE_PRIVATE_H__ */

View File

@@ -197,8 +197,7 @@ gimp_drawable_transform_buffer_flip (GimpDrawable *drawable,
if (clip_result && (new_x != orig_x || new_y != orig_y))
{
GimpRGB bg;
GeglColor *color;
GeglColor *color = NULL;
gint clip_x, clip_y;
gint clip_width, clip_height;
@@ -210,16 +209,15 @@ gimp_drawable_transform_buffer_flip (GimpDrawable *drawable,
*/
if (GIMP_IS_CHANNEL (drawable) || babl_format_has_alpha (format))
{
gimp_rgba_set (&bg, 0.0, 0.0, 0.0, 0.0);
color = gegl_color_new ("black");
gegl_color_set_rgba_with_space (color, 0.0, 0.0, 0.0, 0.0,
gimp_drawable_get_space (drawable));
}
else
{
gimp_context_get_background (context, &bg);
gimp_pickable_srgb_to_image_color (GIMP_PICKABLE (drawable),
&bg, &bg);
color = gegl_color_duplicate (gimp_context_get_background (context));
}
color = gimp_gegl_color_new (&bg, gimp_drawable_get_space (drawable));
gegl_buffer_set_color (new_buffer, NULL, color);
g_object_unref (color);
@@ -355,17 +353,17 @@ gimp_drawable_transform_rotate_point (gint x,
switch (rotate_type)
{
case GIMP_ROTATE_90:
case GIMP_ROTATE_DEGREES90:
*new_x = RINT (center_x - (gdouble) y + center_y);
*new_y = RINT (center_y + (gdouble) x - center_x);
break;
case GIMP_ROTATE_180:
case GIMP_ROTATE_DEGREES180:
*new_x = RINT (center_x - ((gdouble) x - center_x));
*new_y = RINT (center_y - ((gdouble) y - center_y));
break;
case GIMP_ROTATE_270:
case GIMP_ROTATE_DEGREES270:
*new_x = RINT (center_x + (gdouble) y - center_y);
*new_y = RINT (center_y - (gdouble) x + center_x);
break;
@@ -420,7 +418,7 @@ gimp_drawable_transform_buffer_rotate (GimpDrawable *drawable,
switch (rotate_type)
{
case GIMP_ROTATE_90:
case GIMP_ROTATE_DEGREES90:
gimp_drawable_transform_rotate_point (orig_x,
orig_y + orig_height,
rotate_type, center_x, center_y,
@@ -429,7 +427,7 @@ gimp_drawable_transform_buffer_rotate (GimpDrawable *drawable,
new_height = orig_width;
break;
case GIMP_ROTATE_180:
case GIMP_ROTATE_DEGREES180:
gimp_drawable_transform_rotate_point (orig_x + orig_width,
orig_y + orig_height,
rotate_type, center_x, center_y,
@@ -438,7 +436,7 @@ gimp_drawable_transform_buffer_rotate (GimpDrawable *drawable,
new_height = orig_height;
break;
case GIMP_ROTATE_270:
case GIMP_ROTATE_DEGREES270:
gimp_drawable_transform_rotate_point (orig_x + orig_width,
orig_y,
rotate_type, center_x, center_y,
@@ -458,8 +456,7 @@ gimp_drawable_transform_buffer_rotate (GimpDrawable *drawable,
new_width != orig_width || new_height != orig_height))
{
GimpRGB bg;
GeglColor *color;
GeglColor *color = NULL;
gint clip_x, clip_y;
gint clip_width, clip_height;
@@ -475,16 +472,15 @@ gimp_drawable_transform_buffer_rotate (GimpDrawable *drawable,
*/
if (GIMP_IS_CHANNEL (drawable) || babl_format_has_alpha (format))
{
gimp_rgba_set (&bg, 0.0, 0.0, 0.0, 0.0);
color = gegl_color_new ("black");
gegl_color_set_rgba_with_space (color, 0.0, 0.0, 0.0, 0.0,
gimp_drawable_get_space (drawable));
}
else
{
gimp_context_get_background (context, &bg);
gimp_pickable_srgb_to_image_color (GIMP_PICKABLE (drawable),
&bg, &bg);
color = gegl_color_duplicate (gimp_context_get_background (context));
}
color = gimp_gegl_color_new (&bg, gimp_drawable_get_space (drawable));
gegl_buffer_set_color (new_buffer, NULL, color);
g_object_unref (color);
@@ -501,10 +497,10 @@ gimp_drawable_transform_buffer_rotate (GimpDrawable *drawable,
switch (rotate_type)
{
case GIMP_ROTATE_90:
case GIMP_ROTATE_DEGREES90:
gimp_drawable_transform_rotate_point (clip_x + clip_width,
clip_y,
GIMP_ROTATE_270,
GIMP_ROTATE_DEGREES270,
center_x,
center_y,
&orig_x,
@@ -515,17 +511,17 @@ gimp_drawable_transform_buffer_rotate (GimpDrawable *drawable,
orig_height = clip_width;
break;
case GIMP_ROTATE_180:
case GIMP_ROTATE_DEGREES180:
orig_x = clip_x - orig_x;
orig_y = clip_y - orig_y;
orig_width = clip_width;
orig_height = clip_height;
break;
case GIMP_ROTATE_270:
case GIMP_ROTATE_DEGREES270:
gimp_drawable_transform_rotate_point (clip_x,
clip_y + clip_height,
GIMP_ROTATE_90,
GIMP_ROTATE_DEGREES90,
center_x,
center_y,
&orig_x,
@@ -576,7 +572,7 @@ gimp_drawable_transform_buffer_rotate (GimpDrawable *drawable,
switch (rotate_type)
{
case GIMP_ROTATE_90:
case GIMP_ROTATE_DEGREES90:
{
guchar *buf = g_new (guchar, new_height * orig_bpp);
gint i;
@@ -608,7 +604,7 @@ gimp_drawable_transform_buffer_rotate (GimpDrawable *drawable,
}
break;
case GIMP_ROTATE_180:
case GIMP_ROTATE_DEGREES180:
{
guchar *buf = g_new (guchar, new_width * orig_bpp);
gint i, j, k;
@@ -654,7 +650,7 @@ gimp_drawable_transform_buffer_rotate (GimpDrawable *drawable,
}
break;
case GIMP_ROTATE_270:
case GIMP_ROTATE_DEGREES270:
{
guchar *buf = g_new (guchar, new_width * orig_bpp);
gint i;

View File

@@ -31,6 +31,7 @@
#include "gegl/gimp-gegl-apply-operation.h"
#include "gegl/gimp-gegl-loops.h"
#include "gegl/gimp-gegl-utils.h"
#include "gegl/gimptilehandlervalidate.h"
#include "gimp-memsize.h"
#include "gimp-utils.h"
@@ -38,15 +39,18 @@
#include "gimpcontext.h"
#include "gimpdrawable-combine.h"
#include "gimpdrawable-fill.h"
#include "gimpdrawable-filters.h"
#include "gimpdrawable-floating-selection.h"
#include "gimpdrawable-preview.h"
#include "gimpdrawable-private.h"
#include "gimpdrawable-shadow.h"
#include "gimpdrawable-transform.h"
#include "gimpdrawablefilter.h"
#include "gimpfilterstack.h"
#include "gimpimage.h"
#include "gimpimage-colormap.h"
#include "gimpimage-undo-push.h"
#include "gimplayer.h"
#include "gimpmarshal.h"
#include "gimppickable.h"
#include "gimpprogress.h"
@@ -66,6 +70,7 @@ enum
FORMAT_CHANGED,
ALPHA_CHANGED,
BOUNDING_BOX_CHANGED,
FILTERS_CHANGED,
LAST_SIGNAL
};
@@ -270,6 +275,14 @@ gimp_drawable_class_init (GimpDrawableClass *klass)
NULL, NULL, NULL,
G_TYPE_NONE, 0);
gimp_drawable_signals[FILTERS_CHANGED] =
g_signal_new ("filters-changed",
G_TYPE_FROM_CLASS (klass),
G_SIGNAL_RUN_FIRST,
G_STRUCT_OFFSET (GimpDrawableClass, filters_changed),
NULL, NULL, NULL,
G_TYPE_NONE, 0);
object_class->dispose = gimp_drawable_dispose;
object_class->finalize = gimp_drawable_finalize;
object_class->set_property = gimp_drawable_set_property;
@@ -297,6 +310,7 @@ gimp_drawable_class_init (GimpDrawableClass *klass)
klass->format_changed = NULL;
klass->alpha_changed = NULL;
klass->bounding_box_changed = NULL;
klass->filters_changed = NULL;
klass->estimate_memsize = gimp_drawable_real_estimate_memsize;
klass->update_all = gimp_drawable_real_update_all;
klass->invalidate_boundary = NULL;
@@ -336,12 +350,13 @@ gimp_color_managed_iface_init (GimpColorManagedInterface *iface)
static void
gimp_pickable_iface_init (GimpPickableInterface *iface)
{
iface->get_image = (GimpImage * (*) (GimpPickable *pickable)) gimp_item_get_image;
iface->get_format = (const Babl * (*) (GimpPickable *pickable)) gimp_drawable_get_format;
iface->get_format_with_alpha = (const Babl * (*) (GimpPickable *pickable)) gimp_drawable_get_format_with_alpha;
iface->get_buffer = (GeglBuffer * (*) (GimpPickable *pickable)) gimp_drawable_get_buffer;
iface->get_pixel_at = gimp_drawable_get_pixel_at;
iface->get_pixel_average = gimp_drawable_get_pixel_average;
iface->get_image = (GimpImage * (*) (GimpPickable *pickable)) gimp_item_get_image;
iface->get_format = (const Babl * (*) (GimpPickable *pickable)) gimp_drawable_get_format;
iface->get_format_with_alpha = (const Babl * (*) (GimpPickable *pickable)) gimp_drawable_get_format_with_alpha;
iface->get_buffer = (GeglBuffer * (*) (GimpPickable *pickable)) gimp_drawable_get_buffer;
iface->get_buffer_with_effects = (GeglBuffer * (*) (GimpPickable *pickable)) gimp_drawable_get_buffer_with_effects;
iface->get_pixel_at = gimp_drawable_get_pixel_at;
iface->get_pixel_average = gimp_drawable_get_pixel_average;
}
static void
@@ -554,6 +569,30 @@ gimp_drawable_scale (GimpItem *item,
0, 0),
TRUE);
g_object_unref (new_buffer);
if (GIMP_IS_LAYER (drawable))
{
GList *list;
for (list = GIMP_LIST (drawable->private->filter_stack)->queue->tail;
list; list = g_list_previous (list))
{
if (GIMP_IS_DRAWABLE_FILTER (list->data))
{
GimpDrawableFilter *filter = list->data;
GimpChannel *mask = gimp_drawable_filter_get_mask (filter);
GeglRectangle *rect = GEGL_RECTANGLE (0, 0,
new_width,
new_height);
/* Don't resize partial layer effects */
if (gimp_channel_is_empty (mask))
gimp_drawable_filter_refresh_crop (filter, rect);
}
}
if (list)
g_list_free (list);
}
}
static void
@@ -606,12 +645,14 @@ gimp_drawable_resize (GimpItem *item,
{
/* Clear the new buffer if needed */
GimpRGB color;
GeglColor *color;
GimpPattern *pattern;
gimp_get_fill_params (context, fill_type, &color, &pattern, NULL);
gimp_drawable_fill_buffer (drawable, new_buffer,
&color, pattern, 0, 0);
if (gimp_get_fill_params (context, fill_type, &color, &pattern, NULL))
gimp_drawable_fill_buffer (drawable, new_buffer,
color, pattern, 0, 0);
g_clear_object (&color);
}
if (intersect && copy_width && copy_height)
@@ -628,12 +669,37 @@ gimp_drawable_resize (GimpItem *item,
copy_y - new_offset_y, 0, 0));
}
gimp_drawable_set_buffer_full (drawable, gimp_item_is_attached (item), NULL,
gimp_drawable_set_buffer_full (drawable,
gimp_item_is_attached (item) &&
drawable->private->push_resize_undo,
NULL,
new_buffer,
GEGL_RECTANGLE (new_offset_x, new_offset_y,
0, 0),
TRUE);
g_object_unref (new_buffer);
if (GIMP_IS_LAYER (drawable))
{
GList *list;
for (list = GIMP_LIST (drawable->private->filter_stack)->queue->tail;
list; list = g_list_previous (list))
{
if (GIMP_IS_DRAWABLE_FILTER (list->data))
{
GimpDrawableFilter *filter = list->data;
GimpChannel *mask = gimp_drawable_filter_get_mask (filter);
GeglRectangle rect = {0, 0, new_width, new_height};
/* Don't resize partial layer effects */
if (gimp_channel_is_empty (mask))
gimp_drawable_filter_refresh_crop (filter, &rect);
}
}
if (list)
g_list_free (list);
}
}
static void
@@ -906,6 +972,10 @@ gimp_drawable_real_set_buffer (GimpDrawable *drawable,
}
g_set_object (&drawable->private->buffer, buffer);
if (gimp_drawable_is_painting (drawable))
g_set_object (&drawable->private->paint_buffer, buffer);
g_clear_object (&drawable->private->format_profile);
if (drawable->private->buffer_source_node)
@@ -1072,6 +1142,8 @@ gimp_drawable_new (GType type,
gimp_drawable_set_buffer (drawable, FALSE, NULL, buffer);
g_object_unref (buffer);
gimp_drawable_enable_resize_undo (drawable);
return drawable;
}
@@ -1430,6 +1502,55 @@ gimp_drawable_set_buffer_full (GimpDrawable *drawable,
gimp_drawable_update (drawable, 0, 0, -1, -1);
}
GeglBuffer *
gimp_drawable_get_buffer_with_effects (GimpDrawable *drawable)
{
g_return_val_if_fail (GIMP_IS_DRAWABLE (drawable), NULL);
if (drawable->private->paint_count == 0)
{
if (gimp_drawable_has_filters (drawable))
{
GeglNode *source = NULL;
GeglBuffer *buffer;
GimpTileHandlerValidate *validate;
source = gimp_drawable_get_source_node (drawable);
buffer = GIMP_DRAWABLE_GET_CLASS (drawable)->get_buffer (drawable);
if (source)
{
buffer = gegl_buffer_new (gegl_buffer_get_extent (buffer),
gegl_buffer_get_format (buffer));
validate =
GIMP_TILE_HANDLER_VALIDATE (gimp_tile_handler_validate_new (source));
gimp_tile_handler_validate_assign (validate, buffer);
g_object_unref (validate);
gimp_tile_handler_validate_invalidate (validate,
gegl_buffer_get_extent (buffer));
return buffer;
}
else
{
return g_object_ref (buffer);
}
}
else
{
return g_object_ref (GIMP_DRAWABLE_GET_CLASS (drawable)->get_buffer (drawable));
}
}
else
{
return g_object_ref (drawable->private->paint_buffer);
}
}
void
gimp_drawable_steal_buffer (GimpDrawable *drawable,
GimpDrawable *src_drawable)
@@ -1672,6 +1793,22 @@ gimp_drawable_push_undo (GimpDrawable *drawable,
x, y, width, height);
}
void
gimp_drawable_disable_resize_undo (GimpDrawable *drawable)
{
g_return_if_fail (GIMP_IS_DRAWABLE (drawable));
drawable->private->push_resize_undo = FALSE;
}
void
gimp_drawable_enable_resize_undo (GimpDrawable *drawable)
{
g_return_if_fail (GIMP_IS_DRAWABLE (drawable));
drawable->private->push_resize_undo = TRUE;
}
const Babl *
gimp_drawable_get_space (GimpDrawable *drawable)
{
@@ -1862,18 +1999,6 @@ gimp_drawable_get_component_index (GimpDrawable *drawable,
return -1;
}
guchar *
gimp_drawable_get_colormap (GimpDrawable *drawable)
{
GimpImage *image;
g_return_val_if_fail (GIMP_IS_DRAWABLE (drawable), NULL);
image = gimp_item_get_image (GIMP_ITEM (drawable));
return image ? gimp_image_get_colormap (image) : NULL;
}
void
gimp_drawable_start_paint (GimpDrawable *drawable)
{
@@ -1911,6 +2036,16 @@ gimp_drawable_end_paint (GimpDrawable *drawable)
drawable->private->paint_count--;
/* Refresh filters after painting */
if (gimp_drawable_has_filters (drawable) &&
drawable->private->paint_count == 0)
{
gimp_item_set_visible (GIMP_ITEM (drawable), FALSE, FALSE);
gimp_image_flush (gimp_item_get_image (GIMP_ITEM (drawable)));
gimp_item_set_visible (GIMP_ITEM (drawable),TRUE, FALSE);
gimp_image_flush (gimp_item_get_image (GIMP_ITEM (drawable)));
}
return result;
}
@@ -1979,3 +2114,9 @@ gimp_drawable_is_painting (GimpDrawable *drawable)
return drawable->private->paint_count > 0;
}
void
gimp_drawable_filters_changed (GimpDrawable *drawable)
{
g_signal_emit (drawable, gimp_drawable_signals[FILTERS_CHANGED], 0);
}

View File

@@ -53,157 +53,163 @@ struct _GimpDrawableClass
void (* format_changed) (GimpDrawable *drawable);
void (* alpha_changed) (GimpDrawable *drawable);
void (* bounding_box_changed) (GimpDrawable *drawable);
void (* filters_changed) (GimpDrawable *drawable);
/* virtual functions */
gint64 (* estimate_memsize) (GimpDrawable *drawable,
GimpComponentType component_type,
gint width,
gint height);
void (* update_all) (GimpDrawable *drawable);
void (* invalidate_boundary) (GimpDrawable *drawable);
void (* get_active_components) (GimpDrawable *drawable,
gboolean *active);
GimpComponentMask (* get_active_mask) (GimpDrawable *drawable);
gboolean (* supports_alpha) (GimpDrawable *drawable);
void (* convert_type) (GimpDrawable *drawable,
GimpImage *dest_image,
const Babl *new_format,
GimpColorProfile *src_profile,
GimpColorProfile *dest_profile,
GeglDitherMethod layer_dither_type,
GeglDitherMethod mask_dither_type,
gboolean push_undo,
GimpProgress *progress);
void (* apply_buffer) (GimpDrawable *drawable,
GeglBuffer *buffer,
const GeglRectangle *buffer_region,
gboolean push_undo,
const gchar *undo_desc,
gdouble opacity,
GimpLayerMode mode,
GimpLayerColorSpace blend_space,
GimpLayerColorSpace composite_space,
GimpLayerCompositeMode composite_mode,
GeglBuffer *base_buffer,
gint base_x,
gint base_y);
GeglBuffer * (* get_buffer) (GimpDrawable *drawable);
void (* set_buffer) (GimpDrawable *drawable,
gboolean push_undo,
const gchar *undo_desc,
GeglBuffer *buffer,
const GeglRectangle *bounds);
GeglRectangle (* get_bounding_box) (GimpDrawable *drawable);
void (* push_undo) (GimpDrawable *drawable,
const gchar *undo_desc,
GeglBuffer *buffer,
gint x,
gint y,
gint width,
gint height);
void (* swap_pixels) (GimpDrawable *drawable,
GeglBuffer *buffer,
gint x,
gint y);
GeglNode * (* get_source_node) (GimpDrawable *drawable);
gint64 (* estimate_memsize) (GimpDrawable *drawable,
GimpComponentType component_type,
gint width,
gint height);
void (* update_all) (GimpDrawable *drawable);
void (* invalidate_boundary) (GimpDrawable *drawable);
void (* get_active_components) (GimpDrawable *drawable,
gboolean *active);
GimpComponentMask (* get_active_mask) (GimpDrawable *drawable);
gboolean (* supports_alpha) (GimpDrawable *drawable);
void (* convert_type) (GimpDrawable *drawable,
GimpImage *dest_image,
const Babl *new_format,
GimpColorProfile *src_profile,
GimpColorProfile *dest_profile,
GeglDitherMethod layer_dither_type,
GeglDitherMethod mask_dither_type,
gboolean push_undo,
GimpProgress *progress);
void (* apply_buffer) (GimpDrawable *drawable,
GeglBuffer *buffer,
const GeglRectangle *buffer_region,
gboolean push_undo,
const gchar *undo_desc,
gdouble opacity,
GimpLayerMode mode,
GimpLayerColorSpace blend_space,
GimpLayerColorSpace composite_space,
GimpLayerCompositeMode composite_mode,
GeglBuffer *base_buffer,
gint base_x,
gint base_y);
GeglBuffer * (* get_buffer) (GimpDrawable *drawable);
void (* set_buffer) (GimpDrawable *drawable,
gboolean push_undo,
const gchar *undo_desc,
GeglBuffer *buffer,
const GeglRectangle *bounds);
GeglBuffer * (* get_buffer_with_effects) (GimpDrawable *drawable);
GeglRectangle (* get_bounding_box) (GimpDrawable *drawable);
void (* push_undo) (GimpDrawable *drawable,
const gchar *undo_desc,
GeglBuffer *buffer,
gint x,
gint y,
gint width,
gint height);
void (* swap_pixels) (GimpDrawable *drawable,
GeglBuffer *buffer,
gint x,
gint y);
GeglNode * (* get_source_node) (GimpDrawable *drawable);
};
GType gimp_drawable_get_type (void) G_GNUC_CONST;
GType gimp_drawable_get_type (void) G_GNUC_CONST;
GimpDrawable * gimp_drawable_new (GType type,
GimpImage *image,
const gchar *name,
gint offset_x,
gint offset_y,
gint width,
gint height,
const Babl *format);
GimpDrawable * gimp_drawable_new (GType type,
GimpImage *image,
const gchar *name,
gint offset_x,
gint offset_y,
gint width,
gint height,
const Babl *format);
gint64 gimp_drawable_estimate_memsize (GimpDrawable *drawable,
GimpComponentType component_type,
gint width,
gint height);
gint64 gimp_drawable_estimate_memsize (GimpDrawable *drawable,
GimpComponentType component_type,
gint width,
gint height);
void gimp_drawable_update (GimpDrawable *drawable,
gint x,
gint y,
gint width,
gint height);
void gimp_drawable_update_all (GimpDrawable *drawable);
void gimp_drawable_update (GimpDrawable *drawable,
gint x,
gint y,
gint width,
gint height);
void gimp_drawable_update_all (GimpDrawable *drawable);
void gimp_drawable_invalidate_boundary (GimpDrawable *drawable);
void gimp_drawable_get_active_components (GimpDrawable *drawable,
gboolean *active);
GimpComponentMask gimp_drawable_get_active_mask (GimpDrawable *drawable);
void gimp_drawable_invalidate_boundary (GimpDrawable *drawable);
void gimp_drawable_get_active_components (GimpDrawable *drawable,
gboolean *active);
GimpComponentMask gimp_drawable_get_active_mask (GimpDrawable *drawable);
gboolean gimp_drawable_supports_alpha (GimpDrawable *drawable);
gboolean gimp_drawable_supports_alpha (GimpDrawable *drawable);
void gimp_drawable_convert_type (GimpDrawable *drawable,
GimpImage *dest_image,
GimpImageBaseType new_base_type,
GimpPrecision new_precision,
gboolean new_has_alpha,
GimpColorProfile *src_profile,
GimpColorProfile *dest_profile,
GeglDitherMethod layer_dither_type,
GeglDitherMethod mask_dither_type,
gboolean push_undo,
GimpProgress *progress);
void gimp_drawable_convert_type (GimpDrawable *drawable,
GimpImage *dest_image,
GimpImageBaseType new_base_type,
GimpPrecision new_precision,
gboolean new_has_alpha,
GimpColorProfile *src_profile,
GimpColorProfile *dest_profile,
GeglDitherMethod layer_dither_type,
GeglDitherMethod mask_dither_type,
gboolean push_undo,
GimpProgress *progress);
void gimp_drawable_apply_buffer (GimpDrawable *drawable,
GeglBuffer *buffer,
const GeglRectangle *buffer_rect,
gboolean push_undo,
const gchar *undo_desc,
gdouble opacity,
GimpLayerMode mode,
GimpLayerColorSpace blend_space,
GimpLayerColorSpace composite_space,
GimpLayerCompositeMode composite_mode,
GeglBuffer *base_buffer,
gint base_x,
gint base_y);
void gimp_drawable_apply_buffer (GimpDrawable *drawable,
GeglBuffer *buffer,
const GeglRectangle *buffer_rect,
gboolean push_undo,
const gchar *undo_desc,
gdouble opacity,
GimpLayerMode mode,
GimpLayerColorSpace blend_space,
GimpLayerColorSpace composite_space,
GimpLayerCompositeMode composite_mode,
GeglBuffer *base_buffer,
gint base_x,
gint base_y);
GeglBuffer * gimp_drawable_get_buffer (GimpDrawable *drawable);
void gimp_drawable_set_buffer (GimpDrawable *drawable,
gboolean push_undo,
const gchar *undo_desc,
GeglBuffer *buffer);
void gimp_drawable_set_buffer_full (GimpDrawable *drawable,
gboolean push_undo,
const gchar *undo_desc,
GeglBuffer *buffer,
const GeglRectangle *bounds,
gboolean update);
GeglBuffer * gimp_drawable_get_buffer (GimpDrawable *drawable);
void gimp_drawable_set_buffer (GimpDrawable *drawable,
gboolean push_undo,
const gchar *undo_desc,
GeglBuffer *buffer);
void gimp_drawable_set_buffer_full (GimpDrawable *drawable,
gboolean push_undo,
const gchar *undo_desc,
GeglBuffer *buffer,
const GeglRectangle *bounds,
gboolean update);
GeglBuffer * gimp_drawable_get_buffer_with_effects (GimpDrawable *drawable);
void gimp_drawable_steal_buffer (GimpDrawable *drawable,
GimpDrawable *src_drawable);
void gimp_drawable_steal_buffer (GimpDrawable *drawable,
GimpDrawable *src_drawable);
void gimp_drawable_set_format (GimpDrawable *drawable,
const Babl *format,
gboolean copy_buffer,
gboolean push_undo);
void gimp_drawable_set_format (GimpDrawable *drawable,
const Babl *format,
gboolean copy_buffer,
gboolean push_undo);
GeglNode * gimp_drawable_get_source_node (GimpDrawable *drawable);
GeglNode * gimp_drawable_get_mode_node (GimpDrawable *drawable);
GeglNode * gimp_drawable_get_source_node (GimpDrawable *drawable);
GeglNode * gimp_drawable_get_mode_node (GimpDrawable *drawable);
GeglRectangle gimp_drawable_get_bounding_box (GimpDrawable *drawable);
GeglRectangle gimp_drawable_get_bounding_box (GimpDrawable *drawable);
gboolean gimp_drawable_update_bounding_box
(GimpDrawable *drawable);
(GimpDrawable *drawable);
void gimp_drawable_swap_pixels (GimpDrawable *drawable,
GeglBuffer *buffer,
gint x,
gint y);
void gimp_drawable_swap_pixels (GimpDrawable *drawable,
GeglBuffer *buffer,
gint x,
gint y);
void gimp_drawable_push_undo (GimpDrawable *drawable,
const gchar *undo_desc,
GeglBuffer *buffer,
gint x,
gint y,
gint width,
gint height);
void gimp_drawable_push_undo (GimpDrawable *drawable,
const gchar *undo_desc,
GeglBuffer *buffer,
gint x,
gint y,
gint width,
gint height);
void gimp_drawable_disable_resize_undo (GimpDrawable *drawable);
void gimp_drawable_enable_resize_undo (GimpDrawable *drawable);
const Babl * gimp_drawable_get_space (GimpDrawable *drawable);
const Babl * gimp_drawable_get_format (GimpDrawable *drawable);
@@ -224,12 +230,12 @@ const Babl * gimp_drawable_get_component_format (GimpDrawable *drawable,
gint gimp_drawable_get_component_index (GimpDrawable *drawable,
GimpChannelType channel);
guchar * gimp_drawable_get_colormap (GimpDrawable *drawable);
void gimp_drawable_start_paint (GimpDrawable *drawable);
gboolean gimp_drawable_end_paint (GimpDrawable *drawable);
gboolean gimp_drawable_flush_paint (GimpDrawable *drawable);
gboolean gimp_drawable_is_painting (GimpDrawable *drawable);
void gimp_drawable_filters_changed (GimpDrawable *drawable);
#endif /* __GIMP_DRAWABLE_H__ */

View File

@@ -54,12 +54,19 @@ enum
LAST_SIGNAL
};
enum
{
PROP_0,
PROP_MASK
};
struct _GimpDrawableFilter
{
GimpFilter parent_instance;
GimpDrawable *drawable;
GimpChannel *mask;
GeglNode *operation;
gboolean has_input;
@@ -94,7 +101,15 @@ struct _GimpDrawableFilter
GimpApplicator *applicator;
};
static void gimp_drawable_filter_set_property (GObject *object,
guint property_id,
const GValue *value,
GParamSpec *pspec);
static void gimp_drawable_filter_get_property (GObject *object,
guint property_id,
GValue *value,
GParamSpec *pspec);
static void gimp_drawable_filter_dispose (GObject *object);
static void gimp_drawable_filter_finalize (GObject *object);
@@ -159,8 +174,16 @@ gimp_drawable_filter_class_init (GimpDrawableFilterClass *klass)
NULL, NULL, NULL,
G_TYPE_NONE, 0);
object_class->dispose = gimp_drawable_filter_dispose;
object_class->finalize = gimp_drawable_filter_finalize;
object_class->set_property = gimp_drawable_filter_set_property;
object_class->get_property = gimp_drawable_filter_get_property;
object_class->dispose = gimp_drawable_filter_dispose;
object_class->finalize = gimp_drawable_filter_finalize;
g_object_class_install_property (object_class, PROP_MASK,
g_param_spec_object ("mask",
NULL, NULL,
GIMP_TYPE_CHANNEL,
GIMP_PARAM_READWRITE));
}
static void
@@ -179,6 +202,49 @@ gimp_drawable_filter_init (GimpDrawableFilter *drawable_filter)
drawable_filter->composite_mode = GIMP_LAYER_COMPOSITE_AUTO;
}
static void
gimp_drawable_filter_set_property (GObject *object,
guint property_id,
const GValue *value,
GParamSpec *pspec)
{
GimpDrawableFilter *filter = GIMP_DRAWABLE_FILTER (object);
switch (property_id)
{
case PROP_MASK:
g_set_object (&filter->mask, g_value_get_object (value));
if (filter->mask)
gimp_drawable_filter_sync_mask (filter);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
break;
}
}
static void
gimp_drawable_filter_get_property (GObject *object,
guint property_id,
GValue *value,
GParamSpec *pspec)
{
GimpDrawableFilter *filter = GIMP_DRAWABLE_FILTER (object);
switch (property_id)
{
case PROP_MASK:
g_value_set_object (value, gimp_drawable_filter_get_mask (filter));
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
break;
}
}
static void
gimp_drawable_filter_dispose (GObject *object)
{
@@ -195,9 +261,10 @@ gimp_drawable_filter_finalize (GObject *object)
{
GimpDrawableFilter *drawable_filter = GIMP_DRAWABLE_FILTER (object);
g_clear_object (&drawable_filter->operation);
g_clear_object (&drawable_filter->applicator);
g_clear_object (&drawable_filter->drawable);
g_clear_object (&drawable_filter->operation);
g_clear_object (&drawable_filter->mask);
G_OBJECT_CLASS (parent_class)->finalize (object);
}
@@ -219,6 +286,7 @@ gimp_drawable_filter_new (GimpDrawable *drawable,
filter = g_object_new (GIMP_TYPE_DRAWABLE_FILTER,
"name", undo_desc,
"icon-name", icon_name,
"mask", NULL,
NULL);
filter->drawable = g_object_ref (drawable);
@@ -226,8 +294,11 @@ gimp_drawable_filter_new (GimpDrawable *drawable,
node = gimp_filter_get_node (GIMP_FILTER (filter));
gegl_node_add_child (node, operation);
gimp_gegl_node_set_underlying_operation (node, operation);
if (! gegl_node_get_parent (operation))
{
gegl_node_add_child (node, operation);
gimp_gegl_node_set_underlying_operation (node, operation);
}
filter->applicator = gimp_applicator_new (node);
@@ -281,6 +352,78 @@ gimp_drawable_filter_new (GimpDrawable *drawable,
return filter;
}
GimpDrawableFilter *
gimp_drawable_filter_duplicate (GimpDrawable *drawable,
GimpDrawableFilter *prior_filter)
{
GimpDrawableFilter *filter;
GimpChannel *mask;
GeglNode *prior_node;
GeglNode *node = gegl_node_new ();
const gchar *operation;
const gchar *undo_desc;
const gchar *icon_name;
GParamSpec **pspecs;
guint n_pspecs;
g_return_val_if_fail (GIMP_IS_DRAWABLE (drawable), NULL);
g_return_val_if_fail (GIMP_IS_DRAWABLE_FILTER (prior_filter), NULL);
prior_node = gimp_drawable_filter_get_operation (prior_filter);
g_object_get (prior_filter,
"name", &undo_desc,
"icon-name", &icon_name,
NULL);
gegl_node_get (prior_node,
"operation", &operation,
NULL);
gegl_node_set (node,
"operation", operation,
NULL);
pspecs = gegl_operation_list_properties (operation, &n_pspecs);
for (gint i = 0; i < n_pspecs; i++)
{
GParamSpec *pspec = pspecs[i];
GValue value = G_VALUE_INIT;
g_value_init (&value, pspec->value_type);
gegl_node_get_property (prior_node, pspec->name,
&value);
gegl_node_set_property (node, pspec->name,
&value);
g_value_unset (&value);
}
g_free (pspecs);
filter = gimp_drawable_filter_new (drawable, undo_desc, node, icon_name);
g_object_unref (node);
gimp_drawable_filter_set_opacity (filter, prior_filter->opacity);
gimp_drawable_filter_set_mode (filter,
prior_filter->paint_mode,
prior_filter->blend_space,
prior_filter->composite_space,
prior_filter->composite_mode);
gimp_drawable_filter_set_region (filter,
prior_filter->region);
mask = GIMP_CHANNEL (gimp_item_duplicate (GIMP_ITEM (prior_filter->mask),
GIMP_TYPE_CHANNEL));
g_object_set (filter,
"mask", mask,
NULL);
g_object_unref (mask);
return filter;
}
GimpDrawable *
gimp_drawable_filter_get_drawable (GimpDrawableFilter *filter)
{
@@ -297,6 +440,62 @@ gimp_drawable_filter_get_operation (GimpDrawableFilter *filter)
return filter->operation;
}
GimpChannel *
gimp_drawable_filter_get_mask (GimpDrawableFilter *filter)
{
g_return_val_if_fail (GIMP_IS_DRAWABLE_FILTER (filter), NULL);
return filter->mask;
}
gdouble
gimp_drawable_filter_get_opacity (GimpDrawableFilter *filter)
{
g_return_val_if_fail (GIMP_IS_DRAWABLE_FILTER (filter), 0.0f);
return filter->opacity;
}
GimpLayerMode
gimp_drawable_filter_get_paint_mode (GimpDrawableFilter *filter)
{
g_return_val_if_fail (GIMP_IS_DRAWABLE_FILTER (filter), 0);
return filter->paint_mode;
}
GimpLayerColorSpace
gimp_drawable_filter_get_blend_space (GimpDrawableFilter *filter)
{
g_return_val_if_fail (GIMP_IS_DRAWABLE_FILTER (filter), 0);
return filter->blend_space;
}
GimpLayerColorSpace
gimp_drawable_filter_get_composite_space (GimpDrawableFilter *filter)
{
g_return_val_if_fail (GIMP_IS_DRAWABLE_FILTER (filter), 0);
return filter->composite_space;
}
GimpLayerCompositeMode
gimp_drawable_filter_get_composite_mode (GimpDrawableFilter *filter)
{
g_return_val_if_fail (GIMP_IS_DRAWABLE_FILTER (filter), 0);
return filter->composite_mode;
}
GimpFilterRegion
gimp_drawable_filter_get_region (GimpDrawableFilter *filter)
{
g_return_val_if_fail (GIMP_IS_DRAWABLE_FILTER (filter), 0);
return filter->region;
}
void
gimp_drawable_filter_set_clip (GimpDrawableFilter *filter,
gboolean clip)
@@ -307,6 +506,7 @@ gimp_drawable_filter_set_clip (GimpDrawableFilter *filter,
{
filter->clip = clip;
gimp_drawable_filter_sync_region (filter);
gimp_drawable_filter_sync_clip (filter, TRUE);
}
}
@@ -568,6 +768,7 @@ gimp_drawable_filter_apply (GimpDrawableFilter *filter,
gboolean
gimp_drawable_filter_commit (GimpDrawableFilter *filter,
gboolean non_destructive,
GimpProgress *progress,
gboolean cancellable)
{
@@ -582,6 +783,7 @@ gimp_drawable_filter_commit (GimpDrawableFilter *filter,
{
const Babl *format;
g_object_add_weak_pointer (G_OBJECT (filter), (gpointer) &filter);
format = gimp_drawable_filter_get_format (filter);
gimp_drawable_filter_set_preview_split (filter, FALSE,
@@ -589,21 +791,41 @@ gimp_drawable_filter_commit (GimpDrawableFilter *filter,
filter->preview_split_position);
gimp_drawable_filter_set_preview (filter, TRUE);
success = gimp_drawable_merge_filter (filter->drawable,
GIMP_FILTER (filter),
progress,
gimp_object_get_name (filter),
format,
filter->filter_clip,
cancellable,
FALSE);
/* Only commit if filter is applied destructively */
if (! non_destructive)
{
success = gimp_drawable_merge_filter (filter->drawable,
GIMP_FILTER (filter),
progress,
gimp_object_get_name (filter),
format,
filter->filter_clip,
cancellable,
FALSE);
gimp_drawable_filter_remove_filter (filter);
gimp_drawable_filter_remove_filter (filter);
}
else
{
GeglRectangle rect;
if (! success)
gimp_drawable_filter_update_drawable (filter, NULL);
if (gimp_viewable_preview_is_frozen (GIMP_VIEWABLE (filter->drawable)))
gimp_viewable_preview_thaw (GIMP_VIEWABLE (filter->drawable));
g_signal_emit (filter, drawable_filter_signals[FLUSH], 0);
/* Update layer tree preview */
rect = gimp_drawable_get_bounding_box (filter->drawable);
gimp_drawable_update (filter->drawable, rect.x, rect.y,
rect.width, rect.height);
}
if (filter)
{
if (! success)
gimp_drawable_filter_update_drawable (filter, NULL);
g_signal_emit (filter, drawable_filter_signals[FLUSH], 0);
g_object_remove_weak_pointer (G_OBJECT (filter), (gpointer) &filter);
}
}
return success;
@@ -620,6 +842,41 @@ gimp_drawable_filter_abort (GimpDrawableFilter *filter)
}
}
void
gimp_drawable_filter_layer_mask_freeze (GimpDrawableFilter *filter)
{
GimpImage *image = gimp_item_get_image (GIMP_ITEM (filter->drawable));
GimpChannel *mask;
if (! filter->mask)
{
mask = GIMP_CHANNEL (gimp_item_duplicate (GIMP_ITEM (gimp_image_get_mask (image)),
GIMP_TYPE_CHANNEL));
g_set_object (&filter->mask, mask);
g_object_unref (mask);
}
g_signal_handlers_disconnect_by_func (image,
gimp_drawable_filter_mask_changed,
filter);
}
void gimp_drawable_filter_refresh_crop (GimpDrawableFilter *filter,
GeglRectangle *rect)
{
g_return_if_fail (GIMP_IS_DRAWABLE_FILTER (filter));
if (rect)
{
gimp_drawable_filter_set_clip (filter, TRUE);
gimp_drawable_filter_set_clip (filter, FALSE);
gimp_drawable_filter_set_region (filter, GIMP_FILTER_REGION_SELECTION);
gimp_drawable_filter_set_region (filter, GIMP_FILTER_REGION_DRAWABLE);
gimp_drawable_filter_set_crop (filter, NULL, FALSE);
gimp_drawable_filter_set_crop (filter, rect, FALSE);
}
}
/* private functions */
@@ -642,10 +899,9 @@ gimp_drawable_filter_sync_clip (GimpDrawableFilter *filter,
if (! clip)
{
GimpImage *image = gimp_item_get_image (GIMP_ITEM (filter->drawable));
GimpChannel *mask = gimp_image_get_mask (image);
GimpChannel *mask = GIMP_CHANNEL (filter->mask);
if (! gimp_channel_is_empty (mask))
if (mask && ! gimp_channel_is_empty (mask))
clip = TRUE;
}
@@ -838,7 +1094,7 @@ gimp_drawable_filter_sync_crop (GimpDrawableFilter *filter,
gimp_applicator_set_crop (filter->applicator, enabled ? &new_rect : NULL);
if (update &&
if (update &&
gimp_drawable_filter_is_active (filter) &&
! gegl_rectangle_equal (&old_rect, &new_rect))
{
@@ -921,11 +1177,22 @@ static void
gimp_drawable_filter_sync_mask (GimpDrawableFilter *filter)
{
GimpImage *image = gimp_item_get_image (GIMP_ITEM (filter->drawable));
GimpChannel *mask = gimp_image_get_mask (image);
GimpChannel *mask = NULL;
if (gimp_channel_is_empty (mask))
if (! filter->mask)
mask = gimp_image_get_mask (image);
else
mask = GIMP_CHANNEL (filter->mask);
if (! mask || gimp_channel_is_empty (mask))
{
gimp_applicator_set_mask_buffer (filter->applicator, NULL);
gimp_item_mask_intersect (GIMP_ITEM (filter->drawable),
&filter->filter_area.x,
&filter->filter_area.y,
&filter->filter_area.width,
&filter->filter_area.height);
}
else
{
@@ -939,13 +1206,21 @@ gimp_drawable_filter_sync_mask (GimpDrawableFilter *filter)
gimp_applicator_set_mask_buffer (filter->applicator, mask_buffer);
gimp_applicator_set_mask_offset (filter->applicator,
-offset_x, -offset_y);
}
gimp_item_mask_intersect (GIMP_ITEM (filter->drawable),
&filter->filter_area.x,
&filter->filter_area.y,
&filter->filter_area.width,
&filter->filter_area.height);
/* Update filter crop */
filter->filter_area.x = mask->x1;
filter->filter_area.y = mask->y1;
filter->filter_area.width = mask->x2 - mask->x1;
filter->filter_area.height = mask->y2 - mask->y1;
gimp_item_mask_intersect (GIMP_ITEM (filter->drawable),
&filter->filter_area.x,
&filter->filter_area.y,
&filter->filter_area.width,
&filter->filter_area.height);
gimp_drawable_filter_sync_region (filter);
}
}
static void
@@ -1052,24 +1327,25 @@ gimp_drawable_filter_add_filter (GimpDrawableFilter *filter)
g_signal_connect (image, "component-active-changed",
G_CALLBACK (gimp_drawable_filter_affect_changed),
filter);
g_signal_connect (image, "mask-changed",
G_CALLBACK (gimp_drawable_filter_mask_changed),
filter);
g_signal_connect (filter->drawable, "lock-position-changed",
G_CALLBACK (gimp_drawable_filter_lock_position_changed),
filter);
g_signal_connect (filter->drawable, "format-changed",
G_CALLBACK (gimp_drawable_filter_format_changed),
filter);
g_signal_connect (filter->drawable, "removed",
G_CALLBACK (gimp_drawable_filter_drawable_removed),
filter);
if (! filter->mask)
g_signal_connect_object (image, "mask-changed",
G_CALLBACK (gimp_drawable_filter_mask_changed),
filter, 0);
g_signal_connect_object (filter->drawable, "lock-position-changed",
G_CALLBACK (gimp_drawable_filter_lock_position_changed),
filter, 0);
g_signal_connect_object (filter->drawable, "format-changed",
G_CALLBACK (gimp_drawable_filter_format_changed),
filter, 0);
g_signal_connect_object (filter->drawable, "removed",
G_CALLBACK (gimp_drawable_filter_drawable_removed),
filter, 0);
if (GIMP_IS_LAYER (filter->drawable))
{
g_signal_connect (filter->drawable, "lock-alpha-changed",
G_CALLBACK (gimp_drawable_filter_lock_alpha_changed),
filter);
g_signal_connect_object (filter->drawable, "lock-alpha-changed",
G_CALLBACK (gimp_drawable_filter_lock_alpha_changed),
filter, 0);
}
return TRUE;
@@ -1083,37 +1359,34 @@ gimp_drawable_filter_remove_filter (GimpDrawableFilter *filter)
{
if (gimp_drawable_filter_is_added (filter))
{
GimpImage *image = gimp_item_get_image (GIMP_ITEM (filter->drawable));
GimpImage *image = gimp_item_get_image (GIMP_ITEM (filter->drawable));
GimpDrawable *drawable = filter->drawable;
if (GIMP_IS_LAYER (filter->drawable))
{
g_signal_handlers_disconnect_by_func (filter->drawable,
gimp_drawable_filter_lock_alpha_changed,
filter);
}
if (GIMP_IS_LAYER (drawable))
g_signal_handlers_disconnect_by_func (drawable,
gimp_drawable_filter_lock_alpha_changed,
filter);
g_signal_handlers_disconnect_by_func (filter->drawable,
g_signal_handlers_disconnect_by_func (drawable,
gimp_drawable_filter_drawable_removed,
filter);
g_signal_handlers_disconnect_by_func (filter->drawable,
g_signal_handlers_disconnect_by_func (drawable,
gimp_drawable_filter_format_changed,
filter);
g_signal_handlers_disconnect_by_func (filter->drawable,
g_signal_handlers_disconnect_by_func (drawable,
gimp_drawable_filter_lock_position_changed,
filter);
g_signal_handlers_disconnect_by_func (image,
gimp_drawable_filter_mask_changed,
filter);
g_signal_handlers_disconnect_by_func (image,
gimp_drawable_filter_affect_changed,
filter);
gimp_drawable_remove_filter (filter->drawable,
GIMP_FILTER (filter));
gimp_drawable_remove_filter (drawable, GIMP_FILTER (filter));
gimp_drawable_update_bounding_box (filter->drawable);
gimp_drawable_update_bounding_box (drawable);
gimp_viewable_preview_thaw (GIMP_VIEWABLE (filter->drawable));
if (gimp_viewable_preview_is_frozen (GIMP_VIEWABLE (drawable)))
gimp_viewable_preview_thaw (GIMP_VIEWABLE (drawable));
return TRUE;
}
@@ -1181,13 +1454,22 @@ static void
gimp_drawable_filter_mask_changed (GimpImage *image,
GimpDrawableFilter *filter)
{
gimp_drawable_filter_update_drawable (filter, NULL);
if (! filter->mask)
{
gimp_drawable_filter_update_drawable (filter, NULL);
gimp_drawable_filter_sync_mask (filter);
gimp_drawable_filter_sync_clip (filter, FALSE);
gimp_drawable_filter_sync_region (filter);
gimp_drawable_filter_sync_mask (filter);
gimp_drawable_filter_sync_clip (filter, FALSE);
gimp_drawable_filter_sync_region (filter);
gimp_drawable_filter_update_drawable (filter, NULL);
gimp_drawable_filter_update_drawable (filter, NULL);
}
else
{
g_signal_handlers_disconnect_by_func (image,
gimp_drawable_filter_mask_changed,
filter);
}
}
static void
@@ -1210,7 +1492,8 @@ static void
gimp_drawable_filter_drawable_removed (GimpDrawable *drawable,
GimpDrawableFilter *filter)
{
gimp_drawable_filter_remove_filter (filter);
if (filter)
gimp_drawable_filter_remove_filter (filter);
}
static void

Some files were not shown because too many files have changed in this diff Show More