ScummVM API documentation
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 DARKSEED_CURSOR_H
23 #define DARKSEED_CURSOR_H
24 
25 #include "common/rect.h"
26 #include "darkseed/nsp.h"
27 
28 namespace Darkseed {
29 
30 enum CursorType {
31  Pointer = 0,
32  Hand = 2,
33  Look = 3,
34  HourGlass = 91,
35  ConnectorEntrance = 92,
36  HandPointing = 93,
37  ExclamationMark = 94,
38 };
39 
40 class Cursor {
41 private:
42  Common::Point _position;
43  enum CursorType _currentCursorType = Pointer;
44  bool _hasLoadedCursor = false;
45 
46 public:
47 
48  void showCursor(bool showCursor);
49  void setCursorType(enum CursorType newType);
50  CursorType getCursorType() const {
51  return _currentCursorType;
52  }
53 
54  Common::Point &getPosition() {
55  return _position;
56  }
57  void setPosition(Common::Point &position) {
58  _position = position;
59  }
60 
61  int16 getX() const {
62  return _position.x;
63  }
64  int16 getY() const {
65  return _position.y;
66  }
67 
68  int getWidth() const;
69  int getHeight() const;
70  const Sprite &getSprite() const;
71  const Sprite &getSpriteForType(CursorType cursorType) const;
72  void updatePosition(int16 x, int16 y);
73 };
74 
75 } // End of namespace Darkseed
76 
77 #endif // DARKSEED_CURSOR_H
Definition: cursor.h:40
Definition: rect.h:45
Definition: nsp.h:33
int16 x
Definition: rect.h:46
int16 y
Definition: rect.h:47
Definition: adlib_worx.h:27