GNOME Bugzilla – Bug 711573
interval: Implement ClutterScriptable interface
Last modified: 2013-11-07 16:48:01 UTC
The patch applies to the current clutter-1.16 branch
Created attachment 259147 [details] [review] interval: Implement ClutterScriptable interface This allows the creation of ClutterTransition objects in ClutterScript: { "id" : "scripted-transition", "type" : "ClutterPropertyTransition", "property-name" : "background-color", "interval" : { "type" : "ClutterInterval", "value-type" : "ClutterColor", "initial" : "red", "final" : "blue" } }
Review of attachment 259147 [details] [review]: ::: clutter/clutter-interval.c @@ -482,0 +491,30 @@ +static gboolean +clutter_interval_parse_custom_node (ClutterScriptable *scriptable, + ClutterScript *script, ... 27 more ... set_custom_property() cannot fail, so it needs to call g_object_set_property() internally otherwise setting properties that are not "initial" or "final" will not work. I honestly don't understand how the test passes.
Review of attachment 259147 [details] [review]: ::: clutter/clutter-interval.c @@ -482,0 +491,30 @@ +static gboolean +clutter_interval_parse_custom_node (ClutterScriptable *scriptable, + ClutterScript *script, ... 27 more ... You're right, it only works because the :value-type property is construct-only and therefore handled differently. It just won't work for potential subclasses of ClutterInterval with own properties. I'll update the patch
Created attachment 259158 [details] [review] interval: Implement ClutterScriptable interface This allows the creation of ClutterTransition objects in ClutterScript: { "id" : "scripted-transition", "type" : "ClutterPropertyTransition", "property-name" : "background-color", "interval" : { "type" : "ClutterInterval", "value-type" : "ClutterColor", "initial" : "red", "final" : "blue" } }
Review of attachment 259158 [details] [review]: looks good.
Pushed to clutter-1.16