GNU Octave  3.8.0
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Public Member Functions | Public Attributes | Friends | List of all members
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:
Collaboration graph
[legend]

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.
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.
bool isTransparent (const ColorEntry *palette) const
 Returns true if this character has a transparent background when it is drawn with the specified palette.

Public Attributes

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

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.
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.

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 ( 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

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().

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

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.

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 { ... }
CharacterColor Character::backgroundColor
quint16 Character::character

The unicode character value for this character.

Definition at line 75 of file Character.h.

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

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.

CharacterColor Character::foregroundColor
quint8 Character::rendition

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