Gnash
0.8.10
|
A class for parsing DefineButton and DefineButton2 tags. More...
#include <DefineButtonTag.h>
Public Types | |
typedef std::vector< ButtonRecord > | ButtonRecords |
typedef boost::ptr_vector < ButtonAction > | ButtonActions |
Public Member Functions | |
virtual | ~DefineButtonTag () |
DisplayObject * | createDisplayObject (Global_as &gl, DisplayObject *parent) const |
Create a mutable instance of our definition. | |
ButtonRecords & | buttonRecords () |
const ButtonRecords & | buttonRecords () const |
Read-only access to the ButtonRecords directly. | |
bool | hasSound () const |
Does this button have an associated DefineButtonSoundTag? | |
void | addSoundTag (std::auto_ptr< SWF::DefineButtonSoundTag > soundTag) |
const DefineButtonSoundTag::ButtonSound & | buttonSound (size_t index) const |
Return one of the four sounds associated with this Button. | |
int | getSWFVersion () const |
Return version of the SWF containing this button definition. | |
bool | trackAsMenu () const |
Whether to track this button as a menu. | |
bool | hasKeyPressHandler () const |
template<class E > | |
void | forEachTrigger (const event_id &ev, E &f) const |
Invoke a functor for each action triggered by given event. | |
template<class E > | |
void | visitKeyCodes (E &f) const |
Invoke a functor for each key code that should trigger an action. | |
Static Public Member Functions | |
static void | loader (SWFStream &in, TagType tag, movie_definition &m, const RunResources &r) |
Load a DefineButtonTag. | |
Friends | |
class | DefineButton2Tag |
DefineButton2Tag::loader also needs to create a DefineButtonTag. |
A class for parsing DefineButton and DefineButton2 tags.
typedef boost::ptr_vector<ButtonAction> gnash::SWF::DefineButtonTag::ButtonActions |
typedef std::vector<ButtonRecord> gnash::SWF::DefineButtonTag::ButtonRecords |
gnash::SWF::DefineButtonTag::~DefineButtonTag | ( | ) | [virtual] |
void gnash::SWF::DefineButtonTag::addSoundTag | ( | std::auto_ptr< SWF::DefineButtonSoundTag > | soundTag | ) | [inline] |
Add a DefineButtonSoundTag to the button. This should not be done twice, so check hasSound() first.
References assert.
Referenced by gnash::SWF::DefineButtonSoundTag::loader().
ButtonRecords& gnash::SWF::DefineButtonTag::buttonRecords | ( | ) | [inline] |
Access the ButtonRecords directly. Used for modifying the Cxform by a DefineButtonCxform tag.
Referenced by gnash::SWF::DefineButtonCxformTag::loader().
const ButtonRecords& gnash::SWF::DefineButtonTag::buttonRecords | ( | ) | const [inline] |
Read-only access to the ButtonRecords directly.
const DefineButtonSoundTag::ButtonSound& gnash::SWF::DefineButtonTag::buttonSound | ( | size_t | index | ) | const [inline] |
Return one of the four sounds associated with this Button.
index | The sound index (0-3) to get. Do not call this function without checking hasSound() first. |
References assert.
DisplayObject * gnash::SWF::DefineButtonTag::createDisplayObject | ( | Global_as & | gl, |
DisplayObject * | parent | ||
) | const [virtual] |
Create a mutable instance of our definition.
Implements gnash::SWF::DefinitionTag.
References gnash::getObjectWithPrototype(), and gnash::NSV::CLASS_BUTTON.
void gnash::SWF::DefineButtonTag::forEachTrigger | ( | const event_id & | ev, |
E & | f | ||
) | const [inline] |
Invoke a functor for each action triggered by given event.
The functor will be passed a const action_buffer& and is not expected to return anything.
References gnash::key::i, gnash::key::e, and gnash::key::f.
int gnash::SWF::DefineButtonTag::getSWFVersion | ( | ) | const |
Return version of the SWF containing this button definition.
References gnash::movie_definition::get_version().
bool gnash::SWF::DefineButtonTag::hasKeyPressHandler | ( | ) | const |
References gnash::SWF::ButtonAction::triggeredByKeyPress().
bool gnash::SWF::DefineButtonTag::hasSound | ( | ) | const [inline] |
Does this button have an associated DefineButtonSoundTag?
Referenced by gnash::SWF::DefineButtonSoundTag::loader().
void gnash::SWF::DefineButtonTag::loader | ( | SWFStream & | in, |
TagType | tag, | ||
movie_definition & | m, | ||
const RunResources & | r | ||
) | [static] |
Load a DefineButtonTag.
References assert, gnash::SWF::DEFINEBUTTON, gnash::SWFStream::ensureBytes(), gnash::SWFStream::read_u16(), IF_VERBOSE_PARSE, _, and gnash::movie_definition::addDisplayObject().
Referenced by gnash::SWF::addDefaultLoaders().
bool gnash::SWF::DefineButtonTag::trackAsMenu | ( | ) | const [inline] |
Whether to track this button as a menu.
void gnash::SWF::DefineButtonTag::visitKeyCodes | ( | E & | f | ) | const [inline] |
Invoke a functor for each key code that should trigger an action.
Note: the key code is neither ascii nor a key index, but rather a special button key code (the SWF column of GnashKey.h).
References gnash::renderer::opengl::for_each(), and gnash::key::_1.
friend class DefineButton2Tag [friend] |
DefineButton2Tag::loader also needs to create a DefineButtonTag.