From a4dbcf0c32e8143dba4f7dbd4f1191c3225af413 Mon Sep 17 00:00:00 2001 From: Emmanuele Bassi Date: Thu, 17 Jun 2010 16:41:44 +0100 Subject: [PATCH] script-parser: Expose extracting the id from a node The get_id_from_node() internal function should be exposed inside Clutter (as a private function) because it can be useful to other custom parsing code. The code is pretty trivial, but it would be pointless to re-implement it. --- clutter/clutter-script-parser.c | 10 +++++----- clutter/clutter-script-private.h | 2 ++ 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/clutter/clutter-script-parser.c b/clutter/clutter-script-parser.c index 5e93d8546..f2bfd3fb6 100644 --- a/clutter/clutter-script-parser.c +++ b/clutter/clutter-script-parser.c @@ -487,8 +487,8 @@ clutter_script_parse_color (ClutterScript *script, return FALSE; } -static const gchar * -get_id_from_node (JsonNode *node) +const gchar * +_clutter_script_get_id_from_node (JsonNode *node) { JsonObject *object; @@ -531,7 +531,7 @@ parse_children (ObjectInfo *oinfo, JsonNode *child = json_array_get_element (array, i); const gchar *id; - id = get_id_from_node (child); + id = _clutter_script_get_id_from_node (child); if (id) retval = g_list_prepend (retval, g_strdup (id)); } @@ -672,7 +672,7 @@ parse_behaviours (ObjectInfo *oinfo, JsonNode *child = json_array_get_element (array, i); const gchar *id; - id = get_id_from_node (child); + id = _clutter_script_get_id_from_node (child); if (id) retval = g_list_prepend (retval, g_strdup (id)); } @@ -1115,7 +1115,7 @@ clutter_script_parse_node (ClutterScript *script, * definitions are parsed leaf-first we are guaranteed * to have a defined object at this point */ - id = get_id_from_node (node); + id = _clutter_script_get_id_from_node (node); if (id == NULL || *id == '\0') return FALSE; diff --git a/clutter/clutter-script-private.h b/clutter/clutter-script-private.h index 5512f5e50..0b03d13b7 100644 --- a/clutter/clutter-script-private.h +++ b/clutter/clutter-script-private.h @@ -149,6 +149,8 @@ guint _clutter_script_get_last_merge_id (ClutterScript *script); void _clutter_script_add_object_info (ClutterScript *script, ObjectInfo *oinfo); +const gchar *_clutter_script_get_id_from_node (JsonNode *node); + G_END_DECLS #endif /* __CLUTTER_SCRIPT_PRIVATE_H__ */