Пример #1
0
      {
	ClutterColor color = { x * 255 / (ACTORS_X - 1),
			       y * 255 / (ACTORS_Y - 1),
			       128, 255 };
	ClutterActor *rect = clutter_rectangle_new_with_color (&color);

        clutter_actor_set_position (rect,
                                    x * state.actor_width,
                                    y * state.actor_height);
        clutter_actor_set_size (rect,
                                state.actor_width,
                                state.actor_height);

	clutter_actor_add_child (state.stage, rect);

	state.actors[y * ACTORS_X + x] = rect;
      }

  clutter_actor_show (state.stage);

  clutter_threads_add_idle (on_timeout, &state);

  clutter_main ();

  g_assert (state.pass);
}

CLUTTER_TEST_SUITE (
  CLUTTER_TEST_UNIT ("/actor/pick", actor_pick)
)
Пример #2
0
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
static void
default_stage (void)
{
  ClutterActor *stage, *def_stage;

  stage = clutter_test_get_stage ();
  def_stage = clutter_stage_get_default ();

  if (clutter_feature_available (CLUTTER_FEATURE_STAGE_MULTIPLE))
    g_assert (stage != def_stage);
  else
    g_assert (stage == def_stage);

  g_assert (CLUTTER_ACTOR_IS_REALIZED (def_stage));
}
G_GNUC_END_IGNORE_DEPRECATIONS

CLUTTER_TEST_SUITE (
  CLUTTER_TEST_UNIT ("/actor/invariants/initial-state", actor_initial_state)
  CLUTTER_TEST_UNIT ("/actor/invariants/show-not-parented", actor_shown_not_parented)
  CLUTTER_TEST_UNIT ("/actor/invariants/realized", actor_realized)
  CLUTTER_TEST_UNIT ("/actor/invariants/mapped", actor_mapped)
  CLUTTER_TEST_UNIT ("/actor/invariants/visibility-not-recursive", actor_visibility_not_recursive)
  CLUTTER_TEST_UNIT ("/actor/invariants/realize-not-recursive", actor_realize_not_recursive)
  CLUTTER_TEST_UNIT ("/actor/invariants/map-recursive", actor_map_recursive)
  CLUTTER_TEST_UNIT ("/actor/invariants/show-on-set-parent", actor_show_on_set_parent)
  CLUTTER_TEST_UNIT ("/actor/invariants/clone-no-map", clone_no_map)
  CLUTTER_TEST_UNIT ("/actor/invariants/default-stage", default_stage)
)