Term::VTerm::State - provides access to the state layer of libvterm
Term::VTerm::State
$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 Term::VTerm::Pos object.
( $fg, $bg ) = $state->get_default_colors
Returns the default foreground and background colors from the palette as instances of Term::VTerm::Color.
$state->set_default_colors( $fg, $bg )
Sets the default foreground and backgroudn colors to the palette from instances of Term::VTerm::Color.
$col = $state->get_palette_color( $index )
Returns the palette color at the given index as an instance of Term::VTerm::Color.
$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.
ATTR_*
$state->set_callbacks( %cbs )
Sets the state-layer callbacks. Takes the following named arguments:
$on_putglyph->( $glyphinfo, $pos )
$glyphinfo is a Term::VTerm::GlyphInfo instance. $pos is a Term::VTerm::Pos.
$glyphinfo
$pos
$on_movecursor->( $pos, $oldpos, $is_visible )
$pos and $oldpos are a Term::VTerm::Pos. $is_visible is a boolean.
$oldpos
$is_visible
$on_scrollrect->( $rect, $downward, $rightward )
$rect is a Term::VTerm::Rect instance. $downward and $rightward are integers.
$rect
$downward
$rightward
$on_moverect->( $dest, $src )
$dest and $src are Term::VTerm::Rect instances.
$dest
$src
$on_erase->( $rect, $is_selective )
$rect is a Term::VTerm::Rect instance. $is_selective is a boolean.
$is_selective
$on_initpen->()
$on_setpenattr->( $attr, $value )
$attr is one of the ATTR_* constants. The type of $value depends on the attribute type - see get_penattr.
$attr
$value
get_penattr
$on_settermprop->( $prop, $value )
$prop is one of the PROP_* constants. The type of $value depends on the property type - see similar to get_penattr.
$prop
PROP_*
$on_setmousemode->( $mode )
$mode is one of the MOUSE_* constants.
$mode
MOUSE_*
$on_bell->()
$on_setlineinfo->( $row, $lineinfo, $oldlineinfo )
$row is an integer. $lineinfo and $oldlineinfo are Term::VTerm::LineInfo instances.
$row
$lineinfo
$oldlineinfo
$state->set_selection_callbacks( %cbs )
Sets the state-layer selection callbacks. Takes the following named arguments:
$on_set->( $mask, $content )
$mask is a bitmask of SELECTION_* constants. $content is a plain perl string.
$mask
SELECTION_*
$content
$on_query->( $mask )
$mask is a bitmask of SELECTION_* constants.
$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.
$col = $state->convert_color_to_rgb( $col )
Converts a Term::VTerm::Color instance from indexed to RGB form.
Paul Evans <leonerd@leonerd.org.uk>
To install Term::VTerm, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Term::VTerm
CPAN shell
perl -MCPAN -e shell install Term::VTerm
For more information on module installation, please visit the detailed CPAN module installation guide.