NAME

TScreenCell - screen cell value type

SYNOPSIS

use TUI::Drivers;

my $cell = TScreenCell->new(
  bios => 0x1F,
);

$cell->setChar( 'A' );

my $attr = $cell->getAttr;
my $ch   = $cell->getChar;

DESCRIPTION

TScreenCell stores the character and color attributes associated with a screen cell.

A screen cell consists of:

  • a TColorAttr value describing the cell attributes

  • a TCellChar value describing the cell contents

Double-width characters occupy two adjacent screen cells. The first cell contains the character itself and the second cell contains a wide-character trail placeholder.

If a double-width character is not followed by a wide-character trail, or if a wide-character trail is not preceded by a double-width character, the character is considered to be partially overwritten.

CONSTRUCTOR

new

Creates a screen cell.

my $cell = TScreenCell->new();

Construct a cell using default attributes and an empty character value:

my $cell = TScreenCell->new( bios => 0x1F );

Construct a cell using a BIOS color attribute:

METHODS

equals

my $bool = $self->equals($other);

Returns true if both screen cells contain identical character and attribute values.

getAttr

my $attr = $self->getAttr();

Returns the TColorAttr associated with the cell.

getChar

my $ch = $self->getChar();

Returns the TCellChar stored in the cell.

isWide

my $bool = $self->isWide();

Returns true if the stored character does not occupy exactly one screen column.

setAttr

$self->setAttr($attr);

Sets the cell attributes.

setCell

$cell->setCell($char, $attr);

Sets both the character and the attributes of the cell.

setChar

$self->setChar($ch);

Sets the character stored in the cell.

SEE ALSO

TCellChar, TColorAttr

AUTHORS

  • magiblot <magiblot@hotmail.com> (original screen cell design)

  • J. Schneider <brickpool@cpan.org> (Perl implementation and maintenance)

COPYRIGHT AND LICENSE

Copyright (c) 2019-2026 the "AUTHORS" listed above.

This software is licensed under the MIT license (see the LICENSE file, which is part of the distribution).