ScummVM API documentation
mouse_cursor.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 TITANIC_MOUSE_CURSOR_H
23 #define TITANIC_MOUSE_CURSOR_H
24 
25 #include "common/scummsys.h"
26 #include "graphics/managed_surface.h"
27 #include "titanic/support/rect.h"
28 
29 namespace Titanic {
30 
31 #define NUM_CURSORS 15
32 
33 enum CursorId {
34  CURSOR_ARROW = 1,
35  CURSOR_MOVE_LEFT = 2,
36  CURSOR_MOVE_RIGHT = 3,
37  CURSOR_MOVE_FORWARD = 4,
38  CURSOR_LOOK_UP = 5,
39  CURSOR_LOOK_DOWN = 6,
40  CURSOR_MOVE_THROUGH = 7,
41  CURSOR_HAND = 8,
42  CURSOR_ACTIVATE = 9,
43  CURSOR_INVALID = 10,
44  CURSOR_MAGNIFIER = 11,
45  CURSOR_IGNORE = 12,
46  CURSOR_BACKWARDS = 13,
47  CURSOR_DOWN = 14,
48  CURSOR_HOURGLASS = 15
49 };
50 
51 class CScreenManager;
52 class CVideoSurface;
53 
54 class CMouseCursor {
55  struct CursorEntry {
56  Graphics::ManagedSurface *_surface;
57  Common::Point _centroid;
58 
59  CursorEntry() : _surface(nullptr) {}
60  ~CursorEntry();
61  };
62 private:
63  CScreenManager *_screenManager;
64  CursorId _cursorId;
65  CursorEntry _cursors[NUM_CURSORS];
66  uint _setCursorCount;
67  int _hideCounter;
68  int _busyCount;
69  bool _cursorSuppressed;
70  int _fieldE8;
71  Common::Point _moveStartPos;
72  Common::Point _moveDestPos;
73  uint32 _moveStartTime, _moveEndTime;
74 
78  void loadCursorImages();
79 public:
80  bool _inputEnabled;
81 public:
82  CMouseCursor(CScreenManager *screenManager);
83  ~CMouseCursor();
84 
88  void incBusyCount();
89 
94  void decBusyCount();
95 
100  void incHideCounter();
101 
105  void decHideCounter();
106 
111  void suppressCursor();
112 
117  void unsuppressCursor();
118 
122  void setCursor(CursorId cursorId);
123 
127  void update();
128 
132  uint getChangeCount() const { return _setCursorCount; }
133 
137  void disableControl();
138 
142  void enableControl();
143 
147  void setPosition(const Point &pt, double duration);
148 };
149 
150 
151 } // End of namespace Titanic
152 
153 #endif /* TITANIC_MOUSE_CURSOR_H */
Definition: managed_surface.h:51
Definition: screen_manager.h:49
void setPosition(const Point &pt, double duration)
Definition: rect.h:45
Definition: arm.h:30
Definition: mouse_cursor.h:54
void setCursor(CursorId cursorId)
uint getChangeCount() const
Definition: mouse_cursor.h:132