ScummVM API documentation
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 MACS2_MESSAGES_H
23 #define MACS2_MESSAGES_H
24 
25 #include "common/events.h"
26 
27 namespace Macs2 {
28 
29 class UIElement;
30 
31 struct Message {};
32 
33 struct FocusMessage : public Message {
34  UIElement *_priorView = nullptr;
35  FocusMessage() : Message() {}
36  FocusMessage(UIElement *priorView) : Message(),
37  _priorView(priorView) {}
38 };
39 
40 struct UnfocusMessage : public Message {};
41 
42 struct KeypressMessage : public Message, public Common::KeyState {
43  KeypressMessage() : Message() {}
45 };
46 
47 struct MouseMessage : public Message {
48  enum Button { MB_LEFT,
49  MB_RIGHT,
50  MB_MIDDLE };
51  Button _button;
52  Common::Point _pos;
53 
54  MouseMessage() : Message(), _button(MB_LEFT) {}
55  MouseMessage(Button btn, const Common::Point &pos) : Message(), _button(btn), _pos(pos) {}
57 };
58 struct MouseDownMessage : public MouseMessage {
60  MouseDownMessage(Button btn, const Common::Point &pos) : MouseMessage(btn, pos) {}
61  MouseDownMessage(Common::EventType type, const Common::Point &pos) : MouseMessage(type, pos) {}
62 };
63 struct MouseUpMessage : public MouseMessage {
65  MouseUpMessage(Button btn, const Common::Point &pos) : MouseMessage(btn, pos) {}
66  MouseUpMessage(Common::EventType type, const Common::Point &pos) : MouseMessage(type, pos) {}
67 };
68 
69 struct MouseMoveMessage : public MouseMessage {
71  MouseMoveMessage(Button btn, const Common::Point &pos) : MouseMessage(btn, pos) {}
72  MouseMoveMessage(Common::EventType type, const Common::Point &pos) : MouseMessage(type, pos) {}
73 };
74 
75 struct ActionMessage : public Message {
76  int _action;
77  ActionMessage() : Message(), _action(0) {
78  }
79  ActionMessage(int action) : Message(),
80  _action(action) {
81  }
82 };
83 
84 } // namespace Macs2
85 
86 #endif
Definition: messages.h:58
Definition: events.h:54
EventType
Definition: events.h:49
Definition: messages.h:75
Definition: messages.h:69
Definition: messages.h:31
Definition: messages.h:63
Definition: messages.h:47
Definition: rect.h:144
Definition: messages.h:42
Definition: messages.h:33
Definition: keyboard.h:294
Definition: debugtools.h:25
Definition: input.h:69
Definition: messages.h:40