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
28namespace Darkseed {
29
30enum CursorType {
31 Pointer = 0,
32 Hand = 2,
33 Look = 3,
34 HourGlass = 91,
35 ConnectorEntrance = 92,
36 HandPointing = 93,
37 ExclamationMark = 94,
38};
39
40class Cursor {
41private:
42 Common::Point _position;
43 enum CursorType _currentCursorType = Pointer;
44 bool _hasLoadedCursor = false;
45
46public:
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 Common::Rect getRect() const {
69 return Common::Rect(_position, getWidth(), getHeight());
70 }
71
72 int getWidth() const;
73 int getHeight() const;
74 const Sprite &getSprite() const;
75 const Sprite &getSpriteForType(CursorType cursorType) const;
76 void updatePosition(int16 x, int16 y);
77};
78
79} // End of namespace Darkseed
80
81#endif // DARKSEED_CURSOR_H
Definition: cursor.h:40
Definition: nsp.h:33
T y
Definition: rect.h:49
T x
Definition: rect.h:48
Definition: rect.h:144
Definition: rect.h:536