Gnash  0.8.10
Public Member Functions
gnash::StaticText Class Reference

Static text fields, SWF-defined with read-only text. More...

#include <StaticText.h>

Inheritance diagram for gnash::StaticText:
gnash::DisplayObject gnash::GcResource

List of all members.

Public Member Functions

 StaticText (movie_root &mr, as_object *object, const SWF::DefineTextTag *def, DisplayObject *parent)
virtual StaticTextgetStaticText (std::vector< const SWF::TextRecord * > &to, size_t &numChars)
 Return a pointer to this if our definition contains any static text.
virtual void display (Renderer &renderer, const Transform &xform)
 Render the DisplayObject.
void setSelected (size_t pos, bool selected)
const boost::dynamic_bitset & getSelected () const
 Return a bitset showing which DisplayObjects (by index) are selected.
void setSelectionColor (boost::uint32_t color)
virtual SWFRect getBounds () const
virtual bool pointInShape (boost::int32_t x, boost::int32_t y) const
 Return true if the given point falls in this DisplayObject's shape.
const rgbaselectionColor () const

Detailed Description

Static text fields, SWF-defined with read-only text.

StaticText objects hold mutable selection and color information.


Constructor & Destructor Documentation

gnash::StaticText::StaticText ( movie_root mr,
as_object object,
const SWF::DefineTextTag def,
DisplayObject parent 
) [inline]

References assert.


Member Function Documentation

void gnash::StaticText::display ( Renderer renderer,
const Transform xform 
) [virtual]

Render the DisplayObject.

All DisplayObjects must have a display() function.

Implements gnash::DisplayObject.

References gnash::DisplayObject::transform(), and gnash::DisplayObject::clear_invalidated().

virtual SWFRect gnash::StaticText::getBounds ( ) const [inline, virtual]

Implements gnash::DisplayObject.

const boost::dynamic_bitset& gnash::StaticText::getSelected ( ) const [inline]

Return a bitset showing which DisplayObjects (by index) are selected.

Note: mutable information is meaningless until the StaticText is queried with getStaticText(). This is because under normal circumstances there is no need for it. Note also: the size() member of boost::dynamic_bitset returns 0 before getStaticText() is called; afterwards it is equivalent to the number of DisplayObjects in the StaticText's definition.

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

Return a pointer to this if our definition contains any static text.

This is non-const because a TextSnapshot needs to add selection and color information to this StaticText. It also resets selection.

Parameters:
toA vector of pointers to TextRecords containing text.
numCharsThe total number of DisplayObjects in all TextRecords is written to this variable. Note: This function always removes any existing selection and resizes the bitset to the number of DisplayObjects in all TextRecords.

Reimplemented from gnash::DisplayObject.

bool gnash::StaticText::pointInShape ( boost::int32_t  x,
boost::int32_t  y 
) const [virtual]

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

Parameters:
xPoint x coordinate in world space
yPoint y coordinate in world space
Returns:
Whether (x, y) is within the DisplayObject's bounds.

Implements gnash::DisplayObject.

References LOG_ONCE, _, and gnash::DisplayObject::pointInBounds().

const rgba& gnash::StaticText::selectionColor ( ) const [inline]
void gnash::StaticText::setSelected ( size_t  pos,
bool  selected 
) [inline]
void gnash::StaticText::setSelectionColor ( boost::uint32_t  color)

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