Public Member Functions

gnash::InteractiveObject Class Reference

The base class for interactive objects. More...

#include <InteractiveObject.h>

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

List of all members.

Public Member Functions

 InteractiveObject (as_object *object, DisplayObject *parent)
virtual ~InteractiveObject ()
virtual void display (Renderer &renderer, const Transform &xform)=0
 Render this InteractiveObject.
virtual bool mouseEnabled () const =0
 Whether the DisplayObject can handle a mouse event.
virtual bool trackAsMenu ()
 ActionScript property of Buttons and MovieClips altering mouse handling.
virtual StaticTextgetStaticText (std::vector< const SWF::TextRecord * > &, size_t &)
 Allow extraction of static text.
virtual SWFRect getBounds () const =0
 Returns local, untransformed bounds of this DisplayObject in TWIPS.
virtual InteractiveObjecttopmostMouseEntity (boost::int32_t, boost::int32_t)=0
 Return the topmost entity covering the given point and enabled to receive mouse events.
virtual void mouseEvent (const event_id &id)
virtual bool pointInShape (boost::int32_t x, boost::int32_t y) const
 Return true if the given point falls in this DisplayObject's shape.
void add_invalidated_bounds (InvalidatedRanges &ranges, bool force)=0
 Add the DisplayObject's invalidated bounds *to* the given ranges list.

Detailed Description

The base class for interactive objects.

Objects of type InteractiveObject can receive focus, mouse events, and key events for user interaction. Derived classes include TextField, Button, and MovieClip.


Constructor & Destructor Documentation

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

Member Function Documentation

void gnash::InteractiveObject::add_invalidated_bounds ( InvalidatedRanges ranges,
bool  force 
) [pure 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.

Reimplemented from gnash::DisplayObject.

Implemented in gnash::Button, gnash::MovieClip, gnash::TextField, and gnash::DummyCharacter.

virtual void gnash::InteractiveObject::display ( Renderer renderer,
const Transform xform 
) [pure virtual]
virtual SWFRect gnash::InteractiveObject::getBounds (  )  const [pure 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::DisplayObject.

Implemented in gnash::Button, gnash::MovieClip, gnash::TextField, and gnash::DummyCharacter.

virtual StaticText* gnash::InteractiveObject::getStaticText ( std::vector< const SWF::TextRecord * > &  ,
size_t &   
) [inline, virtual]

Allow extraction of static text.

Default returns 0, implemented only for DefineText though DisplayObject.

Reimplemented from gnash::DisplayObject.

virtual bool gnash::InteractiveObject::mouseEnabled (  )  const [pure virtual]

Whether the DisplayObject can handle a mouse event.

Returns:
true if the DisplayObject can handle mouse events

Implemented in gnash::Button, gnash::MovieClip, gnash::TextField, and gnash::DummyCharacter.

virtual void gnash::InteractiveObject::mouseEvent ( const event_id id  )  [inline, virtual]
virtual bool gnash::InteractiveObject::pointInShape ( boost::int32_t  x,
boost::int32_t  y 
) const [inline, virtual]

Return true if the given point falls in this DisplayObject's shape.

Point coordinates are in world TWIPS

The default implementation warns about a missing override and invokes pointInBounds().

Implements gnash::DisplayObject.

Reimplemented in gnash::Button, gnash::MovieClip, and gnash::TextField.

References gnash::DisplayObject::pointInBounds().

virtual InteractiveObject* gnash::InteractiveObject::topmostMouseEntity ( boost::int32_t  ,
boost::int32_t   
) [pure 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

Parameters:
x X ordinate of the pointer, in parent's coordinate space.
y Y ordinate of the pointer, in parent's coordiante space.

Reimplemented from gnash::DisplayObject.

Implemented in gnash::Button, gnash::MovieClip, gnash::TextField, and gnash::DummyCharacter.

virtual bool gnash::InteractiveObject::trackAsMenu (  )  [inline, virtual]

ActionScript property of Buttons and MovieClips altering mouse handling.

Reimplemented in gnash::Button, and gnash::MovieClip.


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