NAME
FLTK::AnsiWidget - Displays ANSI escape codes
Description
Displays ANSI escape codes.
Escape sequences start with the characters ESC
(ASCII 27d/1Bh/033o) and [
(left bracket). This sequence is called CSI for "Control Sequence Introducer".
Supported control codes:
\t
-
tab (20 px)
\a
-
beep
\r
-
return
\n
-
next line
\xC
-
clear screen
\e[K
-
clear to end of line
\e[0m
-
reset all attributes to their defaults
\e[1m
-
set bold on
\e[4m
-
set underline on
\e[7m
-
reverse video
\e[21m
-
set bold off
\e[24m
-
set underline off
\e[27m
-
set reverse off
Functions
ansiToFltk
beep
clearScreen
drawImage
$ansiwidget->drawImage( $img, $x, $y, $sx, $sy, $w, $h );
-
Draws the given image onto the offscreen buffer.
drawLine
drawRect
drawRectFilled
$ansiwidget->drawRectFilled( $x1, $y1, $x2, $y2 );
-
Draw a filled rectangle onto the offscreen buffer.
getFontSize
getHeight
getPixel
my $color = $ansiwidget->getPixel( $x, $y );
-
Returns the color of the pixel at the given
x, y
location.
getWidth
getX
getY
layout
new
print
saveImage
$ansiwidget->saveImage( $filename, $x, $y, $w, $h );
-
Save the offscreen buffer to the given filename.
setColor
setFontSize
setPixel
$ansiwidget->setPixel( $x, $y, $color );
-
Sets the pixel to the given color at the given
X, Y
location.
setTextColor
setXY
textHeight
my $height = $ansiwidget->textHeight( );
-
Returns the height in pixels using the current font setting.
textWidth
my $width = $ansiwidget->textWidth( $string );
-
Returns the width in pixels using the current font setting.
See Also
For more information about ANSI code see:
http://en.wikipedia.org/wiki/ANSI_escape_code
http://www.uv.tietgen.dk/staff/mlha/PC/Soft/Prog/BAS/VB/Function.html
Author
Sanko Robinson <sanko@cpan.org> - http://sankorobinson.com/
License and Legal
Copyright (C) 2008-2010 by Sanko Robinson <sanko@cpan.org>
This program is free software; you can redistribute it and/or modify it under the terms of The Artistic License 2.0. See the LICENSE file included with this distribution or notes on the Artistic License 2.0 for clarification.
When separated from the distribution, all original POD documentation is covered by the Creative Commons Attribution-Share Alike 3.0 License. See the clarification of the CCA-SA3.0.