Equalizer  1.10.1
Parallel Rendering Framework
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
event.h
1 
2 /* Copyright (c) 2006-2013, Stefan Eilemann <eile@equalizergraphics.com>
3  * 2011, Cedric Stalder <cedric.stalder@gmail.com>
4  * 2012, Daniel Nachbaur <danielnachbaur@gmail.com>
5  *
6  * This library is free software; you can redistribute it and/or modify it under
7  * the terms of the GNU Lesser General Public License version 2.1 as published
8  * by the Free Software Foundation.
9  *
10  * This library is distributed in the hope that it will be useful, but WITHOUT
11  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
12  * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
13  * details.
14  *
15  * You should have received a copy of the GNU Lesser General Public License
16  * along with this library; if not, write to the Free Software Foundation, Inc.,
17  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18  */
19 
20 #ifndef EQFABRIC_EVENT_H
21 #define EQFABRIC_EVENT_H
22 
23 #include <eq/fabric/api.h>
24 #include <eq/fabric/types.h>
25 #include <eq/fabric/renderContext.h> // member
26 #include <eq/fabric/statistic.h> // member
27 
28 
29 namespace eq
30 {
31 namespace fabric
32 {
33 
39 {
40  int32_t x;
41  int32_t y;
42  int32_t w;
43  int32_t h;
44  float dw;
45  float dh;
46 };
47 
50 {
51  int32_t x;
52  int32_t y;
53  int32_t dx;
54  int32_t dy;
55  uint32_t buttons;
56  uint32_t button;
57  int32_t xAxis;
58  int32_t yAxis;
59 };
60 
62 struct KeyEvent
63 {
64  uint32_t key;
65  // TODO modifier state
66 };
67 
73 {
74  uint32_t button;
75  uint32_t buttons;
76  int16_t xAxis;
77  int16_t yAxis;
78  int16_t zAxis;
79  int16_t xRotation;
80  int16_t yRotation;
81  int16_t zRotation;
82 };
83 
84 # define EQ_USER_EVENT_SIZE 128
85 
91 struct UserEvent
92 {
93  char data[ EQ_USER_EVENT_SIZE ];
94 };
95 
105 struct Event
106 {
108  EQFABRIC_API Event();
109 
111  enum Type // Also update string table in event.cpp
112  {
119  CHANNEL_POINTER_MOTION,
130  WINDOW_POINTER_MOTION,
139 
149 
156 
167 
169 
170  USER = UNKNOWN + 5, // some buffer for binary-compatible patches
171  ALL // must be last
172  };
173 
174  uint32_t type;
175 
176  // keep before 'uint128_t originator' for alignment
177  uint32_t serial;
178 
180  int64_t time;
181 
183  uint128_t originator;
184 
186  union
187  {
191 
197 
201 
204 
206  };
207 
210 };
211 
213 EQFABRIC_API std::ostream& operator << ( std::ostream&, const Event& );
215 EQFABRIC_API std::ostream& operator << ( std::ostream&, const Event::Type& );
217 EQFABRIC_API std::ostream& operator << ( std::ostream&, const ResizeEvent& );
219 EQFABRIC_API std::ostream& operator << ( std::ostream&, const PointerEvent& );
221 EQFABRIC_API std::ostream& operator << ( std::ostream&, const KeyEvent& );
223 EQFABRIC_API std::ostream& operator << ( std::ostream&, const MagellanEvent& );
224 }
225 }
226 
227 namespace lunchbox
228 {
229 template<> inline void byteswap( eq::fabric::Event& value )
230 {
231  byteswap( value.type );
232  byteswap( value.serial );
233  byteswap( value.time );
234  byteswap( value.originator );
235  // #145 Todo byteswap union
236  //byteswap( value.union );
237  byteswap( value.context );
238 }
239 }
240 
241 #endif // EQFABRIC_EVENT_H
A window is shown.
Definition: event.h:117
Channel pointer button release data in pointerButtonRelease.
Definition: event.h:124
uint32_t buttons
current state of all buttons
Definition: event.h:55
Type
The type of the event.
Definition: event.h:111
int16_t yAxis
Y translation.
Definition: event.h:77
int32_t yAxis
y wheel rotation
Definition: event.h:58
int32_t y
Y position relative to entity (0 is on top)
Definition: event.h:52
UserEvent user
User-defined event data.
Definition: event.h:205
int32_t y
new Y position, relative to parent
Definition: event.h:41
Event structure to report window system and other events.
Definition: event.h:105
Node error event.
Definition: event.h:163
uint32_t button
fired button
Definition: event.h:74
Channel error event.
Definition: event.h:166
PointerEvent pointerWheel
Mouse wheel motion data.
Definition: event.h:196
uint32_t key
KeyCode for special keys, ascii code otherwise.
Definition: event.h:64
PointerEvent pointerMotion
Pointer motion data.
Definition: event.h:193
Event type not known by the event handler.
Definition: event.h:168
uint32_t buttons
current state of all buttons
Definition: event.h:75
User-defined event.
Definition: event.h:91
Defines export visibility macros for library EqualizerFabric.
Window error event.
Definition: event.h:165
int16_t xAxis
X translation.
Definition: event.h:76
MagellanEvent magellan
SpaceMouse data.
Definition: event.h:203
ResizeEvent resize
Resize event data.
Definition: event.h:188
Channel resize data in resize.
Definition: event.h:142
ResizeEvent hide
Window hide event data.
Definition: event.h:190
Event for a pointer (mouse) motion or click.
Definition: event.h:49
SpaceMouse movement data in magellan.
Definition: event.h:146
Window pointer button press data in pointerButtonPress.
Definition: event.h:132
ResizeEvent show
Window show event data.
Definition: event.h:189
int16_t xRotation
X rotation.
Definition: event.h:79
uint32_t serial
server-unique originator serial number
Definition: event.h:177
Window pointer grabbed by system window.
Definition: event.h:136
KeyEvent keyRelease
Key release event data.
Definition: event.h:200
Window pointer movement data in pointerMotion.
Definition: event.h:128
uint32_t type
The event type.
Definition: event.h:174
Exit request due to runtime error.
Definition: event.h:145
Key release data in keyRelease.
Definition: event.h:141
Window resize data in resize.
Definition: event.h:114
PointerEvent pointer
Pointer event data.
Definition: event.h:192
int16_t yRotation
Y rotation.
Definition: event.h:80
int16_t zAxis
Z translation.
Definition: event.h:78
int16_t zRotation
Z rotation.
Definition: event.h:81
KeyEvent key
Key event data.
Definition: event.h:198
Event for a key press or release.
Definition: event.h:62
int32_t dy
Y position change since last event.
Definition: event.h:54
PointerEvent pointerButtonPress
Mouse button press data.
Definition: event.h:194
A window is dirty.
Definition: event.h:113
Statistic event in statistic.
Definition: event.h:143
int32_t xAxis
x wheel rotation
Definition: event.h:57
Channel pointer button press data in pointerButtonPress.
Definition: event.h:122
Window pointer Mouse wheel data in wheel.
Definition: event.h:126
SpaceMouse button data in magellan.
Definition: event.h:147
Statistic statistic
Statistic event.
Definition: event.h:202
float dw
view only: new width relative to initial width
Definition: event.h:44
Observer moved (head tracking update).
Definition: event.h:155
Window pointer to be released by system window.
Definition: event.h:138
RenderContext context
The last rendering context for the pointer position.
Definition: event.h:209
int64_t time
The config time when the event was created.
Definition: event.h:180
Node has timed out.
Definition: event.h:148
Pipe error event.
Definition: event.h:164
Window pointer button release data in pointerButtonRelease.
Definition: event.h:134
A window is hidden.
Definition: event.h:116
EQFABRIC_API Event()
Construct a new event.
Event for a size or position change on a Window, Channel or View.
Definition: event.h:38
User-defined events have to be of this type or higher.
Definition: event.h:170
Event for a SpaceMouse movement or click.
Definition: event.h:72
int32_t x
X position relative to entity.
Definition: event.h:51
uint128_t originator
The identifier of the entity emitting the event.
Definition: event.h:183
char data[EQ_USER_EVENT_SIZE]
Application-specific data.
Definition: event.h:93
int32_t dx
X position change since last event.
Definition: event.h:53
A statistics event.
Definition: statistic.h:39
int32_t h
new height
Definition: event.h:43
int32_t x
new X position, relative to parent
Definition: event.h:40
uint32_t button
fired button
Definition: event.h:56
View resize data in resize.
Definition: event.h:144
KeyEvent keyPress
Key press event data.
Definition: event.h:199
PointerEvent pointerButtonRelease
Mouse button release data.
Definition: event.h:195
Key press data in keyPress.
Definition: event.h:140
The context applied to a channel during rendering operations.
Definition: renderContext.h:38
float dh
view only: new height relative to initial height
Definition: event.h:45
A window screensaver request (Win32 only) < Channel pointer movement data in pointerMotion.
Definition: event.h:118
A window has been closed.
Definition: event.h:115
Config error event.
Definition: event.h:162
int32_t w
new width
Definition: event.h:42