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 TITANIC_TEXT_CURSOR_H
23#define TITANIC_TEXT_CURSOR_H
24
25#include "common/scummsys.h"
26#include "titanic/support/rect.h"
27
28namespace Titanic {
29
30class CScreenManager;
31class CVideoSurface;
32
34private:
35 CScreenManager *_screenManager;
36 CVideoSurface *_backRenderSurface;
37 CVideoSurface *_frontRenderSurface;
38 Point _pos;
39 Rect _screenBounds;
40 uint _blinkDelay;
41 bool _blinkVisible;
42 Point _size;
43 Point _screenTopLeft;
44 uint _priorBlinkTime;
45 byte _cursorR;
46 byte _cursorG;
47 byte _cursorB;
48 CVideoSurface *_surface;
49 int _mode;
50public:
51 bool _active;
52public:
53 CTextCursor(CScreenManager *screenManager);
55
59 void setPos(const Point &pt) { _pos = pt; }
60
64 void setSize(const Point &size) { _size = size; }
65
70 return Rect(_pos.x, _pos.y, _pos.x + _size.x, _pos.y + _size.y);
71 }
72
76 void setBounds(const Rect &r) { _screenBounds = r; }
77
81 void clearBounds() { _screenBounds.clear(); }
82
86 void setBlinkRate(uint ticks) { _blinkDelay = ticks; }
87
91 void setColor(byte r, byte g, byte b);
92
96 bool isActive() const { return _active; }
97
98 int getMode() const { return _mode; }
99
100 void setMode(int mode) { _mode = mode; }
101
105 void show();
106
110 void hide();
111
115 void draw();
116};
117
118} // End of namespace Titanic
119
120#endif /* TITANIC_TEXT_CURSOR_H */
Definition: screen_manager.h:49
Definition: text_cursor.h:33
void setBounds(const Rect &r)
Definition: text_cursor.h:76
bool isActive() const
Definition: text_cursor.h:96
void setSize(const Point &size)
Definition: text_cursor.h:64
Rect getCursorBounds() const
Definition: text_cursor.h:69
void setColor(byte r, byte g, byte b)
void clearBounds()
Definition: text_cursor.h:81
void setPos(const Point &pt)
Definition: text_cursor.h:59
void setBlinkRate(uint ticks)
Definition: text_cursor.h:86
Definition: video_surface.h:43
Definition: rect.h:35
void clear()
Definition: rect.h:49
T y
Definition: rect.h:49
T x
Definition: rect.h:48
Definition: rect.h:144