Commit Graph

2687 Commits

Author SHA1 Message Date
Jehan af5612eda2 Issue #3834: keys Copy, Cut and Paste now supported as secondary shortcuts. 2023-04-12 22:07:09 +02:00
Jehan ab33d032ad app: support Forward and Back keys.
Same as ZoomIn/Out keys, these are implemented as secondary shortcuts to actions
"windows-show-display-next" and "windows-show-display-previous" respectively.

See issue #637.
2023-04-12 22:07:09 +02:00
Jehan 9e8304aeb9 Issue #637: support ZoomIn and ZoomOut special keys.
These will simply be recorded as secondary shortcuts for view-zoom-in and
view-zoom-out.
2023-04-12 22:07:09 +02:00
Jehan 71c8ff1f21 app: change all action entry structs to allow several shortcuts.
- The `accelerator` variable is a NULL-terminated array, allowing up to 3
  accelerators per action (so far, none has more than 2).
- Only the struct GimpProcedureActionEntry still has a single accelerator as I
  don't think it makes sense that we change the plug-in API to allow a plug-in
  to register more than 1 shortcut for a procedure (e.g. we don't want a plug-in
  to just register all possible keys for their procedure!).
  Of course, users will still be allowed to register more shortcuts for plug-in
  actions through the shortcut dialog. It's only the initialization which
  1-shortcut max for procedure actions.
- Remove all actions ending up in "-accel" as these were only a trick to
  register more shortcut for a same action. Now we just have the real
  possibility (rather than creating bogus duplicate actions). As a consequence,
  these actions accelerators have been moved as secondary accelerator to their
  main action.
  The deleted actions are: "view-zoom-out-accel", "view-zoom-in-accel",
  "view-zoom-16-1-accel", "view-zoom-4-1-accel", "view-zoom-2-1-accel" and
  "view-zoom-1-1-accel".
2023-04-12 22:07:09 +02:00
Jehan e724a9bff3 app: GimpActionGroup is not a GtkGroup anymore, but a GimpObject descendant!
I've hesitated if we should make it a GActionGroup, whose API handles actions
fully through name strings. I didn't see what it brings us short-term compared
to the additional work, so for now it's just a class of its own, not
implementing GActionGroup interface. Maybe later.
2023-04-12 22:07:09 +02:00
Jehan 38d0abc026 app: prevent multiple registrations of a same action.
Pre-GIMP-3.0 code logics would re-allocate several GimpMenuFactory or
GimpUIManager for no good reason. While it was still working with old GtkAction
code, with our new GAction-based code, we were ending up overriding an action
with a new version of the same action, while keeping reference to old actions.
This made for discrepancies of the enabled or visible state of actions.

The new code keeps singleton of some objects and references to already
registered GimpUIManager or GimpActionGroups objects and make sure no actions
with the same name are created twice.
2023-04-12 22:07:09 +02:00
Jehan 4251c931c7 app, menus: big cleanup of most of GtkUIManager API.
Only remaining API are action group-related.

While doing this, I also remove 2 debug actions which don't look like they were
outputting any information anyway (at least on the main dev branch):
"debug-dump-items" and "debug-dump-managers".
2023-04-12 22:07:09 +02:00
Jehan 2335e14d59 app: add the gradient editor submenu and a new concept of GimpRadioAction's…
… group name.

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

Instead I add the concept of group name for GimpRadioAction-s and when I use a
radio action attribute as <submenu>, this submenu will use the group name (and
sync with it, if it changes).
2023-04-12 22:07:08 +02:00
Jehan 9f1fd64a41 app: GimpRadioAction is now a subclass of GimpRadioAction.
We now completely got rid of all GtkToggleAction and GtkRadioAction code in the
whole of GIMP!
2023-04-12 22:07:08 +02:00
Jehan d73337680d app: rename the dynamic label for the "file-open-recent-*" actions.
While in the menu, under a contextual "Open Recent" submenu, it is well
understandable, the action is much less understandable without context, e.g. in
the action search. So I prepend an "Open" prefix.

Maybe a future alternative could be to have GimpAction have both contextual and
non-contextual labels (a.k.a. short vs long label)?
2023-04-12 22:07:08 +02:00
Jehan febb9dccd6 app: fix default values of 2 actions.
"windows-show-tabs" and "windows-use-single-window-mode" were set to FALSE by
default, while it is now supposed to be TRUE, same as the config properties. The
discrepancy was only showing with my new GimpMenu which better follows the
action's state.
2023-04-12 22:07:08 +02:00
Jehan a98a903976 app: get rid of gimp_action_(g|s)et_accel_path(). 2023-04-12 22:07:08 +02:00
Jehan 68d862b3c2 app: fully get rid of gimp_action_get_accel_closure().
All the remaining pieces of code where the deprecated concept of accelerator
closure was still used have now been replaced by proper GimpAction API using the
newer GAction API.
2023-04-12 22:07:08 +02:00
Jehan fd7ec4df6a app: make sure the "%s-move-to-screen-%s" have valid action names.
Depending on the OS, the display name may contain characters which are not valid
for action names. In particular, on X11, the display name could be ":0.0" and
therefore we get actions named "app.dock-move-to-screen-:0.0" or
"app.view-move-to-screen-:0.0". The ':' is invalid, which will make calling
gtk_application_get_accels_for_action() (or more simply our new function
gimp_action_get_accels()) fail.
See docs of g_action_parse_detailed_name().
The new utils function gimp_make_valid_action_name() will help us get rid of
invalid characters for actions whose name was generated from strings we don't
totally control.

Furthermore gdk_screen_make_display_name() is now deprecated API, and more
generally gdk_display_get_n_screens() is deprecated too and now always returns 1
since GTK+ 3.10 (i.e. now each display only contains a single screen). Instead
we just use gdk_display_get_default_screen() for every GdkDisplay. So this
commit doubles as GTK/GDK deprecation cleanup.
2023-04-12 22:07:08 +02:00
Jehan ae7ddfd5f5 app: better label the "windows-display-[0-9]*" actions.
Adding a 'Show" before the image identifier, which is now between quotes, and
making this string localizable.
This makes the action more understandable, especially when listed in
less-contextual UI such as the action search.
2023-04-12 22:07:08 +02:00
Jehan 726e690d38 app: make the GimpContext a mandatory property for a Gimp*Action.
Making the action be context-awareness will be useful, in particular as we'll
have access to the GtkApplication.
2023-04-12 22:07:08 +02:00
Jehan c8845c95ec app: move more of GimpActionImpl code into GimpAction. 2023-04-12 22:07:08 +02:00
Jehan a4e7bfdf23 app: rename "layers-mask-add-last-values" action as …
… "Add La_yer Masks with Last Values".

Add the "with Last Values", otherwise the shown label is the same as
"layers-mask-add" action, which is confusing (until we read the longer
description/tooltip).
2023-04-12 22:07:08 +02:00
Jehan dfcc339e15 app: fix non-properly matching gimp_image_undo_group_start/end() calls. 2023-04-12 22:07:07 +02:00
Alx Sa faf2be6dff actions: Standardize usage of "Soft-proofing"
Per #9269, every UI in GIMP but the Softproof Profile wrote it as
"Soft-proof". Now all menu options are consistent.
2023-04-04 17:46:21 +00:00
Jehan 508a6351c9 app: fix a call to gimp_edit_paste() (fixing buffers-paste* action). 2023-04-04 01:56:20 +02:00
Alx Sa 66271e1e56 actions: Disable Arbitrary Rotation menus if...
...no image is active.
There are Arbitrary Rotation options under both the Image and Layer
menus. All of those rotation options are disabled without an image open.
To keep consistency, this disables those menu options as well.
The Tools menu Rotation option is left as-is.
2023-03-07 20:45:48 +00:00
Jehan 473f0b49ef app: better handle bogus file names.
When a plug-in enters a bogus file name such as "Untitled.xcd" as URI,
g_file_is_native() returns FALSE. So when saving such file, core code tries to
mount a remote volume and fails (of course), without even opening the file
dialog.

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

As side fix, I am adding a missing space to the error which I got.
2023-02-13 22:57:09 +01:00
Jehan 19cb236955 Issue #8073: Crop can also be an extend.
Rename "Crop to Selection" to "Resize Layers to Selection" since it's not
necessarily a crop. The layer dimension can also grow now.

Also specifying "Layers" because action titles can also be displayed
off-context, such as in the action search, so we must be more detailed with our
action titles. Similarly adding a "Layers" to "Crop to Content".
2023-01-24 18:54:29 +01:00
Jehan ba5c423331 Issue #8924: Paste as new image uses the full canvas instead of just…
… the copied selection.
2023-01-24 12:51:30 +01:00
Jehan 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 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
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
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 3453c8bd55 app, pdb: paste layers over the top selected drawable.
When several drawables were selected, it was pasting at the top of the layer
stack. Instead, paste over the top selected layer ("top" visually in the Layers
dockable).

There was the question of: what should we do when pasting over a layer group.
Should we consistently paste the new layers above the group or inside the group?
After discussions with Aryeom, we decided to stay consistent and paste above, at
least for now.
2022-11-09 17:22:35 +01:00
Alx Sa 2c4f91f585 app: Paste as new layer by default
This changes the default selection pasting behavior to be a new layer,
rather than a floating selection. It also removes the
"Paste as New Layer" submenu options as they are now redundant.
2022-11-09 00:31:00 +00:00
Jehan f6dd7f9b3a app: get rid of return_if_no_drawable() macro and…
… gimp_image_get_active_drawable() function!

Also fixing some memory leaks from previous usages of the multi version
return_if_no_drawables().
2022-11-09 01:24:34 +01:00
Jehan 831cb91303 app: remove gimp_image_get_active_drawable() usage in colormap actions. 2022-10-20 23:17:07 +02:00
Jehan 48bebb8a27 app: replace one more usage of gimp_image_get_active_drawable(). 2022-10-19 15:14:14 +02:00
Jehan 74b4951e50 app: remove a gimp_image_get_active_drawable() in select actions.
The action "select-float" should probably only work for a single selected
drawable anyway since a floating selection can only be stacked on one drawable
at a time.
2022-10-19 15:09:38 +02:00
Jehan 6716d06aa1 app: remove one more gimp_image_get_active_drawable().
Actions "vectors-fill*" and "vectors-stroke*" require a single drawable to paint
to. So action logic is unchange. I only replace gimp_image_get_active_drawable()
by gimp_image_get_selected_drawables() and counting the drawables.
2022-10-18 22:36:24 +02:00
Jehan 6eb78ca11f app: remaining drawable actions are now multi-layer aware. 2022-10-18 22:19:44 +02:00
Jehan 85adfb46c8 app: make "drawable-lock-content|position" multi-drawable aware. 2022-10-18 22:06:21 +02:00
Jehan cff1ae4176 app: remove one more usage of gimp_image_get_active_vectors().
For "text-tool-text-along-path", it makes sense to keep it only usable when a
single path is selected.
2022-10-18 16:35:59 +02:00
Jehan 0508148580 app: get rid of one more usage of get_active_item() abstract method. 2022-10-12 22:38:35 +02:00
Jehan 9fc8260c7c app: "vectors-copy" and "vectors-export" are now multi-paths aware. 2022-10-12 22:13:38 +02:00
Jehan fde780daeb app: "vectors-(raise|lower)*" actions now multi-paths aware. 2022-10-12 21:45:13 +02:00
Jehan 2835e85950 app: make the "vectors-select-*" actions multi-selection aware. 2022-10-12 21:21:22 +02:00
Jehan c804865ddd app: new "tools-paint-select-pixel-size-set" action.
Also ensure that the outline circle is redrawn while changing the
outline size.
2022-08-17 14:20:18 +02:00
Jehan 67d5e59ffb app: new "tools-warp-effect-pixel-size-set" pixel size set action. 2022-08-17 14:20:18 +02:00
Jehan ebf99132eb app: create a new pixel-size-set action for Ink and Brush tools.
Once this is done, I got rid of the ugly hack I added over the already
ugly hack used on "*-set" enum actions.
2022-08-17 14:20:18 +02:00
Jehan c7979e7f06 app: new double action "tools-mypaint-brush-pixel-size-set", used as…
… new action_pixel_size of GimpMyBrushTool.

MyPaint brush tool clearly shows the limits of my trick to have some
enum actions work with absolute values whereas others work with
per-mille values between the property min and max.

Indeed firstly MyBrush's "radius" value is logarithmic and can be
negative. Since the enum trick relies on the fact that negative values
are the semantic enumerated constants, it's broken in such case. The
second issue is that while it was acceptable to use int size for most
paint tools (even though they were double), here radius only goes from
-2.0 to 6.0; so using int values only would leave us with jumping brush
sizes.

So now I create a proper double action which simply takes pixel size and
use this from the on-canvas brush size changing. No weird trick, no int
or sign limitations.
I also add a new optional action_pixel_size in GimpToolControl.

Note: I'm also updating a bit the logic for the MyPaint brush outline
function gimp_mybrush_tool_get_outline(). Indeed after skimming a bit
through mypaint-brush.c code in libmypaint, I am not sure at all we need
to use the offset_by_random like this. And really this shown outline
seems more indicative than anything else when I see the actual size
printed by the various brushes. Finally here it was counter-productive
as I needed to get easily the logarithmic radius from the pointer
interaction on canvas.
2022-08-17 14:20:18 +02:00
Jehan 59709d348c app: distance moved on-canvas set the ink tool size as well. 2022-08-17 14:20:18 +02:00
Jehan 43f0147bfe app: allow to change the brush size on alt-right click.
I started from mitch's patch (though code changed so it was not working,
yet I ended up with quite a different direction).

Modified from original proposition in #498:

* Do not mix opacity and brush size in a same action, one on horizontal
  movement, the other on vertical. The problem is that it's hard to stay
  perfectly horizontal or vertical, so you nearly necessarily change one
  while changing the other and this would be frustrating.
* Do not just use modifiers, but modifiers + right click. The logics is
  that left (or whatever is the first button) click is for the tool
  actions. The middle click for navigation (panning, rotation, and even
  layer navigation now). Right click for now is only for menu. With this
  change, let's use right click for various settings-related changes
  too. Also we already have people complaining with things like canvas
  rotation happening unexpectedly even though it requires button clicks.
  Imagine an action just made of modifiers! Many people would hit these
  by mistake all the time!
* Focus on brush size only for now. Instead of just calling the action
  repetitively with the "SElECT_NEXT" action as proposed in the original
  patch by mitch, let's compute the actual size between the press and
  release. This would allow to have a real visual hint and also would
  make it a lot more useful and meaningful to be an on-canvas change.
  Say you want to reproduce a stroke size on canvas. You can click the
  center and expand to retrieve approximately the size without computing
  it in pixels.

Limitations and future work:

* This is a first draft and I still want to test if it works well with
  the "lock brush to view" and with scale factor > 1.
* I want to associate this with work done for #7034 so that visual hint
  still appear even when we have no visual hint set.
* I am not so fond of with the way we use enum actions which doesn't
  really make satisfying logics (I hacked a bit over it, but it's
  getting ugly). I'm considering creating int/double actions to really
  set some values with exact numbers through actions.
* Right now we need to stop the right click first. I want to be able to
  stop the brush sizing with releasing Alt too.
* It would be nice to make this all more customizable, which is why I
  called internal variable "mod1_setting". The goal will be to have
  other types of actions possibly. Also it could be deactivatable for
  people really not liking these or hitting these by mistake (while not
  needing these). Same for the navigation shorcuts.
* Similarly the right-click menu could be deactivatable or switched to
  other actions conditionally (through Preferences). It is doubtful how
  useful it is (compared to using the same menus on top of the GUI)
  though I don't want to just delete the option because some people
  would clearly be used to it.
* I think we should start breaking down the whole tool events code a bit
  more, in particular the function gimp_display_shell_canvas_tool_events().
* For more settings, a small on-canvas GUI could be of interest where
  you could customize various values through sliders and buttons, and
  also where you could put your favorite brushes or dynamics or whatnot.
  It's not replacing the more complete dockable but could be a nice
  quick version for fast editing.
2022-08-17 14:20:18 +02:00
Alx Sa 0587a10543 core: Add simulation intent and BPC to GimpImage
Adds a simulation_bpc and simulation_intent to GimpImage to allow 
plug-ins to access it
for CMYK import/export.
Four pdb functions were added to enable this access:
image_get_simulation_bpc (), image_set_simulation_bpc (), 
image_get_simulation_intent (), and image_set_simulation_intent ().
Next, it updates menu options and code to support GimpImage's
internal simulation intent and bpc.
New 'simulation-intent-changed' and 'simulation-bpc-changed signal 
are emitted via
GimpColorManagedInterface so that relevant tools 
(such as the
CYMK color picker, GimpColorFrame, and future pop-overs)
 are aware of these changes.
2022-08-13 19:39:47 +00:00
Povilas Kanapickas ae3c4c3577 widgets: Implement zoom focus in gradient editor
Zoom focus centers the point that we're zooming into at the location of
the mouse pointer.

Default zoom focus value is 0.5 which results in previous behavior.
2022-08-06 16:28:50 +00:00
Jehan 26a3a600e3 Issue #7890: Filter commands Repeat and Re-show last plug-in don't…
… work when no image is loaded.
2022-07-21 01:32:37 +02:00
Jehan 81b569cb8c Issue #8124: plug-in localization now totally moved plug-in side.
Plug-in localization was always partially plug-in side, especially for
things like custom GUI. But labels or blurb in GIMP (such as in menus or
action search) were localizing GIMP side.

It had many drawbacks:

- To get menu localization, a plug-in had to set up gettext, even though
  they might want to use something else for their GUI (after all, giving
  facilities for gettext is a good idea, but there is no reason to force
  using this system).
- There was a complex internal system passing the localization domain
  name, as well as the catalog file system path to core, then through
  various classes which we can now get rid of.
- There could be domain name clashes, if 2 plug-ins were to use the same
  i18n domain name. This was handled in now removed functions
  gimp_plug_in_manager_get_locale_domains() by simply keeping a unique
  one (and gimp_plug_in_manager_bind_text_domains() would just bind the
  domain to the kept directory). In other words, one of the duplicate
  plug-ins would use the wrong catalog. We could try to make the whole
  thing more complicated or try to forbid plug-ins to use any random
  name (in particular made easier with the new extension wrapper). But
  anyway this whole issue doesn't happen anymore if localization is
  fully made plug-in side, so why bother?

I tried to evaluate the advantages of the core-side localization of
plug-in labels/blurbs and could only find one theoretical: if we wanted
to keep access to the original English text. This could be useful
(theoretically) if we wanted to search (e.g. in the action search) in
both localized and English text; or if we wanted to be able to swap
easily en/l10n text in a UI without reload. But even if we were to ever
do this, it would only be possible for plug-ins (GEGL operations in
particular are localized GEGL-side), so it lacks consistency. And it's
unsure why special-casing English should really make sense for other
language natives who want text in their lang, and search in their lang.
They don't necessarily care about original.

So in the end, I decided to simplify the whole thing, make localization
of plug-ins a plug-in side thing. Core will only receive translated text
and that's it. It cuts a lot of code out of the core, simplify runtime
processing and make plug-in creation simpler to understand.

The only think I still want to look at is how exactly menu paths are
translated right now. Note that it still works, but it's possible that
some things may be worth improving/simplifying on this side too.
2022-07-05 12:22:32 +02:00
Alx Sa 0d7fed93ae core: Add softproof profile to GimpImage
Adds a simulation_profile to GimpImage to allow plug-ins to access it
for CMYK import/export.
Two pdb functions were added to enable this access:
image_get_simulation_profile () and image_set_simulation_profile()
Next, it updates menu options and code to support GimpImage's
internal simulation profile. Menu items are moved from View to Image's
Color Management section.
New 'simulation-profile-changed' signal is emitted via
GimpColorManagedInterface so that relevant tools (such as the
CYMK color picker, GimpColorFrame, and future dockable
dialogue) are aware of these changes.
2022-07-02 15:26:19 +02:00
Jehan 95abf39066 app, libgimp: reverse internal l10n logic of plug-in labels in core app.
I hesitated a lot whether we should just drop the whole localization of
plug-ins' label and description (blurb) within the core. Actually the
commit messages I wrote a few days ago were moving towards this logic.
It really looks to me like plug-in localization can happen fully within
plug-in themselves. As far as I can see, the only advantage which the
current logic has theoretically is that if we needed, we have access to
both the original strings and their translations (e.g. it could be
useful for text search). Nevertheless I am not sure if we will ever make
use of this, and this is limited cases as all filters turned GEGL ops
don't have such ability anyway.

Nevertheless since previous contributors clearly put quite a lot of work
on this code of localizing the plug-in's label and description within
the main binary, I want to give myself a little more time to think and
study the whole thing because doing anything rash.

In the meantime, what changes is that by default now, a plug-in without
a local gettext catalog is simply not localized. In particular, the core
process doesn't try to localize it using the default catalog, a.k.a.
GETTEXT_PACKAGE"-std-plug-ins" ("gimp30-std-plug-ins"). It just doesn't
make sense and the worst which could happen would be to get unexpected
and wrong translations.
Now by default, plug-ins will try to find a catalog in their main
folder, named as this folder. If it fails to find it, a message is
printed to stderr and localization is disabled (rather than falling back
to a default catalog). It is up to plug-in developers to either install
a catalog, or implement set_i18n() to give the right catalog, folder, or
disable localization with gettext, as handled by libgimp.
2022-06-05 01:57:02 +02:00
Ben Rogalski d90b84ba9d Custom transparency checkerboard colors
Reviewer (Jehan) note: cherry picked from MR !274. Still deciding
whether this will be pushed to gimp-2-10 branch too.

Fixed Conflicts from !274:
	app/dialogs/preferences-dialog.c
	app/display/gimpdisplayshell-draw.c
	app/plug-in/gimppluginmanager-call.c
	libgimp/gimp.c
	libgimp/gimp.h
	libgimpwidgets/gimppreviewarea.c
	libgimpwidgets/gimppreviewarea.h
	libgimpwidgets/gimpscrolledpreview.c
2022-05-14 16:27:15 +02:00
Claude Paroz a6d59a9b68 Fixed text along path error message 2022-04-15 17:25:20 +02:00
Jehan 62a76d7856 app: new welcome dialog to appear only at first launch after a new…
… installation or an update.
2022-02-22 12:23:46 +01:00
Jehan 2e64bfc61b app: allow "Lock alpha" to be set on layer groups.
It can be argued that layer groups can't be painted on, and that's
probably the original reason, but it's really just the same as "Lock
pixels". It is interesting to be able to lock alpha channels on a layer
group to simply lock all its contents alpha channels.
2022-02-15 22:08:23 +01:00
Jehan ed59344406 app: allowing to "Lock position" on layer groups.
Since we are now allowed to move groups (which is the same thing as
multi-selecting all its children and moving them), it makes no sense
that this lock is disabled.

This works the same way as "Lock pixels" in that a locked grouped also
forbid moving children. And there was already some logics so that you
can't move a layer group if one of it's children is locked. So this lock
really works both ways and is a bit special.

Finally I cleaned up a bit the multi-layer selection logics and
messaging, as well as which lock to blink (similar to the previous
commit) for the "Lock position" case.
2022-02-15 22:08:23 +01:00
Jehan e72f5614da app: properly blink the right locked layer when pixels are locked.
In particular, if painting on a layer whose parent's pixels are locked,
we were blinking an empty lock spot, which is confusing. Now
gimp_item_is_content_locked() will also return the proper item (when
relevant, i.e. when returning TRUE) which is locked. It may or may not
the same item as passed in (it may also be a parent item in particular).
2022-02-15 22:08:23 +01:00
Jehan cef6737d86 app: plural is expected here with multi-layer selected support.
Thanks to Anders Jonsson for noticing.
2022-02-12 18:55:56 +01:00
Jehan 849bd0ac47 app: new "context-dynamics-toggle" action.
As the name implies, this is an action to toggle the paint dynamics ON
and OFF which can be a huge time saver when painting and needing to
switch between dynamics and non-dynamics painting.

I have not been adding this action in the "dynamics-action" group
because these are only used for the dynamics dockable menu. Also it
looks like the context actions are not visible in the action search (I
can't recall why, but I think there was a reason), yet you can still set
a shortcut.
Should we create a new "paint-action" group maybe?
2022-02-04 15:12:00 +01:00
Jehan 084906dbf1 app, devel-docs, libgimp, pdb: remove gimp_item_set_linked().
I cleaned many remaining places where the concept of linked item still
survived.
On loading an XCF file with linked items, we are now going to create a
named sets for the linked items, allowing people to easily select these
back if the relation was still needed.

We don't remove gimp_item_get_linked() yet and in particular, we don't
save stored items into XCF files. This will come in an upcoming change.
2021-12-23 13:45:20 +01:00
Jehan 2ce84b5245 app, devel-docs, libgimp, pdb: delete gimpitem-linked.[ch].
Getting rid of the last usage from these files dedicated to outdated
item link concept.
2021-12-23 13:45:20 +01:00
Jehan 26615fde92 app, devel-docs, libgimp, pdb: now removing gimp_item_linked_rotate(). 2021-12-23 13:45:20 +01:00
Jehan 26d696ce9d app, devel-docs, libgimp, pdb: remove item link ref in flip code.
"Item links" concept is no more in the GUI so we are progressively
removing reference and implementation of this in the core code.
2021-12-23 13:45:20 +01:00
Jehan a6dccf5c2f app: fix icons for the "*-lock-*" actions.
Now that we have dedicated icons made by Aryeom!
2021-12-23 13:39:43 +01:00
Jehan d9846ac9dd app: get rid of all "*-linked" actions.
I.e.: "layers-linked", "channels-linked", "vectors-linked" and
"drawable-linked".
2021-12-23 13:39:43 +01:00
Jehan 9d23216566 app: remove the "Linked" switch from the item options dialog. 2021-12-23 13:39:42 +01:00
Jehan 5c63c2478f app: duplicate and delete channel actions multi-channel aware. 2021-12-23 12:55:11 +01:00
Jehan 718177b8bc app: raise/lower channels one step or to top/bottom multi-channel aware. 2021-12-23 12:55:11 +01:00
Jehan fcd59784e0 app: improve "Select Top|Bottom Layer" actions.
Similarly to how I improved "Select Top|Bottom Channel", we should set
the actions sensitive not only when the selected layers are not the
top/bottom ones, but also when there are no selected layers at all.
2021-12-23 12:55:11 +01:00
Jehan 8d38b72446 app: channel selection actions now multi-channel aware. 2021-12-23 12:55:11 +01:00
Jehan 566e55e72e app: "Bend the text along the currently active path" multi-layer aware.
It still only requires one single path selected to work, but I updated
the internal API used.
2021-12-23 12:55:11 +01:00
Jehan 58302ee332 app, pdb: get rid of various gimp_image_get_active_channel().
Replace them with gimp_image_get_selected_channels().
2021-12-23 12:55:11 +01:00
Jordi Mas 6aaa017d34 Remove unnecessary space at the end of the string 2021-09-28 10:42:58 +00:00
Jehan 15fb4a7be0 Issue #1168 - Allow resetting rotation view and flip view separately.
Action "view-rotate-reset" renamed to "view-reset" (resets both flipping
and rotate). New "view-rotate-reset" and "view-flip-rotate" for
resetting rotation and flipping respectively.
2021-08-23 15:46:11 +02:00
Jehan 62827563c4 app: unref the newly created GVariant-s.
I first sink these, because they are floating references. This is
actually quite unneeded here, because callbacks given to
gimp_action_group_add_procedure_actions() (this is what
filters_history_cmd_callback() is for) are not taking ownership of the
GVariant anyway. Yet just in case this ever changes, this is the proper
way to do it to avoid a double-free in the future. We take ownership in
the calling code, hence we free the variable there after using it.
2021-08-22 11:32:59 +02:00
Jehan 9a0876b9bd app: forgotten GList freeing.
Thanks to Massimo for the report.
2021-08-21 19:06:14 +02:00
Jehan 0359427756 app: allow image_merge_layers_callback() to be called with NULL dialog.
This function is not only used as "response" callback to the merge
dialog, but also called directly with a NULL dialog in
image_merge_layers_last_vals_cmd_callback().

This commit fixes:
> (gimp-2.99:130330): Gtk-CRITICAL **: 22:17:59.774: gtk_widget_destroy: assertion 'GTK_IS_WIDGET (widget)' failed

Reported by Massimo.
2021-08-16 22:20:07 +02:00
Jehan 968cc3c758 app: free unused return value of gimp_procedure_execute().
Another leak reported by Massimo.
2021-08-16 19:08:40 +02:00
Jacob Boerema 42fe8abc98 app: fix #5153 keyboard shortcuts Shift+[ and ] don't work on most keyboards
On most keyboards the [ and ] keys are shared with { and }. Which means
that if you press Shift+[ you get {. We were using this key combination
to increase the tool's size by 10 and the other to decrease it by 10.

However, on all keyboards where these keys share the same physical spot
on the keyboard, this wasn't working.
So, let's change the actual keys to do this to { and }.
2021-07-28 13:38:26 -04:00
Jehan f8f768c077 app: adding a comment for translators.
As per comment by Alexandre Franke, so that translators are aware this
is not about a "map" like a "world map", but like "mapping" filters.

Cf. https://gitlab.gnome.org/Teams/Translation/fr/-/issues/17#note_1209282
2021-07-22 17:11:16 +02:00
Jehan ef2402bf8e app, libgimp, pdb, plug-ins: allow pasting multiple full layers.
When a selection exists, we are copying then pasting the selection
contents. In particular, with multi-layer selection, it means pasting a
merged result of the selected layers (like a sample merged but limited
to selected layers).

Yet when no selection exists, with a single layer selected, a cut in
particular would remove the layer fully, then a paste would copy it
elsewhere (in the same image or even on a different image). This was
still working, but not with multiple layers. This is now fixed and we
can now copy/cut then paste several layers (without merge), which is
sometimes a very practical way to move layers (sometimes simpler than
drag'n drop, especially between images).

As a consequence, the PDB function gimp_edit_paste() now also returns an
array of layers (not a single layer).
2021-04-24 23:22:58 +02:00
Jehan 811d356953 app: GimpAction now has a "reason" parameter to explain being disabled.
In some cases, in particular for actions generated from plug-in
procedure right now, we were displaying the reason of the insensitivity
(typically right now, only the drawable type is cited). This was done by
appending the reason to the tooltip, separated by 2 newlines, which
resulted in extra ugly design, no nice way to style this info directly
(with pango for instance if the widget display allows it, or on a
separate info widget in a possible future, or whatnot).

Also it would mean that the action search could match a disabled action
by mistake if a search word happens to be in the reason message.

This improves the situation with the following changes:
* gimp_action_set_sensitive() now takes an optional reason string to set
  the reason message.
* Same for gimp_action_group_set_action_sensitive().
* gimp_action_get_sensitive() returns an optional reason string.
* gimp_procedure_get_sensitive()'s tooltip return value now becomes a
  reason (it won't contain anymore the tooltip and the reason
  concatenated, only the reason for separate processing).
2021-04-23 19:43:30 +02:00
Jehan 0b750eca6f app: print to standard error output when procedure uses deprecated…
… single drawable run() function.
All Scheme scripts use a single drawable and I am not so sure where to
change this (or rather I hope someone will handle this rather than I).
So let's not output a warning which would result into a stacktrace,
blocking the GUI for a second or 2 and displaying an annoying popup each
time. Let's just output to stderr for now until we get into a better
state.
2021-04-20 17:43:53 +02:00
Stanislav Grinkov b21865328c
gui: Add pixel density selector to canvas size dialog ...
which will be shown when selected template pixel density don't
match the image pixel density.

Then user can either keep current image ppi and scale the
template or set image ppi to match the template ppi.

Density selector displayed only when template and image ppi
differs and template unit is matches one of real world units
(e.g. inch, mm, etc).

Closes: GNOME/gimp#1140
2021-04-08 22:09:26 +06:00
Jehan 353c73457a app, libgimp, libgimpconfig, extensions: image procedures now with…
… drawable array instead of a single drawable.

Instead of expecting a single drawable, GimpImageProcedure's run()
function will now have an array of drawable as parameter.
As a consequence, all existing plug-ins are broken again. I am going to
fix them in the next commit so that this change can be easily reviewed
and examined if needed later.

I only fix the Vala demo plug-in now (or rather, I just use the first
layer in the array for now) because otherwise the build fails.
2021-04-04 01:40:00 +02:00
Jehan dc7853233b app, libgimp, pdb: new API to advertize when procedures are sensitive.
The new function gimp_procedure_set_sensitivity_mask() allows plug-ins
to tell when a procedure should be marked as sensitive or not.
gimp_procedure_get_sensitivity_mask() retrieves this information.

Currently plug-ins are automatically marked as sensitive when an image
is present and a single drawable is selected. Nowadays, we can have
multiple selected layers so we should allow plug-ins to tell us if they
support working on multiple drawables. Actually we could even imagine
new plug-ins which would be made to work only on multiple drawables.
Oppositely, there are a lot of plug-ins which don't care at all if any
drawable is selected at all (so we should allow no drawable selected).

Finally why not even imagine plug-ins which don't care if no image is
shown? E.g. plug-ins to create new images or whatnot. This new API
allows our core to know all this and show procedure sensitivity
accordingly. By default, when the function is not called, the 1 image
with 1 drawable selected case is the default, allowing existing plug-ins
easier update.

Note: this only handles the sensitivity part right now. A plug-in which
would advertize working on several layer would still not work, because
the core won't allow sending several layers. It's coming in further
commits.
2021-04-04 01:40:00 +02:00
Jehan 02fa354254 app: replace more gimp_(s|g)et_active_layer() to *_selected_layers(). 2021-02-22 00:00:47 +01:00
Jehan 7a363f9095 app: s/GEGL graph/GEGL Graph/
Let's have the same casing as other menu items.
2021-01-31 17:59:17 +01:00
Stanislav Grinkov ce93d5c3ab gui: #5339 Disable GEGL Op menu action if no image is open
Because "GEGL Operations..." menu action should be active only
if image is open
2021-01-31 16:47:03 +00:00
Jehan 73a64a4ee8 app: use the GimpDisplay as progress object when exporting.
Since we now hide the file dialog when exporting, progression ends up
invisible, which is especially a problem with big files. Therefore use
the image display as a GimpProgress to show progression.
2021-01-30 10:44:36 +01:00
Jehan 6d7d73935f app: remove unused (deprecated) property read.
We were also reading "gtk-show-unicode-menu" which has also been
deprecated since GTK+3.10, and we were not even using the read value.
Just remove this piece of unused code.
2020-12-15 03:15:23 +01:00
Jehan f6f94836c1 app, menus: get rid of custom input method menu.
The input menu added with gtk_im_multicontext_append_menuitems() mostly
provides redundant (e.g. the system defaults) or useless options
(e.g. "None" or "Simple" which basically seems to mean the keyboard
mapping straight keys, and I don't see why anyone would want this if one
set a system-wide input system). Worse it can provide unstable options
(e.g. "Wayland" which crashes GIMP when I tried it on my X11 desktop! It
crashes on _gtk_immodule_wayland_init which is probably normal as we are
not on a Wayland client).

Anyway gtk_im_multicontext_append_menuitems() is deprecated since
GTK+3.10, as well as the "gtk-show-input-method-menu" property which we
read from GTK+ settings (and is FALSE anyway nowadays by default, so we
usually never show this submenu) to determine if we should show this
additional text tool submenu or not. Furthermore there is just no reason
not to leave the defaults system input method engine does its job (which
works well as far as I can see, at the very least on my GNU/Linux X11
desktop and on Wayland also, last I tested).
2020-12-15 03:04:15 +01:00
Jehan 2cae9b9acf app: make "gegl:introspect" an optional operation dependency.
Check at runtime for the operation availability and set the "Show Image
Graph" action active depending on this check.

This goes with discussions to make this operation optional with a
runtime check for the tool `dot`.
See: https://gitlab.gnome.org/GNOME/gegl/-/merge_requests/84
2020-12-14 20:01:45 +01:00
Jehan cd6e777dcd Issue #6045: File > Debug > Show Image Graph == GIMP_Crash.
The issue has also been fixed on GEGL side (see commit 5ac40e3c3 in
GEGL), but since the fact that "gegl:introspect" relies on a runtime
tool (which is not the best thing), let's make an additional check
within GIMP to make sure we have a proper buffer as a result to
"gegl:introspect". Otherwise we might crash when trying to use this
NULL buffer.
2020-12-05 18:55:59 +01:00
Thomas Manni b94121f53f app/actions: fix Apply Layer Mask 2020-11-26 17:54:41 +01:00
Jehan 057b94f5f5 app: use gimp_viewable_is_ancestor() instead of gimp_item_is_ancestor().
I had recently created gimp_item_is_ancestor() but realize it duplicates
gimp_viewable_is_ancestor() (which works on GimpItem since it's a parent
class). No need for duplicate code.
2020-10-22 12:45:33 +02:00
Jehan 025309b0d7 app, libgimpconfig: "printer-profile" becomes "simulation-profile".
As per a FIXME for 3.0 where various mention to "print" got replaced by
a more generic notion of "simulation".
2020-10-16 19:50:19 +02:00
Jehan e50f522d5b app: "drawable-linked" multi-drawable aware. 2020-08-17 18:28:26 +02:00
Felix Yan fe085200c3 Correct typos in layers-commands.c 2020-08-08 10:41:20 +00:00
Jehan c73ac8fdf4 app: action "drawable-visible" now multi-layer aware. 2020-08-03 19:51:18 +02:00
Ell 9e0fdc8e2c app: allow recording GLIB log messages in performance logs
Add a new "Messages" boolean parameter to performance logs, which,
when set, records GLIB log messages in the performance log as
markers, with an accompanying sample capturing their backtrace.
This option is enabled by default.
2020-08-02 11:02:00 +03:00
Jehan 892fbafdf8 app: some more gimp_image_get_active_drawable() removed.
No logics changed. These are places where we expect single layer
selected.
2020-08-02 01:10:13 +02:00
Jehan 2ba6ac6286 app: selection stroke and "Stroke Path" now multi-layer aware.
This includes "select-stroke*" actions and "Stroke Path" feature of the
Vector tool.
2020-08-01 14:02:24 +02:00
Jehan 6b829c7008 app: Selection fill and "Fill Path" now multi-layer aware.
This includes the actions "select-fill*" as well as the "Fill Path"
feature in the Vector tool which were using common code.
2020-08-01 13:12:21 +02:00
Jehan 5d14a7a595 app: some fixes/improvements.
Forgot to free a list.
Also getting rid of a gimp_image_get_active_drawable() in edit_paste(),
with logics staying the same.
2020-08-01 12:04:04 +02:00
Jehan 5eec3e3457 app: get rid of last remnants of single-layer logics in edit-actions.
edit-cut and edit-named-* implementations were already multi-layer
aware. Making them sensitive appropriately was the only missing part.
2020-07-31 21:06:10 +02:00
Jehan ae0f595a19 app: edit-fill-fg|bg|pattern multi-layer aware. 2020-07-31 17:52:53 +02:00
Jehan 696fb34cc5 app: layers-mask-edit only works with a single layer selected. 2020-07-31 17:42:39 +02:00
Jehan 0f1f8b7b45 app: layers-resize and layers-scale work on one layer at once.
Making these actions multi-layer aware here means checking only exactly
1 layer is selected as these actions have GUI which shows dimensions and
preview (for the layer dimension action, i.e. layers-resize).
2020-07-30 21:26:13 +02:00
Jehan bf7d555759 app: edit-clear multi-layers aware. 2020-07-30 21:18:54 +02:00
Jehan 62eedd41b4 app: layers-alpha-add|remove multi-layer aware. 2020-07-30 21:03:03 +02:00
Jehan 4b3348dffe app: layers-crop-to-selection and layers-crop-to-content multi-layers…
… aware.
2020-07-30 18:36:18 +02:00
Ell 9b29d17895 app: improve layout of performance-log file-selection dialog parameters 2020-07-30 18:15:32 +03:00
Ell 146c234350 app: add progressive performance logs
Add an option to record progressive performance logs.  Progressive
logs contain complete information after each recorded sample, by
writing partial address maps at each sample, containing all new
addresses introduced by the sample.  Furthermore, when recording a
progressive log, the output stream is flushed after each sample.

This allows recording complete logs even in cases where they can't
be properly terminated, such as when GIMP crashes or freezes in the
middle of the log.

Progressive logs are disabled by default, since they potentially
increase the sampling cost.  They can be enabled through a toggle
in the log file-dialog, or through the
GIMP_PERFORMANCE_LOG_PROGRESSIVE environment varaible.
2020-07-30 01:03:38 +03:00
Ell 126002c5c9 app: allow controlling performance-log parameters through the UI
When recording a performance log, allow setting the log parametrs
through the file dialog.  Currently, this includes the sample
frequency, and the option to include backtraces.

These options are still controllable through the
GIMP_PERFORMANCE_LOG_SAMPLE_FREQUENCY and
GIMP_PERFORMANCE_LOG_BACKTRACE environment variables.  When set,
the variables override the values entered through the UI.
2020-07-30 01:03:37 +03:00
Jehan 5565a6a389 app: layers-resize-to-image action multi-layer aware. 2020-07-01 01:00:48 +02:00
Jehan 955aecab92 app, pdb: layers-merge-down action now multi-layer aware.
When several layers are selected, each layer will merge down with the
layer below it. This is similar to running Merge Down several times, one
for each selected layer.
2020-06-30 23:29:05 +02:00
Jehan 080ef8a0d8 Issue #5179: fix "Add layer masks" and improve "Edit layer mask".
The `mask` test was broken as it is not multi-layer aware (also it
should be negated).

The "layers-mask-edit" test was actually already fine because current
implementation only allow mask editing when single-selected. Still
improve the test to use multi-layer variables.

Thanks to Cyril Richard for the original patch proposition from which I
derivated the present one.
2020-06-09 11:54:16 +02:00
Ell 24f45e327b po: add vector-toolpath-actions.c to POTFILES.in
... and remove intl support from vector-toolpath-commands.c.
2020-06-04 01:34:34 +03:00
Ell 323355a708 app, menus: add gegl:lens-blur to Filters -> Blur
gegl:lens-blur simulates an out-of-focus lens blur.
2020-06-02 23:25:26 +03:00
Jehan 647ebffe7b app: GimpTransformTool multi-layer aware.
This implied a lot of other core changes, which also pushed me into
improving some of the edit actions and PDB calls to be multi-layer aware
in the same time.

Note that it is still work-in-progress, but I just had to commit
something in an acceptable intermediate state otherwise I was just going
crazy.

In particular now the various transform tools are multi-layer aware and
work simultaneously on all selected layers (and the linked layers if any
of the selected layers is linked too). Both preview and final transform
processing works.
In the limitations, preview doesn't work well (only one layer in the
preview) when there is a selection (though the actual transform works).

Also I am left to wonder how we should process this case of canvas
selection+transform on multi-layers. Indeed currently I am just creating
a floating selection (like we used to for the selection+transform case)
containing a transform result of the composited version of all selected
layers. This is a possible expected result, but another could be to get
several transformed layers (without composition). But then should the
"Floating Selection" concept allow for multiple Floating Selections?
Sooo many questions left to answer.
2020-05-28 14:28:01 +02:00
Jehan 7233464664 app: Alpha to Selection will warn when the resulting selection is empty.
Proposed by Aryeom to make it more obvious of a possible issue when
running "Alpha to Selection" and ending up with an empty selection
(which is useless hence may means there might have been a problem in
one's workflow).
This warning will also occur for similar actions (i.e. the
Add|Substract|Intersect Alpha to|from|with Selection actions).
2020-05-26 14:15:17 +02:00
Simon Budig c10778fa03 app: implement a few more functions for the ToolPath context menu. 2020-05-25 22:13:45 +02:00
Simon Budig f6f180c5cb app: Add basic infratructure for a vector tool popup menu. 2020-05-25 22:13:45 +02:00
Jehan ae4abbabfd app: layers-merge-group multi-layer aware.
Also layers-flatten-image does not care about the layer selection and
layers-anchor works anyway only when there is a floating selection,
which means only one layer selected.
2020-05-21 15:08:28 +02:00
Jehan 5c221df99f app: layers-blend-space-* & layers-composite-space|mode-* multi-layer…
… aware.
2020-05-21 00:04:37 +02:00
Jehan 338ac504df app: "layers-mask-selection-*" multi-layers aware.
All selected layers' masks are combined first as union, then the result
is combined with the image selection according to requested boolean
operation.
Also use new gimp_channel_combine_items() function.
2020-05-20 22:59:34 +02:00
Jehan 081ebf19f0 app: more accurate undo names.
Don't just name all alpha-selection actions the same "Alpha to
Selection". Have some more accurate naming like "Substract Alpha from
Selection", etc.

Also improve the action names to make them more accurate as these names
are not only in menus anymore, but also in search actions (and we want
to avoid duplicate naming).
2020-05-20 21:20:39 +02:00
Jehan 32740ac0de app: improve alpha to selection with multiple items.
I created a new function gimp_channel_combine_items() which combines a
list of items with a channel. The list of items is first combined
together as an union set, then only combined with the channel with the
desired operation (this is important for operations such as intersect
which was broken in my previous commit because all items would be
intersected with each other and the selection, whereas we actually want
the union of all items to be intersected with the selection). This new
function is now used for "Alpha to Selection".

Also similarly to copy or color-pick on multi-layers, alpha to selection
will now use the composited result of the multi-layers as visible. In
particular it means that opacity, modes and visible properties on the
layers are taken into account. Alpha to selection on a single layer
though still works as previously, only taking the non-composited layer
data into account.
I am actually struggling if alpha to selection on uncomposited layers
(just an union on alpha to selection result for each layer) would not
make sense to on some workflows. To be experimented.

Finally it is to be noted that this function should also work on
channels and vectors (both single or multiple; and of course in such
cases, compositing does not matter) though I haven't tested yet. It
could even work with a source mix of layers, channels and vectors,
though our GUI does not allow such action currently.
2020-05-20 18:45:44 +02:00
Jehan 645d80123a app: make "Alpha to Selection" multi-layer aware.
Allows to select several layers and have their alpha channel to replace
the selection, or substract from it, etc.
2020-05-18 12:22:08 +02:00
Jehan 2956873740 app, libgimp, pdb: fix gimp_selection_float() usage.
This fixes bugs introduced in commit a7c59277fb where I obviously didn't
properly checked all the places where gimp_selection_float() was used
after its parameters changed.
2020-05-18 02:09:45 +02:00
Jehan 5964f72cea app, pdb: layers-merge-layers* and image-merge-layers multi-layer aware.
Multi selection actually only really matter when "Merge within active
groups only" option is checked, in which case we are able to merge
layers within several layer groups simultaneously, and end up with
multi-selected merged layers.

Also not sure why both layers-merge-layers and image-merge-layers exist,
as they are exactly the same (exact same callback called when
activated).
2020-05-17 18:57:32 +02:00
Jehan 9dc6b2e9fe app: various "select-*" were already multi-layer aware.
No code change, they don't actually need drawable selection to work.
2020-05-17 18:57:32 +02:00
Jehan 98603c69c9 app, libgimp, pdb: "edit-copy" multi-layer aware.
When several layers are selected, select their render, similar to how
"edit-copy-visible" would have copied an image with only these layers
made visible.
Also apply the same logics to PDB function gimp_edit_copy() which can
now be used on several drawables at once.
2020-05-17 18:57:32 +02:00