Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

EventHandler Class Reference

#include <eventHandler.h>

Inheritance diagram for EventHandler:

TypedObject List of all members.

Public Types

typedef void EventFunction (CPT_Event)
typedef void EventCallbackFunction (CPT(Event), void *)

Public Member Functions

void process_events ()
virtual void dispatch_event (const CPT_Event &event)
void write (ostream &out) const
bool add_hook (const string &event_name, EventFunction *function)
bool add_hook (const string &event_name, EventCallbackFunction *function, void *)
bool remove_hook (const string &event_name, EventFunction *function)
bool remove_hook (const string &event_name, EventCallbackFunction *function, void *)
void remove_all_hooks ()
virtual TypeHandle get_type () const
virtual TypeHandle force_init_type ()

Static Public Member Functions

TypeHandle get_class_type ()
void init_type ()

Public Attributes

PUBLISHED __pad0__: EventHandler(EventQueue *queue)

Protected Types

typedef pset< EventFunction * > Functions
typedef pmap< string, FunctionsHooks
typedef pair< EventCallbackFunction *,
void * > 
CallbackFunction
typedef pset< CallbackFunctionCallbackFunctions
typedef pmap< string, CallbackFunctionsCallbackHooks

Protected Attributes

Hooks _hooks
CallbackHooks _cbhooks
EventQueue_queue

Private Member Functions

void write_hook (ostream &out, const Hooks::value_type &hook) const
void write_cbhook (ostream &out, const CallbackHooks::value_type &hook) const

Static Private Attributes

TypeHandle _type_handle

Member Typedef Documentation

typedef pair<EventCallbackFunction*, void*> EventHandler::CallbackFunction [protected]
 

Definition at line 73 of file eventHandler.h.

Referenced by add_hook(), and remove_hook().

typedef pset<CallbackFunction> EventHandler::CallbackFunctions [protected]
 

Definition at line 74 of file eventHandler.h.

Referenced by dispatch_event().

typedef pmap<string, CallbackFunctions> EventHandler::CallbackHooks [protected]
 

Definition at line 75 of file eventHandler.h.

typedef void EventHandler::EventCallbackFunction(CPT(Event), void*)
 

Definition at line 48 of file eventHandler.h.

typedef void EventHandler::EventFunction(CPT_Event)
 

Definition at line 47 of file eventHandler.h.

typedef pset<EventFunction *> EventHandler::Functions [protected]
 

Definition at line 71 of file eventHandler.h.

Referenced by dispatch_event().

typedef pmap<string, Functions> EventHandler::Hooks [protected]
 

Definition at line 72 of file eventHandler.h.


Member Function Documentation

bool EventHandler::add_hook const string &  event_name,
EventCallbackFunction function,
void * 
 

Definition at line 165 of file eventHandler.cxx.

References _cbhooks, CallbackFunction, and data.

bool EventHandler::add_hook const string &  event_name,
EventFunction function
 

Definition at line 146 of file eventHandler.cxx.

References _hooks.

Referenced by demo_keys(), PandaFramework::do_enable_default_keys(), event_add_particles(), herc_keys(), loader_keys(), main(), min_shader_keys(), motion_keys(), panda_keys(), AutonomousLerp::resume(), shader_keys(), AutonomousLerp::start(), and text_keys().

void EventHandler::dispatch_event const CPT_Event event  )  [virtual]
 

Definition at line 56 of file eventHandler.cxx.

References _cbhooks, _hooks, CallbackFunctions, and Functions.

Referenced by process_events().

virtual TypeHandle EventHandler::force_init_type void   )  [inline, virtual]
 

Implements TypedObject.

Definition at line 98 of file eventHandler.h.

References TypedObject::get_class_type(), and TypedObject::init_type().

TypeHandle EventHandler::get_class_type void   )  [inline, static]
 

Reimplemented from TypedObject.

Definition at line 87 of file eventHandler.h.

virtual TypeHandle EventHandler::get_type void   )  const [inline, virtual]
 

Implements TypedObject.

Definition at line 95 of file eventHandler.h.

References TypedObject::get_class_type().

void EventHandler::init_type void   )  [inline, static]
 

Reimplemented from TypedObject.

Definition at line 90 of file eventHandler.h.

References TypedObject::get_class_type(), TypedObject::init_type(), and register_type().

Referenced by ConfigureFn().

void EventHandler::process_events  ) 
 

Definition at line 43 of file eventHandler.cxx.

References _queue, EventQueue::dequeue_event(), dispatch_event(), and EventQueue::is_queue_empty().

Referenced by PandaFramework::do_frame().

void EventHandler::remove_all_hooks  ) 
 

Definition at line 205 of file eventHandler.cxx.

References _cbhooks, and _hooks.

Referenced by PandaFramework::close_framework().

bool EventHandler::remove_hook const string &  event_name,
EventCallbackFunction function,
void * 
 

Definition at line 193 of file eventHandler.cxx.

References _cbhooks, CallbackFunction, and data.

bool EventHandler::remove_hook const string &  event_name,
EventFunction function
 

Definition at line 179 of file eventHandler.cxx.

References _hooks.

Referenced by AutonomousLerp::stop().

void EventHandler::write ostream &  out  )  const
 

Definition at line 99 of file eventHandler.cxx.

References _cbhooks, _hooks, write_cbhook(), and write_hook().

void EventHandler::write_cbhook ostream &  out,
const CallbackHooks::value_type &  hook
const [private]
 

Definition at line 229 of file eventHandler.cxx.

Referenced by write().

void EventHandler::write_hook ostream &  out,
const Hooks::value_type &  hook
const [private]
 

Definition at line 217 of file eventHandler.cxx.

Referenced by write().


Member Data Documentation

PUBLISHED EventHandler::__pad0__
 

Reimplemented from TypedObject.

Definition at line 51 of file eventHandler.h.

CallbackHooks EventHandler::_cbhooks [protected]
 

Definition at line 78 of file eventHandler.h.

Referenced by add_hook(), dispatch_event(), remove_all_hooks(), remove_hook(), and write().

Hooks EventHandler::_hooks [protected]
 

Definition at line 77 of file eventHandler.h.

Referenced by add_hook(), dispatch_event(), remove_all_hooks(), remove_hook(), and write().

EventQueue& EventHandler::_queue [protected]
 

Definition at line 79 of file eventHandler.h.

Referenced by process_events().

TypeHandle EventHandler::_type_handle [static, private]
 

Reimplemented from TypedObject.

Definition at line 23 of file eventHandler.cxx.


The documentation for this class was generated from the following files:
Generated on Fri Apr 18 00:12:15 2003 for Panda by doxygen1.3