Commit Graph

278 Commits

Author SHA1 Message Date
Michael Schumacher 530dc883ca app, libgimp*: glib-genmarshal warns about --header --body
Using --header --body is mentioned as being deprecated, the way to get the desired result said to be
--prototypes --body now.
2021-04-17 22:50:49 +02:00
Jehan 2e73e30afd libgimp: 'gimp_ui' as priority prefix for GimpUi introspected module.
Since meson 0.43.0 (below our current requirement), 'symbol_prefix'
argument of gnome.generate_gir() allows an ordered list. If I prepend
'gimp_ui', it makes any gimp_ui_*() function to not start with 'ui_'.

In particular, GimpUi.ui_init() becomes GimpUi.init() which is much less
redundant.
2020-09-26 22:11:53 +02:00
Ell 25aefa972e libgimp: link libgimpui against GEGL
Needed since commit 4c8ee413eb.
2020-09-13 10:25:30 +03:00
Niels De Graef acf50009f8 Allow building vala plugins 2020-05-26 17:52:52 +00: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 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
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
Michael Natterer 45e96a0ff4 libgimp: improve handling of procedure default values a lot
Add internal GimpProcedureConfig API to load/save "default values"
which are to be treated as if they were the hardcoded GParamSpec
defaults, but user-configurable. Also make all other load/save
functions available to other libgimp files.

In gimp_procedure_run(), if incomplete arguments are passed, don't
just complete them with the GParamSpec defaults, but look up the
user-saved defaults and use them if they exist. This happens before
everything else and brings back the PNG export feature of using
user-saved defaults also in non-interactive mode (but for all
procedures not just PNG export).

In GimpProcedureDialog, add "Load Defaults" and "Save Defaults"
buttons, they are the only way of managing the user-configurable
procedure defaults.

When clicking "Reset", show a popover with the reset options "Initial
Values" and "Factory Defaults".
2019-09-26 19:26:23 +02:00
Michael Natterer 0123bb3389 libgimp: make sure gimpparamspecs-body.c gets introspected 2019-09-05 21:09:28 +02:00
Michael Natterer 7019eaa56b app, libgimp: share the code of libgimp/gimpparamspecs.c with app/
move the code to gimpparamspecs-body.c and include it from both app/
and libgimp/. They are the same apart from a minor difference which we

Also share the entire libgimp/gimpparamspecs.h header with the core.
2019-09-04 16:48:26 +02:00
Michael Natterer a351ce9126 Remove the entire old plug-in interface 2019-09-04 00:03:12 +02:00
Michael Natterer a04e287966 libgimp: fold gimpplugin-private.c into gimpplugin.c
having that separation was a bad idea in the first place. Private,
really private, totally private in a separate file? just merge them.
2019-08-22 22:24:33 +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
Jehan 31bee77be9 libgimp: s/gimpdb-private.h/gimppdb-private.h/
Ok so that's why I thought it was not existing. There was actually a
typo!
2019-08-14 22:33:43 +02:00
Michael Natterer f8895f7f22 Revert "libgimp: gimpdb-private.h was removed."
It's very much alive :)

This reverts commit e67c922b00.
2019-08-14 20:44:36 +02:00
Jehan e67c922b00 libgimp: gimpdb-private.h was removed. 2019-08-14 20:28:10 +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
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 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
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 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 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 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
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
Michael Natterer 05baadcd1d pdb: rename the "procedural_db" PDB group to just "pdb" 2019-08-06 12:51:56 +02:00
Michael Natterer 450a9f90b4 libgimp: add a GimpPDB class and subclass GimpProcedure as GimpPDBProcedure
The idea is that we already have a GimpProcedure object in libgimp
which has name, help, blurb, arguments, return values and everything,
so we really don't need a parallel API to query PDB procedures for
their properties.

- make run() a virtual function of GimpProcedure
- move GIMP_PDB_ERROR to GimpPDB
- GimpPDBProcedure is a trivial subblass which populates
  GimpProcedure's members by querying the PDB.
- make "plug-in", "procedure-type" and "name" construct-only
  properties of GimpProcedure.

This is all work in progress.
2019-08-06 12:22:23 +02:00
Michael Natterer 8c1a43dff7 libgimp: move the debug code to new private files gimp-debug.[ch] 2019-08-04 23:26:31 +02:00
Michael Natterer ca1cb056fc libgimp: move the shm code to new private files gimp-shm.[ch]
and remove it from the public API, it should have never been
there in the first place.
2019-08-04 18:54:00 +02:00
Jehan b6e6f0b71b libgimp: gimplegacy not introspected anymore.
Also remove several functions which never made it to a GIMP release.
They were really meant as temporary anyway from the start, waiting for
the new API to be usable.
And GimpParam is not boxed anymore. This is made useless by the fact it
is not an introspected type now.
2019-08-03 09:46:56 +02:00
Jehan 826c09b629 libgimp: keep gimplegacy as introspectable, at least temporarily.
Recent commits broke the Python plug-ins again because the old API is
not introspected anymore. Of course, by release of GIMP 3, we should
probably remove this deprecated API from introspection. But first, we
have to figure out how and if the new API can be used in bindings.
2019-07-31 11:18:00 +02:00
Michael Natterer 7201be78d9 libgimp: add gimp-private.h for private stuff shared between files
instead of declaring stuff n time in various files. This also removes
gimp_read_expect_msg() as public symbol from libgimp.
2019-07-30 23:49:54 +02:00
Michael Natterer e9c0732595 libgimp: move old plug-in and procedure registering/calling code to gimplegacy.c 2019-07-30 22:05:42 +02:00
Michael Natterer 7b7c518782 libgimp: move the old plug-in and procedure api to gimplegacy.h
The implementations are still in gimp.c.
2019-07-30 21:36:32 +02:00
Michael Natterer 0a6f157d58 app, libgimp, libgimpbase: big plug-in API refactoring part three
- libgimpbase: change GPParam to transfer all information about the
  GValues we use, in the same way done for GPParamDef. GPParam is now
  different from GimpParam from libgimp, pointers can't be casted any
  longer. The protocol is now completely GimpPDBArgType-free. Remove
  gp_params_destroy() from the public API.

- libgimp: add API to convert between an array of GPParams and
  GimpValueArray, the latter is now the new official API for dealing
  with procedure arguments and return values, GimpParam is cruft (the
  wire now talks with GimpPlugIn more directly than with the members
  of GimpPlugInInfo, which need additional compat conversions).

- libgimp, app: rename gimpgpparamspecs.[ch] to simply
  gimpgpparams.[ch] which is also more accurate because they now
  contain GValue functions too. The code that used to live in
  app/plug-in/plug-in-params.h is now completely in libgimp.

- app: contains no protocol compat code any longer, the only place
  that uses GimpPDBArgType is the PDB query procedure implementation,
  which also needs to change.

- app: change some forgotten int32 run-modes to enums.
2019-07-29 12:22:58 +02:00
Michael Natterer 32ea28b6b1 app, libgimp, libgimpbase: plug-in and PDB protocol refactoring part two
- Change the wire protocol's GPProcInstall to transmit the entire
  information needed for constructing all GParamSpecs we use, don't
  use GimpPDBArgType in GPProcInstall but an enum private to the wire
  protocol plus the GParamSpec's GType name. Bump the wire protocol
  version.

- Add gimpgpparamspecs.[ch] in both app/plug-in/ and libgimp/ which
  take care of converting between GPParamDef and GParamSpec. They
  share code as far as possible.

- Change pluginrc writing and parsing to re-use GPParamDef and the
  utility functions from gimpgpparamspecs.

- Remove gimp_pdb_compat_param_spec() from app/pdb/gimp-pdb-compat.[ch],
  the entire core uses proper GParamSpecs from the wire protocol now,
  the whole file will follow down the drain once we use a GValue
  representation on the wire too.

- In gimp_plug_in_handle_proc_install(), change the "run-mode"
  parameter to a GParamSpecEnum(GIMP_TYPE_RUN_MODE) (if it is not
  already an enum). and change all places in app/ to treat it as an
  enum value.

- plug-ins: fix cml-explorer to register correctly, a typo in
  "run-mode" was never noticed until now.

- Add gimpgpcompat.[ch] in libgimp to deal with all the transforms
  between old-style wire communication and using GParamSpec and
  GValue, it contains some functions that are subject to change or
  even removal in the next steps.

- Change the libgimp GimpProcedure and GimpPlugIn in many ways to be
  able to actually install procedures the new way.

- plug-ins: change goat-exercise to completely use the new GimpPlugIn
  and GimpProcedure API, look here to see how plug-ins will look in
  the future, of course subject to change until this is finished.

- Next: changing GPParam to transmit all information about a GValue.
2019-07-28 17:34:40 +02:00
Michael Natterer 427b01a634 libgimp: add GType and GParamSpec types for all IDs, like image, drawable
Same set of functions and types as in app/, but purely ID-based.
2019-07-26 16:05:11 +02:00
Michael Natterer f2d399b17b libgimp: add initial version of a GimpPlugIn class
The new way of doing plug-ins:

- subclass GimpPlugIn in your plug-in
- implement its query() and run() methods, run() will move to a
  new GimpProcedure class soon
- instead of MAIN(), say GIMP_MAIN(YOUR_PLUG_IN_TYPE)

Instead of keeping around a GimpPlugInInfo struct, libgimp will
create an instance of your plug-in class, keep it around during
the plug-in's lifetime, and call its virtual functions.
2019-07-25 23:07:24 +02:00
Jehan 6389bb4b58 libgimp, libgimpbase: both introspectable under same namespace Gimp.
At first I thought these could be different namespaces, but actually
GObject Introspection parses files and can only use (AFAICS) the
namespace actually used in our C function, which is always `gimp_` (and
not `gimpbase_` or whatever.

So make the introspection at the root level, and it will include all
libgimp* libraries in one namespace, same as the C lib anyway. For now
only libgimp and libgimpbase as I am still testing.
Also I move the introspectable sources in their own file in order to
share the list between the library building Makefile and the GI
makefile because I can't find how to pass over variables otherwise.
2019-07-25 10:51:03 +02:00
Michael Natterer aafb55fa02 libgimp: remove GimpDrawable and GimpTile
The GimpDrawable abstraction is completely gone, GimpTile is now a
small struct in gimptilebackendplugin.c.

All tile handling code is now in GimpTileBackendPlugin, the backend
functions are simply calling gimp_tile_get() and gimp_tile_put()
directly.
2019-07-20 01:02:24 +02:00
Michael Natterer 6a59ccf840 libgimp: remove GimpTile from the public API, and kill the tile cache 2019-07-19 22:49:20 +02:00
Michael Natterer 60554eaed9 libgimp: remove GimpPixelRgn, it's now completely unused, yay! 2019-07-19 19:08:31 +02:00
Michael Natterer eb11aefa20 libgimp: remove gimppixelfetcher.[ch] it was deprecated and now unused
except for pygimp, but that's another pile to port to GEGL anyway and
isn't built currently.
2019-07-08 21:27:33 +02:00
Michael Natterer a7d86c572d libgimp: remove the deprecated gimpregioniterator.[ch]
it is now completely unused.
2019-07-07 17:16:40 +02:00
Ell a5102a7dba */Makefile.am: add *marshal.h files to BUILT_SOURCES
In subdirs containing a generated foomarshal.h header, add the
generated sources to BUILT_SOURCES, so that they're generated
before the rest of the source files are built.  Otherwise, since
there is no rule specifying the dependency between the rest of the
source files and foomarshal.h, and since foomarshal.h is not
checked into git (and hence doesn't exist when doing a clean
build), compilation of the said source files may fail if they're
built before foomarshal.h is generated.
2018-07-24 14:05:08 -04:00
Michael Natterer f180a171cd pdb: remove all deprecated procedures 2018-05-20 21:06:29 +02:00
Michael Natterer 9525c646e1 libgimp: remove tons of deprecated cruft 2018-05-20 21:06:29 +02:00