From 39c2b837466f6edb3770a390cdd3e14dcaf13b1f Mon Sep 17 00:00:00 2001 From: Jehan Date: Sun, 15 Dec 2024 13:30:10 +0100 Subject: [PATCH] libgimp: allow passing GeglParamSeed arguments from plug-ins. In particular, I encountered some script-fu scripts calling some GEGL ops with a seed, but this argument wouldn't be reproduced in the config object. Technically it's just a uint. Let's just pass them as such. --- libgimp/gimpgpparams-body.c | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/libgimp/gimpgpparams-body.c b/libgimp/gimpgpparams-body.c index 7130c87c31..81b4232ad9 100644 --- a/libgimp/gimpgpparams-body.c +++ b/libgimp/gimpgpparams-body.c @@ -117,7 +117,13 @@ _gimp_gp_param_def_to_param_spec (const GPParamDef *param_def) param_def->meta.m_int.default_val, flags); - if (! strcmp (param_def->type_name, "GParamUInt")) + if (! strcmp (param_def->type_name, "GParamUInt") || +#ifdef LIBGIMP_COMPILATION + ! strcmp (param_def->type_name, "GeglParamSeed") +#else + FALSE +#endif + ) return g_param_spec_uint (name, nick, blurb, param_def->meta.m_int.min_val, param_def->meta.m_int.max_val, @@ -364,7 +370,13 @@ _gimp_param_spec_to_gp_param_def (GParamSpec *pspec, param_def->meta.m_int.max_val = ispec->maximum; param_def->meta.m_int.default_val = ispec->default_value; } - else if (pspec_type == G_TYPE_PARAM_UINT) + else if (pspec_type == G_TYPE_PARAM_UINT || +#ifdef LIBGIMP_COMPILATION + FALSE +#else + pspec_type == GEGL_TYPE_PARAM_SEED +#endif + ) { GParamSpecUInt *uspec = G_PARAM_SPEC_UINT (pspec);