ManaPlus
src
gui
fonts
textchunk.h
Go to the documentation of this file.
1
/*
2
* The ManaPlus Client
3
* Copyright (C) 2004-2009 The Mana World Development Team
4
* Copyright (C) 2009-2010 The Mana Developers
5
* Copyright (C) 2011-2019 The ManaPlus Developers
6
* Copyright (C) 2019-2021 Andrei Karas
7
* Copyright (C) 2009 Aethyra Development Team
8
*
9
* This file is part of The ManaPlus Client.
10
*
11
* This program is free software; you can redistribute it and/or modify
12
* it under the terms of the GNU General Public License as published by
13
* the Free Software Foundation; either version 2 of the License, or
14
* any later version.
15
*
16
* This program is distributed in the hope that it will be useful,
17
* but WITHOUT ANY WARRANTY; without even the implied warranty of
18
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19
* GNU General Public License for more details.
20
*
21
* You should have received a copy of the GNU General Public License
22
* along with this program. If not, see <http://www.gnu.org/licenses/>.
23
*/
24
25
#ifndef GUI_FONTS_TEXTCHUNK_H
26
#define GUI_FONTS_TEXTCHUNK_H
27
28
#include "
gui/color.h
"
29
30
#include <string>
31
32
PRAGMA48
(GCC diagnostic push)
33
PRAGMA48
(GCC diagnostic ignored
"-Wshadow"
)
34
#include <SDL_ttf.h>
35
PRAGMA48
(GCC diagnostic pop)
36
37
#include "localconsts.h"
38
39
class
Font
;
40
class
Image
;
41
42
class
TextChunk
final
43
{
44
public
:
45
TextChunk
();
46
47
TextChunk
(
const
std::string &
restrict
text0,
48
const
Color
&
restrict
color0,
49
const
Color
&
restrict
color1,
50
Font
*
restrict
const
font);
51
52
A_DELETE_COPY
(
TextChunk
)
53
54
~TextChunk
();
55
56
bool
operator==
(
const
TextChunk
&
restrict
chunk)
const
restrict2
;
57
58
void
generate
(TTF_Font *
restrict
const
font,
59
const
float
alpha)
restrict2
;
60
61
void
deleteImage
()
restrict2
;
62
63
Image
*
restrict
img
;
64
Font
*
restrict
textFont
;
65
std::string
text
;
66
Color
color
;
67
Color
color2
;
68
TextChunk
*
restrict
prev
;
69
TextChunk
*
restrict
next
;
70
};
71
72
#ifdef UNITTESTS
73
extern
int
textChunkCnt;
74
#endif
// UNITTESTS
75
76
#endif
// GUI_FONTS_TEXTCHUNK_H
Color
Definition:
color.h:76
Font
Definition:
font.h:90
Image
TextChunk
Definition:
textchunk.h:43
TextChunk::deleteImage
void deleteImage()
Definition:
textchunk.cpp:193
TextChunk::operator==
bool operator==(const TextChunk &chunk) const
Definition:
textchunk.cpp:91
TextChunk::textFont
Font * textFont
Definition:
textchunk.h:64
TextChunk::next
TextChunk * next
Definition:
textchunk.h:69
TextChunk::img
Image * img
Definition:
textchunk.h:63
TextChunk::color
Color color
Definition:
textchunk.h:66
TextChunk::TextChunk
TextChunk()
Definition:
textchunk.cpp:52
TextChunk::color2
Color color2
Definition:
textchunk.h:67
TextChunk::prev
TextChunk * prev
Definition:
textchunk.h:68
TextChunk::~TextChunk
~TextChunk()
Definition:
textchunk.cpp:83
TextChunk::text
std::string text
Definition:
textchunk.h:65
TextChunk::generate
void generate(TTF_Font *const font, const float alpha)
Definition:
textchunk.cpp:97
color.h
restrict
#define restrict
Definition:
localconsts.h:165
restrict2
#define restrict2
Definition:
localconsts.h:166
final
#define final
Definition:
localconsts.h:46
PRAGMA48
#define PRAGMA48(str)
Definition:
localconsts.h:199
A_DELETE_COPY
#define A_DELETE_COPY(func)
Definition:
localconsts.h:53
Generated on Wed Mar 17 2021 19:19:06 for ManaPlus by
1.9.1