app, libgimp: get rid of all ID GTypes and ID param specs

Turn all ID param specs into object param specs (e.g. GimpParamImageID
becomes GimpParamImage) and convert between IDs and objects in
gimpgpparams.c directly above the the wire protocol, so all of app/,
libgimp/ and plug-ins/ can deal directly with objects down to the
lowest level and not care about IDs.

Use the actual object param specs for procedure arguments and return
values again instead of a plain g_param_spec_object() and bring back
the none_ok parameter.

This implies changing the PDB type checking functions to work on pure
integers instead of IDs (one can't check whether object creation is
possible if performing that check requires the object to already
exist).

For example gimp_foo_is_valid() becomes gimp_foo_id_is_valid() and is
not involved in automatic object creation magic at the protocol
level. Added wrappers which still say gimp_foo_is_valid() and take the
respective objects.

Adapted all code, and it all becomes nicer and less convoluted, even
the generated PDB wrappers in app/ and libgimp/.
This commit is contained in:
Michael Natterer 2019-08-29 11:25:35 +02:00
parent d68ef36974
commit 392f00baf5
115 changed files with 7588 additions and 9166 deletions

View file

@ -168,3 +168,22 @@ gimp_display_get_by_id (gint32 display_id)
return NULL;
}
/**
* gimp_display_is_valid:
* @display: The display to check.
*
* Returns TRUE if the display is valid.
*
* This procedure checks if the given display is valid and refers to
* an existing display.
*
* Returns: Whether the display is valid.
*
* Since: 2.4
**/
gboolean
gimp_display_is_valid (GimpDisplay *display)
{
return gimp_display_id_is_valid (gimp_display_get_id (display));
}