app, libgimp, pdb: new GimpDrawableFilterConfig class.

This is mostly an empty shell whose goal is to serve as base class for
specific dynamically generated per-operation subclasses, which will have
properties mimicking the arguments of the GEGL operation.

Most of the fundamental type args will just use the base GLib param spec
types instead of GEGL ones.

As a special case, the GeglParamEnum arguments are transformed into
GimpChoice param specs on libgimp side. The reason is that most of the
time, enum types are created within the scope of an operation code only
and cannot be properly reconstructed over the wire. I could just
transform these into an int type (which is mostly what is done in GEGL
right now when running an op with such arg), but GimpChoice allow much
nicer string-type args, which make much more semantic code. This class
was initially created for plug-ins, but it would work very well to run
GEGL ops on drawables. So let's do it.

Finally add a gimp_drawable_filter_get_config() to request the current
config of a filter.

Note that right now, we can't do much with this config object other than
observing an operation args and default values. Being able to update a
filter's settings will come up in further commits.
This commit is contained in:
Jehan 2024-11-28 01:07:23 +09:00
parent c49dec3416
commit 2cf6b637e7
16 changed files with 680 additions and 47 deletions

View file

@ -36,11 +36,12 @@ G_BEGIN_DECLS
G_DECLARE_FINAL_TYPE (GimpDrawableFilter, gimp_drawable_filter, GIMP, DRAWABLE_FILTER, GObject)
gint32 gimp_drawable_filter_get_id (GimpDrawableFilter *filter);
GimpDrawableFilter * gimp_drawable_filter_get_by_id (gint32 filter_id);
gint32 gimp_drawable_filter_get_id (GimpDrawableFilter *filter);
GimpDrawableFilter * gimp_drawable_filter_get_by_id (gint32 filter_id);
gboolean gimp_drawable_filter_is_valid (GimpDrawableFilter *filter);
gboolean gimp_drawable_filter_is_valid (GimpDrawableFilter *filter);
GimpDrawableFilterConfig * gimp_drawable_filter_get_config (GimpDrawableFilter *filter);
G_END_DECLS