ScummVM API documentation
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
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 GOT_MESSAGES_H
23 #define GOT_MESSAGES_H
24 
25 #include "common/events.h"
26 #include "common/str.h"
27 
28 namespace Got {
29 
30 class UIElement;
31 
32 struct Message {};
33 
34 struct FocusMessage : public Message {
35  UIElement *_priorView = nullptr;
36  FocusMessage() : Message() {}
37  FocusMessage(UIElement *priorView) : Message(), _priorView(priorView) {}
38 };
39 
40 struct UnfocusMessage : public Message {};
41 struct MouseEnterMessage : public Message {};
42 struct MouseLeaveMessage : public Message {};
43 
44 struct KeypressMessage : public Message, public Common::KeyState {
45  KeypressMessage() : Message() {}
47 };
48 
49 struct MouseMessage : public Message {
50  enum Button { MB_LEFT,
51  MB_RIGHT,
52  MB_MIDDLE };
53  Button _button;
54  Common::Point _pos;
55 
56  MouseMessage() : Message(), _button(MB_LEFT) {}
57  MouseMessage(Button btn, const Common::Point &pos) : Message(), _button(btn), _pos(pos) {}
59 };
60 struct MouseDownMessage : public MouseMessage {
62  MouseDownMessage(Button btn, const Common::Point &pos) : MouseMessage(btn, pos) {}
63  MouseDownMessage(Common::EventType type, const Common::Point &pos) : MouseMessage(type, pos) {}
64 };
65 struct MouseUpMessage : public MouseMessage {
67  MouseUpMessage(Button btn, const Common::Point &pos) : MouseMessage(btn, pos) {}
68  MouseUpMessage(Common::EventType type, const Common::Point &pos) : MouseMessage(type, pos) {}
69 };
71 
72 struct GameMessage : public Message {
73  Common::String _name;
74  int _value;
75  Common::String _stringValue;
76 
77  GameMessage() : Message(), _value(-1) {}
78  GameMessage(const Common::String &name) : Message(), _name(name), _value(-1) {}
79  GameMessage(const Common::String &name, int value) : Message(), _name(name), _value(value) {}
80  GameMessage(const Common::String &name, const Common::String &value) : Message(), _name(name), _stringValue(value), _value(0) {}
81 };
82 
83 struct ValueMessage : public Message {
84  int _value;
85 
86  ValueMessage() : Message(), _value(0) {}
87  ValueMessage(int value) : Message(), _value(value) {}
88 };
89 
90 struct ActionMessage : public Message {
91  int _action;
92 
93  ActionMessage() : Message(), _action(0) {}
94  ActionMessage(int action) : Message(), _action(action) {}
95 };
96 
97 } // namespace Got
98 
99 #endif
Definition: messages.h:41
Definition: messages.h:44
Definition: str.h:59
EventType
Definition: events.h:49
Definition: messages.h:34
Definition: messages.h:42
Definition: messages.h:90
Definition: messages.h:49
Definition: messages.h:72
Definition: events.h:77
Definition: messages.h:65
Definition: rect.h:45
Definition: messages.h:40
Definition: keyboard.h:294
Definition: messages.h:60
Definition: console.h:28
Definition: input.h:69
Definition: messages.h:83
Definition: messages.h:32