/usr/share/clutter-1.0/cookbook/examples/animations-complex.c is in libclutter-1.0-doc 1.20.0-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 | #include <stdlib.h>
#include <clutter/clutter.h>
#define UI_FILE "animations-complex.json"
/*
* start the animation when a key is pressed;
* see the signals recipe in the Script chapter for more details
*/
gboolean
foo_key_pressed_cb (ClutterActor *actor,
ClutterEvent *event,
gpointer user_data)
{
ClutterScript *script = CLUTTER_SCRIPT (user_data);
ClutterAnimator *animator;
clutter_script_get_objects (script,
"animator", &animator,
NULL);
if (clutter_timeline_is_playing (clutter_animator_get_timeline (animator)))
return FALSE;
clutter_animator_start (animator);
return TRUE;
}
int
main (int argc, char *argv[])
{
gchar *filename = UI_FILE;
ClutterScript *script;
ClutterActor *stage;
GError *error = NULL;
if (argc > 1)
filename = argv[1];
if (clutter_init (&argc, &argv) != CLUTTER_INIT_SUCCESS)
return 1;
script = clutter_script_new ();
clutter_script_load_from_file (script, filename, &error);
if (error != NULL)
{
g_critical ("Error loading ClutterScript file %s\n%s", filename, error->message);
g_error_free (error);
exit (EXIT_FAILURE);
}
/* connect signal handlers as defined in the script */
clutter_script_connect_signals (script, script);
clutter_script_get_objects (script,
"stage", &stage,
NULL);
clutter_actor_show (stage);
clutter_main ();
g_object_unref (script);
return EXIT_SUCCESS;
}
|