Exemplo n.º 1
0
int
main (int argc, char *argv[])
{
  ClutterActor *stage         = NULL;
  Data data1, data2,data3;
  guint id_2 = 0;

  g_set_application_name ("AtkText");

  if (clutter_init (&argc, &argv) != CLUTTER_INIT_SUCCESS)
    return 1;

  cally_util_a11y_init (&argc, &argv);

  data1.value = 10;
  data2.value = 20;
  data3.value = 30;

  /* key event listeners */
  atk_add_key_event_listener ((AtkKeySnoopFunc)atk_key_listener, &data1);
  id_2 = atk_add_key_event_listener ((AtkKeySnoopFunc)atk_key_listener, &data2);
  atk_add_key_event_listener ((AtkKeySnoopFunc)atk_key_listener, &data3);

  atk_remove_key_event_listener (id_2);

  /* event listeners */
  atk_add_global_event_listener (window_event_listener, "window:create");
  atk_add_global_event_listener (window_event_listener, "window:destroy");
  atk_add_global_event_listener (window_event_listener, "window:activate");
  atk_add_global_event_listener (window_event_listener, "window:deactivate");

  stage = clutter_stage_get_default ();
  make_ui (stage);

  clutter_actor_show_all (stage);

  if (clutter_feature_available (CLUTTER_FEATURE_STAGE_MULTIPLE))
    {
      stage = clutter_stage_new ();
      make_ui (stage);
      clutter_actor_show_all (stage);
    }

  clutter_main ();

  return 0;
}
Exemplo n.º 2
0
int
main (int argc, char *argv[])
{
  ClutterActor *stage         = NULL;

  g_set_application_name ("Clone Example");

  clutter_init (&argc, &argv);

  cally_util_a11y_init (&argc, &argv);

  stage = clutter_stage_get_default ();
  make_ui (stage);

  clutter_actor_show_all (stage);

  clutter_main ();

  return 0;
}
int
main (int argc, char *argv[])
{
  ClutterActor *stage         = NULL;

  g_set_application_name ("AtkEditableText");

  clutter_init (&argc, &argv);

  cally_util_a11y_init (&argc, &argv);

  stage = clutter_stage_get_default ();

  make_ui (stage);

  clutter_actor_show_all (stage);

  test_atk_text (text_actor);
  test_atk_text (text_editable_actor);

  clutter_main ();

  return 0;
}
Exemplo n.º 4
0
int
main (int argc, char *argv[])
{
  ClutterActor *stage = NULL;
  ClutterColor  color = { 0x00, 0x00, 0x00, 0xff };
  ClutterActor *button1 = NULL;
  ClutterActor *button2 = NULL;
  ClutterActor *button3 = NULL;
  ClutterActor *button4 = NULL;
  ClutterActor *group[4];
  ClutterGeometry geom = {0, 0, SIZE, SIZE};
  gint i = 0;

  if (clutter_init (&argc, &argv) != CLUTTER_INIT_SUCCESS)
    return 1;

  cally_util_a11y_init (&argc, &argv);

  stage = clutter_stage_get_default ();

  clutter_stage_set_color (CLUTTER_STAGE (stage), &color);
  clutter_actor_set_size (stage, WIDTH, HEIGHT);

  button1 = clutter_rectangle_new_with_color (&color1);
  clutter_actor_set_geometry (button1, &geom);

  button2 = clutter_rectangle_new_with_color (&color2);
  geom.x = 2*SIZE;
  geom.y = 0;
  clutter_actor_set_geometry (button2, &geom);

  geom.x = 0;
  geom.y = 2*SIZE;
  button3 = clutter_rectangle_new_with_color (&color3);
  clutter_actor_set_geometry (button3, &geom);
  clutter_actor_set_depth( button3, DEPTH);

  /* a nested hierarchy, to check that the relative positions are
     computed properly */
  geom.x = SIZE/2;
  geom.y = SIZE/2;
  button4 = clutter_rectangle_new_with_color (&color4);
  clutter_actor_set_geometry (button4, &geom);
  clutter_actor_show (button4);

  for (i = 0; i < 4; i++) {
    group[i] = clutter_group_new ();
    clutter_actor_set_geometry (group[i], &geom);

    if (i > 0)
      clutter_group_add (CLUTTER_GROUP (group[i]), group [i - 1]);

    clutter_actor_show_all (group[i]);
  }

  clutter_group_add (CLUTTER_GROUP (stage), button1);
  clutter_group_add (CLUTTER_GROUP (stage), button2);
  clutter_group_add (CLUTTER_GROUP (stage), button3);
  clutter_group_add (CLUTTER_GROUP (stage), group[3]);
  clutter_group_add (CLUTTER_GROUP (group[0]), button4);

  clutter_actor_show_all (stage);

  clutter_main ();

  return 0;
}