ScummVM API documentation
cursors.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 MOHAWK_CURSORS_H
23#define MOHAWK_CURSORS_H
24
25#include "common/scummsys.h"
26
27namespace Common {
28class MacResManager;
29class WinResources;
30class SeekableReadStream;
31class String;
32}
33
34namespace Graphics {
35struct WinCursorGroup;
36}
37
38#include "mohawk/resource.h"
39
40namespace Mohawk {
41
42enum {
43 kRivenOpenHandCursor = 2003,
44 kRivenClosedHandCursor = 2004,
45 kRivenMainCursor = 3000,
46 kRivenPelletCursor = 5000,
47 kRivenHideCursor = 9000
48};
49
50class MohawkArchive;
51class MohawkEngine;
52
54public:
55 CursorManager() {}
56 virtual ~CursorManager() {}
57
58 virtual void showCursor();
59 virtual void hideCursor();
60 virtual void setCursor(uint16 id);
61 virtual void setCursor(const Common::String &name) {}
62 virtual void setDefaultCursor();
63 virtual bool hasSource() const { return false; }
64
65protected:
66 // Set a Mac CURS/crsr cursor to the screen
67 void setMacCursor(Common::SeekableReadStream *stream);
68};
69
70// The default Mohawk cursor manager
71// Uses standard tCUR resources
73public:
74 explicit DefaultCursorManager(MohawkEngine *vm, uint32 tag = ID_TCUR) : _vm(vm), _tag(tag) {}
75 ~DefaultCursorManager() override {}
76
77 void setCursor(uint16 id) override;
78 bool hasSource() const override { return true; }
79
80private:
81 MohawkEngine *_vm;
82 uint32 _tag;
83};
84
85#ifdef ENABLE_MYST
86
87// 803-805 are animated, one large bmp which is in chunks - these are NEVER USED
88// Other cursors (200, 300, 400, 500, 600, 700) are not the same in each stack
89enum {
90 kDefaultMystCursor = 100, // The default hand
91 kWhitePageCursor = 800, // Holding a white page
92 kRedPageCursor = 801, // Holding a red page
93 kBluePageCursor = 802, // Holding a blue page
94 // kDroppingWhitePageAnimCursor = 803,
95 // kDroppingRedPageAnimCursor = 804,
96 // kDroppingBluePageAnimCursor = 805,
97 kNewMatchCursor = 900, // Match that has not yet been lit
98 kLitMatchCursor = 901, // Match that's burning
99 kDeadMatchCursor = 902, // Match that's been extinguished
100 kKeyCursor = 903, // Key in Lighthouse in Stoneship
101 kRotateClockwiseCursor = 904, // Rotate gear clockwise (boiler on Myst)
102 kRotateCounterClockwiseCursor = 905, // Rotate gear counter clockwise (boiler on Myst)
103 kMystZipModeCursor = 999 // Zip Mode cursor
104};
105
106class MohawkEngine_Myst;
107
108// The cursor manager for Myst
109// Uses WDIB + CLRC resources
110class MystCursorManager : public CursorManager {
111public:
112 explicit MystCursorManager(MohawkEngine_Myst *vm);
113 ~MystCursorManager() override;
114
115 void showCursor() override;
116 void hideCursor() override;
117 void setCursor(uint16 id) override;
118 void setDefaultCursor() override;
119 bool hasSource() const override { return true; }
120
121private:
122 MohawkEngine_Myst *_vm;
123};
124
125#endif // ENABLE_MYST
126
127// The cursor manager for Mac applications
129public:
130 explicit MacCursorManager(const Common::Path &appName);
131 ~MacCursorManager() override;
132
133 void setCursor(uint16 id) override;
134 bool hasSource() const override { return _resFork != nullptr; }
135
136private:
137 Common::MacResManager *_resFork;
138};
139
140// The cursor manager for Living Books v2+ games
141// Handles custom generated cursors in addition to tCUR resources
143public:
146
147 void setCursor(uint16 id) override;
148 void setCursor(const Common::String &name) override;
149 bool hasSource() const override { return _sysArchive != nullptr; }
150
151private:
152 MohawkArchive *_sysArchive;
153};
154
155// The cursor manager for Windows EXE's
157public:
158 ~WinCursorManager() override;
159
160 void setCursor(uint16 id) override;
161 bool hasSource() const override { return !_cursors.empty(); }
162
163protected:
164 void loadCursors(Common::WinResources *exe);
165
166private:
167 struct CursorItem {
168 uint16 id;
169 Graphics::WinCursorGroup *cursorGroup;
170 };
171
173};
174
175// The cursor manager for NE EXE's
177public:
178 explicit NECursorManager(const Common::Path &appName);
179};
180
181// The cursor manager for PE EXE's
183public:
184 explicit PECursorManager(const Common::Path &appName);
185};
186
187} // End of namespace Mohawk
188
189#endif
bool empty() const
Definition: array.h:352
Definition: macresman.h:126
Definition: path.h:52
Definition: stream.h:745
Definition: str.h:59
Definition: winexe.h:110
Definition: cursors.h:53
Definition: cursors.h:72
Definition: cursors.h:142
Definition: cursors.h:128
Definition: resource.h:171
Definition: mohawk.h:54
Definition: cursors.h:176
Definition: cursors.h:182
Definition: cursors.h:156
Definition: algorithm.h:29
Definition: formatinfo.h:28
Definition: bitmap.h:32
Definition: wincursor.h:54