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