ScummVM API documentation
mouse_messages.h
1 /* ScummVM - Graphic Adventure Engine
2  *
3  * ScummVM is the legal property of its developers, whose names
4  * are too numerous to list here. Please refer to the COPYRIGHT
5  * file distributed with this source distribution.
6  *
7  * This program is free software: you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation, either version 3 of the License, or
10  * (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program. If not, see <http://www.gnu.org/licenses/>.
19  *
20  */
21 
22 #ifndef TITANIC_MOUSE_MESSAGES_H
23 #define TITANIC_MOUSE_MESSAGES_H
24 
25 #include "titanic/support/rect.h"
26 #include "titanic/messages/messages.h"
27 
28 namespace Titanic {
29 
30 enum MouseButton { MB_LEFT = 1, MB_MIDDLE = 2, MB_RIGHT = 4 };
31 
32 class CMouseMsg : public CMessage {
33 public:
34  int _buttons;
35  Point _mousePos;
36 public:
37  CLASSDEF;
38  static bool isSupportedBy(const CTreeItem *item) {
39  return supports(item, _type);
40  }
41 
42  CMouseMsg() : _buttons(0) {}
43  CMouseMsg(const Point &pt, int buttons) :
44  _mousePos(pt), _buttons(buttons) {}
45 };
46 
47 class CMouseMoveMsg : public CMouseMsg {
48 public:
49  CLASSDEF;
50  CMouseMoveMsg() : CMouseMsg() {}
51  CMouseMoveMsg(const Point &pt, int buttons) : CMouseMsg(pt, buttons) {}
52 
53  static bool isSupportedBy(const CTreeItem *item) {
54  return supports(item, _type);
55  }
56 };
57 
58 class CMouseButtonMsg : public CMouseMsg {
59 public:
60  int _field10;
61 public:
62  CLASSDEF;
63  CMouseButtonMsg() : CMouseMsg(), _field10(0) {}
64  CMouseButtonMsg(const Point &pt, int buttons) : CMouseMsg(pt, buttons) {}
65 
66  static bool isSupportedBy(const CTreeItem *item) {
67  return supports(item, _type);
68  }
69 };
70 
72 public:
73  CLASSDEF;
75  CMouseButtonDownMsg(const Point &pt, int buttons) : CMouseButtonMsg(pt, buttons) {}
76 
77  static bool isSupportedBy(const CTreeItem *item) {
78  return supports(item, _type);
79  }
80 
84  static void generate();
85 };
86 
88 public:
89  CLASSDEF;
91  CMouseButtonUpMsg(const Point &pt, int buttons) : CMouseButtonMsg(pt, buttons) {}
92 
93  static bool isSupportedBy(const CTreeItem *item) {
94  return supports(item, _type);
95  }
96 
100  static void generate();
101 };
102 
103 class CMouseWheelMsg : public CMouseMsg {
104 public:
105  bool _wheelUp;
106 public:
107  CLASSDEF;
108  CMouseWheelMsg() : CMouseMsg(), _wheelUp(false) {}
109  CMouseWheelMsg(const Point &pt, bool wheelUp) :
110  CMouseMsg(pt, 0), _wheelUp(wheelUp) {}
111 
112  static bool isSupportedBy(const CTreeItem *item) {
113  return supports(item, _type);
114  }
115 };
116 
118 public:
119  CLASSDEF;
121  CMouseDoubleClickMsg(const Point &pt, int buttons) : CMouseButtonMsg(pt, buttons) {}
122 
123  static bool isSupportedBy(const CTreeItem *item) {
124  return supports(item, _type);
125  }
126 };
127 
128 class CMouseDragMsg : public CMouseMsg {
129 public:
130  CLASSDEF;
131  CMouseDragMsg() : CMouseMsg() {}
132  CMouseDragMsg(const Point &pt) : CMouseMsg(pt, 0) {}
133 
134  static bool isSupportedBy(const CTreeItem *item) {
135  return supports(item, _type);
136  }
137 };
138 
140 public:
141  CLASSDEF;
143  CMouseDragMoveMsg(const Point &pt) : CMouseDragMsg(pt) {}
144 
145  static bool isSupportedBy(const CTreeItem *item) {
146  return supports(item, _type);
147  }
148 };
149 
151 public:
152  CTreeItem *_dragItem;
153  bool _handled;
154 public:
155  CLASSDEF;
156  CMouseDragStartMsg() : CMouseDragMsg(), _dragItem(nullptr), _handled(false) {}
157  CMouseDragStartMsg(const Point &pt) : CMouseDragMsg(pt),
158  _dragItem(nullptr), _handled(false) {}
159 
160  static bool isSupportedBy(const CTreeItem *item) {
161  return supports(item, _type);
162  }
163 };
164 
166 public:
167  Point _mousePos;
168  int _value3;
169  int _value4;
170 public:
171  CLASSDEF;
172  CPassOnDragStartMsg() : CMessage(), _value3(0), _value4(0) {}
173  CPassOnDragStartMsg(const Point &pt, int v3 = 0, int v4 = 0) :
174  CMessage(), _mousePos(pt), _value3(v3), _value4(v4) {}
175 
176  static bool isSupportedBy(const CTreeItem *item) {
177  return supports(item, _type);
178  }
179 };
180 
182 public:
183  CGameObject *_dropTarget;
184 public:
185  CLASSDEF;
186  CMouseDragEndMsg() : CMouseDragMsg(), _dropTarget(nullptr) {}
187  CMouseDragEndMsg(const Point &pt, CGameObject *dropTarget = nullptr) :
188  CMouseDragMsg(pt), _dropTarget(dropTarget) {}
189 
190  static bool isSupportedBy(const CTreeItem *item) {
191  return supports(item, _type);
192  }
193 };
194 
195 class CChildDragMoveMsg : public CMessage {
196 public:
197  Point _mousePos;
198 public:
199  CLASSDEF;
200  CChildDragMoveMsg() : CMessage() {}
201  CChildDragMoveMsg(const Point &pt) : CMessage(), _mousePos(pt) {}
202 
203  static bool isSupportedBy(const CTreeItem *item) {
204  return supports(item, _type);
205  }
206 };
207 
208 class CChildDragStartMsg : public CMessage {
209 public:
210  Point _mousePos;
211 public:
212  CLASSDEF;
214  CChildDragStartMsg(const Point &pt) : CMessage(), _mousePos(pt) {}
215 
216  static bool isSupportedBy(const CTreeItem *item) {
217  return supports(item, _type);
218  }
219 };
220 
221 } // End of namespace Titanic
222 
223 #endif /* TITANIC_MOUSE_MESSAGES_H */
Definition: mouse_messages.h:150
Definition: mouse_messages.h:58
Definition: mouse_messages.h:195
Definition: mouse_messages.h:208
static bool supports(const CTreeItem *treeItem, ClassDef *classDef)
Definition: mouse_messages.h:117
Definition: mouse_messages.h:47
Definition: mouse_messages.h:139
MouseButton
Definition: events.h:183
Definition: game_object.h:79
Definition: mouse_messages.h:181
Definition: tree_item.h:37
Definition: mouse_messages.h:32
Definition: mouse_messages.h:103
Definition: rect.h:45
Definition: arm.h:30
Definition: mouse_messages.h:128
Definition: mouse_messages.h:87
Definition: mouse_messages.h:71
Definition: mouse_messages.h:165
Definition: messages.h:91