/* ScummVM - Graphic Adventure Engine * * ScummVM is the legal property of its developers, whose names * are too numerous to list here. Please refer to the COPYRIGHT * file distributed with this source distribution. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . * */ #ifndef ULTIMA4_VIEWS_TEXTVIEW_H #define ULTIMA4_VIEWS_TEXTVIEW_H #include "ultima/ultima4/views/view.h" #include "ultima/ultima4/gfx/image.h" #include "common/array.h" #include "common/rect.h" namespace Ultima { namespace Ultima4 { #define PRINTF_LIKE(x,y) #define CHAR_WIDTH 8 #define CHAR_HEIGHT 8 /** * A view of a text area. Keeps track of the cursor position. */ class TextView : public View { struct Option : public Common::Rect { char _key; Option() : Common::Rect(), _key('\0') {} Option(const Common::Rect &r, char key) : Common::Rect(r), _key(key) {} }; protected: int _columns, _rows; /**< size of the view in character cells */ bool _cursorEnabled; /**< whether the cursor is enabled */ bool _cursorFollowsText; /**< whether the cursor is moved past the last character written */ int _cursorX, _cursorY; /**< current position of cursor */ int _cursorPhase; /**< the rotation state of the cursor */ static Image *_charset; /**< image containing font */ Common::Array