OpenMW
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
events.hpp
Go to the documentation of this file.
1 #ifndef _SFO_EVENTS_H
2 #define _SFO_EVENTS_H
3 
4 #include <SDL_types.h>
5 #include <SDL_events.h>
6 
8 // Events //
10 
11 namespace SDLUtil
12 {
13 
16 
17  Sint32 zrel;
18  Sint32 z;
19 };
20 
21 
23 // Listeners //
25 
27 {
28 public:
29  virtual ~MouseListener() {}
30  virtual void mouseMoved( const MouseMotionEvent &arg ) = 0;
31  virtual void mousePressed( const SDL_MouseButtonEvent &arg, Uint8 id ) = 0;
32  virtual void mouseReleased( const SDL_MouseButtonEvent &arg, Uint8 id ) = 0;
33 };
34 
36 {
37 public:
38  virtual ~KeyListener() {}
39  virtual void textInput (const SDL_TextInputEvent& arg) {}
40  virtual void keyPressed(const SDL_KeyboardEvent &arg) = 0;
41  virtual void keyReleased(const SDL_KeyboardEvent &arg) = 0;
42 };
43 
45 {
46 public:
47  virtual ~ControllerListener() {}
49  virtual void buttonPressed(int deviceID, const SDL_ControllerButtonEvent &evt) = 0;
50 
52  virtual void buttonReleased(int deviceID, const SDL_ControllerButtonEvent &evt) = 0;
53 
55  virtual void axisMoved(int deviceID, const SDL_ControllerAxisEvent &arg) = 0;
56 
58  virtual void controllerAdded(int deviceID, const SDL_ControllerDeviceEvent &arg) = 0;
59 
61  virtual void controllerRemoved(const SDL_ControllerDeviceEvent &arg) = 0;
62 
63 };
64 
66 {
67 public:
68  virtual ~WindowListener() {}
69 
71  virtual void windowVisibilityChange( bool visible ) {}
72 
74  virtual void windowFocusChange( bool have_focus ) {}
75 
76  virtual void windowClosed () {}
77 
78  virtual void windowResized (int x, int y) {}
79 };
80 
81 }
82 
83 #endif
Sint32 z
Definition: events.hpp:18
virtual void keyReleased(const SDL_KeyboardEvent &arg)=0
virtual void buttonPressed(int deviceID, const SDL_ControllerButtonEvent &evt)=0
Definition: events.hpp:65
Definition: events.hpp:15
virtual void windowClosed()
Definition: events.hpp:76
virtual void mousePressed(const SDL_MouseButtonEvent &arg, Uint8 id)=0
virtual void controllerAdded(int deviceID, const SDL_ControllerDeviceEvent &arg)=0
Definition: events.hpp:26
virtual void axisMoved(int deviceID, const SDL_ControllerAxisEvent &arg)=0
virtual void controllerRemoved(const SDL_ControllerDeviceEvent &arg)=0
Definition: events.hpp:44
virtual void mouseReleased(const SDL_MouseButtonEvent &arg, Uint8 id)=0
virtual void textInput(const SDL_TextInputEvent &arg)
Definition: events.hpp:39
virtual void windowResized(int x, int y)
Definition: events.hpp:78
virtual void windowFocusChange(bool have_focus)
Definition: events.hpp:74
virtual void buttonReleased(int deviceID, const SDL_ControllerButtonEvent &evt)=0
Definition: events.hpp:35
virtual ~WindowListener()
Definition: events.hpp:68
virtual ~ControllerListener()
Definition: events.hpp:47
virtual void mouseMoved(const MouseMotionEvent &arg)=0
virtual ~KeyListener()
Definition: events.hpp:38
virtual void windowVisibilityChange(bool visible)
Definition: events.hpp:71
virtual void keyPressed(const SDL_KeyboardEvent &arg)=0
virtual ~MouseListener()
Definition: events.hpp:29
Sint32 zrel
Definition: events.hpp:17