Equalizer  1.6.1
agl/eventHandler.h
1 
2 /* Copyright (c) 2007-2013, 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/client/defines.h>
22 #ifdef AGL
23 
24 #include <eq/client/agl/types.h>
25 #include <eq/client/eventHandler.h> // base class
26 
27 namespace eq
28 {
29 namespace agl
30 {
40  {
41  public:
46  EventHandler( agl::WindowIF* window );
47 
49  virtual ~EventHandler();
50 
57  static void initMagellan( Node* node );
58 
64  static void exitMagellan( Node* node );
65 
67  agl::WindowIF* getWindow() const { return _window; }
68 
70  bool handleEvent( EventRef event );
71 
72  private:
73  agl::WindowIF* const _window;
74 
75  EventHandlerRef _eventHandler;
76  EventHandlerRef _eventDispatcher;
77 
78  void _processWindowEvent( WindowEvent& event );
80  bool _processMouseEvent( WindowEvent& event );
81  void _processKeyEvent( WindowEvent& event );
82 
83  uint32_t _getButtonState();
84  uint32_t _getButtonAction( EventRef event );
85  uint32_t _getKey( EventRef event );
86 
87  uint32_t _lastDX;
88  uint32_t _lastDY;
89  };
90 }
91 }
92 #endif // AGL
93 #endif // EQ_AGL_EVENTHANDLER_H
A Node represents a single computer in the cluster.
static void exitMagellan(Node *node)
De-initialize space mouse event handling for this process.
static void initMagellan(Node *node)
Initialize space mouse event handling for this process.
EventHandler()
Construct a new event handler.
Definition: eventHandler.h:30
The interface defining the minimum functionality for an AGL window.
Base class for window system-specific event handlers.
Definition: eventHandler.h:26
virtual ~EventHandler()
Destruct the AGL event handler.
The event handler for AGL windows.
A window-system event with the native Carbon event, used for AGL.
agl::WindowIF * getWindow() const