Commit graph

31 commits

Author SHA1 Message Date
Alx Sa
eb8076526d python: Update Spyro-Plus after GEGL Color update
Resolves #12795
After the Color Space Invasion, gimp_gradient_get_uniform_samples ()
returns an array of GeglColors rather than GimpRGB values and a status
variable. This patch fixes the Spyro-Plus plug-in to expects the new
return values.
It also restores code that utilized the second color gradient in the output
when the Gradient's Repeat Mode is Triangular Wave. This appears to
have been lost during the port from GIMP 2.10.
2025-01-24 02:51:34 +00:00
Jehan
8900967a81 extensions, libgimp, plug-ins: remove n_drawables arg from GimpImageProcedure's…
… run() function.

This is more consistent with recent changes in PDB, and now the
drawables argument is NULL-terminated.
2024-10-28 22:08:45 +01:00
Anders Jonsson
4c2ff66bdd python: rename Vectors to Path
spyro-plus ran into errors since it called old names
containing Vectors. Fix this by changing to Path to
follow the current API.
2024-09-04 22:29:14 +00:00
Jehan
8b6d90700a libgimp, pdb, plug-ins: don't skip gimp_*get_*() API from GObject Introspection anymore.
The original reason to skip these was because the new _list_ API were
introspected basically to a similar function signature, except with a
useless return value, at least in pygobject binding where the list size
was also returned.
Though it seems that in fact, only the docstring was wrong. The real
signature was apparently already the same.
See: https://gitlab.gnome.org/GNOME/pygobject/-/issues/352

Therefore since the _get_ naming is more consistent compared to other
existing function, let's re-integrate the _get_ functions for array of
items or images.

This basically reverts commit 15ec254148.
2024-07-06 14:44:45 +02:00
Anders Jonsson
5841e9f8af python: translation fixes
Followup to 292cb01fc2,
taking care of remaining untranslated strings and a stray
accelerator in a tooltip.
2024-06-10 20:58:39 +00:00
Alx Sa
292cb01fc2 python: Port arguments code to use functions
This patch ports the first-party Python plug-ins
to use the new argument API.
This restores the ability to add dropdown menus from
enums and Gimp.Choice parameters, and also allows
defaults to be set for custom datatypes like Gegl.Color.
2024-06-10 15:22:02 +00:00
Anders Jonsson
bca4679fa3 python: fix translation of Spyrograph dropdowns 2024-04-15 23:19:02 +00:00
Alx Sa
cf73a28145 python: Fix Spyro-Gimp Long Gradient option
Resolves #10873.

We needed to update a Gimp.RGB object to Gegl.Color
in order for the Long Gradient option to work properly.
2024-02-18 19:21:31 +00:00
Alx Sa
dfad2a3028 python: Fix Spyro-Gimp Selection option
As noted in a comment on issue 10873,
choosing Selection for Fixed Gear throws
a TypeError. This is because with the change
from GimpRGB to GeglColor, we can no longer
directly access the red component with an index.

Instead, we need to call Gegl.Color.get_rgba() to get
that value, which is what this patch does.
2024-02-18 18:41:04 +00:00
Alx Sa
a0990e324d python: Fix spyro-gimp Preview tool
Gimp.context_get_foreground() no longer returns a Boolean
as a first output, so we need to remove it from the assignment
line.
2024-02-17 00:02:25 +00:00
Jehan
3a0a400ad1 plug-ins: port forgotten uses of gimp_pdb_run_procedure*() removed API.
As often, we forgot to look in bindings. Thanks to Alx Sa for reminding me of
these.
2023-10-20 19:01:38 +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
Anders Jonsson
caff1e61e4 libgimpwidgets, plug-ins: translate dialog buttons
GTK no longer contains stock labels, so the button
labels needed to be marked as translatable.
2023-07-15 14:29:14 +00:00
Jehan
d54c511968 plug-ins: use proper gimp_brush_get_by_name().
Note that in the future, we expect this to be possible to create other brushes
with a same name. Maybe we should have a special function allowing to request
core resources (the ones installed by GIMP itself).
2023-07-11 12:00:22 +02:00
lloyd konneker
e00f2d7f50 Fix plugins to use new GimpResource. 2023-01-14 17:43:26 +01:00
Jehan
69f6f5748a plug-ins: use list() variants in bindings.
Cf. previous commit.
2022-06-27 22:30:42 +02:00
Jehan
18c37f7084 plug-ins, libgimp: override set_i18n() for all our core plug-ins.
Hence avoiding the stderr messages. These are going to be localized with
centrally installed catalogs "gimp*-std-plugins", "gimp*-script-fu" and
"gimp*-python".

We now handle core plug-in localizations differently and in particular,
with kind of a reverse logic:

- We don't consider "gimp*-std-plugins" to be the default catalog
  anymore. It made sense in the old world where we would consider the
  core plug-ins to be the most important and numerous ones. But we want
  to push a world where people are even more encouraged to develop their
  own plug-ins. These won't use the standard catalog anymore (because
  there are nearly no reasons that the strings are the same, it's only a
  confusing logic). So let's explicitly set the standard catalogs with
  DEFINE_STD_SET_I18N macro (which maps to a different catalog for
  script-fu plug-ins).
- Doing something similar for Python plug-ins which have again their own
  catalog.
- Getting rid of the INIT_I18N macro since now all the locale domain
  binding is done automatically by libgimp when using the set_i18n()
  method infrastructure.
2022-06-05 01:57:02 +02:00
Jehan
208d415a1a plug-ins: properly localize core Python plug-ins.
- Set the "gimp30-python" Gettext domain and bind it to the proper
  locale directory as installed by GIMP.
- Localize various strings with gettext.
- Remove calls to self.set_translation_domain() in
  do_query_procedures(). This is technically wrong right now but I am
  going to get rid of the menu item localization for plug-ins done by
  the core.
2022-06-04 14:52:14 +02:00
Jehan
387d97437d plug-ins: use the new function Gimp.context_enable_dynamics(). 2022-02-04 14:04:46 +01:00
Jehan
2a1555b082 plug-ins: fix spyro-plus.
- Now using multi-drawable run() signature, but sensitive only with a
  single drawable.
- width|height() calls are now get_width|height().
- PDB call to 'plug-in-sel2path' now expects a drawable array as well.
2021-04-20 22:17:28 +02:00
luz paz
bb322d94d7 Fix typos
Found via:
```
codespell -q 3 -S ./ChangeLog*,*.po,./.git,./NEWS* -L als,ang,ba,chello,daa,doubleclick,foto,hist,iff,inport,klass,mut,nd,ower,paeth,params,pard,pevent,sinc,thru,tim,uint
```
2020-11-19 21:56:25 +01:00
Jehan
2e73e30afd libgimp: 'gimp_ui' as priority prefix for GimpUi introspected module.
Since meson 0.43.0 (below our current requirement), 'symbol_prefix'
argument of gnome.generate_gir() allows an ordered list. If I prepend
'gimp_ui', it makes any gimp_ui_*() function to not start with 'ui_'.

In particular, GimpUi.ui_init() becomes GimpUi.init() which is much less
redundant.
2020-09-26 22:11:53 +02:00
Niels De Graef
43d0f0fbd2 gimppdb: Allow more easy bindable API
Plug-ins that work from different bindings probably want to use their
own list-type to specify arguments, rather than working with a more
cumbersome `GimpValueArray`.

This new API should make it less verbose. For example:

```
args = Gimp.ValueArray.new(5)
args.insert(0, GObject.Value(Gimp.RunMode, Gimp.RunMode.NONINTERACTIVE))
args.insert(1, GObject.Value(Gimp.Image, image))
args.insert(2, GObject.Value(Gimp.Drawable, mask))
args.insert(3, GObject.Value(GObject.TYPE_INT, int(time.time())))
args.insert(4, GObject.Value(GObject.TYPE_DOUBLE, turbulence))
Gimp.get_pdb().run_procedure('plug-in-plasma', args)
```

becomes

```
Gimp.get_pdb().run_procedure('plug-in-plasma', [
    GObject.Value(Gimp.RunMode, Gimp.RunMode.NONINTERACTIVE),
    GObject.Value(Gimp.Image, image),
    GObject.Value(Gimp.Drawable, mask),
    GObject.Value(GObject.TYPE_INT, int(time.time())),
    GObject.Value(GObject.TYPE_DOUBLE, turbulence),
])
```
2020-09-20 11:36:01 +00:00
Elad Shahar
7d1e108b90 plug-ins: spyrogimp - fix type of new layer to include alpha channel 2020-09-01 11:44:11 +02:00
Elad Shahar
17b701a940 Issue #5043: Spyrogimp 'Live' Preview Pollutes Undo History
Reduce number of undo steps created by Spryrogimp previews.
First, by grouping them into a single undo.
The implementation adds a function for clearing the
incremental preview drawing that is being executed as an idle task,
and closing an undo group in case the preview left it open (which
would usually be the case). A second way to reduce undos is
by generating a new preview only upon mouse button release of
scales in the UI, and not while dragging the scale.
2020-08-31 12:43:52 +02:00
PhotonQyv
5d412088af plug-ins: fix spyro-plus after Gimp/GimpUi split.
Since the Python bindings for Gimp has been split into Gimp and GimpUi
bindings this plug-in needs a slight tweak to still work correctly.
2020-06-08 20:38:53 +00:00
Elad Shahar
93602a3973 Issue #4326 - Add visual tab to spyrogimp plugin
Add visual tab to spyrogimp plugin for a more intuitive, visual
way of specifying the spyrograph pattern.
In addition, fix using the selection as the fixed gear, and add
option to save the pattern to a path.
2020-05-05 13:29:09 +03:00
Elad Shahar
b0ae5f1351 plug-ins: minor fixes to spyrogimp plugin.
Use Gtk Grid instead of deprecated table.
Fix use of some Gtk constants.
Fix top limit of scale widgets by setting page size of Adjustment to 0.
2019-11-26 20:08:59 +01:00
Michael Natterer
d257c7ba91 plug-ins: remove second parameter of gimp_ui_init() in all non-C plug-ins 2019-09-24 19:43:58 +02:00
Sabri Ünal
2e766f67d4 Missing mnemonics on several dialogs
paste as brush, paste as pattern, select to new brush, select to new pattern
fill selection outline, fill path, stroke selection, distort, rounded rectangle
indexed color conversion, merge visible layers, new guide, new guide (by percent)
image properties, newsprint, fractal explorer, sample colorize, new layer

metadata editor (just a button), spyroplus (only common buttons)
2019-09-05 22:41:19 +03:00
Jehan
3c6360a373 plug-ins: port spyro-plus to Python 3 + new API.
It is a nearly full port. Some things would still need to be updated
(like deprecated use of GtkTable or gtk_range_set_update_policy()
removed), and other stuff need to be taken care of in GIMP API first.
But the core of the feature is there.
2019-09-02 11:42:38 +02:00
Renamed from plug-ins/pygimp/plug-ins/spyro_plus.py (Browse further)