view include/EventHandler.h @ 2:0684158d38a8

Before cleanup. Still has experimental code in it.
author Eris Caffee <discordia@eldalin.com>
date Fri, 22 Oct 2010 02:21:52 -0500
parents 455406f5f021
children d691ce98f406
line source
1 ////////////////////////////////////////////////////////////////////////////////
2 //
3 // (C) 2010 Sarah Eris Horsley Caffee
4 //
5 // mandelbrot - A simple Mandelbrot Set viewer.
6 //
7 // EventHandler.h
8 // EventHandler class definition. This is a virtual class that is meant to be
9 // an interface implemented by an application class. It does, though, provide
10 // default implementations of it's methods so that unused events can be quietly
11 // ignored.
12 //
13 ////////////////////////////////////////////////////////////////////////////////
15 #ifndef EVENTHANDLER_H
16 #define EVENTHANDLER_H
18 #include "SDL.h"
20 class EventHandler
21 {
22 public:
24 EventHandler();
25 virtual ~EventHandler();
27 #ifndef USE_SDL_WAITEVENT
28 virtual int wait_event_timeout(SDL_Event * event, Uint32 timeout);
29 #endif
31 virtual void on_event(SDL_Event * event);
33 virtual void on_InputFocus();
34 virtual void on_InputBlur();
35 virtual void on_KeyDown(SDLKey sym, SDLMod mod, Uint16 unicode);
36 virtual void on_KeyUp(SDLKey sym, SDLMod mod, Uint16 unicode);
37 virtual void on_MouseFocus();
38 virtual void on_MouseBlur();
39 virtual void on_MouseMove(int mx, int my, int relx, int rely, bool left, bool right, bool middle);
40 virtual void on_MouseWheel(bool up, bool down);
41 virtual void on_LButtonDown(int mx, int my);
42 virtual void on_LButtonUp(int mx, int my);
43 virtual void on_RButtonDown(int mx, int my);
44 virtual void on_RButtonUp(int mx, int my);
45 virtual void on_MButtonDown(int mx, int my);
46 virtual void on_MButtonUp(int mx, int my);
47 virtual void on_JoyAxis(Uint8 ehich, Uint8 axis, Sint16 value);
48 virtual void on_JoyButtonDown(Uint8 which, Uint8 button);
49 virtual void on_JoyButtonUp(Uint8 which, Uint8 button);
50 virtual void on_JoyHat(Uint8 which, Uint8 hat, Uint8 value);
51 virtual void on_JoyBall(Uint8 which, Uint8 ball, Sint16 xrel, Sint16 yrel);
52 virtual void on_Minimize();
53 virtual void on_Restore();
54 virtual void on_Resize(int w, int h);
55 virtual void on_Expose();
56 virtual void on_Exit();
57 virtual void on_User(Uint8 type, int code, void * data1, void * data2);
58 };
60 #endif