-
Notifications
You must be signed in to change notification settings - Fork 2
/
TextImage.h
35 lines (27 loc) · 982 Bytes
/
TextImage.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#pragma once
#include "Pixmap.h"
#include "TextStyle.h"
namespace dawn
{
class TextImage : public Pixmap
{
public:
TextImage(std::string text, TextStyle *style) : m_text(text), m_style(style) { }
virtual ~TextImage() { }
virtual CONSTANTS::PixmapType type() const { return CONSTANTS::TextImagePixmap; }
std::string text() const { return m_text; }
void text(std::string text) { setChanged(m_text != text); m_text = text; }
TextStyle *style() const { return m_style; }
virtual void style(TextStyle *style) { setChanged(m_style != style); m_style = style; }
virtual bool isChanged(etag_t *etag, bool recursive) {
bool changed = Pixmap::isChanged(etag, recursive);
if (recursive) {
changed |= m_style->isChanged(etag, recursive);
}
return changed;
}
protected:
std::string m_text;
TextStyle *m_style;
};
}