Castor3D 0.13.0
Multiplatform 3D engine
Types publics | Liste de tous les membres
Référence de la classe castor3d::UserInputListenerabstract

#include <UserInputListener.hpp>

Graphe d'héritage de castor3d::UserInputListener:
Inheritance graph
[légende]
Graphe de collaboration de castor3d::UserInputListener:
Collaboration graph
[légende]

Types publics

using OnClickActionFunction = std::function< void() >
 
using OnMouseMoveActionFunction = std::function< void(castor::Position const &) >
 
using OnSelectActionFunction = std::function< void(int) >
 
using OnTextActionFunction = std::function< void(castor::String const &) >
 

Fonctions membres publiques

Getters
castor::Position const & getMousePosition () const
 
EventHandlergetActiveControl () const
 
EventHandlergetFocusedControl () const
 
FrameListenergetFrameListener () const
 
Output events
C3D_API void registerMouseMoveAction (castor::String const &handler, OnMouseMoveActionFunction function)
 
C3D_API void registerClickAction (castor::String const &handler, OnClickActionFunction function)
 
C3D_API void registerSelectAction (castor::String const &handler, OnSelectActionFunction function)
 
C3D_API void registerTextAction (castor::String const &handler, OnTextActionFunction function)
 
C3D_API void unregisterMouseMoveAction (castor::String const &handler)
 
C3D_API void unregisterClickAction (castor::String const &handler)
 
C3D_API void unregisterSelectAction (castor::String const &handler)
 
C3D_API void unregisterTextAction (castor::String const &handler)
 
C3D_API void onMouseMoveAction (castor::String const &handler)
 
C3D_API void onClickAction (castor::String const &handler)
 
C3D_API void onSelectAction (castor::String const &handler, int index)
 
C3D_API void onTextAction (castor::String const &handler, castor::String const &text)
 
C3D_API void enableHandler (castor::String const &handler)
 
C3D_API void disableHandler (castor::String const &handler)
 
Mouse input events
C3D_API bool fireMouseMove (castor::Position const &position)
 
C3D_API bool fireMouseButtonPushed (MouseButton button)
 
C3D_API bool fireMouseButtonReleased (MouseButton button)
 
C3D_API bool fireMouseWheel (castor::Position const &offsets)
 

General

std::mutex m_mutexHandlers
 
std::vector< EventHandlerSPtr > m_handlers
 
FrameListenerSPtr m_frameListener
 
C3D_API UserInputListener (Engine &engine, castor::String const &name)
 
virtual C3D_API ~UserInputListener ()
 
C3D_API bool initialise ()
 
C3D_API void cleanup ()
 
C3D_API void processEvents ()
 

Keyboard input events

C3D_API bool fireKeydown (KeyboardKey key, bool ctrl, bool alt, bool shift)
 
C3D_API bool fireKeyUp (KeyboardKey key, bool ctrl, bool alt, bool shift)
 
C3D_API bool fireChar (KeyboardKey key, castor::String const &c)
 
std::vector< EventHandlerSPtr > doGetHandlers () const
 
bool doHasHandlers () const
 
void doAddHandler (EventHandlerSPtr handler)
 
void doRemoveHandler (EventHandler const &handler)
 

Documentation des définitions de type membres

◆ OnClickActionFunction

using castor3d::UserInputListener::OnClickActionFunction = std::function< void() >

◆ OnMouseMoveActionFunction

using castor3d::UserInputListener::OnMouseMoveActionFunction = std::function< void( castor::Position const & ) >

◆ OnSelectActionFunction

using castor3d::UserInputListener::OnSelectActionFunction = std::function< void( int ) >

◆ OnTextActionFunction

using castor3d::UserInputListener::OnTextActionFunction = std::function< void( castor::String const & ) >

Documentation des constructeurs et destructeur

◆ UserInputListener()

C3D_API castor3d::UserInputListener::UserInputListener ( Engine engine,
castor::String const &  name 
)

◆ ~UserInputListener()

virtual C3D_API castor3d::UserInputListener::~UserInputListener ( )
virtual

Documentation des fonctions membres

◆ cleanup()

C3D_API void castor3d::UserInputListener::cleanup ( )

◆ disableHandler()

C3D_API void castor3d::UserInputListener::disableHandler ( castor::String const &  handler)

◆ doAddHandler()

void castor3d::UserInputListener::doAddHandler ( EventHandlerSPtr  handler)
inlineprotected

Références m_handlers, et m_mutexHandlers.

◆ doGetHandlers()

std::vector< EventHandlerSPtr > castor3d::UserInputListener::doGetHandlers ( ) const
inlineprotected
Renvoie
Les gestionnaires, de manière thread-safe.

Références m_handlers, et m_mutexHandlers.

◆ doHasHandlers()

bool castor3d::UserInputListener::doHasHandlers ( ) const
inlineprotected
Renvoie
true s'il y a des gestionnaires.

Références m_handlers, et m_mutexHandlers.

◆ doRemoveHandler()

void castor3d::UserInputListener::doRemoveHandler ( EventHandler const &  handler)
inlineprotected

Références m_handlers, et m_mutexHandlers.

◆ enableHandler()

C3D_API void castor3d::UserInputListener::enableHandler ( castor::String const &  handler)

◆ fireChar()

C3D_API bool castor3d::UserInputListener::fireChar ( KeyboardKey  key,
castor::String const &  c 
)

◆ fireKeydown()

C3D_API bool castor3d::UserInputListener::fireKeydown ( KeyboardKey  key,
bool  ctrl,
bool  alt,
bool  shift 
)

◆ fireKeyUp()

C3D_API bool castor3d::UserInputListener::fireKeyUp ( KeyboardKey  key,
bool  ctrl,
bool  alt,
bool  shift 
)

◆ fireMouseButtonPushed()

C3D_API bool castor3d::UserInputListener::fireMouseButtonPushed ( MouseButton  button)

◆ fireMouseButtonReleased()

C3D_API bool castor3d::UserInputListener::fireMouseButtonReleased ( MouseButton  button)

◆ fireMouseMove()

C3D_API bool castor3d::UserInputListener::fireMouseMove ( castor::Position const &  position)

◆ fireMouseWheel()

C3D_API bool castor3d::UserInputListener::fireMouseWheel ( castor::Position const &  offsets)

◆ getActiveControl()

EventHandler * castor3d::UserInputListener::getActiveControl ( ) const
inline

◆ getFocusedControl()

EventHandler * castor3d::UserInputListener::getFocusedControl ( ) const
inline

◆ getFrameListener()

FrameListener & castor3d::UserInputListener::getFrameListener ( ) const
inline

Références m_frameListener.

◆ getMousePosition()

castor::Position const & castor3d::UserInputListener::getMousePosition ( ) const
inline

◆ initialise()

C3D_API bool castor3d::UserInputListener::initialise ( )

◆ onClickAction()

C3D_API void castor3d::UserInputListener::onClickAction ( castor::String const &  handler)

◆ onMouseMoveAction()

C3D_API void castor3d::UserInputListener::onMouseMoveAction ( castor::String const &  handler)

◆ onSelectAction()

C3D_API void castor3d::UserInputListener::onSelectAction ( castor::String const &  handler,
int  index 
)

◆ onTextAction()

C3D_API void castor3d::UserInputListener::onTextAction ( castor::String const &  handler,
castor::String const &  text 
)

◆ processEvents()

C3D_API void castor3d::UserInputListener::processEvents ( )

◆ registerClickAction()

C3D_API void castor3d::UserInputListener::registerClickAction ( castor::String const &  handler,
OnClickActionFunction  function 
)

◆ registerMouseMoveAction()

C3D_API void castor3d::UserInputListener::registerMouseMoveAction ( castor::String const &  handler,
OnMouseMoveActionFunction  function 
)

◆ registerSelectAction()

C3D_API void castor3d::UserInputListener::registerSelectAction ( castor::String const &  handler,
OnSelectActionFunction  function 
)

◆ registerTextAction()

C3D_API void castor3d::UserInputListener::registerTextAction ( castor::String const &  handler,
OnTextActionFunction  function 
)

◆ unregisterClickAction()

C3D_API void castor3d::UserInputListener::unregisterClickAction ( castor::String const &  handler)

◆ unregisterMouseMoveAction()

C3D_API void castor3d::UserInputListener::unregisterMouseMoveAction ( castor::String const &  handler)

◆ unregisterSelectAction()

C3D_API void castor3d::UserInputListener::unregisterSelectAction ( castor::String const &  handler)

◆ unregisterTextAction()

C3D_API void castor3d::UserInputListener::unregisterTextAction ( castor::String const &  handler)

Documentation des données membres

◆ m_frameListener

FrameListenerSPtr castor3d::UserInputListener::m_frameListener
protected

Le frame listener associé.

Référencé par getFrameListener().

◆ m_handlers

std::vector< EventHandlerSPtr > castor3d::UserInputListener::m_handlers
protected

Le tableau de gestionnaires.

Référencé par doAddHandler(), doGetHandlers(), doHasHandlers(), et doRemoveHandler().

◆ m_mutexHandlers

std::mutex castor3d::UserInputListener::m_mutexHandlers
mutableprotected

Le mutex de protection du tableau de gestionnaires.

Référencé par doAddHandler(), doGetHandlers(), doHasHandlers(), et doRemoveHandler().


La documentation de cette classe a été générée à partir du fichier suivant :