[glide] Add support for saving names



commit 1fb04beb20d6d71580a6cccfb79f857c36c4c874
Author: Robert Carr <racarr Valentine localdomain>
Date:   Sat May 1 22:25:45 2010 -0400

    Add support for saving names

 src/glide-actor.c |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)
---
diff --git a/src/glide-actor.c b/src/glide-actor.c
index 5c90113..8332b03 100644
--- a/src/glide-actor.c
+++ b/src/glide-actor.c
@@ -216,7 +216,13 @@ glide_actor_serialize (GlideActor *actor)
   
   klass = GLIDE_ACTOR_GET_CLASS (actor);
   if (klass->serialize)
-    return klass->serialize (actor);
+    {
+      JsonNode *n = klass->serialize (actor);
+      JsonObject *o = json_node_get_object (n);
+      glide_json_object_set_string (o, "name", clutter_actor_get_name (CLUTTER_ACTOR (actor)));
+      
+      return n;
+    }
   
   return NULL;
 }
@@ -231,6 +237,7 @@ glide_actor_deserialize (GlideActor *actor, JsonObject *actor_obj)
     klass->deserialize (actor, actor_obj);
   
   glide_json_object_restore_actor_geometry (actor_obj, CLUTTER_ACTOR (actor));
+  clutter_actor_set_name (CLUTTER_ACTOR (actor), glide_json_object_get_string (actor_obj, "name"));
 }
 
 void 



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