Commit Graph

2436 Commits

Author SHA1 Message Date
Jehan 1b4834126f libgimp: better organization of gimp_image_metadata_*() API.
gimpimagemetadata.[ch] was built into libgimpui because GTK+ was used
for dialog query for rotation metadata. gimpimagemetadata-save.c only
was built into libgimp, which made no sense as the declaration for its
public function was inside gimpimagemetadata.h!
That was a weird situation and somehow only made visible in the build
system because GIR build was complaining about missing annotations to
gimp_image_metadata_save_prepare() (the annotation was actually present
but in the implementation which was not in the same library as the
header, how weird!):

> Warning: GimpUi: gimp_image_metadata_save_prepare: return value: Missing (transfer) annotation

Moreover it means that only plug-ins linking libgimpui had access to the
gimp_image_metadata*() API, which is obviously not cool (that should be
a core API).

Instead I moved everything into libgimp and replaced
gimp_image_metadata_load_finish() with
gimp_image_metadata_load_finish_batch(), which is essentially the same
function except that it's not interactive (it will proceed to rotate the
image without user confirmation, provided the right flag is present).
Then I add gimpimagemetadata-interactive.[ch] which contains only
gimp_image_metadata_load_finish() and is the alternative interactive
version of gimp_image_metadata_load_finish_batch(). Most plug-ins won't
even have to be changed (at least none in core GIMP) and would still
work as before, whereas now a non-interactive version exists, which
doesn't mandate to link GTK+.
2020-09-13 13:36:51 +02:00
Ell 25aefa972e libgimp: link libgimpui against GEGL
Needed since commit 4c8ee413eb.
2020-09-13 10:25:30 +03:00
Jehan d93d7effb2 libgimp: gimp_vectors_stroke_reverse missing in def file.
First bug found by our new distcheck CI step!
2020-08-03 03:19:49 +02:00
Jehan e21db99333 libgimp: fix documentation comment.
No need "See Also: gimp_drawable_get_shadow_buffer()" from within
gimp_drawable_get_shadow_buffer() documentation itself!
2020-07-01 11:09:52 +02:00
Jehan 3edcaa4baa libgimp: do not assume there are selected layers.
The list of selected layers may be empty, which doesn't matter much
because we don't actually do much with this list in current export code.
In the code modified in this commit, we were only using existing layers
to set the type of a new layer (which seems very useless right now as
anyway the layer type has to be the image base type with or without
alpha, so a with_alpha boolean parameter would be just as good, unless
we plan to support different color model layers in a same image).
2020-06-27 18:17:15 +02:00
Ell 4c8ee413eb libgimp: add GIMP_EXPORT_NEEDS_CROP export capability
Add a new GIMP_EXPORT_NEEDS_CROP export capability, which causes
gimp_export_image() to crop the exported image content to the image
bounds; this is useful for formats that support layers, but have no
concept of global image bounds, hence cropping is the only way to
enforce the image bounds.

When showing the export dialog, give an option to either crop the
layers to the image bounds, or to resize the image to fit the
layers.
2020-06-25 18:20:47 +03:00
Jehan 33520a547d app, libgimp: protect a bit GDK X Window calls.
The GDK_WINDOWING_X11 build-time macro check is not enough as GDK can be
built with both X11 and Wayland backends. We need to add a runtime check
of the type of display.
2020-06-21 12:54:13 +02:00
Michael Natterer 48b04e7257 libgimp: implement argument sync in GimpProcedureConfig
In begin_run() and end_run(), sync string properties set to
GIMP_ARGUMENT_SYNC_PARASITE with image parasites of the same name,
exactly the way "gimp-comment" was handled by begin_export() and
end_export(). Remove the "gimp-comment" handling code from
begin_export() and end_export().
2020-06-17 21:56:31 +02:00
Michael Natterer 5a235fae69 libgimp: add the concept of "argument sync" to GimpProcedure
which can be set to GIMP_ARGUMENT_SYNC_NONE (the default) or
GIMP_ARGUMENT_SYNC_PARASITE, which indicates that the argument should
be synced with an image parasite of the same name.
2020-06-17 21:56:31 +02:00
Michael Natterer b814ea95a1 libgimp: return the added GParamSpec from all GimpProcedure...
...functions which add arguments or return values.

So code can do stuff with them without an additional lookup call.
2020-06-17 21:56:31 +02:00
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