[gegl/meta-json: 14/18] meta-json: Also support GeglColor properties



commit e815e46e8da7c9256c9111aa8a31f881d373bb13
Author: Jon Nordby <jononor gmail com>
Date:   Tue Jan 20 00:52:51 2015 +0100

    meta-json: Also support GeglColor properties

 operations/core/json.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
---
diff --git a/operations/core/json.c b/operations/core/json.c
index 9bb9be7..839cc2a 100644
--- a/operations/core/json.c
+++ b/operations/core/json.c
@@ -184,8 +184,11 @@ copy_param_spec(GParamSpec *in, const gchar *name) {
   } else if (G_IS_PARAM_SPEC_LONG(in)) {
     GParamSpecLong *l = G_PARAM_SPEC_LONG(in);
     out = g_param_spec_int(name, name, blurb, l->minimum, l->maximum, l->default_value, flags);
+  } else if (GEGL_IS_PARAM_SPEC_COLOR(in)) {
+    GeglColor *default_value = gegl_param_spec_color_get_default(in);
+    out = gegl_param_spec_color(name, name, blurb, default_value, flags);
   } else {
-    g_critical("json: Unknown param spec type");
+    g_critical("json: Unknown param spec type for property %s", g_param_spec_get_nick(in));
   }
   return out;
 }


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