Castor3D 0.12.0
Multiplatform 3D engine
Public Types | Protected Types | List of all members
castor3d::EventHandler Class Referenceabstract

#include <EventHandler.hpp>

Inheritance diagram for castor3d::EventHandler:
Inheritance graph
[legend]
Collaboration diagram for castor3d::EventHandler:
Collaboration graph
[legend]

Public Types

using ClientMouseFunction = std::function< void(MouseEvent const &) >
 
using ClientKeyboardFunction = std::function< void(KeyboardEvent const &) >
 
using ClientHandlerFunction = std::function< void(HandlerEvent const &) >
 
using OnClientMouseEvent = castor::SignalT< ClientMouseFunction >
 
using OnClientKeyboardEvent = castor::SignalT< ClientKeyboardFunction >
 
using OnClientHandlerEvent = castor::SignalT< ClientHandlerFunction >
 
using OnClientMouseEventConnection = OnClientMouseEvent::connection
 
using OnClientKeyboardEventConnection = OnClientKeyboardEvent::connection
 
using OnClientHandlerEventConnection = OnClientHandlerEvent::connection
 

Public Member Functions

General
 EventHandler (bool catchMouseEvents)
 
virtual ~EventHandler ()
 
void processEvents ()
 
Mouse events
void pushEvent (MouseEvent const &event)
 
void connect (MouseEventType event, ClientMouseFunction function)
 

Protected Types

using EventHandlerFunction = std::function< void() >
 
using EventQueue = std::deque< std::pair< UserInputEventSPtr, EventHandlerFunction > >
 

Keyboard events

std::array< OnClientMouseEvent, size_t(MouseEventType::eCount) > m_mouseSlots
 
std::array< std::vector< OnClientMouseEventConnection >, size_t(MouseEventType::eCount) > m_mouseSlotsConnections
 
std::array< OnClientKeyboardEvent, size_t(KeyboardEventType::eCount) > m_keyboardSlots
 
std::array< std::vector< OnClientKeyboardEventConnection >, size_t(KeyboardEventType::eCount) > m_keyboardSlotsConnections
 
std::array< OnClientHandlerEvent, size_t(HandlerEventType::eCount) > m_handlerSlots
 
std::array< std::vector< OnClientHandlerEventConnection >, size_t(HandlerEventType::eCount) > m_handlerSlotsConnections
 
void pushEvent (KeyboardEvent const &event)
 
void connect (KeyboardEventType event, ClientKeyboardFunction function)
 
bool catchesMouseEvents () const
 
void setCatchesMouseEvents (bool value)
 
void pushEvent (HandlerEvent const &event)
 
void connect (HandlerEventType event, ClientHandlerFunction function)
 
bool catchesTabKey () const
 
bool catchesReturnKey () const
 
void processMouseEvent (MouseEventSPtr event)
 
void processKeyboardEvent (KeyboardEventSPtr event)
 
void processHandlerEvent (HandlerEventSPtr event)
 

Member Typedef Documentation

◆ ClientHandlerFunction

using castor3d::EventHandler::ClientHandlerFunction = std::function< void( HandlerEvent const & ) >

Catcher definition for handler events.

◆ ClientKeyboardFunction

using castor3d::EventHandler::ClientKeyboardFunction = std::function< void( KeyboardEvent const & ) >

Catcher definition for keyboard events.

◆ ClientMouseFunction

using castor3d::EventHandler::ClientMouseFunction = std::function< void( MouseEvent const & ) >

Catcher definition for mouse events.

◆ EventHandlerFunction

using castor3d::EventHandler::EventHandlerFunction = std::function< void() >
protected

◆ EventQueue

using castor3d::EventHandler::EventQueue = std::deque< std::pair< UserInputEventSPtr, EventHandlerFunction > >
protected

◆ OnClientHandlerEvent

Handler event signal definition.

◆ OnClientHandlerEventConnection

using castor3d::EventHandler::OnClientHandlerEventConnection = OnClientHandlerEvent::connection

Handler event signal connection definition.

◆ OnClientKeyboardEvent

Keyboard event signal definition.

◆ OnClientKeyboardEventConnection

using castor3d::EventHandler::OnClientKeyboardEventConnection = OnClientKeyboardEvent::connection

Keyboard event signal connection definition.

◆ OnClientMouseEvent

Mouse event signal definition.

◆ OnClientMouseEventConnection

using castor3d::EventHandler::OnClientMouseEventConnection = OnClientMouseEvent::connection

Mouse event signal connection definition.

Constructor & Destructor Documentation

◆ EventHandler()

castor3d::EventHandler::EventHandler ( bool  catchMouseEvents)
inlineexplicit

◆ ~EventHandler()

virtual castor3d::EventHandler::~EventHandler ( )
inlinevirtual

Member Function Documentation

◆ catchesMouseEvents()

bool castor3d::EventHandler::catchesMouseEvents ( ) const
inline

◆ catchesReturnKey()

bool castor3d::EventHandler::catchesReturnKey ( ) const
inline

◆ catchesTabKey()

bool castor3d::EventHandler::catchesTabKey ( ) const
inline

◆ connect() [1/3]

void castor3d::EventHandler::connect ( HandlerEventType  event,
ClientHandlerFunction  function 
)
inline

References connect(), m_handlerSlots, and m_handlerSlotsConnections.

Here is the call graph for this function:

◆ connect() [2/3]

void castor3d::EventHandler::connect ( KeyboardEventType  event,
ClientKeyboardFunction  function 
)
inline

References connect(), m_keyboardSlots, and m_keyboardSlotsConnections.

Here is the call graph for this function:

◆ connect() [3/3]

void castor3d::EventHandler::connect ( MouseEventType  event,
ClientMouseFunction  function 
)
inline

References connect(), m_mouseSlots, and m_mouseSlotsConnections.

Referenced by connect(), and castor3d::NonClientEventHandler< Derived >::connectNC().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ processEvents()

void castor3d::EventHandler::processEvents ( )
inline

◆ processHandlerEvent()

void castor3d::EventHandler::processHandlerEvent ( HandlerEventSPtr  event)
inlineprotected

References m_handlerSlots.

Referenced by pushEvent().

Here is the caller graph for this function:

◆ processKeyboardEvent()

void castor3d::EventHandler::processKeyboardEvent ( KeyboardEventSPtr  event)
inlineprotected

References m_keyboardSlots.

Referenced by pushEvent().

Here is the caller graph for this function:

◆ processMouseEvent()

void castor3d::EventHandler::processMouseEvent ( MouseEventSPtr  event)
inlineprotected

References m_mouseSlots.

Referenced by pushEvent().

Here is the caller graph for this function:

◆ pushEvent() [1/3]

void castor3d::EventHandler::pushEvent ( HandlerEvent const &  event)
inline

References processHandlerEvent().

Here is the call graph for this function:

◆ pushEvent() [2/3]

void castor3d::EventHandler::pushEvent ( KeyboardEvent const &  event)
inline

References processKeyboardEvent().

Here is the call graph for this function:

◆ pushEvent() [3/3]

void castor3d::EventHandler::pushEvent ( MouseEvent const &  event)
inline

References processMouseEvent().

Here is the call graph for this function:

◆ setCatchesMouseEvents()

void castor3d::EventHandler::setCatchesMouseEvents ( bool  value)
inline

Member Data Documentation

◆ m_handlerSlots

std::array< OnClientHandlerEvent, size_t( HandlerEventType::eCount ) > castor3d::EventHandler::m_handlerSlots
protected

The keyboard events slots.

Referenced by connect(), and processHandlerEvent().

◆ m_handlerSlotsConnections

std::array< std::vector< OnClientHandlerEventConnection >, size_t( HandlerEventType::eCount ) > castor3d::EventHandler::m_handlerSlotsConnections
protected

The handler events slots connections.

Referenced by connect().

◆ m_keyboardSlots

std::array< OnClientKeyboardEvent, size_t( KeyboardEventType::eCount ) > castor3d::EventHandler::m_keyboardSlots
protected

The keyboard events slots.

Referenced by connect(), and processKeyboardEvent().

◆ m_keyboardSlotsConnections

std::array< std::vector< OnClientKeyboardEventConnection >, size_t( KeyboardEventType::eCount ) > castor3d::EventHandler::m_keyboardSlotsConnections
protected

The handler events slots connections.

Referenced by connect().

◆ m_mouseSlots

std::array< OnClientMouseEvent, size_t( MouseEventType::eCount ) > castor3d::EventHandler::m_mouseSlots
protected

The mouse events slots.

Referenced by connect(), and processMouseEvent().

◆ m_mouseSlotsConnections

std::array< std::vector< OnClientMouseEventConnection >, size_t( MouseEventType::eCount ) > castor3d::EventHandler::m_mouseSlotsConnections
protected

The mouse events slots connections.

Referenced by connect().


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