|
Gnash
0.8.11dev
|
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 Types inherited from gnash::SWF::ControlTag | |
Public Member Functions | |
| virtual | ~DefineButtonTag () |
| DisplayObject * | createDisplayObject (Global_as &gl, DisplayObject *parent) const |
| Create a mutable instance of our definition. More... | |
| ButtonRecords & | buttonRecords () |
| const ButtonRecords & | buttonRecords () const |
| Read-only access to the ButtonRecords directly. More... | |
| bool | hasSound () const |
| Does this button have an associated DefineButtonSoundTag? More... | |
| void | addSoundTag (std::unique_ptr< SWF::DefineButtonSoundTag > soundTag) |
| const DefineButtonSoundTag::ButtonSound & | buttonSound (size_t index) const |
| Return one of the four sounds associated with this Button. More... | |
| int | getSWFVersion () const |
| Return version of the SWF containing this button definition. More... | |
| bool | trackAsMenu () const |
| Whether to track this button as a menu. More... | |
| 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. More... | |
| template<class E > | |
| void | visitKeyCodes (E &f) const |
| Invoke a functor for each key code that should trigger an action. More... | |
Public Member Functions inherited from gnash::SWF::DefinitionTag | |
| virtual | ~DefinitionTag () |
| virtual DSOTEXPORT void | executeState (MovieClip *m, DisplayList &) const |
| Executing a DefinitionTag adds its id to list of known characters. More... | |
| std::uint16_t | id () const |
| The immutable id of the DefinitionTag. More... | |
Public Member Functions inherited from gnash::SWF::ControlTag | |
| virtual | ~ControlTag () |
| virtual void | executeActions (MovieClip *, DisplayList &) const |
| Execute Action tags. More... | |
Public Member Functions inherited from gnash::ref_counted | |
| ref_counted () | |
| ref_counted (const ref_counted &) | |
| void | add_ref () const |
| void | drop_ref () const |
| long | get_ref_count () const |
Static Public Member Functions | |
| static void | loader (SWFStream &in, TagType tag, movie_definition &m, const RunResources &r) |
| Load a DefineButtonTag. More... | |
Friends | |
| class | DefineButton2Tag |
| DefineButton2Tag::loader also needs to create a DefineButtonTag. More... | |
Additional Inherited Members | |
Protected Member Functions inherited from gnash::SWF::DefinitionTag | |
| DefinitionTag (std::uint16_t id) | |
Protected Member Functions inherited from gnash::ref_counted | |
| virtual | ~ref_counted () |
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 |
|
virtual |
|
inline |
Add a DefineButtonSoundTag to the button. This should not be done twice, so check hasSound() first.
Referenced by gnash::SWF::DefineButtonSoundTag::loader().
|
inline |
Access the ButtonRecords directly. Used for modifying the Cxform by a DefineButtonCxform tag.
Referenced by gnash::SWF::DefineButtonCxformTag::loader().
|
inline |
Read-only access to the ButtonRecords directly.
|
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 gnash::getSWFVersion().
|
virtual |
Create a mutable instance of our definition.
Implements gnash::SWF::DefinitionTag.
References gnash::NSV::CLASS_BUTTON, and gnash::getObjectWithPrototype().
|
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::SWF::ButtonAction::_actions, gnash::key::e, gnash::key::f, gnash::key::i, and gnash::SWF::ButtonAction::triggeredBy().
| int gnash::SWF::DefineButtonTag::getSWFVersion | ( | ) | const |
Return version of the SWF containing this button definition.
| bool gnash::SWF::DefineButtonTag::hasKeyPressHandler | ( | ) | const |
References gnash::SWF::ButtonAction::triggeredByKeyPress().
|
inline |
Does this button have an associated DefineButtonSoundTag?
Referenced by gnash::SWF::DefineButtonSoundTag::loader().
|
static |
Load a DefineButtonTag.
References _, gnash::movie_definition::addDisplayObject(), gnash::SWF::DEFINEBUTTON, gnash::SWFStream::ensureBytes(), IF_VERBOSE_PARSE, gnash::log_parse(), and gnash::SWFStream::read_u16().
Referenced by gnash::SWF::addDefaultLoaders().
|
inline |
Whether to track this button as a menu.
|
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::key::_1, gnash::renderer::opengl::for_each(), and gnash::SWF::ButtonAction::getKeyCode().
|
friend |
DefineButton2Tag::loader also needs to create a DefineButtonTag.
1.8.11