2

I've been following this tutorial on Clutter, and as you can imagine, it's pretty out of date, with my GCC throwing all manner of deprecation warnings about. As I don't want them to be chucked around (things get deprecated for a reason), I managed to get around most things in there by either following the warnings' advice, or by judiciously researching the Clutter reference.

However, one of the sections (the one about scores) requires me to use clutter_score_new. According to both the GCC warnings and the reference material, this is deprecated, with no alternatives or suggestions given. Having looked at the documentation, I'm a bit lost - what should I do?

Koz Ross
  • 3,040
  • 2
  • 24
  • 44

2 Answers2

1

ClutterScore was a bad class that, sadly, was not removed in time before 1.0 got released.

you can achieve the same effect using ClutterTimeline and markers to connect/start/stop timelines in a hierarchical way.

to be fair, though, there's no real reason to use ClutterTimeline directly these days. you can use the implicit animation API directly, or the explicit Transition API.

ebassi
  • 8,648
  • 27
  • 29
0

Many API have been deprecated since. I updated the code with ClutterPropertyTransition. For instance to animate rect1 rectangle you could use:

ClutterTransition *transition = clutter_property_transition_new("rotation-angle-z");
clutter_timeline_set_progress_mode(CLUTTER_TIMELINE(transition), CLUTTER_LINEAR);
clutter_timeline_set_duration(CLUTTER_TIMELINE(transition), msecs);
clutter_timeline_set_repeat_count(CLUTTER_TIMELINE(transition), -1);
clutter_transition_set_animatable(transition, CLUTTER_ANIMATABLE(rect1));
clutter_transition_set_from(transition, G_TYPE_FLOAT, 0.0);
clutter_transition_set_to(transition, G_TYPE_FLOAT, 360.0);
clutter_timeline_start(CLUTTER_TIMELINE(transition));

Do not forget to release the reference to "transition" when done

Marc Rechté
  • 1,817
  • 1
  • 13
  • 5