comparison 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
comparison
equal deleted inserted replaced
52:15a18fbe6f21 53:ddbcbd000206
49 float scale; 49 float scale;
50 } Size; 50 } Size;
51 } impl; 51 } impl;
52 }; 52 };
53 53
54 struct TextStream { 54 class TextStream {
55 std::vector<TextElem> container; 55 public:
56 typedef std::vector<TextElem>::iterator Iterator; 56 TextStream(void);
57 enum {sjis, euc} kanji_type; 57 TextStream& operator =(const TextStream& from) {
58 container = from.container;
59 kanji_type = from.kanji_type;
60 return *this;
61 }
58 62
59 std::string Save(void); 63 static TextStream ParseMoji(const char* str, int r, int g, int b, int size);
60 void Load(const std::string&);
61 64
62 void SetSize(double size); 65 std::string Save(void);
63 void SetColor(unsigned char r, unsigned char g, unsigned char b); 66 void Load(const std::string&);
64 void SetDefaultColor(unsigned char r, unsigned char g, unsigned char b);
65 void InsertColor(int begin_pos, int end_pos, unsigned char r, unsigned char g, unsigned char b);
66 void Clear(void);
67 void Add(const char* str);
68 void AddReturn(void);
69 void AddName(const char* name);
70 void AddRuby(const char* str, const char* ruby);
71 67
72 void RemoveName(char* name, int namelen); 68 void SetSize(double size);
69 void SetColor(unsigned char r, unsigned char g, unsigned char b);
70 void SetDefaultColor(unsigned char r, unsigned char g, unsigned char b);
71 void InsertColor(int begin_pos, int end_pos, unsigned char r, unsigned char g, unsigned char b);
72 void Clear(void);
73 void Add(const char* str);
74 void AddReturn(void);
75 void AddName(const char* name);
76 void AddRuby(const char* str, const char* ruby);
73 77
74 TextStream(void); 78 void RemoveName(char* name, int namelen);
75 TextStream& operator =(const TextStream& from) { 79
76 container = from.container; 80 public:
77 kanji_type = from.kanji_type; 81 std::vector<TextElem> container;
78 return *this; 82 typedef std::vector<TextElem>::iterator Iterator;
79 } 83
84 enum {sjis, euc} kanji_type;
85
80 }; 86 };
81 87
82 namespace XKFont { 88 namespace XKFont {
83 class Glyph; 89 class Glyph;
84 class Font; 90 class Font;