[gegl] gegl-xml: add serialisation to xml for enum properties
- From: Michael Murà <mmure src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gegl] gegl-xml: add serialisation to xml for enum properties
- Date: Sun, 4 Sep 2011 17:37:17 +0000 (UTC)
commit 4b7b20ddd1e08d119917ebd45cba01cf6e35cc9c
Author: Michael Murà <batolettre gmail com>
Date: Sun Sep 4 13:34:36 2011 +0200
gegl-xml: add serialisation to xml for enum properties
gegl/gegl-xml.c | 11 +++++++++++
1 files changed, 11 insertions(+), 0 deletions(-)
---
diff --git a/gegl/gegl-xml.c b/gegl/gegl-xml.c
index 25301db..e6f5447 100644
--- a/gegl/gegl-xml.c
+++ b/gegl/gegl-xml.c
@@ -836,6 +836,17 @@ serialize_properties (SerializeState *ss,
xml_param (ss, indent + 2, properties[i]->name, value);
g_free (value);
}
+ else if (g_type_is_a (properties[i]->value_type, G_TYPE_ENUM))
+ {
+ GEnumClass *eclass = g_type_class_peek (properties[i]->value_type);
+ GEnumValue *evalue;
+ gint value;
+
+ gegl_node_get (node, properties[i]->name, &value, NULL);
+ evalue = g_enum_get_value (eclass, value);
+
+ xml_param (ss, indent + 2, properties[i]->name, evalue->value_nick);
+ }
else if (properties[i]->value_type == GEGL_TYPE_COLOR)
{
GeglColor *color;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]