|
Gnash
0.8.10
|
Static text fields, SWF-defined with read-only text. More...
#include <StaticText.h>
Public Member Functions | |
| StaticText (movie_root &mr, as_object *object, const SWF::DefineTextTag *def, DisplayObject *parent) | |
| virtual StaticText * | getStaticText (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 rgba & | selectionColor () const |
Static text fields, SWF-defined with read-only text.
StaticText objects hold mutable selection and color information.
| gnash::StaticText::StaticText | ( | movie_root & | mr, |
| as_object * | object, | ||
| const SWF::DefineTextTag * | def, | ||
| DisplayObject * | parent | ||
| ) | [inline] |
References assert.
| 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::clear_invalidated(), and gnash::DisplayObject::transform().
| 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.
| to | A vector of pointers to TextRecords containing text. |
| numChars | The 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.
| x | Point x coordinate in world space |
| y | Point y coordinate in world space |
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 | ) |
References gnash::rgba::parseRGB().
1.7.6.1