NAME
Term::VTerm::State - provides access to the state layer of libvterm
METHODS
$state->reset( $hard )
Resets the terminal state; performing either a soft or hard reset depending on the (optional) boolean value given.
$pos = $state->get_cursorpos
Returns the current cursor position as a VTermPos object.
$fg, $bg = $state->get_default_colors
Returns the default foreground and background colors from the palette as instances of VTermColor.
$col = $state->get_palette_color( $index )
Returns the palette color at the given index as an instance of VTermColor.
$value = $state->get_penattr( $attr )
Returns the current value of the given pen attribute (as one of the ATTR_* constants). Boolean, integer or string attributes are represented as native perl values. Color attributes return an instance of VTermColor.
$state->set_callbacks( %cbs )
Sets the state-layer callbacks. Takes the following named arguments:
- on_putglyph => CODE
-
$on_putglyph->( $glyphinfo, $pos )$glyphinfois aVTermGlyphInfostructure.$posis aVTermPos. - on_movecursor => CODE
-
$on_movecursor->( $pos, $oldpos, $is_visible )$posand$oldposare aVTermPos.$is_visibleis a boolean. - on_scrollrect => CODE
-
$on_scrollrect->( $rect, $downward, $rightward )$rectis aVTermRectstructure.$downwardand$rightwardare integers. - on_moverect => CODE
-
$on_moverect->( $dest, $src )$destand$srcareVTermRectstructures. - on_erase => CODE
-
$on_erase->( $rect, $is_selective )$rectis aVTermRectstructure.$is_selectiveis a boolean. - on_initpen => CODE
-
$on_initpen->() - on_setpenattr => CODE
-
$on_setpenattr->( $attr, $value )$attris one of theATTR_*constants. The type of$valuedepends on the attribute type - seeget_penattr. - on_settermprop => CODE
-
$on_settermprop->( $prop, $value )$propis one of thePROP_*constants. The type of$valuedepends on the property type - see similar toget_penattr. - on_setmousemode => CODE
-
$on_setmousemode->( $mode )$modeis one of theMOUSE_*constants. - on_bell => CODE
-
$on_bell->() - on_setlineinfo => CODE
-
$on_setlineinfo->( $row, $lineinfo, $oldlineinfo )$rowis an integer.$lineinfoand$oldlineinfoareVTermLineInfostructures.
AUTHOR
Paul Evans <leonerd@leonerd.org.uk>