Mercurial > otakunoraifu
diff font/text.h @ 53:ddbcbd000206
* MuSys, AyuSysConfig, FileSearcher (former FILESEARCHER) and KeyHolder (former KEYHOLDER) are now singletons
* ParseMoji moved to TextStream
* Some cleaning (0 -> NULL when needed, removal of useless returns, ...)
author | thib |
---|---|
date | Sun, 19 Apr 2009 11:44:05 +0000 |
parents | 15a18fbe6f21 |
children |
line wrap: on
line diff
--- a/font/text.h +++ b/font/text.h @@ -51,32 +51,38 @@ struct TextElem { } impl; }; -struct TextStream { - std::vector<TextElem> container; - typedef std::vector<TextElem>::iterator Iterator; - enum {sjis, euc} kanji_type; +class TextStream { + public: + TextStream(void); + TextStream& operator =(const TextStream& from) { + container = from.container; + kanji_type = from.kanji_type; + return *this; + } - std::string Save(void); - void Load(const std::string&); + static TextStream ParseMoji(const char* str, int r, int g, int b, int size); + + std::string Save(void); + void Load(const std::string&); - void SetSize(double size); - void SetColor(unsigned char r, unsigned char g, unsigned char b); - void SetDefaultColor(unsigned char r, unsigned char g, unsigned char b); - void InsertColor(int begin_pos, int end_pos, unsigned char r, unsigned char g, unsigned char b); - void Clear(void); - void Add(const char* str); - void AddReturn(void); - void AddName(const char* name); - void AddRuby(const char* str, const char* ruby); + void SetSize(double size); + void SetColor(unsigned char r, unsigned char g, unsigned char b); + void SetDefaultColor(unsigned char r, unsigned char g, unsigned char b); + void InsertColor(int begin_pos, int end_pos, unsigned char r, unsigned char g, unsigned char b); + void Clear(void); + void Add(const char* str); + void AddReturn(void); + void AddName(const char* name); + void AddRuby(const char* str, const char* ruby); - void RemoveName(char* name, int namelen); + void RemoveName(char* name, int namelen); - TextStream(void); - TextStream& operator =(const TextStream& from) { - container = from.container; - kanji_type = from.kanji_type; - return *this; - } + public: + std::vector<TextElem> container; + typedef std::vector<TextElem>::iterator Iterator; + + enum {sjis, euc} kanji_type; + }; namespace XKFont {