ScummVM API documentation
qd_screen_text_set.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 QDENGINE_QDCORE_QD_SCREEN_TEXT_SET_H
23#define QDENGINE_QDCORE_QD_SCREEN_TEXT_SET_H
24
25#include "qdengine/qdcore/qd_screen_text.h"
26#include "qdengine/parser/xml_fwd.h"
27
28
29namespace QDEngine {
30
33public:
36
38 int ID() const {
39 return _ID;
40 }
42 void set_ID(int id) {
43 _ID = id;
44 }
45
47 const Vect2i &screen_pos() const {
48 return _pos;
49 }
51 void set_screen_pos(const Vect2i &pos) {
52 _pos = pos;
53 }
54
56 const Vect2i &screen_size() const {
57 return _size;
58 }
60 void set_screen_size(const Vect2i &sz) {
61 _size = sz;
62 }
63
67 void clear_texts() {
68 _texts.clear();
70 }
73
75 void redraw() const;
76 bool pre_redraw() const;
77 bool post_redraw();
78
79 grScreenRegion screen_region() const;
80
83
84 void load_script(const xml::tag *p);
85 bool save_script(Common::WriteStream &fh, int indent) const;
86
87 bool need_redraw() const {
88 return _need_redraw;
89 }
90
91 bool is_empty() const {
92 return _texts.empty();
93 }
94
95 int size() const {
96 return _texts.size();
97 }
98
99 void set_max_text_width(int width) {
100 _max_text_width = width;
101 format_texts();
103 }
104
106 qdScreenText *get_text(int x, int y);
107
108 bool was_changed() const {
109 return _was_changed;
110 }
111 void toggle_changed(bool state) {
112 _was_changed = state;
113 }
114
115 int new_texts_height() const {
116 return _new_texts_height;
117 }
118 void clear_new_texts_height() {
119 _new_texts_height = 0;
120 }
121
122 void clear_hover_mode();
123
124private:
125
127 int _ID;
128
130 Vect2i _pos;
132 Vect2i _size;
133
135 int _space;
136
137 typedef Common::Array<qdScreenText> texts_container_t;
139 texts_container_t _texts;
140
142 bool _was_changed;
143
145
148 int _max_text_width;
149
150 int _new_texts_height;
151
152 bool _need_redraw;
153 grScreenRegion _last_screen_region;
154
156 void format_texts();
157};
158
159} // namespace QDEngine
160
161#endif // QDENGINE_QDCORE_QD_SCREEN_TEXT_SET_H
size_type size() const
Definition: array.h:316
void clear()
Definition: array.h:321
bool empty() const
Definition: array.h:352
Definition: stream.h:77
Definition: xmath.h:268
Прямоугольная область на экране.
Definition: gr_screen_region.h:31
Поименованный объект.
Definition: qd_named_object.h:70
Экранный текст.
Definition: qd_screen_text.h:146
Набор экранных текстов.
Definition: qd_screen_text_set.h:32
qdScreenText * get_text(int x, int y)
Возвращает текст, в который попадает точка с экранными координатами (x,y).
void set_screen_size(const Vect2i &sz)
Устанавливает размеры набора на экране.
Definition: qd_screen_text_set.h:60
void clear_texts()
Очистка всех текстов набора.
Definition: qd_screen_text_set.h:67
bool arrange_texts()
Расставляет тексты в наборе.
void redraw() const
Отрисовка набора.
const Vect2i & screen_size() const
Возвращает размеры набора на экране.
Definition: qd_screen_text_set.h:56
void set_ID(int id)
Устанавливает идентификатор набора.
Definition: qd_screen_text_set.h:42
int ID() const
Возвращает идентификатор набора.
Definition: qd_screen_text_set.h:38
qdScreenText * add_text(const qdScreenText &txt)
Добавление текста в набор.
void clear_texts(qdNamedObject *owner)
Очистка всех текстов с владельцем owner.
void set_screen_pos(const Vect2i &pos)
Устанавливает экранные координаты центра набора.
Definition: qd_screen_text_set.h:51
const Vect2i & screen_pos() const
Возвращает экранные координаты центра набора.
Definition: qd_screen_text_set.h:47
XML тег.
Definition: xml_tag.h:33
Базовый класс для игровых ресурсов.
Definition: console.h:28