libgimp: update annotations for gimp_install_procedure() and...

... GimpRunProc function type.
In gimp_install_procedure(), make sure that @params and @return_vals are
processed as arrays, otherwise they are unusable.

As for the run procedure, make so that @return_vals and @n_return_vals
are considered as returned values. In Python binding for instance, that
makes these not parameters anymore, but actually returnable by the run
function.

With these changes, I made the first fully functional GI Python plug-in,
which just creates a new image and a display for this image. Still a lot
to improve clearly, but we are on the right track. :-)
This commit is contained in:
Jehan 2019-07-25 19:27:16 +02:00
parent 74c69ae3c2
commit c20645054c
2 changed files with 17 additions and 17 deletions

View File

@ -741,21 +741,21 @@ gimp_quit (void)
/** /**
* gimp_install_procedure: * gimp_install_procedure:
* @name: the procedure's name. * @name: the procedure's name.
* @blurb: a short text describing what the procedure does. * @blurb: a short text describing what the procedure does.
* @help: the help text for the procedure (usually considerably * @help: the help text for the procedure (usually considerably
* longer than @blurb). * longer than @blurb).
* @author: the procedure's author(s). * @author: the procedure's author(s).
* @copyright: the procedure's copyright. * @copyright: the procedure's copyright.
* @date: the date the procedure was added. * @date: the date the procedure was added.
* @menu_label: the label to use for the procedure's menu entry, * @menu_label: the label to use for the procedure's menu entry,
* or #NULL if the procedure has no menu entry. * or #NULL if the procedure has no menu entry.
* @image_types: the drawable types the procedure can handle. * @image_types: the drawable types the procedure can handle.
* @type: the type of the procedure. * @type: the type of the procedure.
* @n_params: the number of parameters the procedure takes. * @n_params: the number of parameters the procedure takes.
* @n_return_vals: the number of return values the procedure returns. * @n_return_vals: the number of return values the procedure returns.
* @params: the procedure's parameters. * @params: (array length=n_params): the procedure's parameters.
* @return_vals: the procedure's return values. * @return_vals: (array length=n_return_vals): the procedure's return values.
* *
* Installs a new procedure with the PDB (procedural database). * Installs a new procedure with the PDB (procedural database).
* *

View File

@ -92,8 +92,8 @@ typedef void (* GimpQueryProc) (void);
* @name: the name of the procedure which has been called. * @name: the name of the procedure which has been called.
* @n_params: the number of parameters passed to the procedure. * @n_params: the number of parameters passed to the procedure.
* @param: (array length=n_params): the parameters passed to @name. * @param: (array length=n_params): the parameters passed to @name.
* @n_return_vals: the number of values returned by @name. * @n_return_vals: (out caller-allocates): the number of values returned by @name.
* @return_vals: (array length=n_return_vals): the returned values. * @return_vals: (array length=n_return_vals) (out callee-allocates): the returned values.
* *
* The run procedure is run during the lifetime of the GIMP session, * The run procedure is run during the lifetime of the GIMP session,
* each time a plug-in procedure is called. * each time a plug-in procedure is called.