Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <clutter/clutter.h>
- #include <stdlib.h>
- int
- main (int argc, char *argv[])
- {
- if (clutter_init (&argc, &argv) != CLUTTER_INIT_SUCCESS)
- g_error ("*** Unable to initialize Clutter");
- const gchar *backend_str;
- #if CLUTTER_WINDOWING_GDK
- if (clutter_check_backend (CLUTTER_GDK_BACKEND))
- backend_str = "Clutter is using the GDK backend";
- else
- #endif
- #if CLUTTER_WINDOWING_X11
- if (clutter_check_backend (CLUTTER_X11_BACKEND))
- backend_str = "Clutter is using the X11 backend";
- else
- #endif
- #if CLUTTER_WINDOWING_WAYLAND
- if (clutter_check_backend (CLUTTER_WAYLAND_BACKEND))
- backend_str = "Clutter is using the Wayland backend";
- else
- #endif
- #if CLUTTER_WINDOWING_OSX
- if (clutter_check_backend (CLUTTER_OSX_BACKEND))
- backend_str = "Clutter is using the OS X backend";
- else
- #endif
- #if CLUTTER_WINDOWING_WIN32
- if (clutter_check_backend (CLUTTER_WIN32_BACKEND))
- backend_str = "Clutter is using the Windows backend";
- else
- #endif
- g_error ("*** Unrecognized backend");
- gchar *label = g_strconcat ("<big><b>", backend_str, "</b></big>", NULL);
- ClutterActor *stage = clutter_stage_new ();
- clutter_stage_set_user_resizable (CLUTTER_STAGE (stage), TRUE);
- clutter_stage_set_title (CLUTTER_STAGE (stage), "Test Backends");
- clutter_stage_set_color (CLUTTER_STAGE (stage), CLUTTER_COLOR_LightSkyBlue);
- g_signal_connect (stage, "destroy", G_CALLBACK (clutter_main_quit), NULL);
- clutter_actor_show (stage);
- ClutterActor *text = clutter_text_new ();
- clutter_text_set_markup (CLUTTER_TEXT (text), label);
- clutter_actor_add_constraint (text, clutter_align_constraint_new (stage, CLUTTER_ALIGN_X_AXIS, 0.5));
- clutter_actor_add_constraint (text, clutter_align_constraint_new (stage, CLUTTER_ALIGN_Y_AXIS, 0.5));
- clutter_container_add_actor (CLUTTER_CONTAINER (stage), text);
- ClutterVertex center = {
- .x = clutter_actor_get_width (text) / 2.0,
- .y = clutter_actor_get_height (text) / 2.0,
- .z = 0.f
- };
- ClutterAnimation *animation = clutter_actor_animate (text, CLUTTER_LINEAR, 6000,
- "fixed::rotation-center-y", ¢er,
- "rotation-angle-y", 360.0,
- NULL);
- clutter_timeline_set_loop (clutter_animation_get_timeline (animation), TRUE);
- clutter_main ();
- g_free (label);
- return EXIT_SUCCESS;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement