Commit Graph

2513 Commits

Author SHA1 Message Date
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