Commit Graph

2426 Commits

Author SHA1 Message Date
Michael Natterer afe98c5c70 libgimp: add gimp_procedure_config_save_metadata()
so the export's GimpMetadata can be written at any time during the
export process, which is for example needed for TIFF export.
2020-06-08 14:28:47 +02:00
Michael Natterer 1ef5f816aa libgimp: change ARG_OFFSET define in GimpSaveProcedure from 4 to 5
the procedure's signature changed which broke marshalling of
additional arguments and creation of GimpProcedureConfig object.
2020-06-08 14:28:47 +02:00
Jehan 647ebffe7b app: GimpTransformTool multi-layer aware.
This implied a lot of other core changes, which also pushed me into
improving some of the edit actions and PDB calls to be multi-layer aware
in the same time.

Note that it is still work-in-progress, but I just had to commit
something in an acceptable intermediate state otherwise I was just going
crazy.

In particular now the various transform tools are multi-layer aware and
work simultaneously on all selected layers (and the linked layers if any
of the selected layers is linked too). Both preview and final transform
processing works.
In the limitations, preview doesn't work well (only one layer in the
preview) when there is a selection (though the actual transform works).

Also I am left to wonder how we should process this case of canvas
selection+transform on multi-layers. Indeed currently I am just creating
a floating selection (like we used to for the selection+transform case)
containing a transform result of the composited version of all selected
layers. This is a possible expected result, but another could be to get
several transformed layers (without composition). But then should the
"Floating Selection" concept allow for multiple Floating Selections?
Sooo many questions left to answer.
2020-05-28 14:28:01 +02:00
Niels De Graef 23d5ef2546 vala: Fix some metadata warnings
We were mentioning some symbols that aren't introspected, because they
are part of `app/*`.
2020-05-26 22:05:12 +02:00
Niels De Graef acf50009f8 Allow building vala plugins 2020-05-26 17:52:52 +00:00
Simon Budig 8839cb58bb pdb: update autogenerated files. 2020-05-25 22:55:01 +02:00
Niels De Graef 25e535b5e0 Fix missing includes
We're exposing symbols in our header files like `GType`, `GFile` and
others, without actually including the proper headers. This also gives
errors in the GIR scanner (who can't resolve those symbols).
2020-05-21 16:02:55 +02:00
Niels De Graef 842dc7535f gir: (skip) functions with varargs
Bindings can't handle these, so they are not introspectable.
2020-05-21 13:49:38 +02:00
Jehan 2956873740 app, libgimp, pdb: fix gimp_selection_float() usage.
This fixes bugs introduced in commit a7c59277fb where I obviously didn't
properly checked all the places where gimp_selection_float() was used
after its parameters changed.
2020-05-18 02:09:45 +02:00
Jehan bb7f94ce3b libgimp: add new functions to gimp.def.
This fixes the Windows build.
2020-05-17 22:44:02 +02:00
Jehan 5498adf50a app, libgimp, pdb: color picker multi-layer aware.
Color picking on a single layer still works as it used to. On multiple
layer, it will now pick on the composited color, similarly to sample
merged if only selected layers were made visible.

The PDB/libgimp function gimp_image_pick_color() is also updated to work
on multiple drawables too, giving the same ability to plug-ins (the only
call to this function in core plug-ins have been updated).
2020-05-17 18:57:32 +02:00
Jehan 98603c69c9 app, libgimp, pdb: "edit-copy" multi-layer aware.
When several layers are selected, select their render, similar to how
"edit-copy-visible" would have copied an image with only these layers
made visible.
Also apply the same logics to PDB function gimp_edit_copy() which can
now be used on several drawables at once.
2020-05-17 18:57:32 +02:00
Jehan d3139e0f7c app: support saving/exporting with multi-selection.
This commit just changes our saving API (i.e. the GimpSaveProcedure
class) to take an array of drawables as argument instead of a single
drawable.

It actually doesn't matter much for exporting as the whole API seems
more or less bogus there and all formats plug-ins mostly care only
whether they will merge/flatten all visible layers (the selected ones
don't really matter) or if the format supports layers of some sort. It
may be worth later strengthening a bit this whole logics, and maybe
allow partial exports for instance.

As for saving, it was not even looking at the passed GimpDrawable either
and was simply re-querying the active layer anyway.
Note that I don't implement the multi-selection saving in XCF yet in
this commit. I only updated the API. The reason is that the current
commit won't be backportable to gimp-2-10 because it is an API break. On
the other hand, the code to save multi-selection can still be backported
even though the save() API will only pass a single drawable (as I said
anyway, this argument was mostly bogus until now, hence it doesn't
matter much for 2.10 logics).
2020-05-17 18:32:16 +02:00
Jehan ac56b1ed14 app, libgimp, pdb: add PDB function gimp_image_get_selected_layers().
Also add gimp_image_list_selected_layers() which is the GList version.
2020-05-17 18:32:16 +02:00
Niels De Graef b14b93de14 Split GIR into Gimp-3.0 and GimpUi-3.0
Fixes https://gitlab.gnome.org/GNOME/gimp/-/issues/4065
2020-05-15 07:45:25 +00:00
Niels De Graef 0d9716a0a8 patternselect: Document pattern_name parameter
Fixes an annoying gtk-doc warning.
2020-05-12 20:03:56 +02:00
Niels De Graef 904a2e422d meson: Declare internal libgimp(ui) dependency
By using Meson's `declare_dependency()`, we can avoid specifying the
linked libraries, dependencies and includes we need over and over again.

Basically, this conceptually acts like an internal pkg-config.
2020-05-11 06:42:29 +02:00
Niels De Graef 57d3837e40 gir: More missing annotations
Especially need to watch out with forgetting `(array)` and `(out)`
annotations, as they can really give a different API in certain (if not
most) bindings.
2020-05-08 16:57:45 +02:00
Niels De Graef f23ada8c77 zoompreview: Add (array) gir annotation 2020-05-08 16:34:23 +02:00
Niels De Graef 09f8a3c922 zoompreview: Fix gtk-doc identifier
Also fix the (transfer full) annotation, which isn't correct.
2020-05-08 16:32:54 +02:00
Niels De Graef ed310dd48d Fix some gtk-doc comments and GIR annotations 2020-05-08 15:26:42 +02:00
Niels De Graef 693eeae96b gimpprogress: Add arg descriptions to vfuncs
That squashes some gtk-doc warnings.
2020-05-08 10:39:33 +02:00
Niels De Graef 2f94513df4 libgimp: Make sure GIR includes the right header
When using GIR-based bindings that will eventually include the header
files (like Vala), we need to make sure to tell the gir-scanner what
file that is. Otherwise tools like `vapigen` have to make an educated
guess (which will be wrong).
2020-05-08 10:15:08 +02:00
Niels De Graef b680945752 gir: Make use of typedefs for GimpProgressVtable vfuncs
GObject introspection has issues handling random vfuncs (i.e. not part
of a GObject). Most of all, it needs to be able to give these a name
(so they can be used to cast in some higher level languages for
example). As such, give each vfunc in `GimpProgressVtable` a separate
typedef.
2020-05-06 11:40:26 +00:00
Niels De Graef 58fecd7f8c gir: Make sure the GIR file includes the correct header
That way, bindings that still need to know the original C header that
needs to be included (like Vala) are pointed to the correct place.
2020-05-05 19:16:49 +02:00
Niels De Graef 83d6764e0e gir: Add (closure) tags 2020-05-04 21:31:30 +02:00
Niels De Graef 7f58f2d6e5 gir: Add more missing (array) and (out) annotations 2020-05-04 21:29:42 +02:00
Niels De Graef 9c9e310a67 gir: Add missing annotations
Otherwise we won't be able to generate proper API for our bindings
2020-05-04 02:11:57 +02:00
Niels De Graef db0493aa0d gir: Add more (out) annotations
This will change the API for some bindings, so we probably want to do it
before a release.
2020-05-03 17:57:23 +02:00
Niels De Graef 85d9730936 Add some missing (nullable) annotations
Fixes https://gitlab.gnome.org/GNOME/gimp/-/issues/4750
2020-05-01 15:34:56 +02:00
Jehan fdcf74ea72 libgimp: add gimp_param_spec_get_desc() in gimp.def. 2020-04-28 20:15:28 +02:00
Michael Natterer 15bedc9bf9 libgimp: revive parameter range descriptions in the procedure browser
Copy gimp_param_specs_get_desc() to libgimp and make it also mention
default values. Don't install its header for now, because it's pretty
much a utility function of GimpProcView. It also doesn't handle most
GParamSpec types yet.

As a side effect, this fixed issue #3947.
2020-04-28 19:14:11 +02:00
Jehan eafe90fa7c libgimp, po-python: fix missing header in distribution…
… and additional source from python POTFILES.

These 2 fixes allow `make distcheck` to work fine.
You'll notice that I just commented the pygimp files out instead of just
deleting them. That's because there have been discussions and a patch
proposal lately about porting the pygimp API to Python 3/master. We are
not sure we want this yet for maintainability reason (and I was supposed
to be the one to wipe these files out!) but we'll see.
2020-04-19 12:52:28 +02:00
Jehan ea0cc27c01 app, libgimp, pdb: update gimpfile PDB functions' documentation.
All file-related functions now uses a single GimpFile as argument.
Comments regarding path as entered vs full pathname are now obsolete.
2020-04-13 20:25:32 +02:00
Niels De Graef 878804fb01 Cleanup GObject signal marshallers
* Don't generate our own marshallers if they are available in GLib
  already
* Don't set the c_marshaller parameter in `g_signal_new()` if it's a
  default marshaller provided by GLib. See commit message of commit
  39e4aa3c57 on why this is the case.
2020-04-01 21:20:01 +00:00
Jehan 707d3c6f64 libgimp: fix wrong assert in gimp_procedure_config_set_values().
The first property of a GimpProcedureConfig is the related
GimpProcedure. All others are the procedure arguments.
Also fixing the pspecs index while looping since we want to start at 1
to loop through arguments for the same reason.

Among other things, this was breaking the calls to file_save() and
several unit tests.

(cherry picked from commit 48acb361a3)
2020-03-19 11:05:19 +01:00
bootchk 8d5afa76e7 issue 4669 2020-03-17 12:34:01 +00:00
Ell 3d0606a9be libgimp: fix range of "opacity" parameter in brush-select callback 2020-03-05 20:35:44 +02:00
Jehan 4a4359d3da libgimp: (meson) build GIR file silently.
In case of errors or warnings, they will still be displayed, but it is
better to not show outputs when everything is building fine.
2020-01-15 22:24:48 +01:00
Oleksii Samorukov 3e78c674d8 Return FALSE on gimp_osx_focus_window to avoid endless loop 2020-01-15 17:40:23 +01:00
Michael Natterer 97bbd4773e libgimp: fix writing empty array GValues in gimp_value_to_gp_param()
When g_value_get_boxed() returns a NULL array, we would encode
nonsense on the wire and run into warnings. Now we simply send a
zero-length array.
2020-01-06 16:16:18 +01:00
Michael Natterer afe19ff393 libgimp: GimpProcedureDialog: next time save before committing... 2020-01-05 18:57:17 +01:00
Michael Natterer f2cf791a25 libgimp: document GimpProcedureDialog's properties 2020-01-05 18:37:58 +01:00
Michael Natterer 7cd99086ba libgimp: some documentation fixes and improvements 2019-12-27 19:56:21 +01:00
Michael Natterer 1856990c2b libgimp*: check all return values of g_param_spec_internal()
like in the fix for issue #4392. Remove the reference to the issue
from gimp_param_spec_layer() because we can't have it in all places
that now do checks.
2019-12-27 19:53:08 +01:00
Jehan 9399c937df Issue #4392: Gimp Segmentation Fault triggered by Glib GParamSpec...
... property name validation.
Slightly different fix on master compared to the gimp-2-10 branch. Here
the GParamSpec creation will happen already on the plug-in process in
libgimp. Let's just make sure we abort before we segfault.

This will be enough for the plug-in developer to start debugging one's
code. At least the core process is not crashing when the plug-in dev
provides invalid param names.
2019-12-24 02:10:02 +01:00
Michael Natterer 1be4ec2100 libgimpbase: remove enum GimpBlendMode, it's not used any longer 2019-11-19 21:13:31 +01:00
Michael Natterer 5a37be083a libgimp: doc fixes and improvements in procedure subclasses 2019-10-29 22:15:58 +01:00
Michael Natterer 0da5f0ae7e libgimp: make GimpProcedureConfig handle the image comment automatically
in gimp_procedure_config_begin_export() and end_export(). It uses
both the "gimp-comment" parasite and gimp_get_default_comment() and
syncs them with the config's "comment" property if it has one.
2019-10-29 20:38:51 +01:00
Michael Natterer c8bf85cc54 pdb: item.pdb: '3,0' is not a version, it's '3.0' 2019-10-27 18:56:53 +01:00