Commit Graph

19 Commits

Author SHA1 Message Date
Jehan 601437addd plug-ins: file-openraster also moved to new gimp_load_procedure_new().
Additionally getting rid of a call to gimp_image_set_file() since we clarified
its docs as not being used for non-XCF files.
2023-10-01 21:02:32 +02:00
Jehan 69edf13e2c plug-ins: fix the GimpSaveProcedure plug-ins in Python.
As usual, these got forgotten!

Also colorxhtml is actually deeply broken by commit 89c359ce47 which removed
gimp_drawable_get_pixel() (Niels thought it was not used, whereas it was simply
harder to spot with bindings!).
This will have to be fixed eventually.
2023-10-01 20:52:02 +02: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 d25b7301d6 plug-ins: fix the ORA thumbnail load procedure.
- Fix return value in error case: s/GObject.Error/GLib.Error/ and anyway
  in this form, the error should be a string. Using the easier form
  procedure.new_return_values() instead.
- "file-png-load" uses a GFile now (like all load procedures).
2022-02-09 22:56:42 +01:00
Jacob Boerema 6ec20e6ed0 plug-ins: adapt file-openraster to API changes.
I only fixed the changes that made it fail.
I have not updated it to the sensitivity API.
2021-04-21 13:04:46 -04:00
Jacob Boerema d8009a000b plug-ins: Remove gamma parameter in openraster call to file-png-save.
Commit d57eafd189 removed the
gamma parameter for file-png-save so we have to remove it here too.
2021-01-30 13:18:50 -05:00
Jacob Boerema d87cd48f02 plug-ins: check for run_procedure SUCCESS in openraster
The Openraster plug-in calls file-png-load and
gimp-file-load-layer but didn't check if the result
was SUCCESS. Even though I haven't seen any
failures let's improve error checking by adding
a check for a correct result.
2021-01-27 19:07:51 -05:00
Jacob Boerema 9a19cf3b81 plug-ins: add missing parameters to file-png-save in openraster save_ora 2021-01-27 19:07:51 -05:00
Jacob Boerema 9d9f6e6240 plug-ins: add progress updates to openraster load and save.
Since openraster load and save is not very fast for multi layer
images it seems like a good idea to add progress update
support.
2021-01-27 19:07:51 -05:00
Jacob Boerema 6d6b7e90c2 plug-ins: improve exporting of layer modes for openraster.
The current openraster specification only has a limited
number of layer modes. Let's improve things a little bit
by mapping both the current and legacy layer modes
to the same openraster composite-op where available.

For the other layer modes we could examine what the
closest composite-op is, or add a GIMP specific op
(which is what Krita seems to do). For now we set
all these to the openraster equivalent of NORMAL.
2021-01-27 19:07:51 -05:00
Jacob Boerema 304c7d6bc8 plug-ins: don't use the legacy layer modes in openraster load/save
Let's use the non legacy layer modes when importing/exporting
openraster images. That way we are more likely to be able to
import the correct layer modes since openraster only has a
limited number of layer modes defined.
2021-01-27 19:07:51 -05:00
Jacob Boerema 7650767ad3 plug-ins: loading and saving of group layers failed in openraster plug-in. 2021-01-27 19:07:51 -05:00
Jacob Boerema d001e4b38b Issue #5984 file-openraster-save throws CRITICAL at Gimp.ObjectArray.new() 2021-01-27 19:07:51 -05:00
Jacob Boerema dbc198001e plug-ins: Fix incomplete port of file-openraster.
This fixes #5838 which was caused by an incomplete port
of this plug-in to the new introspection API.

For now we do keep the n_drawables parameter of save_ora until
issue #5312 is fixed. Not doing this would cause saving to fail.
2020-10-31 12:49:54 -04: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
Michael Natterer 26a744f44d plug-ins: register thumbnail procedures before load procedures
so registering the thumbnail loader with the load procedure can
perform some checks for procedure existence and signature.
2019-09-10 19:36:54 +02:00
Jehan 13ea5caec2 plug-ins: port file-openraster to Python 3 + new API.
Apart from porting, only code logics change is the whole
encode()/decode() code because it created a string vs bytes mess and the
zipfile API apparently didn't like to deal with bytes, even though the
docs say otherwise.
It's hard to test on my UTF-8 system, so please anyone working with
non-UTF-8 paths, we welcome reports if ORA load/save does not work
properly.

Other than this, load, save and load_thumb were all tested and working
properly so far.
2019-08-25 12:01:41 +02:00