accessibility/*: Do not use clutter_stage_get_default()

This commit is contained in:
Emmanuele Bassi 2011-11-08 17:11:34 +00:00
parent deba576dd1
commit a5522b707e
5 changed files with 27 additions and 13 deletions

View File

@ -45,8 +45,9 @@ main (int argc, char *argv[])
cally_util_a11y_init (&argc, &argv); cally_util_a11y_init (&argc, &argv);
stage = clutter_stage_get_default (); stage = clutter_stage_new ();
clutter_stage_set_title (CLUTTER_STAGE (stage), "Cally - AtkComponent Test");
clutter_stage_set_color (CLUTTER_STAGE (stage), CLUTTER_COLOR_White); clutter_stage_set_color (CLUTTER_STAGE (stage), CLUTTER_COLOR_White);
clutter_actor_set_size (stage, WIDTH, HEIGHT); clutter_actor_set_size (stage, WIDTH, HEIGHT);

View File

@ -168,12 +168,12 @@ _create_button (const gchar *text)
static void static void
make_ui (ClutterActor *stage) make_ui (ClutterActor *stage)
{ {
ClutterColor color_stage = { 0x00, 0x00, 0x00, 0xff };
ClutterColor color_text = { 0xff, 0x00, 0x00, 0xff }; ClutterColor color_text = { 0xff, 0x00, 0x00, 0xff };
ClutterColor color_sel = { 0x00, 0xff, 0x00, 0x55 }; ClutterColor color_sel = { 0x00, 0xff, 0x00, 0x55 };
ClutterActor *button = NULL; ClutterActor *button = NULL;
clutter_stage_set_color (CLUTTER_STAGE (stage), &color_stage); clutter_stage_set_title (CLUTTER_STAGE (stage), "Cally - AtkEditable Test");
clutter_stage_set_color (CLUTTER_STAGE (stage), CLUTTER_COLOR_White);
clutter_actor_set_size (stage, WIDTH, HEIGHT); clutter_actor_set_size (stage, WIDTH, HEIGHT);
/* text */ /* text */
@ -256,7 +256,7 @@ main (int argc, char *argv[])
cally_util_a11y_init (&argc, &argv); cally_util_a11y_init (&argc, &argv);
stage = clutter_stage_get_default (); stage = clutter_stage_new ();
make_ui (stage); make_ui (stage);

View File

@ -138,8 +138,8 @@ make_ui (ClutterActor *stage)
int int
main (int argc, char *argv[]) main (int argc, char *argv[])
{ {
ClutterActor *stage = NULL; ClutterActor *stage, *stage_main
Data data1, data2,data3; Data data1, data2, data3;
guint id_2 = 0; guint id_2 = 0;
g_set_application_name ("AtkText"); g_set_application_name ("AtkText");
@ -171,19 +171,25 @@ main (int argc, char *argv[])
atk_add_global_event_listener (window_event_listener, "Atk:AtkWindow:activate"); atk_add_global_event_listener (window_event_listener, "Atk:AtkWindow:activate");
atk_add_global_event_listener (window_event_listener, "Atk:AtkWindow:deactivate"); atk_add_global_event_listener (window_event_listener, "Atk:AtkWindow:deactivate");
stage = clutter_stage_get_default (); stage_main = clutter_stage_new ();
make_ui (stage); clutter_stage_set_title (CLUTTER_STAGE (stage), "Cally - AtkEvents/1");
make_ui (stage_main);
clutter_actor_show_all (stage); clutter_actor_show_all (stage_main);
if (clutter_feature_available (CLUTTER_FEATURE_STAGE_MULTIPLE)) if (clutter_feature_available (CLUTTER_FEATURE_STAGE_MULTIPLE))
{ {
stage = clutter_stage_new (); stage = clutter_stage_new ();
clutter_stage_set_title (CLUTTER_STAGE (stage), "Cally - AtkEvents/2");
make_ui (stage); make_ui (stage);
clutter_actor_show_all (stage); clutter_actor_show_all (stage);
} }
clutter_main (); clutter_main ();
clutter_actor_destroy (stage);
clutter_actor_destroy (stage_main);
return 0; return 0;
} }

View File

@ -243,7 +243,7 @@ make_ui (ClutterActor *stage)
int int
main (int argc, char *argv[]) main (int argc, char *argv[])
{ {
ClutterActor *stage = NULL; ClutterActor *stage;
g_set_application_name ("AtkText"); g_set_application_name ("AtkText");
@ -252,7 +252,8 @@ main (int argc, char *argv[])
cally_util_a11y_init (&argc, &argv); cally_util_a11y_init (&argc, &argv);
stage = clutter_stage_get_default (); stage = clutter_stage_new ();
clutter_stage_set_title (CLUTTER_STAGE (stage), "Cally - AtkText Test");
make_ui (stage); make_ui (stage);
@ -263,5 +264,7 @@ main (int argc, char *argv[])
clutter_main (); clutter_main ();
clutter_actor_destroy (stage);
return 0; return 0;
} }

View File

@ -93,7 +93,7 @@ make_ui (ClutterActor *stage)
int int
main (int argc, char *argv[]) main (int argc, char *argv[])
{ {
ClutterActor *stage = NULL; ClutterActor *stage;
g_set_application_name ("Clone Example"); g_set_application_name ("Clone Example");
@ -102,12 +102,16 @@ main (int argc, char *argv[])
cally_util_a11y_init (&argc, &argv); cally_util_a11y_init (&argc, &argv);
stage = clutter_stage_get_default (); stage = clutter_stage_new ();
clutter_stage_set_title (CLUTTER_STAGE (stage), "Cally - Clone Test");
make_ui (stage); make_ui (stage);
clutter_actor_show_all (stage); clutter_actor_show_all (stage);
clutter_main (); clutter_main ();
clutter_actor_destroy (stage);
return 0; return 0;
} }