From 5b17b4e41bf861ceb35ca887293db23ae13fe9a2 Mon Sep 17 00:00:00 2001 From: Emmanuele Bassi Date: Mon, 13 Feb 2012 16:47:17 +0000 Subject: [PATCH] interactive/*: Update the API usage Drop some deprecated methods. --- tests/interactive/test-actor-clone.c | 4 ++-- tests/interactive/test-actors.c | 4 ++-- tests/interactive/test-animation.c | 2 +- tests/interactive/test-behave.c | 4 ++-- tests/interactive/test-bin-layout.c | 2 +- tests/interactive/test-cairo-clock.c | 2 +- tests/interactive/test-cairo-flowers.c | 4 ++-- tests/interactive/test-depth.c | 2 +- tests/interactive/test-devices.c | 2 +- tests/interactive/test-easing.c | 2 +- tests/interactive/test-fbo.c | 4 +--- tests/interactive/test-flow-layout.c | 2 +- tests/interactive/test-layout.c | 2 +- tests/interactive/test-multistage.c | 6 +++--- tests/interactive/test-paint-wrapper.c | 4 ++-- tests/interactive/test-pixmap.c | 2 +- tests/interactive/test-scale.c | 9 +++------ tests/interactive/test-shader-effects.c | 4 ++-- tests/interactive/test-shader.c | 2 +- tests/interactive/test-state.c | 2 +- tests/interactive/test-text-field.c | 2 +- tests/interactive/test-text.c | 2 +- tests/interactive/test-texture-async.c | 2 +- tests/interactive/test-texture-quality.c | 2 +- tests/interactive/test-threads.c | 4 ++-- 25 files changed, 36 insertions(+), 41 deletions(-) diff --git a/tests/interactive/test-actor-clone.c b/tests/interactive/test-actor-clone.c index fa7fa3b..2ca4cab 100644 --- a/tests/interactive/test-actor-clone.c +++ b/tests/interactive/test-actor-clone.c @@ -170,16 +170,16 @@ test_actor_clone_main (int argc, char *argv[]) oh = g_new (SuperOH, 1); oh->stage = stage = clutter_stage_new (); + clutter_actor_set_background_color (stage, &stage_color); clutter_actor_set_size (stage, 800, 600); clutter_stage_set_title (CLUTTER_STAGE (stage), "Clone Test"); - clutter_stage_set_color (CLUTTER_STAGE (stage), &stage_color); g_signal_connect (stage, "destroy", G_CALLBACK (clean_and_quit), oh); /* Create a timeline to manage animation */ oh->timeline = clutter_timeline_new (6000); - clutter_timeline_set_loop (oh->timeline, TRUE); + clutter_timeline_set_repeat_count (oh->timeline, -1); /* fire a callback for frame change */ oh->frame_id = diff --git a/tests/interactive/test-actors.c b/tests/interactive/test-actors.c index 4722d86..aeed9cb 100644 --- a/tests/interactive/test-actors.c +++ b/tests/interactive/test-actors.c @@ -192,15 +192,15 @@ test_actors_main (int argc, char *argv[]) oh->stage = clutter_stage_new (); clutter_actor_set_size (oh->stage, 800, 600); clutter_actor_set_name (oh->stage, "Default Stage"); + clutter_actor_set_background_color (oh->stage, CLUTTER_COLOR_LightSkyBlue); g_signal_connect (oh->stage, "destroy", G_CALLBACK (stop_and_quit), oh); clutter_stage_set_title (CLUTTER_STAGE (oh->stage), "Actors"); - clutter_stage_set_color (CLUTTER_STAGE (oh->stage), CLUTTER_COLOR_LightSkyBlue); clutter_stage_set_user_resizable (CLUTTER_STAGE (oh->stage), TRUE); /* Create a timeline to manage animation */ oh->timeline = clutter_timeline_new (6000); - clutter_timeline_set_loop (oh->timeline, TRUE); + clutter_timeline_set_repeat_count (oh->timeline, -1); /* fire a callback for frame change */ g_signal_connect (oh->timeline, "new-frame", G_CALLBACK (frame_cb), oh); diff --git a/tests/interactive/test-animation.c b/tests/interactive/test-animation.c index 80b1212..6221fda 100644 --- a/tests/interactive/test-animation.c +++ b/tests/interactive/test-animation.c @@ -91,7 +91,7 @@ test_animation_main (int argc, char *argv[]) return 1; stage = clutter_stage_new (); - clutter_stage_set_color (CLUTTER_STAGE (stage), CLUTTER_COLOR_LightSkyBlue); + clutter_actor_set_background_color (stage, CLUTTER_COLOR_LightSkyBlue); clutter_stage_set_title (CLUTTER_STAGE (stage), "Animation"); g_signal_connect (stage, "destroy", G_CALLBACK (clutter_main_quit), NULL); diff --git a/tests/interactive/test-behave.c b/tests/interactive/test-behave.c index c6b7590..8beb4a5 100644 --- a/tests/interactive/test-behave.c +++ b/tests/interactive/test-behave.c @@ -104,7 +104,7 @@ test_behave_main (int argc, char *argv[]) stage = clutter_stage_new (); clutter_stage_set_title (CLUTTER_STAGE (stage), "Behaviours"); - clutter_stage_set_color (CLUTTER_STAGE (stage), CLUTTER_COLOR_Aluminium2); + clutter_actor_set_background_color (stage, CLUTTER_COLOR_Aluminium2); clutter_stage_hide_cursor (CLUTTER_STAGE (stage)); g_signal_connect (stage, "destroy", G_CALLBACK (clutter_main_quit), NULL); g_signal_connect (stage, "button-press-event", @@ -147,7 +147,7 @@ test_behave_main (int argc, char *argv[]) /* Make a timeline */ timeline = clutter_timeline_new (4000); - clutter_timeline_set_loop (timeline, TRUE); + clutter_timeline_set_repeat_count (timeline, -1); clutter_timeline_set_auto_reverse (timeline, TRUE); /* Set an alpha func to power behaviour - ramp is constant rise */ diff --git a/tests/interactive/test-bin-layout.c b/tests/interactive/test-bin-layout.c index ad9b748..049fdbd 100644 --- a/tests/interactive/test-bin-layout.c +++ b/tests/interactive/test-bin-layout.c @@ -165,7 +165,7 @@ test_bin_layout_main (int argc, char *argv[]) stage = clutter_stage_new (); clutter_stage_set_title (CLUTTER_STAGE (stage), "BinLayout"); - clutter_stage_set_color (CLUTTER_STAGE (stage), &stage_color); + clutter_actor_set_background_color (stage, &stage_color); clutter_actor_set_size (stage, 640, 480); g_signal_connect (stage, "destroy", G_CALLBACK (clutter_main_quit), NULL); diff --git a/tests/interactive/test-cairo-clock.c b/tests/interactive/test-cairo-clock.c index 6edd83b..714eac9 100644 --- a/tests/interactive/test-cairo-clock.c +++ b/tests/interactive/test-cairo-clock.c @@ -80,8 +80,8 @@ test_cairo_clock_main (int argc, char *argv[]) /* create a resizable stage */ stage = clutter_stage_new (); clutter_stage_set_title (CLUTTER_STAGE (stage), "2D Clock"); - clutter_stage_set_color (CLUTTER_STAGE (stage), CLUTTER_COLOR_LightSkyBlue); clutter_stage_set_user_resizable (CLUTTER_STAGE (stage), TRUE); + clutter_actor_set_background_color (stage, CLUTTER_COLOR_LightSkyBlue); clutter_actor_set_size (stage, 300, 300); clutter_actor_show (stage); diff --git a/tests/interactive/test-cairo-flowers.c b/tests/interactive/test-cairo-flowers.c index bf63ade..f60a0f3 100644 --- a/tests/interactive/test-cairo-flowers.c +++ b/tests/interactive/test-cairo-flowers.c @@ -188,13 +188,13 @@ test_cairo_flowers_main (int argc, char **argv) /* Create a timeline to manage animation */ timeline = clutter_timeline_new (6000); - clutter_timeline_set_loop (timeline, TRUE); + clutter_timeline_set_repeat_count (timeline, -1); stage = clutter_stage_new (); clutter_stage_set_title (CLUTTER_STAGE (stage), "Cairo Flowers"); g_signal_connect (stage, "destroy", G_CALLBACK (stop_and_quit), timeline); - clutter_stage_set_color (CLUTTER_STAGE (stage), CLUTTER_COLOR_Black); + clutter_actor_set_background_color (stage, CLUTTER_COLOR_Black); for (i=0; i< N_FLOWERS; i++) { diff --git a/tests/interactive/test-depth.c b/tests/interactive/test-depth.c index b196575..50a02c9 100644 --- a/tests/interactive/test-depth.c +++ b/tests/interactive/test-depth.c @@ -121,7 +121,7 @@ test_depth_main (int argc, char *argv[]) stage = clutter_stage_new (); clutter_stage_set_title (CLUTTER_STAGE (stage), "Depth Test"); - clutter_stage_set_color (CLUTTER_STAGE (stage), CLUTTER_COLOR_Aluminium2); + clutter_actor_set_background_color (stage, CLUTTER_COLOR_Aluminium2); g_signal_connect (stage, "destroy", G_CALLBACK (clutter_main_quit), NULL); diff --git a/tests/interactive/test-devices.c b/tests/interactive/test-devices.c index 5473174..498da35 100644 --- a/tests/interactive/test-devices.c +++ b/tests/interactive/test-devices.c @@ -233,7 +233,7 @@ test_devices_main (int argc, char **argv) app->devices = g_hash_table_new (g_direct_hash, g_direct_equal) ; stage = clutter_stage_new (); - clutter_stage_set_color (CLUTTER_STAGE (stage), CLUTTER_COLOR_LightSkyBlue); + clutter_actor_set_background_color (stage, CLUTTER_COLOR_LightSkyBlue); clutter_stage_set_title (CLUTTER_STAGE (stage), "Devices"); clutter_stage_hide_cursor (CLUTTER_STAGE (stage)); g_signal_connect (stage, diff --git a/tests/interactive/test-easing.c b/tests/interactive/test-easing.c index b81aecd..feab40e 100644 --- a/tests/interactive/test-easing.c +++ b/tests/interactive/test-easing.c @@ -227,7 +227,7 @@ test_easing_main (int argc, char *argv[]) stage = clutter_stage_new (); clutter_stage_set_title (CLUTTER_STAGE (stage), "Easing Modes"); - clutter_stage_set_color (CLUTTER_STAGE (stage), CLUTTER_COLOR_LightSkyBlue); + clutter_actor_set_background_color (stage, CLUTTER_COLOR_LightSkyBlue); g_signal_connect (stage, "destroy", G_CALLBACK (clutter_main_quit), NULL); main_stage = stage; diff --git a/tests/interactive/test-fbo.c b/tests/interactive/test-fbo.c index 039f730..c659fe1 100644 --- a/tests/interactive/test-fbo.c +++ b/tests/interactive/test-fbo.c @@ -40,8 +40,6 @@ make_source (void) G_MODULE_EXPORT int test_fbo_main (int argc, char *argv[]) { - ClutterColor blue = {0x33, 0x44, 0x55, 0xff}; - ClutterActor *fbo; ClutterActor *onscreen_source; ClutterActor *stage; @@ -57,7 +55,7 @@ test_fbo_main (int argc, char *argv[]) stage = clutter_stage_new (); clutter_actor_set_size (stage, STAGE_WIDTH, STAGE_HEIGHT); - clutter_stage_set_color (CLUTTER_STAGE (stage), &blue); + clutter_actor_set_background_color (stage, CLUTTER_COLOR_SkyBlue); clutter_stage_set_title (CLUTTER_STAGE (stage), "Texture from Actor"); g_signal_connect (stage, "destroy", G_CALLBACK (clutter_main_quit), NULL); diff --git a/tests/interactive/test-flow-layout.c b/tests/interactive/test-flow-layout.c index fa42583..aefaaed 100644 --- a/tests/interactive/test-flow-layout.c +++ b/tests/interactive/test-flow-layout.c @@ -89,8 +89,8 @@ test_flow_layout_main (int argc, char *argv[]) } stage = clutter_stage_new (); + clutter_actor_set_background_color (stage, CLUTTER_COLOR_LightSkyBlue); clutter_stage_set_title (CLUTTER_STAGE (stage), "Flow Layout"); - clutter_stage_set_color (CLUTTER_STAGE (stage), CLUTTER_COLOR_LightSkyBlue); clutter_stage_set_user_resizable (CLUTTER_STAGE (stage), TRUE); g_signal_connect (stage, "destroy", G_CALLBACK (clutter_main_quit), NULL); diff --git a/tests/interactive/test-layout.c b/tests/interactive/test-layout.c index 2053690..76d3091 100644 --- a/tests/interactive/test-layout.c +++ b/tests/interactive/test-layout.c @@ -757,7 +757,7 @@ test_layout_main (int argc, char *argv[]) g_signal_connect (stage, "destroy", G_CALLBACK (clutter_main_quit), NULL); main_timeline = clutter_timeline_new (2000); - clutter_timeline_set_loop (main_timeline, TRUE); + clutter_timeline_set_repeat_count (main_timeline, -1); clutter_timeline_set_auto_reverse (main_timeline, TRUE); g_signal_connect (main_timeline, "new-frame", G_CALLBACK (relayout_on_frame), diff --git a/tests/interactive/test-multistage.c b/tests/interactive/test-multistage.c index 5ae0d96..4a55f69 100644 --- a/tests/interactive/test-multistage.c +++ b/tests/interactive/test-multistage.c @@ -40,8 +40,8 @@ on_button_press (ClutterActor *actor, stage_name = g_strdup_printf ("Stage [%d]", ++n_stages); clutter_stage_set_title (CLUTTER_STAGE (new_stage), stage_name); - clutter_stage_set_color (CLUTTER_STAGE (new_stage), - CLUTTER_COLOR_DarkScarletRed); + clutter_actor_set_background_color (new_stage, + CLUTTER_COLOR_DarkScarletRed); clutter_actor_set_size (new_stage, 320, 240); clutter_actor_set_name (new_stage, stage_name); @@ -82,7 +82,7 @@ on_button_press (ClutterActor *actor, */ timeline = clutter_timeline_new (2000); - clutter_timeline_set_loop (timeline, TRUE); + clutter_timeline_set_repeat_count (timeline, -1); alpha = clutter_alpha_new_full (timeline, CLUTTER_LINEAR); r_behave = clutter_behaviour_rotate_new (alpha, diff --git a/tests/interactive/test-paint-wrapper.c b/tests/interactive/test-paint-wrapper.c index e06c87f..103f9d0 100644 --- a/tests/interactive/test-paint-wrapper.c +++ b/tests/interactive/test-paint-wrapper.c @@ -241,14 +241,14 @@ test_paint_wrapper_main (int argc, char *argv[]) } clutter_stage_set_title (CLUTTER_STAGE (stage), "Paint Test"); - clutter_stage_set_color (CLUTTER_STAGE (stage), &stage_color); + clutter_actor_set_background_color (stage, &stage_color); g_signal_connect (stage, "destroy", G_CALLBACK (stop_and_quit), oh); oh->stage = stage; /* Create a timeline to manage animation */ oh->timeline = clutter_timeline_new (6000); - clutter_timeline_set_loop (oh->timeline, TRUE); + clutter_timeline_set_repeat_count (oh->timeline, -1); /* fire a callback for frame change */ oh->frame_id = diff --git a/tests/interactive/test-pixmap.c b/tests/interactive/test-pixmap.c index 7df1751..d339055 100644 --- a/tests/interactive/test-pixmap.c +++ b/tests/interactive/test-pixmap.c @@ -239,7 +239,7 @@ test_pixmap_main (int argc, char **argv) stage = clutter_stage_new (); clutter_actor_set_position (stage, 0, 150); - clutter_stage_set_color (CLUTTER_STAGE (stage), &gry); + clutter_actor_set_background_color (stage, &gry); clutter_stage_set_title (CLUTTER_STAGE (stage), "X11 Texture from Pixmap"); g_signal_connect (stage, "destroy", G_CALLBACK (clutter_main_quit), NULL); diff --git a/tests/interactive/test-scale.c b/tests/interactive/test-scale.c index 4564fea..a21f6d6 100644 --- a/tests/interactive/test-scale.c +++ b/tests/interactive/test-scale.c @@ -49,9 +49,7 @@ G_MODULE_EXPORT int test_scale_main (int argc, char *argv[]) { ClutterActor *stage, *rect; - ClutterColor stage_color = { 0x0, 0x0, 0x0, 0xff }; ClutterColor rect_color = { 0xff, 0xff, 0xff, 0x99 }; - ClutterColor white_color = { 0xff, 0xff, 0xff, 0xFF }; ClutterTimeline *timeline; ClutterAlpha *alpha; ClutterBehaviour *behave; @@ -61,7 +59,7 @@ test_scale_main (int argc, char *argv[]) stage = clutter_stage_new (); clutter_stage_set_title (CLUTTER_STAGE (stage), "Scaling"); - clutter_stage_set_color (CLUTTER_STAGE (stage), &stage_color); + clutter_actor_set_background_color (stage, CLUTTER_COLOR_Black); clutter_actor_set_size (stage, 300, 300); g_signal_connect (stage, "destroy", G_CALLBACK (clutter_main_quit), NULL); @@ -72,8 +70,7 @@ test_scale_main (int argc, char *argv[]) clutter_container_add_actor (CLUTTER_CONTAINER (stage), rect); label = clutter_text_new_with_text ("Sans 20px", ""); - clutter_text_set_color (CLUTTER_TEXT (label), - &white_color); + clutter_text_set_color (CLUTTER_TEXT (label), CLUTTER_COLOR_White); clutter_actor_set_position (label, clutter_actor_get_x (rect), clutter_actor_get_y (rect) @@ -100,7 +97,7 @@ test_scale_main (int argc, char *argv[]) clutter_behaviour_apply (behave, rect); - clutter_timeline_set_loop (timeline, TRUE); + clutter_timeline_set_repeat_count (timeline, -1); g_signal_connect_swapped (timeline, "completed", G_CALLBACK (set_next_gravity), rect); clutter_timeline_start (timeline); diff --git a/tests/interactive/test-shader-effects.c b/tests/interactive/test-shader-effects.c index 6c7d8a6..d185252 100644 --- a/tests/interactive/test-shader-effects.c +++ b/tests/interactive/test-shader-effects.c @@ -19,11 +19,11 @@ test_shader_effects_main (int argc, char *argv[]) /* Make a timeline */ timeline = clutter_timeline_new (7692); - clutter_timeline_set_loop (timeline, TRUE); + clutter_timeline_set_repeat_count (timeline, -1); stage = clutter_stage_new (); clutter_stage_set_title (CLUTTER_STAGE (stage), "Rotations"); - clutter_stage_set_color (CLUTTER_STAGE (stage), CLUTTER_COLOR_Aluminium3); + clutter_actor_set_background_color (stage, CLUTTER_COLOR_Aluminium3); g_signal_connect (stage, "destroy", G_CALLBACK (clutter_main_quit), NULL); /* Make a hand */ diff --git a/tests/interactive/test-shader.c b/tests/interactive/test-shader.c index d86565a..35a7c47 100644 --- a/tests/interactive/test-shader.c +++ b/tests/interactive/test-shader.c @@ -334,7 +334,7 @@ test_shader_main (gint argc, gchar *argv[]) } clutter_stage_set_title (CLUTTER_STAGE (stage), "Shader Test"); - clutter_stage_set_color (CLUTTER_STAGE (stage), &stage_color); + clutter_actor_set_background_color (stage, &stage_color); file = g_build_filename (TESTS_DATADIR, "redhand.png", NULL); diff --git a/tests/interactive/test-state.c b/tests/interactive/test-state.c index fe71fda..0634173 100644 --- a/tests/interactive/test-state.c +++ b/tests/interactive/test-state.c @@ -106,7 +106,7 @@ test_state_main (gint argc, layout_state = clutter_state_new (); stage = clutter_stage_new (); - clutter_stage_set_color (CLUTTER_STAGE (stage), CLUTTER_COLOR_Black); + clutter_actor_set_background_color (stage, CLUTTER_COLOR_Black); clutter_stage_set_title (CLUTTER_STAGE (stage), "State Machine"); clutter_actor_set_size (stage, STAGE_WIDTH, STAGE_HEIGHT); g_signal_connect (stage, "destroy", G_CALLBACK (clutter_main_quit), NULL); diff --git a/tests/interactive/test-text-field.c b/tests/interactive/test-text-field.c index e40fb70..96616eb 100644 --- a/tests/interactive/test-text-field.c +++ b/tests/interactive/test-text-field.c @@ -279,7 +279,7 @@ test_text_field_main (gint argc, stage = clutter_stage_new (); clutter_stage_set_title (CLUTTER_STAGE (stage), "Text Fields"); - clutter_stage_set_color (CLUTTER_STAGE (stage), CLUTTER_COLOR_Black); + clutter_actor_set_background_color (stage, CLUTTER_COLOR_Black); g_signal_connect (stage, "destroy", G_CALLBACK (clutter_main_quit), NULL); table = clutter_table_layout_new (); diff --git a/tests/interactive/test-text.c b/tests/interactive/test-text.c index aadcf14..37e45a7 100644 --- a/tests/interactive/test-text.c +++ b/tests/interactive/test-text.c @@ -25,7 +25,7 @@ test_text_main (gint argc, stage = clutter_stage_new (); clutter_stage_set_title (CLUTTER_STAGE (stage), "Text Editing"); - clutter_stage_set_color (CLUTTER_STAGE (stage), CLUTTER_COLOR_Black); + clutter_actor_set_background_color (stage, CLUTTER_COLOR_Black); g_signal_connect (stage, "destroy", G_CALLBACK (clutter_main_quit), NULL); buffer = clutter_text_buffer_new_with_text ("·", -1); diff --git a/tests/interactive/test-texture-async.c b/tests/interactive/test-texture-async.c index 20d802b..ad04a89 100644 --- a/tests/interactive/test-texture-async.c +++ b/tests/interactive/test-texture-async.c @@ -125,7 +125,7 @@ test_texture_async_main (int argc, char *argv[]) stage = clutter_stage_new (); clutter_stage_set_title (CLUTTER_STAGE (stage), "Asynchronous Texture Loading"); - clutter_stage_set_color (CLUTTER_STAGE (stage), CLUTTER_COLOR_LightSkyBlue); + clutter_actor_set_background_color (stage, CLUTTER_COLOR_LightSkyBlue); g_signal_connect (stage, "destroy", G_CALLBACK (clutter_main_quit), NULL); clutter_actor_show (stage); diff --git a/tests/interactive/test-texture-quality.c b/tests/interactive/test-texture-quality.c index c612eb3..8cb916a 100644 --- a/tests/interactive/test-texture-quality.c +++ b/tests/interactive/test-texture-quality.c @@ -56,7 +56,7 @@ test_texture_quality_main (int argc, char *argv[]) return 1; stage = clutter_stage_new (); - clutter_stage_set_color (CLUTTER_STAGE (stage), &stage_color); + clutter_actor_set_background_color (stage, &stage_color); clutter_stage_set_use_fog (CLUTTER_STAGE (stage), TRUE); clutter_stage_set_fog (CLUTTER_STAGE (stage), &stage_fog); g_signal_connect (stage, diff --git a/tests/interactive/test-threads.c b/tests/interactive/test-threads.c index 16359f9..31baa88 100644 --- a/tests/interactive/test-threads.c +++ b/tests/interactive/test-threads.c @@ -212,7 +212,7 @@ test_threads_main (int argc, char *argv[]) stage = clutter_stage_new (); clutter_stage_set_title (CLUTTER_STAGE (stage), "Threading"); - clutter_stage_set_color (CLUTTER_STAGE (stage), CLUTTER_COLOR_Aluminium3); + clutter_actor_set_background_color (stage, CLUTTER_COLOR_Aluminium3); clutter_actor_set_size (stage, 600, 300); g_signal_connect (stage, "destroy", G_CALLBACK (clutter_main_quit), NULL); @@ -238,8 +238,8 @@ test_threads_main (int argc, char *argv[]) NULL); timeline = clutter_timeline_new (3000); - clutter_timeline_set_loop (timeline, TRUE); clutter_timeline_set_auto_reverse (timeline, TRUE); + clutter_timeline_set_repeat_count (timeline, -1); alpha = clutter_alpha_new_full (timeline, CLUTTER_LINEAR); r_behaviour = clutter_behaviour_rotate_new (alpha, -- 2.7.4