GNU Octave  6.2.0
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
Character Class Reference

A single character in the terminal which consists of a unicode character value, foreground and background colors and a set of rendition attributes which specify how it should be drawn. More...

#include "Character.h"

Collaboration diagram for Character:

Public Member Functions

 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. More...
 
bool isBold (const ColorEntry *base) const
 Returns true if this character should always be drawn in bold when it is drawn with the specified palette, independent of whether or not the character has the RE_BOLD rendition flag. More...
 
bool isTransparent (const ColorEntry *palette) const
 Returns true if this character has a transparent background when it is drawn with the specified palette. More...
 

Public Attributes

union {
   quint16   character
 The unicode character value for this character. More...
 
   quint16   charSequence
 Experimental addition which allows a single Character instance to contain more than one unicode character. More...
 
}; 
 
CharacterColor backgroundColor
 The color used to draw this character's background. More...
 
CharacterColor foregroundColor
 The foreground color used to draw this character. More...
 
quint8 rendition
 A combination of RENDITION flags which specify options for drawing the character. More...
 

Friends

bool operator!= (const Character &a, const Character &b)
 Compares two characters and returns true if they have different unicode character values, renditions or colors. More...
 
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. More...
 

Detailed Description

A single character in the terminal which consists of a unicode character value, foreground and background colors and a set of rendition attributes which specify how it should be drawn.

Definition at line 55 of file Character.h.

Constructor & Destructor Documentation

◆ Character()

Character::Character ( quint16  _c = ' ',
CharacterColor  _f = CharacterColor(COLOR_SPACE_DEFAULT,DEFAULT_FORE_COLOR),
CharacterColor  _b = CharacterColor(COLOR_SPACE_DEFAULT,DEFAULT_BACK_COLOR),
quint8  _r = 0 
)
inline

Constructs a new character.

Parameters
_cThe unicode character value of this character.
_fThe foreground color used to draw the character.
_bThe color used to draw the character's background.
_rA set of rendition flags which specify how this character is to be drawn.

Definition at line 66 of file Character.h.

Member Function Documentation

◆ isBold()

bool Character::isBold ( const ColorEntry base) const
inline

Returns true if this character should always be drawn in bold when it is drawn with the specified palette, independent of whether or not the character has the RE_BOLD rendition flag.

Definition at line 142 of file Character.h.

References CharacterColor::_colorSpace, CharacterColor::_u, CharacterColor::_v, backgroundColor, BASE_COLORS, ColorEntry::bold, COLOR_SPACE_DEFAULT, and COLOR_SPACE_SYSTEM.

Referenced by TerminalView::drawCharacters().

◆ isTransparent()

bool Character::isTransparent ( const ColorEntry palette) const
inline

Returns true if this character has a transparent background when it is drawn with the specified palette.

Definition at line 134 of file Character.h.

References CharacterColor::_colorSpace, CharacterColor::_u, CharacterColor::_v, backgroundColor, BASE_COLORS, COLOR_SPACE_DEFAULT, COLOR_SPACE_SYSTEM, and ColorEntry::transparent.

Friends And Related Function Documentation

◆ operator!=

bool operator!= ( const Character a,
const Character b 
)
friend

Compares two characters and returns true if they have different unicode character values, renditions or colors.

Definition at line 126 of file Character.h.

◆ operator==

bool operator== ( const Character a,
const Character b 
)
friend

Compares two characters and returns true if they have the same unicode character value, rendition and colors.

Definition at line 118 of file Character.h.

Member Data Documentation

◆ 

union { ... }

◆ backgroundColor

◆ character

quint16 Character::character

The unicode character value for this character.

Definition at line 75 of file Character.h.

Referenced by TerminalView::clearImage(), TerminalView::drawContents(), Screen::ShowCharacter(), and TerminalView::updateImage().

◆ charSequence

quint16 Character::charSequence

Experimental addition which allows a single Character instance to contain more than one unicode character.

charSequence is a hash code which can be used to look up the unicode character sequence in the ExtendedCharTable used to create the sequence.

Definition at line 83 of file Character.h.

◆ foregroundColor

◆ rendition

quint8 Character::rendition

The documentation for this class was generated from the following file: