Main Page   Packages   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Search  

C:/temp/src/j2k/Deprecated/old_18mar_diff/nto/ANSI.hpp File Reference

#include <j2k/Fred/Standard.hpp>

Go to the source code of this file.

Enumerations

enum  VideoMode_t {
  Text40x25BW = 0x0000, Text40x25C = 0x0001, Text40 = 0x0001, Text80x25BW = 0x0002,
  Text80x25C = 0x0003, Text80 = 0x0003, Graph320x200x4C = 0x0004, Graph320x200x4BW = 0x0005,
  Graph640x200x4C = 0x0006, GraphMonoCard = 0x0007, Graph160x200x16jr = 0x0008, Graph320x200x16jr = 0x0009,
  Graph640x200x4jr = 0x000A, Graph320x200x16 = 0x000D, Graph640x200x16 = 0x000E, Graph640x350BW = 0x000F,
  Graph640x350x16 = 0x0010, Graph640x480x2 = 0x0011, Graph640x480x16 = 0x0012, VGA16 = 0x0012,
  Graph320x200x256 = 0x0013, VGA256 = 0x0013
}
enum  TextAttr_t {
  NoAttribute = 0, Bold = 1, Underline = 4, Flashing = 5,
  InverseVideo = 7, HiddenText = 8
}
enum  Color_t {
  Black = 0, Red = 1, Green = 2, Yellow = 3,
  Blue = 4, Purple = 5, Cyan = 6, White = 7
}

Functions

void Locate (USHORT row, USHORT col)
void gotoXY (USHORT row, USHORT col)
void goUp (USHORT y)
void goDown (USHORT y)
void goRight (USHORT x)
void goLeft (USHORT y)
void saveCursor ()
void loadCursor ()
void EraseLine ()
void screen (enum VideoMode_t mode=Text80)
void screenNoLine (enum VideoMode_t mode=Text80)
void Center (short row, const char *text)
void ColorName (enum Color_t fg=White, enum Color_t bg=Black, enum TextAttr_t txtAttr=NoAttribute)
void Color (short fg, short bg)
void QBColor (short fg=7, short bg=0)
void Cls (short bg)

Variables

const char * colorNameTable [16]
short Ansi2QBColorTable [8]
int NoColor = 0


Enumeration Type Documentation

enum Color_t
 

Enumeration values:
Black 
Red 
Green 
Yellow 
Blue 
Purple 
Cyan 
White 

Definition at line 125 of file ANSI.hpp.

00125              { 
00126   Black   = 0,
00127   Red     = 1,
00128   Green   = 2,
00129   Yellow  = 3,
00130   Blue    = 4,
00131   Purple  = 5,
00132   Cyan    = 6,
00133   White   = 7
00134 };

enum TextAttr_t
 

Enumeration values:
NoAttribute 
Bold 
Underline 
Flashing 
InverseVideo 
HiddenText 

Definition at line 116 of file ANSI.hpp.

00116                 { 
00117   NoAttribute  = 0, /* Aucun attribut */
00118   Bold         = 1, /* Gras */
00119   Underline    = 4, /* Souligné (moniteurs monochromes uniquement) */
00120   Flashing     = 5, /* Clignotant */
00121   InverseVideo = 7, /* Vidéo inverse */
00122   HiddenText   = 8  /* Caché */
00123 };

enum VideoMode_t
 

Enumeration values:
Text40x25BW 
Text40x25C 
Text40 
Text80x25BW 
Text80x25C 
Text80 
Graph320x200x4C 
Graph320x200x4BW 
Graph640x200x4C 
GraphMonoCard 
Graph160x200x16jr 
Graph320x200x16jr 
Graph640x200x4jr 
Graph320x200x16 
Graph640x200x16 
Graph640x350BW 
Graph640x350x16 
Graph640x480x2 
Graph640x480x16 
VGA16 
Graph320x200x256 
VGA256 

Definition at line 46 of file ANSI.hpp.

00046                  {
00047   Text40x25BW       = 0x0000,     // Color card
00048 
00049   Text40x25C        = 0x0001,
00050   Text40            = 0x0001,     // Old Big Text Mode 40x25
00051 
00052   Text80x25BW       = 0x0002,
00053 
00054   Text80x25C        = 0x0003,     // Classic Text Mode 80x25
00055   Text80            = 0x0003,
00056                        
00057   Graph320x200x4C   = 0x0004,        
00058   Graph320x200x4BW  = 0x0005,
00059 
00060   Graph640x200x4C   = 0x0006,
00061 
00062   GraphMonoCard     = 0x0007,
00063 
00064   Graph160x200x16jr = 0x0008,     // PC Junior and higher
00065   Graph320x200x16jr = 0x0009,
00066   Graph640x200x4jr  = 0x000A,
00067                         
00068   Graph320x200x16   = 0x000D,     // EGA and higher
00069   Graph640x200x16   = 0x000E,
00070   Graph640x350BW    = 0x000F,
00071   Graph640x350x16   = 0x0010,
00072 
00073   Graph640x480x2    = 0x0011,     // MCGA and higher
00074 
00075   Graph640x480x16   = 0x0012,     // Classic VGA 16 color
00076   VGA16             = 0x0012,
00077 
00078   Graph320x200x256  = 0x0013,     // Classic VGA 256 color (MCGA+)
00079   VGA256            = 0x0013
00080 };


Function Documentation

void Center short    row,
const char *    text
 

Definition at line 91 of file ANSI.hpp.

00091                                            {
00092   register short col = 41 - strlen( text ) / 2;
00093   Locate( row, col );
00094   printf("%s", text );
00095 }

void Cls short    bg
 

Definition at line 188 of file ANSI.hpp.

00188                      {
00189    QBColor( 7, bg );
00190    printf("\033[2J" );
00191 }

void Color short    fg,
short    bg
 

Definition at line 156 of file ANSI.hpp.

00157 {
00158    register short a = 0;
00159    if ( fg > 7  && fg <= 15 ) { a = 1; fg -=  8; }
00160    if ( fg > 15 && fg <= 22 ) { a = 5; fg -= 16; }
00161    if ( fg > 22 && fg <= 30 ) { a = 6; fg -= 24; }
00162 
00163    register short f = ( fg ) + 30;
00164    register short b = ( bg ) + 40;
00165 
00166    printf("\033[%d;%d;%dm", a, f, b );
00167 }

void ColorName enum Color_t    fg = White,
enum Color_t    bg = Black,
enum TextAttr_t    txtAttr = NoAttribute
 

Definition at line 147 of file ANSI.hpp.

00148 {
00149    register short f = (short)fg + 30;
00150    register short b = (short)bg + 40;
00151    register short a = (short)txtAttr;
00152 
00153    printf("\033[%d;%d;%dm", a, f, b );
00154 }

void EraseLine  
 

Definition at line 42 of file ANSI.hpp.

00042                  {
00043    printf("\033[K" );
00044 }

void Locate USHORT    row,
USHORT    col
 

Definition at line 10 of file ANSI.hpp.

00010                                       {
00011    printf("\033[%d;%dH", row, col );
00012 }

void QBColor short    fg = 7,
short    bg = 0
 

Definition at line 171 of file ANSI.hpp.

00172 {
00173    if ( NoColor ) return;
00174    register short a = 0;
00175    if ( fg > 7  && fg <= 15 ) { a = 1; fg -=  8; }
00176    if ( fg > 15 && fg <= 22 ) { a = 5; fg -= 16; }
00177    if ( fg > 22 && fg <= 30 ) { a = 6; fg -= 24; }
00178 
00179    register short qb_fg = Ansi2QBColorTable[ fg ];
00180    register short qb_bg = Ansi2QBColorTable[ bg ];
00181    register short f = ( qb_fg ) + 30;
00182    register short b = ( qb_bg ) + 40;
00183 
00184    printf("\033[%d;%d;%dm", a, f, b );
00185 }

void goDown USHORT    y
 

Definition at line 22 of file ANSI.hpp.

00022                         {
00023    printf("\033[%dB", y );
00024 }

void goLeft USHORT    y
 

Definition at line 30 of file ANSI.hpp.

00030                         {
00031    printf("\033[%dD", y );
00032 }

void goRight USHORT    x
 

Definition at line 26 of file ANSI.hpp.

00026                          {
00027    printf("\033[%dC", x );
00028 }

void goUp USHORT    y
 

Definition at line 18 of file ANSI.hpp.

00018                       {
00019    printf("\033[%dA", y );
00020 }

void gotoXY USHORT    row,
USHORT    col
 

Definition at line 14 of file ANSI.hpp.

00014                                       {
00015    printf("\033[%d;%df", row, col );
00016 }

void loadCursor  
 

Definition at line 38 of file ANSI.hpp.

00038                   {
00039    printf("\033[u" );
00040 }

void saveCursor  
 

Definition at line 34 of file ANSI.hpp.

00034                   {
00035    printf("\033[s" );
00036 }

void screen enum VideoMode_t    mode = Text80
 

Definition at line 82 of file ANSI.hpp.

00082                                               {
00083  printf("\033[=%dh", (short)mode );
00084 }

void screenNoLine enum VideoMode_t    mode = Text80
 

Definition at line 87 of file ANSI.hpp.

00087                                                     {
00088  printf("\033[=%dl", (short)mode );
00089 }


Variable Documentation

short Ansi2QBColorTable[ 8 ]
 

Initial value:

 {
  0,  
  4,  
  2,  
  6,  
  1,  
  5,  
  3,  
  7   
}

Definition at line 136 of file ANSI.hpp.

int NoColor = 0 [static]
 

Definition at line 169 of file ANSI.hpp.

const char* colorNameTable[ 16 ]
 

Initial value:

 {
  "Black        ",
  "Dark Red     ",
  "Dark Green   ",
  "Brown        ",
  "Dark Blue    ",
  "Dark Purple  ",
  "Dark Cyan    ",
  "Dark White   ",
  "Gray         ",
  "Bright Red   ",
  "Bright Green ",
  "Bright Yellow",
  "Bright Blue  ",
  "Bright Purple",
  "Bright Cyan  ",
  "Bright White "
}

Definition at line 97 of file ANSI.hpp.


Generated on Sun Oct 14 18:47:12 2001 for Standard J2K Library by doxygen1.2.11.1 written by Dimitri van Heesch, © 1997-2001