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.
bool operator== (const event_id &id) const
 Return whether two event_ids are equal.
bool operator< (const event_id &id) const
 Comparator for use in stdlib containers.
const std::string & functionName () const
string_table::key functionKey () 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]

Construct an event_id.

Parameters:
id The type of event
c The key associated with an event (only if this is a keyboard event).

Member Function Documentation

string_table::key gnash::event_id::functionKey (  )  const
const std::string & gnash::event_id::functionName (  )  const

Return the name of a method-handler function corresponding to this event.

References DATA, DRAG_OVER, gnash::key::e, ENTER_FRAME, INVALID, KEY_DOWN, KEY_PRESS, LOAD, MOUSE_UP, RELEASE, and ROLL_OVER.

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

Return the identifier for this event type.

Referenced by gnash::Button::mouseEvent(), gnash::TextField::notifyEvent(), and gnash::SWF::ButtonAction::triggeredBy().

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

bool gnash::event_id::operator< ( const event_id id  )  const [inline]

Comparator for use in stdlib containers.

bool gnash::event_id::operator== ( const event_id id  )  const [inline]

Return whether two event_ids are equal.

event_ids are equal if both id and keycode match. Keycode is only relevant for keyboard events, and must be key::INVALID for other event types.

void gnash::event_id::setKeyCode ( boost::uint8_t  SWFkey  )  [inline]

Set the key associated with this event.

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

References gnash::key::codeMap, gnash::key::i, gnash::key::KEYCOUNT, and gnash::key::SWF.


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