NAME
TUI::Drivers::ScreenCell - screen cell value type
SYNOPSIS
use TUI::Drivers;
my $cell = TScreenCell->new(
bios => 0x411F,
);
$cell = TScreenCell->new(
ch => 'A',
attr => 0x1F,
);
$cell->character( 'A' );
my $attr = $cell->attribute;
my $ch = $cell->character;
DESCRIPTION
TScreenCell stores the character and color attributes associated with a screen cell.
A screen cell consists of:
a TScreenCharacter value describing the cell contents
a TColorAttr value describing the cell attributes
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.
TScreenCharacter is designed to be compatible with Borland's Turbo Vision cell structure, and it is therefore trivially constructible and copyable via "assign" and "clone".
A zero-initialized TScreenCharacter is valid and represents the text of an empty screen cell.
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 => 0x411F );
Construct a cell from a PC text-mode character/attribute word.
my $cell = TScreenCell->new( ch => $char, attr => $attr );
Construct a cell consisting of a character and an attribute value.
METHODS
assign
$self->assign($other);
Copies the contents of another TScreenCell into the current one.
attribute
my $attr = $self->attribute();
$self->attribute($attr);
Sets the cell attributes or returns the TColorAttr associated with the cell.
character
my $ch = $self->character();
$self->character($ch);
Sets the character stored in the cell or returns the TScreenCharacter stored in the cell.
clone
my $cell = $self->clone();
Returns a new TScreenCell object that is a copy of the current one.
equals
my $bool = $self->equals($other);
Returns true if both screen cells contain identical character and attribute values.
OPERATORS
Numeric equality
$a == $b
Returns true when TScreenCell values contain identical data.
SEE ALSO
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).