Emmanuele Bassi 67eeea6b62 actor: Maintain behaviour of old allocate() implementations
The usual way to implement a container actor is to override the
allocate() virtual function, chain up, and then allocate the actor's
children.

Clutter now has the ability to delegate layout management to
ClutterLayoutManager directly; in the allocation, this is done by
checking whether the actor has children, and then call
clutter_layout_manager_allocate() from within the default implementation
of the ClutterActor::allocate() vfunc. The same vfunc that everyone, has
been chaining up to.

Whoopsie.

Well, we can check if there's a layout manager, and if it's NULL, we
bail out. Except that there's a default layout manager, and it's the
fixed layout manager, so that classes like Group and Stage work by
default.

Double whoopsie.

The fix for this scenario is a bit nasty; we have to check if the actor
class has overridden the allocate() vfunc or not, before actually
looking at the layout manager. This means that classes that override the
allocate() vfunc are expected to do everything that ClutterActor's
default implementation does - which I think it's a fair requirement to
have.

For newly written code, though, it would probably be best if we just
provided a function that does the right thing by default, and that
you're supposed to be calling from within the allocate() vfunc
implementation, if you ever chose to override it. This new function,
clutter_actor_set_allocation(), should come with a warning the size of
Texas, to avoid people thinking it's a way to override the whole "call
allocate() on each child" mechanism. Plus, it should check if we're
inside an allocation sequence, and bail out if not.
2012-01-19 12:40:32 +00:00
..
2012-01-16 23:37:12 +00:00
2011-11-10 19:05:39 +01:00
2011-11-18 22:06:30 +01:00
2011-11-14 11:06:28 +00:00
2011-10-19 15:23:55 +01:00
2011-10-19 15:23:55 +01:00
2011-11-10 14:13:45 +00:00
2012-01-16 23:35:13 +00:00
2012-01-16 23:35:16 +00:00
2011-12-28 09:37:53 +00:00
2012-01-16 21:06:19 +00:00
2012-01-17 14:29:45 +00:00
2012-01-16 23:49:49 +00:00
2012-01-16 23:49:49 +00:00
2012-01-16 23:49:49 +00:00
2012-01-16 23:35:17 +00:00
2012-01-17 14:29:44 +00:00