/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 4; tab-width: 4 -*- */
/*
* presets.c
- * Copyright (C) John Stebbins 2008 <stebbins@stebbins>
+ * Copyright (C) John Stebbins 2008-2011 <stebbins@stebbins>
*
* presets.c is free software.
*
}
static void
+xform_double_string(const GValue *dval, GValue *sval)
+{
+ gchar *str;
+ double val = g_value_get_double(dval);
+ str = g_strdup_printf("%g", val);
+ g_value_take_string(sval, str);
+}
+
+static void
xform_boolean_double(const GValue *bval, GValue *dval)
{
gboolean b = g_value_get_boolean(bval);
xform_string_double);
g_value_register_transform_func(G_TYPE_BOOLEAN, G_TYPE_DOUBLE,
xform_boolean_double);
+ g_value_register_transform_func(G_TYPE_DOUBLE, G_TYPE_STRING,
+ xform_double_string);
}