00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef EQ_EVENT_H
00022 #define EQ_EVENT_H
00023
00024 #include <eq/client/renderContext.h>
00025 #include <eq/client/statistic.h>
00026
00027 #include <eq/base/base.h>
00028
00029 namespace eq
00030 {
00037 enum KeyCode
00038 {
00039 KC_ESCAPE = 256,
00040 KC_BACKSPACE,
00041 KC_RETURN,
00042 KC_TAB,
00043 KC_HOME,
00044 KC_LEFT,
00045 KC_UP,
00046 KC_RIGHT,
00047 KC_DOWN,
00048 KC_PAGE_UP,
00049 KC_PAGE_DOWN,
00050 KC_END,
00051 KC_F1,
00052 KC_F2,
00053 KC_F3,
00054 KC_F4,
00055 KC_F5,
00056 KC_F6,
00057 KC_F7,
00058 KC_F8,
00059 KC_F9,
00060 KC_F10,
00061 KC_F11,
00062 KC_F12,
00063 KC_F13,
00064 KC_F14,
00065 KC_F15,
00066 KC_F16,
00067 KC_F17,
00068 KC_F18,
00069 KC_F19,
00070 KC_F20,
00071 KC_F21,
00072 KC_F22,
00073 KC_F23,
00074 KC_F24,
00075 KC_SHIFT_L,
00076 KC_SHIFT_R,
00077 KC_CONTROL_L,
00078 KC_CONTROL_R,
00079 KC_ALT_L,
00080 KC_ALT_R,
00081 KC_VOID = 0xFFFFFF
00082 };
00083
00088 enum PointerButton
00089 {
00090 PTR_BUTTON_NONE = EQ_BIT_NONE,
00091 PTR_BUTTON1 = EQ_BIT1,
00092 PTR_BUTTON2 = EQ_BIT2,
00093 PTR_BUTTON3 = EQ_BIT3,
00094 PTR_BUTTON4 = EQ_BIT4,
00095 PTR_BUTTON5 = EQ_BIT5
00096 };
00097
00099 struct ResizeEvent
00100 {
00101 int32_t x;
00102 int32_t y;
00103 int32_t w;
00104 int32_t h;
00105 float dw;
00106 float dh;
00107 };
00108
00110 struct PointerEvent
00111 {
00112 int32_t x;
00113 int32_t y;
00114 int32_t dx;
00115 int32_t dy;
00116 uint32_t buttons;
00117 uint32_t button;
00118 };
00119
00121 struct KeyEvent
00122 {
00123 uint32_t key;
00124
00125 };
00126
00128 struct MagellanEvent
00129 {
00130 uint32_t button;
00131 uint32_t buttons;
00132 int16_t xAxis;
00133 int16_t yAxis;
00134 int16_t zAxis;
00135 int16_t xRotation;
00136 int16_t yRotation;
00137 int16_t zRotation;
00138 };
00139
00140 # define EQ_USER_EVENT_SIZE 64
00141
00142 struct UserEvent
00143 {
00144 char data[ EQ_USER_EVENT_SIZE ];
00145 };
00146
00148 struct Event
00149 {
00151 EQ_EXPORT Event();
00152
00154 enum Type
00155 {
00156 WINDOW_EXPOSE = 0,
00157 WINDOW_RESIZE,
00158 WINDOW_CLOSE,
00159 WINDOW_HIDE,
00160 WINDOW_SHOW,
00161 WINDOW_SCREENSAVER,
00162 POINTER_MOTION,
00163
00164 POINTER_BUTTON_PRESS,
00166 POINTER_BUTTON_RELEASE,
00167 KEY_PRESS,
00168 KEY_RELEASE,
00169 CHANNEL_RESIZE,
00170 STATISTIC,
00171 VIEW_RESIZE,
00172 EXIT,
00173 MAGELLAN_AXIS,
00174 MAGELLAN_BUTTON,
00175 UNKNOWN,
00176 FILL1,
00177 FILL2,
00178 FILL3,
00179 FILL4,
00180 FILL5,
00182 USER,
00183 ALL
00184 };
00185
00187 uint32_t type;
00188
00190 uint32_t originator;
00191
00193 union
00194 {
00195 ResizeEvent resize;
00196 ResizeEvent show;
00197 ResizeEvent hide;
00198
00199 PointerEvent pointer;
00200 PointerEvent pointerMotion;
00201 PointerEvent pointerButtonPress;
00202 PointerEvent pointerButtonRelease;
00203
00204 KeyEvent key;
00205 KeyEvent keyPress;
00206 KeyEvent keyRelease;
00207
00208 Statistic statistic;
00209 MagellanEvent magellan;
00210
00211 UserEvent user;
00212 };
00213
00215 RenderContext context;
00216 };
00217
00218 EQ_EXPORT std::ostream& operator << ( std::ostream&, const Event& );
00219 EQ_EXPORT std::ostream& operator << ( std::ostream&, const Event::Type& );
00220 EQ_EXPORT std::ostream& operator << ( std::ostream&, const ResizeEvent& );
00221 EQ_EXPORT std::ostream& operator << ( std::ostream&, const PointerEvent& );
00222 EQ_EXPORT std::ostream& operator << ( std::ostream&, const KeyEvent& );
00223 EQ_EXPORT std::ostream& operator << ( std::ostream&, const Statistic& );
00224 EQ_EXPORT std::ostream& operator << ( std::ostream&, const MagellanEvent& );
00225 }
00226
00227 #endif // EQ_EVENT_H
00228