25 #ifndef WUIVIEWEVENTHANDLER_H
26 #define WUIVIEWEVENTHANDLER_H
28 #include <boost/signals2/signal.hpp>
30 #include <osgGA/GUIEventAdapter>
31 #include <osgGA/GUIEventHandler>
33 #include "../common/math/linearAlgebra/WVectorFixed.h"
34 #include "../common/WLogger.h"
35 #include "WUIViewWidget.h"
70 bool handle(
const osgGA::GUIEventAdapter& ea, osgGA::GUIActionAdapter& );
90 typedef boost::signals2::signal< void ( GUIEvents::ScrollingMotion,
float,
float ) >
ScrollSignalType;
100 typedef boost::signals2::signal< void (
int,
unsigned int ) >
KeySignalType;
122 virtual void subscribePush( ButtonSignalType::slot_type slot );
140 virtual void subscribeDrag( DragSignalType::slot_type slot );
147 virtual void subscribeMove( MoveSignalType::slot_type slot );
229 virtual void subscribeUser( TriggerSignalType::slot_type slot );
275 virtual void handleKeydown(
int keyID,
unsigned int modKeyMask );
284 virtual void handleKeyup(
int keyID,
unsigned int modKeyMask );
299 virtual void handleResize(
int xPos,
int yPos,
int width,
int height );
308 virtual void handleScroll( GUIEvents::ScrollingMotion motion,
float deltaX,
float deltaY );
A fixed size matrix class.
An event handler for a custom widget which eases interaction with GUIEvents within your module.
virtual void handleKeyup(int keyID, unsigned int modKeyMask)
Called whenever the KEYUP event occurs.
TriggerSignalType m_sigQuitApplication
Signal used for notification of the QUIT_APPLICATION event.
DragSignalType m_sigDrag
Signal used for notification of the DRAG event.
virtual void handlePush(WVector2f mousePos, int button)
Called whenever the PUSH event occurs.
virtual void handleScroll(GUIEvents::ScrollingMotion motion, float deltaX, float deltaY)
Called whenever the SCROLL event occurs.
TriggerSignalType m_sigPenProximityLeave
Signal used for notification of the PEN_PROXIMITY_LEAVE event.
TriggerSignalType m_sigUser
Signal used for notification of the USER event.
virtual void handlePenPressure(float pressure)
Called whenever the PEN_PRESSURE event occurs.
boost::signals2::signal< void(void) > TriggerSignalType
Short hand type for signal signature of FRAME, PEN_PROXIMITY_ENTER, -LEAVE, CLOSE_WINDOW,...
virtual void subscribePenOrientation(PenOrientationSignalType::slot_type slot)
Registers a function slot to PEN_ORIENTATION events.
MoveSignalType m_sigMove
Signal used for notification of the MOVE event.
ButtonSignalType m_sigDoubleclick
Signal used for notification of the DOUBLECLICK event.
boost::signals2::signal< void(float) > PenPressureSignalType
Short hand type for signal signature of PEN_PRESSURE event.
boost::signals2::signal< void(const osg::Matrix) > PenOrientationSignalType
Short hand type for signal signature of PEN_ORIENTATION event.
virtual void subscribeMove(MoveSignalType::slot_type slot)
Registers a function slot to MOVE events.
WUIViewEventHandler(WUIViewWidget::SPtr widget)
Constructor.
virtual void handleQuitApplication()
Called whenever the QUIT_APPLICATION event occurs.
wlog::WStreamedLogger errorLog() const
Logger instance for comfortable error logging.
virtual void handlePenProximityEnter()
Called whenever the PEN_PROXIMITY_ENTER event occurs.
virtual void handlePenProximityLeave()
Called whenever the PEN_PROXIMITY_LEAVE event occurs.
virtual void handleRelease(WVector2f mousePos, int button)
Called whenever the RELEASE event occurs.
virtual void subscribePenProximityLeave(TriggerSignalType::slot_type slot)
Registers a function slot to PEN_PROXIMITY_LEAVE events.
virtual void subscribeQuitApplication(TriggerSignalType::slot_type slot)
Registers a function slot to QUIT_APPLICATION events.
virtual void handleResize(int xPos, int yPos, int width, int height)
Called whenever the widget has resized.
virtual void handleCloseWindow()
Called whenever the CLOSE_WINDOW event occurs.
virtual void handleUser()
Called whenever the USER event occurs.
bool handle(const osgGA::GUIEventAdapter &ea, osgGA::GUIActionAdapter &)
The OSG calls this function whenever a new event has occured.
ButtonSignalType m_sigPush
Signal used for notification of the PUSH event.
virtual void subscribePenPressure(PenPressureSignalType::slot_type slot)
Registers a function slot to PEN_PRESSURE events.
boost::signals2::signal< void(int, int, int, int) > ResizeSignalType
Short hand type for signal signature of RESIZE event.
ButtonSignalType m_sigRelease
Signal used for notification of the RELEASE event.
KeySignalType m_sigKeydown
Signal used for notification of the KEYDOWN event.
unsigned int m_preselection
Binary mask describing which events should be used for notification or subscription.
PenOrientationSignalType m_sigPenOrientation
Signal used for notification of the PEN_ORIENTATION event.
virtual void subscribeFrame(TriggerSignalType::slot_type)
Registers a function slot to FRAME events.
ResizeSignalType m_sigResize
Signal used for notification of the RESIZE event.
virtual void subscribeKeydown(KeySignalType::slot_type slot)
Registers a function slot to KEYDOWN events.
virtual void handleDrag(WVector2f mousePos, int buttonMask)
Called whenever the DRAG event occurs.
virtual void subscribeCloseWindow(TriggerSignalType::slot_type slot)
Registers a function slot to CLOSE_WINDOW events.
boost::signals2::signal< void(WVector2f, unsigned int) > DragSignalType
Short hand type for signal signature of DRAG event.
virtual void handlePenOrientation(const osg::Matrix orientation)
Called whenever the PEN_ORIENTATION event occurs.
boost::signals2::signal< void(WVector2f, int) > ButtonSignalType
Short hand type for signal signature of PUSH, RELEASE and DOUBLECLICK event.
virtual void subscribeKeyup(KeySignalType::slot_type slot)
Registers a function slot to KEYUP events.
virtual void subscribeDrag(DragSignalType::slot_type slot)
Registers a function slot to DRAG events.
virtual void subscribePenProximityEnter(TriggerSignalType::slot_type slot)
Registers a function slot to PEN_PROXIMITY_ENTER events.
boost::signals2::signal< void(GUIEvents::ScrollingMotion, float, float) > ScrollSignalType
Short hand type for signal signature of SCROLL event.
virtual void subscribeDoubleclick(ButtonSignalType::slot_type slot)
Registers a function slot to DOUBLECLICK events.
virtual void handleKeydown(int keyID, unsigned int modKeyMask)
Called whenever the KEYDOWN event occurs.
boost::signals2::signal< void(WVector2f) > MoveSignalType
Short hand type for signal signature of MOVE event.
virtual void handleFrame()
Called whenever the FRAME event occurs.
virtual void subscribeResize(ResizeSignalType::slot_type slot)
Registers a function slot to RESIZE events.
KeySignalType m_sigKeyup
Signal used for notification of the KEYUP event.
WUIViewWidget::SPtr m_widget
Reference to the WUIViewWidget for which event handling should performed.
virtual void subscribeScroll(ScrollSignalType::slot_type slot)
Registers a function slot to SCROLL events.
ScrollSignalType m_sigScroll
Signal used for notification of the SCROLL event.
virtual void subscribePush(ButtonSignalType::slot_type slot)
Registers a function slot to PUSH events.
boost::signals2::signal< void(int, unsigned int) > KeySignalType
Short hand type for signal signature of KEYDOWN and KEYUP event.
PenPressureSignalType m_sigPenPressure
Signal used for notification of the PEN_PRESSURE event.
TriggerSignalType m_sigCloseWindow
Signal used for notification of the CLOSE_WINDOW event.
TriggerSignalType m_sigFrame
Signal used for notification of the FRAME event.
virtual void subscribeUser(TriggerSignalType::slot_type slot)
Registers a function slot to USER events.
TriggerSignalType m_sigPenProximityEnter
Signal used for notification of the PEN_PROXIMITY_ENTER event.
virtual void handleMove(WVector2f mousePos)
Called whenever the MOVE event occurs.
virtual void subscribeRelease(ButtonSignalType::slot_type slot)
Registers a function slot to RELEASE events.
virtual void handleDoubleclick(WVector2f mousePos, int button)
Called whenever the DOUBLECLICK event occurs.
Resource class for streamed logging.