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
27namespace Macs2 {
28
29class UIElement;
30
31struct Message {};
32
33struct FocusMessage : public Message {
34 UIElement *_priorView = nullptr;
35 FocusMessage() : Message() {}
36 FocusMessage(UIElement *priorView) : Message(),
37 _priorView(priorView) {}
38};
39
40struct UnfocusMessage : public Message {};
41
42struct KeypressMessage : public Message, public Common::KeyState {
45};
46
47struct 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};
60 MouseDownMessage(Button btn, const Common::Point &pos) : MouseMessage(btn, pos) {}
61 MouseDownMessage(Common::EventType type, const Common::Point &pos) : MouseMessage(type, pos) {}
62};
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
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
75struct 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: input.h:69
Definition: events.h:54
EventType
Definition: events.h:49
Definition: keyboard.h:294
Definition: rect.h:144
Definition: messages.h:75
Definition: messages.h:33
Definition: messages.h:42
Definition: messages.h:31
Definition: messages.h:58
Definition: messages.h:47
Definition: messages.h:69
Definition: messages.h:63
Definition: messages.h:40