[gimp] app: support GimpParamSpecRGB in generated GEGL UI, not only GeglParamSpecColor



commit c16c61f4586bf84da0d4d51265a4f64a433ee726
Author: Michael Natterer <mitch gimp org>
Date:   Fri May 4 23:50:02 2012 +0200

    app: support GimpParamSpecRGB in generated GEGL UI, not only GeglParamSpecColor

 app/core/gimpparamspecs-duplicate.c |   18 ++++++++++++++++++
 app/gegl/gimp-gegl-config-proxy.c   |    2 +-
 2 files changed, 19 insertions(+), 1 deletions(-)
---
diff --git a/app/core/gimpparamspecs-duplicate.c b/app/core/gimpparamspecs-duplicate.c
index 6cb550c..2bd5f28 100644
--- a/app/core/gimpparamspecs-duplicate.c
+++ b/app/core/gimpparamspecs-duplicate.c
@@ -188,6 +188,24 @@ gimp_param_spec_duplicate (GParamSpec *pspec)
                                 pspec->flags |
                                 GIMP_CONFIG_PARAM_SERIALIZE);
     }
+  else if (GIMP_IS_PARAM_SPEC_RGB (pspec))
+    {
+      GValue  value = G_VALUE_INIT;
+      GimpRGB color;
+
+      g_value_init (&value, GIMP_TYPE_RGB);
+      g_param_value_set_default (pspec, &value);
+      gimp_value_get_rgb (&value, &color);
+      g_value_unset (&value);
+
+      return gimp_param_spec_rgb (pspec->name,
+                                  g_param_spec_get_nick (pspec),
+                                  g_param_spec_get_blurb (pspec),
+                                  gimp_param_spec_rgb_has_alpha (pspec),
+                                  &color,
+                                  pspec->flags |
+                                  GIMP_CONFIG_PARAM_SERIALIZE);
+    }
   else if (GEGL_IS_PARAM_SPEC_COLOR (pspec))
     {
       GeglColor *gegl_color;
diff --git a/app/gegl/gimp-gegl-config-proxy.c b/app/gegl/gimp-gegl-config-proxy.c
index 093ead9..a0216fb 100644
--- a/app/gegl/gimp-gegl-config-proxy.c
+++ b/app/gegl/gimp-gegl-config-proxy.c
@@ -278,7 +278,7 @@ gimp_gegl_config_proxy_sync (GimpObject  *proxy,
           g_object_get_property (G_OBJECT (proxy), gimp_pspec->name,
                                  &value);
 
-          if (GIMP_IS_PARAM_SPEC_RGB (gimp_pspec))
+          if (GEGL_IS_PARAM_SPEC_COLOR (gegl_pspec))
             {
               GimpRGB    gimp_color;
               GeglColor *gegl_color;



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