Make PDB API more object oriented for array parameters
In object oriented programming, an array object knows its own length.
The PDB API currently requires passing two parameters (length, array) e.g. (n_drawables, drawables). The proposed enhancement is to pass only one parameter, the array. The benefit is a simplified API, more in tune with OO languages (and GObject) used to write plugins.
This can be implemented by changing PDBGEN, the tool (Perl code) that generates much code for PDB procedures. Demonstrative patch files are attached. The patch demonstrates that it can work, but needs much improvement (cruft exists and whitespace is garbled). The patch code can be thought of as generating a "binding" from the C API of libgimp to/from the OO API of the PDB.
It is a good time to make the enhancement, since GIMP is undergoing major revision.
The patch might not be sufficient since other Gimp code might requires change. For example, calls to PDB procedure gimp-file-save (whose signature is changed by the patch.) There could be other Gimp code that passes arrays to PDB procedures and requires change. Its not easy to determine a complete patch since the compiler doesn't check calls to PDB procedures. The patch works (generates code that compiles, of the desired signature in the PDB), but probably breaks things.
The impact on existing third party plugins is probably minimal, since few pass arrays to PDB procedures, and they all need rewriting anyway.
The enhancement does not require changes to the .pdb files (the files that specify internal PDB procedures.) Such files continue to specify the parameters of an internal PDB procedure in terms closely corresponding to the C API of the libgimp functions they wrap (yet the PDB API becomes object oriented, lacking the "array length" parameter.)
For consistency, the signature of file load/save plugins (of procedure type PLUGIN) e.g. file-jpeg-save might also be changed similarly. The patch only changes the signature of procedures of procedure type INTERNAL.enhancePDBAPI.diff