diff --git a/doc/Changelog.md b/doc/Changelog.md index 6cfdf4ccee..ca7c3398ee 100644 --- a/doc/Changelog.md +++ b/doc/Changelog.md @@ -3,6 +3,8 @@ Changelog {#Changelog} # git master +* [609](https://github.com/Eyescale/Equalizer/pull/609): + Clean up magellan event API * [608](https://github.com/Eyescale/Equalizer/pull/608): Make Frame::Buffer enum an enum class to ease bitmask handling; enum values are now Frame::Buffer::value instead of Frame::BUFFER_VALUE diff --git a/eq/agl/eventHandler.cpp b/eq/agl/eventHandler.cpp index cb65c88567..5fd38fd516 100644 --- a/eq/agl/eventHandler.cpp +++ b/eq/agl/eventHandler.cpp @@ -1,5 +1,5 @@ -/* Copyright (c) 2007-2016, Stefan Eilemann +/* Copyright (c) 2007-2017, Stefan Eilemann * Cedric Stalder * * This library is free software; you can redistribute it and/or modify it under @@ -501,7 +501,7 @@ void _magellanEventHandler( io_connect_t, natural_t messageType, event.xRotation = -state->axis[3]; event.yRotation = state->axis[4]; event.zRotation = state->axis[5]; - _magellanNode->processEvent( EVENT_MAGELLAN_AXIS, event ); + _magellanNode->processEvent( event ); return; } @@ -509,7 +509,7 @@ void _magellanEventHandler( io_connect_t, natural_t messageType, { ButtonEvent event; event.buttons = state->buttons; - _magellanNode->processEvent( EVENT_MAGELLAN_BUTTON, event ); + _magellanNode->processEvent( event ); return; } diff --git a/eq/config.cpp b/eq/config.cpp index 6e97587813..653aba8eae 100644 --- a/eq/config.cpp +++ b/eq/config.cpp @@ -620,10 +620,10 @@ bool Config::handleEvent( EventICommand command ) return handleEvent( type, command.read< KeyEvent >( )); case EVENT_MAGELLAN_AXIS: - return handleEvent( type, command.read< AxisEvent >( )); + return handleEvent( command.read< AxisEvent >( )); case EVENT_MAGELLAN_BUTTON: - return handleEvent( type, command.read< ButtonEvent >( )); + return handleEvent( command.read< ButtonEvent >( )); case EVENT_WINDOW_CLOSE: case EVENT_WINDOW_HIDE: @@ -755,12 +755,12 @@ bool Config::handleEvent( const EventType type, const KeyEvent& event ) } } -bool Config::handleEvent( const EventType, const AxisEvent& ) +bool Config::handleEvent( const AxisEvent& ) { return false; } -bool Config::handleEvent( const EventType, const ButtonEvent& ) +bool Config::handleEvent( const ButtonEvent& ) { return false; } diff --git a/eq/config.h b/eq/config.h index 9ffb9e27de..eab1d26ef1 100644 --- a/eq/config.h +++ b/eq/config.h @@ -1,5 +1,5 @@ -/* Copyright (c) 2005-2016, Stefan Eilemann +/* Copyright (c) 2005-2017, Stefan Eilemann * Cedric Stalder * Daniel Nachbaur * @@ -388,8 +388,8 @@ class Config : public fabric::Config< Server, Config, Observer, Layout, Canvas, EQ_API virtual bool handleEvent( EventType type, const SizeEvent& event ); EQ_API virtual bool handleEvent( EventType type, const PointerEvent& event); EQ_API virtual bool handleEvent( EventType type, const KeyEvent& event ); - EQ_API virtual bool handleEvent( EventType type, const AxisEvent& event ); - EQ_API virtual bool handleEvent( EventType type, const ButtonEvent& event ); + EQ_API virtual bool handleEvent( const AxisEvent& event ); + EQ_API virtual bool handleEvent( const ButtonEvent& event ); /** @return true if events are pending. Thread safe. @version 1.0 */ EQ_API bool checkEvent() const; diff --git a/eq/glx/eventHandler.cpp b/eq/glx/eventHandler.cpp index 9f5a9d76a8..5846c1e69a 100644 --- a/eq/glx/eventHandler.cpp +++ b/eq/glx/eventHandler.cpp @@ -1,5 +1,5 @@ -/* Copyright (c) 2006-2016, Stefan Eilemann +/* Copyright (c) 2006-2017, Stefan Eilemann * Daniel Nachbaur * Cedric Stalder * @@ -349,8 +349,7 @@ bool EventHandler::_processEvent( const XEvent& event ) axisEvent.xRotation = -spev.motion.rx; axisEvent.yRotation = -spev.motion.ry; axisEvent.zRotation = spev.motion.rz; - return _window->processEvent( EVENT_MAGELLAN_AXIS, event, - axisEvent ); + return _window->processEvent( event, axisEvent ); } case SPNAV_EVENT_BUTTON: @@ -358,8 +357,7 @@ bool EventHandler::_processEvent( const XEvent& event ) ButtonEvent buttonEvent; buttonEvent.buttons = spev.button.press; buttonEvent.button = spev.button.bnum; - return _window->processEvent( EVENT_MAGELLAN_BUTTON, event, - buttonEvent ); + return _window->processEvent( event, buttonEvent ); } default: diff --git a/eq/glx/window.h b/eq/glx/window.h index e003c410ab..1c3038a2c6 100644 --- a/eq/glx/window.h +++ b/eq/glx/window.h @@ -1,5 +1,5 @@ -/* Copyright (c) 2005-2016, Stefan Eilemann +/* Copyright (c) 2005-2017, Stefan Eilemann * Daniel Nachbaur * Maxim Makhinya * @@ -61,14 +61,12 @@ class WindowIF : public GLWindow { return GLWindow::processEvent( type, event ); } /** Process an axis event. @return true if the event was handled. */ - virtual bool processEvent( EventType type, const XEvent&, - AxisEvent& event ) - { return GLWindow::processEvent( type, event ); } + virtual bool processEvent( const XEvent&, AxisEvent& event ) + { return GLWindow::processEvent( event ); } /** Process a button event. @return true if the event was handled. */ - virtual bool processEvent( EventType type, const XEvent&, - ButtonEvent& event ) - { return GLWindow::processEvent( type, event ); } + virtual bool processEvent( const XEvent&, ButtonEvent& event ) + { return GLWindow::processEvent( event ); } /** Process a stateless event. @return true if the event was handled. */ virtual bool processEvent( EventType type, const XEvent& ) diff --git a/eq/image.cpp b/eq/image.cpp index 18c5c44c41..6e6d7df951 100644 --- a/eq/image.cpp +++ b/eq/image.cpp @@ -20,6 +20,7 @@ #include "image.h" +#include "gl.h" #include "half.h" #include "log.h" #include "pixelData.h" @@ -1802,4 +1803,3 @@ co::DataIStream& operator >> ( co::DataIStream& is, Image& image ) } } - diff --git a/eq/node.cpp b/eq/node.cpp index 4e138733e0..9d920eff78 100644 --- a/eq/node.cpp +++ b/eq/node.cpp @@ -472,19 +472,19 @@ EventOCommand Node::sendError( const uint32_t error ) return getConfig()->sendError( EVENT_NODE_ERROR, Error( error, getID( ))); } -bool Node::processEvent( const EventType type, AxisEvent& event ) +bool Node::processEvent( AxisEvent& event ) { Config* config = getConfig(); updateEvent( event, config->getTime( )); - config->sendEvent( type ) << event; + config->sendEvent( EVENT_MAGELLAN_AXIS ) << event; return true; } -bool Node::processEvent( const EventType type, ButtonEvent& event ) +bool Node::processEvent( ButtonEvent& event ) { Config* config = getConfig(); updateEvent( event, config->getTime( )); - config->sendEvent( type ) << event; + config->sendEvent( EVENT_MAGELLAN_BUTTON ) << event; return true; } diff --git a/eq/node.h b/eq/node.h index b0509ccc2b..5fab61fb20 100644 --- a/eq/node.h +++ b/eq/node.h @@ -1,5 +1,5 @@ -/* Copyright (c) 2005-2016, Stefan Eilemann +/* Copyright (c) 2005-2017, Stefan Eilemann * Cedric Stalder * * This library is free software; you can redistribute it and/or modify it under @@ -133,13 +133,12 @@ class Node : public fabric::Node< Config, Node, Pipe, NodeVisitor > * The task of this method is to update the node as necessary, and send it * to the application using Config::sendEvent(). * - * @param type unused * @param event the received event. * @return true if the event was handled, false if not. * @version 1.5.2 */ - EQ_API virtual bool processEvent( EventType type, AxisEvent& event ); - EQ_API virtual bool processEvent( EventType type, ButtonEvent& event ); + EQ_API virtual bool processEvent( AxisEvent& event ); + EQ_API virtual bool processEvent( ButtonEvent& event ); EQ_API virtual bool processEvent( Statistic& event ); /** @internal @sa Serializable::setDirty() */ diff --git a/eq/notifierInterface.h b/eq/notifierInterface.h index 0ff2550f44..85043d44e1 100644 --- a/eq/notifierInterface.h +++ b/eq/notifierInterface.h @@ -1,5 +1,5 @@ -/* Copyright (c) 2014-2016, Daniel Nachbaur +/* Copyright (c) 2014-2017, Daniel Nachbaur * * This library is free software; you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License version 2.1 as published @@ -50,8 +50,8 @@ class NotifierInterface virtual bool processEvent( EventType type, SizeEvent& event ) = 0; virtual bool processEvent( EventType type, PointerEvent& event ) = 0; virtual bool processEvent( EventType type, KeyEvent& event ) = 0; - virtual bool processEvent( EventType type, AxisEvent& event ) = 0; - virtual bool processEvent( EventType type, ButtonEvent& event ) = 0; + virtual bool processEvent( AxisEvent& event ) = 0; + virtual bool processEvent( ButtonEvent& event ) = 0; virtual bool processEvent( EventType type ) = 0; //!< stateless event }; } diff --git a/eq/systemWindow.cpp b/eq/systemWindow.cpp index 06d9f25284..c9e58f5c77 100644 --- a/eq/systemWindow.cpp +++ b/eq/systemWindow.cpp @@ -1,5 +1,5 @@ -/* Copyright (c) 2005-2016, Stefan Eilemann +/* Copyright (c) 2005-2017, Stefan Eilemann * Daniel Nachbaur * Maxim Makhinya * @@ -114,14 +114,14 @@ bool SystemWindow::processEvent( const EventType type, KeyEvent& event ) return _parent.processEvent( type, event ); } -bool SystemWindow::processEvent( EventType type, AxisEvent& event ) +bool SystemWindow::processEvent( AxisEvent& event ) { - return _parent.processEvent( type, event ); + return _parent.processEvent( event ); } -bool SystemWindow::processEvent( EventType type, ButtonEvent& event ) +bool SystemWindow::processEvent( ButtonEvent& event ) { - return _parent.processEvent( type, event ); + return _parent.processEvent( event ); } } diff --git a/eq/systemWindow.h b/eq/systemWindow.h index 318a1d78a7..e27e222e70 100644 --- a/eq/systemWindow.h +++ b/eq/systemWindow.h @@ -1,5 +1,5 @@ -/* Copyright (c) 2005-2016, Stefan Eilemann +/* Copyright (c) 2005-2017, Stefan Eilemann * Daniel Nachbaur * Maxim Makhinya * @@ -165,10 +165,10 @@ class SystemWindow EQ_API bool processEvent( EventType type, KeyEvent& event ); /** Process an axis event. @return true if the event was handled. */ - EQ_API bool processEvent( EventType type, AxisEvent& event ); + EQ_API bool processEvent( AxisEvent& event ); /** Process a button event. @return true if the event was handled. */ - EQ_API bool processEvent( EventType type, ButtonEvent& event ); + EQ_API bool processEvent( ButtonEvent& event ); /** * Set the window's pixel viewport wrt its parent pipe. diff --git a/eq/wgl/eventHandler.cpp b/eq/wgl/eventHandler.cpp index 048dc87d59..c2cd371cd9 100644 --- a/eq/wgl/eventHandler.cpp +++ b/eq/wgl/eventHandler.cpp @@ -1,5 +1,5 @@ -/* Copyright (c) 2007-2016, Stefan Eilemann +/* Copyright (c) 2007-2017, Stefan Eilemann * Cedric Stalder * * This library is free software; you can redistribute it and/or modify it under @@ -617,7 +617,7 @@ void EventHandler::_magellanEventHandler( LPARAM lParam ) event.buttons |= PTR_BUTTON2; if( pRawHid->bRawData[3] ) event.buttons |= PTR_BUTTON3; - _magellanNode->processEvent( EVENT_MAGELLAN_BUTTON, event ); + _magellanNode->processEvent( event ); } else { @@ -638,7 +638,7 @@ void EventHandler::_magellanEventHandler( LPARAM lParam ) _magellanGotRotation = false; _magellanGotTranslation = false; - _magellanNode->processEvent( EVENT_MAGELLAN_AXIS, event ); + _magellanNode->processEvent( event ); } } #endif diff --git a/eq/wgl/window.h b/eq/wgl/window.h index 35f9602aad..304144149e 100644 --- a/eq/wgl/window.h +++ b/eq/wgl/window.h @@ -1,5 +1,5 @@ -/* Copyright (c) 2005-2016, Stefan Eilemann +/* Copyright (c) 2005-2017, Stefan Eilemann * Maxim Makhinya * * This library is free software; you can redistribute it and/or modify it under @@ -67,12 +67,12 @@ class WindowIF : public GLWindow { return GLWindow::processEvent( type, event ); } /** Process an axis event. @return true if the event was handled. */ - virtual bool processEvent( EventType type, AxisEvent& event ) - { return GLWindow::processEvent( type, event ); } + virtual bool processEvent( AxisEvent& event ) + { return GLWindow::processEvent( event ); } /** Process a button event. @return true if the event was handled. */ - virtual bool processEvent( EventType type, ButtonEvent& event ) - { return GLWindow::processEvent( type, event ); } + virtual bool processEvent( ButtonEvent& event ) + { return GLWindow::processEvent( event ); } /** Process a stateless event. @return true if the event was handled. */ virtual bool processEvent( EventType ) { return false; } diff --git a/eq/window.cpp b/eq/window.cpp index 142a3ac061..9983235235 100644 --- a/eq/window.cpp +++ b/eq/window.cpp @@ -1,5 +1,5 @@ -/* Copyright (c) 2005-2016, Stefan Eilemann +/* Copyright (c) 2005-2017, Stefan Eilemann * Cedric Stalder * Daniel Nachbaur * @@ -797,19 +797,19 @@ bool Window::processEvent( const EventType type, KeyEvent& event ) return true; } -bool Window::processEvent( const EventType type, AxisEvent& event ) +bool Window::processEvent( AxisEvent& event ) { Config* config = getConfig(); updateEvent( event, config->getTime( )); - config->sendEvent( type ) << event; + config->sendEvent( EVENT_MAGELLAN_AXIS ) << event; return true; } -bool Window::processEvent( const EventType type, ButtonEvent& event ) +bool Window::processEvent( ButtonEvent& event ) { Config* config = getConfig(); updateEvent( event, config->getTime( )); - config->sendEvent( type ) << event; + config->sendEvent( EVENT_MAGELLAN_BUTTON ) << event; return true; } diff --git a/eq/window.h b/eq/window.h index 89add4d65b..7988050f53 100644 --- a/eq/window.h +++ b/eq/window.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2005-2016, Stefan Eilemann +/* Copyright (c) 2005-2017, Stefan Eilemann * Cedric Stalder * Daniel Nachbaur * @@ -304,10 +304,10 @@ class Window : public fabric::Window< Pipe, Window, Channel, WindowSettings >, EQ_API bool processEvent( EventType type, KeyEvent& event ) override; /** @sa NotifierInterface::processEvent(). */ - EQ_API bool processEvent( EventType type, AxisEvent& event ) override; + EQ_API bool processEvent( AxisEvent& event ) override; /** @sa NotifierInterface::processEvent(). */ - EQ_API bool processEvent( EventType type, ButtonEvent& event ) override; + EQ_API bool processEvent( ButtonEvent& event ) override; EQ_API bool processEvent( Statistic& event ); //@} diff --git a/examples/eqPly/config.cpp b/examples/eqPly/config.cpp index 3c991c3ed3..bd7f108c2a 100644 --- a/examples/eqPly/config.cpp +++ b/examples/eqPly/config.cpp @@ -688,7 +688,7 @@ bool Config::handleEvent( const eq::EventType type, return eq::Config::handleEvent( type, event ); } -bool Config::handleEvent( const eq::EventType, const eq::AxisEvent& event ) +bool Config::handleEvent( const eq::AxisEvent& event ) { _spinX = 0; _spinY = 0; @@ -700,15 +700,14 @@ bool Config::handleEvent( const eq::EventType, const eq::AxisEvent& event ) return true; } -bool Config::handleEvent( const eq::EventType type, - const eq::ButtonEvent& event ) +bool Config::handleEvent( const eq::ButtonEvent& event ) { if( event.button == eq::PTR_BUTTON1 ) { _frameData.toggleColorMode(); return true; } - return eq::Config::handleEvent( type, event ); + return eq::Config::handleEvent( event ); } bool Config::handleEvent( const eq::EventType type, const eq::Event& event ) diff --git a/examples/eqPly/config.h b/examples/eqPly/config.h index ff19286041..d6daa77a28 100644 --- a/examples/eqPly/config.h +++ b/examples/eqPly/config.h @@ -75,8 +75,8 @@ class Config : public eq::Config bool handleEvent( eq::EventType type, const eq::Event& event ) override; bool handleEvent( eq::EventType type, const eq::KeyEvent& event ) override; bool handleEvent( eq::EventType type, const eq::PointerEvent& ) override; - bool handleEvent( eq::EventType type, const eq::AxisEvent& event ) override; - bool handleEvent( eq::EventType type, const eq::ButtonEvent& ) override; + bool handleEvent( const eq::AxisEvent& event ) override; + bool handleEvent( const eq::ButtonEvent& ) override; /** @return true if the application is idling. */ bool isIdleAA(); diff --git a/seq/detail/masterConfig.cpp b/seq/detail/masterConfig.cpp index 2e4f1c9d39..d7a6fc2c92 100644 --- a/seq/detail/masterConfig.cpp +++ b/seq/detail/masterConfig.cpp @@ -1,5 +1,5 @@ -/* Copyright (c) 2011-2016, Stefan Eilemann +/* Copyright (c) 2011-2017, Stefan Eilemann * Daniel Nachbaur * * This library is free software; you can redistribute it and/or modify it under @@ -155,7 +155,20 @@ bool MasterConfig::_handleEvent( eq::EventType type, E& event ) return _redraw; } +template< class E > bool MasterConfig::_handleEvent( E& event ) +{ + if( Config::handleEvent( event )) + _redraw = true; + + if( _currentViewID == 0 ) + return _redraw; + + View* view = static_cast< View* >( find< eq::View >( _currentViewID )); + if( view && view->handleEvent( event )) + _redraw = true; + return _redraw; +} bool MasterConfig::handleEvent( EventICommand command ) { @@ -200,16 +213,14 @@ bool MasterConfig::handleEvent( const eq::EventType type, return _handleEvent( type, event ); } -bool MasterConfig::handleEvent( const eq::EventType type, - const AxisEvent& event ) +bool MasterConfig::handleEvent( const AxisEvent& event ) { - return _handleEvent( type, event ); + return _handleEvent( event ); } -bool MasterConfig::handleEvent( const eq::EventType type, - const ButtonEvent& event ) +bool MasterConfig::handleEvent( const ButtonEvent& event ) { - return _handleEvent( type, event ); + return _handleEvent( event ); } bool MasterConfig::handleEvent( const eq::EventType type, const Event& event ) diff --git a/seq/detail/masterConfig.h b/seq/detail/masterConfig.h index 6f377abb38..6e5ff87346 100644 --- a/seq/detail/masterConfig.h +++ b/seq/detail/masterConfig.h @@ -1,5 +1,5 @@ -/* Copyright (c) 2011-2016, Stefan Eilemann +/* Copyright (c) 2011-2017, Stefan Eilemann * Daniel Nachbaur * * This library is free software; you can redistribute it and/or modify it under @@ -16,7 +16,6 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ - #ifndef EQSEQUEL_DETAIL_MASTERCONFIG_H #define EQSEQUEL_DETAIL_MASTERCONFIG_H @@ -49,11 +48,12 @@ class MasterConfig : public Config bool handleEvent( eq::EventType type, const SizeEvent& event ) final; bool handleEvent( eq::EventType type, const PointerEvent& event ) final; bool handleEvent( eq::EventType type, const KeyEvent& event ) final; - bool handleEvent( eq::EventType type, const AxisEvent& event ) final; - bool handleEvent( eq::EventType type, const ButtonEvent& event ) final; + bool handleEvent( const AxisEvent& event ) final; + bool handleEvent( const ButtonEvent& event ) final; bool handleEvent( eq::EventType type, const Event& event ) final; void addStatistic( const Statistic& stat ) final; template< class E > bool _handleEvent( eq::EventType type, E& event ); + template< class E > bool _handleEvent( E& event ); }; } } diff --git a/seq/detail/view.cpp b/seq/detail/view.cpp index f122269b67..984d883204 100644 --- a/seq/detail/view.cpp +++ b/seq/detail/view.cpp @@ -1,5 +1,5 @@ -/* Copyright (c) 2011-2016, Stefan Eilemann +/* Copyright (c) 2011-2017, Stefan Eilemann * Daniel Nachbaur * * This library is free software; you can redistribute it and/or modify it under @@ -24,6 +24,7 @@ #include #include #include + #include #include @@ -129,6 +130,17 @@ template< class E > bool View::_handleEvent( eq::EventType type, E& event ) return false; } +template< class E > bool View::_handleEvent( E& event ) +{ + ViewData* data = getViewData(); + LBASSERT( data ); + if( !data ) + return false; + if( isActive() ) + return data->handleEvent( event ); + return false; +} + bool View::handleEvent( eq::EventType type, const SizeEvent& event ) { return _handleEvent( type, event ); @@ -144,14 +156,14 @@ bool View::handleEvent( eq::EventType type, const KeyEvent& event ) return _handleEvent( type, event ); } -bool View::handleEvent( eq::EventType type, const AxisEvent& event ) +bool View::handleEvent( const AxisEvent& event ) { - return _handleEvent( type, event ); + return _handleEvent( event ); } -bool View::handleEvent( eq::EventType type, const ButtonEvent& event ) +bool View::handleEvent( const ButtonEvent& event ) { - return _handleEvent( type, event ); + return _handleEvent( event ); } } } diff --git a/seq/detail/view.h b/seq/detail/view.h index 8efffb65f7..9b49217c2d 100644 --- a/seq/detail/view.h +++ b/seq/detail/view.h @@ -1,5 +1,5 @@ -/* Copyright (c) 2011-2016, Stefan Eilemann +/* Copyright (c) 2011-2017, Stefan Eilemann * Daniel Nachbaur * * This library is free software; you can redistribute it and/or modify it under @@ -20,6 +20,7 @@ #define EQSEQUEL_DETAIL_VIEW_H #include + #include // base class namespace seq @@ -44,8 +45,8 @@ class View : public eq::View bool handleEvent( eq::EventType type, const SizeEvent& event ) final; bool handleEvent( eq::EventType type, const PointerEvent& event ); bool handleEvent( eq::EventType type, const KeyEvent& event ); - bool handleEvent( eq::EventType type, const AxisEvent& event ); - bool handleEvent( eq::EventType type, const ButtonEvent& event ); + bool handleEvent( const AxisEvent& event ); + bool handleEvent( const ButtonEvent& event ); bool updateData(); //@} @@ -58,6 +59,7 @@ class View : public eq::View void notifyAttach() final; void notifyDetached() final; template< class E > bool _handleEvent( eq::EventType type, E& event ); + template< class E > bool _handleEvent( E& event ); }; } } diff --git a/seq/detail/window.cpp b/seq/detail/window.cpp index be873a0bf0..1768bab596 100644 --- a/seq/detail/window.cpp +++ b/seq/detail/window.cpp @@ -1,5 +1,5 @@ -/* Copyright (c) 2011-2016, Stefan Eilemann +/* Copyright (c) 2011-2017, Stefan Eilemann * Petros Kataras * * This library is free software; you can redistribute it and/or modify it under @@ -123,6 +123,14 @@ bool Window::_processEvent( const eq::EventType type, E& event ) return eq::Window::processEvent( type, event ); } +template< class E > bool Window::_processEvent( E& event ) +{ + seq::Renderer* const renderer = getRenderer(); + if( renderer->processEvent( event )) + return true; + return eq::Window::processEvent( event ); +} + bool Window::processEvent( const eq::EventType type, SizeEvent& event ) { return _processEvent( type, event ); @@ -138,14 +146,14 @@ bool Window::processEvent( const eq::EventType type, KeyEvent& event ) return _processEvent( type, event ); } -bool Window::processEvent( const eq::EventType type, AxisEvent& event ) +bool Window::processEvent( AxisEvent& event ) { - return _processEvent( type, event ); + return _processEvent( event ); } -bool Window::processEvent( const eq::EventType type, ButtonEvent& event ) +bool Window::processEvent( ButtonEvent& event ) { - return _processEvent( type, event ); + return _processEvent( event ); } } diff --git a/seq/detail/window.h b/seq/detail/window.h index 879794a535..1f04272748 100644 --- a/seq/detail/window.h +++ b/seq/detail/window.h @@ -1,5 +1,5 @@ -/* Copyright (c) 2011-2016, Stefan Eilemann +/* Copyright (c) 2011-2017, Stefan Eilemann * Petros Kataras * * This library is free software; you can redistribute it and/or modify it under @@ -49,8 +49,8 @@ class Window : public eq::Window bool processEvent( eq::EventType type, SizeEvent& event ) final; bool processEvent( eq::EventType type, PointerEvent& event ) final; bool processEvent( eq::EventType type, KeyEvent& event ) final; - bool processEvent( eq::EventType type, AxisEvent& event ) final; - bool processEvent( eq::EventType type, ButtonEvent& event ) final; + bool processEvent( AxisEvent& event ) final; + bool processEvent( ButtonEvent& event ) final; bool initContext() { return eq::Window::configInitGL( uint128_t( )); } bool exitContext() { return eq::Window::configExitGL(); } @@ -60,6 +60,7 @@ class Window : public eq::Window virtual ~Window(); template< class E > bool _processEvent( eq::EventType type, E& event ); + template< class E > bool _processEvent( E& event ); }; } } diff --git a/seq/renderer.h b/seq/renderer.h index a2317d28b6..1d3b5ab265 100644 --- a/seq/renderer.h +++ b/seq/renderer.h @@ -1,5 +1,5 @@ -/* Copyright (c) 2011-2016, Stefan Eilemann +/* Copyright (c) 2011-2017, Stefan Eilemann * Daniel Nachbaur * Petros Kataras * @@ -186,8 +186,8 @@ class Renderer : public co::ObjectFactory virtual bool processEvent( EventType, const SizeEvent& ) { return false; } virtual bool processEvent( EventType, const PointerEvent& ){ return false; } virtual bool processEvent( EventType, const KeyEvent& ) { return false; } - virtual bool processEvent( EventType, const AxisEvent& ) { return false; } - virtual bool processEvent( EventType, const ButtonEvent& ) { return false; } + virtual bool processEvent( const AxisEvent& ) { return false; } + virtual bool processEvent( const ButtonEvent& ) { return false; } //@} /** @name Data Access */ diff --git a/seq/viewData.cpp b/seq/viewData.cpp index d8c89e38ef..fe40d02e8d 100644 --- a/seq/viewData.cpp +++ b/seq/viewData.cpp @@ -1,5 +1,5 @@ -/* Copyright (c) 2011-2016, Stefan Eilemann +/* Copyright (c) 2011-2017, Stefan Eilemann * Daniel Nachbaur * Petros Kataras * @@ -141,7 +141,7 @@ bool ViewData::handleEvent( const eq::EventType type, const KeyEvent& event ) } } -bool ViewData::handleEvent( const eq::EventType, const AxisEvent& event ) +bool ViewData::handleEvent( const AxisEvent& event ) { _spinX = 0; _spinY = 0; @@ -153,7 +153,7 @@ bool ViewData::handleEvent( const eq::EventType, const AxisEvent& event ) return true; } -bool ViewData::handleEvent( const eq::EventType, const ButtonEvent& ) +bool ViewData::handleEvent( const ButtonEvent& ) { return false; } diff --git a/seq/viewData.h b/seq/viewData.h index 3b521e6c6f..08e04e761f 100644 --- a/seq/viewData.h +++ b/seq/viewData.h @@ -1,5 +1,5 @@ -/* Copyright (c) 2011-2016, Stefan Eilemann +/* Copyright (c) 2011-2017, Stefan Eilemann * Daniel Nachbaur * * This library is free software; you can redistribute it and/or modify it under @@ -49,8 +49,8 @@ class ViewData : public co::Serializable SEQ_API virtual bool handleEvent( eq::EventType type, const SizeEvent& ); SEQ_API virtual bool handleEvent( eq::EventType type, const PointerEvent& ); SEQ_API virtual bool handleEvent( eq::EventType type, const KeyEvent& ); - SEQ_API virtual bool handleEvent( eq::EventType type, const AxisEvent& ); - SEQ_API virtual bool handleEvent( eq::EventType type, const ButtonEvent& ); + SEQ_API virtual bool handleEvent( const AxisEvent& ); + SEQ_API virtual bool handleEvent( const ButtonEvent& ); /** Rotate the model matrix by the given increments. @version 1.0 */ SEQ_API void spinModel( const float x, const float y, const float z );