1
0
Fork 0

interactive/*: Update the API usage

Drop some deprecated methods.
This commit is contained in:
Emmanuele Bassi 2012-02-13 16:47:17 +00:00
parent bc7959069b
commit 5b17b4e41b
25 changed files with 36 additions and 41 deletions

View file

@ -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 =

View file

@ -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);

View file

@ -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);

View file

@ -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 */

View file

@ -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);

View file

@ -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);

View file

@ -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++)
{

View file

@ -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);

View file

@ -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,

View file

@ -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;

View file

@ -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);

View file

@ -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);

View file

@ -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),

View file

@ -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,

View file

@ -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 =

View file

@ -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);

View file

@ -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);

View file

@ -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 */

View file

@ -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);

View file

@ -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);

View file

@ -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 ();

View file

@ -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);

View file

@ -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);

View file

@ -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,

View file

@ -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,