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
|
2012-02-15 08:43:15 -05:00
|
|
|
|
actor_initial_state (TestConformSimpleFixture *fixture,
|
|
|
|
|
gconstpointer data)
|
2008-06-16 09:40:39 -04:00
|
|
|
|
{
|
|
|
|
|
ClutterActor *actor;
|
|
|
|
|
|
2013-06-12 05:27:37 -04:00
|
|
|
|
actor = clutter_actor_new ();
|
2012-02-15 08:43:15 -05:00
|
|
|
|
g_object_ref_sink (actor);
|
2013-06-12 05:27:37 -04:00
|
|
|
|
g_object_add_weak_pointer (G_OBJECT (actor), (gpointer *) &actor);
|
2012-02-15 08:43:15 -05:00
|
|
|
|
|
|
|
|
|
if (g_test_verbose ())
|
|
|
|
|
g_print ("initial state - visible: %s, realized: %s, mapped: %s\n",
|
|
|
|
|
CLUTTER_ACTOR_IS_VISIBLE (actor) ? "yes" : "no",
|
|
|
|
|
CLUTTER_ACTOR_IS_REALIZED (actor) ? "yes" : "no",
|
|
|
|
|
CLUTTER_ACTOR_IS_MAPPED (actor) ? "yes" : "no");
|
2008-06-16 09:40:39 -04:00
|
|
|
|
|
|
|
|
|
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);
|
2013-06-12 05:27:37 -04:00
|
|
|
|
g_assert (actor == NULL);
|
2008-06-16 09:40:39 -04:00
|
|
|
|
}
|
|
|
|
|
|
Enforce invariants on mapped, realized, visibility states
Bug 1138 - No trackable "mapped" state
* Add a VISIBLE flag tracking application programmer's
expected showing-state for the actor, allowing us to
always ensure we keep what the app wants while tracking
internal implementation state separately.
* Make MAPPED reflect whether the actor will be painted;
add notification on a ClutterActor::mapped property.
Keep MAPPED state updated as the actor is shown,
ancestors are shown, actor is reparented, etc.
* Require a stage and realized parents to realize; this means
at realization time the correct window system and GL resources
are known. But unparented actors can no longer be realized.
* Allow children to be unrealized even if parent is realized.
Otherwise in effect either all actors or no actors are realized,
i.e. it becomes a stage-global flag.
* Allow clutter_actor_realize() to "fail" if not inside a toplevel
* Rework clutter_actor_unrealize() so internally we have
a flavor that does not mess with visibility flag
* Add _clutter_actor_rerealize() to encapsulate a somewhat
tricky operation we were doing in a couple of places
* Do not realize/unrealize children in ClutterGroup,
ClutterActor already does it
* Do not realize impl by hand in clutter_stage_show(),
since showing impl already does that
* Do not unrealize in various dispose() methods, since
ClutterActor dispose implementation already does it
and chaining up is mandatory
* ClutterTexture uses COGL while unrealizable (before it's
added to a stage). Previously this breakage was affecting
ClutterActor because we had to allow realize outside
a stage. Move the breakage to ClutterTexture, by making
ClutterTexture just use COGL while not realized.
* Unrealize before we set parent to NULL in clutter_actor_unparent().
This means unrealize() implementations can get to the stage.
Because actors need the stage in order to detach from stage.
* Update clutter-actor-invariants.txt to reflect latest changes
* Remove explicit hide/unrealize from ClutterActor::dispose since
unparent already forces those
Instead just assert that unparent() occurred and did the right thing.
* Check whether parent implements unrealize before chaining up
Needed because ClutterGroup no longer has to implement unrealize.
* Perform unrealize in the default handler for the signal.
This allows non-containers that have children to work properly,
and allows containers to override how it's done.
* Add map/unmap virtual methods and set MAPPED flag on self and
children in there. This allows subclasses to hook map/unmap.
These are not signals, because notify::mapped is better for
anything it's legitimate for a non-subclass to do.
Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
2009-04-02 09:16:43 -04:00
|
|
|
|
void
|
2012-02-15 08:43:15 -05:00
|
|
|
|
actor_shown_not_parented (TestConformSimpleFixture *fixture,
|
|
|
|
|
gconstpointer data)
|
Enforce invariants on mapped, realized, visibility states
Bug 1138 - No trackable "mapped" state
* Add a VISIBLE flag tracking application programmer's
expected showing-state for the actor, allowing us to
always ensure we keep what the app wants while tracking
internal implementation state separately.
* Make MAPPED reflect whether the actor will be painted;
add notification on a ClutterActor::mapped property.
Keep MAPPED state updated as the actor is shown,
ancestors are shown, actor is reparented, etc.
* Require a stage and realized parents to realize; this means
at realization time the correct window system and GL resources
are known. But unparented actors can no longer be realized.
* Allow children to be unrealized even if parent is realized.
Otherwise in effect either all actors or no actors are realized,
i.e. it becomes a stage-global flag.
* Allow clutter_actor_realize() to "fail" if not inside a toplevel
* Rework clutter_actor_unrealize() so internally we have
a flavor that does not mess with visibility flag
* Add _clutter_actor_rerealize() to encapsulate a somewhat
tricky operation we were doing in a couple of places
* Do not realize/unrealize children in ClutterGroup,
ClutterActor already does it
* Do not realize impl by hand in clutter_stage_show(),
since showing impl already does that
* Do not unrealize in various dispose() methods, since
ClutterActor dispose implementation already does it
and chaining up is mandatory
* ClutterTexture uses COGL while unrealizable (before it's
added to a stage). Previously this breakage was affecting
ClutterActor because we had to allow realize outside
a stage. Move the breakage to ClutterTexture, by making
ClutterTexture just use COGL while not realized.
* Unrealize before we set parent to NULL in clutter_actor_unparent().
This means unrealize() implementations can get to the stage.
Because actors need the stage in order to detach from stage.
* Update clutter-actor-invariants.txt to reflect latest changes
* Remove explicit hide/unrealize from ClutterActor::dispose since
unparent already forces those
Instead just assert that unparent() occurred and did the right thing.
* Check whether parent implements unrealize before chaining up
Needed because ClutterGroup no longer has to implement unrealize.
* Perform unrealize in the default handler for the signal.
This allows non-containers that have children to work properly,
and allows containers to override how it's done.
* Add map/unmap virtual methods and set MAPPED flag on self and
children in there. This allows subclasses to hook map/unmap.
These are not signals, because notify::mapped is better for
anything it's legitimate for a non-subclass to do.
Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
2009-04-02 09:16:43 -04:00
|
|
|
|
{
|
|
|
|
|
ClutterActor *actor;
|
|
|
|
|
|
|
|
|
|
actor = clutter_rectangle_new ();
|
2012-02-15 08:43:15 -05:00
|
|
|
|
g_object_ref_sink (actor);
|
2013-06-12 05:27:37 -04:00
|
|
|
|
g_object_add_weak_pointer (G_OBJECT (actor), (gpointer *) &actor);
|
Enforce invariants on mapped, realized, visibility states
Bug 1138 - No trackable "mapped" state
* Add a VISIBLE flag tracking application programmer's
expected showing-state for the actor, allowing us to
always ensure we keep what the app wants while tracking
internal implementation state separately.
* Make MAPPED reflect whether the actor will be painted;
add notification on a ClutterActor::mapped property.
Keep MAPPED state updated as the actor is shown,
ancestors are shown, actor is reparented, etc.
* Require a stage and realized parents to realize; this means
at realization time the correct window system and GL resources
are known. But unparented actors can no longer be realized.
* Allow children to be unrealized even if parent is realized.
Otherwise in effect either all actors or no actors are realized,
i.e. it becomes a stage-global flag.
* Allow clutter_actor_realize() to "fail" if not inside a toplevel
* Rework clutter_actor_unrealize() so internally we have
a flavor that does not mess with visibility flag
* Add _clutter_actor_rerealize() to encapsulate a somewhat
tricky operation we were doing in a couple of places
* Do not realize/unrealize children in ClutterGroup,
ClutterActor already does it
* Do not realize impl by hand in clutter_stage_show(),
since showing impl already does that
* Do not unrealize in various dispose() methods, since
ClutterActor dispose implementation already does it
and chaining up is mandatory
* ClutterTexture uses COGL while unrealizable (before it's
added to a stage). Previously this breakage was affecting
ClutterActor because we had to allow realize outside
a stage. Move the breakage to ClutterTexture, by making
ClutterTexture just use COGL while not realized.
* Unrealize before we set parent to NULL in clutter_actor_unparent().
This means unrealize() implementations can get to the stage.
Because actors need the stage in order to detach from stage.
* Update clutter-actor-invariants.txt to reflect latest changes
* Remove explicit hide/unrealize from ClutterActor::dispose since
unparent already forces those
Instead just assert that unparent() occurred and did the right thing.
* Check whether parent implements unrealize before chaining up
Needed because ClutterGroup no longer has to implement unrealize.
* Perform unrealize in the default handler for the signal.
This allows non-containers that have children to work properly,
and allows containers to override how it's done.
* Add map/unmap virtual methods and set MAPPED flag on self and
children in there. This allows subclasses to hook map/unmap.
These are not signals, because notify::mapped is better for
anything it's legitimate for a non-subclass to do.
Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
2009-04-02 09:16:43 -04:00
|
|
|
|
|
|
|
|
|
clutter_actor_show (actor);
|
|
|
|
|
|
2012-02-15 08:43:15 -05:00
|
|
|
|
if (g_test_verbose ())
|
|
|
|
|
g_print ("show without a parent - visible: %s, realized: %s, mapped: %s\n",
|
|
|
|
|
CLUTTER_ACTOR_IS_VISIBLE (actor) ? "yes" : "no",
|
|
|
|
|
CLUTTER_ACTOR_IS_REALIZED (actor) ? "yes" : "no",
|
|
|
|
|
CLUTTER_ACTOR_IS_MAPPED (actor) ? "yes" : "no");
|
|
|
|
|
|
Enforce invariants on mapped, realized, visibility states
Bug 1138 - No trackable "mapped" state
* Add a VISIBLE flag tracking application programmer's
expected showing-state for the actor, allowing us to
always ensure we keep what the app wants while tracking
internal implementation state separately.
* Make MAPPED reflect whether the actor will be painted;
add notification on a ClutterActor::mapped property.
Keep MAPPED state updated as the actor is shown,
ancestors are shown, actor is reparented, etc.
* Require a stage and realized parents to realize; this means
at realization time the correct window system and GL resources
are known. But unparented actors can no longer be realized.
* Allow children to be unrealized even if parent is realized.
Otherwise in effect either all actors or no actors are realized,
i.e. it becomes a stage-global flag.
* Allow clutter_actor_realize() to "fail" if not inside a toplevel
* Rework clutter_actor_unrealize() so internally we have
a flavor that does not mess with visibility flag
* Add _clutter_actor_rerealize() to encapsulate a somewhat
tricky operation we were doing in a couple of places
* Do not realize/unrealize children in ClutterGroup,
ClutterActor already does it
* Do not realize impl by hand in clutter_stage_show(),
since showing impl already does that
* Do not unrealize in various dispose() methods, since
ClutterActor dispose implementation already does it
and chaining up is mandatory
* ClutterTexture uses COGL while unrealizable (before it's
added to a stage). Previously this breakage was affecting
ClutterActor because we had to allow realize outside
a stage. Move the breakage to ClutterTexture, by making
ClutterTexture just use COGL while not realized.
* Unrealize before we set parent to NULL in clutter_actor_unparent().
This means unrealize() implementations can get to the stage.
Because actors need the stage in order to detach from stage.
* Update clutter-actor-invariants.txt to reflect latest changes
* Remove explicit hide/unrealize from ClutterActor::dispose since
unparent already forces those
Instead just assert that unparent() occurred and did the right thing.
* Check whether parent implements unrealize before chaining up
Needed because ClutterGroup no longer has to implement unrealize.
* Perform unrealize in the default handler for the signal.
This allows non-containers that have children to work properly,
and allows containers to override how it's done.
* Add map/unmap virtual methods and set MAPPED flag on self and
children in there. This allows subclasses to hook map/unmap.
These are not signals, because notify::mapped is better for
anything it's legitimate for a non-subclass to do.
Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
2009-04-02 09:16:43 -04:00
|
|
|
|
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);
|
2013-06-12 05:27:37 -04:00
|
|
|
|
g_assert (actor == NULL);
|
Enforce invariants on mapped, realized, visibility states
Bug 1138 - No trackable "mapped" state
* Add a VISIBLE flag tracking application programmer's
expected showing-state for the actor, allowing us to
always ensure we keep what the app wants while tracking
internal implementation state separately.
* Make MAPPED reflect whether the actor will be painted;
add notification on a ClutterActor::mapped property.
Keep MAPPED state updated as the actor is shown,
ancestors are shown, actor is reparented, etc.
* Require a stage and realized parents to realize; this means
at realization time the correct window system and GL resources
are known. But unparented actors can no longer be realized.
* Allow children to be unrealized even if parent is realized.
Otherwise in effect either all actors or no actors are realized,
i.e. it becomes a stage-global flag.
* Allow clutter_actor_realize() to "fail" if not inside a toplevel
* Rework clutter_actor_unrealize() so internally we have
a flavor that does not mess with visibility flag
* Add _clutter_actor_rerealize() to encapsulate a somewhat
tricky operation we were doing in a couple of places
* Do not realize/unrealize children in ClutterGroup,
ClutterActor already does it
* Do not realize impl by hand in clutter_stage_show(),
since showing impl already does that
* Do not unrealize in various dispose() methods, since
ClutterActor dispose implementation already does it
and chaining up is mandatory
* ClutterTexture uses COGL while unrealizable (before it's
added to a stage). Previously this breakage was affecting
ClutterActor because we had to allow realize outside
a stage. Move the breakage to ClutterTexture, by making
ClutterTexture just use COGL while not realized.
* Unrealize before we set parent to NULL in clutter_actor_unparent().
This means unrealize() implementations can get to the stage.
Because actors need the stage in order to detach from stage.
* Update clutter-actor-invariants.txt to reflect latest changes
* Remove explicit hide/unrealize from ClutterActor::dispose since
unparent already forces those
Instead just assert that unparent() occurred and did the right thing.
* Check whether parent implements unrealize before chaining up
Needed because ClutterGroup no longer has to implement unrealize.
* Perform unrealize in the default handler for the signal.
This allows non-containers that have children to work properly,
and allows containers to override how it's done.
* Add map/unmap virtual methods and set MAPPED flag on self and
children in there. This allows subclasses to hook map/unmap.
These are not signals, because notify::mapped is better for
anything it's legitimate for a non-subclass to do.
Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
2009-04-02 09:16:43 -04:00
|
|
|
|
}
|
|
|
|
|
|
2008-11-08 10:56:22 -05:00
|
|
|
|
void
|
2012-02-15 08:43:15 -05:00
|
|
|
|
actor_realized (TestConformSimpleFixture *fixture,
|
|
|
|
|
gconstpointer data)
|
2008-06-16 09:40:39 -04:00
|
|
|
|
{
|
|
|
|
|
ClutterActor *actor;
|
Enforce invariants on mapped, realized, visibility states
Bug 1138 - No trackable "mapped" state
* Add a VISIBLE flag tracking application programmer's
expected showing-state for the actor, allowing us to
always ensure we keep what the app wants while tracking
internal implementation state separately.
* Make MAPPED reflect whether the actor will be painted;
add notification on a ClutterActor::mapped property.
Keep MAPPED state updated as the actor is shown,
ancestors are shown, actor is reparented, etc.
* Require a stage and realized parents to realize; this means
at realization time the correct window system and GL resources
are known. But unparented actors can no longer be realized.
* Allow children to be unrealized even if parent is realized.
Otherwise in effect either all actors or no actors are realized,
i.e. it becomes a stage-global flag.
* Allow clutter_actor_realize() to "fail" if not inside a toplevel
* Rework clutter_actor_unrealize() so internally we have
a flavor that does not mess with visibility flag
* Add _clutter_actor_rerealize() to encapsulate a somewhat
tricky operation we were doing in a couple of places
* Do not realize/unrealize children in ClutterGroup,
ClutterActor already does it
* Do not realize impl by hand in clutter_stage_show(),
since showing impl already does that
* Do not unrealize in various dispose() methods, since
ClutterActor dispose implementation already does it
and chaining up is mandatory
* ClutterTexture uses COGL while unrealizable (before it's
added to a stage). Previously this breakage was affecting
ClutterActor because we had to allow realize outside
a stage. Move the breakage to ClutterTexture, by making
ClutterTexture just use COGL while not realized.
* Unrealize before we set parent to NULL in clutter_actor_unparent().
This means unrealize() implementations can get to the stage.
Because actors need the stage in order to detach from stage.
* Update clutter-actor-invariants.txt to reflect latest changes
* Remove explicit hide/unrealize from ClutterActor::dispose since
unparent already forces those
Instead just assert that unparent() occurred and did the right thing.
* Check whether parent implements unrealize before chaining up
Needed because ClutterGroup no longer has to implement unrealize.
* Perform unrealize in the default handler for the signal.
This allows non-containers that have children to work properly,
and allows containers to override how it's done.
* Add map/unmap virtual methods and set MAPPED flag on self and
children in there. This allows subclasses to hook map/unmap.
These are not signals, because notify::mapped is better for
anything it's legitimate for a non-subclass to do.
Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
2009-04-02 09:16:43 -04:00
|
|
|
|
ClutterActor *stage;
|
|
|
|
|
|
2011-11-08 12:04:44 -05:00
|
|
|
|
stage = clutter_stage_new ();
|
2008-06-16 09:40:39 -04:00
|
|
|
|
|
2012-02-15 08:43:15 -05:00
|
|
|
|
actor = clutter_actor_new ();
|
2008-06-16 09:40:39 -04:00
|
|
|
|
|
|
|
|
|
g_assert (!(CLUTTER_ACTOR_IS_REALIZED (actor)));
|
|
|
|
|
|
Enforce invariants on mapped, realized, visibility states
Bug 1138 - No trackable "mapped" state
* Add a VISIBLE flag tracking application programmer's
expected showing-state for the actor, allowing us to
always ensure we keep what the app wants while tracking
internal implementation state separately.
* Make MAPPED reflect whether the actor will be painted;
add notification on a ClutterActor::mapped property.
Keep MAPPED state updated as the actor is shown,
ancestors are shown, actor is reparented, etc.
* Require a stage and realized parents to realize; this means
at realization time the correct window system and GL resources
are known. But unparented actors can no longer be realized.
* Allow children to be unrealized even if parent is realized.
Otherwise in effect either all actors or no actors are realized,
i.e. it becomes a stage-global flag.
* Allow clutter_actor_realize() to "fail" if not inside a toplevel
* Rework clutter_actor_unrealize() so internally we have
a flavor that does not mess with visibility flag
* Add _clutter_actor_rerealize() to encapsulate a somewhat
tricky operation we were doing in a couple of places
* Do not realize/unrealize children in ClutterGroup,
ClutterActor already does it
* Do not realize impl by hand in clutter_stage_show(),
since showing impl already does that
* Do not unrealize in various dispose() methods, since
ClutterActor dispose implementation already does it
and chaining up is mandatory
* ClutterTexture uses COGL while unrealizable (before it's
added to a stage). Previously this breakage was affecting
ClutterActor because we had to allow realize outside
a stage. Move the breakage to ClutterTexture, by making
ClutterTexture just use COGL while not realized.
* Unrealize before we set parent to NULL in clutter_actor_unparent().
This means unrealize() implementations can get to the stage.
Because actors need the stage in order to detach from stage.
* Update clutter-actor-invariants.txt to reflect latest changes
* Remove explicit hide/unrealize from ClutterActor::dispose since
unparent already forces those
Instead just assert that unparent() occurred and did the right thing.
* Check whether parent implements unrealize before chaining up
Needed because ClutterGroup no longer has to implement unrealize.
* Perform unrealize in the default handler for the signal.
This allows non-containers that have children to work properly,
and allows containers to override how it's done.
* Add map/unmap virtual methods and set MAPPED flag on self and
children in there. This allows subclasses to hook map/unmap.
These are not signals, because notify::mapped is better for
anything it's legitimate for a non-subclass to do.
Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
2009-04-02 09:16:43 -04:00
|
|
|
|
clutter_actor_hide (actor); /* don't show, so won't map */
|
2012-02-15 08:43:15 -05:00
|
|
|
|
clutter_actor_add_child (stage, actor);
|
2008-06-16 09:40:39 -04:00
|
|
|
|
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)));
|
|
|
|
|
|
2011-11-08 12:04:44 -05:00
|
|
|
|
clutter_actor_destroy (stage);
|
2008-06-16 09:40:39 -04:00
|
|
|
|
}
|
|
|
|
|
|
2008-11-08 10:56:22 -05:00
|
|
|
|
void
|
2012-02-15 08:43:15 -05:00
|
|
|
|
actor_mapped (TestConformSimpleFixture *fixture,
|
|
|
|
|
gconstpointer data)
|
2008-06-16 09:40:39 -04:00
|
|
|
|
{
|
|
|
|
|
ClutterActor *actor;
|
Enforce invariants on mapped, realized, visibility states
Bug 1138 - No trackable "mapped" state
* Add a VISIBLE flag tracking application programmer's
expected showing-state for the actor, allowing us to
always ensure we keep what the app wants while tracking
internal implementation state separately.
* Make MAPPED reflect whether the actor will be painted;
add notification on a ClutterActor::mapped property.
Keep MAPPED state updated as the actor is shown,
ancestors are shown, actor is reparented, etc.
* Require a stage and realized parents to realize; this means
at realization time the correct window system and GL resources
are known. But unparented actors can no longer be realized.
* Allow children to be unrealized even if parent is realized.
Otherwise in effect either all actors or no actors are realized,
i.e. it becomes a stage-global flag.
* Allow clutter_actor_realize() to "fail" if not inside a toplevel
* Rework clutter_actor_unrealize() so internally we have
a flavor that does not mess with visibility flag
* Add _clutter_actor_rerealize() to encapsulate a somewhat
tricky operation we were doing in a couple of places
* Do not realize/unrealize children in ClutterGroup,
ClutterActor already does it
* Do not realize impl by hand in clutter_stage_show(),
since showing impl already does that
* Do not unrealize in various dispose() methods, since
ClutterActor dispose implementation already does it
and chaining up is mandatory
* ClutterTexture uses COGL while unrealizable (before it's
added to a stage). Previously this breakage was affecting
ClutterActor because we had to allow realize outside
a stage. Move the breakage to ClutterTexture, by making
ClutterTexture just use COGL while not realized.
* Unrealize before we set parent to NULL in clutter_actor_unparent().
This means unrealize() implementations can get to the stage.
Because actors need the stage in order to detach from stage.
* Update clutter-actor-invariants.txt to reflect latest changes
* Remove explicit hide/unrealize from ClutterActor::dispose since
unparent already forces those
Instead just assert that unparent() occurred and did the right thing.
* Check whether parent implements unrealize before chaining up
Needed because ClutterGroup no longer has to implement unrealize.
* Perform unrealize in the default handler for the signal.
This allows non-containers that have children to work properly,
and allows containers to override how it's done.
* Add map/unmap virtual methods and set MAPPED flag on self and
children in there. This allows subclasses to hook map/unmap.
These are not signals, because notify::mapped is better for
anything it's legitimate for a non-subclass to do.
Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
2009-04-02 09:16:43 -04:00
|
|
|
|
ClutterActor *stage;
|
|
|
|
|
|
2011-11-08 12:04:44 -05:00
|
|
|
|
stage = clutter_stage_new ();
|
2010-02-24 07:09:13 -05:00
|
|
|
|
clutter_actor_show (stage);
|
2008-06-16 09:40:39 -04:00
|
|
|
|
|
2012-02-15 08:43:15 -05:00
|
|
|
|
actor = clutter_actor_new ();
|
2008-06-16 09:40:39 -04:00
|
|
|
|
|
|
|
|
|
g_assert (!(CLUTTER_ACTOR_IS_REALIZED (actor)));
|
|
|
|
|
g_assert (!(CLUTTER_ACTOR_IS_MAPPED (actor)));
|
|
|
|
|
|
2012-02-15 08:43:15 -05:00
|
|
|
|
clutter_actor_add_child (stage, actor);
|
|
|
|
|
|
|
|
|
|
if (g_test_verbose ())
|
|
|
|
|
g_print ("adding to a container should map - "
|
|
|
|
|
"visible: %s, realized: %s, mapped: %s\n",
|
|
|
|
|
CLUTTER_ACTOR_IS_VISIBLE (actor) ? "yes" : "no",
|
|
|
|
|
CLUTTER_ACTOR_IS_REALIZED (actor) ? "yes" : "no",
|
|
|
|
|
CLUTTER_ACTOR_IS_MAPPED (actor) ? "yes" : "no");
|
2008-06-16 09:40:39 -04:00
|
|
|
|
|
|
|
|
|
g_assert (CLUTTER_ACTOR_IS_REALIZED (actor));
|
|
|
|
|
g_assert (CLUTTER_ACTOR_IS_MAPPED (actor));
|
|
|
|
|
g_assert (CLUTTER_ACTOR_IS_VISIBLE (actor));
|
|
|
|
|
|
2012-02-15 08:43:15 -05:00
|
|
|
|
clutter_actor_hide (actor);
|
|
|
|
|
|
|
|
|
|
if (g_test_verbose ())
|
|
|
|
|
g_print ("hiding should unmap - "
|
|
|
|
|
"visible: %s, realized: %s, mapped: %s\n",
|
|
|
|
|
CLUTTER_ACTOR_IS_VISIBLE (actor) ? "yes" : "no",
|
|
|
|
|
CLUTTER_ACTOR_IS_REALIZED (actor) ? "yes" : "no",
|
|
|
|
|
CLUTTER_ACTOR_IS_MAPPED (actor) ? "yes" : "no");
|
|
|
|
|
|
|
|
|
|
g_assert (CLUTTER_ACTOR_IS_REALIZED (actor));
|
|
|
|
|
g_assert (!CLUTTER_ACTOR_IS_MAPPED (actor));
|
|
|
|
|
g_assert (!CLUTTER_ACTOR_IS_VISIBLE (actor));
|
|
|
|
|
|
2011-11-08 12:04:44 -05:00
|
|
|
|
clutter_actor_destroy (stage);
|
2008-06-16 09:40:39 -04:00
|
|
|
|
}
|
|
|
|
|
|
2012-03-05 12:45:23 -05:00
|
|
|
|
void
|
|
|
|
|
actor_visibility_not_recursive (TestConformSimpleFixture *fixture,
|
|
|
|
|
gconstpointer data)
|
|
|
|
|
{
|
|
|
|
|
ClutterActor *actor, *group;
|
|
|
|
|
ClutterActor *stage;
|
|
|
|
|
|
|
|
|
|
stage = clutter_stage_new ();
|
|
|
|
|
group = clutter_actor_new ();
|
|
|
|
|
actor = clutter_actor_new ();
|
|
|
|
|
|
|
|
|
|
clutter_actor_hide (group); /* don't show, so won't map */
|
|
|
|
|
clutter_actor_hide (actor); /* don't show, so won't map */
|
|
|
|
|
|
|
|
|
|
g_assert (!(CLUTTER_ACTOR_IS_VISIBLE (stage)));
|
|
|
|
|
g_assert (!(CLUTTER_ACTOR_IS_VISIBLE (group)));
|
|
|
|
|
g_assert (!(CLUTTER_ACTOR_IS_VISIBLE (actor)));
|
|
|
|
|
|
|
|
|
|
clutter_actor_add_child (stage, group);
|
|
|
|
|
clutter_actor_add_child (group, actor);
|
|
|
|
|
|
|
|
|
|
clutter_actor_show (actor);
|
|
|
|
|
g_assert (CLUTTER_ACTOR_IS_VISIBLE (actor));
|
|
|
|
|
g_assert (!CLUTTER_ACTOR_IS_VISIBLE (group));
|
|
|
|
|
g_assert (!CLUTTER_ACTOR_IS_VISIBLE (stage));
|
|
|
|
|
|
|
|
|
|
clutter_actor_show (stage);
|
|
|
|
|
g_assert (CLUTTER_ACTOR_IS_VISIBLE (actor));
|
|
|
|
|
g_assert (!CLUTTER_ACTOR_IS_VISIBLE (group));
|
|
|
|
|
g_assert (CLUTTER_ACTOR_IS_VISIBLE (stage));
|
|
|
|
|
|
|
|
|
|
clutter_actor_hide (actor);
|
|
|
|
|
clutter_actor_hide (group);
|
|
|
|
|
clutter_actor_hide (stage);
|
|
|
|
|
g_assert (!CLUTTER_ACTOR_IS_VISIBLE (actor));
|
|
|
|
|
|
|
|
|
|
clutter_actor_show (stage);
|
|
|
|
|
g_assert (!CLUTTER_ACTOR_IS_VISIBLE (actor));
|
|
|
|
|
|
|
|
|
|
clutter_actor_destroy (stage);
|
|
|
|
|
}
|
|
|
|
|
|
Enforce invariants on mapped, realized, visibility states
Bug 1138 - No trackable "mapped" state
* Add a VISIBLE flag tracking application programmer's
expected showing-state for the actor, allowing us to
always ensure we keep what the app wants while tracking
internal implementation state separately.
* Make MAPPED reflect whether the actor will be painted;
add notification on a ClutterActor::mapped property.
Keep MAPPED state updated as the actor is shown,
ancestors are shown, actor is reparented, etc.
* Require a stage and realized parents to realize; this means
at realization time the correct window system and GL resources
are known. But unparented actors can no longer be realized.
* Allow children to be unrealized even if parent is realized.
Otherwise in effect either all actors or no actors are realized,
i.e. it becomes a stage-global flag.
* Allow clutter_actor_realize() to "fail" if not inside a toplevel
* Rework clutter_actor_unrealize() so internally we have
a flavor that does not mess with visibility flag
* Add _clutter_actor_rerealize() to encapsulate a somewhat
tricky operation we were doing in a couple of places
* Do not realize/unrealize children in ClutterGroup,
ClutterActor already does it
* Do not realize impl by hand in clutter_stage_show(),
since showing impl already does that
* Do not unrealize in various dispose() methods, since
ClutterActor dispose implementation already does it
and chaining up is mandatory
* ClutterTexture uses COGL while unrealizable (before it's
added to a stage). Previously this breakage was affecting
ClutterActor because we had to allow realize outside
a stage. Move the breakage to ClutterTexture, by making
ClutterTexture just use COGL while not realized.
* Unrealize before we set parent to NULL in clutter_actor_unparent().
This means unrealize() implementations can get to the stage.
Because actors need the stage in order to detach from stage.
* Update clutter-actor-invariants.txt to reflect latest changes
* Remove explicit hide/unrealize from ClutterActor::dispose since
unparent already forces those
Instead just assert that unparent() occurred and did the right thing.
* Check whether parent implements unrealize before chaining up
Needed because ClutterGroup no longer has to implement unrealize.
* Perform unrealize in the default handler for the signal.
This allows non-containers that have children to work properly,
and allows containers to override how it's done.
* Add map/unmap virtual methods and set MAPPED flag on self and
children in there. This allows subclasses to hook map/unmap.
These are not signals, because notify::mapped is better for
anything it's legitimate for a non-subclass to do.
Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
2009-04-02 09:16:43 -04:00
|
|
|
|
void
|
2012-02-15 08:43:15 -05:00
|
|
|
|
actor_realize_not_recursive (TestConformSimpleFixture *fixture,
|
|
|
|
|
gconstpointer data)
|
Enforce invariants on mapped, realized, visibility states
Bug 1138 - No trackable "mapped" state
* Add a VISIBLE flag tracking application programmer's
expected showing-state for the actor, allowing us to
always ensure we keep what the app wants while tracking
internal implementation state separately.
* Make MAPPED reflect whether the actor will be painted;
add notification on a ClutterActor::mapped property.
Keep MAPPED state updated as the actor is shown,
ancestors are shown, actor is reparented, etc.
* Require a stage and realized parents to realize; this means
at realization time the correct window system and GL resources
are known. But unparented actors can no longer be realized.
* Allow children to be unrealized even if parent is realized.
Otherwise in effect either all actors or no actors are realized,
i.e. it becomes a stage-global flag.
* Allow clutter_actor_realize() to "fail" if not inside a toplevel
* Rework clutter_actor_unrealize() so internally we have
a flavor that does not mess with visibility flag
* Add _clutter_actor_rerealize() to encapsulate a somewhat
tricky operation we were doing in a couple of places
* Do not realize/unrealize children in ClutterGroup,
ClutterActor already does it
* Do not realize impl by hand in clutter_stage_show(),
since showing impl already does that
* Do not unrealize in various dispose() methods, since
ClutterActor dispose implementation already does it
and chaining up is mandatory
* ClutterTexture uses COGL while unrealizable (before it's
added to a stage). Previously this breakage was affecting
ClutterActor because we had to allow realize outside
a stage. Move the breakage to ClutterTexture, by making
ClutterTexture just use COGL while not realized.
* Unrealize before we set parent to NULL in clutter_actor_unparent().
This means unrealize() implementations can get to the stage.
Because actors need the stage in order to detach from stage.
* Update clutter-actor-invariants.txt to reflect latest changes
* Remove explicit hide/unrealize from ClutterActor::dispose since
unparent already forces those
Instead just assert that unparent() occurred and did the right thing.
* Check whether parent implements unrealize before chaining up
Needed because ClutterGroup no longer has to implement unrealize.
* Perform unrealize in the default handler for the signal.
This allows non-containers that have children to work properly,
and allows containers to override how it's done.
* Add map/unmap virtual methods and set MAPPED flag on self and
children in there. This allows subclasses to hook map/unmap.
These are not signals, because notify::mapped is better for
anything it's legitimate for a non-subclass to do.
Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
2009-04-02 09:16:43 -04:00
|
|
|
|
{
|
|
|
|
|
ClutterActor *actor, *group;
|
|
|
|
|
ClutterActor *stage;
|
|
|
|
|
|
2011-11-08 12:04:44 -05:00
|
|
|
|
stage = clutter_stage_new ();
|
2010-02-24 07:09:13 -05:00
|
|
|
|
clutter_actor_show (stage);
|
Enforce invariants on mapped, realized, visibility states
Bug 1138 - No trackable "mapped" state
* Add a VISIBLE flag tracking application programmer's
expected showing-state for the actor, allowing us to
always ensure we keep what the app wants while tracking
internal implementation state separately.
* Make MAPPED reflect whether the actor will be painted;
add notification on a ClutterActor::mapped property.
Keep MAPPED state updated as the actor is shown,
ancestors are shown, actor is reparented, etc.
* Require a stage and realized parents to realize; this means
at realization time the correct window system and GL resources
are known. But unparented actors can no longer be realized.
* Allow children to be unrealized even if parent is realized.
Otherwise in effect either all actors or no actors are realized,
i.e. it becomes a stage-global flag.
* Allow clutter_actor_realize() to "fail" if not inside a toplevel
* Rework clutter_actor_unrealize() so internally we have
a flavor that does not mess with visibility flag
* Add _clutter_actor_rerealize() to encapsulate a somewhat
tricky operation we were doing in a couple of places
* Do not realize/unrealize children in ClutterGroup,
ClutterActor already does it
* Do not realize impl by hand in clutter_stage_show(),
since showing impl already does that
* Do not unrealize in various dispose() methods, since
ClutterActor dispose implementation already does it
and chaining up is mandatory
* ClutterTexture uses COGL while unrealizable (before it's
added to a stage). Previously this breakage was affecting
ClutterActor because we had to allow realize outside
a stage. Move the breakage to ClutterTexture, by making
ClutterTexture just use COGL while not realized.
* Unrealize before we set parent to NULL in clutter_actor_unparent().
This means unrealize() implementations can get to the stage.
Because actors need the stage in order to detach from stage.
* Update clutter-actor-invariants.txt to reflect latest changes
* Remove explicit hide/unrealize from ClutterActor::dispose since
unparent already forces those
Instead just assert that unparent() occurred and did the right thing.
* Check whether parent implements unrealize before chaining up
Needed because ClutterGroup no longer has to implement unrealize.
* Perform unrealize in the default handler for the signal.
This allows non-containers that have children to work properly,
and allows containers to override how it's done.
* Add map/unmap virtual methods and set MAPPED flag on self and
children in there. This allows subclasses to hook map/unmap.
These are not signals, because notify::mapped is better for
anything it's legitimate for a non-subclass to do.
Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
2009-04-02 09:16:43 -04:00
|
|
|
|
|
2012-02-15 08:43:15 -05:00
|
|
|
|
group = clutter_actor_new ();
|
Enforce invariants on mapped, realized, visibility states
Bug 1138 - No trackable "mapped" state
* Add a VISIBLE flag tracking application programmer's
expected showing-state for the actor, allowing us to
always ensure we keep what the app wants while tracking
internal implementation state separately.
* Make MAPPED reflect whether the actor will be painted;
add notification on a ClutterActor::mapped property.
Keep MAPPED state updated as the actor is shown,
ancestors are shown, actor is reparented, etc.
* Require a stage and realized parents to realize; this means
at realization time the correct window system and GL resources
are known. But unparented actors can no longer be realized.
* Allow children to be unrealized even if parent is realized.
Otherwise in effect either all actors or no actors are realized,
i.e. it becomes a stage-global flag.
* Allow clutter_actor_realize() to "fail" if not inside a toplevel
* Rework clutter_actor_unrealize() so internally we have
a flavor that does not mess with visibility flag
* Add _clutter_actor_rerealize() to encapsulate a somewhat
tricky operation we were doing in a couple of places
* Do not realize/unrealize children in ClutterGroup,
ClutterActor already does it
* Do not realize impl by hand in clutter_stage_show(),
since showing impl already does that
* Do not unrealize in various dispose() methods, since
ClutterActor dispose implementation already does it
and chaining up is mandatory
* ClutterTexture uses COGL while unrealizable (before it's
added to a stage). Previously this breakage was affecting
ClutterActor because we had to allow realize outside
a stage. Move the breakage to ClutterTexture, by making
ClutterTexture just use COGL while not realized.
* Unrealize before we set parent to NULL in clutter_actor_unparent().
This means unrealize() implementations can get to the stage.
Because actors need the stage in order to detach from stage.
* Update clutter-actor-invariants.txt to reflect latest changes
* Remove explicit hide/unrealize from ClutterActor::dispose since
unparent already forces those
Instead just assert that unparent() occurred and did the right thing.
* Check whether parent implements unrealize before chaining up
Needed because ClutterGroup no longer has to implement unrealize.
* Perform unrealize in the default handler for the signal.
This allows non-containers that have children to work properly,
and allows containers to override how it's done.
* Add map/unmap virtual methods and set MAPPED flag on self and
children in there. This allows subclasses to hook map/unmap.
These are not signals, because notify::mapped is better for
anything it's legitimate for a non-subclass to do.
Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
2009-04-02 09:16:43 -04:00
|
|
|
|
|
2012-02-15 08:43:15 -05:00
|
|
|
|
actor = clutter_actor_new ();
|
Enforce invariants on mapped, realized, visibility states
Bug 1138 - No trackable "mapped" state
* Add a VISIBLE flag tracking application programmer's
expected showing-state for the actor, allowing us to
always ensure we keep what the app wants while tracking
internal implementation state separately.
* Make MAPPED reflect whether the actor will be painted;
add notification on a ClutterActor::mapped property.
Keep MAPPED state updated as the actor is shown,
ancestors are shown, actor is reparented, etc.
* Require a stage and realized parents to realize; this means
at realization time the correct window system and GL resources
are known. But unparented actors can no longer be realized.
* Allow children to be unrealized even if parent is realized.
Otherwise in effect either all actors or no actors are realized,
i.e. it becomes a stage-global flag.
* Allow clutter_actor_realize() to "fail" if not inside a toplevel
* Rework clutter_actor_unrealize() so internally we have
a flavor that does not mess with visibility flag
* Add _clutter_actor_rerealize() to encapsulate a somewhat
tricky operation we were doing in a couple of places
* Do not realize/unrealize children in ClutterGroup,
ClutterActor already does it
* Do not realize impl by hand in clutter_stage_show(),
since showing impl already does that
* Do not unrealize in various dispose() methods, since
ClutterActor dispose implementation already does it
and chaining up is mandatory
* ClutterTexture uses COGL while unrealizable (before it's
added to a stage). Previously this breakage was affecting
ClutterActor because we had to allow realize outside
a stage. Move the breakage to ClutterTexture, by making
ClutterTexture just use COGL while not realized.
* Unrealize before we set parent to NULL in clutter_actor_unparent().
This means unrealize() implementations can get to the stage.
Because actors need the stage in order to detach from stage.
* Update clutter-actor-invariants.txt to reflect latest changes
* Remove explicit hide/unrealize from ClutterActor::dispose since
unparent already forces those
Instead just assert that unparent() occurred and did the right thing.
* Check whether parent implements unrealize before chaining up
Needed because ClutterGroup no longer has to implement unrealize.
* Perform unrealize in the default handler for the signal.
This allows non-containers that have children to work properly,
and allows containers to override how it's done.
* Add map/unmap virtual methods and set MAPPED flag on self and
children in there. This allows subclasses to hook map/unmap.
These are not signals, because notify::mapped is better for
anything it's legitimate for a non-subclass to do.
Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
2009-04-02 09:16:43 -04:00
|
|
|
|
|
|
|
|
|
clutter_actor_hide (group); /* don't show, so won't map */
|
|
|
|
|
clutter_actor_hide (actor); /* don't show, so won't map */
|
|
|
|
|
|
|
|
|
|
g_assert (!(CLUTTER_ACTOR_IS_REALIZED (group)));
|
|
|
|
|
g_assert (!(CLUTTER_ACTOR_IS_REALIZED (actor)));
|
|
|
|
|
|
2012-02-15 08:43:15 -05:00
|
|
|
|
clutter_actor_add_child (stage, group);
|
|
|
|
|
clutter_actor_add_child (group, actor);
|
Enforce invariants on mapped, realized, visibility states
Bug 1138 - No trackable "mapped" state
* Add a VISIBLE flag tracking application programmer's
expected showing-state for the actor, allowing us to
always ensure we keep what the app wants while tracking
internal implementation state separately.
* Make MAPPED reflect whether the actor will be painted;
add notification on a ClutterActor::mapped property.
Keep MAPPED state updated as the actor is shown,
ancestors are shown, actor is reparented, etc.
* Require a stage and realized parents to realize; this means
at realization time the correct window system and GL resources
are known. But unparented actors can no longer be realized.
* Allow children to be unrealized even if parent is realized.
Otherwise in effect either all actors or no actors are realized,
i.e. it becomes a stage-global flag.
* Allow clutter_actor_realize() to "fail" if not inside a toplevel
* Rework clutter_actor_unrealize() so internally we have
a flavor that does not mess with visibility flag
* Add _clutter_actor_rerealize() to encapsulate a somewhat
tricky operation we were doing in a couple of places
* Do not realize/unrealize children in ClutterGroup,
ClutterActor already does it
* Do not realize impl by hand in clutter_stage_show(),
since showing impl already does that
* Do not unrealize in various dispose() methods, since
ClutterActor dispose implementation already does it
and chaining up is mandatory
* ClutterTexture uses COGL while unrealizable (before it's
added to a stage). Previously this breakage was affecting
ClutterActor because we had to allow realize outside
a stage. Move the breakage to ClutterTexture, by making
ClutterTexture just use COGL while not realized.
* Unrealize before we set parent to NULL in clutter_actor_unparent().
This means unrealize() implementations can get to the stage.
Because actors need the stage in order to detach from stage.
* Update clutter-actor-invariants.txt to reflect latest changes
* Remove explicit hide/unrealize from ClutterActor::dispose since
unparent already forces those
Instead just assert that unparent() occurred and did the right thing.
* Check whether parent implements unrealize before chaining up
Needed because ClutterGroup no longer has to implement unrealize.
* Perform unrealize in the default handler for the signal.
This allows non-containers that have children to work properly,
and allows containers to override how it's done.
* Add map/unmap virtual methods and set MAPPED flag on self and
children in there. This allows subclasses to hook map/unmap.
These are not signals, because notify::mapped is better for
anything it's legitimate for a non-subclass to do.
Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
2009-04-02 09:16:43 -04:00
|
|
|
|
|
|
|
|
|
clutter_actor_realize (group);
|
|
|
|
|
|
|
|
|
|
g_assert (CLUTTER_ACTOR_IS_REALIZED (group));
|
|
|
|
|
|
|
|
|
|
g_assert (!(CLUTTER_ACTOR_IS_MAPPED (group)));
|
|
|
|
|
g_assert (!(CLUTTER_ACTOR_IS_VISIBLE (group)));
|
|
|
|
|
|
|
|
|
|
/* realizing group did not realize the child */
|
|
|
|
|
g_assert (!CLUTTER_ACTOR_IS_REALIZED (actor));
|
|
|
|
|
g_assert (!(CLUTTER_ACTOR_IS_MAPPED (actor)));
|
|
|
|
|
g_assert (!(CLUTTER_ACTOR_IS_VISIBLE (actor)));
|
|
|
|
|
|
2011-11-08 12:04:44 -05:00
|
|
|
|
clutter_actor_destroy (stage);
|
Enforce invariants on mapped, realized, visibility states
Bug 1138 - No trackable "mapped" state
* Add a VISIBLE flag tracking application programmer's
expected showing-state for the actor, allowing us to
always ensure we keep what the app wants while tracking
internal implementation state separately.
* Make MAPPED reflect whether the actor will be painted;
add notification on a ClutterActor::mapped property.
Keep MAPPED state updated as the actor is shown,
ancestors are shown, actor is reparented, etc.
* Require a stage and realized parents to realize; this means
at realization time the correct window system and GL resources
are known. But unparented actors can no longer be realized.
* Allow children to be unrealized even if parent is realized.
Otherwise in effect either all actors or no actors are realized,
i.e. it becomes a stage-global flag.
* Allow clutter_actor_realize() to "fail" if not inside a toplevel
* Rework clutter_actor_unrealize() so internally we have
a flavor that does not mess with visibility flag
* Add _clutter_actor_rerealize() to encapsulate a somewhat
tricky operation we were doing in a couple of places
* Do not realize/unrealize children in ClutterGroup,
ClutterActor already does it
* Do not realize impl by hand in clutter_stage_show(),
since showing impl already does that
* Do not unrealize in various dispose() methods, since
ClutterActor dispose implementation already does it
and chaining up is mandatory
* ClutterTexture uses COGL while unrealizable (before it's
added to a stage). Previously this breakage was affecting
ClutterActor because we had to allow realize outside
a stage. Move the breakage to ClutterTexture, by making
ClutterTexture just use COGL while not realized.
* Unrealize before we set parent to NULL in clutter_actor_unparent().
This means unrealize() implementations can get to the stage.
Because actors need the stage in order to detach from stage.
* Update clutter-actor-invariants.txt to reflect latest changes
* Remove explicit hide/unrealize from ClutterActor::dispose since
unparent already forces those
Instead just assert that unparent() occurred and did the right thing.
* Check whether parent implements unrealize before chaining up
Needed because ClutterGroup no longer has to implement unrealize.
* Perform unrealize in the default handler for the signal.
This allows non-containers that have children to work properly,
and allows containers to override how it's done.
* Add map/unmap virtual methods and set MAPPED flag on self and
children in there. This allows subclasses to hook map/unmap.
These are not signals, because notify::mapped is better for
anything it's legitimate for a non-subclass to do.
Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
2009-04-02 09:16:43 -04:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void
|
2012-02-15 08:43:15 -05:00
|
|
|
|
actor_map_recursive (TestConformSimpleFixture *fixture,
|
|
|
|
|
gconstpointer data)
|
Enforce invariants on mapped, realized, visibility states
Bug 1138 - No trackable "mapped" state
* Add a VISIBLE flag tracking application programmer's
expected showing-state for the actor, allowing us to
always ensure we keep what the app wants while tracking
internal implementation state separately.
* Make MAPPED reflect whether the actor will be painted;
add notification on a ClutterActor::mapped property.
Keep MAPPED state updated as the actor is shown,
ancestors are shown, actor is reparented, etc.
* Require a stage and realized parents to realize; this means
at realization time the correct window system and GL resources
are known. But unparented actors can no longer be realized.
* Allow children to be unrealized even if parent is realized.
Otherwise in effect either all actors or no actors are realized,
i.e. it becomes a stage-global flag.
* Allow clutter_actor_realize() to "fail" if not inside a toplevel
* Rework clutter_actor_unrealize() so internally we have
a flavor that does not mess with visibility flag
* Add _clutter_actor_rerealize() to encapsulate a somewhat
tricky operation we were doing in a couple of places
* Do not realize/unrealize children in ClutterGroup,
ClutterActor already does it
* Do not realize impl by hand in clutter_stage_show(),
since showing impl already does that
* Do not unrealize in various dispose() methods, since
ClutterActor dispose implementation already does it
and chaining up is mandatory
* ClutterTexture uses COGL while unrealizable (before it's
added to a stage). Previously this breakage was affecting
ClutterActor because we had to allow realize outside
a stage. Move the breakage to ClutterTexture, by making
ClutterTexture just use COGL while not realized.
* Unrealize before we set parent to NULL in clutter_actor_unparent().
This means unrealize() implementations can get to the stage.
Because actors need the stage in order to detach from stage.
* Update clutter-actor-invariants.txt to reflect latest changes
* Remove explicit hide/unrealize from ClutterActor::dispose since
unparent already forces those
Instead just assert that unparent() occurred and did the right thing.
* Check whether parent implements unrealize before chaining up
Needed because ClutterGroup no longer has to implement unrealize.
* Perform unrealize in the default handler for the signal.
This allows non-containers that have children to work properly,
and allows containers to override how it's done.
* Add map/unmap virtual methods and set MAPPED flag on self and
children in there. This allows subclasses to hook map/unmap.
These are not signals, because notify::mapped is better for
anything it's legitimate for a non-subclass to do.
Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
2009-04-02 09:16:43 -04:00
|
|
|
|
{
|
|
|
|
|
ClutterActor *actor, *group;
|
|
|
|
|
ClutterActor *stage;
|
|
|
|
|
|
2011-11-08 12:04:44 -05:00
|
|
|
|
stage = clutter_stage_new ();
|
2010-02-24 07:09:13 -05:00
|
|
|
|
clutter_actor_show (stage);
|
Enforce invariants on mapped, realized, visibility states
Bug 1138 - No trackable "mapped" state
* Add a VISIBLE flag tracking application programmer's
expected showing-state for the actor, allowing us to
always ensure we keep what the app wants while tracking
internal implementation state separately.
* Make MAPPED reflect whether the actor will be painted;
add notification on a ClutterActor::mapped property.
Keep MAPPED state updated as the actor is shown,
ancestors are shown, actor is reparented, etc.
* Require a stage and realized parents to realize; this means
at realization time the correct window system and GL resources
are known. But unparented actors can no longer be realized.
* Allow children to be unrealized even if parent is realized.
Otherwise in effect either all actors or no actors are realized,
i.e. it becomes a stage-global flag.
* Allow clutter_actor_realize() to "fail" if not inside a toplevel
* Rework clutter_actor_unrealize() so internally we have
a flavor that does not mess with visibility flag
* Add _clutter_actor_rerealize() to encapsulate a somewhat
tricky operation we were doing in a couple of places
* Do not realize/unrealize children in ClutterGroup,
ClutterActor already does it
* Do not realize impl by hand in clutter_stage_show(),
since showing impl already does that
* Do not unrealize in various dispose() methods, since
ClutterActor dispose implementation already does it
and chaining up is mandatory
* ClutterTexture uses COGL while unrealizable (before it's
added to a stage). Previously this breakage was affecting
ClutterActor because we had to allow realize outside
a stage. Move the breakage to ClutterTexture, by making
ClutterTexture just use COGL while not realized.
* Unrealize before we set parent to NULL in clutter_actor_unparent().
This means unrealize() implementations can get to the stage.
Because actors need the stage in order to detach from stage.
* Update clutter-actor-invariants.txt to reflect latest changes
* Remove explicit hide/unrealize from ClutterActor::dispose since
unparent already forces those
Instead just assert that unparent() occurred and did the right thing.
* Check whether parent implements unrealize before chaining up
Needed because ClutterGroup no longer has to implement unrealize.
* Perform unrealize in the default handler for the signal.
This allows non-containers that have children to work properly,
and allows containers to override how it's done.
* Add map/unmap virtual methods and set MAPPED flag on self and
children in there. This allows subclasses to hook map/unmap.
These are not signals, because notify::mapped is better for
anything it's legitimate for a non-subclass to do.
Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
2009-04-02 09:16:43 -04:00
|
|
|
|
|
2012-02-15 08:43:15 -05:00
|
|
|
|
group = clutter_actor_new ();
|
Enforce invariants on mapped, realized, visibility states
Bug 1138 - No trackable "mapped" state
* Add a VISIBLE flag tracking application programmer's
expected showing-state for the actor, allowing us to
always ensure we keep what the app wants while tracking
internal implementation state separately.
* Make MAPPED reflect whether the actor will be painted;
add notification on a ClutterActor::mapped property.
Keep MAPPED state updated as the actor is shown,
ancestors are shown, actor is reparented, etc.
* Require a stage and realized parents to realize; this means
at realization time the correct window system and GL resources
are known. But unparented actors can no longer be realized.
* Allow children to be unrealized even if parent is realized.
Otherwise in effect either all actors or no actors are realized,
i.e. it becomes a stage-global flag.
* Allow clutter_actor_realize() to "fail" if not inside a toplevel
* Rework clutter_actor_unrealize() so internally we have
a flavor that does not mess with visibility flag
* Add _clutter_actor_rerealize() to encapsulate a somewhat
tricky operation we were doing in a couple of places
* Do not realize/unrealize children in ClutterGroup,
ClutterActor already does it
* Do not realize impl by hand in clutter_stage_show(),
since showing impl already does that
* Do not unrealize in various dispose() methods, since
ClutterActor dispose implementation already does it
and chaining up is mandatory
* ClutterTexture uses COGL while unrealizable (before it's
added to a stage). Previously this breakage was affecting
ClutterActor because we had to allow realize outside
a stage. Move the breakage to ClutterTexture, by making
ClutterTexture just use COGL while not realized.
* Unrealize before we set parent to NULL in clutter_actor_unparent().
This means unrealize() implementations can get to the stage.
Because actors need the stage in order to detach from stage.
* Update clutter-actor-invariants.txt to reflect latest changes
* Remove explicit hide/unrealize from ClutterActor::dispose since
unparent already forces those
Instead just assert that unparent() occurred and did the right thing.
* Check whether parent implements unrealize before chaining up
Needed because ClutterGroup no longer has to implement unrealize.
* Perform unrealize in the default handler for the signal.
This allows non-containers that have children to work properly,
and allows containers to override how it's done.
* Add map/unmap virtual methods and set MAPPED flag on self and
children in there. This allows subclasses to hook map/unmap.
These are not signals, because notify::mapped is better for
anything it's legitimate for a non-subclass to do.
Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
2009-04-02 09:16:43 -04:00
|
|
|
|
|
2012-02-15 08:43:15 -05:00
|
|
|
|
actor = clutter_actor_new ();
|
Enforce invariants on mapped, realized, visibility states
Bug 1138 - No trackable "mapped" state
* Add a VISIBLE flag tracking application programmer's
expected showing-state for the actor, allowing us to
always ensure we keep what the app wants while tracking
internal implementation state separately.
* Make MAPPED reflect whether the actor will be painted;
add notification on a ClutterActor::mapped property.
Keep MAPPED state updated as the actor is shown,
ancestors are shown, actor is reparented, etc.
* Require a stage and realized parents to realize; this means
at realization time the correct window system and GL resources
are known. But unparented actors can no longer be realized.
* Allow children to be unrealized even if parent is realized.
Otherwise in effect either all actors or no actors are realized,
i.e. it becomes a stage-global flag.
* Allow clutter_actor_realize() to "fail" if not inside a toplevel
* Rework clutter_actor_unrealize() so internally we have
a flavor that does not mess with visibility flag
* Add _clutter_actor_rerealize() to encapsulate a somewhat
tricky operation we were doing in a couple of places
* Do not realize/unrealize children in ClutterGroup,
ClutterActor already does it
* Do not realize impl by hand in clutter_stage_show(),
since showing impl already does that
* Do not unrealize in various dispose() methods, since
ClutterActor dispose implementation already does it
and chaining up is mandatory
* ClutterTexture uses COGL while unrealizable (before it's
added to a stage). Previously this breakage was affecting
ClutterActor because we had to allow realize outside
a stage. Move the breakage to ClutterTexture, by making
ClutterTexture just use COGL while not realized.
* Unrealize before we set parent to NULL in clutter_actor_unparent().
This means unrealize() implementations can get to the stage.
Because actors need the stage in order to detach from stage.
* Update clutter-actor-invariants.txt to reflect latest changes
* Remove explicit hide/unrealize from ClutterActor::dispose since
unparent already forces those
Instead just assert that unparent() occurred and did the right thing.
* Check whether parent implements unrealize before chaining up
Needed because ClutterGroup no longer has to implement unrealize.
* Perform unrealize in the default handler for the signal.
This allows non-containers that have children to work properly,
and allows containers to override how it's done.
* Add map/unmap virtual methods and set MAPPED flag on self and
children in there. This allows subclasses to hook map/unmap.
These are not signals, because notify::mapped is better for
anything it's legitimate for a non-subclass to do.
Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
2009-04-02 09:16:43 -04:00
|
|
|
|
|
|
|
|
|
clutter_actor_hide (group); /* hide at first */
|
|
|
|
|
clutter_actor_show (actor); /* show at first */
|
|
|
|
|
|
|
|
|
|
g_assert (!(CLUTTER_ACTOR_IS_REALIZED (group)));
|
|
|
|
|
g_assert (!(CLUTTER_ACTOR_IS_REALIZED (actor)));
|
|
|
|
|
g_assert (!(CLUTTER_ACTOR_IS_MAPPED (group)));
|
|
|
|
|
g_assert (!(CLUTTER_ACTOR_IS_MAPPED (actor)));
|
|
|
|
|
g_assert (!(CLUTTER_ACTOR_IS_VISIBLE (group)));
|
|
|
|
|
g_assert ((CLUTTER_ACTOR_IS_VISIBLE (actor)));
|
|
|
|
|
|
2012-02-15 08:43:15 -05:00
|
|
|
|
clutter_actor_add_child (stage, group);
|
|
|
|
|
clutter_actor_add_child (group, actor);
|
Enforce invariants on mapped, realized, visibility states
Bug 1138 - No trackable "mapped" state
* Add a VISIBLE flag tracking application programmer's
expected showing-state for the actor, allowing us to
always ensure we keep what the app wants while tracking
internal implementation state separately.
* Make MAPPED reflect whether the actor will be painted;
add notification on a ClutterActor::mapped property.
Keep MAPPED state updated as the actor is shown,
ancestors are shown, actor is reparented, etc.
* Require a stage and realized parents to realize; this means
at realization time the correct window system and GL resources
are known. But unparented actors can no longer be realized.
* Allow children to be unrealized even if parent is realized.
Otherwise in effect either all actors or no actors are realized,
i.e. it becomes a stage-global flag.
* Allow clutter_actor_realize() to "fail" if not inside a toplevel
* Rework clutter_actor_unrealize() so internally we have
a flavor that does not mess with visibility flag
* Add _clutter_actor_rerealize() to encapsulate a somewhat
tricky operation we were doing in a couple of places
* Do not realize/unrealize children in ClutterGroup,
ClutterActor already does it
* Do not realize impl by hand in clutter_stage_show(),
since showing impl already does that
* Do not unrealize in various dispose() methods, since
ClutterActor dispose implementation already does it
and chaining up is mandatory
* ClutterTexture uses COGL while unrealizable (before it's
added to a stage). Previously this breakage was affecting
ClutterActor because we had to allow realize outside
a stage. Move the breakage to ClutterTexture, by making
ClutterTexture just use COGL while not realized.
* Unrealize before we set parent to NULL in clutter_actor_unparent().
This means unrealize() implementations can get to the stage.
Because actors need the stage in order to detach from stage.
* Update clutter-actor-invariants.txt to reflect latest changes
* Remove explicit hide/unrealize from ClutterActor::dispose since
unparent already forces those
Instead just assert that unparent() occurred and did the right thing.
* Check whether parent implements unrealize before chaining up
Needed because ClutterGroup no longer has to implement unrealize.
* Perform unrealize in the default handler for the signal.
This allows non-containers that have children to work properly,
and allows containers to override how it's done.
* Add map/unmap virtual methods and set MAPPED flag on self and
children in there. This allows subclasses to hook map/unmap.
These are not signals, because notify::mapped is better for
anything it's legitimate for a non-subclass to do.
Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
2009-04-02 09:16:43 -04:00
|
|
|
|
|
|
|
|
|
g_assert (!(CLUTTER_ACTOR_IS_REALIZED (group)));
|
|
|
|
|
g_assert (!(CLUTTER_ACTOR_IS_REALIZED (actor)));
|
|
|
|
|
g_assert (!(CLUTTER_ACTOR_IS_MAPPED (group)));
|
|
|
|
|
g_assert (!(CLUTTER_ACTOR_IS_MAPPED (actor)));
|
|
|
|
|
g_assert (!(CLUTTER_ACTOR_IS_VISIBLE (group)));
|
|
|
|
|
g_assert ((CLUTTER_ACTOR_IS_VISIBLE (actor)));
|
|
|
|
|
|
|
|
|
|
/* show group, which should map and realize both
|
|
|
|
|
* group and child.
|
|
|
|
|
*/
|
|
|
|
|
clutter_actor_show (group);
|
|
|
|
|
g_assert (CLUTTER_ACTOR_IS_REALIZED (group));
|
|
|
|
|
g_assert (CLUTTER_ACTOR_IS_REALIZED (actor));
|
|
|
|
|
g_assert (CLUTTER_ACTOR_IS_MAPPED (group));
|
|
|
|
|
g_assert (CLUTTER_ACTOR_IS_MAPPED (actor));
|
|
|
|
|
g_assert (CLUTTER_ACTOR_IS_VISIBLE (group));
|
|
|
|
|
g_assert (CLUTTER_ACTOR_IS_VISIBLE (actor));
|
|
|
|
|
|
2011-11-08 12:04:44 -05:00
|
|
|
|
clutter_actor_destroy (stage);
|
Enforce invariants on mapped, realized, visibility states
Bug 1138 - No trackable "mapped" state
* Add a VISIBLE flag tracking application programmer's
expected showing-state for the actor, allowing us to
always ensure we keep what the app wants while tracking
internal implementation state separately.
* Make MAPPED reflect whether the actor will be painted;
add notification on a ClutterActor::mapped property.
Keep MAPPED state updated as the actor is shown,
ancestors are shown, actor is reparented, etc.
* Require a stage and realized parents to realize; this means
at realization time the correct window system and GL resources
are known. But unparented actors can no longer be realized.
* Allow children to be unrealized even if parent is realized.
Otherwise in effect either all actors or no actors are realized,
i.e. it becomes a stage-global flag.
* Allow clutter_actor_realize() to "fail" if not inside a toplevel
* Rework clutter_actor_unrealize() so internally we have
a flavor that does not mess with visibility flag
* Add _clutter_actor_rerealize() to encapsulate a somewhat
tricky operation we were doing in a couple of places
* Do not realize/unrealize children in ClutterGroup,
ClutterActor already does it
* Do not realize impl by hand in clutter_stage_show(),
since showing impl already does that
* Do not unrealize in various dispose() methods, since
ClutterActor dispose implementation already does it
and chaining up is mandatory
* ClutterTexture uses COGL while unrealizable (before it's
added to a stage). Previously this breakage was affecting
ClutterActor because we had to allow realize outside
a stage. Move the breakage to ClutterTexture, by making
ClutterTexture just use COGL while not realized.
* Unrealize before we set parent to NULL in clutter_actor_unparent().
This means unrealize() implementations can get to the stage.
Because actors need the stage in order to detach from stage.
* Update clutter-actor-invariants.txt to reflect latest changes
* Remove explicit hide/unrealize from ClutterActor::dispose since
unparent already forces those
Instead just assert that unparent() occurred and did the right thing.
* Check whether parent implements unrealize before chaining up
Needed because ClutterGroup no longer has to implement unrealize.
* Perform unrealize in the default handler for the signal.
This allows non-containers that have children to work properly,
and allows containers to override how it's done.
* Add map/unmap virtual methods and set MAPPED flag on self and
children in there. This allows subclasses to hook map/unmap.
These are not signals, because notify::mapped is better for
anything it's legitimate for a non-subclass to do.
Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
2009-04-02 09:16:43 -04:00
|
|
|
|
}
|
|
|
|
|
|
2008-11-08 10:56:22 -05:00
|
|
|
|
void
|
2012-02-15 08:43:15 -05:00
|
|
|
|
actor_show_on_set_parent (TestConformSimpleFixture *fixture,
|
|
|
|
|
gconstpointer data)
|
2008-06-16 09:40:39 -04:00
|
|
|
|
{
|
|
|
|
|
ClutterActor *actor, *group;
|
|
|
|
|
gboolean show_on_set_parent;
|
Enforce invariants on mapped, realized, visibility states
Bug 1138 - No trackable "mapped" state
* Add a VISIBLE flag tracking application programmer's
expected showing-state for the actor, allowing us to
always ensure we keep what the app wants while tracking
internal implementation state separately.
* Make MAPPED reflect whether the actor will be painted;
add notification on a ClutterActor::mapped property.
Keep MAPPED state updated as the actor is shown,
ancestors are shown, actor is reparented, etc.
* Require a stage and realized parents to realize; this means
at realization time the correct window system and GL resources
are known. But unparented actors can no longer be realized.
* Allow children to be unrealized even if parent is realized.
Otherwise in effect either all actors or no actors are realized,
i.e. it becomes a stage-global flag.
* Allow clutter_actor_realize() to "fail" if not inside a toplevel
* Rework clutter_actor_unrealize() so internally we have
a flavor that does not mess with visibility flag
* Add _clutter_actor_rerealize() to encapsulate a somewhat
tricky operation we were doing in a couple of places
* Do not realize/unrealize children in ClutterGroup,
ClutterActor already does it
* Do not realize impl by hand in clutter_stage_show(),
since showing impl already does that
* Do not unrealize in various dispose() methods, since
ClutterActor dispose implementation already does it
and chaining up is mandatory
* ClutterTexture uses COGL while unrealizable (before it's
added to a stage). Previously this breakage was affecting
ClutterActor because we had to allow realize outside
a stage. Move the breakage to ClutterTexture, by making
ClutterTexture just use COGL while not realized.
* Unrealize before we set parent to NULL in clutter_actor_unparent().
This means unrealize() implementations can get to the stage.
Because actors need the stage in order to detach from stage.
* Update clutter-actor-invariants.txt to reflect latest changes
* Remove explicit hide/unrealize from ClutterActor::dispose since
unparent already forces those
Instead just assert that unparent() occurred and did the right thing.
* Check whether parent implements unrealize before chaining up
Needed because ClutterGroup no longer has to implement unrealize.
* Perform unrealize in the default handler for the signal.
This allows non-containers that have children to work properly,
and allows containers to override how it's done.
* Add map/unmap virtual methods and set MAPPED flag on self and
children in there. This allows subclasses to hook map/unmap.
These are not signals, because notify::mapped is better for
anything it's legitimate for a non-subclass to do.
Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
2009-04-02 09:16:43 -04:00
|
|
|
|
ClutterActor *stage;
|
|
|
|
|
|
2011-11-08 12:04:44 -05:00
|
|
|
|
stage = clutter_stage_new ();
|
2008-06-16 09:40:39 -04:00
|
|
|
|
|
2012-02-15 08:43:15 -05:00
|
|
|
|
group = clutter_actor_new ();
|
2008-06-16 09:40:39 -04:00
|
|
|
|
|
|
|
|
|
g_assert (!(CLUTTER_ACTOR_IS_VISIBLE (group)));
|
|
|
|
|
|
2012-02-15 08:43:15 -05:00
|
|
|
|
clutter_actor_add_child (stage, group);
|
Enforce invariants on mapped, realized, visibility states
Bug 1138 - No trackable "mapped" state
* Add a VISIBLE flag tracking application programmer's
expected showing-state for the actor, allowing us to
always ensure we keep what the app wants while tracking
internal implementation state separately.
* Make MAPPED reflect whether the actor will be painted;
add notification on a ClutterActor::mapped property.
Keep MAPPED state updated as the actor is shown,
ancestors are shown, actor is reparented, etc.
* Require a stage and realized parents to realize; this means
at realization time the correct window system and GL resources
are known. But unparented actors can no longer be realized.
* Allow children to be unrealized even if parent is realized.
Otherwise in effect either all actors or no actors are realized,
i.e. it becomes a stage-global flag.
* Allow clutter_actor_realize() to "fail" if not inside a toplevel
* Rework clutter_actor_unrealize() so internally we have
a flavor that does not mess with visibility flag
* Add _clutter_actor_rerealize() to encapsulate a somewhat
tricky operation we were doing in a couple of places
* Do not realize/unrealize children in ClutterGroup,
ClutterActor already does it
* Do not realize impl by hand in clutter_stage_show(),
since showing impl already does that
* Do not unrealize in various dispose() methods, since
ClutterActor dispose implementation already does it
and chaining up is mandatory
* ClutterTexture uses COGL while unrealizable (before it's
added to a stage). Previously this breakage was affecting
ClutterActor because we had to allow realize outside
a stage. Move the breakage to ClutterTexture, by making
ClutterTexture just use COGL while not realized.
* Unrealize before we set parent to NULL in clutter_actor_unparent().
This means unrealize() implementations can get to the stage.
Because actors need the stage in order to detach from stage.
* Update clutter-actor-invariants.txt to reflect latest changes
* Remove explicit hide/unrealize from ClutterActor::dispose since
unparent already forces those
Instead just assert that unparent() occurred and did the right thing.
* Check whether parent implements unrealize before chaining up
Needed because ClutterGroup no longer has to implement unrealize.
* Perform unrealize in the default handler for the signal.
This allows non-containers that have children to work properly,
and allows containers to override how it's done.
* Add map/unmap virtual methods and set MAPPED flag on self and
children in there. This allows subclasses to hook map/unmap.
These are not signals, because notify::mapped is better for
anything it's legitimate for a non-subclass to do.
Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
2009-04-02 09:16:43 -04:00
|
|
|
|
|
2012-02-15 08:43:15 -05:00
|
|
|
|
actor = clutter_actor_new ();
|
2011-06-16 12:07:32 -04:00
|
|
|
|
g_object_get (actor,
|
2008-06-16 09:40:39 -04:00
|
|
|
|
"show-on-set-parent", &show_on_set_parent,
|
|
|
|
|
NULL);
|
|
|
|
|
|
|
|
|
|
g_assert (!(CLUTTER_ACTOR_IS_VISIBLE (actor)));
|
2012-03-05 12:26:09 -05:00
|
|
|
|
g_assert (show_on_set_parent);
|
2008-06-16 09:40:39 -04:00
|
|
|
|
|
2012-02-15 08:43:15 -05:00
|
|
|
|
clutter_actor_add_child (group, actor);
|
2011-06-16 12:07:32 -04:00
|
|
|
|
g_object_get (actor,
|
2008-06-16 09:40:39 -04:00
|
|
|
|
"show-on-set-parent", &show_on_set_parent,
|
|
|
|
|
NULL);
|
|
|
|
|
|
|
|
|
|
g_assert (CLUTTER_ACTOR_IS_VISIBLE (actor));
|
2012-03-05 12:26:09 -05:00
|
|
|
|
g_assert (show_on_set_parent);
|
2008-06-16 09:40:39 -04:00
|
|
|
|
|
|
|
|
|
g_object_ref (actor);
|
2012-02-15 08:43:15 -05:00
|
|
|
|
clutter_actor_remove_child (group, actor);
|
2011-06-16 12:07:32 -04:00
|
|
|
|
g_object_get (actor,
|
2008-06-16 09:40:39 -04:00
|
|
|
|
"show-on-set-parent", &show_on_set_parent,
|
|
|
|
|
NULL);
|
|
|
|
|
|
Enforce invariants on mapped, realized, visibility states
Bug 1138 - No trackable "mapped" state
* Add a VISIBLE flag tracking application programmer's
expected showing-state for the actor, allowing us to
always ensure we keep what the app wants while tracking
internal implementation state separately.
* Make MAPPED reflect whether the actor will be painted;
add notification on a ClutterActor::mapped property.
Keep MAPPED state updated as the actor is shown,
ancestors are shown, actor is reparented, etc.
* Require a stage and realized parents to realize; this means
at realization time the correct window system and GL resources
are known. But unparented actors can no longer be realized.
* Allow children to be unrealized even if parent is realized.
Otherwise in effect either all actors or no actors are realized,
i.e. it becomes a stage-global flag.
* Allow clutter_actor_realize() to "fail" if not inside a toplevel
* Rework clutter_actor_unrealize() so internally we have
a flavor that does not mess with visibility flag
* Add _clutter_actor_rerealize() to encapsulate a somewhat
tricky operation we were doing in a couple of places
* Do not realize/unrealize children in ClutterGroup,
ClutterActor already does it
* Do not realize impl by hand in clutter_stage_show(),
since showing impl already does that
* Do not unrealize in various dispose() methods, since
ClutterActor dispose implementation already does it
and chaining up is mandatory
* ClutterTexture uses COGL while unrealizable (before it's
added to a stage). Previously this breakage was affecting
ClutterActor because we had to allow realize outside
a stage. Move the breakage to ClutterTexture, by making
ClutterTexture just use COGL while not realized.
* Unrealize before we set parent to NULL in clutter_actor_unparent().
This means unrealize() implementations can get to the stage.
Because actors need the stage in order to detach from stage.
* Update clutter-actor-invariants.txt to reflect latest changes
* Remove explicit hide/unrealize from ClutterActor::dispose since
unparent already forces those
Instead just assert that unparent() occurred and did the right thing.
* Check whether parent implements unrealize before chaining up
Needed because ClutterGroup no longer has to implement unrealize.
* Perform unrealize in the default handler for the signal.
This allows non-containers that have children to work properly,
and allows containers to override how it's done.
* Add map/unmap virtual methods and set MAPPED flag on self and
children in there. This allows subclasses to hook map/unmap.
These are not signals, because notify::mapped is better for
anything it's legitimate for a non-subclass to do.
Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
2009-04-02 09:16:43 -04:00
|
|
|
|
g_assert (!CLUTTER_ACTOR_IS_REALIZED (actor));
|
|
|
|
|
g_assert (!CLUTTER_ACTOR_IS_MAPPED (actor));
|
|
|
|
|
g_assert (CLUTTER_ACTOR_IS_VISIBLE (actor));
|
2012-03-05 12:26:09 -05:00
|
|
|
|
g_assert (show_on_set_parent);
|
2008-06-16 09:40:39 -04:00
|
|
|
|
|
|
|
|
|
clutter_actor_destroy (actor);
|
|
|
|
|
clutter_actor_destroy (group);
|
2012-03-05 12:26:09 -05:00
|
|
|
|
|
|
|
|
|
actor = clutter_actor_new ();
|
|
|
|
|
clutter_actor_add_child (stage, actor);
|
|
|
|
|
clutter_actor_hide (actor);
|
|
|
|
|
g_object_get (actor,
|
|
|
|
|
"show-on-set-parent", &show_on_set_parent,
|
|
|
|
|
NULL);
|
|
|
|
|
g_assert (!CLUTTER_ACTOR_IS_VISIBLE (actor));
|
|
|
|
|
g_assert (!CLUTTER_ACTOR_IS_MAPPED (actor));
|
|
|
|
|
g_assert (show_on_set_parent);
|
|
|
|
|
|
|
|
|
|
clutter_actor_destroy (actor);
|
|
|
|
|
|
|
|
|
|
actor = clutter_actor_new ();
|
|
|
|
|
clutter_actor_hide (actor);
|
|
|
|
|
clutter_actor_add_child (stage, actor);
|
|
|
|
|
g_object_get (actor,
|
|
|
|
|
"show-on-set-parent", &show_on_set_parent,
|
|
|
|
|
NULL);
|
|
|
|
|
g_assert (!CLUTTER_ACTOR_IS_VISIBLE (actor));
|
|
|
|
|
g_assert (!CLUTTER_ACTOR_IS_MAPPED (actor));
|
|
|
|
|
g_assert (!show_on_set_parent);
|
|
|
|
|
|
|
|
|
|
clutter_actor_destroy (actor);
|
|
|
|
|
|
2011-11-08 12:04:44 -05:00
|
|
|
|
clutter_actor_destroy (stage);
|
2008-06-16 09:40:39 -04:00
|
|
|
|
}
|
2009-06-11 22:46:38 -04:00
|
|
|
|
|
|
|
|
|
void
|
2012-02-15 08:43:15 -05:00
|
|
|
|
clone_no_map (TestConformSimpleFixture *fixture,
|
|
|
|
|
gconstpointer data)
|
2009-06-11 22:46:38 -04:00
|
|
|
|
{
|
|
|
|
|
ClutterActor *stage;
|
|
|
|
|
ClutterActor *group;
|
|
|
|
|
ClutterActor *actor;
|
|
|
|
|
ClutterActor *clone;
|
|
|
|
|
|
2011-11-08 12:04:44 -05:00
|
|
|
|
stage = clutter_stage_new ();
|
2010-02-24 07:09:13 -05:00
|
|
|
|
clutter_actor_show (stage);
|
2009-06-11 22:46:38 -04:00
|
|
|
|
|
2013-06-12 05:27:37 -04:00
|
|
|
|
group = clutter_actor_new ();
|
|
|
|
|
actor = clutter_actor_new ();
|
2009-06-11 22:46:38 -04:00
|
|
|
|
|
|
|
|
|
clutter_actor_hide (group);
|
|
|
|
|
|
2013-06-12 05:27:37 -04:00
|
|
|
|
clutter_actor_add_child (group, actor);
|
|
|
|
|
clutter_actor_add_child (stage, group);
|
2009-06-11 22:46:38 -04:00
|
|
|
|
|
|
|
|
|
g_assert (!(CLUTTER_ACTOR_IS_MAPPED (group)));
|
|
|
|
|
g_assert (!(CLUTTER_ACTOR_IS_MAPPED (actor)));
|
|
|
|
|
|
|
|
|
|
clone = clutter_clone_new (group);
|
|
|
|
|
|
2013-06-12 05:27:37 -04:00
|
|
|
|
clutter_actor_add_child (stage, clone);
|
2009-06-11 22:46:38 -04:00
|
|
|
|
|
|
|
|
|
g_assert (CLUTTER_ACTOR_IS_MAPPED (clone));
|
|
|
|
|
g_assert (!(CLUTTER_ACTOR_IS_MAPPED (group)));
|
|
|
|
|
g_assert (!(CLUTTER_ACTOR_IS_MAPPED (actor)));
|
|
|
|
|
|
|
|
|
|
clutter_actor_destroy (CLUTTER_ACTOR (clone));
|
|
|
|
|
clutter_actor_destroy (CLUTTER_ACTOR (group));
|
2011-11-08 12:04:44 -05:00
|
|
|
|
clutter_actor_destroy (stage);
|
2009-06-11 22:46:38 -04:00
|
|
|
|
}
|
2010-09-27 17:17:12 -04:00
|
|
|
|
|
|
|
|
|
void
|
2012-02-15 08:43:15 -05:00
|
|
|
|
actor_contains (TestConformSimpleFixture *fixture,
|
|
|
|
|
gconstpointer data)
|
2010-09-27 17:17:12 -04:00
|
|
|
|
{
|
|
|
|
|
/* This build up the following tree:
|
|
|
|
|
*
|
|
|
|
|
* a
|
|
|
|
|
* ╱ │ ╲
|
|
|
|
|
* ╱ │ ╲
|
|
|
|
|
* b c d
|
|
|
|
|
* ╱ ╲ ╱ ╲ ╱ ╲
|
|
|
|
|
* e f g h i j
|
|
|
|
|
*/
|
|
|
|
|
struct {
|
|
|
|
|
ClutterActor *actor_a, *actor_b, *actor_c, *actor_d, *actor_e;
|
|
|
|
|
ClutterActor *actor_f, *actor_g, *actor_h, *actor_i, *actor_j;
|
|
|
|
|
} d;
|
|
|
|
|
int x, y;
|
|
|
|
|
ClutterActor **actor_array = &d.actor_a;
|
|
|
|
|
|
|
|
|
|
/* Matrix of expected results */
|
|
|
|
|
static const gboolean expected_results[] =
|
|
|
|
|
{ /* a, b, c, d, e, f, g, h, i, j */
|
|
|
|
|
/* a */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
|
|
|
|
/* b */ 0, 1, 0, 0, 1, 1, 0, 0, 0, 0,
|
|
|
|
|
/* c */ 0, 0, 1, 0, 0, 0, 1, 1, 0, 0,
|
|
|
|
|
/* d */ 0, 0, 0, 1, 0, 0, 0, 0, 1, 1,
|
|
|
|
|
/* e */ 0, 0, 0, 0, 1, 0, 0, 0, 0, 0,
|
|
|
|
|
/* f */ 0, 0, 0, 0, 0, 1, 0, 0, 0, 0,
|
|
|
|
|
/* g */ 0, 0, 0, 0, 0, 0, 1, 0, 0, 0,
|
|
|
|
|
/* h */ 0, 0, 0, 0, 0, 0, 0, 1, 0, 0,
|
|
|
|
|
/* i */ 0, 0, 0, 0, 0, 0, 0, 0, 1, 0,
|
|
|
|
|
/* j */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 1
|
|
|
|
|
};
|
|
|
|
|
|
2012-02-15 08:43:15 -05:00
|
|
|
|
d.actor_a = clutter_actor_new ();
|
|
|
|
|
d.actor_b = clutter_actor_new ();
|
|
|
|
|
d.actor_c = clutter_actor_new ();
|
|
|
|
|
d.actor_d = clutter_actor_new ();
|
|
|
|
|
d.actor_e = clutter_actor_new ();
|
|
|
|
|
d.actor_f = clutter_actor_new ();
|
|
|
|
|
d.actor_g = clutter_actor_new ();
|
|
|
|
|
d.actor_h = clutter_actor_new ();
|
|
|
|
|
d.actor_i = clutter_actor_new ();
|
|
|
|
|
d.actor_j = clutter_actor_new ();
|
|
|
|
|
|
|
|
|
|
clutter_actor_add_child (d.actor_a, d.actor_b);
|
|
|
|
|
clutter_actor_add_child (d.actor_a, d.actor_c);
|
|
|
|
|
clutter_actor_add_child (d.actor_a, d.actor_d);
|
|
|
|
|
|
|
|
|
|
clutter_actor_add_child (d.actor_b, d.actor_e);
|
|
|
|
|
clutter_actor_add_child (d.actor_b, d.actor_f);
|
|
|
|
|
|
|
|
|
|
clutter_actor_add_child (d.actor_c, d.actor_g);
|
|
|
|
|
clutter_actor_add_child (d.actor_c, d.actor_h);
|
|
|
|
|
|
|
|
|
|
clutter_actor_add_child (d.actor_d, d.actor_i);
|
|
|
|
|
clutter_actor_add_child (d.actor_d, d.actor_j);
|
2010-09-27 17:17:12 -04:00
|
|
|
|
|
|
|
|
|
for (y = 0; y < 10; y++)
|
|
|
|
|
for (x = 0; x < 10; x++)
|
|
|
|
|
g_assert_cmpint (clutter_actor_contains (actor_array[x],
|
|
|
|
|
actor_array[y]),
|
|
|
|
|
==,
|
|
|
|
|
expected_results[x * 10 + y]);
|
|
|
|
|
}
|
2011-11-08 12:04:44 -05:00
|
|
|
|
|
|
|
|
|
void
|
|
|
|
|
default_stage (TestConformSimpleFixture *fixture,
|
|
|
|
|
gconstpointer data)
|
|
|
|
|
{
|
|
|
|
|
ClutterActor *stage, *def_stage;
|
|
|
|
|
|
|
|
|
|
stage = clutter_stage_new ();
|
|
|
|
|
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));
|
|
|
|
|
}
|
actor: rollback pivot translation even on explicit transforms
When setting an explicit transform with clutter_actor_set_transform()
and a non (0,0) pivot-point, clutter_actor_apply_transform() will fail
to roll back the pivot-point translation done before multiplying the
transformation matrix due to the "out:" label being slightly misplaced
in clutter_actor_real_apply_transform().
This works properly:
clutter_actor_set_pivot_point (actor, 0.5, 0.5);
clutter_actor_set_rotation_angle (actor, CLUTTER_Z_AXIS, 30);
This results in the actor being moved to the pivot-point position:
clutter_actor_set_pivot_point (actor, 0.5, 0.5);
clutter_matrix_init_identity(&matrix);
cogl_matrix_rotate (&matrix, 30, 0, 0, 1.0);
clutter_actor_set_transform (actor, &matrix);
This also add a conformance test checking that even when using a
pivot-point, no matter how a rotation is set the resulting
transformation matrix will be the same.
https://bugzilla.gnome.org/show_bug.cgi?id=690214
2012-12-14 12:05:26 -05:00
|
|
|
|
|
|
|
|
|
void
|
|
|
|
|
actor_pivot_transformation (TestConformSimpleFixture *fixture,
|
|
|
|
|
gconstpointer data)
|
|
|
|
|
{
|
|
|
|
|
ClutterActor *stage, *actor_implicit, *actor_explicit;
|
|
|
|
|
ClutterMatrix transform, result_implicit, result_explicit;
|
|
|
|
|
ClutterActorBox allocation = CLUTTER_ACTOR_BOX_INIT (0, 0, 90, 30);
|
|
|
|
|
gfloat angle = 30;
|
|
|
|
|
|
|
|
|
|
stage = clutter_stage_new ();
|
|
|
|
|
|
|
|
|
|
actor_implicit = clutter_actor_new ();
|
|
|
|
|
actor_explicit = clutter_actor_new ();
|
|
|
|
|
|
|
|
|
|
clutter_actor_add_child (stage, actor_implicit);
|
|
|
|
|
clutter_actor_add_child (stage, actor_explicit);
|
|
|
|
|
|
|
|
|
|
/* Fake allocation or pivot-point will not have any effect */
|
|
|
|
|
clutter_actor_allocate (actor_implicit, &allocation, CLUTTER_ALLOCATION_NONE);
|
|
|
|
|
clutter_actor_allocate (actor_explicit, &allocation, CLUTTER_ALLOCATION_NONE);
|
|
|
|
|
|
|
|
|
|
clutter_actor_set_pivot_point (actor_implicit, 0.5, 0.5);
|
|
|
|
|
clutter_actor_set_pivot_point (actor_explicit, 0.5, 0.5);
|
|
|
|
|
|
|
|
|
|
/* Implict transformation */
|
|
|
|
|
clutter_actor_set_rotation_angle (actor_implicit, CLUTTER_Z_AXIS, angle);
|
|
|
|
|
|
|
|
|
|
/* Explict transformation */
|
|
|
|
|
clutter_matrix_init_identity(&transform);
|
|
|
|
|
cogl_matrix_rotate (&transform, angle, 0, 0, 1.0);
|
|
|
|
|
clutter_actor_set_transform (actor_explicit, &transform);
|
|
|
|
|
|
|
|
|
|
clutter_actor_get_transform (actor_implicit, &result_implicit);
|
|
|
|
|
clutter_actor_get_transform (actor_explicit, &result_explicit);
|
|
|
|
|
|
|
|
|
|
clutter_actor_destroy (stage);
|
|
|
|
|
|
|
|
|
|
g_assert (cogl_matrix_equal (&result_implicit, &result_explicit));
|
|
|
|
|
}
|