Commit Graph

9630 Commits

Author SHA1 Message Date
Alx Sa bf210243f2 plug-ins: Port selection-to-path.c to gimp_image_procedure_new2()...
...and to GimpProcedureDialog.
selection-to-path-dialog.c was also removed as the code can now be contained
within selection-to-path.c thanks to the new API.
2023-10-01 21:02:33 +02:00
Jehan dd1c12a0e1 plug-ins: port script-fu-script.c to gimp_image_procedure_new2(). 2023-10-01 21:02:33 +02:00
Jehan 7f34fb14f7 plug-ins: port pagecurl to gimp_image_procedure_new2() and GimpProcedureDialog.
I'm also changing various arguments to GimpChoice and making "opacity" into an
argument.
2023-10-01 21:02:33 +02:00
Jehan fa67a6ce0e libgimp, plug-ins: properly document the return values of GimpThumbnailProcedure.
The various information (width, height, image type and number of layers) are
those of the full image, not of the thumbnail. Make it clear in the docs of
GimpRunThumbnailFunc.

Additionally:

- file-xmc was returning the proper information but variables were wrongly
  named, which was confusing.
- Fix file-ico thumbnail proc which was returning the thumbnail width/height.
- In file-darktable, initialize width/height to 0 so that we just don't show any
  size when we don't get the information. It's better not to show anything than
  completely wrong information (the thumbnail target size).
2023-10-01 21:02:33 +02:00
Jehan 9124f9c627 plug-ins: fix algorithm for choosing the best thumbnail of ICNS image.
We were choosing the bigger icon in the ICNS list. Instead let's choose the
bigger icon within the target size bounding box. In case there is no smaller (or
equal size) icon, we falls back to the smallest bigger icon.

Also make sure we set width and height to the full image size, as this is used
as information on the full image (not the thumbnail).
2023-10-01 21:02:32 +02:00
Jehan 93ad26e6bc plug-ins: load SVG image at proper size.
SVG is a vector format which is easy to render exactly within the size×size
bounding box. Let's make sure we do so.
This makes for much sharper SVG thumbnails (and also possibly faster thumbnail
render).
2023-10-01 21:02:32 +02:00
Jehan ed98b990c5 plug-ins, libgimp: GimpRunThumbnailFunc now uses a GimpProcedureConfig rather…
… than a GimpValueArray.

Similar to other GimpProcedure, move to using a config object. A difference is
that thumbnail procedures are always run non-interactively.

Also fixing WMF load thumbnail procedure: the dimension computation was wrong
when the image was wider than tall.
2023-10-01 21:02:32 +02:00
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 9e2a7e8759 libgimp, plug-ins: rename gimp_load_procedure_new2() as gimp_load_procedure_new().
All C load procedures are now moved to the new API.
2023-10-01 21:02:32 +02:00
Jehan 136aca3c34 plug-ins: port all remaining C load procedures to gimp_load_procedure_new2(). 2023-10-01 21:02:29 +02:00
Jehan d5607454b3 plug-ins: port file-cel to gimp_load_procedure_new2() and GimpProcedureDialog.
Also the palette argument is now a proper GFile argument (not a string).

There is also a palette argument for the export procedure, but it's currently
unused. A palette storing function will need to be implemented.

Some bit of additional logic cleanup was done.
2023-10-01 20:52:02 +02:00
Jehan c256f63d63 plug-ins: port file-png to gimp_load_procedure_new2(). 2023-10-01 20:52:02 +02:00
Jehan 885bae59ba plug-ins: port file-pdf-load to gimp_load_procedure_new2().
I also did a bit of code cleanup in the main run() load code.
2023-10-01 20:52:02 +02:00
Jehan 2416b40c26 plug-ins: port file-svg to gimp_load_procedure_new2 and GimpProcedureDialog.
Again, I am losing a tiny bit of UI, in particular the ratio fields, but also
the update of the size label (this was kinda broken anyway, as it updated only
when updating some fields, not others).

Also moving the default resolution to 300 PPI.

Last but not least, I transformed the "paths" int argument to a GimpChoice
argument.
2023-10-01 20:52:02 +02:00
Jehan 7a0fd77b95 plug-ins: port file-wmf to gimp_load_procedure_new2 and GimpProcedureDialog.
The new dialog is not fully on-par with the old one. We lost the X and Y ratio
fields as well as the ability to constrain dimensions to each other. This should
be improved when we'll get proper automatically generated widgets for dimension
arguments.
2023-10-01 20:52:02 +02:00
Jehan 4a3fd7423a plug-ins: port various plug-ins to gimp_load_procedure_new2(). 2023-10-01 20:52:02 +02:00
Jehan 2d33f1fb39 plug-ins: "compression" arg of file-tiff-save now becomes a GimpParamChoice. 2023-10-01 20:52:02 +02:00
Jehan cedc45d8f3 plug-ins: change "format" aux argument to a GimpChoice. 2023-10-01 20:52:02 +02:00
Alx Sa 3c53d5f38e plug-ins: port cml-explorer to gimp_image_procedure_new2()
Also fixes some spelling issues and removes a warning about an
uninitialized variable.
Currently the only argument is for non-interactive mode, so
the dialogue isn't ported to GimpProcedureDialog yet.
2023-10-01 20:52:02 +02:00
Alx Sa 6dc21425c0 plug-ins: port smooth-palette to gimp_image_procedure_new2()
The dialog itself is ported to GimpProcedureDialog. However, the
width and height require another API that allows for size entries with
multiple fields before it can be considered finished.
2023-10-01 20:52:02 +02:00
Jehan 37a867d85a plug-ins: port file-farbfeld to new gimp_save_procedure_new().
This was not forgotten, simply this is a new plug-in which got into the tree
after a rebase. ;-)
2023-10-01 20:52:02 +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 fcc810d7d3 libgimp, plug-ins: rename to gimp_save_procedure_new().
Also the mimetype is already set by gimp_file_procedure_set_mime_types() so
transform the mimetype argument into an export_metadata argument.
2023-10-01 20:52:02 +02:00
Jehan 06bd1f1289 plug-ins: port file-gih to GimpSaveProcedureDialog.
I was hoping to redesign further but the whole logic of animated brush creation
is made so complicated that I think it would require a whole more complex GUI
with visual hints. So anyway I stopped at basic redesign and port to the new
dialog generation code.
It still makes the code much simpler and a bit more powerful (also less bugs
hopefully). I have also reviewed the procedure arguments, removing redundant
ones (display-cols and display-rows are just computed from cell-width and
cell-height) and adding some aux arguments instead to simplify dynamic GUI code.
2023-10-01 20:52:02 +02:00
Jehan 689e3da5b9 plug-ins: port the last GimpSaveProcedure to gimp_save_procedure_new2().
It's the basic stupid port, though this dialog is so bad that I think I'm going
for a second stage with a basic redesign of this GUI while also moving to
GimpSaveProcedureDialog. To be continued.
2023-10-01 20:52:02 +02:00
Jehan 9ed8f00e5b plug-ins: port most plug-ins to gimp_save_procedure_new2(). 2023-10-01 20:52:02 +02:00
Jehan 44e2bab9ad plug-ins: remove "num-images" argument and improve error feedback.
The arg "num-images" is clearly redundant as the "images" array already has this
information. Moreover it is bug-prone, for instance running 'Repeat "Filmstrip"'
would crash the plug-in which was defaulting to NULL "images" and 1 "num-images"
(without any GimpItem serialization ability yet).
Of course, we could just fix this, but better remove the redundant arg and all
possibilities of future similar bugs.

Also I now display a proper error message when running without input images
which says: "\"Filmstrip\" cannot be run without any input images"
2023-10-01 20:52:01 +02:00
Jehan df6ccf390f plug-ins: fix possibly unreffing a NULL pointer. 2023-10-01 20:52:01 +02:00
Jehan 14bcaa717b plug-ins: a bunch of more plug-ins ported to gimp_save_procedure_new2(). 2023-10-01 20:52:01 +02:00
Jehan b23519a401 plug-ins: port to gimp_save_procedure_new2() all export procedures…
… which were using gimp_procedure_config_begin_export().
2023-10-01 20:52:01 +02:00
Alx Sa e79de5db86 plug-ins: port small-tile to gimp_image_procedure_new2()
The dialog itself is ported to GimpProcedureDialog, but the original 
plug-in only had one config parameter (Number of Tiles).
Some of the other options might make sense as config parameters 
such as the horizontal/vertical toggles and opacity.
2023-10-01 20:52:01 +02:00
Jehan 3c1ecd53ff plug-ins: port film to GimpProcedureDialog.
I needed a few more GimpProcedureDialog widgets, which I now have. The only part
still not generated in this plug-in is the image selection. This is hundreds of
lines less!

It now has arguments for every usable setting (except "keep-height" which is an
aux arg because it is simulated with a 0 "film-height" in non-interactive mode).

Also the film-height/keep-height default in interactive mode is now much better.
I override the film-height default and set it to be the image's height. This
makes for a much better default at all time.

The "Reset" button in Advanced section is not useful anymore since we now have
the generic "Reset" (to Initial/Factory) of GimpProcedureDialog, though it
actually doesn't work right for the time being, as it fails serializing
GimpFont.
2023-10-01 20:52:01 +02:00
Jehan 5cc1c898d7 libgimp, plug-ins: enhance gimp_procedure_dialog_get_label() with markup and…
… mnemonic abilities.
2023-10-01 20:52:01 +02:00
Jehan 99d4c504d0 plug-ins: port film to gimp_image_procedure_new2().
The dialog is not ported to GimpProcedureDialog yet. It will be worth doing it
as a second step.
2023-10-01 20:52:01 +02:00
Jehan f5183cbd7b plug-ins: port warp to gimp_image_procedure_new2().
It would be worth porting when GimpDrawableComboBox widgets can be used as
GimpProcedureDialog generated widgets. Or even better, if the GimpPickableButton
were ported to libgimp to be used by plug-ins (since it's actually a lot more
usable).
2023-10-01 20:52:01 +02:00
Jehan 2f91e45b4f plug-ins: port easy plug-ins to gimp_image_procedure_new2().
These were the plug-ins already using gimp_procedure_config_*() API.
2023-10-01 20:52:01 +02:00
Jehan 2a21d45ada plug-ins: port grid to gimp_image_procedure_new2().
I didn't port to GimpProcedureDialog because we'd need first a GimpSizeEntry
generatable widget, which can map to several properties (here for instance 3
width properties).
2023-10-01 20:52:01 +02:00
Jehan 3c658789a6 plug-ins: now port to gimp_image_procedure_new2() all plug-ins without args. 2023-10-01 20:52:01 +02:00
Jehan 4f14f620c4 plug-ins: port to gimp_image_procedure_new2() all plug-ins which were already…
… working with a GimpProcedureConfig.

These are the easiest ones to port as most of the work was already done (mostly
just some now useless calls to remove).
2023-10-01 20:52:01 +02:00
Jehan 96b3302e65 plug-ins: port gradient-flare to gimp_image_procedure_new2() and GimpProcedureDialog.
The port to GimpProcedureDialog is partial as there are still quite a few pieces
which can be improved. But it's a good start.
2023-10-01 20:52:01 +02:00
Jehan 7da0db9e88 plug-ins: port tile to gimp_image_procedure_new2() and GimpProcedureDialog. 2023-10-01 20:52:01 +02:00
Jehan 3806b46fc5 plug-ins: forgotten Python plug-ins had to be ported to new Gimp.Procedure.new().
There was also one case of port to updated GimpResource API to get the name of a
palette.
2023-10-01 20:52:01 +02:00
Jehan 2b38a2df86 libgimp, plug-ins: rename gimp_procedure_new2() as gimp_procedure_new() and…
… remove the latter.

Now all GimpProcedure use this new implementation with use a config object.
2023-10-01 20:52:01 +02:00
Jehan a2acf24ecb libgimp, plug-ins: Script-fu scripts now use gimp_procedure_new2() too.
Also in gimp_procedure_config_begin_run(), make sure we sync the arguments with
the config object first thing, even in interactive and with-last-vals case
(where the args may be further overridden). This was especially important for
Script-fu scripts as the image and drawable were not provided separately, so we
need to make sure that the config file has the right values.
2023-10-01 20:52:01 +02:00
Jehan 5d3112a2f1 plug-ins, libgimp: move GimpBatchProcedure's run function to use config objects.
Also port more script-fu procedures to gimp_procedure_new2(), which were sharing
some code with the script-fu batch procedure.
2023-10-01 20:52:01 +02:00
Jehan af00b66914 plug-ins: port the easy script-fu procedures to gimp_procedure_new2(). 2023-10-01 20:52:01 +02:00
Jehan 38ecbfc762 plug-ins: more plug-ins ported to gimp_procedure_new2(). 2023-10-01 20:52:01 +02:00
Jehan 9b2240f51e plug-ins: port web-page to GimpProcedureDialog and gimp_procedure_new2().
Again a lot less lines for more functionalities (e.g. now it should work fine in
WITH_LAST_VALS mode).
2023-10-01 20:52:01 +02:00
Jehan e92ef9d45a plug-ins: port several of the easy plug-ins to gimp_procedure_new2(). 2023-10-01 20:52:01 +02:00
Jehan f6da799c11 plug-ins: port screenshot to GimpProcedureDialog and gimp_procedure_new2().
A lot less lines for the same functionalities!
This includes improvements too:

* "include-pointer" as new PDB argument;
* settings storage thanks to GimpProcedureDialog;
* it should hopefully work better in non-interactive (though it's untested).

The macOS and Windows screenshots are untested after this change, though they
should still work the same. Please report if there is any problem!
2023-10-01 20:52:01 +02:00