Changeset View
Changeset View
Standalone View
Standalone View
src/Character.h
Show All 19 Lines | 1 | /* | |||
---|---|---|---|---|---|
20 | 02110-1301 USA. | 20 | 02110-1301 USA. | ||
21 | */ | 21 | */ | ||
22 | 22 | | |||
23 | #ifndef CHARACTER_H | 23 | #ifndef CHARACTER_H | ||
24 | #define CHARACTER_H | 24 | #define CHARACTER_H | ||
25 | 25 | | |||
26 | // Konsole | 26 | // Konsole | ||
27 | #include "CharacterColor.h" | 27 | #include "CharacterColor.h" | ||
28 | #include "konsole_wcwidth.h" | 28 | #include "CharacterWidth.h" | ||
29 | 29 | | |||
30 | // Qt | 30 | // Qt | ||
31 | #include <QVector> | 31 | #include <QVector> | ||
32 | 32 | | |||
33 | namespace Konsole { | 33 | namespace Konsole { | ||
34 | typedef unsigned char LineProperty; | 34 | typedef unsigned char LineProperty; | ||
35 | 35 | | |||
36 | typedef quint16 RenditionFlags; | 36 | typedef quint16 RenditionFlags; | ||
▲ Show 20 Lines • Show All 123 Lines • ▼ Show 20 Line(s) | 155 | { | |||
160 | } | 160 | } | ||
161 | } | 161 | } | ||
162 | 162 | | |||
163 | inline int width() const { | 163 | inline int width() const { | ||
164 | return width(character); | 164 | return width(character); | ||
165 | } | 165 | } | ||
166 | 166 | | |||
167 | static int width(uint ucs4) { | 167 | static int width(uint ucs4) { | ||
168 | return konsole_wcwidth(ucs4); | 168 | return characterWidth(ucs4); | ||
169 | } | 169 | } | ||
170 | 170 | | |||
171 | static int stringWidth(const uint *ucs4Str, int len) { | 171 | static int stringWidth(const uint *ucs4Str, int len) { | ||
172 | int w = 0; | 172 | int w = 0; | ||
173 | for (int i = 0; i < len; ++i) { | 173 | for (int i = 0; i < len; ++i) { | ||
174 | w += width(ucs4Str[i]); | 174 | w += width(ucs4Str[i]); | ||
175 | } | 175 | } | ||
176 | return w; | 176 | return w; | ||
Show All 28 Lines |