Need ideas for making ClutterInterval scriptable



Hello folks!

I¹m currently looking into moving my scripted ClutterStates to
ClutterTransitions and found out that the ClutterInterval part of a
transition cannot be scripted (yet).

So far, I¹ve found out that the ³initial² and ³final² properties are not
being handled properly in clutter-script-parser.c. While in
_clutter_script_parse_node(), the value is seen as a boxed type (as per
the object¹s property param spec), but the only boxed type value being
handled in _clutter_script_parse_node() is a ClutterColor.

From there, I figured I got 2 options:

* Implement ClutterScriptable interface in ClutterInterval
* Handle other boxed types in _clutter_script_parse_node()


In both cases, I¹m having issues related to the boxed type (which I am no
expert with).

By implementing the scriptable interface, from parse_custom_node() I can
easily get the json node value and pass it off to
clutter_interval_set_*_value(), which in turn will handle the conversion
of the value into whatever we need. I¹m purposefully always returning
FALSE and not implementing the set_custom_property() to avoid other
problems that occur from letting ClutterScript handle the value (more on
that below).

On the other hand, if I try to handle this in
_clutter_script_parse_node(), I¹m having a problem when the value is a
fundamental type. From what I can understand, I can¹t initialize a Gvalue
to be a plain abstract boxed type into which I would copy a fundamental
type.


I¹m having a bit of a feeling that using a g_param_spec_boxed property is
a bit hackish when dealing with fundamental types. At least, that¹s what I
understand from GLib¹s warning message when trying to pass a G_TYPE_DOUBLE
Gvalue through g_object_set_property():

-----
(interval:19221): GLib-GObject-WARNING **: unable to set property
'initial' of type 'GValue' from value of type Œgdouble'
----- 

Any hints/ideas?

Thanks

‹
Dominique Bureau




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]