Gnash  0.8.10
Public Types | Public Member Functions
gnash::event_id Class Reference

A class to identify 'static' SWF events (system events). More...

#include <event_id.h>

List of all members.

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 ObjectURIfunctionURI () const
key::code keyCode () const
 Return the keycode associated with this event_id.
EventCode id () const
 Return the identifier for this event type.

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

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

gnash::event_id::event_id ( ) [inline]

Construct an invalid event_id.

This is not useful until its values have been set.

gnash::event_id::event_id ( EventCode  id,
key::code  c = key::INVALID 
) [inline, explicit]

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

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
EventCode gnash::event_id::id ( ) const [inline]
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.

Parameters:
SWFKeyThe 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.


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