Public Member Functions | Protected Attributes

gnash::DisplayObjectContainer Class Reference

#include <DisplayObjectContainer.h>

Inheritance diagram for gnash::DisplayObjectContainer:
Inheritance graph
[legend]
Collaboration diagram for gnash::DisplayObjectContainer:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 DisplayObjectContainer (as_object *object, DisplayObject *parent)
virtual ~DisplayObjectContainer ()
DisplayObjectremoveChildAt (int index)
 Remove the DisplayObject at the specified depth.
DisplayObjectremoveChild (DisplayObject *obj)
 Remove the specified child DisplayObject.
DisplayObjectaddChild (DisplayObject *obj)
 Add a child DisplayObject at the next suitable index (AS2: depth).
DisplayObjectaddChildAt (DisplayObject *obj, int index)
 Add a child DisplayObject at the specified index (AS2: depth).
size_t numChildren () const

Protected Attributes

DisplayList _displayList

Constructor & Destructor Documentation

gnash::DisplayObjectContainer::DisplayObjectContainer ( as_object object,
DisplayObject parent 
) [inline]
gnash::DisplayObjectContainer::~DisplayObjectContainer (  )  [virtual]

Member Function Documentation

DisplayObject * gnash::DisplayObjectContainer::addChild ( DisplayObject obj  ) 

Add a child DisplayObject at the next suitable index (AS2: depth).

TODO: should be a function of DisplayObjectContainer This is the implementation of the AS3-only method DisplayObjectContainer.addChild(), but can also be used for AS2.

Parameters:
obj The DisplayObject to add.
Returns:
The added DisplayObject (reflects the AS return)

References _displayList, gnash::DisplayList::addDisplayObject(), gnash::DisplayObject::parent(), removeChild(), and gnash::DisplayObject::set_parent().

DisplayObject * gnash::DisplayObjectContainer::addChildAt ( DisplayObject obj,
int  index 
)

Add a child DisplayObject at the specified index (AS2: depth).

TODO: should be a function of DisplayObjectContainer This is the implementation of the AS3-only method DisplayObjectContainer.addChild(), but can also be used for AS2.

Parameters:
obj The DisplayObject to add.
index The index (depth) at which to add the DisplayObject.
Returns:
The added DisplayObject (reflects the AS return)

References _displayList, gnash::DisplayList::insertDisplayObject(), gnash::DisplayObject::parent(), removeChild(), and gnash::DisplayObject::set_parent().

size_t gnash::DisplayObjectContainer::numChildren (  )  const [inline]
DisplayObject * gnash::DisplayObjectContainer::removeChild ( DisplayObject obj  ) 

Remove the specified child DisplayObject.

TODO: should be a function of DisplayObjectContainer This is the implementation of the AS3-only method DisplayObjectContainer.removeChild(), but can also be used for AS2.

Parameters:
obj The DisplayObject to remove.
Returns:
The removed DisplayObject (reflects the AS return)

References _displayList, gnash::DisplayList::removeDisplayObject(), and gnash::DisplayObject::set_parent().

Referenced by addChild(), and addChildAt().

DisplayObject * gnash::DisplayObjectContainer::removeChildAt ( int  index  ) 

Remove the DisplayObject at the specified depth.

This is the implementation of the AS3-only method DisplayObjectContainer.removeChildAt().

Parameters:
index The depth from which to remove a DisplayObject.
Returns:
The removed DisplayObject (reflects the AS return)

References _displayList, gnash::DisplayList::removeDisplayObjectAt(), and gnash::DisplayObject::set_parent().


Member Data Documentation


The documentation for this class was generated from the following files: