2007-09-27 17:38:38 -04:00
|
|
|
#include <stdio.h>
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include <clutter/clutter.h>
|
|
|
|
|
2007-12-04 11:26:19 -05:00
|
|
|
static gint level = 1;
|
|
|
|
|
|
|
|
static void
|
|
|
|
on_timeline_started (ClutterScore *score,
|
|
|
|
ClutterTimeline *timeline)
|
|
|
|
{
|
|
|
|
gint i;
|
|
|
|
|
|
|
|
for (i = 0; i < level; i++)
|
|
|
|
g_print (" ");
|
|
|
|
|
|
|
|
g_print ("Started timeline: `%s'\n",
|
|
|
|
g_object_get_data (G_OBJECT (timeline), "timeline-name"));
|
|
|
|
|
|
|
|
level += 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
on_timeline_completed (ClutterScore *score,
|
|
|
|
ClutterTimeline *timeline)
|
|
|
|
{
|
|
|
|
gint i;
|
|
|
|
|
|
|
|
level -= 1;
|
|
|
|
|
|
|
|
for (i = 0; i < level; i++)
|
|
|
|
g_print (" ");
|
|
|
|
|
|
|
|
g_print ("Completed timeline: `%s'\n",
|
|
|
|
g_object_get_data (G_OBJECT (timeline), "timeline-name"));
|
|
|
|
}
|
|
|
|
|
2007-09-27 17:38:38 -04:00
|
|
|
int
|
|
|
|
main (int argc, char **argv)
|
|
|
|
{
|
|
|
|
ClutterScore *score;
|
|
|
|
ClutterTimeline *timeline_1;
|
|
|
|
ClutterTimeline *timeline_2;
|
|
|
|
ClutterTimeline *timeline_3;
|
2007-10-17 19:03:38 -04:00
|
|
|
ClutterTimeline *timeline_4;
|
2007-09-27 17:38:38 -04:00
|
|
|
|
|
|
|
clutter_init (&argc, &argv);
|
|
|
|
|
|
|
|
timeline_1 = clutter_timeline_new (10, 120);
|
2007-12-04 11:26:19 -05:00
|
|
|
g_object_set_data_full (G_OBJECT (timeline_1),
|
|
|
|
"timeline-name", g_strdup ("Timeline 1"),
|
|
|
|
g_free);
|
|
|
|
|
2007-09-27 17:38:38 -04:00
|
|
|
timeline_2 = clutter_timeline_clone (timeline_1);
|
2007-12-04 11:26:19 -05:00
|
|
|
g_object_set_data_full (G_OBJECT (timeline_2),
|
|
|
|
"timeline-name", g_strdup ("Timeline 2"),
|
|
|
|
g_free);
|
|
|
|
|
2007-09-27 17:38:38 -04:00
|
|
|
timeline_3 = clutter_timeline_clone (timeline_1);
|
2007-12-04 11:26:19 -05:00
|
|
|
g_object_set_data_full (G_OBJECT (timeline_3),
|
|
|
|
"timeline-name", g_strdup ("Timeline 3"),
|
|
|
|
g_free);
|
|
|
|
|
2007-10-17 19:03:38 -04:00
|
|
|
timeline_4 = clutter_timeline_clone (timeline_1);
|
2007-12-04 11:26:19 -05:00
|
|
|
g_object_set_data_full (G_OBJECT (timeline_4),
|
|
|
|
"timeline-name", g_strdup ("Timeline 4"),
|
|
|
|
g_free);
|
|
|
|
|
2007-09-27 17:38:38 -04:00
|
|
|
|
|
|
|
score = clutter_score_new();
|
2007-12-04 11:26:19 -05:00
|
|
|
g_signal_connect (score, "timeline-started",
|
|
|
|
G_CALLBACK (on_timeline_started),
|
|
|
|
NULL);
|
|
|
|
g_signal_connect (score, "timeline-completed",
|
|
|
|
G_CALLBACK (on_timeline_completed),
|
|
|
|
NULL);
|
|
|
|
g_signal_connect (score, "completed",
|
|
|
|
G_CALLBACK (clutter_main_quit),
|
|
|
|
NULL);
|
|
|
|
|
|
|
|
clutter_score_append (score, NULL, timeline_1);
|
2007-09-27 17:38:38 -04:00
|
|
|
clutter_score_append (score, timeline_1, timeline_2);
|
2007-10-17 19:03:38 -04:00
|
|
|
clutter_score_append (score, timeline_1, timeline_3);
|
|
|
|
clutter_score_append (score, timeline_3, timeline_4);
|
|
|
|
|
2007-09-27 17:38:38 -04:00
|
|
|
clutter_score_start (score);
|
|
|
|
|
|
|
|
clutter_main ();
|
|
|
|
|
|
|
|
g_object_unref (score);
|
|
|
|
g_object_unref (timeline_1);
|
|
|
|
g_object_unref (timeline_2);
|
|
|
|
g_object_unref (timeline_3);
|
2007-12-04 11:26:19 -05:00
|
|
|
g_object_unref (timeline_4);
|
2007-09-27 17:38:38 -04:00
|
|
|
|
|
|
|
return EXIT_SUCCESS;
|
|
|
|
}
|