Gnash
0.8.10
|
A class to identify 'static' SWF events (system events). More...
#include <event_id.h>
Public Types | |
enum | EventCode { INVALID, PRESS, RELEASE, RELEASE_OUTSIDE, ROLL_OVER, ROLL_OUT, DRAG_OVER, DRAG_OUT, KEY_PRESS, INITIALIZE, LOAD, UNLOAD, ENTER_FRAME, MOUSE_DOWN, MOUSE_UP, MOUSE_MOVE, KEY_DOWN, KEY_UP, DATA, CONSTRUCT } |
The types of events that are handled by DisplayObjects. More... | |
Public Member Functions | |
event_id () | |
Construct an invalid event_id. | |
event_id (EventCode id, key::code c=key::INVALID) | |
Construct an event_id. | |
void | setKeyCode (boost::uint8_t SWFkey) |
Set the key associated with this event. | |
const std::string & | functionName () const |
const ObjectURI & | functionURI () const |
key::code | keyCode () const |
Return the keycode associated with this event_id. | |
EventCode | id () const |
Return the identifier for this event type. |
A class to identify 'static' SWF events (system events).
The event process in a SWF comprises the raising of the event itself and its receipt by a handler. Events may be either dynamically or statically defined. A dynamic event is handled in ActionScript: an AS-defined function is called when the event is raised. Dynamic events do not need event_id. Event handlers may also be defined statically, for instance in a PlaceObject2 tag, or by default. System events such as mouse handling, load milestones, or keyboard events should be sent to appropriate DisplayObjects. This process uses event_id. Static events may additionally be handled dynamically (using ActionScript). The event_id class is used as an identifier for actual events and and for the signature of an expected event.
gnash::event_id::event_id | ( | ) | [inline] |
Construct an invalid event_id.
This is not useful until its values have been set.
Construct an event_id.
id | The type of event |
c | The key associated with an event (only if this is a keyboard event). |
const std::string & gnash::event_id::functionName | ( | ) | const |
Return the name of a method-handler function corresponding to this event.
References gnash::key::e, INVALID, PRESS, RELEASE, RELEASE_OUTSIDE, ROLL_OVER, ROLL_OUT, DRAG_OVER, DRAG_OUT, KEY_PRESS, INITIALIZE, LOAD, UNLOAD, ENTER_FRAME, MOUSE_DOWN, MOUSE_UP, MOUSE_MOVE, KEY_DOWN, KEY_UP, DATA, CONSTRUCT, and assert.
Referenced by gnash::operator<<().
const ObjectURI & gnash::event_id::functionURI | ( | ) | const |
Return the ObjectURI of a method-handler function corresponding to this event.
References gnash::key::e, PRESS, gnash::NSV::PROP_ON_PRESS, RELEASE, gnash::NSV::PROP_ON_RELEASE, RELEASE_OUTSIDE, gnash::NSV::PROP_ON_RELEASE_OUTSIDE, ROLL_OVER, gnash::NSV::PROP_ON_ROLL_OVER, ROLL_OUT, gnash::NSV::PROP_ON_ROLL_OUT, DRAG_OVER, gnash::NSV::PROP_ON_DRAG_OVER, DRAG_OUT, gnash::NSV::PROP_ON_DRAG_OUT, KEY_PRESS, gnash::NSV::PROP_ON_KEY_PRESS, INITIALIZE, gnash::NSV::PROP_ON_INITIALIZE, LOAD, gnash::NSV::PROP_ON_LOAD, UNLOAD, gnash::NSV::PROP_ON_UNLOAD, ENTER_FRAME, gnash::NSV::PROP_ON_ENTER_FRAME, MOUSE_DOWN, gnash::NSV::PROP_ON_MOUSE_DOWN, MOUSE_UP, gnash::NSV::PROP_ON_MOUSE_UP, MOUSE_MOVE, gnash::NSV::PROP_ON_MOUSE_MOVE, KEY_DOWN, gnash::NSV::PROP_ON_KEY_DOWN, KEY_UP, gnash::NSV::PROP_ON_KEY_UP, DATA, gnash::NSV::PROP_ON_DATA, CONSTRUCT, gnash::NSV::PROP_ON_CONSTRUCT, and assert.
Referenced by gnash::Button::mouseEvent().
EventCode gnash::event_id::id | ( | ) | const [inline] |
Return the identifier for this event type.
Referenced by gnash::Button::mouseEvent(), gnash::SWF::ButtonAction::triggeredBy(), gnash::isKeyEvent(), gnash::isButtonEvent(), and gnash::TextField::mouseEvent().
key::code gnash::event_id::keyCode | ( | ) | const [inline] |
Return the keycode associated with this event_id.
This should be key::INVALID if the event_id is not a keyboard event.
Referenced by gnash::SWF::ButtonAction::triggeredBy().
void gnash::event_id::setKeyCode | ( | boost::uint8_t | SWFkey | ) | [inline] |
Set the key associated with this event.
SWFKey | The SWF code matched to the event. This must be converted to a unique gnash::key::code. |
References gnash::key::i, gnash::key::codeMap, gnash::key::SWF, gnash::key::KEYCOUNT, and INVALID.