Commit Graph

23739 Commits

Author SHA1 Message Date
Jacob Boerema 9ac2178e6e app: update gimphelp-ids.h
Removed several help ids that are not in use anymore.
Fixed spelling of one help id, the spelling has also been fixed in
gimp-help.
2023-01-14 16:02:03 -05:00
Jehan 24b955bf17 app, libgimp, pdb: various coding-style fixing and struct for final types…
… moved to the implementation file.

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

For the rest, it's mostly alignment bugs and the like.
2023-01-14 18:44:31 +01:00
lloyd konneker e00f2d7f50 Fix plugins to use new GimpResource. 2023-01-14 17:43:26 +01:00
lloyd konneker d59a7af38c libgimp: API refactor GUI for GimpResource
Simplifies chooser widgets (e.g. GimpBrushSelect) by eliminating attributes (e.g. opacity) of chosen resource.
See #8745, but this commit fixes that by first refactoring the code.

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

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

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

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

Fix gimp_prop_chooser_brush_new same as other resources.

Finish changes, and clean style.

Annotations
2023-01-14 16:38:40 +00:00
lloyd konneker d720375e97 2.99 libgimp: add GimpResource, GimpBrush, GimpPropWidgetBrush
So procedures can declare args and GimpProcedureDialog show chooser
widgets

Fix so is no error dialog on id_is_valid for resources

Palette.pdb changes and testing

Memory mgt changes

Gradient pdb

Font and Pattern tests

Test  brush, palette

Cleanup, remove generator

Rebase, edit docs, install test-dialog.py

Whitespace, and fix failed distcheck

Fix some clang-format, fix fail distcheck

Fix distcheck

Cleanup from review Jehan
2023-01-14 12:58:05 +00:00
Jehan 68cd873481 app: add a comment to complete !808.
It is better to add a comment rather than simply disabling these 2 calls without
explanation on macOS. This way, developers who'll look at this code in the
future will immediately know what's the reason and status for the "unicity"
concept of GIMP process on macOS. Basically there are 3 features:

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

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

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

The batch version has also been modified as it only applies if
compiled as an application, since it returns FALSE if it is complied
as a console app.
2023-01-12 17:15:48 +00:00
programmer_ceds 62e2716b21 Expand from Centre Issue (Fixes issue #7954) 2023-01-11 21:29:19 +00:00
Jehan 71605b092c app: remove definitions of gimp_image_[gs]et_active_(layer|channel|vectors).
These are not used anymore anywhere in our codebase! I'm sure some issues still
exist in various places, yet we can now consider that the multi-item awareness
project is finally over! Wouhou! 🥳

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

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

So for now, let's apply this option to both the items to align and the reference
item. We'll see if anyone wants a separate option some day and has a good use
case to submit for this.
2023-01-09 18:22:08 +01:00
Jehan 036510d191 app: when arranging an item and an ancestor item, drop the descendant.
Trying to arranging both doesn't make sense and only end up in weird result. If
both the parent (layer group) and one or several child items are selected, just
arrange the parent.
2023-01-09 18:22:08 +01:00
Alx Sa 11495ea4fd tools: Don't auto-activate when image changes
This changes the auto-activate behavior for transform and
GEGL tools so it does not apply when the image is changed.
2023-01-09 15:28:37 +00:00
Alx Sa a41ba956e6 tools: Auto-activate GEGL operation tool on click
This extends the work done in !778 to open the GEGL operation dialogue
automatically when selected from the menu, rather than requiring the
user to click on the canvas first.
2023-01-09 15:28:37 +00:00
valadaptive ea28ac0bbd app: Fix "Handle Transform" handle snap location
(cherry picked from commit d6d2e56c00)
2023-01-03 15:59:55 +01:00
Sabri Ünal 5d9f214cb8 app: Make a comment reachable
gettext cannot reach otherwise.
2022-12-30 12:43:41 +00:00
Jacob Boerema 8372220345 app: use pre-defined help id GIMP_HELP_COLORSELECTOR_PALETTE
Instead of using the string directly. This ensures that possible updates
in the string don't go unnoticed in gimp-help.
2022-12-23 13:01:11 -05:00
Jacob Boerema 469dfdcf11 app: update available help ids for gimp-help
Add several missing help ids, remove those that are not used anymore,
and update "gimp-colorselector-water" to "gimp-colorselector-watercolor".

Also add a comment why some help ids are not used directly.
2022-12-23 12:56:47 -05:00
Jehan 4acd18309a app: use our custom layer search entry with Ctrl-F in the Layers dockable.
GtkTreeView has an "interactive search" feature built-in, which basically kicks
in with the Ctrl-F shortcut by default. Let's hijack this feature and trigger
our own new search popover which is much more powerful (multi-item selection,
ability to use regexp or glob search by enabling these in Preferences, etc.).

This was an idea by Aryeom who wanted to be able to hit Ctrl-F to search for
layers.
2022-11-28 21:48:53 +01:00
Jehan 3795afefa5 app: GIMP_TIMER_START|END are no-op on release builds.
These are typically debug outputs and we don't want them to appear on stderr of
release builds. They confuse people (some tester would report these on IRC when
we last release GIMP 2.99.14).
So let's not show these debug text on release versions.
2022-11-28 20:59:30 +01:00
Jehan 2912552263 app: make the "Anchor" tooltip depending on whether we are floating over…
… a layer or a layer mask.
2022-11-28 20:43:56 +01:00
Lukas Oberhuber e62f00ad4e macos: support MacPorts
This provides MacPorts support which is now the official way that
the MacOS port is built and packaged.
2022-11-22 14:36:22 +00:00
Jordi Mallach 1aec2281f5 Increase the timeout of tests from default 30s to 60s.
Some slower architectures hit the timeouts and fail their build.

See
https://buildd.debian.org/status/fetch.php?pkg=gimp&arch=armel&ver=2.99.14-1&stamp=1669046159&raw=0
for an example of a failed build.
2022-11-22 10:01:44 +01:00
Alx Sa cc3f7afb04 tools: auto-activate transform tools on canvas
This removes the need to click the canvas after selecting a transform
tool before you can start working on the transform.
2022-11-13 17:52:25 +00:00
Øyvind Kolås 06b481a3ec meson, configure, app: depend on babl 0.1.98 2022-11-13 17:31:32 +01:00
Øyvind Kolås b85032d8b6 meson, configure, app: depend on GEGL 0.4.40 2022-11-13 17:16:49 +01:00
Jehan 143496af22 app, menus, pdb: new "Paste as Single Layer( in Place)?" actions.
When the clipboard contains raw image data or single layers, it's the same as
the normal "Paste" (and "Paste In Place" respectively). These actions are useful
if you want to copy a bunch of layers and paste them "merged" into a single
layers (since now the copy-paste of multiple layers will create multiple
layers).
It is somehow similar to the "Copy Visible" action except that it works on
selected layers only and work at paste time, making the action more versatile.
2022-11-12 22:34:51 +01:00
Jehan fc050914ab app, menus, plug-ins: move some advanced paste actions into submenu.
There are so many paste options and I feel that the "Paste into Selection*"
actions are advanved enough that they can go into submenus. So I move them into
"Paste as". The other reason is that I'm going to add 2 more options!

I hesitated to rename the "Paste as" submenu but we couldn't find a good naming
(except just "Paste" but it's redundant with the default action and "Paste…" but
this usually implies a dialog, not a submenu).

Last but not least, I renamed the various paste actions to contain the word
"Paste" in it. E.g. s/New Image/Paste as New Image/. The old naming made sense
when action labels were only displayed in menus. But nowadays they can be shown
in other more independant context, such as the action search (and just
displaying "New Image" in there is very misleading).
2022-11-12 22:34:36 +01:00
Jehan 92cc33d52a app: fix a use of gimp_edit_paste().
When dropping a buffer, we just consider it like common data pasting, hence we
leave the GIMP_PASTE_TYPE_NEW_LAYER_OR_FLOATING algorithm decide what type of
paste it will be.
2022-11-12 19:07:47 +01:00
Jehan 9a2f5b0709 app: rework and fix the logic for copy-pasting multiple drawables.
There were a lot of incertainty of what should happen when we copy layers being
descendant of each other (i.e. when you select a group layer and some of its
children), then when you paste such data. So we sat down with Aryeom and tried
to come up with some consistent behavior which is somewhat expectable, but also
which would allow the most use-case.

Otherwise it was making very weird result when pasting the data, duplicating
some layers and whatnot, which was obviously a buggy behavior and never the
expected result.

We decided that if you select one leaf item, then even if you also selected a
parent item, it would be as though the parent was not selected. This is very
often what you expect anyway when you select a whole bunch of layers and would
work well if, say, you shift-click over many layers in sub-groups. Then you
wouldn't have to manually ctrl-click to unselect every group.

Then what if you were instead expecting to copy many groups? Then you could
shift-click the group arrow, closing all same-level groups. Once they are all
closed, you can shift-click the groups to only select group layers, not their
contents.

This way, both use cases are still quite doable easily with this default choice.
2022-11-12 18:28:58 +01:00
Jehan 18c5b39cf5 app: copying from selection creates layers the size of the selection.
After further discussions with Aryeom, we had to make decisions about a few
problems. The main problem was: what happens when we copy a selection of a layer
whose bounds don't intersect with the selection?

The silent treatment of discarding the layer was not acceptable, because e.g. it
could happen on huge set of selected layers (like say you copy 100 layers with a
selection: you expect 100 created layers and if you realize you don't have them
all — e.g. you have 99! — after hours of work, trying to find the missing one
can be a huge time loss).
The status bar notification (or even error) did not feel right either because
this can typically be missed easily. Also it doesn't give a lot of feedback
(e.g. you might want hint to find the non-intersecting layers, in case it was
not supposed to happen).
An error box was even considered, possibly proposing to ignore the problematic
layers, or even giving easy ways to find them.
Finally what if we let the selection happen regardless the non-intersecting
layers? What should the dimension and offset of said layers be?

In the end, we went with the more consistent behavior of always creating new
layers of the exact same size as the selection. It can be considered as a rule
which would make the behavior predictable. For the non-intersecting layers, we'd
just have new layers with the dimension/offset of the selection bounding box,
and no contents. For other layers, they'd be also this same dimension, possibly
increasing the dimension of the source layers (though any new pixel is fully
transparent obviously). Aryeom wondered if some people might absolutely need for
their workflow that the new layers stick to the origin bounding box. But we felt
it was enough of a stretch that we'd try this way for now.

Note: of course if some day we get infinite canvas/layers, this whole discussion
could be less of a problem anyway! This was Aryeom's conclusion! Ahahah!
2022-11-11 00:04:38 +01:00
Jehan 363facef5e app: fix one case in gimp_edit_paste_get_top_item().
I was forgetting to store the path for the first item, which in particular was
making a problem when the top item was the first one in the list.
2022-11-10 23:29:23 +01:00
Jehan 1b64fdf52d app: pasting selection from multiple layers should still create multiple layers.
This is also work-in-progress for better copy-paste handling for multi-items.
Until now, I had decided that, if a selection existed, a copy would copy a
merged version of the selected items. But sometimes you want to have a piece of
each layer, each piece in its own layer. Also you may always merge the pasted
layers afterwards.

So now we will indeed create as many layers out as there are layers in. Being
able to copy a merged down version of all selected layers is still an
interesting feature though. We might add a dedicated "Copy Merged" action,
similarly to the fact we have a "Copy Visible" (which does the same thing but
for all visible layers, not specifically the selected ones).
2022-11-10 22:49:47 +01:00
Jehan bd186d56ee app: fix position of pasted data.
Position of pasted image data was getting very bad lately, especially with the
multi-item selection logic which confused the hell out of the legacy algorithm.
So I reviewed it a bit, in light of the multi-item abilities, as well as the
recent no-floating-selection paste changes.

One of the particularly wrong paste position was when pasting one or several
pieces (through selection) of existing layers. The positionning was really bad
and sometimes even off-canvas (which was explicitly forbidden by the algorithm,
except it was broken now).

Now the behavior is much more reliable and consistent, by centering on viewport
or on target drawables. If there are several such targets, their bounding box is
used as target position (and the bounding box of all source drawables is also
used now). An interesting consequence of this is that copy-pasting quickly
without removing a selection paste "in-place" since the target this time will
use the selection bounding box.

Aryeom and I are doing some work on specifying copy-paste (based on existing
logic, we tried not to disrupt too much years of logic, but also keeping
consistency and new logic for recent changes, such as multi-items). It will all
be written down into the GIMP developer website, section "Specifications".
2022-11-10 22:49:47 +01:00