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