A dummy character instance, for use by unit tests. More...
#include <DummyCharacter.h>
Public Member Functions | |
DummyCharacter (as_object *object, DisplayObject *parent) | |
virtual void | display (Renderer &) |
Render this InteractiveObject. | |
virtual SWFRect | getBounds () const |
Returns local, untransformed bounds of this DisplayObject in TWIPS. | |
virtual bool | mouseEnabled () const |
Whether the DisplayObject can handle a mouse event. | |
InteractiveObject * | topmostMouseEntity (boost::int32_t, boost::int32_t) |
Return the topmost entity covering the given point and enabled to receive mouse events. | |
void | add_invalidated_bounds (InvalidatedRanges &, bool) |
Add the DisplayObject's invalidated bounds *to* the given ranges list. |
A dummy character instance, for use by unit tests.
This class provides implementation of all virtual methods of movie_definition by returning user-defined values for XXXXXXXXXXXXXXXXXXXXXXXXXX etc..
gnash::DummyCharacter::DummyCharacter | ( | as_object * | object, | |
DisplayObject * | parent | |||
) | [inline] |
void gnash::DummyCharacter::add_invalidated_bounds | ( | InvalidatedRanges & | ranges, | |
bool | force | |||
) | [inline, virtual] |
Add the DisplayObject's invalidated bounds *to* the given ranges list.
NOTE that this method should include the bounds that it covered the last time clear_invalidated() was called, as those need to be rerendered as well (to clear the region previously occupied by this DisplayObject).
That's why it returns the *union* of old_invalidated_ranges and the current bounds. The function is also used internally by set_invalidated() to update m_old_invalidated_ranges itself (you may notice some kind of circular reference), but that's no problem since old_invalidated_ranges is NULL during that call.
It is used to determine what area needs to be re-rendered. The coordinates are world coordinates (in TWIPS). Only instances with _invalidated flag set are checked unless force is set.
Implements gnash::InteractiveObject.
virtual void gnash::DummyCharacter::display | ( | Renderer & | renderer | ) | [inline, virtual] |
Render this InteractiveObject.
Implements gnash::InteractiveObject.
virtual SWFRect gnash::DummyCharacter::getBounds | ( | ) | const [inline, virtual] |
Returns local, untransformed bounds of this DisplayObject in TWIPS.
Container DisplayObjects (sprite and buttons) return the composite bounds of all their children, appropriately transformed with their local SWFMatrix.
Implements gnash::InteractiveObject.
virtual bool gnash::DummyCharacter::mouseEnabled | ( | ) | const [inline, virtual] |
Whether the DisplayObject can handle a mouse event.
Implements gnash::InteractiveObject.
InteractiveObject* gnash::DummyCharacter::topmostMouseEntity | ( | boost::int32_t | , | |
boost::int32_t | ||||
) | [inline, virtual] |
Return the topmost entity covering the given point and enabled to receive mouse events.
Return NULL if no "active" entity is found under the pointer.
Coordinates of the point are given in parent's coordinate space. This means that in order to convert the point to the local coordinate space you need to apply an inverse transformation using this DisplayObject SWFMatrix. Example:
point p(x,y); getMatrix().transform_by_inverse(p); -- p is now in local coordinates
Don't blame me for this mess, I'm just trying to document the existing functions ... --strk
x | X ordinate of the pointer, in parent's coordinate space. | |
y | Y ordinate of the pointer, in parent's coordiante space. |
Implements gnash::InteractiveObject.