After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 711573 - interval: Implement ClutterScriptable interface
interval: Implement ClutterScriptable interface
Status: RESOLVED FIXED
Product: clutter
Classification: Platform
Component: general
unspecified
Other All
: Normal normal
: ---
Assigned To: clutter-maint
clutter-maint
Depends on:
Blocks:
 
 
Reported: 2013-11-06 22:47 UTC by Bastian Winkler
Modified: 2013-11-07 16:48 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
interval: Implement ClutterScriptable interface (6.53 KB, patch)
2013-11-06 22:47 UTC, Bastian Winkler
needs-work Details | Review
interval: Implement ClutterScriptable interface (6.60 KB, patch)
2013-11-07 07:18 UTC, Bastian Winkler
accepted-commit_now Details | Review

Description Bastian Winkler 2013-11-06 22:47:36 UTC
The patch applies to the current clutter-1.16 branch
Comment 1 Bastian Winkler 2013-11-06 22:47:38 UTC
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"
   }
 }
Comment 2 Emmanuele Bassi (:ebassi) 2013-11-06 23:20:21 UTC
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.
Comment 3 Bastian Winkler 2013-11-07 07:15:57 UTC
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
Comment 4 Bastian Winkler 2013-11-07 07:18:15 UTC
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"
   }
 }
Comment 5 Emmanuele Bassi (:ebassi) 2013-11-07 12:04:33 UTC
Review of attachment 259158 [details] [review]:

looks good.
Comment 6 Bastian Winkler 2013-11-07 16:48:01 UTC
Pushed to clutter-1.16