Commit Graph

2164 Commits

Author SHA1 Message Date
Michael Natterer dbeed89858 libgimp: remove gimp_pdb_dump() and gimp_pdb_proc_exists() 2019-08-11 22:38:43 +02:00
Michael Natterer ae824dcab5 pdb, libgimp: remove the now unused gimp_pdb_proc_arg() and _proc_val()
Bye bye legacy.
2019-08-11 22:32:25 +02:00
Michael Natterer 533e947f50 libgimp: stop using gimp_pdb_proc_arg() and proc_val()
Their return values can be derived from the GParamSpec returned
by gimp_pdb_proc_argument() and proc_return_value().
2019-08-11 22:05:07 +02:00
Michael Natterer b35dbf0d77 libgimp: change the remaining "author" strings and variables to "authors" 2019-08-11 17:03:03 +02:00
Michael Natterer 1c9b3c7055 libgimp: add gimp_pdb_get_last_error() and _get_last_status()
and move the old API to gimplegacy.[ch].
2019-08-11 16:41:58 +02:00
Michael Natterer 6622cf0dc4 libgimp: add and fix docs, reorder GimpParamData and remove d_boundary 2019-08-11 15:38:07 +02:00
Michael Natterer d067441c31 libgimp: rename GimpLoad,SaveFunc to GimpRunLoad,SaveFunc
and document gimp_load,save_procedure_new().
2019-08-11 14:58:55 +02:00
Michael Natterer fc065f8add pdb, libgimp: add gimp_load_procedure_set_thumbnail_loader()
and move the old API to gimplegacy.[ch]
2019-08-11 14:27:41 +02:00
Michael Natterer 84629cc1d0 pdb, libgimp: move the old file proc registering API to gimplegacy.[ch]
Also, #define GIMP_DISABLE_COMPAT_CRUFT in all GimpPlugIn related
files to prevent accidential use of the old API.
2019-08-11 13:21:55 +02:00
Michael Natterer 0477e60200 libgimp: update gimp.def 2019-08-11 12:56:13 +02:00
Michael Natterer cd836e9d96 libgimp: add gimp_file_procedure_set_handles_uri()
Implementing a shiny new GimpFileProcedure doesn't mean the libraries
we use to load/save files are automatically capable of handling remote
files, so we still need this flag.
2019-08-11 12:52:28 +02:00
Michael Natterer a79eaaf503 libgimp: add GimpFileProcedure, GimpLoadProcedure and GimpSaveProcedure
which are GimpProcedure subclasses with API to register as load/save
handlers and their own kind of run functions that get their standard
arguments passed directly instead of packed into a GimpValueArray.

They also register their standard arguments themselves, which removes
quite some boilerplate from load/save plug-ins.

Remove gimpprocedure-private.[ch] because install() and uninstall()
are now virtual functions of GimpProcedure.
2019-08-10 22:01:37 +02:00
Michael Natterer e6d662e352 libgimp*: various doc fixes 2019-08-10 12:32:25 +02:00
Michael Natterer 60b6f34737 pdb, libgimp: fix various doc issues found by gtk-doc 2019-08-10 11:08:06 +02:00
Jehan 6fe24fcb0b libgimp: fix missing installed headers.
While doing so, better break the various source categories in libgimp/.
Otherwise we were duplicating some of the header list, hence we forgot
to install some of the headers.
2019-08-09 22:41:14 +02:00
Jehan 10c10e16b1 libgimp: add libgimp_built_sources inside libgimp_introspectable. 2019-08-09 18:58:48 +02:00
Michael Natterer 354ce5f742 pdb, libgimp: one more annotation for gimp_enums_get_type_names() 2019-08-09 18:47:55 +02:00
Michael Natterer 6d24eb9bb2 pdb, libgimp: annotate gimp_enums_get_type_names()
and manually add gimpenums.c to the list of introspectable files.
2019-08-09 18:41:58 +02:00
Jehan 8f79ddbfe0 libgimp: add some (nullable) annotation and fix some comments. 2019-08-09 12:48:41 +02:00
Michael Natterer 41fb552988 libgimp: more docs and annotations 2019-08-09 12:41:45 +02:00
Jehan d28af77fc2 libgimp: make GimpProcBrowserDialog work both with the old and new API.
The dialog was still calling the old API gimp_pdb_query() everywhere,
which made it fail to run when called with the new API (e.g. from the
Python console or directly from an action) whereas it worked well when
called from the old API (e.g. from the Script-fu console). By testing
the existence of the GimpPDB singleton, we can have this dialog work in
both cases.
2019-08-09 02:32:52 +02:00
lillolollo 4cef17c7cf Issue #3758: fixes the build on mingw-w64.
Fixes:
> '_argc' undeclared (first use in this function)
2019-08-09 01:18:22 +02:00
Michael Natterer 155bc75a75 libimp*, app: get rid of inline pixbufs in the API and in pluginrc
because they are deprecated.

Change GIMP_ICON_TYPE_INLINE_PIXBUF to GIMP_ICON_TYPE_PIXBUF and the
libgimp API to (icon-name, GdkPixbuf, GFile). Use the file's uri and a
PNG blob of the pixbuf to pass around on the wire and for storage in
pluginrc.
2019-08-09 00:16:35 +02:00
Michael Natterer 244b52bf0d pdb, libgimp: make the "pdb" PDB group private
and don't install its header. Temporarily add its only two remaining
needed functions to gimppdb.[ch].

Also some Makefile cleanup.
2019-08-08 21:55:11 +02:00
Jehan 25ec0a0381 libgimp: GObject Introspection now depends on Babl-0.1 introspected lib.
And that's a lot of less warnings now! Youhou!
2019-08-08 18:02:23 +02:00
Jehan f49f1b587a libgimp: improve GimpProcedure icon functions.
gimp_procedure_set_icon() and gimp_procedure_get_icon() are not very
nice functions for bindings. They are still usable, but in most
bindings, the data parameter/returned value would end up like a uint
list which you'd want to convert to a string in the icon name or file
path case. It's still possible but very cumbersome.

Instead, I skip both functions for bindings and create specific
gimp_procedure_set_icon_*() and gimp_procedure_get_icon_*() functions,
which are much more binding-friendly.
2019-08-08 17:35:20 +02:00
Jehan 9339741135 libgimp: unnecessary (out) annotation on return value.
Fixes:
> Warning: Gimp: unexpected annotation: out
2019-08-08 16:58:56 +02:00
Jehan 376552fbfc libgimp: fix the build.
Autotools were not able to recognize that libgimp-@GIMP_API_VERSION@.la
and ../libgimp/libgimp-@GIMP_API_VERSION@.la were the same dependency.
Hence with multi-thread builds, GI scanner was not waiting for the lib
to be totally built then failed randomly. Make the path recognizable,
and do the same for libgimpui.
For other libgimp*, I still need to keep a more complicated relative
path, but since libgimp/ is the last processed folder, AFAIK it won't
make problems.
2019-08-08 16:40:02 +02:00
Jehan 2dde79b3e7 libgimp*: move GObject Introspection into libgimp/.
libgimp is anyway processed at the very end after all other libgimp*
were built. This way, it also fixes #3746, by removing the $(top_srcdir)
everywhere from introspected files, hence making the build work again
with older automake.
2019-08-08 15:59:44 +02:00
Michael Natterer 35ead93a8f libgimp: simplify gimp_pdb_run_procedure_valist() a lot
by using gimp_value_array_new_from_types_valist().
2019-08-08 13:27:34 +02:00
Michael Natterer 30d63111c3 libgimp*, pdb: gimp_value_array_new_from_types*() takes (type, value)
So a value array can now we created like this:

array = gimp_value_array_new_from_types (&error_msg,
                                         G_TYPE_STRING, "foo",
                                         G_TYPE_INT,    23,
                                         G_TYPE_NONE);

Change PDB generation to use this, which makes for much nicer code in
the libgimp wrappers, and only set arrays separately instead of all
values.
2019-08-08 13:01:50 +02:00
Michael Natterer dd8bf71f96 libgimp: make "pdb" a construct-only property of GimpPDBProcedure 2019-08-08 12:12:55 +02:00
Michael Natterer d156028c8a libgimp*, app: add the help-id to the wire protocol
Pass the help-id specified by the procedure to the core, and use it in
the core if set instead of always using the procedure's name (which
was probably good enough for all eternity, but it's still more
consistent this way).
2019-08-08 09:57:56 +02:00
Michael Natterer 0aa2dcfadb libgimp: replace gimp_pdb_dump() and gimp_pdb_query() by new API
and move them to gimplegacy.[ch].
2019-08-08 01:14:35 +02:00
Michael Natterer 5d80b74204 libgimp: more docs and annotations for GimpPDB 2019-08-08 00:34:16 +02:00
Michael Natterer e1276e2eda libgimp: help_func is (scope async) 2019-08-08 00:05:56 +02:00
Michael Natterer 6b2624f021 libgimp: don't connect a NULL destroy notify 2019-08-07 23:45:25 +02:00
Michael Natterer c6bcb3114f libgimp: add GDestroyNotify for image and item combo box data 2019-08-07 23:16:25 +02:00
Michael Natterer b2582e80f6 libimp: merge public gimppixbuf functions into gimplayer and gimpdrawable
and remove gimppuxbuf.h from the public API. Keep the files privately
for _gimp_pixbuf_from_data().
2019-08-07 22:26:05 +02:00
Michael Natterer c08186e6fe libgimp*: fix some parameter inconsistencies to silence GI warnings 2019-08-07 22:05:12 +02:00
Michael Natterer e437e00adf pdb, libgimp: hide gimpunit_pdb.h and gimpplugin_pdb.h from the API
They only contain private functions and don't need to be installed or
included by gimp_pdb_headers.h.

The PDB generation part is done by adding a "lib_private" variable
that can be set on PDB groups which should not be public API; the rest
is manual Makefile fiddling.
2019-08-07 18:47:24 +02:00
Jehan fc620ee67e libgimp: read and write channel should be boxed properties.
gpointer is not introspectable, and we should always prefer boxed types
over generic pointer types (thanks nielsdg!).
This also fixes gjs (JavaScript) binding of our API which was dropping
our properties even though they didn't need to be handled in JS.

See https://gitlab.gnome.org/GNOME/gjs/issues/266
2019-08-07 12:31:17 +02:00
Michael Natterer 0ef65bc647 pdb: move gimp_plugin_set,get_pdb_error_handler() to gimplegacy.[ch]
Hide the PDB wrappers and add the same API to GimpPlugIn.
2019-08-07 11:01:53 +02:00
Michael Natterer 1e6abab1d3 libgimp: name parameters "procedure_name" not just "name"
and some random cleanup.
2019-08-07 10:43:07 +02:00
Michael Natterer 7b58cb1d28 libgimp: move most old gimp_pdb functions to gimplegacy.[ch] 2019-08-07 00:27:34 +02:00
Michael Natterer 64d880f1fe libgimp: add gimp_pdb_temp_procedure_name() and hide the PDB wrapper 2019-08-07 00:19:38 +02:00
Michael Natterer 2599c6e071 libgimp: add some const to input parameters, like const GimpValueArray*
for procedure arguments. This implies creating a new value array in
gimp_procedure_run() if the passed array is too short, instead of
just appending to the passed array, which was ugly anyway.
2019-08-07 00:04:58 +02:00
Michael Natterer 877a116667 libgimp: fix typo in G_OS_WIN32 code 2019-08-06 23:54:34 +02:00
Michael Natterer 500a840f50 libgimp: forgot to add gimplegacy-private.h 2019-08-06 23:28:29 +02:00
Michael Natterer cc5e9240d2 libgmp: move the remaining legacy code to gimplegacy, even PLUG_IN_INFO
Add gimplegacy-private.h to keep it separate from gimp-private.h.

The legacy code could now be removed and GimpPlugIn-ported plug-ins
would not notice.
2019-08-06 23:06:15 +02:00