nanogui: VT100 terminal emulation


Previous by date: 21 Apr 2007 19:24:41 +0100 VT100 terminal emulation, Yan Seiner
Next by date: 21 Apr 2007 19:24:41 +0100 Nano-X on Cirrus ARM/frame buffer ?, ehuang.ix.netcom.com
Previous in thread: 21 Apr 2007 19:24:41 +0100 VT100 terminal emulation, Yan Seiner
Next in thread: 21 Apr 2007 19:24:41 +0100 Re: VT100 terminal emulation, Yan Seiner

Subject: Re: [nanogui] VT100 terminal emulation
From: "Greg Haerr" ####@####.####
Date: 21 Apr 2007 19:24:41 +0100
Message-Id: <01fe01c78442$269893f0$6401a8c0@winXP>

: The vt100 terminal can set various display attributes; I would 
: appreciate some help with nano-X code snippets for the following:

Remember, that in order to not write all your code twice,
you'll have to save both the attribute and color along with 
the character in save memory, so that the expose event
"refresh" routine can redraw everything like it was drawn
in the first place.  And it would be nice to have the same
code do the drawing both initially and for the refresh, so
you're not duplicating everything.  This can be tested
by obscuring a portion of the window, and then uncovering
it, forcing a redraw event.  32 bits per character
(8 for the character, 8 bits for attribute and 16 bits
for foreground and background color will allow 
all input chars and colors/attributes to refresh properly)


: 1    Bright -> bold?
: 2    Dim -> ?? italic???

Bright, bold and dim are handled properly through 
bright, regular, and dim versions of each of the colors below.


: 4    Underscore -> I have no clue how to do this

Use GrLine underneath each character for the width
of the character, after drawing the character.


: 5    Blink -> ditto

This requires a timer which draws the character, then
the blank character each click.


: 7    Reverse -> I have the code for this

This just reverses the foreground and background color
from the colors below.


: 8    Hidden -> set fg = bg?

Draw blank characters rather than the "hidden" character.


:     Foreground Colours
: 30    Black
: 31    Red
: 32    Green
: 33    Yellow
: 34    Blue
: 35    Magenta
: 36    Cyan
: 37    White
: 
:     Background Colours
: 40    Black
: 41    Red
: 42    Green
: 43    Yellow
: 44    Blue
: 45    Magenta
: 46    Cyan
: 47    White

Each of these colors can be stored in an three arrays of 
RGB values.  Use the color according to whether you're drawing
regular, bright, or dim.   When a color change request
is parsed, just store the actual color requested, and use
the current attribute bits to determine the final displayed
color used to draw.

Note that you'll need to pick a foreground and background color
on startup/terminal initialization, and clear the screen to the
background color.  When the terminal scrolls, the bottom
line needs to scroll to the screen background color.

Hope this helps.

Regards,

Greg

Previous by date: 21 Apr 2007 19:24:41 +0100 VT100 terminal emulation, Yan Seiner
Next by date: 21 Apr 2007 19:24:41 +0100 Nano-X on Cirrus ARM/frame buffer ?, ehuang.ix.netcom.com
Previous in thread: 21 Apr 2007 19:24:41 +0100 VT100 terminal emulation, Yan Seiner
Next in thread: 21 Apr 2007 19:24:41 +0100 Re: VT100 terminal emulation, Yan Seiner


Powered by ezmlm-browse 0.20.