script: Always allow setting object properties by id reference

The block that allows setting a GObject property holding an object
instance is conditionally depending on the USE_PIXBUF define. This
makes it impossible to reference an object inside ClutterScript on
platforms not using GdkPixbuf.
This commit is contained in:
Emmanuele Bassi 2009-10-21 15:17:50 +01:00
parent ef8ae7d72f
commit 50aec3c540

View File

@ -1103,21 +1103,25 @@ clutter_script_parse_node (ClutterScript *script,
g_free (path); g_free (path);
} }
} }
else #endif
if (G_VALUE_HOLDS (&node_value, G_TYPE_STRING))
{ {
if (G_VALUE_HOLDS (&node_value, G_TYPE_STRING)) const gchar *str = g_value_get_string (&node_value);
GObject *object = clutter_script_get_object (script, str);
if (object)
{ {
const gchar *str = g_value_get_string (&node_value); CLUTTER_NOTE (SCRIPT,
GObject *object = clutter_script_get_object (script, str); "Assigning '%s' (%s) to property '%s'",
if (object) str,
{ G_OBJECT_TYPE_NAME (object),
g_value_set_object (value, object); name);
retval = TRUE;
} g_value_set_object (value, object);
retval = TRUE;
} }
} }
break; break;
#endif
default: default:
retval = FALSE; retval = FALSE;
@ -1179,6 +1183,7 @@ clutter_script_translate_parameters (ClutterScript *script,
if (!res) if (!res)
{ {
CLUTTER_NOTE (SCRIPT, "Property '%s' ignored", pinfo->name);
unparsed = g_list_prepend (unparsed, pinfo); unparsed = g_list_prepend (unparsed, pinfo);
continue; continue;
} }