Gnash  0.8.11dev
Public Types | Public Member Functions | List of all members
gnash::event_id Class Reference

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. More...
 
 event_id (EventCode id, key::code c=key::INVALID)
 Construct an event_id. More...
 
void setKeyCode (std::uint8_t SWFkey)
 Set the key associated with this event. More...
 
const std::string & functionName () const
 
const ObjectURIfunctionURI () const
 
key::code keyCode () const
 Return the keycode associated with this event_id. More...
 
EventCode id () const
 Return the identifier for this event type. More...
 

Detailed Description

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.

Member Enumeration Documentation

§ EventCode

The types of events that are handled by DisplayObjects.

Enumerator
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 

Constructor & Destructor Documentation

§ event_id() [1/2]

gnash::event_id::event_id ( )
inline

Construct an invalid event_id.

This is not useful until its values have been set.

§ event_id() [2/2]

gnash::event_id::event_id ( EventCode  id,
key::code  c = key::INVALID 
)
inlineexplicit

Construct an event_id.

Parameters
idThe type of event
cThe key associated with an event (only if this is a keyboard event).

Member Function Documentation

§ functionName()

const std::string & gnash::event_id::functionName ( ) const

§ functionURI()

const ObjectURI & gnash::event_id::functionURI ( ) const

§ id()

EventCode gnash::event_id::id ( ) const
inline

§ keyCode()

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::operator<(), gnash::operator==(), and gnash::SWF::ButtonAction::triggeredBy().

§ setKeyCode()

void gnash::event_id::setKeyCode ( std::uint8_t  SWFkey)
inline

Set the key associated with this event.

Parameters
SWFKeyThe SWF code matched to the event. This must be converted to a unique gnash::key::code.

References gnash::key::codeMap, functionName(), functionURI(), gnash::key::i, gnash::key::INVALID, gnash::key::KEYCOUNT, and gnash::key::SWF.


The documentation for this class was generated from the following files: