Equalizer  1.10.1
Parallel Rendering Framework
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
agl/eventHandler.h
1 
2 /* Copyright (c) 2007-2014, Stefan Eilemann <eile@equalizergraphics.com>
3  *
4  * This library is free software; you can redistribute it and/or modify it under
5  * the terms of the GNU Lesser General Public License version 2.1 as published
6  * by the Free Software Foundation.
7  *
8  * This library is distributed in the hope that it will be useful, but WITHOUT
9  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
10  * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
11  * details.
12  *
13  * You should have received a copy of the GNU Lesser General Public License
14  * along with this library; if not, write to the Free Software Foundation, Inc.,
15  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
16  */
17 
18 #ifndef EQ_AGL_EVENTHANDLER_H
19 #define EQ_AGL_EVENTHANDLER_H
20 
21 #include <eq/defines.h>
22 #include <eq/os.h>
23 #ifdef AGL
24 #include <eq/agl/types.h>
25 #include <eq/eventHandler.h> // base class
26 
27 namespace eq
28 {
29 namespace agl
30 {
38 class EventHandler : public eq::EventHandler
39 {
40 public:
45  EventHandler( agl::WindowIF* window );
46 
48  virtual ~EventHandler();
49 
56  static void initMagellan( Node* node );
57 
63  static void exitMagellan( Node* node );
64 
66  agl::WindowIF* getWindow() const { return _window; }
67 
69  bool handleEvent( EventRef event );
70 
71 private:
72  agl::WindowIF* const _window;
73 
74  EventHandlerRef _eventHandler;
75  EventHandlerRef _eventDispatcher;
76 
77  void _processWindowEvent( WindowEvent& event );
79  bool _processMouseEvent( WindowEvent& event );
80  void _processKeyEvent( WindowEvent& event );
81 
82  uint32_t _getButtonState();
83  uint32_t _getButtonAction( EventRef event );
84  uint32_t _getKey( EventRef event );
85 
86  uint32_t _lastDX;
87  uint32_t _lastDY;
88 };
89 }
90 }
91 #endif // AGL
92 #endif // EQ_AGL_EVENTHANDLER_H
Base class for window system-specific event handlers.
Definition: eventHandler.h:29
Includes operating system headers for OpenGL and the used window system(s) correctly.