P_("Allocation"),
P_("The actor's allocation"),
CLUTTER_TYPE_ACTOR_BOX,
- CLUTTER_PARAM_READABLE);
+ G_PARAM_READABLE |
+ G_PARAM_STATIC_STRINGS |
+ CLUTTER_PARAM_ANIMATABLE);
/**
* ClutterActor:request-mode:
*allocation = adj_allocation;
}
+static void
+clutter_actor_allocate_internal (ClutterActor *self,
+ const ClutterActorBox *allocation,
+ ClutterAllocationFlags flags)
+{
+ ClutterActorClass *klass;
+
+ CLUTTER_SET_PRIVATE_FLAGS (self, CLUTTER_IN_RELAYOUT);
+
+ CLUTTER_NOTE (LAYOUT, "Calling %s::allocate()",
+ _clutter_actor_get_debug_name (self));
+
+ klass = CLUTTER_ACTOR_GET_CLASS (self);
+ klass->allocate (self, allocation, flags);
+
+ CLUTTER_UNSET_PRIVATE_FLAGS (self, CLUTTER_IN_RELAYOUT);
+
+ clutter_actor_queue_redraw (self);
+}
+
/**
* clutter_actor_allocate:
* @self: A #ClutterActor
const ClutterActorBox *box,
ClutterAllocationFlags flags)
{
- ClutterActorPrivate *priv;
- ClutterActorClass *klass;
ClutterActorBox old_allocation, real_allocation;
gboolean origin_changed, child_moved, size_changed;
gboolean stage_allocation_changed;
+ ClutterActorPrivate *priv;
g_return_if_fail (CLUTTER_IS_ACTOR (self));
if (G_UNLIKELY (_clutter_actor_get_stage_internal (self) == NULL))
if (child_moved)
flags |= CLUTTER_ABSOLUTE_ORIGIN_CHANGED;
- CLUTTER_SET_PRIVATE_FLAGS (self, CLUTTER_IN_RELAYOUT);
-
- CLUTTER_NOTE (LAYOUT, "Calling %s::allocate()",
- _clutter_actor_get_debug_name (self));
-
- klass = CLUTTER_ACTOR_GET_CLASS (self);
- klass->allocate (self, &real_allocation, flags);
-
- CLUTTER_UNSET_PRIVATE_FLAGS (self, CLUTTER_IN_RELAYOUT);
+ /* store the flags here, so that they can be propagated by the
+ * transition code
+ */
+ self->priv->allocation_flags = flags;
- if (stage_allocation_changed)
- clutter_actor_queue_redraw (self);
+ if (_clutter_actor_get_transition (self, obj_props[PROP_ALLOCATION]) == NULL)
+ {
+ _clutter_actor_create_transition (self, obj_props[PROP_ALLOCATION],
+ &priv->allocation,
+ &real_allocation);
+ }
+ else
+ _clutter_actor_update_transition (self, obj_props[PROP_ALLOCATION],
+ &real_allocation);
}
/**
clutter_actor_set_size_internal (actor, g_value_get_boxed (value));
break;
+ case PROP_ALLOCATION:
+ clutter_actor_allocate_internal (actor,
+ g_value_get_boxed (value),
+ actor->priv->allocation_flags);
+ break;
+
case PROP_DEPTH:
clutter_actor_set_depth_internal (actor, g_value_get_float (value));
break;