summaryrefslogtreecommitdiff
path: root/src/gui/fonts/font.h
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-05-17 18:43:03 +0300
committerAndrei Karas <akaras@inbox.ru>2014-05-17 18:45:18 +0300
commita3eae284bfdb06ea5501230705f19e75e6a0173d (patch)
treece5c7bbd965b2cea59c7d3cae7921eaf8b22d11e /src/gui/fonts/font.h
parent9f3eddda4befaf04c0c1a08983f210ee7c77b8ea (diff)
downloadmanaverse-a3eae284bfdb06ea5501230705f19e75e6a0173d.tar.gz
manaverse-a3eae284bfdb06ea5501230705f19e75e6a0173d.tar.bz2
manaverse-a3eae284bfdb06ea5501230705f19e75e6a0173d.tar.xz
manaverse-a3eae284bfdb06ea5501230705f19e75e6a0173d.zip
Move textchunksmall into separate file.
Diffstat (limited to 'src/gui/fonts/font.h')
-rw-r--r--src/gui/fonts/font.h47
1 files changed, 17 insertions, 30 deletions
diff --git a/src/gui/fonts/font.h b/src/gui/fonts/font.h
index f6a64a2d8..551800bdb 100644
--- a/src/gui/fonts/font.h
+++ b/src/gui/fonts/font.h
@@ -69,6 +69,8 @@
#include "gui/color.h"
+#include "gui/fonts/textchunksmall.h"
+
#include <SDL_ttf.h>
#include <map>
@@ -82,33 +84,18 @@ class Image;
const unsigned int CACHES_NUMBER = 256;
-class SDLTextChunkSmall
-{
- public:
- SDLTextChunkSmall(const std::string &text0, const Color &color0,
- const Color &color1);
-
- SDLTextChunkSmall(const SDLTextChunkSmall &old);
-
- bool operator==(const SDLTextChunkSmall &chunk) const;
- bool operator<(const SDLTextChunkSmall &chunk) const;
-
- std::string text;
- Color color;
- Color color2;
-};
-
-class SDLTextChunk final
+class TextChunk final
{
public:
- SDLTextChunk(const std::string &text0, const Color &color0,
- const Color &color1);
+ TextChunk(const std::string &text0,
+ const Color &color0,
+ const Color &color1);
- A_DELETE_COPY(SDLTextChunk)
+ A_DELETE_COPY(TextChunk)
- ~SDLTextChunk();
+ ~TextChunk();
- bool operator==(const SDLTextChunk &chunk) const;
+ bool operator==(const TextChunk &chunk) const;
void generate(TTF_Font *const font, const float alpha);
@@ -116,8 +103,8 @@ class SDLTextChunk final
std::string text;
Color color;
Color color2;
- SDLTextChunk *prev;
- SDLTextChunk *next;
+ TextChunk *prev;
+ TextChunk *next;
};
@@ -128,9 +115,9 @@ class TextChunkList final
A_DELETE_COPY(TextChunkList)
- void insertFirst(SDLTextChunk *const item);
+ void insertFirst(TextChunk *const item);
- void moveToFirst(SDLTextChunk *const item);
+ void moveToFirst(TextChunk *const item);
void removeBack();
@@ -138,11 +125,11 @@ class TextChunkList final
void clear();
- SDLTextChunk *start;
- SDLTextChunk *end;
+ TextChunk *start;
+ TextChunk *end;
uint32_t size;
- std::map<SDLTextChunkSmall, SDLTextChunk*> search;
- std::map<std::string, SDLTextChunk*> searchWidth;
+ std::map<TextChunkSmall, TextChunk*> search;
+ std::map<std::string, TextChunk*> searchWidth;
};
/**