]> git.tdb.fi Git - libs/gui.git/blob - source/input/mouse.h
eb5e9d61a4a1da49fda275a4b0b3e21bcdeb1ae7
[libs/gui.git] / source / input / mouse.h
1 #ifndef MSP_GBASE_MOUSE_H_
2 #define MSP_GBASE_MOUSE_H_
3
4 #include <msp/gbase/window.h>
5 #include "device.h"
6
7 namespace Msp {
8 namespace Input {
9
10 /**
11 Mouse device.  Receives events from a Graphics::Window and presents them in a
12 uniform way.
13
14 Note: Y axis grows upwards.
15 */
16 class Mouse: public Device
17 {
18 private:
19         Graphics::EventSource &source;
20
21 public:
22         Mouse(Graphics::EventSource &);
23         virtual std::string get_button_name(unsigned) const;
24         virtual std::string get_axis_name(unsigned) const;
25 private:
26         void button_press(int, int, unsigned, unsigned);
27         void button_release(int, int, unsigned, unsigned);
28         void pointer_motion(int, int);
29 };
30
31 } // namespace Input
32 } // namespace Msp
33
34 #endif