29 #include <QtCore/QHash> 41 #define DEFAULT_RENDITION 0 42 #define RE_BOLD (1 << 0) 43 #define RE_BLINK (1 << 1) 44 #define RE_UNDERLINE (1 << 2) 45 #define RE_REVERSE (1 << 3) // Screen only 46 #define RE_INTENSIVE (1 << 3) // Widget only 47 #define RE_CURSOR (1 << 4) 48 #define RE_EXTENDED_CHAR (1 << 5) 120 return a.character ==
b.character &&
121 a.rendition ==
b.rendition &&
122 a.foregroundColor ==
b.foregroundColor &&
123 a.backgroundColor ==
b.backgroundColor;
128 return a.character !=
b.character ||
129 a.rendition !=
b.rendition ||
130 a.foregroundColor !=
b.foregroundColor ||
131 a.backgroundColor !=
b.backgroundColor;
204 #endif // CHARACTER_H An entry in a terminal display's color palette.
ushort extendedCharHash(ushort *unicodePoints, ushort length) const
std::string hash(hash_fptr hash_fcn, const std::string &str, int result_buf_len)
static const int LINE_DOUBLEWIDTH
ushort * lookupExtendedChar(ushort hash, ushort &length) const
Looks up and returns a pointer to a sequence of unicode characters which was added to the table using...
#define DEFAULT_FORE_COLOR
#define DEFAULT_RENDITION
A single character in the terminal which consists of a unicode character value, foreground and backgr...
bool operator!=(const Character &a, const Character &b)
#define COLOR_SPACE_DEFAULT
Describes the color of a single character in the terminal.
bool operator==(const Character &a, const Character &b)
quint16 charSequence
Experimental addition which allows a single Character instance to contain more than one unicode chara...
ushort createExtendedChar(ushort *unicodePoints, ushort length)
Adds a sequences of unicode characters to the table and returns a hash code which can be used later t...
quint8 rendition
A combination of RENDITION flags which specify options for drawing the character. ...
unsigned short vt100_graphics[32]
bool extendedCharMatch(ushort hash, ushort *unicodePoints, ushort length) const
QHash< ushort, ushort * > extendedCharTable
unsigned char LineProperty
calling an anonymous function involves an overhead quite comparable to the overhead of an m file function Passing a handle to a built in function is because the interpreter is not involved in the internal loop For a
friend bool operator==(const Character &a, const Character &b)
Compares two characters and returns true if they have the same unicode character value, rendition and colors.
bool transparent
If true character backgrounds using this color should be transparent.
static const int LINE_WRAPPED
ExtendedCharTable()
Constructs a new character table.
friend bool operator!=(const Character &a, const Character &b)
Compares two characters and returns true if they have different unicode character values...
A table which stores sequences of unicode characters, referenced by hash keys.
CharacterColor backgroundColor
The color used to draw this character's background.
bool isBold(const ColorEntry *base) const
Returns true if this character should always be drawn in bold when it is drawn with the specified pal...
bool bold
If true characters drawn using this color should be bold.
CharacterColor foregroundColor
The foreground color used to draw this character.
static ExtendedCharTable instance
The global ExtendedCharTable instance.
quint16 character
The unicode character value for this character.
static const int LINE_DEFAULT
bool isTransparent(const ColorEntry *palette) const
Returns true if this character has a transparent background when it is drawn with the specified palet...
#define COLOR_SPACE_SYSTEM
static const int LINE_DOUBLEHEIGHT
Character(quint16 _c=' ', CharacterColor _f=CharacterColor(COLOR_SPACE_DEFAULT, DEFAULT_FORE_COLOR), CharacterColor _b=CharacterColor(COLOR_SPACE_DEFAULT, DEFAULT_BACK_COLOR), quint8 _r=0)
Constructs a new character.
#define DEFAULT_BACK_COLOR