actor: Add _get_stage_internal to clutter-private.h

This adds _clutter_actor_get_stage_internal to clutter-private.h since
we plan to use it in clutter-offscreen-effect when preparing to
redirect an actor offscreen.
This commit is contained in:
Robert Bragg 2010-09-07 11:55:23 +01:00
parent 64088ea4de
commit ab008948cf
2 changed files with 14 additions and 15 deletions

View File

@ -635,8 +635,6 @@ static ClutterGravity clutter_anchor_coord_get_gravity (AnchorCoord *coord);
static void clutter_anchor_coord_set_gravity (AnchorCoord *coord,
ClutterGravity gravity);
static ClutterActor *clutter_actor_get_stage_internal (ClutterActor *actor);
static gboolean clutter_anchor_coord_is_zero (const AnchorCoord *coord);
/* Helper macro which translates by the anchor coord, applies the
@ -1080,7 +1078,7 @@ clutter_actor_real_unmap (ClutterActor *self)
{
ClutterActor *stage;
stage = clutter_actor_get_stage_internal (self);
stage = _clutter_actor_get_stage_internal (self);
if (stage != NULL &&
clutter_stage_get_key_focus (CLUTTER_STAGE (stage)) == self)
@ -1818,7 +1816,7 @@ clutter_actor_real_queue_redraw (ClutterActor *self,
*/
if (self->priv->propagated_one_redraw)
{
ClutterActor *stage = clutter_actor_get_stage_internal (self);
ClutterActor *stage = _clutter_actor_get_stage_internal (self);
if (stage != NULL &&
_clutter_stage_has_full_redraw_queued (CLUTTER_STAGE (stage)))
@ -2191,7 +2189,7 @@ _clutter_actor_ensure_stage_current (ClutterActor *self)
* Simply duping code for now in wait for Cogl cleanup that can hopefully
* address this in a nicer way.
*/
stage = clutter_actor_get_stage_internal (self);
stage = _clutter_actor_get_stage_internal (self);
/* FIXME: if were not yet added to a stage, its probably unsafe to
* return default - ideally the func should fail
@ -2236,7 +2234,7 @@ _clutter_actor_get_relative_modelview (ClutterActor *self,
if (ancestor == NULL)
{
stage = clutter_actor_get_stage_internal (self);
stage = _clutter_actor_get_stage_internal (self);
clutter_stage_get_perspective (CLUTTER_STAGE (stage), &perspective);
cogl_perspective (perspective.fovy,
@ -2375,7 +2373,7 @@ clutter_actor_get_allocation_vertices (ClutterActor *self,
* Simply duping code for now in wait for Cogl cleanup that can hopefully
* address this in a nicer way.
*/
stage = clutter_actor_get_stage_internal (self);
stage = _clutter_actor_get_stage_internal (self);
/* FIXME: if were not yet added to a stage, its probably unsafe to
* return default - idealy the func should fail
@ -2456,7 +2454,7 @@ clutter_actor_get_abs_allocation_vertices (ClutterActor *self,
*/
if (priv->needs_allocation)
{
ClutterActor *stage = clutter_actor_get_stage_internal (self);
ClutterActor *stage = _clutter_actor_get_stage_internal (self);
/* FIXME: if were not yet added to a stage, its probably unsafe to
* return default - idealy the func should fail
@ -2621,7 +2619,7 @@ _clutter_actor_apply_modelview_transform_recursive (ClutterActor *self,
if (self == ancestor)
return;
stage = clutter_actor_get_stage_internal (self);
stage = _clutter_actor_get_stage_internal (self);
/* FIXME: if were not yet added to a stage, its probably unsafe to
* return default - idealy the func should fail
@ -5491,7 +5489,7 @@ clutter_actor_get_allocation_box (ClutterActor *self,
/* this implements 2) */
if (G_UNLIKELY (self->priv->needs_allocation))
{
ClutterActor *stage = clutter_actor_get_stage_internal (self);
ClutterActor *stage = _clutter_actor_get_stage_internal (self);
/* do not queue a relayout on an unparented actor */
if (stage)
@ -9847,8 +9845,8 @@ clutter_actor_is_scaled (ClutterActor *self)
return FALSE;
}
static ClutterActor *
clutter_actor_get_stage_internal (ClutterActor *actor)
ClutterActor *
_clutter_actor_get_stage_internal (ClutterActor *actor)
{
while (actor && !CLUTTER_ACTOR_IS_TOPLEVEL (actor))
actor = actor->priv->parent_actor;
@ -9871,7 +9869,7 @@ clutter_actor_get_stage (ClutterActor *actor)
{
g_return_val_if_fail (CLUTTER_IS_ACTOR (actor), NULL);
return clutter_actor_get_stage_internal (actor);
return _clutter_actor_get_stage_internal (actor);
}
/**
@ -10188,7 +10186,7 @@ clutter_actor_grab_key_focus (ClutterActor *self)
g_return_if_fail (CLUTTER_IS_ACTOR (self));
stage = clutter_actor_get_stage_internal (self);
stage = _clutter_actor_get_stage_internal (self);
if (stage != NULL)
clutter_stage_set_key_focus (CLUTTER_STAGE (stage), self);
}
@ -11661,7 +11659,7 @@ clutter_actor_has_key_focus (ClutterActor *self)
g_return_val_if_fail (CLUTTER_IS_ACTOR (self), FALSE);
stage = clutter_actor_get_stage_internal (self);
stage = _clutter_actor_get_stage_internal (self);
if (stage == NULL)
return FALSE;

View File

@ -329,6 +329,7 @@ gboolean _clutter_boolean_handled_accumulator (GSignalInvocationHint *ihint,
const GValue *handler_return,
gpointer dummy);
ClutterActor *_clutter_actor_get_stage_internal (ClutterActor *actor);
void _clutter_actor_apply_modelview_transform_recursive (ClutterActor *self,
ClutterActor *ancestor);