Commit graph

25512 commits

Author SHA1 Message Date
Jehan
67a04ba3b2 app, libgimp, pdb: port GimpRasterizable interface to libgimp too. 2025-10-13 16:37:25 +02:00
Jehan
d593cb3230 app, pdb, po: new GimpRasterizable interface.
Share the whole rasterize logic of the text, link and vector layer into
an interface. I didn't write it as an abstract parent class, because we
might have more rasterizable items in the future, which may not be
layers (e.g. there were discussions of vector masks).
2025-10-13 15:37:11 +02:00
Jehan
59c0e1ae6e app: remove useless heading newline. 2025-10-13 15:37:11 +02:00
Jehan
9d45f41868 app: properly react to the currently selected vector layer being rasterized.
Also properly factorize the set_layer() code, avoiding duplicating the
(dis)connecting signal handler code in various places.
2025-10-12 19:58:28 +02:00
Jehan
2962362884 app, libgimp, pdb: fix markdown-like syntax.
We need 2 lines in the PDB for it to be an empty line in the C file,
which in turn will be interpreted as markdown-like lists for the
gi-docgen generated HTML docs.
2025-10-12 17:22:18 +02:00
Alx Sa
e224278517 app, modules: Resolve unused Windows variable warnings
This patch adds moves several variables that are not used
on Windows to #ifndef G_OS_WIN32 blocks to prevent
warnings on Windows builds.
2025-10-12 14:06:04 +00:00
Idriss Fekir
c5bd321570 GimpFontFactory: don't match postscript name on Skia font family
Pango shows all fonts in the family as "Skia Bold", unless the psname is not matched
so we make an exception for skia and don't match on psname in the custom fontconfig xml.
see issue 14659.
2025-10-12 10:10:29 +02:00
Jehan
a46d0c3117 app, libgimp, pdb: further improve function documentation.
- Consistently add the text about inserting items into the image after
  creation, with correct function links/references.
- Consistent grammar for function blurb.
- Make @name argument nullable for gimp_path_new().
2025-10-11 22:10:30 +02:00
Jehan
93fa9ca32e app, libgimp, pdb: make for more consistent function documentation. 2025-10-11 18:54:30 +02:00
Jehan
4752246f8a app: minor coding style cleanup. 2025-10-11 00:04:45 +02:00
Jehan
e86e0fb54c app: sync undo label with action label. 2025-10-11 00:02:38 +02:00
Jehan
1e88cfd70f app: make the "Create New Layer" option work properly.
It will duplicate the current path, create a new vector layer based on
it and will let one start editing it.
2025-10-10 23:40:54 +02:00
Jehan
0725b023cd app: add "Confirm Path Editing" dialog on Path tool similar to the…
… "Confirm Text Editing" one on Text tool.

When selecting a rasterized vector layer, this will suggest to edit it
anyway (hence losing any modification since rasterization), create a new
layer based off the same path, or cancel.
2025-10-10 23:34:37 +02:00
Jehan
7c7f7b4898 app, libgimpwidgets: add 2 new icon macros.
New libgimpwidgets icon macros: GIMP_ICON_LAYER_LINK_LAYER and
GIMP_ICON_LAYER_VECTOR_LAYER. Note that the actual icons still need to
be done so I use temporary actual icon designs for now.

Also adding some TODOs for these.

Fix run warning:

> WARNING: icon theme has no icon 'gimp-vector-layer'.
2025-10-10 23:34:37 +02:00
Jehan
c3075f9ee9 gimp-ux#252: update "layers-retrieve" label.
Per discussions with Alx, this wording would increase connection with
the "Rasterize" action. Also, even though it feels slightly improper
English, if we treat "Rasterize" like an action name, then it does make
sense in English too.
2025-10-10 21:25:39 +02:00
Jehan
8e9c6d7e3c Issue gimp-ux#252: simpler, more to the point, dialog text. 2025-10-10 21:22:48 +02:00
Jehan
0fea05af78 app: indentation fixes. 2025-10-10 20:23:46 +02:00
Jehan
144ce9b897 app: fix updating sessionrc from 2.x to GIMP 3.2.
While "gimp-vectors-list" migration to newer name "gimp-path-list" was
correctly happening from GIMP 3.0 to 3.2, there is a different code path
from 2.x to 3.2 (because the scale factor update can only happen in this
latter codepath). So this part of the migration needs to be duplicated
in both update functions.
2025-10-10 19:39:14 +02:00
Jehan
432c3089fd app: fix migration of "vectors"->"path" renamed action from 2.10.
While the migration code did exist from 3.0 shortcutsrc, we need to
duplicate this for the menurc migration, in case someone were to migrate
from 2.10, 2.8 or older (i.e. installing 3.2 after GIMP 2 without having
ever installed 3.0 in-between).
2025-10-10 12:16:50 +02:00
Jehan
c392d8ea7f app: remove various layers discard action in favor of layers-rasterize.
The following actions are removed: layers-link-discard,
layers-text-discard and layers-vector-discard. The new action
"layers-rasterize" introduced previously will handle all of these.

Since layers-text-discard is the only one which existed until GIMP 3.0,
we are migrating any custom shortcut which may have been set to
layers-rasterize (both from 3.0 shortcutsrc or older menurc).

Action layers-link-monitor is also removed (in favor of layers-retrieve)
but no migration code is added, since this didn't exist in 3.0.
2025-10-10 12:16:50 +02:00
Jehan
a54e13c105 app: fix converting 2.10 menurc to 3.0 shortcutsrc.
Ugh. How did this happen?!
2025-10-10 12:16:50 +02:00
Alx Sa
0cb00e6c5b app/tests: Fix build warning on Windows
A GLogLevelFlags fatal_mask variable was
created inside an #if defined (G_OS_WIN32)
block, below a function call to
gimp_test_utils_set_gimp3_directory (). This
resulted in build warnings on Windows:
"ISO C90 forbids mixing declarations and code"
This patch adds another #if defined (G_OS_WIN32)
at the top and moves the variable declaration there.
2025-10-10 01:01:47 +00:00
Alx Sa
5539a03e2c pdb: Add PDB for text layer outline
This patch adds PDB API to get and set text outline properties,
modelled after similar API for getting vector layer stroke
settings.
2025-10-09 22:41:25 +00:00
Jehan
94568edb64 app: fix Windows-style line breaks with dos2unix. 2025-10-09 21:03:59 +02:00
Jehan
ac46ece4e3 app: make it possible to retrieve discarded vector layers too. 2025-10-09 21:03:59 +02:00
Jehan
3cafc52129 app: fix typo. 2025-10-09 20:46:10 +02:00
Jehan
1ca6faab0d app, menus: new actions layers-rasterize and layers-retrieve.
These 2 new actions are meant to be usable on all 3 types of non-raster
(and non-group) layers, i.e. link, text and vector layers, to
respectively rasterize and un-rasterize them.

This will also work with multiple selected layers, and is not specific
to one type of layers.

I also change how gimp_text_layer_discard() used to work, by marking the
text layer as modified instead of actually discarding all text
information. The main consequence of this was that a layer rasterized
this way was forever lost. Now it can actually be revived as a text
layer, not only through the new layers-retrieve action, but also by
trying to edit it with the Text tool, which will trigger the same dialog
as when a text layer had been rasterized by editing it with a paint
tool.

Whereas the label of "layers-rasterize" seem to be quite straightforward
(simply "Rasterize" per discussions in gimp-ux#252), I am really unsure
of the label for "layers-retrieve". Further UX discussions should help
on this front.
2025-10-09 20:41:11 +02:00
Jehan
42783ace78 app: also apply the no-edit on non-raster layers to text layers! 2025-10-08 23:26:24 +02:00
Jehan
5ddb853964 app: globally block editing vector and link layers.
Instead of blocking various drawable-editing tools to work on vector or
link layers, per tool (as in commits 38c379cd92 or 36330a271a), let's
have a more generic logic in GimpTool. We will now block the tool
initialization early when it's destructive and tries to work on link or
vector layers.

By default, all tools are set as being destructive, but we can override
this per-class by setting the class' is_destructive flag. For instance,
text and path tools, or the Zoom or Color picker tools, etc. are
non-destructive.
Filter tools also are non-destructive (they may be destructive, but have
their internal code to disable this path on these types of layers).

Source tools are special-cased because we may allow them to be
initialized on a link/vector layer as sources. For this special-case, I
make a second check on gimp_tool_button_press().
2025-10-08 23:21:59 +02:00
Alx Sa
221a50741a text, libgimpbase: Move text enums
This patch moves the enums for GimpTextOutline
and GimpTextOutlineDirection so that they are
accessible to plug-ins/scripts. This will allow
for us to add PDB functions to get/set text outline
properties.
2025-10-08 11:34:57 +00:00
Jehan
0ae163e43c app: fix partial canvas update when hiding or removing filter on…
… pass-through group layer.

Because of the strength-reduce pass-through to normal mode, we had case
when the effective layer mode of a pass-through group ended up to
Normal, which may shrink the effective bounding box.

Note that getting rid of the GimpGroupLayer's get_effective_mode()
(gimp_group_layer_get_effective_mode()) implementation was also fixing
this issue. I did hesitate a lot because it is also simplifying the code
a lot. But I was also wary about getting rid of the optimization
previously made by Ell (see commit fa9a023c270; note that I haven't
actually tested how efficient this optimization is).

This seems like a good compromise.
2025-10-08 01:23:07 +02:00
Jehan
6095b247be app: special-case pass-through groups' drawable area.
On empty pass-through groups, it was returning a 1×1 area, which
triggered effects with X/Y distance arguments to have no set min/max
values. For instance, a gaussian blue's X/Y scale widgets end up showing
a [0, 1.5] range, making it very impractical to set higher values.
2025-10-07 23:34:55 +02:00
Jehan
85d381bd0c Issue #15004: empty pass-through groups have no size, making it…
… impossible to use them like adjustment layers without additional step.

Even without the "adjustment layer" look-alike use case, this is wrong,
because an effect on an adjustment layer will be only applied on the
area contained in child layers, whereas by definition, a pass-through
layer would use the below render as input, and therefore its output
could be bigger than its child layers box.

I could find commit aa9ae1c65c as a culprit commit, and reverting it
would in fact also fix this issue, though by doing this, we'd regress on
the issue #4634 (I tested with one of the contributed XCF and can indeed
reproduce the bug).

Instead I return the unioned bounding box of the node, and of the
computed one. I do not feel like it's optimal, but this feels like a
complicated issue. It looks to me like there might be another deeper
issue in how both these bounding boxes are computed (not optimally!).

In any case, it also makes empty pass-through groups now usable to apply
directly an effect on the whole below render, as a side effect.
2025-10-07 23:34:55 +02:00
Jehan
f5b94bdc03 app: we also have alias links for RC releases. 2025-10-07 23:34:55 +02:00
Alx Sa
a5182a010f tools: Fix missing cursor for MyPaint Brush tool
Resolves #15001
In the MyPaint Brushes v2 port (ea8b9dc1),
I implemented a cursor_update () function from the
parent class. However, I did not call the parent's
version of the function afterwards, so the MyPaint
Brush cursor was not being redrawn. This patch
adds the call to fix the cursor display issue.
2025-10-03 22:14:52 +00:00
Øyvind Kolås
9c2c5ff183 meson, app: depend on GEGL-0.4.64 2025-10-03 23:56:36 +02:00
Bruno Lopes
f09007507f
Declare gexiv2 dependency on many targets (due to gimpmetadata.h)
Our build files were relying 'sysroot' to find gexiv2.h but this is
not possible with Apple Clang om which sysroot points to macOS SDK.
So, exotic environments like Homebrew were failing. Let's fix this.
2025-10-03 18:31:53 -03:00
Alx Sa
81c67e5614 tools: Don't commit Filter Tool without a filter
The Filter Tool is a "hidden" tool that we switch to
when applying a filter. Like other tools, it commits when
we save our image. However, we may no longer have an
active filter in the tool when we do so (like, after applying
an NDE filter). Because we check the drawable from the
filter to confirm whether we should force NDE or not,
this can cause a CRITICAL when we try to access a now
non-existent filter.

This patch extends the "if (filter_tool->filter)" check to
cover the full commit check process, to prevent the bug.
2025-10-02 12:07:25 +00:00
Øyvind Kolås
67fa72a94e meson, app: depend on babl-0.1.116 2025-10-02 13:22:29 +02:00
Alx Sa
36330a271a tools: Prevent bucket fill on link/vector layers
Resolves #14993
We currently prevent paint tools from painting on
link or vector layers. However, we had not added this
protection to the bucket fill tool. This patch copies over
the relevant if statements to prevent this.
2025-10-01 13:23:09 +00:00
Jehan
baa4825880 app: use the new release/ alias URLs for the "Learn more" link of…
… Release Notes tab.
2025-10-01 14:40:18 +02:00
Jehan
eb0bfe7bdb Issue #13553: pop an error dialog up only for specific GIO error.
This fixes 46d9a09698. There was a reason why this was not implemented
as an assert-type error nor as a user-facing error: network problems
happen.

We cannot pop an error up every time:

* The computer is offline! 😱 GIMP is not made to be run as a connected
  software and working on GIMP with a non-connected computer is a
  perfectly valid way of using GIMP.
* gimp.org is down (it's rare, but it happens and it should not have any
  impact to creators with GIMP).
* You are behind some kind of proxy or other complicated network
  configuration which GIO is not able to pass through.
* And any other reason which could make your GIMP not able to read the
  remote json file…

Instead let's check the more particular domain and error code, though
even this I hesitated between doing this change or simply reverting
commit 46d9a09698.
Indeed it's still quite a generic G_IO_ERROR_NOT_SUPPORTED error, so I
do hope we cannot get it in other normal conditions where reading a
remote link may fail. The last thing we want is GIMP popping up errors
which are neither bugs in our code, nor environment issues for which
anyone can do anything about.
2025-09-29 20:31:40 +02:00
Jehan
f4a7da1ee3 app, pdb: similar to the previous commit, but for files loaded with…
… gimp_file_load().

We make sure that the load procedure associated to the file is the one
used for the inner-file (in case of imbricated files into container
formats).

Also let's set the imported file unless it's a XCF inner format.
2025-09-29 17:46:32 +02:00
Jehan
bb9d8df855 app: make sure we only consider the inner file load procedure to…
… determine if a file is XCF.

This was kinda already working for files loaded through the GUI. Yet the
code in file_open_file_proc_is_import() was assuming a file loaded
through the file-compressor plug-in is necessarily XCF.

Even though it is the original use, the code in file-compressor is
actually generic and is able to load any supported format additionally
compressed with gz, bz2 or xz.
Furthermore, we will soon support zip-ped imaged, explicitly to support
the format .hgt.zip which is quite common (see !2483). So remove any
logic of a file loaded by file-compressor as meaning it's a compressed
XCF.
2025-09-29 17:46:32 +02:00
Bruno Lopes
789af76a32
app: Move "Documentation" link one line up over (community) "Tutorials"
Users were thinking the tutorials are some kind of official docs,
but they are not maintained as the official GIMP help website,
they are more like informal documentation about GIMP made public.

Let's clarify this reordering the buttons.
2025-09-29 07:32:12 -03:00
Bruno Lopes
46d9a09698
app: Use 'g_message' (like the help plug-in) when GVFSd-HTTP is not present
Closes #13553

Such issue tends to affect only AppImage users (e.g. when running it in
KDE installations). This is because AppImage files are not ran by
any host helper (e.g. snapd or flatpak) to connect to GVFSd and is
not possible to bundle GVFSd due to its own nature (it is daemon).

Since GVFS is listed in the INSTALL file as a required dependency, it is
fair enough to be more clear when it is not present, otherwise users will
have outdated GIMP without knowing (like happened in macOS in the past).

We are already doing this with GIMP help plug-in by the way. The
difference is that, at GIMP start, such techinical error message can
be surprising, but even so it is needed as feedback for fail on the
update check button in the end of day. Let's follow GIMP help on this.
2025-09-27 11:39:36 -03:00
Alx Sa
714e9041d8 pdb: Set choice args to default in gimp-file-load
This patch resolves the same issue as 8021b464,
but for `gimp-file-load`.
2025-09-26 23:57:51 +00:00
Jehan
24c8f86c85 app: minor indentation cleanup. 2025-09-26 23:30:37 +02:00
Gabriele
7f8298467b Issue #11869: use a custom AppMenu for macOS 2025-09-26 11:43:47 +00:00
Jehan
0af9261980 app: fix rendering background of Colormap dockable.
The rgba variable would be used uninitialized. This needs to be moved
one loop level up so that the color extracted at each cell start
position is properly reused (and also so that the full transparent color
at no-entry position is properly set and reused too).
2025-09-25 01:27:54 +02:00