2008-06-16 09:40:39 -04:00
|
|
|
#include <stdlib.h>
|
|
|
|
#include <string.h>
|
|
|
|
|
|
|
|
#include <clutter/clutter.h>
|
|
|
|
|
2008-11-08 10:56:22 -05:00
|
|
|
#include "test-conform-common.h"
|
2008-06-16 09:40:39 -04:00
|
|
|
|
2008-11-08 10:56:22 -05:00
|
|
|
void
|
|
|
|
test_initial_state (TestConformSimpleFixture *fixture,
|
|
|
|
gconstpointer data)
|
2008-06-16 09:40:39 -04:00
|
|
|
{
|
|
|
|
ClutterActor *actor;
|
|
|
|
|
|
|
|
actor = clutter_rectangle_new ();
|
|
|
|
|
|
|
|
g_assert (!(CLUTTER_ACTOR_IS_REALIZED (actor)));
|
|
|
|
g_assert (!(CLUTTER_ACTOR_IS_MAPPED (actor)));
|
|
|
|
g_assert (!(CLUTTER_ACTOR_IS_VISIBLE (actor)));
|
|
|
|
|
|
|
|
clutter_actor_destroy (actor);
|
|
|
|
}
|
|
|
|
|
2008-11-08 10:56:22 -05:00
|
|
|
void
|
|
|
|
test_realized (TestConformSimpleFixture *fixture,
|
|
|
|
gconstpointer data)
|
2008-06-16 09:40:39 -04:00
|
|
|
{
|
|
|
|
ClutterActor *actor;
|
|
|
|
|
|
|
|
actor = clutter_rectangle_new ();
|
|
|
|
|
|
|
|
g_assert (!(CLUTTER_ACTOR_IS_REALIZED (actor)));
|
|
|
|
|
|
|
|
clutter_actor_realize (actor);
|
|
|
|
|
|
|
|
g_assert (CLUTTER_ACTOR_IS_REALIZED (actor));
|
|
|
|
|
|
|
|
g_assert (!(CLUTTER_ACTOR_IS_MAPPED (actor)));
|
|
|
|
g_assert (!(CLUTTER_ACTOR_IS_VISIBLE (actor)));
|
|
|
|
|
|
|
|
clutter_actor_destroy (actor);
|
|
|
|
}
|
|
|
|
|
2008-11-08 10:56:22 -05:00
|
|
|
void
|
|
|
|
test_mapped (TestConformSimpleFixture *fixture,
|
|
|
|
gconstpointer data)
|
2008-06-16 09:40:39 -04:00
|
|
|
{
|
|
|
|
ClutterActor *actor;
|
|
|
|
|
|
|
|
actor = clutter_rectangle_new ();
|
|
|
|
|
|
|
|
g_assert (!(CLUTTER_ACTOR_IS_REALIZED (actor)));
|
|
|
|
g_assert (!(CLUTTER_ACTOR_IS_MAPPED (actor)));
|
|
|
|
|
|
|
|
clutter_actor_show (actor);
|
|
|
|
|
|
|
|
g_assert (CLUTTER_ACTOR_IS_REALIZED (actor));
|
|
|
|
g_assert (CLUTTER_ACTOR_IS_MAPPED (actor));
|
|
|
|
|
|
|
|
g_assert (CLUTTER_ACTOR_IS_VISIBLE (actor));
|
|
|
|
|
|
|
|
clutter_actor_destroy (actor);
|
|
|
|
}
|
|
|
|
|
2008-11-08 10:56:22 -05:00
|
|
|
void
|
|
|
|
test_show_on_set_parent (TestConformSimpleFixture *fixture,
|
|
|
|
gconstpointer data)
|
2008-06-16 09:40:39 -04:00
|
|
|
{
|
|
|
|
ClutterActor *actor, *group;
|
|
|
|
gboolean show_on_set_parent;
|
|
|
|
|
|
|
|
group = clutter_group_new ();
|
|
|
|
|
|
|
|
g_assert (!(CLUTTER_ACTOR_IS_VISIBLE (group)));
|
|
|
|
|
|
|
|
actor = clutter_rectangle_new ();
|
|
|
|
g_object_get (G_OBJECT (actor),
|
|
|
|
"show-on-set-parent", &show_on_set_parent,
|
|
|
|
NULL);
|
|
|
|
|
|
|
|
g_assert (!(CLUTTER_ACTOR_IS_VISIBLE (actor)));
|
|
|
|
g_assert (show_on_set_parent == TRUE);
|
|
|
|
|
|
|
|
clutter_group_add (group, actor);
|
|
|
|
g_object_get (G_OBJECT (actor),
|
|
|
|
"show-on-set-parent", &show_on_set_parent,
|
|
|
|
NULL);
|
|
|
|
|
|
|
|
g_assert (CLUTTER_ACTOR_IS_VISIBLE (actor));
|
|
|
|
g_assert (show_on_set_parent == TRUE);
|
|
|
|
|
|
|
|
g_object_ref (actor);
|
|
|
|
clutter_actor_unparent (actor);
|
|
|
|
g_object_get (G_OBJECT (actor),
|
|
|
|
"show-on-set-parent", &show_on_set_parent,
|
|
|
|
NULL);
|
|
|
|
|
2008-06-17 05:33:18 -04:00
|
|
|
g_assert (CLUTTER_ACTOR_IS_REALIZED (actor));
|
2008-06-16 09:40:39 -04:00
|
|
|
g_assert (!(CLUTTER_ACTOR_IS_VISIBLE (actor)));
|
|
|
|
g_assert (show_on_set_parent == TRUE);
|
|
|
|
|
|
|
|
clutter_actor_destroy (actor);
|
|
|
|
clutter_actor_destroy (group);
|
|
|
|
}
|