ScummVM API documentation
display.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 ADL_DISPLAY_H
23#define ADL_DISPLAY_H
24
25#include "common/text-to-speech.h"
26#include "common/types.h"
27
28namespace Common {
29class String;
30struct Point;
31}
32
33namespace Adl {
34
35class Display {
36public:
37 enum Mode {
38 kModeGraphics,
39 kModeText,
40 kModeMixed
41 };
42
43 virtual ~Display();
44
45 virtual void init() = 0;
46 void setMode(Mode mode);
47 virtual void renderText() = 0;
48 virtual void renderGraphics() = 0;
49
50 virtual char asciiToNative(char c) const = 0;
51 virtual void printChar(char c) = 0;
52 virtual void showCursor(bool enable) = 0;
53 void home();
54 void moveCursorTo(const Common::Point &pos);
55 void moveCursorForward();
56 void moveCursorBackward();
57 void printString(const Common::String &str, bool voiceString = true);
58 void printAsciiString(const Common::String &str, bool voiceString = true);
59 void sayText(const Common::String &text, Common::TextToSpeechManager::Action action = Common::TextToSpeechManager::QUEUE) const;
60 Common::U32String convertText(const Common::String &text) const;
61 void setCharAtCursor(byte c);
62 uint getTextWidth() const { return _textWidth; }
63 uint getTextHeight() const { return _textHeight; }
64 void scrollUp();
65
66protected:
67 Display() : _textBuf(nullptr), _cursorPos(0), _mode(kModeText), _textWidth(0), _textHeight(0) { }
68
69 void createTextBuffer(uint textWidth, uint textHeight);
70
71 byte *_textBuf;
72 uint _cursorPos;
73 Mode _mode;
74 uint _textWidth;
75 uint _textHeight;
76};
77
78} // End of namespace Adl
79
80#endif
Definition: display.h:35
Definition: str.h:59
Definition: ustr.h:57
Definition: algorithm.h:29
Definition: rect.h:144
Definition: display_client.h:58