[NTOS]: Start using colored pages. This will help performance on real systems signifi...
[reactos.git] / base / applications / network / telnet / src / ansiprsr.h
1 #pragma once
2
3 #include <stdio.h>
4 #include <stdlib.h>
5 #include <ctype.h>
6 #include <string.h>
7 #include "tnconfig.h"
8 #include "tparser.h"
9
10 // added this color table to make things go faster (Paul Branann 5/8/98)
11 enum Colors {BLACK=0, BLUE, GREEN, CYAN, RED, MAGENTA, YELLOW, WHITE};
12 extern const int ANSIColors[];
13
14 // This should be greater than the largest conceivable window size
15 // 200 should suffice
16 #define MAX_TAB_POSITIONS 200
17
18 // Added by Frediano Ziglio 6/2/2000
19 // Include Meridian Emulator support
20 // undefine it to remove support
21 #define MTE_SUPPORT 1
22
23 // TANSIParser is now properly no longer a base class for TTelnetParser.
24 // Screen output is handled in TConsole.cpp.
25 // (Paul Brannan 6/15/98)
26 class TANSIParser : public TParser {
27 private:
28 char* ParseEscapeANSI(char* pszBuffer, char* pszBufferEnd);
29 char* ParseANSIBuffer(char* pszBuffer, char* pszBufferEnd);
30 char* ParseEscape(char* pszBuffer, char* pszBufferEnd);
31 // Added by I.Ioannou 06/04/97
32 char* PrintBuffer(char* pszBuffer, char* pszBufferEnd);
33 char* PrintGoodChars(char * pszHead, char * pszTail);
34
35 #ifdef MTE_SUPPORT
36 // Added by Frediano Ziglio, 5/31/2000
37 char* ParseEscapeMTE(char* pszBuffer, char* pszBufferEnd);
38 short int mteRegionXF,mteRegionYF;
39 #endif
40
41 void ConSetAttribute(unsigned char wAttr);
42 const char *GetTerminalID();
43 void ConSetCursorPos(int x, int y);
44 void ResetTerminal();
45 void Init();
46
47 void SaveCurX(int iX);
48 void SaveCurY(int iY);
49
50 void resetTabStops();
51
52 int iSavedCurX;
53 int iSavedCurY;
54 unsigned char iSavedAttributes;
55 FILE * dumpfile;
56
57 // Added by I.Ioannou 06 April 1997
58 FILE * printfile;
59 char InPrintMode;
60 int inGraphMode;
61
62 char last_char; // TITUS++: 2. November 98
63
64 char map_G0, map_G1;
65 int current_map;
66 bool vt52_mode;
67 bool print_ctrl;
68 bool ignore_margins;
69 bool fast_write;
70 bool newline_mode;
71
72 int tab_stops[MAX_TAB_POSITIONS];
73
74 public:
75 // Changed by Paul Brannan 5/13/98
76 TANSIParser(TConsole &Console, KeyTranslator &RefKeyTrans,
77 TScroller &RefScroller, TNetwork &NetHandler, TCharmap &RefCharmap);
78 ~TANSIParser();
79
80 char* ParseBuffer(char* pszBuffer, char* pszBufferEnd);
81 static int StripBuffer(char* pszBuffer, char* pszBufferEnd, int width);
82 };