FireBreath  1.4.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Pages
MouseEvents.h
1 /**********************************************************\
2 Original Author: Richard Bateman (taxilian)
3 
4 Created: Dec 7, 2009
5 License: Dual license model; choose one of two:
6  New BSD License
7  http://www.opensource.org/licenses/bsd-license.php
8  - or -
9  GNU Lesser General Public License, version 2.1
10  http://www.gnu.org/licenses/lgpl-2.1.html
11 
12 Copyright 2009 Richard Bateman, Firebreath development team
13 \**********************************************************/
14 
15 #pragma once
16 #ifndef H_FB_PLUGINEVENTS_MOUSEEVENTS
17 #define H_FB_PLUGINEVENTS_MOUSEEVENTS
18 
19 #include "PluginEvent.h"
20 
21 namespace FB {
22 
28  class MouseEvent : public PluginEvent
29  {
30  public:
31  enum ModifierState {
32  ModifierState_None = 0x0,
33  ModifierState_Shift = 0x1,
34  ModifierState_Control = 0x2,
35  ModifierState_Menu = 0x4,
36  ModifierState_Alt = 0x8,
37  };
38  MouseEvent(int x, int y, uint32_t state = ModifierState_None) :m_x(x), m_y(y), m_state(state) { }
39 
40  public:
41  int m_x;
42  int m_y;
43  uint32_t m_state;
44  };
50  class MouseMoveEvent : public MouseEvent
51  {
52  public:
53  MouseMoveEvent(int x, int y, uint32_t state = ModifierState_None) : MouseEvent(x, y, state) { }
54 
55  public:
56  };
57 
64  {
65  public:
66  enum MouseButton {
67  MouseButton_Left,
68  MouseButton_Right,
69  MouseButton_Middle,
70  MouseButton_None
71  };
72  MouseButtonEvent(MouseButton btn, int x, int y, uint32_t state = ModifierState_None) : MouseEvent(x, y, state), m_Btn(btn) { }
73 
74  public:
75  MouseButton m_Btn;
76  };
77 
84  {
85  public:
86  MouseDownEvent(MouseButton btn, int x, int y, uint32_t state = ModifierState_None) : MouseButtonEvent(btn, x, y, state) { }
87  };
88 
95  {
96  public:
97  MouseDoubleClickEvent(MouseButton btn, int x, int y, uint32_t state = ModifierState_None) : MouseButtonEvent(btn, x, y, state) { }
98  };
99 
106  {
107  public:
108  MouseUpEvent(MouseButton btn, int x, int y, uint32_t state = ModifierState_None) : MouseButtonEvent(btn, x, y, state) { }
109  };
110 
117  {
118  public:
119  MouseScrollEvent(int x, int y, double dx, double dy, uint32_t state = ModifierState_None) : MouseEvent(x, y, state), m_dx(dx), m_dy(dy) { }
120 
121  public:
122  double m_dx;
123  double m_dy;
124  };
125 
132  {
133  public:
134  MouseEnteredEvent(int x, int y) : MouseMoveEvent(x,y) { }
135  };
136 
143  {
144  public:
145  MouseExitedEvent(int x, int y) : MouseMoveEvent(x,y) { }
146  };
147 };
148 
149 #endif // H_FB_PLUGINEVENTS_MOUSEEVENTS
150 
Fired when the user moves the scrollwheel.
Definition: MouseEvents.h:116
Fired when the mouse moves.
Definition: MouseEvents.h:50
Fired when a mouse event occurs.
Definition: MouseEvents.h:28
Fired when a mouse up event occurs.
Definition: MouseEvents.h:105
Fired when the user moves mouse away from the plugin.
Definition: MouseEvents.h:142
Fired when a mouse down event occurs.
Definition: MouseEvents.h:83
Fired when a mouse button event occurs.
Definition: MouseEvents.h:63
Plugin event base class.
Definition: PluginEvent.h:36
Fired when the user moves mouse over the plugin.
Definition: MouseEvents.h:131
Fired when a mouse double click event occurs.
Definition: MouseEvents.h:94