It is conceivable that Container implementations might add children
outside of the Container::add() implementation - e.g. for packing at
a specific index. Since the addition (and removal) might happen outside
the common path we need to expose all the API that is implicitly called
by ClutterContainer when adding and removing a child - namely the
ChildMeta creation and destruction.
Bug 1517 - clutter_container_foreach_with_internals()
This allows us to iterate over all children (for things like maintaining
map/realize invariants) or only children that apps added and care about.
Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
* clutter/clutter-container.[ch]: Add checks to the Container
interface invocation methods, to avoid crashing or corrupting
the stack when an actor does not implement every virtual
function of the Container interface vtable. GObject allows this
to happen so we must handle the case gracefully. This also means
that we can classify some virtual function as mandatory (as is
the case for ::add, ::remove and ::foreach) and some other
optional.
Bug 882 - Allow child properties for containers implementing the
ClutterContainer interface (Øyvind Kolås)
* clutter/clutter-child-meta.[ch]: Base class for the metadata
of a ClutterActor inside a ClutterContainer; the ChildMeta
object implements a wrapper for storing data that is attached
to a ClutterActor only when it's part of a ClutterContainer.
The ChildMeta object is used to store the child properties
accessible through the ClutterContainer API.
* clutter/clutter-container.[ch]: Creates the ChildMeta for
each actor, in case the Container specifies the ChildMeta
type to use.
* clutter/Makefile.am: Add clutter-child-meta.[ch] to the build.
* clutter/clutter-marshal.list: Add the marshaller for the
ClutterContainer::child-notify signal.
* clutter/clutter-types.h: Declare ClutterContainer and
ClutterChildMeta to avoid recursive inclusion.
from interface (and all implementations of it) since this
functionality is now implemented using a global hash.
* clutter/clutter-box.c:
* clutter/clutter-group.c:
Language bindings will have problems with raise() and lower() bein in both
ClutterContainer and ClutterActor; hence, this patch renames
clutter_container_raise() and clutter_container_lower() to
clutter_container_raise_child() and clutter_container_lower_child(),
respectively.
Since ClutterActor directly calls ClutterGroup methods we need ClutterContainer
to provide them, so that every container actor behaves the same way.
This patch makes ::raise, ::lower and ::sort_depth_order virtual functions
of the ClutterContainer interface, implemented by ClutterGroup.
The documentation has been added and deprecation warnings have been added
as well.
Finding a child by its ID is a method that should be used by every container
and not only by ClutterGroup. This is needed to actually fix the picking in
ClutterStage.
* clutter/clutter-container.h:
* clutter/clutter-layout.h: Interfaces are not checked
at compile-time, so there's not need to add padding to
avoid ABI breaks.