A class for parsing ButtonRecord, used by DefineButton and DefineButton2. More...
#include <DefineButtonTag.h>
Public Member Functions | |
ButtonRecord () | |
DisplayObject * | instantiate (Button *button, bool name=true) const |
Create a DisplayObject from a ButtonRecord. | |
bool | hasState (Button::MouseState st) const |
Check if this ButtonRecord has a DisplayObject for a particular state. | |
void | readRGBTransform (SWFStream &in) |
Read an RGB cxform for this record. | |
bool | read (SWFStream &in, TagType t, movie_definition &m, unsigned long endPos) |
Read a ButtonRecord from the SWF stream. | |
bool | valid () const |
Return true if the ButtonRecord is valid. |
A class for parsing ButtonRecord, used by DefineButton and DefineButton2.
gnash::SWF::ButtonRecord::ButtonRecord | ( | ) | [inline] |
bool gnash::SWF::ButtonRecord::hasState | ( | Button::MouseState | st | ) | const |
Check if this ButtonRecord has a DisplayObject for a particular state.
state | The Button::MouseState to test for. |
References gnash::Button::MOUSESTATE_DOWN, gnash::Button::MOUSESTATE_HIT, gnash::Button::MOUSESTATE_OVER, and gnash::Button::MOUSESTATE_UP.
DisplayObject * gnash::SWF::ButtonRecord::instantiate | ( | Button * | button, | |
bool | name = true | |||
) | const |
Create a DisplayObject from a ButtonRecord.
name | Whether the created DisplayObject requires its own instance name. | |
button | The button to which the DisplayObject will belong. |
References gnash::SWF::DefinitionTag::createDisplayObject(), gnash::getGlobal(), gnash::DisplayObject::getNextUnnamedInstanceName(), gnash::getObject(), gnash::isReferenceable(), gnash::key::o, gnash::DisplayObject::set_cxform(), gnash::DisplayObject::set_depth(), gnash::DisplayObject::set_name(), gnash::DisplayObject::setMatrix(), and gnash::DisplayObject::staticDepthOffset.
Referenced by gnash::Button::construct(), and gnash::Button::set_current_state().
bool gnash::SWF::ButtonRecord::read | ( | SWFStream & | in, | |
TagType | t, | |||
movie_definition & | m, | |||
unsigned long | endPos | |||
) |
Read a ButtonRecord from the SWF stream.
Return true if we read a record; false if this is a null
endPos | Last stream offset available for a valid read |
References _, gnash::SWF::DEFINEBUTTON2, gnash::SWFStream::ensureBytes(), gnash::movie_definition::getDefinitionTag(), IF_VERBOSE_MALFORMED_SWF, IF_VERBOSE_PARSE, LOG_ONCE, gnash::cxform::read_rgba(), gnash::SWFStream::read_u16(), gnash::SWFStream::read_u8(), gnash::readSWFMatrix(), gnash::SWFStream::tell(), and gnash::typeName().
void gnash::SWF::ButtonRecord::readRGBTransform | ( | SWFStream & | in | ) | [inline] |
Read an RGB cxform for this record.
Cxform is stored in a different tag for SWF2 Buttons (DEFINEBUTTON tag)
References gnash::cxform::read_rgb().
bool gnash::SWF::ButtonRecord::valid | ( | ) | const [inline] |
Return true if the ButtonRecord is valid.
A ButtonRecord is invalid if it refers to a DisplayObject which has not been defined.