Commit Graph

51041 Commits

Author SHA1 Message Date
Rodrigo Lledó 3d827148c9 Update Spanish translation 2023-10-05 13:25:21 +00:00
bootchk 6781a35668 Fix 10115 SF interface call gegl_init
Resource chooser widgets recently changed to use gegl.
2023-10-05 07:37:15 -04:00
Alx Sa cbf14a7e2d plug-ins: Various warnings/code style fixes for plugins...
After the recent port.
* contrast-retinex: Initialize format & src_buffer to NULL
* curve-bend and map-object: Remove no longer needed functions
* file-load-gif: Fix C++ style comment
2023-10-04 20:27:17 +00:00
Jehan 98f0c44881 app: set keyboard focus to selected item in GimpContainerTreeView.
When the selection changes, the focus must be on one of the selected items. Not
doing this was creating a very annoying behavior where you would select an item
in the tree view with the pointer first, but then when moving up/down with the
keyboard arrow, the move originated from the previously set item. This was
because the arrow move used the "cursor path", i.e. the keyboard focus, and not
the item selection as origin.

In our case, let's make sure these match (i.e. the cursor path is the path of at
least one of the selected items, which is the most expected behavior for mixed
pointer/keyboard interactions).

See code in gtk_tree_view_move_cursor_up_down() from GTK code.
2023-10-04 15:17:43 +02:00
Idriss Fekir 68aadf4a27 Issue #9979:bold and italic broken 2023-10-04 12:01:06 +00:00
Alx Sa f46160f29c plug-ins: Prevent infinite loop in film
Resolves #10119.

If the user sets the "Image Spacing" and "Hole Width" values
to 0, the hole creation code gets stuck in an infinite loop.
This patch adds a check to the allocation code for the hole
to make sure both its dimensions are greater than 0. If not,
then the hole is not created in the first place.
2023-10-04 11:12:42 +00:00
Jehan 04dcd11fd6 app: complete !1073 for case when transformed <shift>num action clashes…
… with another default shortcut.

This won't happen with the standard US layout, but among all the layouts which
exist (or will exist), there is no say that the characters behing <shift>2-5
keys are not another one of our default shortcuts for other actions. We don't
want to print this case, because it is special enough that it's really not a
bug. In this case, we just ignore the transformed shortcut on the zoom action
and be done with it.
2023-10-04 00:11:35 +02:00
programmer_ceds 13ec70bb16 Make Numeric Shift Shortcuts Work (Fixes issue #9798) 2023-10-03 21:44:59 +00:00
Jehan ef65087c2b app: save new data to file immediately.
Calling gimp_resource_delete() on a data with a file which was not stored yet
would fail on missing file as reported by Lloyd in a comment in #9976. We could
just special-case the code to make the already-inexisting case acceptable on
deletion, but there are a few more issues.

In particular gimp_data_create_filename() relies on actually checking file
existence on the file system. Therefore generating the file path too early
(before any possible rename, i.e. for uniqueness or other formatting need) would
easily generate duplicate paths (which means one of the data object would be
overwritten on exit). It's better to kinda *reserve* the set file path
immediately by saving the data file.

The only drawback I could see on saving early is possible I/O slowdown if a
script were to create many data, but I actually don't think it's a valid use
case (no script should likely create enough data files that we would notice a
slowdown, i.e. likely creating hundreds of data objects at once) anyway. So
let's go with it, at least for now.
2023-10-03 14:40:33 +02:00
Jehan 03a6fec6b3 plug-ins: GimpUi should be loaded by default in the Python console. 2023-10-03 13:46:24 +02:00
Alx Sa 22963405ac plug-ins: Set Pixel Aspect Ratio for GIFs
If the GIF has a value other than 0 or 49 in its PixelAspectRatio 
header, then we now use it to set the non-square pixel resolution.
For reference, GIFs calculate this value like so:
PAR = (Value + 15) / (float) 64.
2023-10-03 02:14:59 +00:00
Jehan fc6c0974ea Issue #9976: gimp-brush-new throws critical. 2023-10-03 00:02:33 +02:00
Jehan eab9d8da28 app, libgimp, pdb: new PDB function gimp_fonts_get_by_name().
It returns all the fonts (possibly more than 1) with a given name. I left the
function gimp_font_get_by_name() as a utility when one don't want to choose (or
is not able anyway, e.g. a script with minimal information), though I wondered
if we should not simplify with a single function (the new one, which is the
correct one now that it is possible to have several fonts with a given name).

It is easy to test with fonts named the same. For instance I could find 2
different fonts, both named 'Holiday'. This call in the Python console returns
both:

> Gimp.fonts_get_by_name('Holiday')

As part of this commit, I also implemented resource arrays (or subtype arrays)
as PDB arguments and return types.
2023-10-02 23:22:49 +02:00
Jehan 66488ed958 plug-in: changed sign of descent in gimp_text_get_extents_font().
The film plug-in is the sole usage of gimp_text_get_extents_font().
2023-10-02 21:42:23 +02:00
Jehan adce3179d4 app, libgimp, pdb: further fix gimp_text_get_extents_font() and improve…
… description.

- The returned value as width/height/etc. of the glyph extents (or bounding
  box), not "of the font" (which doesn't mean much).
- Adding some definition for ascent and descent. This text is straight out
  copied from Pango documentation comments in pango/pango-types.h.
- I don't see why we were negating the descent value. Let's keep the value sign
  as defined in Pango.
2023-10-02 21:30:20 +02:00
Jehan a898641cd1 app: fix return type.
Fixes:

> warning: returning ‘void *’ from a function with return type ‘gboolean’
2023-10-02 20:56:19 +02:00
Jehan 24a85eebd6 Issue #9987: text related functions crash using string for font name.
- Fonctions were renamed: s/gimp_text_fontname/gimp_text_font/ and
  s/gimp_text_get_extents_fontname/gimp_text_get_extents_font/
- The size_type arguments were removed. Even in 2.10, this argument was marked
  as "dead" and ignored. It was only kept for API compatibility.
- The font name (string) was replaced by a GimpFont argument.

gimp_text_font() is easily tested in the Python console with:

> Gimp.text_font(Gimp.list_images()[0], None, 10, 40, "Hello World!", 1.0, True, 100, Gimp.context_get_font())

And gimp_text_get_extents_font() with:

> Gimp.text_get_extents_font("Hello World!", 100, Gimp.context_get_font())
2023-10-02 20:49:53 +02:00
Martin 0a77a8492f Update Slovenian translation 2023-10-02 14:52:08 +00:00
Martin d40137a79d Update Slovenian translation 2023-10-02 14:50:35 +00:00
Martin fa9d394569 Update Slovenian translation 2023-10-02 14:48:21 +00:00
Martin 5a4d5e7d2d Update Slovenian translation 2023-10-02 14:47:00 +00:00
Luming Zh d3584d2d50 Update Chinese (China) translation 2023-10-02 13:45:37 +00:00
Luming Zh a3c39531db Update Chinese (China) translation 2023-10-02 13:43:59 +00:00
Luming Zh 0b01c76808 Update Chinese (China) translation 2023-10-02 13:43:48 +00:00
Luming Zh 4f07172fac Update Chinese (China) translation 2023-10-02 13:42:45 +00:00
Ekaterine Papava 21d9ce5f31 Update Georgian translation 2023-10-02 12:30:21 +00:00
Ekaterine Papava f67cc26a4b Update Georgian translation 2023-10-02 12:28:44 +00:00
Ekaterine Papava 5109772d28 Update Georgian translation 2023-10-02 12:28:07 +00:00
Ekaterine Papava 0709eebffe Update Georgian translation 2023-10-02 12:24:48 +00:00
Yuri Chornoivan edddfa2052 Update Ukrainian translation 2023-10-02 06:58:32 +00:00
Yuri Chornoivan 53c70e47b6 Update Ukrainian translation 2023-10-02 06:57:30 +00:00
Yuri Chornoivan d1d73541c1 Update Ukrainian translation 2023-10-02 06:56:11 +00:00
Yuri Chornoivan 11ef35f7de Update Ukrainian translation 2023-10-02 06:54:52 +00:00
Jehan a186220e58 app: be more forgiving in reading shortcutsrc.
- First do not write the protocol-version (and therefore don't read it either
  nor compare it to the current one). This file does not depend on the protocol
  version.
- Secondly when reading an unknown identifier, simply print a message on stderr
  for debugging/reference, but ignore it up to the next closing parenthese.
- Finally do not use the file-version as a terminal error as well. When we read
  a shortcutsrc with the wrong version, we still try to read it as best as we
  can. There might be issues, but it's better than fully dropping the whole list
  of shortcuts as it's a pretty important file (people might have spent a lot of
  time tweaking their shortcuts!).
2023-10-02 01:30:02 +02:00
Jehan 278f78fee6 libgimp: fix various GIR build warnings breaking HTML reference generation.
- a few inconsistent parameter naming;
- broken links to other symbols.
2023-10-02 00:25:12 +02:00
Jehan 8694f67918 libgimp: fixing duplicate gimppropwidgets section for introspection docs.
Fixing:

> [809/2421] Generating libgimp/GimpUi-3.0.gir with a custom command (wrapped by meson to set env)
> libgimpwidgets/gimppropwidgets.c:37: Warning: GimpUi: multiple comment blocks documenting 'SECTION:gimppropwidgets:' identifier (already seen at gimppropwidgets.c:23).
2023-10-02 00:05:10 +02:00
Jehan 3acac137ae NEWS: update with all changes from MR !1065.
Only the DDS vulnerability item is not from this MR but from the rebase.
2023-10-01 23:02:12 +02:00
Jehan 5a5a94d9b7 plug-ins: port other Python plug-ins to new gimp_image_procedure_new().
SpyroGIMP will have to be ported to GimpProcedureDialog, or at least, it should
store its arguments. Currently they are resetted at each run.
2023-10-01 21:02:34 +02:00
Jehan accf3b1e64 plug-ins: port histogram-export to new gimp_image_procedure_new() and…
… to GimpProcedureDialog.
2023-10-01 21:02:34 +02:00
Jehan 1d50c81130 libgimp, plug-ins, extensions: gimp_image_procedure_new2() renamed gimp_image_procedure_new(). 2023-10-01 21:02:34 +02:00
Alx Sa 5c8aa1f242 plug-ins: port lighting to gimp_image_procedure_new2()
...and to GimpProcedureDialog.
As with the last few, improvements could be made to the GUI, mneumonics,
and global variables used.
2023-10-01 21:02:34 +02:00
Alx Sa 5765240f6b plug-ins: port fractal-explorer to gimp_image_procedure_new2()
...and to GimpProcedureDialog.
Note that there are still some unnecessary global variables that could be refactored out.
2023-10-01 21:02:34 +02:00
Jehan 9a2d9991e5 plug-ins: get rid of hardcoded colors for built-in units.
Hardcoded colors don't work well with theme customization (on a dark theme in
particular, it was bad).

Anyway built-in units are already grayed-out and non-editable. I don't think
further styling is needed.
2023-10-01 21:02:34 +02:00
Jehan 0273c1031c app, libgimp, pdb: gimp_text_layer_new() now uses GimpFont.
This function is not perfect and in particular doesn't seem usable with binding
because of GimpUnit being some weird mix between an enum and some kind of class.

So this will have to be fixed too. See #8900.
2023-10-01 21:02:34 +02:00
Jehan ea55b7a11a app, devel-docs, libgimp: updating gimp_text_layer_[gs]et_font() and new…
… function gimp_font_get_pango_font_description().

Also updating file-pdf-save which is the only plug-in using these right now.

Note that I am not fully happy with the new function
gimp_font_get_pango_font_description() because I experienced some weird behavior
in file-pdf-save which is that some fonts were wrong if this is called after
pango_cairo_font_map_set_resolution().
But let's say this is a first step looking for improvements.
2023-10-01 21:02:34 +02:00
Alx Sa faae47a9a8 plug-ins: port map-object to gimp_image_procedure_new2()
...and to GimpProcedureDialog.
Also resolves #25 by adding the missing PDB parameters to the GUI.
Note that there are a few remaining tasks:
* The config values are being copied to mapvals. 
Eventually the rest of the code needs to be updated
to directly use the config.
* The material tab uses icons from the Lighting plug-in. They didn't show up before the port; this needs to be fixed.
* The drawable buttons are huge compared to the original plug-in. The styling needs to be looked at.
2023-10-01 21:02:34 +02:00
Alx Sa 640b0cffe0 plug-ins: port sample-colorize to gimp_image_procedure_new2()
..and to GimpProcedureDialog.
Note that the UI could be improved - happy to make changes based on
feedback!
2023-10-01 21:02:34 +02:00
Jehan 2f4d625059 app, libgimp, pdb: generate widgets for GIMP_PROC_ARG_LAYER|CHANNEL arguments.
I am using the same GimpDrawableChooser with an additional drawable_type
argument to only show the appropriate tab if we want to limit what can be
chosen.

None of our plug-ins actually use a GimpLayer or GimpChannel only arg so far,
but if we have some day, or if some third-party plug-ins want to have such arg,
now they quite easily can!
2023-10-01 21:02:34 +02:00
Jehan 4be1166982 app, libgimp: disable again cross-process transient setting.
After testing, setting a window as transient to another from another process is
still broken on Windows and it's hard to diagnose without using Windows
directly. Since it's not just broken, but it even hangs the whole process, which
is quite a blocker issue, let's disable again the whole code on Windows.
2023-10-01 21:02:34 +02:00
Alx Sa 7b29ac247a plug-ins: port compose to gimp_image_procedure_new2()
Converted to GimpProcedureDialog as well, and changed the
string argument for the combobox to GimpChoice.
Some widgets are still standalone and could be further improved
to work with GimpProcedureDialog.
2023-10-01 21:02:33 +02:00