![]() |
Public API Reference |
Base implementation of a generic event handler. More...
#include <csutil/csbaseeventh.h>
Classes | |
| class | EventHandlerImpl |
| Actual iEventHandler implementation. More... | |
Public Member Functions | |
| void | Initialize (iObjectRegistry *registry) |
| Perform basic initialization. | |
| bool | RegisterQueue (iObjectRegistry *registry, csEventID name) |
| Register the event handler with the event queue registered with the object registry. | |
| bool | RegisterQueue (iObjectRegistry *registry, csEventID names[]) |
| Register the event handler with the event queue registered with the object registry. | |
| bool | RegisterQueue (iEventQueue *queue, csEventID name) |
| Register the event handler with an event queue. | |
| bool | RegisterQueue (iEventQueue *queue, csEventID names[]) |
| Register the event handler with an event queue. | |
| void | UnregisterQueue () |
| Unregister the event handler with the event queue that it is currently registered with. | |
| virtual | ~csBaseEventHandler () |
| Destructor. | |
Protected Member Functions | |
| csBaseEventHandler () | |
| Constructor. | |
| virtual void | Frame () |
| Invoked by the handler for the crystalspace.frame event. | |
| virtual const char * | GenericName () const |
| Override this if you want to refer to your csBaseEventHandler derived event handler as anything besides "application" for purposes of event subscription scheduling. | |
| virtual const csHandlerID * | GenericPrec (csRef< iEventHandlerRegistry > &, csRef< iEventNameRegistry > &, csEventID) const |
| Override this if you want to force some modules to always handle some events before csBaseEventHandler. | |
| virtual const csHandlerID * | GenericSucc (csRef< iEventHandlerRegistry > &, csRef< iEventNameRegistry > &, csEventID) const |
| Override this if you want to force some modules to always handle some events after csBaseEventHandler. | |
| virtual bool | HandleEvent (iEvent &event) |
| Implementation of the event handling mechanism. | |
| virtual const csHandlerID * | InstancePrec (csRef< iEventHandlerRegistry > &, csRef< iEventNameRegistry > &, csEventID) const |
| Override this if you want to force some modules to always handle some events before this instance of csBaseEventHandler. | |
| virtual const csHandlerID * | InstanceSucc (csRef< iEventHandlerRegistry > &, csRef< iEventNameRegistry > &, csEventID) const |
| Override this if you want to force some modules to always handle some events before this instance of csBaseEventHandler. | |
| virtual bool | OnJoystickDown (iEvent &event) |
| Invoked by the event handler when a joystick button down event is received. | |
| virtual bool | OnJoystickMove (iEvent &event) |
| Invoked by the event handler when a joystick movement event is received. | |
| virtual bool | OnJoystickUp (iEvent &event) |
| Invoked by the event handler when a joystick button up event is received. | |
| virtual bool | OnKeyboard (iEvent &event) |
| Invoked by the event handler when a keyboard event is received. | |
| virtual bool | OnMouseClick (iEvent &event) |
| Invoked by the event handler when a mouse button click event is received. | |
| virtual bool | OnMouseDoubleClick (iEvent &event) |
| Invoked by the event handler when a mouse button double-click event is received. | |
| virtual bool | OnMouseDown (iEvent &event) |
| Invoked by the event handler when a mouse down event is received. | |
| virtual bool | OnMouseMove (iEvent &event) |
| Invoked by the event handler when a mouse move event is received. | |
| virtual bool | OnMouseUp (iEvent &event) |
| Invoked by the event handler when a mouse up event is received. | |
| virtual bool | OnUnhandledEvent (iEvent &event) |
| Invoked by the event handler when an unknown event is received. | |
Base implementation of a generic event handler.
OnFoo() trigger methods you are interested in processing. On... trigger function. Definition at line 58 of file csbaseeventh.h.
| csBaseEventHandler::csBaseEventHandler | ( | ) | [protected] |
Constructor.
| virtual csBaseEventHandler::~csBaseEventHandler | ( | ) | [virtual] |
Destructor.
| virtual void csBaseEventHandler::Frame | ( | ) | [protected, virtual] |
Invoked by the handler for the crystalspace.frame event.
Reimplemented in CS::Utility::DemoApplication.
| virtual const char* csBaseEventHandler::GenericName | ( | ) | const [inline, protected, virtual] |
Override this if you want to refer to your csBaseEventHandler derived event handler as anything besides "application" for purposes of event subscription scheduling.
Definition at line 221 of file csbaseeventh.h.
| virtual const csHandlerID* csBaseEventHandler::GenericPrec | ( | csRef< iEventHandlerRegistry > & | , |
| csRef< iEventNameRegistry > & | , | ||
| csEventID | |||
| ) | const [inline, protected, virtual] |
Override this if you want to force some modules to always handle some events before csBaseEventHandler.
Definition at line 234 of file csbaseeventh.h.
| virtual const csHandlerID* csBaseEventHandler::GenericSucc | ( | csRef< iEventHandlerRegistry > & | , |
| csRef< iEventNameRegistry > & | , | ||
| csEventID | |||
| ) | const [inline, protected, virtual] |
Override this if you want to force some modules to always handle some events after csBaseEventHandler.
Definition at line 243 of file csbaseeventh.h.
| virtual bool csBaseEventHandler::HandleEvent | ( | iEvent & | event | ) | [protected, virtual] |
Implementation of the event handling mechanism.
This low-level method examines the event dispatches it to the appropriate OnFoo() or FooFrame() method.
| void csBaseEventHandler::Initialize | ( | iObjectRegistry * | registry | ) |
Perform basic initialization.
This function MUST be called before invoking any of the RegisterQueue() methods.
| virtual const csHandlerID* csBaseEventHandler::InstancePrec | ( | csRef< iEventHandlerRegistry > & | , |
| csRef< iEventNameRegistry > & | , | ||
| csEventID | |||
| ) | const [inline, protected, virtual] |
Override this if you want to force some modules to always handle some events before this instance of csBaseEventHandler.
Definition at line 252 of file csbaseeventh.h.
| virtual const csHandlerID* csBaseEventHandler::InstanceSucc | ( | csRef< iEventHandlerRegistry > & | , |
| csRef< iEventNameRegistry > & | , | ||
| csEventID | |||
| ) | const [inline, protected, virtual] |
Override this if you want to force some modules to always handle some events before this instance of csBaseEventHandler.
Definition at line 261 of file csbaseeventh.h.
| virtual bool csBaseEventHandler::OnJoystickDown | ( | iEvent & | event | ) | [protected, virtual] |
Invoked by the event handler when a joystick button down event is received.
| virtual bool csBaseEventHandler::OnJoystickMove | ( | iEvent & | event | ) | [protected, virtual] |
Invoked by the event handler when a joystick movement event is received.
| virtual bool csBaseEventHandler::OnJoystickUp | ( | iEvent & | event | ) | [protected, virtual] |
Invoked by the event handler when a joystick button up event is received.
| virtual bool csBaseEventHandler::OnKeyboard | ( | iEvent & | event | ) | [protected, virtual] |
Invoked by the event handler when a keyboard event is received.
Reimplemented in CS::Utility::DemoApplication.
| virtual bool csBaseEventHandler::OnMouseClick | ( | iEvent & | event | ) | [protected, virtual] |
Invoked by the event handler when a mouse button click event is received.
| virtual bool csBaseEventHandler::OnMouseDoubleClick | ( | iEvent & | event | ) | [protected, virtual] |
Invoked by the event handler when a mouse button double-click event is received.
| virtual bool csBaseEventHandler::OnMouseDown | ( | iEvent & | event | ) | [protected, virtual] |
Invoked by the event handler when a mouse down event is received.
| virtual bool csBaseEventHandler::OnMouseMove | ( | iEvent & | event | ) | [protected, virtual] |
Invoked by the event handler when a mouse move event is received.
Reimplemented in CS::Utility::DemoApplication.
| virtual bool csBaseEventHandler::OnMouseUp | ( | iEvent & | event | ) | [protected, virtual] |
Invoked by the event handler when a mouse up event is received.
| virtual bool csBaseEventHandler::OnUnhandledEvent | ( | iEvent & | event | ) | [protected, virtual] |
Invoked by the event handler when an unknown event is received.
| bool csBaseEventHandler::RegisterQueue | ( | iObjectRegistry * | registry, |
| csEventID | name | ||
| ) |
Register the event handler with the event queue registered with the object registry.
| registry | The application's object registry |
| name | An event name handle. May be a token from iutil/evdefs.h or the result of a call to csEventNameRegistry::GetID. |
| bool csBaseEventHandler::RegisterQueue | ( | iObjectRegistry * | registry, |
| csEventID | names[] | ||
| ) |
Register the event handler with the event queue registered with the object registry.
| registry | The application's object registry |
| names | An array of event name handles. Each may be a tokens from iutil/evdefs.h or the result of a call to csEventNameRegistry::GetID. List must be terminated with CS_EVENTLIST_END. |
| bool csBaseEventHandler::RegisterQueue | ( | iEventQueue * | queue, |
| csEventID | name | ||
| ) |
Register the event handler with an event queue.
| queue | The event queue to register with |
| name | An event name handle. May be a token from iutil/evdefs.h or the result of a call to csEventNameRegistry::GetID. |
| bool csBaseEventHandler::RegisterQueue | ( | iEventQueue * | queue, |
| csEventID | names[] | ||
| ) |
Register the event handler with an event queue.
| queue | The event queue to register with |
| names | An array of event name handles. Each may be a tokens from iutil/evdefs.h or the result of a call to csEventNameRegistry::GetID. List must be terminated with CS_EVENTLIST_END. |
| void csBaseEventHandler::UnregisterQueue | ( | ) |
Unregister the event handler with the event queue that it is currently registered with.