[gimp] app, libgimp: support normal GParamInt for plug-in procedures



commit 20d04e029fcc493b6cf66c93181398a47930b344
Author: Michael Natterer <mitch gimp org>
Date:   Sat Aug 3 16:59:34 2019 +0200

    app, libgimp: support normal GParamInt for plug-in procedures

 app/plug-in/gimpgpparams.c  | 7 +++++++
 libgimp/gimpgpparams-body.c | 3 ++-
 2 files changed, 9 insertions(+), 1 deletion(-)
---
diff --git a/app/plug-in/gimpgpparams.c b/app/plug-in/gimpgpparams.c
index 5364f5b0b5..f01eb9def5 100644
--- a/app/plug-in/gimpgpparams.c
+++ b/app/plug-in/gimpgpparams.c
@@ -83,6 +83,13 @@ _gimp_gp_param_def_to_param_spec (Gimp       *gimp,
       break;
 
     case GP_PARAM_DEF_TYPE_INT:
+      if (! strcmp (param_def->type_name, "GParamInt"))
+        return g_param_spec_int (name, nick, blurb,
+                                 param_def->meta.m_int.min_val,
+                                 param_def->meta.m_int.max_val,
+                                 param_def->meta.m_int.default_val,
+                                 flags);
+
       if (! strcmp (param_def->type_name, "GimpParamInt32"))
         return gimp_param_spec_int32 (name, nick, blurb,
                                       param_def->meta.m_int.min_val,
diff --git a/libgimp/gimpgpparams-body.c b/libgimp/gimpgpparams-body.c
index 8b6ef916e1..0531b5a118 100644
--- a/libgimp/gimpgpparams-body.c
+++ b/libgimp/gimpgpparams-body.c
@@ -39,7 +39,8 @@ _gimp_param_spec_to_gp_param_def (GParamSpec *pspec,
 
   pspec_type = G_PARAM_SPEC_TYPE (pspec);
 
-  if (pspec_type == GIMP_TYPE_PARAM_INT32 ||
+  if (pspec_type == G_TYPE_PARAM_INT      ||
+      pspec_type == GIMP_TYPE_PARAM_INT32 ||
       pspec_type == GIMP_TYPE_PARAM_INT16)
     {
       GParamSpecInt *ispec = G_PARAM_SPEC_INT (pspec);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]