Commit Graph

43887 Commits

Author SHA1 Message Date
Michael Natterer 454822e58f data: add python.env to set up the GI_TYPELIB_PATH to Gimp-3.0.typelib 2019-08-04 18:20:25 +02:00
Michael Natterer d34bc03229 libgimp: don't leak the temp callback name in the data select impls 2019-08-04 18:04:18 +02:00
Michael Natterer fad59611bc libgimp: port gimpprogress to the new plug-in API, untested
It's tested to still work when using the old API though.
2019-08-04 17:51:59 +02:00
Jehan 026cc0f149 libgimp: fix s/m_float/m_enum/ for GP_PARAM_DEF_TYPE_ENUM. 2019-08-04 17:23:54 +02:00
Michael Natterer 89feeecc96 libgimp: make GimpFontSelectButton interpret NULL as the current font
like all other select buttons do.
2019-08-04 17:14:18 +02:00
Michael Natterer ae7fa2a1de libgimp: clean up the instance private code in all select buttons 2019-08-04 17:04:22 +02:00
Michael Natterer b6033684ff plug-ins: add all brush, pattern etc. select buttons to pagecurl
They do nothing but testing themselves with the new plug-in API, this
is of course temporary.
2019-08-04 17:02:21 +02:00
Michael Natterer 6e80a2324f libgimp: port gimp*select.[ch] to the new plug-in API
Use the new implementation only if a GimpPlugIn exists, use the old
code otherwise. Add a GDestroyNotify for the callabck's user_data.
2019-08-04 16:08:49 +02:00
Piotr Drąg 224af7e42f Update Polish translation 2019-08-04 15:19:28 +02:00
Øyvind Kolås 1661aab620 plug-ins: link dds plugins against libm 2019-08-04 14:22:09 +02:00
Michael Natterer 0f8747f10a app: avoid GIMP_TYPE_INT32 with gimp_pdb_execute_procedure_by_name()
Instead, use the actual enum type, G_TYPE_BOOLEAN, and G_TYPE_INT for
plain integers.
2019-08-04 14:10:42 +02:00
Michael Natterer 4962428440 app: relax GIMP_TYPE_INT32 checks in gimp_pdb_execute_procedure_by_name()
allow to pass booleans and enums to GIMP_TYPE_INT32 arguments. We
didn't have them in the old plug-in API, and being less strict allows
for booleans and enums being passed to old procedures transparently.
2019-08-04 13:57:05 +02:00
Jehan c822350fb3 plug-ins: forgot to change run() signature to new API in python-console. 2019-08-04 12:22:01 +02:00
Michael Natterer cc8fc0f90f libgimp*: add GI's .dirstamp to .gitigore 2019-08-03 19:50:17 +02:00
Michael Natterer 9549be2539 libgimp: kill the plug-in when old API is used while a GimpPlugIn exists 2019-08-03 18:20:28 +02:00
Niels De Graef 529aa743dd Start using g_object_notify_by_pspec()
`g_object_notify()` actually takes a global lock to look up the property
by its name, which means there is a performance hit (albeit tiny) every
time this function is called. For this reason, always try to use
`g_object_notify_by_pspec()` instead.
2019-08-03 15:57:10 +00:00
Michael Natterer 910828bf51 app: better error reporting in gimp_pdb_dialog_run_callback()
Display the error returned from trying to run the temp procedure.
2019-08-03 17:29:34 +02:00
Michael Natterer 38089bb61f libgmp: more useless includes 2019-08-03 17:12:27 +02:00
Michael Natterer e705ab050e libgimp: remove useless includes 2019-08-03 17:11:30 +02:00
Michael Natterer eaf5c792bf plug-ins: port pagecurl to the new API, to have a GUI plug-in to test 2019-08-03 17:10:33 +02:00
Michael Natterer 20d04e029f app, libgimp: support normal GParamInt for plug-in procedures 2019-08-03 17:00:43 +02:00
Michael Natterer 5b8deb68b4 libgimp: make sure GimpProcedures always get all their arguments
gimp_procedure_run(): fill the value array with default values so a
procedure's run callback always gets a complete value array. No more
number-of-arguments checking in any new-style plug-in.
2019-08-03 17:00:43 +02:00
Jehan 5cd09366e1 libgimp: fix gimp_procedure_add_*_from_property().
Argh I changed the signature and added a new parameter, but forgot to
update the implementation!
2019-08-03 16:42:19 +02:00
Michael Natterer ad8dcff199 libgimp: add _gimp_plug_in_read_expect_msg()
and make the places who need it dispatch between it and
_gimp_read_expect_msg() depending on whether there is a GimpPlugIn
instance. Also clean up some includes.
2019-08-03 12:52:22 +02:00
Michael Natterer 3dd79f42c3 Revert "libgimp: move _gimp_read_expect_msg() back to gimp.c"
This reverts commit 366047f423.
2019-08-03 12:37:32 +02:00
Michael Natterer 992f4b0e8a libgimp: add gimp_get_plug_in() which returns the GimpPlugIn singleton 2019-08-03 12:20:22 +02:00
Niels De Graef 5f92ced1f3 Add (nullable) if applicable
Basically this commit makes sure that all return values that are marked
as "Returns:" also have a `(nullable)` annotation if it is mentioned on
the same line that NULL can also be returned.

This will prevent a few problems in GObject-introspection.
2019-08-03 07:53:47 +00:00
Niels De Graef 1dda60154c Use "Returns:" to annotate return values
To be able to annotate return values through GObject-introspection, you
need to make sure it is tagged with `Returns:` and not something else.
2019-08-03 07:53:47 +00:00
Niels De Graef 746a72b956 Make sure to use % for constants
Documentation-wise in C, this doesn't matter a lot, but it allows
GObject-Introspection based bindings to use their built-in versions when
they want to render any kind of documentation (for example, docs for
Python plugins can render `%NULL` as `None`).
2019-08-03 07:53:47 +00: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 58b3ca816a plug-ins: port python-console to new API. 2019-08-03 09:46:52 +02:00
Jehan 6a1df5be31 libgimpwidgets: fix a copy-paste bug in function docs. 2019-08-03 09:38:46 +02:00
Jehan 04598b1522 plug-ins: use new gimp_procedure_add_*_from_property() in Python.
Since GParamSpec are not working fine (cf. pygobject#227), we have this
trick of initializing new arguments or return values with properties.
Use this trick in the palette-to-gradient plug-in.
2019-08-03 09:38:46 +02:00
Jehan 2c4a8c89ed libgimp, app: allow usage of GParamSpecString procedure arguments.
Just consider these as a GimpParamSpecString with default allow_non_utf8
and non_empty values (FALSE).
2019-08-03 09:38:46 +02:00
Jehan 0787510810 libgimp: add gimp_procedure_add_(argument|return_value)_from_property().
This will be used at least for the Python plug-ins. There is currently a
bug preventing to set a GParamSpec in a binded API.
See pygobject#227.

Please don't revert this. At least it allows to use the new GimpPlugIn
API for Python plug-ins. Anyway even with the old API, I had to add ugly
temporary API for the introspection (which I will now remove as they
never made it to release). So we are trading an ugly situation for a
less ugly one.
We can always remove these 2 new functions before release if we find or
implement better solutions before.
2019-08-03 09:38:21 +02:00
Ell 95429ad704 Issue #3723 - Symmetry Painting with random colour isn't symmetrical
In GimpPaintbrush, calculate grad_point in
_gimp_paintbrush_motion() independently of any stroke, and pass
its value down to GimpPaintbrush::get_paint_params() at each
stroke, so that the color is the same for all strokes, even when
using a color/random dynamics.
2019-08-02 22:28:59 +03:00
Michael Natterer 219fa33eb2 libgimp: create the GimpPlugIn much later in gimp_main_internal()
it will soon get some construct properties that are not known earlier.
2019-08-02 20:53:43 +02:00
Michael Natterer a50069e176 libgimp: change the return values of GimpPlugIn::init_procedures()
and ::query_procedures() to a GList* of strings.
2019-08-02 19:10:13 +02:00
Michael Natterer e3374e7d4e libgimp: make gimp_close() static to gimp.c again
Instead of calling _gimp_close() and returning from both the main
plug-in loop variants, simply only return and call gimp_close() from
where both loops return to, at the end of gimp_main_internal().
2019-08-02 18:48:07 +02:00
Øyvind Kolås 05d47f197a build: require babl-0.1.70 2019-08-02 18:44:15 +02:00
Michael Natterer 366047f423 libgimp: move _gimp_read_expect_msg() back to gimp.c
and make it distinguish between old and new plug-in running.
2019-08-02 18:26:52 +02:00
Michael Natterer 856fe16070 libgimp: add _gimp_plug_in_run() and copy the main plug-in loop to GimpPlugIn
Move the legacy loop code to gimplegacy.c. Also remove some more stuff
from gimp.c, old and new are now completely separate apart from one
glitch which wll go next...
2019-08-02 17:05:51 +02:00
Jehan bc7b358802 libgimp, plug-ins: remove n_procedures from (init|query)_procedures().
The way currently implemented plug-ins are, they are already
NULL-terminating the returned arrays. Since a procedure name cannot be
NULL itself by definition, defining the array length by a terminal NULL
is enough. There is no need to also add a n_procedures parameters which
is just one more possible bug source, even more as we were already
expecting the NULL termination by using g_strfreev() to free the memory.

Anyway a length parameter does not bring any advantage since a plug-in
can still "lie" about its array size (just as it can forget to
NULL-terminate it) and when this happens, the plug-in will segfault.
That's it, it's just a plug-in programming error.

Last but not least, some binding seem to have issues with returned array
setting an (out) parameter as the length. In pygobject at least, the
length parameter doesn't disappear and we end up with this ugly
signature:

> In [3]: Gimp.PlugIn.do_query_procedures.__doc__
> Out[3]: 'query_procedures(self) -> list, n_procedures:int'

See bug report pygobject#352.
To avoid this, we should either set both the array and the length as
(out) parameters or just set the returned array as NULL-terminated
(which is the solution I chose).
2019-08-02 13:50:38 +02:00
Jehan 3945701bd6 plug-ins: localization calls must happens inside query().
It's a bit weird because this has to happen during the query() step, but
plug-ins don't have access to this step anymore, apart from
query_procedures(), which then turns out to be badly named.
2019-08-02 12:58:37 +02:00
Jehan ed619d9ebd libgimpbase: add documentations on gimpparasite public functions.
Once again, the "Since:" is the result of a bit of `git log` archeology.
Hopefully it's right (should be according to tags. Still…).
2019-08-02 12:22:25 +02:00
Michael Natterer 1e2efcf95e libgmp: reorder GimpPlugIn's query(), init(), quit()
in plug-in lifecycle order.
2019-08-02 12:05:28 +02:00
Michael Natterer 5f8d0ef27b libgimp: add gimp_plug_in_extension_enable() and _extension_process()
Start copying all the actual wire communication to GimpPlugIn, and
move the legacy versions to gimplegacy.c.

This implies having the entire protocol code twice, but without any
if(PLUG_IN) { plug_in_stuff(); } else { legacy_stuff(); }

At the moment it is a wild mixture of old and new, but when finished
the wire code in gimplegacy.c will be entirely separate from the wire
code in GimpPlugIn, which will make it easy to g_assert() that only
one API is used by a plug-in.
2019-08-02 12:02:20 +02:00
Jehan 19fbb1d9a8 libgimpwidgets: add documentation for many functions and fix...
... an annotation.
s/(transfer-none)/(transfer none)/
For the "Since:" value, I did some git log archeology. Hopefully I got
these right.
2019-08-02 11:46:39 +02:00
Jehan 3a4b17e8b5 libgimpmath: make GimpVector[23] boxed types.
This way, all functions using these types are now introspectable.
2019-08-02 03:47:23 +02:00
Jehan 0411c7ef97 libgimp: fix some annotations. 2019-08-02 03:21:59 +02:00