Re: Need ideas for making ClutterInterval scriptable



hi Dominique;

Bastian Winkler recently filed a bug[1] with a patch to implement
ClutterScriptable in ClutterInterval. the patch has been accepted, and
will be pushed to the 1.16 stable branch. I need to make a new 1.16
release soon(ish), so it'll be in the next stable release of Clutter.

ciao,
 Emmanuele.

[1] https://bugzilla.gnome.org/show_bug.cgi?id=711573

On 7 November 2013 14:14, Dominique Bureau <dbureau gmail com> wrote:
Wow. Apologies for the funky characters in the post. Remember to never use
Outlook on a Mac, it's evil.

--
Dominique Bureau



On Wed, Nov 6, 2013 at 1:47 PM, Dominique Bureau <dbureau gmail com> wrote:

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




_______________________________________________
clutter-list mailing list
clutter-list gnome org
https://mail.gnome.org/mailman/listinfo/clutter-list




-- 
W: http://www.emmanuelebassi.name
B: http://blogs.gnome.org/ebassi/


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