/* all bets are off during reparent when we're potentially realized,
* but should not be according to invariants
*/
- if (!(CLUTTER_PRIVATE_FLAGS (self) & CLUTTER_ACTOR_IN_REPARENT))
+ if (!CLUTTER_ACTOR_IN_REPARENT (self))
{
if (priv->parent_actor == NULL)
{
- if (CLUTTER_PRIVATE_FLAGS (self) & CLUTTER_ACTOR_IS_TOPLEVEL)
+ if (CLUTTER_ACTOR_IS_TOPLEVEL (self))
{
}
else
/* remaining bets are off during reparent when we're potentially
* mapped, but should not be according to invariants
*/
- if (!(CLUTTER_PRIVATE_FLAGS (self) & CLUTTER_ACTOR_IN_REPARENT))
+ if (!CLUTTER_ACTOR_IN_REPARENT (self))
{
if (priv->parent_actor == NULL)
{
- if (CLUTTER_PRIVATE_FLAGS (self) & CLUTTER_ACTOR_IS_TOPLEVEL)
+ if (CLUTTER_ACTOR_IS_TOPLEVEL (self))
{
if (!CLUTTER_ACTOR_IS_VISIBLE (self) &&
- !(CLUTTER_PRIVATE_FLAGS (self) & CLUTTER_ACTOR_IN_DESTRUCTION))
+ !CLUTTER_ACTOR_IN_DESTRUCTION (self))
{
g_warning ("Toplevel actor '%s' is mapped "
"but not visible",
get_actor_debug_name (priv->parent_actor));
}
- if (!(CLUTTER_PRIVATE_FLAGS (priv->parent_actor) &
- CLUTTER_ACTOR_IS_TOPLEVEL))
+ if (!CLUTTER_ACTOR_IS_TOPLEVEL (priv->parent_actor))
{
if (!CLUTTER_ACTOR_IS_MAPPED (priv->parent_actor))
g_warning ("Actor '%s' is mapped but its non-toplevel "
was_mapped = CLUTTER_ACTOR_IS_MAPPED (self);
- if (CLUTTER_PRIVATE_FLAGS (self) & CLUTTER_ACTOR_IS_TOPLEVEL)
+ if (CLUTTER_ACTOR_IS_TOPLEVEL (self))
{
/* the mapped flag on top-level actors must be set by the
* per-backend implementation because it might be asynchronous.
if (CLUTTER_ACTOR_IS_MAPPED (self) &&
!CLUTTER_ACTOR_IS_VISIBLE (self) &&
- !(CLUTTER_PRIVATE_FLAGS (self) & CLUTTER_ACTOR_IN_DESTRUCTION))
+ !CLUTTER_ACTOR_IN_DESTRUCTION (self))
{
g_warning ("Clutter toplevel of type '%s' is not visible, but "
"it is somehow still mapped",
gboolean parent_is_visible_realized_toplevel;
parent_is_visible_realized_toplevel =
- (((CLUTTER_PRIVATE_FLAGS (parent) &
- CLUTTER_ACTOR_IS_TOPLEVEL) != 0) &&
+ (CLUTTER_ACTOR_IS_TOPLEVEL (parent) &&
CLUTTER_ACTOR_IS_VISIBLE (parent) &&
CLUTTER_ACTOR_IS_REALIZED (parent));
*/
/* Unmap */
- if (!should_be_mapped &&
- !(CLUTTER_PRIVATE_FLAGS (self) & CLUTTER_ACTOR_IN_REPARENT))
- {
- clutter_actor_set_mapped (self, FALSE);
- }
+ if (!should_be_mapped && !CLUTTER_ACTOR_IN_REPARENT (self))
+ clutter_actor_set_mapped (self, FALSE);
/* Realize */
if (must_be_realized)
g_assert (!(must_be_realized && !may_be_realized));
/* Unrealize */
- if (!may_be_realized &&
- !(CLUTTER_PRIVATE_FLAGS (self) & CLUTTER_ACTOR_IN_REPARENT))
+ if (!may_be_realized && !CLUTTER_ACTOR_IN_REPARENT (self))
clutter_actor_unrealize_not_hiding (self);
/* Map */
g_object_notify (G_OBJECT (self), "mapped");
/* relinquish keyboard focus if we were unmapped while owning it */
- if (!(CLUTTER_PRIVATE_FLAGS (self) & CLUTTER_ACTOR_IS_TOPLEVEL))
+ if (!CLUTTER_ACTOR_IS_TOPLEVEL (self))
{
ClutterActor *stage;
if (priv->parent_actor != NULL)
clutter_actor_realize (priv->parent_actor);
- if (CLUTTER_PRIVATE_FLAGS (self) & CLUTTER_ACTOR_IS_TOPLEVEL)
+ if (CLUTTER_ACTOR_IS_TOPLEVEL (self))
{
/* toplevels can be realized at any time */
}
ClutterActor *origin)
{
/* no point in queuing a redraw on a destroyed actor */
- if (CLUTTER_PRIVATE_FLAGS (self) & CLUTTER_ACTOR_IN_DESTRUCTION)
+ if (CLUTTER_ACTOR_IN_DESTRUCTION (self))
return;
/* NB: We can't bail out early here if the actor is hidden in case
: "same actor");
/* no point in queuing a redraw on a destroyed actor */
- if (CLUTTER_PRIVATE_FLAGS (self) & CLUTTER_ACTOR_IN_DESTRUCTION)
+ if (CLUTTER_ACTOR_IN_DESTRUCTION (self))
return;
/* If the actor isn't visible, we still had to emit the signal
ClutterActorPrivate *priv = self->priv;
/* no point in queueing a redraw on a destroyed actor */
- if (CLUTTER_PRIVATE_FLAGS (self) & CLUTTER_ACTOR_IN_DESTRUCTION)
+ if (CLUTTER_ACTOR_IN_DESTRUCTION (self))
return;
priv->needs_width_request = TRUE;
* actors with 0 opacity to be a NOP... */
if (context->pick_mode == CLUTTER_PICK_NONE &&
/* ignore top-levels, since they might be transparent */
- !(CLUTTER_PRIVATE_FLAGS (self) & CLUTTER_ACTOR_IS_TOPLEVEL) &&
+ !CLUTTER_ACTOR_IS_TOPLEVEL (self) &&
/* If the actor is being painted from a clone then check the
clone's opacity instead */
(priv->opacity_parent ? priv->opacity_parent->priv : priv)->opacity == 0)
return;
/* mark that we are in the paint process */
- CLUTTER_SET_PRIVATE_FLAGS (self, CLUTTER_ACTOR_IN_PAINT);
+ CLUTTER_SET_PRIVATE_FLAGS (self, CLUTTER_IN_PAINT);
cogl_push_matrix();
cogl_pop_matrix();
/* paint sequence complete */
- CLUTTER_UNSET_PRIVATE_FLAGS (self, CLUTTER_ACTOR_IN_PAINT);
+ CLUTTER_UNSET_PRIVATE_FLAGS (self, CLUTTER_IN_PAINT);
}
/* internal helper function set the rotation angle without affecting
* is an internal child and has been marked as such
*/
if (CLUTTER_IS_CONTAINER (parent) &&
- !(CLUTTER_PRIVATE_FLAGS (self) & CLUTTER_ACTOR_INTERNAL_CHILD))
+ !CLUTTER_ACTOR_IS_INTERNAL_CHILD (self))
{
clutter_container_remove_actor (CLUTTER_CONTAINER (parent), self);
}
/* parent should be gone */
g_assert (priv->parent_actor == NULL);
- if (!(CLUTTER_PRIVATE_FLAGS (self) & CLUTTER_ACTOR_IS_TOPLEVEL))
+ if (!CLUTTER_ACTOR_IS_TOPLEVEL (self))
{
/* can't be mapped or realized with no parent */
g_assert (!CLUTTER_ACTOR_IS_MAPPED (self));
g_object_ref (self);
/* avoid recursion while destroying */
- if (!(CLUTTER_PRIVATE_FLAGS (self) & CLUTTER_ACTOR_IN_DESTRUCTION))
+ if (!CLUTTER_ACTOR_IN_DESTRUCTION (self))
{
- CLUTTER_SET_PRIVATE_FLAGS (self, CLUTTER_ACTOR_IN_DESTRUCTION);
+ CLUTTER_SET_PRIVATE_FLAGS (self, CLUTTER_IN_DESTRUCTION);
/* if we are destroying we want to unrealize ourselves
* first before the dispose run removes the parent
*/
- if (!(CLUTTER_PRIVATE_FLAGS (self) & CLUTTER_ACTOR_IS_TOPLEVEL))
+ if (!CLUTTER_ACTOR_IS_TOPLEVEL (self))
clutter_actor_update_map_state (self, MAP_STATE_MAKE_UNREALIZED);
g_object_run_dispose (G_OBJECT (self));
- CLUTTER_UNSET_PRIVATE_FLAGS (self, CLUTTER_ACTOR_IN_DESTRUCTION);
+ CLUTTER_UNSET_PRIVATE_FLAGS (self, CLUTTER_IN_DESTRUCTION);
}
g_object_unref (self);
* avoid needlessly traversing the actors ancestors to derive an
* incorrect modelview matrix.)
*/
- if ((CLUTTER_PRIVATE_FLAGS (self) & CLUTTER_ACTOR_SYNC_MATRICES) &&
- !(CLUTTER_PRIVATE_FLAGS (self) & CLUTTER_STAGE_IN_RESIZE))
+ if ((CLUTTER_PRIVATE_FLAGS (self) & CLUTTER_SYNC_MATRICES) &&
+ !CLUTTER_STAGE_IN_RESIZE (self))
{
clutter_actor_queue_redraw (self);
return;
return; /* save some cpu cycles */
#if CLUTTER_ENABLE_DEBUG
- if (!(CLUTTER_PRIVATE_FLAGS (self) & CLUTTER_ACTOR_IS_TOPLEVEL) &&
- (CLUTTER_PRIVATE_FLAGS (self) & CLUTTER_ACTOR_IN_RELAYOUT))
+ if (!CLUTTER_ACTOR_IS_TOPLEVEL (self) && CLUTTER_ACTOR_IN_RELAYOUT (self))
{
g_warning ("The actor '%s' is currently inside an allocation "
"cycle; calling clutter_actor_queue_relayout() is "
if (child_moved)
flags |= CLUTTER_ABSOLUTE_ORIGIN_CHANGED;
- CLUTTER_SET_PRIVATE_FLAGS (self, CLUTTER_ACTOR_IN_RELAYOUT);
+ CLUTTER_SET_PRIVATE_FLAGS (self, CLUTTER_IN_RELAYOUT);
klass = CLUTTER_ACTOR_GET_CLASS (self);
klass->allocate (self, box, flags);
- CLUTTER_UNSET_PRIVATE_FLAGS (self, CLUTTER_ACTOR_IN_RELAYOUT);
+ CLUTTER_UNSET_PRIVATE_FLAGS (self, CLUTTER_IN_RELAYOUT);
}
/**
* then we ignore the passed value and we override it with
* the stage implementation's preferred size.
*/
- if ((CLUTTER_PRIVATE_FLAGS (self) & CLUTTER_ACTOR_IS_TOPLEVEL) &&
+ if (CLUTTER_ACTOR_IS_TOPLEVEL (self) &&
clutter_feature_available (CLUTTER_FEATURE_STAGE_STATIC))
return;
* then we ignore the passed value and we override it with
* the stage implementation's preferred size.
*/
- if ((CLUTTER_PRIVATE_FLAGS (self) & CLUTTER_ACTOR_IS_TOPLEVEL) &&
+ if (CLUTTER_ACTOR_IS_TOPLEVEL (self) &&
clutter_feature_available (CLUTTER_FEATURE_STAGE_STATIC))
return;
* then we ignore the passed value and we override it with
* the stage implementation's preferred size.
*/
- if ((CLUTTER_PRIVATE_FLAGS (self) & CLUTTER_ACTOR_IS_TOPLEVEL) &&
+ if (CLUTTER_ACTOR_IS_TOPLEVEL (self) &&
clutter_feature_available (CLUTTER_FEATURE_STAGE_STATIC))
return;
* then we ignore the passed value and we override it with
* the stage implementation's preferred size.
*/
- if ((CLUTTER_PRIVATE_FLAGS (self) & CLUTTER_ACTOR_IS_TOPLEVEL) &&
+ if (CLUTTER_ACTOR_IS_TOPLEVEL (self) &&
clutter_feature_available (CLUTTER_FEATURE_STAGE_STATIC))
return;
* width to be resized to, so we should not be setting it
* along with the :natural-width
*/
- if (!(CLUTTER_PRIVATE_FLAGS (self) & CLUTTER_ACTOR_IS_TOPLEVEL))
+ if (!CLUTTER_ACTOR_IS_TOPLEVEL (self))
clutter_actor_set_min_width (self, width);
clutter_actor_set_natural_width (self, width);
else
{
/* we only unset the :natural-width for the Stage */
- if (!(CLUTTER_PRIVATE_FLAGS (self) & CLUTTER_ACTOR_IS_TOPLEVEL))
+ if (!CLUTTER_ACTOR_IS_TOPLEVEL (self))
clutter_actor_set_min_width_set (self, FALSE);
clutter_actor_set_natural_width_set (self, FALSE);
if (height >= 0)
{
/* see the comment above in set_width_internal() */
- if (!(CLUTTER_PRIVATE_FLAGS (self) & CLUTTER_ACTOR_IS_TOPLEVEL))
+ if (!CLUTTER_ACTOR_IS_TOPLEVEL (self))
clutter_actor_set_min_height (self, height);
clutter_actor_set_natural_height (self, height);
else
{
/* see the comment above in set_width_internal() */
- if (!(CLUTTER_PRIVATE_FLAGS (self) & CLUTTER_ACTOR_IS_TOPLEVEL))
+ if (!CLUTTER_ACTOR_IS_TOPLEVEL (self))
clutter_actor_set_min_height_set (self, FALSE);
clutter_actor_set_natural_height_set (self, FALSE);
* case of ClutterStage:use-alpha being TRUE we want the rest
* of the scene to be painted
*/
- if (CLUTTER_PRIVATE_FLAGS (self) & CLUTTER_ACTOR_IS_TOPLEVEL)
+ if (CLUTTER_ACTOR_IS_TOPLEVEL (self))
return 255;
if (priv->opacity_parent != NULL)
return;
}
- if (CLUTTER_PRIVATE_FLAGS (self) & CLUTTER_ACTOR_IS_TOPLEVEL)
+ if (CLUTTER_ACTOR_IS_TOPLEVEL (self))
{
g_warning ("Cannot set a parent on a toplevel actor\n");
return;
}
- if (CLUTTER_PRIVATE_FLAGS (parent) & CLUTTER_ACTOR_IN_DESTRUCTION)
+ if (CLUTTER_ACTOR_IN_DESTRUCTION (self))
{
g_warning ("Cannot set a parent currently being destroyed");
return;
* the flag on the actor
*/
if (parent->priv->internal_child)
- CLUTTER_SET_PRIVATE_FLAGS (self, CLUTTER_ACTOR_INTERNAL_CHILD);
+ CLUTTER_SET_PRIVATE_FLAGS (self, CLUTTER_INTERNAL_CHILD);
/* clutter_actor_reparent() will emit ::parent-set for us */
- if (!(CLUTTER_PRIVATE_FLAGS (self) & CLUTTER_ACTOR_IN_REPARENT))
+ if (!CLUTTER_ACTOR_IN_REPARENT (self))
g_signal_emit (self, actor_signals[PARENT_SET], 0, NULL);
/* If parent is mapped or realized, we need to also be mapped or
priv->parent_actor = NULL;
/* clutter_actor_reparent() will emit ::parent-set for us */
- if (!(CLUTTER_PRIVATE_FLAGS (self) & CLUTTER_ACTOR_IN_REPARENT))
+ if (!CLUTTER_ACTOR_IN_REPARENT (self))
g_signal_emit (self, actor_signals[PARENT_SET], 0, old_parent);
/* Queue a redraw on old_parent only if we were painted in the first
g_return_if_fail (CLUTTER_IS_ACTOR (new_parent));
g_return_if_fail (self != new_parent);
- if (CLUTTER_PRIVATE_FLAGS (self) & CLUTTER_ACTOR_IS_TOPLEVEL)
+ if (CLUTTER_ACTOR_IS_TOPLEVEL (self))
{
g_warning ("Cannot set a parent on a toplevel actor");
return;
}
- if (CLUTTER_PRIVATE_FLAGS (new_parent) & CLUTTER_ACTOR_IN_DESTRUCTION)
+ if (CLUTTER_ACTOR_IN_DESTRUCTION (self))
{
g_warning ("Cannot set a parent currently being destroyed");
return;
{
ClutterActor *old_parent;
- CLUTTER_SET_PRIVATE_FLAGS (self, CLUTTER_ACTOR_IN_REPARENT);
+ CLUTTER_SET_PRIVATE_FLAGS (self, CLUTTER_IN_REPARENT);
old_parent = priv->parent_actor;
* child and not an internal one
*/
if (CLUTTER_IS_CONTAINER (priv->parent_actor) &&
- !(CLUTTER_PRIVATE_FLAGS (self) & CLUTTER_ACTOR_INTERNAL_CHILD))
+ !CLUTTER_ACTOR_IS_INTERNAL_CHILD (self))
{
ClutterContainer *parent = CLUTTER_CONTAINER (priv->parent_actor);
g_object_unref (self);
- CLUTTER_UNSET_PRIVATE_FLAGS (self, CLUTTER_ACTOR_IN_REPARENT);
+ CLUTTER_UNSET_PRIVATE_FLAGS (self, CLUTTER_IN_REPARENT);
/* the IN_REPARENT flag suspends state updates */
clutter_actor_update_map_state (self, MAP_STATE_CHECK);
static ClutterActor *
clutter_actor_get_stage_internal (ClutterActor *actor)
{
- while (actor && !(CLUTTER_PRIVATE_FLAGS (actor) & CLUTTER_ACTOR_IS_TOPLEVEL))
+ while (actor && !CLUTTER_ACTOR_IS_TOPLEVEL (actor))
actor = actor->priv->parent_actor;
return actor;
typedef struct _ClutterMainContext ClutterMainContext;
+#define CLUTTER_PRIVATE_FLAGS(a) (((ClutterActor *) (a))->private_flags)
+#define CLUTTER_SET_PRIVATE_FLAGS(a,f) (CLUTTER_PRIVATE_FLAGS (a) |= (f))
+#define CLUTTER_UNSET_PRIVATE_FLAGS(a,f) (CLUTTER_PRIVATE_FLAGS (a) &= ~(f))
+
+#define CLUTTER_ACTOR_IS_TOPLEVEL(a) ((CLUTTER_PRIVATE_FLAGS (a) & CLUTTER_IS_TOPLEVEL) != FALSE)
+#define CLUTTER_ACTOR_IS_INTERNAL_CHILD(a) ((CLUTTER_PRIVATE_FLAGS (a) & CLUTTER_INTERNAL_CHILD) != FALSE)
+#define CLUTTER_ACTOR_IN_DESTRUCTION(a) ((CLUTTER_PRIVATE_FLAGS (a) & CLUTTER_IN_DESTRUCTION) != FALSE)
+#define CLUTTER_ACTOR_IN_REPARENT(a) ((CLUTTER_PRIVATE_FLAGS (a) & CLUTTER_IN_REPARENT) != FALSE)
+#define CLUTTER_ACTOR_IN_PAINT(a) ((CLUTTER_PRIVATE_FLAGS (a) & CLUTTER_IN_PAINT) != FALSE)
+#define CLUTTER_ACTOR_IN_RELAYOUT(a) ((CLUTTER_PRIVATE_FLAGS (a) & CLUTTER_IN_RELAYOUT) != FALSE)
+#define CLUTTER_STAGE_IN_RESIZE(a) ((CLUTTER_PRIVATE_FLAGS (a) & CLUTTER_IN_RESIZE) != FALSE)
+
typedef enum {
- CLUTTER_ACTOR_UNUSED_FLAG = 0,
+ CLUTTER_ACTOR_UNUSED_FLAG = 0,
- CLUTTER_ACTOR_IN_DESTRUCTION = 1 << 0,
- CLUTTER_ACTOR_IS_TOPLEVEL = 1 << 1,
- CLUTTER_ACTOR_IN_REPARENT = 1 << 2,
+ CLUTTER_IN_DESTRUCTION = 1 << 0,
+ CLUTTER_IS_TOPLEVEL = 1 << 1,
+ CLUTTER_IN_REPARENT = 1 << 2,
/* Used by the stage to indicate GL viewport / perspective etc needs
* (re)setting.
*/
- CLUTTER_ACTOR_SYNC_MATRICES = 1 << 3,
+ CLUTTER_SYNC_MATRICES = 1 << 3,
/* Used to avoid recursion */
- CLUTTER_ACTOR_IN_PAINT = 1 << 4,
+ CLUTTER_IN_PAINT = 1 << 4,
/* Used to avoid recursion */
- CLUTTER_ACTOR_IN_RELAYOUT = 1 << 5,
+ CLUTTER_IN_RELAYOUT = 1 << 5,
/* Used by the stage if resizing is an asynchronous operation (like on
* X11) to delay queueing relayouts until we got a notification from the
* event handling
*/
- CLUTTER_STAGE_IN_RESIZE = 1 << 6,
+ CLUTTER_IN_RESIZE = 1 << 6,
/* a flag for internal children of Containers */
- CLUTTER_ACTOR_INTERNAL_CHILD = 1 << 7
+ CLUTTER_INTERNAL_CHILD = 1 << 7
} ClutterPrivateFlags;
struct _ClutterInputDevice
PangoContext *_clutter_context_create_pango_context (ClutterMainContext *self);
PangoContext *_clutter_context_get_pango_context (ClutterMainContext *self);
-#define CLUTTER_PRIVATE_FLAGS(a) (((ClutterActor *) (a))->private_flags)
-#define CLUTTER_SET_PRIVATE_FLAGS(a,f) (CLUTTER_PRIVATE_FLAGS (a) |= (f))
-#define CLUTTER_UNSET_PRIVATE_FLAGS(a,f) (CLUTTER_PRIVATE_FLAGS (a) &= ~(f))
-
#define CLUTTER_PARAM_READABLE \
G_PARAM_READABLE | G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB
#define CLUTTER_PARAM_WRITABLE \