gameui
diff include/event.h @ 5:5a84873185ff
rudimentary theme plugin system and other minor fixes
author | John Tsiombikas <nuclear@member.fsf.org> |
---|---|
date | Sat, 22 Mar 2014 01:50:01 +0200 |
parents | src/event.h@e0916bb20b7f |
children |
line diff
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/include/event.h Sat Mar 22 01:50:01 2014 +0200 1.3 @@ -0,0 +1,45 @@ 1.4 +#ifndef EVENT_H_ 1.5 +#define EVENT_H_ 1.6 + 1.7 +#include "vec.h" 1.8 + 1.9 +namespace goatkit { 1.10 + 1.11 +enum EventType { 1.12 + EV_MOUSE_BUTTON, 1.13 + EV_MOUSE_MOTION, 1.14 + EV_MOUSE_FOCUS, 1.15 + EV_KEY 1.16 +}; 1.17 + 1.18 +struct ButtonEvent { 1.19 + Vec2 pos; 1.20 + int button; 1.21 + bool press; 1.22 +}; 1.23 + 1.24 +struct MotionEvent { 1.25 + Vec2 pos; 1.26 +}; 1.27 + 1.28 +struct FocusEvent { 1.29 + bool enter; 1.30 +}; 1.31 + 1.32 +struct KeyEvent { 1.33 + int key; 1.34 + bool press; 1.35 +}; 1.36 + 1.37 +struct Event { 1.38 + EventType type; 1.39 + 1.40 + ButtonEvent button; 1.41 + MotionEvent motion; 1.42 + FocusEvent focus; 1.43 + KeyEvent key; 1.44 +}; 1.45 + 1.46 +} // namespace goatkit 1.47 + 1.48 +#endif // EVENT_H_