script-parser: Also honor properties of type GType
authorBastian Winkler <buz@netbuz.org>
Mon, 3 Jan 2011 15:15:17 +0000 (16:15 +0100)
committerEmmanuele Bassi <ebassi@linux.intel.com>
Tue, 11 Jan 2011 12:37:53 +0000 (12:37 +0000)
The script parser should also handle GType properties.

http://bugzilla.clutter-project.org/show_bug.cgi?id=2513

clutter/clutter-script-parser.c

index 959d25a..316617d 100644 (file)
@@ -1356,6 +1356,15 @@ clutter_script_parse_node (ClutterScript *script,
           break;
         }
 
+      if (G_VALUE_TYPE (value) == G_TYPE_GTYPE &&
+          G_VALUE_HOLDS (&node_value, G_TYPE_STRING))
+        {
+          const gchar *str = g_value_get_string (&node_value);
+          GType type = clutter_script_get_type_from_name (script, str);
+          g_value_set_gtype (value, type);
+          retval = TRUE;
+        }
+
       g_value_unset (&node_value);
       break;
     }