ScummVM API documentation
text_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 ULTIMA_SHARED_GFX_TEXT_CURSOR_H
23#define ULTIMA_SHARED_GFX_TEXT_CURSOR_H
24
25#include "ultima/shared/core/rect.h"
26#include "ultima/shared/gfx/screen.h"
27
28namespace Ultima {
29namespace Shared {
30namespace Gfx {
31
35class TextCursor : public Cursor {
36protected:
37 bool _visible;
38 Common::Rect _bounds;
39protected:
44public:
45 TextCursor() : _visible(false) {
46 }
47 ~TextCursor() override {
48 }
49
53 bool isVisible() const {
54 return _visible;
55 }
56
60 virtual void setVisible(bool isVis) {
61 _visible = isVis;
63 }
64
68 Common::Rect getBounds() const override { return _bounds; }
69
73 Point getPosition() const { return Point(_bounds.left, _bounds.top); }
74
78 void setPosition(const Point &pt) {
79 bool vis = _visible;
80 setVisible(false);
81 _bounds.moveTo(pt);
82 setVisible(vis);
83 }
84
88 virtual void update() = 0;
89};
90
91} // End of namespace Gfx
92} // End of namespace Shared
93} // End of namespace Ultima
94
95#endif
Definition: screen.h:40
Definition: text_cursor.h:35
Common::Rect getBounds() const override
Definition: text_cursor.h:68
void setPosition(const Point &pt)
Definition: text_cursor.h:78
Point getPosition() const
Definition: text_cursor.h:73
virtual void setVisible(bool isVis)
Definition: text_cursor.h:60
bool isVisible() const
Definition: text_cursor.h:53
Definition: rect.h:144
void moveTo(T x, T y)
Definition: rect.h:399
T left
Definition: rect.h:170
Definition: rect.h:536