ScummVM API documentation
mouseMap.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 MOUSE_MAP_H
23#define MOUSE_MAP_H
24
25#include "common/array.h"
26#include "common/ptr.h"
27#include "common/rect.h"
28#include "common/str.h"
29
30namespace AGDS {
31
32class AGDSEngine;
33struct Region;
34using RegionPtr = Common::SharedPtr<Region>;
35
37 int id = -1;
38 RegionPtr region = nullptr;
39 bool enabled = true;
40 bool visible = false;
41
42 Common::String onEnter;
43 Common::String onLeave;
44
45 void enable() {
46 enabled = true;
47 }
48
49 void disable() {
50 enabled = false;
51 }
52
53 MouseRegion() {}
54
55 MouseRegion(RegionPtr reg, const Common::String &enter, const Common::String &leave) : region(reg), onEnter(enter), onLeave(leave) {
56 }
57
58 void hide(AGDSEngine *engine);
59 void show(AGDSEngine *engine);
60};
62
63class MouseMap {
65 bool _disabled;
66
67public:
68 MouseMap() : _mouseRegions(100), _disabled(false) {}
69
70 void disable(bool disabled) {
71 _disabled = disabled;
72 }
73
74 bool disabled() const {
75 return _disabled;
76 }
77
78 int findFree() const;
79 int add(MouseRegion area);
80 void remove(int id);
81
82 void hideAll(AGDSEngine *engine);
83
84 void hideInactive(AGDSEngine *engine, Common::Point pos);
85 MouseRegion *find(int id);
86};
87
88} // End of namespace AGDS
89
90#endif /* AGDS_SCREEN_H */
Definition: agds.h:82
Definition: mouseMap.h:63
Definition: array.h:52
Definition: ptr.h:572
Definition: str.h:59
Definition: mouseMap.h:36
Definition: rect.h:144