[clutter/deprecate-default-stage: 4/12] Merge with a11y



commit 529819f32e9bff11cb0cc3583c3ad049518a2cd1
Author: Emmanuele Bassi <ebassi linux intel com>
Date:   Wed Nov 9 10:55:49 2011 +0000

    Merge with a11y

 tests/accessibility/cally-atkcomponent-example.c   |    2 ++
 .../accessibility/cally-atkeditabletext-example.c  |   17 +++++++----------
 tests/accessibility/cally-atkevents-example.c      |   12 +++++-------
 tests/accessibility/cally-atktext-example.c        |    4 +---
 tests/accessibility/cally-clone-example.c          |    3 +--
 5 files changed, 16 insertions(+), 22 deletions(-)
---
diff --git a/tests/accessibility/cally-atkcomponent-example.c b/tests/accessibility/cally-atkcomponent-example.c
index 853ccbe..79a816b 100644
--- a/tests/accessibility/cally-atkcomponent-example.c
+++ b/tests/accessibility/cally-atkcomponent-example.c
@@ -51,6 +51,8 @@ main (int argc, char *argv[])
   clutter_stage_set_color (CLUTTER_STAGE (stage), CLUTTER_COLOR_White);
   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);
   clutter_actor_set_size (button1, SIZE, SIZE);
 
diff --git a/tests/accessibility/cally-atkeditabletext-example.c b/tests/accessibility/cally-atkeditabletext-example.c
index 4f2e732..433ee92 100644
--- a/tests/accessibility/cally-atkeditabletext-example.c
+++ b/tests/accessibility/cally-atkeditabletext-example.c
@@ -148,15 +148,14 @@ _create_button (const gchar *text)
   ClutterActor *button     = NULL;
   ClutterActor *rectangle  = NULL;
   ClutterActor *label      = NULL;
-  ClutterColor  color_rect = { 0x00, 0xff, 0xff, 0xff };
-  ClutterColor  color_label = { 0x00, 0x00, 0x00, 0xff };
 
   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);
 
   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), label);
   clutter_actor_set_reactive (button, TRUE);
@@ -164,12 +163,9 @@ _create_button (const gchar *text)
   return button;
 }
 
-
 static void
 make_ui (ClutterActor *stage)
 {
-  ClutterColor  color_text  = { 0xff, 0x00, 0x00, 0xff };
-  ClutterColor  color_sel   = { 0x00, 0xff, 0x00, 0x55 };
   ClutterActor *button      = NULL;
 
   clutter_stage_set_title (CLUTTER_STAGE (stage), "Cally - AtkEditable Test");
@@ -179,18 +175,18 @@ make_ui (ClutterActor *stage)
   /* text */
   text_actor = clutter_text_new_full ("Sans Bold 32px",
                                       "Lorem ipsum dolor sit amet",
-                                      &color_text);
+                                      CLUTTER_COLOR_Red);
   clutter_container_add_actor (CLUTTER_CONTAINER (stage), text_actor);
 
   /* text_editable */
   text_editable_actor = clutter_text_new_full ("Sans Bold 32px",
                                                "consectetur adipisicing elit",
-                                               &color_text);
+                                               CLUTTER_COLOR_Red);
   clutter_actor_set_position (text_editable_actor, 0, 100);
   clutter_text_set_editable (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),
-                                    &color_sel);
+                                    CLUTTER_COLOR_Green);
   clutter_text_set_activatable (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);
 
   stage = clutter_stage_new ();
+  g_signal_connect (stage, "destroy", G_CALLBACK (clutter_main_quit), NULL);
 
   make_ui (stage);
 
diff --git a/tests/accessibility/cally-atkevents-example.c b/tests/accessibility/cally-atkevents-example.c
index c3f2df2..4a55c9f 100644
--- a/tests/accessibility/cally-atkevents-example.c
+++ b/tests/accessibility/cally-atkevents-example.c
@@ -88,7 +88,6 @@ make_ui (ClutterActor *stage)
   ClutterActor    *editable      = NULL;
   ClutterActor    *rectangle     = NULL;
   ClutterActor    *label         = NULL;
-  ClutterColor     color_text    = { 0xff, 0x00, 0x00, 0xff };
   ClutterColor     color_sel     = { 0x00, 0xff, 0x00, 0x55 };
   ClutterColor     color_label   = { 0x00, 0xff, 0x55, 0xff };
   ClutterColor     color_rect    = { 0x00, 0xff, 0xff, 0x55 };
@@ -111,7 +110,7 @@ make_ui (ClutterActor *stage)
       /* editable */
       editable = clutter_text_new_full ("Sans Bold 32px",
                                         "ddd",
-                                        &color_text);
+                                        CLUTTER_COLOR_Red);
       clutter_actor_set_position (editable, 150, editable_geom_y);
       clutter_actor_set_size (editable, 500, 75);
       clutter_text_set_editable (CLUTTER_TEXT (editable), TRUE);
@@ -138,7 +137,7 @@ make_ui (ClutterActor *stage)
 int
 main (int argc, char *argv[])
 {
-  ClutterActor *stage, *stage_main
+  ClutterActor *stage, *stage_main;
   Data data1, data2, data3;
   guint id_2 = 0;
 
@@ -172,7 +171,8 @@ main (int argc, char *argv[])
   atk_add_global_event_listener (window_event_listener, "Atk:AtkWindow:deactivate");
 
   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);
 
   clutter_actor_show_all (stage_main);
@@ -181,6 +181,7 @@ main (int argc, char *argv[])
     {
       stage = clutter_stage_new ();
       clutter_stage_set_title (CLUTTER_STAGE (stage), "Cally - AtkEvents/2");
+      g_signal_connect (stage, "destroy", G_CALLBACK (clutter_main_quit), NULL);
 
       make_ui (stage);
       clutter_actor_show_all (stage);
@@ -188,8 +189,5 @@ main (int argc, char *argv[])
 
   clutter_main ();
 
-  clutter_actor_destroy (stage);
-  clutter_actor_destroy (stage_main);
-
   return 0;
 }
diff --git a/tests/accessibility/cally-atktext-example.c b/tests/accessibility/cally-atktext-example.c
index 3ffade6..f7218ce 100644
--- a/tests/accessibility/cally-atktext-example.c
+++ b/tests/accessibility/cally-atktext-example.c
@@ -237,7 +237,6 @@ make_ui (ClutterActor *stage)
                           G_CALLBACK (button_press_cb), NULL);
 
   clutter_container_add_actor (CLUTTER_CONTAINER (stage), button);
-
 }
 
 int
@@ -254,6 +253,7 @@ main (int argc, char *argv[])
 
   stage = clutter_stage_new ();
   clutter_stage_set_title (CLUTTER_STAGE (stage), "Cally - AtkText Test");
+  g_signal_connect (stage, "destroy", G_CALLBACK (clutter_main_quit), NULL);
 
   make_ui (stage);
 
@@ -264,7 +264,5 @@ main (int argc, char *argv[])
 
   clutter_main ();
 
-  clutter_actor_destroy (stage);
-
   return 0;
 }
diff --git a/tests/accessibility/cally-clone-example.c b/tests/accessibility/cally-clone-example.c
index 3cc3acb..9cc2d68 100644
--- a/tests/accessibility/cally-clone-example.c
+++ b/tests/accessibility/cally-clone-example.c
@@ -104,6 +104,7 @@ main (int argc, char *argv[])
 
   stage = clutter_stage_new ();
   clutter_stage_set_title (CLUTTER_STAGE (stage), "Cally - Clone Test");
+  g_signal_connect (stage, "destroy", G_CALLBACK (clutter_main_quit), NULL);
 
   make_ui (stage);
 
@@ -111,7 +112,5 @@ main (int argc, char *argv[])
 
   clutter_main ();
 
-  clutter_actor_destroy (stage);
-
   return 0;
 }



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]