Merge with a11y

This commit is contained in:
Emmanuele Bassi 2011-11-09 10:55:49 +00:00
parent 93eb0bfe32
commit 6ed879b84c
5 changed files with 16 additions and 22 deletions

View File

@ -51,6 +51,8 @@ main (int argc, char *argv[])
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);
g_signal_connect (stage, "destroy", G_CALLBACK (clutter_main_quit), NULL);
button1 = clutter_rectangle_new_with_color (CLUTTER_COLOR_Yellow); button1 = clutter_rectangle_new_with_color (CLUTTER_COLOR_Yellow);
clutter_actor_set_size (button1, SIZE, SIZE); clutter_actor_set_size (button1, SIZE, SIZE);

View File

@ -148,15 +148,14 @@ _create_button (const gchar *text)
ClutterActor *button = NULL; ClutterActor *button = NULL;
ClutterActor *rectangle = NULL; ClutterActor *rectangle = NULL;
ClutterActor *label = NULL; ClutterActor *label = NULL;
ClutterColor color_rect = { 0x00, 0xff, 0xff, 0xff };
ClutterColor color_label = { 0x00, 0x00, 0x00, 0xff };
button = clutter_group_new (); button = clutter_group_new ();
rectangle = clutter_rectangle_new_with_color (&color_rect); rectangle = clutter_rectangle_new_with_color (CLUTTER_COLOR_Magenta);
clutter_actor_set_size (rectangle, 375, 35); clutter_actor_set_size (rectangle, 375, 35);
label = clutter_text_new_full ("Sans Bold 32px", label = clutter_text_new_full ("Sans Bold 32px",
text, &color_label); text,
CLUTTER_COLOR_Black);
clutter_container_add_actor (CLUTTER_CONTAINER (button), rectangle); clutter_container_add_actor (CLUTTER_CONTAINER (button), rectangle);
clutter_container_add_actor (CLUTTER_CONTAINER (button), label); clutter_container_add_actor (CLUTTER_CONTAINER (button), label);
clutter_actor_set_reactive (button, TRUE); clutter_actor_set_reactive (button, TRUE);
@ -164,12 +163,9 @@ _create_button (const gchar *text)
return button; return button;
} }
static void static void
make_ui (ClutterActor *stage) make_ui (ClutterActor *stage)
{ {
ClutterColor color_text = { 0xff, 0x00, 0x00, 0xff };
ClutterColor color_sel = { 0x00, 0xff, 0x00, 0x55 };
ClutterActor *button = NULL; ClutterActor *button = NULL;
clutter_stage_set_title (CLUTTER_STAGE (stage), "Cally - AtkEditable Test"); clutter_stage_set_title (CLUTTER_STAGE (stage), "Cally - AtkEditable Test");
@ -179,18 +175,18 @@ make_ui (ClutterActor *stage)
/* text */ /* text */
text_actor = clutter_text_new_full ("Sans Bold 32px", text_actor = clutter_text_new_full ("Sans Bold 32px",
"Lorem ipsum dolor sit amet", "Lorem ipsum dolor sit amet",
&color_text); CLUTTER_COLOR_Red);
clutter_container_add_actor (CLUTTER_CONTAINER (stage), text_actor); clutter_container_add_actor (CLUTTER_CONTAINER (stage), text_actor);
/* text_editable */ /* text_editable */
text_editable_actor = clutter_text_new_full ("Sans Bold 32px", text_editable_actor = clutter_text_new_full ("Sans Bold 32px",
"consectetur adipisicing elit", "consectetur adipisicing elit",
&color_text); CLUTTER_COLOR_Red);
clutter_actor_set_position (text_editable_actor, 0, 100); clutter_actor_set_position (text_editable_actor, 0, 100);
clutter_text_set_editable (CLUTTER_TEXT (text_editable_actor), TRUE); clutter_text_set_editable (CLUTTER_TEXT (text_editable_actor), TRUE);
clutter_text_set_selectable (CLUTTER_TEXT (text_editable_actor), TRUE); clutter_text_set_selectable (CLUTTER_TEXT (text_editable_actor), TRUE);
clutter_text_set_selection_color (CLUTTER_TEXT (text_editable_actor), clutter_text_set_selection_color (CLUTTER_TEXT (text_editable_actor),
&color_sel); CLUTTER_COLOR_Green);
clutter_text_set_activatable (CLUTTER_TEXT (text_editable_actor), clutter_text_set_activatable (CLUTTER_TEXT (text_editable_actor),
TRUE); TRUE);
clutter_text_set_line_wrap (CLUTTER_TEXT (text_editable_actor), TRUE); clutter_text_set_line_wrap (CLUTTER_TEXT (text_editable_actor), TRUE);
@ -257,6 +253,7 @@ main (int argc, char *argv[])
cally_util_a11y_init (&argc, &argv); cally_util_a11y_init (&argc, &argv);
stage = clutter_stage_new (); stage = clutter_stage_new ();
g_signal_connect (stage, "destroy", G_CALLBACK (clutter_main_quit), NULL);
make_ui (stage); make_ui (stage);

View File

@ -88,7 +88,6 @@ make_ui (ClutterActor *stage)
ClutterActor *editable = NULL; ClutterActor *editable = NULL;
ClutterActor *rectangle = NULL; ClutterActor *rectangle = NULL;
ClutterActor *label = NULL; ClutterActor *label = NULL;
ClutterColor color_text = { 0xff, 0x00, 0x00, 0xff };
ClutterColor color_sel = { 0x00, 0xff, 0x00, 0x55 }; ClutterColor color_sel = { 0x00, 0xff, 0x00, 0x55 };
ClutterColor color_label = { 0x00, 0xff, 0x55, 0xff }; ClutterColor color_label = { 0x00, 0xff, 0x55, 0xff };
ClutterColor color_rect = { 0x00, 0xff, 0xff, 0x55 }; ClutterColor color_rect = { 0x00, 0xff, 0xff, 0x55 };
@ -111,7 +110,7 @@ make_ui (ClutterActor *stage)
/* editable */ /* editable */
editable = clutter_text_new_full ("Sans Bold 32px", editable = clutter_text_new_full ("Sans Bold 32px",
"ddd", "ddd",
&color_text); CLUTTER_COLOR_Red);
clutter_actor_set_position (editable, 150, editable_geom_y); clutter_actor_set_position (editable, 150, editable_geom_y);
clutter_actor_set_size (editable, 500, 75); clutter_actor_set_size (editable, 500, 75);
clutter_text_set_editable (CLUTTER_TEXT (editable), TRUE); clutter_text_set_editable (CLUTTER_TEXT (editable), TRUE);
@ -138,7 +137,7 @@ make_ui (ClutterActor *stage)
int int
main (int argc, char *argv[]) main (int argc, char *argv[])
{ {
ClutterActor *stage, *stage_main ClutterActor *stage, *stage_main;
Data data1, data2, data3; Data data1, data2, data3;
guint id_2 = 0; guint id_2 = 0;
@ -172,7 +171,8 @@ main (int argc, char *argv[])
atk_add_global_event_listener (window_event_listener, "Atk:AtkWindow:deactivate"); atk_add_global_event_listener (window_event_listener, "Atk:AtkWindow:deactivate");
stage_main = clutter_stage_new (); stage_main = clutter_stage_new ();
clutter_stage_set_title (CLUTTER_STAGE (stage), "Cally - AtkEvents/1"); clutter_stage_set_title (CLUTTER_STAGE (stage_main), "Cally - AtkEvents/1");
g_signal_connect (stage_main, "destroy", G_CALLBACK (clutter_main_quit), NULL);
make_ui (stage_main); make_ui (stage_main);
clutter_actor_show_all (stage_main); clutter_actor_show_all (stage_main);
@ -181,6 +181,7 @@ main (int argc, char *argv[])
{ {
stage = clutter_stage_new (); stage = clutter_stage_new ();
clutter_stage_set_title (CLUTTER_STAGE (stage), "Cally - AtkEvents/2"); clutter_stage_set_title (CLUTTER_STAGE (stage), "Cally - AtkEvents/2");
g_signal_connect (stage, "destroy", G_CALLBACK (clutter_main_quit), NULL);
make_ui (stage); make_ui (stage);
clutter_actor_show_all (stage); clutter_actor_show_all (stage);
@ -188,8 +189,5 @@ main (int argc, char *argv[])
clutter_main (); clutter_main ();
clutter_actor_destroy (stage);
clutter_actor_destroy (stage_main);
return 0; return 0;
} }

View File

@ -237,7 +237,6 @@ make_ui (ClutterActor *stage)
G_CALLBACK (button_press_cb), NULL); G_CALLBACK (button_press_cb), NULL);
clutter_container_add_actor (CLUTTER_CONTAINER (stage), button); clutter_container_add_actor (CLUTTER_CONTAINER (stage), button);
} }
int int
@ -254,6 +253,7 @@ main (int argc, char *argv[])
stage = clutter_stage_new (); stage = clutter_stage_new ();
clutter_stage_set_title (CLUTTER_STAGE (stage), "Cally - AtkText Test"); clutter_stage_set_title (CLUTTER_STAGE (stage), "Cally - AtkText Test");
g_signal_connect (stage, "destroy", G_CALLBACK (clutter_main_quit), NULL);
make_ui (stage); make_ui (stage);
@ -264,7 +264,5 @@ main (int argc, char *argv[])
clutter_main (); clutter_main ();
clutter_actor_destroy (stage);
return 0; return 0;
} }

View File

@ -104,6 +104,7 @@ main (int argc, char *argv[])
stage = clutter_stage_new (); stage = clutter_stage_new ();
clutter_stage_set_title (CLUTTER_STAGE (stage), "Cally - Clone Test"); clutter_stage_set_title (CLUTTER_STAGE (stage), "Cally - Clone Test");
g_signal_connect (stage, "destroy", G_CALLBACK (clutter_main_quit), NULL);
make_ui (stage); make_ui (stage);
@ -111,7 +112,5 @@ main (int argc, char *argv[])
clutter_main (); clutter_main ();
clutter_actor_destroy (stage);
return 0; return 0;
} }