Commit Graph

44199 Commits

Author SHA1 Message Date
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
Piotr Drąg 4a56f1d9cc Update POTFILES.in 2019-08-10 16:42:35 +02:00
Michael Natterer 299d657ff1 libgimpbase: change gimpprotocol GPParamDefInt's members to gint64
so the full range of any unsigned int param spec's values fits.
2019-08-10 16:25:22 +02:00
Michael Natterer 4bafbeca1b devel-docs: doc updates, more doc modules without any warnings 2019-08-10 12:32:56 +02:00
Michael Natterer e6d662e352 libgimp*: various doc fixes 2019-08-10 12:32:25 +02:00
Michael Natterer 6cb027f402 devel-docs: update the libgimp docs 2019-08-10 11:08:33 +02:00
Michael Natterer 60b6f34737 pdb, libgimp: fix various doc issues found by gtk-doc 2019-08-10 11:08:06 +02:00
Michael Natterer 7e504a0ddd libgimpconig: fix indentation in gimpscanner.h 2019-08-10 11:07:27 +02:00
Michael Natterer 2182efddfb devel-docs: update the libgimpconfig docs 2019-08-10 09:42:28 +02:00
Michael Natterer b6d39a4f3f devel-docs: update libgimpbase docs 2019-08-10 02:29:32 +02:00
Jehan ae7dfba2c4 libgimpwidgets: fix some typos.
s/logharithmic/logarithmic/
2019-08-09 23:40:07 +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
Niels De Graef 1743f474e5 app/widgets: Use G_DECLARE_INTERFACE()
This cuts aways a little of the GObject boilerplate.
2019-08-09 19:48:21 +00:00
Niels De Graef d3e9e5617d app/core: Use G_DECLARE_INTERFACE()
This cuts aways a little of the GObject boilerplate.
2019-08-09 19:48:21 +00:00
Niels De Graef a0ba37649d libgimpcolor: colormanaged: Use G_DECLARE_INTERFACE()
This cuts aways a little of the GObject boilerplate.
2019-08-09 19:48:20 +00:00
Niels De Graef aefb40c82a libgimpconfig: Ensure G_PARAM_STATIC_STRINGS
The `GIMP_CONFIG_PROP_*` macros do not automatically set
`G_PARAM_STATIC_STRINGS`, which means each property that uses such a
macro does not have this flag set by default (and almost none set it
themselves). By adding `G_PARAM_STATIC_STRINGS` to
`GIMP_CONFIG_PARAM_FLAGS`, we can prevent this from happening, which
should lead to some unnecessary string copies being prevented.
2019-08-09 19:27:02 +00:00
Ell ce6dfd3194 pdb: fix image-mask transforms
In the various PDB transform functions, avoid erroneously creating
a floating selection when transforming the image mask, and rather
transform the mask normally.
2019-08-09 22:23:35 +03:00
Ell 33a389cd0c app, pdb: use gimp_item_get_clip() everywhere
Remove the special clipping-mode handling for channels throughout
the transform (and drawable-filter) code, and rather use
gimp_item_get_clip(), added in the previous commit, instead.  As
mentioned in the previous commit, we only modify the clipping mode
in top-level code, while having lower-level code use the clipping
mode as-is.  This not only hides the actual clipping-mode logic
from the transform code, but, in particular, allows code performing
transformation internally to use arbitrary clipping modes.

Also, this commit fixes a bunch of PDB bugs all over the place :)
2019-08-09 22:23:17 +03:00
Ell d5cdcc6c02 app: add gimp_item_get_clip()
Add a new GimpItem::get_clip() virtual function, and a
corresponding gimp_item_get_clip() function, which return the
actual clipping mode to be used when transforming (or applying a
filter to) a given item, given the original clipping mode.  This
applies only to whole-item transformations (i.e., when not creating
a floating selection), and should be used by the top-level code
applying the transformation, rather than by the actual
transformation code, so that the item can be transformed using a
different clipping mode internally.

Provide a default implementation that simply returns the input
clipping mode, and override for GimpChannel (to always return CLIP)
and for GimpVecotrs (to always return ADJUST).
2019-08-09 22:22:50 +03:00
Ell f9fb3e6fad app: fix layer-mask offset when applying filter to layer without clipping 2019-08-09 22:22:50 +03:00
Jehan ba5a583a5d gitlab-ci: configure with --with-javascript=force.
We don't actually need the GJS dependency at build-time. This is really
more of a packager warning.
2019-08-09 19:01:34 +02:00
Jehan 10c10e16b1 libgimp: add libgimp_built_sources inside libgimp_introspectable. 2019-08-09 18:58:48 +02:00
Michael Natterer c9b22def51 libgimpconfig: update gimpconfig.def 2019-08-09 18:51:12 +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 f9f144b4bc configure: add a check for gjs (JavaScript interpreter with GI binding).
As discussed on IRC, I am not sure if really this is needed, since
theoretically we now have support for a whole bunch of languages without
doing anything (languages supported by GObject Introspection) and we are
not going to check for all of them.
Yet since now we install one JS plug-in, let's still do a quick check.
We'll see later if we want to change how we handle supported script
languages.
2019-08-09 18:40:14 +02:00
Jehan b1662443af m4macros, configure: add and use AM_PYTHON_CHECK_PYGOBJECT() macro.
Rather than looking for pygobject-3.0 with pkg-config, run an actual
test in python, loading the 'gi' module.
I also added a version parameter making it possible to even check for a
required version of PyGObject, though it is currently unused (as I have
no idea if we have a minimum requirement for our plug-ins to work well).

This is an improvement of commit 8e938e0960 as I realized that we don't
need any development files, therefore I don't think that searching with
pkg-config was the right idea in our case.
2019-08-09 18:18:21 +02:00
Jehan 96a33277d4 gitlab-ci: configure GIMP with --with-python=force.
We don't actually need any of the Python dependencies at runtime. We
only check for these to make packagers aware of the runtime need. Force
the build to go forward even with these deps.
2019-08-09 17:08:53 +02:00
Jehan 8e938e0960 configure: also look for pygobject-3.0 runtime dependency.
If we decide to look for Python dependencies, we should also look for
pygobject as it provides the GI binding to Python.
I'm still not sure if we should look for these runtime dependencies at
configure time. But for the time being, if we continue doing so, let's
do it right.
2019-08-09 16:43:34 +02:00
Jehan c1f28f7e8c plug-ins: rename the C goat exercise to goat-exercise-c.
Makes for consistent naming of the different demo code we have there.
2019-08-09 15:48:25 +02:00
Jehan d0be3d3e0c plug-ins: get rid of getCurrentPath() in goat-exercise-gjs.js.
The file path was already the same as ARGV first argument (i.e.
System.programInvocationName as I added this myself!). Why did I even
bothered with this annoying trick!
This makes the code much simpler, which is better for demo code.
2019-08-09 15:48:25 +02:00
Jehan 9ed4dd5dde plug-ins: add a goat-exercise-py3.py.
Right now it is not working, always because of the same bug about not
being able to create GParamSpec (pygobject#227). As a consequence, I
tried a workaround by creating object properties and using their spec
instead. But it turns out that in pygobject, I cannot create random
properties for custom types (well I could for boxed types or GObject
subclasses, not for GimpImageID or GimpDrawableID). Cf. pygobject#357.
So I am stuck again.

Anyway I still push this demo file which would just work as it is, if we
coult at least got the image/drawable ID.
I comment out the Makefile.am part for now until we can get the issues
sorted out.
2019-08-09 15:48:25 +02:00
Michael Natterer b45c2a6f78 libgimpcolor: rudimentary docs for gimp_adaptive_supersample_area()
and proper callback annotations. Also move the three callback typedefs
from gimpcolortypes.h to gimpadaptivesupersample.h because they are
needed nowhere else.
2019-08-09 15:24:49 +02:00
Jehan 9454567e8c plug-ins: pre-load Babl module in Python console. 2019-08-09 14:41:40 +02:00
Michael Natterer 31b8ea4a90 libgimpbase: add lots of const to GimpEnumDesc and GimpFlagsDesc APIs 2019-08-09 13:29:34 +02:00
Michael Natterer 55940b733b libgimpwidgets: add a GDestroyNotify for gimp_help_connect()'s user_data 2019-08-09 13:11:30 +02:00
Michael Natterer ebddecd696 libgimpwidgets: more docs and annotations 2019-08-09 12:59:41 +02:00
Michael Natterer 4add4c6645 libgimpbase: add a GimpStringArray typedef and use it 2019-08-09 12:54:09 +02:00
Jehan 8f79ddbfe0 libgimp: add some (nullable) annotation and fix some comments. 2019-08-09 12:48:41 +02:00
Michael Natterer d3d621b502 libgimpconfig: add a GimpScanner typedef and make it a boxed type
Replace _destroy() by _ref() and _unref().
2019-08-09 12:42:52 +02:00
Michael Natterer 41fb552988 libgimp: more docs and annotations 2019-08-09 12:41:45 +02:00
Michael Natterer 8cfef5e60d libgimpwidgets: more docs and annotations 2019-08-09 12:32:09 +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 fd55514416 plug-ins: eek, twain calls gimp_main() directly
Make it call gimp_main_legacy() instead.
2019-08-09 00:50:32 +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 6ffd25b9f7 plug-ins: use new procedure.set_icon_name() in JavaScript demo. 2019-08-08 17:43:13 +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