nanogui: VT100 terminal emulation
Subject:
Re: [nanogui] VT100 terminal emulation
From:
Yan Seiner ####@####.####
Date:
23 Apr 2007 05:37:02 +0100
Message-Id: <462C3773.8050303@seiner.com>
Greg Haerr napsal(a):
> : 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)
>
Do you know if nxterm is doing all that properly? I'm using it as the
skeleton for all the Gr* functions; I've just ripped out all of the vt52
stuff and completely rewrote all of the codes handling.
>
> : 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.
>
OK. Is there a bold? Or do I need to load up a bold font?
>
> : 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.
>
OK.
>
> : 5 Blink -> ditto
>
> This requires a timer which draws the character, then
> the blank character each click.
>
Hmmm... This sounds like a pthread thing... Probably not something I
want to implement as I don't need it. I'll stub it out.
>
> : 7 Reverse -> I have the code for this
>
> This just reverses the foreground and background color
> from the colors below.
>
Stole that from nxterm.
>
> : 8 Hidden -> set fg = bg?
>
> Draw blank characters rather than the "hidden" character.
>
OK, I might need more info on that.
>
> : 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.
>
Well, I can put the code in, but my screen has 3 colors: black, white,
and gray. I can't guarantee that real colors will work correctly... My
driver maps everything between 0 0 0 and 255 255 255 as gray. :-)
--Yan