Commit Graph

44199 Commits

Author SHA1 Message Date
Jehan 793cba6675 libgimp: allow object GimpImage as procedure parameter.
Though it is still possible to use an image ID as procedure parameter,
it is now possible to pass a GimpImage GParamSpecObject.

Over the wire, this will transform back and forth into a GimpImageID,
totally transparently for the plug-in which will only always get a
GimpImage.
2019-08-22 15:54:36 +02:00
Jehan e0d50aa121 plug-ins: keep building all plug-ins with old API.
Build existing plug-ins with -DGIMP_DEPRECATED_REPLACE_NEW_API.
We will port the plug-ins one at a time to the new GimpImage API.
2019-08-22 15:54:36 +02:00
Jehan 09f0530dab libgimp: update non-generated API to allow old and new API.
Same as previous commit: by default the new API will be used. But if a
plug-in builds with GIMP_DEPRECATED_REPLACE_NEW_API macro, then the same
function names will call the old API with ids.
2019-08-22 15:54:36 +02:00
Jehan fec6034c7a pdb: keep both the old and new API alive.
By default the new API will be used. But if we build with
GIMP_DEPRECATED_REPLACE_NEW_API macro, then the same function names will
call the old API with ids.

This way, we don't have to update all our plug-ins at once (which I
tried and is very tedious work).

Note that bindings won't have access to the deprecated API at all.
2019-08-22 15:54:36 +02:00
Jehan 17a40b049f libgimp: generate functions both for old and new GimpImage APIs.
This way, it would still be possible to use the old API. WIP.
2019-08-22 15:54:36 +02:00
Jehan 688c3230d0 libgimp: create and use gimp_image_new_by_id().
Simpler than using g_object_new() in a bunch of places.
2019-08-22 15:54:36 +02:00
Jehan bb72504ea9 libgimp: change all non-generated API to use GimpImage.
We shouldn't pass as parameter nor return gint32 anymore.
2019-08-22 15:54:36 +02:00
Jehan 4db8cda24e app, pdb, libgimp: add a new GimpImage class for plug-ins.
This means that all functions which were returning or taking as
parameter an image id (as gint32) are now taking a GimpImage object
instead.
The PDB is still passing around an id only over the wire. But we create
an object for plug-ins to work on.

This is quite a huge API break, but is probably the best bet for the
future quality. It will make nicer API instrospection (and nicer API in
binding), will fix the issues with pspec on GimpImageID in Python
bindings (which makes the current Python API unusable as soon as we need
to work on images, which is most of our plug-ins!), etc.
Also it will allow to use signals on images, which will be a great asset
when we will finally have bi-directionnal communications (i.e. plug-ins
would be able to connect to image changes, destructions, and whatnot).
2019-08-22 15:54:36 +02:00
Félix Piédallu 699b3c5c02 refactoring of the gitlab-ci.yml 2019-08-21 14:18:49 +02:00
Tobias Ellinghaus 583d965773
Fix typo in configure warning re: luajit 2019-08-20 14:02:43 +02:00
Alexandre Prokoudine 115f9fc873 Remove Bugzilla from the desktop file
We don't seem to need it anymore, and all GNOME apps have removed it already.
2019-08-20 12:58:28 +03:00
luz.paz 0340c4a904 libgimp/ documentation typo fixes
Found via `codespell -i 3 -w -S ./ChangeLog*,*.po -I ../gimp-word-whitelist.txt ./libgimp`
2019-08-20 08:40:58 +00:00
Michael Natterer 2b310999fc plug-ins: port file-wmf to GimpPlugIn 2019-08-20 10:22:27 +02:00
Michael Natterer 4c3f3c451b plug-ins: port file-pdf-load to GimpPlugIn 2019-08-20 02:32:15 +02:00
Michael Natterer 0f273a5959 app, libgimp: also UTF-8-validate all elements of PDB string arrays 2019-08-20 01:46:56 +02:00
Michael Natterer 6ed2d03c73 libgimp: use the new macros in all non-generated files 2019-08-20 01:21:32 +02:00
Michael Natterer 4cb4b3ef3a plug-ins: port all plug-ins to the new macros 2019-08-20 01:03:38 +02:00
Michael Natterer 09eaf0295a libgimp: add a gazillion of macros to gimpprocedure-params.h
that make dealing with value arrays easier and shorter, e.g.

  g_value_get_boolean (gimp_value_array_index (args, n)):

becomes:

  GIMP_VALUES_GET_BOOLEAN (args, n);
2019-08-20 01:00:47 +02:00
Michael Natterer 1253faaab3 plug-ins: change all ported thumbnail loaders to GimpThumbnailProcedure 2019-08-19 14:04:00 +02:00
Michael Natterer c4a973c30a libgimp: add GimpThumbnailProceudre
which handles the standard thmbnail procedure args and return values.
2019-08-19 14:02:34 +02:00
Michael Natterer fab806089a app, libgimp: UTF-8 validate all string arguments and return values
The only way for a plug-in to prevent this is now using
GIMP_PARAM_NO_VALIDATE.
2019-08-19 13:11:02 +02:00
Michael Natterer d62e75a41f Move GimpParamSpecString from libgimp back to app
It's just too weird to be public. Remove its properties from the wire
protocol and from pluginrc. Instead, have all GParamSpecs' flags on
the wire and in pluginrc, so we can use stuff like
GIMP_PARAM_NO_VALIDATE.

Port the remaining few places to GIMP_PROC_ARG_STRING().

I'm sure something is broken now wrt UTF-8 validation,
will add tighter checks in the next commit.
2019-08-19 12:54:52 +02:00
Michael Natterer de121374ef Change the "handles uri" flag of file procedures to "handle remote"
And always pass URIs to all file procedures, the ones what didn't
register as "handles remove" will only ever get local file:// URIs.

Change all file plug-ins (also legacy ones) to expect URIs instead
of filenames, and convert to local paths in the plug-in.

The wire protocol should now be almost 100% clean of non-UTF-8 strings.
2019-08-19 12:05:12 +02:00
Michael Natterer 9cabc8c8d0 libgimp, plug-ins: use the new macros everwhere
Except for gimp_param_spec_string() which is on its way back to the
core.
2019-08-19 10:02:07 +02:00
Michael Natterer 471285bda9 libgimp: add gimpprocedure-params.h
which looks much like gimpconfig-params.h and contains macros
(e.g. GIMP_PROC_ARG_BOOLEAN() and GIMP_PROC_VAL_BOOLEAN()) for all
GimpProcedure argument and return value types supported by the
protocol, and makes the boilerplate of setting up a procedure more
readable and much less indented.

This file is C-only and not introspected.
2019-08-19 09:56:20 +02:00
Michael Natterer 64920f01eb plug-ins: port file-svg to GimpPlugIn 2019-08-18 23:47:03 +02:00
Michael Natterer 1e49befef3 plug-ins: link file-svg against GEGL, it uses it indirectly 2019-08-18 23:19:58 +02:00
Jehan 045d03a3de plug-ins: some very minor style (alignment) fixes. 2019-08-18 22:37:31 +02:00
Jehan 4799619bbc plug-ins: fix various plug-ins ported to GimpImageProcedure.
All the GimpImageProcedure must remap the order of their additional
arguments (i.e. subtracts 3).
This fixes the other plug-ins changed in commit 15019fef52 which had
such additional arguments.
2019-08-18 22:26:33 +02:00
Jehan 5b3e8e1f05 plug-ins: fix pagecurl arguments order after GimpImageProcedure port.
The additional arguments are ordered down -3.
2019-08-18 21:53:45 +02:00
Jehan 011ae15460 plug-ins: canonicalize curve-bend.
Since commit 11ce199cea, we reject non-canonical procedure name. We
have one such in our plug-ins in curve-bend. Fix this.
2019-08-18 21:50:14 +02:00
Michael Natterer 81bb3237ef libgimpconfig: add weird hack to gimp_scanner_parse_float()
because for whatever reason, writing

*dest = -scanner->value.v_int;

fails and writes some positive value instead.
2019-08-18 18:28:32 +02:00
Michael Natterer b444954d03 plug-ins: port file-ps to GimpPlugIn 2019-08-18 18:28:32 +02:00
Piotr Drąg 5a09042b6d Update Polish translation 2019-08-18 16:00:35 +02:00
Michael Natterer 17648ead86 plug-ins: port file-fig-load to GimpPlugIn
And also fix a glitch in my earlier g_strlcpy() commit that would keep
most GIFs from being loaded, oops.
2019-08-18 15:04:57 +02:00
Michael Natterer b250af33e1 devel-docs: some doc updates 2019-08-18 14:15:24 +02:00
Michael Natterer ea4fe02a6d libgimpwidgets: some docs fixes 2019-08-18 14:07:17 +02:00
Michael Natterer d7e42b28e3 libgimp: move the GimpProcedure icon API next to the menu API 2019-08-18 14:04:45 +02:00
Michael Natterer 15019fef52 plug-ins: port many plug-ins from GimpProcedure to GimpImageProcedure
Also move the call to set_icon_name() after set_menu_label(), all
ported plug-ins should look the same so we are a good example for copy
and paste ;)
2019-08-18 13:45:58 +02:00
Michael Natterer d89e6ca7e9 plug-ins: port goat-exercise-c to GimpFileProcedure
and fix loading of the plug-in source code into the text view. Also,
ancountering a zero-sized selection is not an error, but simply a
successful nop.
2019-08-18 13:14:27 +02:00
Michael Natterer 98bfe065e8 libgimp: add GimpImageProcedure with (run_mode, image, drawable) args
to save the boulerplate of handlin these 3 arguments in a lot of
plug-ins.
2019-08-18 12:46:07 +02:00
Michael Natterer f480d02823 libgimp: add precondition checks for gimp_is_canonical_identifier()
on all procedure name parameters.
2019-08-18 12:43:37 +02:00
Michael Natterer 11ce199cea app: stop canonicalizing procedure names
on behalf of plug-in authors who have no style or can't type.

Instead, simply reject non-canonical procedure names and remove all
code that keeps aroud the original non-canonical shit just to pass it
back to the plug-in.
2019-08-18 01:55:47 +02:00
Michael Natterer b610475122 libgimp: remove gimp_register_file_handler_priority() 2019-08-18 00:44:18 +02:00
Michael Natterer 293d909cf4 plug-ins: port file-psd to GimpPlugIn
and remove all save arguments, they are completely unused, wtf?
2019-08-18 00:26:13 +02:00
Seong-ho Cho 93cd5b0b29 Update Korean translation 2019-08-17 13:16:43 +00:00
Jehan f705bfb395 libgimpbase: return 0 for GIMP_UNIT_PIXEL in gimp_unit_get_factor().
Just as documented, pixel unit should always return factor 0. There is
no need to call _gimp_unit_vtable.unit_get_factor().

This is even more important as there is one implementation of
unit_get_factor() in core, and another in libgimp and the one in libgimp
is expecting unit to always be >= GIMP_UNIT_INCH. So we were getting
CRITICALs in libgimp when calling gimp_unit_get_factor() on pixel unit
(for instance when drawing a GimpRuler).
2019-08-17 12:12:40 +02:00
Jehan 91bde62b08 plug-ins: make mail more robust.
I got a 'Invalid cross-device link' error (errno 18) on my system. Let's
add some redundancy and try g_file_move() if g_rename() failed.
This at least fixed my case.
2019-08-17 10:54:03 +02:00
Jehan f22290e0a2 libgimpwidgets: fix a warning. 2019-08-17 10:53:45 +02:00
Jehan 9e9e6f0e9a app: fix a warning. 2019-08-17 10:53:29 +02:00