NAME
Term::VTerm::Screen
- provides access to the screen layer of libvterm
METHODS
enable_altscreen
$screen->enable_altscreen( $enabled )
Controls whether the altscreen buffer is enabled. Doing so allows the DEC altscreen mode to switch between regular and alternate screen buffers, but consumes more memory.
flush_damage
$screen->flush_damage
Flushes all pending damage through the screen to the damage callback.
set_damage_merge
$screen->set_damage_merge( $size )
Sets the damage merge size, as one of the DAMAGE_*
constants.
reset
$screen->reset( $hard )
Resets the terminal state; performing either a soft or hard reset depending on the (optional) boolean value given.
get_cell
$cell = $screen->get_cell( $pos )
Returns a VTermScreenCell
object representing the current state of the cell at the given location. Note that this is an instantaneous snapshot - the returned object will not update to reflect later changes in the screen's state.
get_text
$str = $screen->get_text( $rect )
Returns a UTF-8 string containing the text in the screen buffer within the given VTermRect
.
set_callbacks
$screen->set_callbacks( %cbs )
Sets the screen-layer callbacks. Takes the following named arguments:
- on_damage => CODE
-
$on_damage->( $rect )
$rect
is aVTermRect
structure. - on_moverect => CODE
-
$on_moverect->( $dest, $src )
$dest
and$src
areVTermRect
structures. - on_movecursor => CODE
-
$on_movecursor->( $pos, $oldpos, $is_visible )
$pos
and$oldpos
are aVTermPos
.$is_visible
is a boolean. - on_settermprop => CODE
-
$on_settermprop->( $prop, $value )
$prop
is one of thePROP_*
constants. The type of$value
depends on the property type - see similar toget_penattr
. - on_bell => CODE
-
$on_bell->()
- on_resize => CODE
-
$on_resize->( $rows, $cols )
convert_color_to_rgb
$col = $screen->convert_color_to_rgb( $col )
Converts a VTermColor
structure from indexed to RGB form.
CELL OBJECTS
A VTermScreenCell
instance has the following field accessors:
@chars = $cell->chars
A list of Unicode character numbers. This list does not include the terminating 0.
$str = $cell->str
A UTF-8 string containing the characters (normally just one but it may be followed by zero-width combining marks).
$width = $cell->width
The width of the cell in columns. Normally 1, but 2 for a Unicode double-width character, or the special value of -1 on the "second" cell of such a character.
$bold = $cell->bold
$underline = $cell->underline
$italic = $cell->italic
$blink = $cell->blink
$reverse = $cell->reverse
$strike = $cell->strike
Simple rendering attributes. All are boolean values, except underline
which is an integer between 0 and 2 (to support double-underline).
$font = $cell->font
Font selection; an integer between 0 and 10.
$fg = $cell->fg
$bg = $cell->bg
The foreground and background colours, as VTermColor
instances.
AUTHOR
Paul Evans <leonerd@leonerd.org.uk>