NAME
Term::VTerm::State - provides access to the state layer of libvterm
METHODS
reset
$state->reset( $hard )
Resets the terminal state; performing either a soft or hard reset depending on the (optional) boolean value given.
get_cursorpos
$pos = $state->get_cursorpos
Returns the current cursor position as a Term::VTerm::Pos object.
get_default_colors
( $fg, $bg ) = $state->get_default_colors
Returns the default foreground and background colors from the palette as instances of Term::VTerm::Color.
set_default_colors
$state->set_default_colors( $fg, $bg )
Sets the default foreground and backgroudn colors to the palette from instances of Term::VTerm::Color.
get_palette_color
$col = $state->get_palette_color( $index )
Returns the palette color at the given index as an instance of Term::VTerm::Color.
get_penattr
$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 Term::VTerm::Color.
set_callbacks
$state->set_callbacks( %cbs )
Sets the state-layer callbacks. Takes the following named arguments:
- on_putglyph => CODE
-
$on_putglyph->( $glyphinfo, $pos )$glyphinfois a Term::VTerm::GlyphInfo instance.$posis a Term::VTerm::Pos. - on_movecursor => CODE
-
$on_movecursor->( $pos, $oldpos, $is_visible )$posand$oldposare a Term::VTerm::Pos.$is_visibleis a boolean. - on_scrollrect => CODE
-
$on_scrollrect->( $rect, $downward, $rightward )$rectis a Term::VTerm::Rect instance.$downwardand$rightwardare integers. - on_moverect => CODE
-
$on_moverect->( $dest, $src )$destand$srcare Term::VTerm::Rect instances. - on_erase => CODE
-
$on_erase->( $rect, $is_selective )$rectis a Term::VTerm::Rect instance.$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$oldlineinfoare Term::VTerm::LineInfo instances.
set_selection_callbacks
$state->set_selection_callbacks( %cbs )
Sets the state-layer selection callbacks. Takes the following named arguments:
- on_set
-
$on_set->( $mask, $content )$maskis a bitmask ofSELECTION_*constants.$contentis a plain perl string. - on_query
-
$on_query->( $mask )$maskis a bitmask ofSELECTION_*constants.
send_selection
$state->send_selection( $mask, $content )
Sends the selection, likely in response of a selection query request. $mask is a bitmask of SELECTION_* constants. $content is a plain perl string.
convert_color_to_rgb
$col = $state->convert_color_to_rgb( $col )
Converts a Term::VTerm::Color instance from indexed to RGB form.
AUTHOR
Paul Evans <leonerd@leonerd.org.uk>