|
|
1.1 root 1: // Borland C++ Builder
2: // Copyright (c) 1995, 2002 by Borland Software Corporation
3: // All rights reserved
4:
5: // (DO NOT EDIT: machine generated header) 'EmulVT.pas' rev: 6.00
6:
7: #ifndef EmulVTHPP
8: #define EmulVTHPP
9:
10: #pragma delphiheader begin
11: #pragma option push -w-
12: #pragma option push -Vx
13: #include <Clipbrd.hpp> // Pascal unit
14: #include <StdCtrls.hpp> // Pascal unit
15: #include <Dialogs.hpp> // Pascal unit
16: #include <Forms.hpp> // Pascal unit
17: #include <Controls.hpp> // Pascal unit
18: #include <Graphics.hpp> // Pascal unit
19: #include <Classes.hpp> // Pascal unit
20: #include <Messages.hpp> // Pascal unit
21: #include <Windows.hpp> // Pascal unit
22: #include <SysUtils.hpp> // Pascal unit
23: #include <SysInit.hpp> // Pascal unit
24: #include <System.hpp> // Pascal unit
25:
26: //-- user supplied -----------------------------------------------------------
27:
28: namespace Emulvt
29: {
30: //-- type declarations -------------------------------------------------------
31: #pragma option push -b-
32: enum TBackColors { vtsBlack, vtsRed, vtsGreen, vtsYellow, vtsBlue, vtsMagenta, vtsCyan, vtsWhite };
33: #pragma option pop
34:
35: #pragma option push -b-
36: enum TScreenOption { vtoBackColor, vtoCopyBackOnClear };
37: #pragma option pop
38:
39: typedef Set<TScreenOption, vtoBackColor, vtoCopyBackOnClear> TScreenOptions;
40:
41: typedef char TXlatTable[256];
42:
43: typedef char *PXlatTable;
44:
45: typedef SmallString<50> TFuncKeyValue;
46:
47: typedef TFuncKeyValue *PFuncKeyValue;
48:
49: #pragma pack(push, 1)
50: struct TFuncKey
51: {
52: char ScanCode;
53: Classes::TShiftState Shift;
54: bool Ext;
55: TFuncKeyValue Value;
56: } ;
57: #pragma pack(pop)
58:
59: typedef TFuncKey TFuncKeysTable[64];
60:
61: typedef TFuncKey *PFuncKeysTable;
62:
63: typedef void __fastcall (__closure *TKeyBufferEvent)(System::TObject* Sender, char * Buffer, int Len);
64:
65: typedef void __fastcall (__closure *TKeyDownEvent)(System::TObject* Sender, int &VirtKey, Classes::TShiftState &Shift, bool &ShiftLock, char &ScanCode, bool &Ext);
66:
67: class DELPHICLASS TLine;
68: class PASCALIMPLEMENTATION TLine : public System::TObject
69: {
70: typedef System::TObject inherited;
71:
72: public:
73: char Txt[161];
74: Byte Att[161];
75: __fastcall TLine(void);
76: void __fastcall Clear(Byte Attr);
77: public:
78: #pragma option push -w-inl
79: /* TObject.Destroy */ inline __fastcall virtual ~TLine(void) { }
80: #pragma option pop
81:
82: };
83:
84:
85: typedef TLine* TLineArray[16383];
86:
87: typedef TLine* *PLineArray;
88:
89: class DELPHICLASS TScreen;
90: class PASCALIMPLEMENTATION TScreen : public System::TObject
91: {
92: typedef System::TObject inherited;
93:
94: public:
95: TLine* *FLines;
96: int FRow;
97: int FCol;
98: int FRowSaved;
99: int FColSaved;
100: int FScrollRowTop;
101: int FScrollRowBottom;
102: Byte FAttribute;
103: bool FForceHighBit;
104: bool FReverseVideo;
105: bool FUnderLine;
106: int FRowCount;
107: int FColCount;
108: int FBackRowCount;
109: int FBackEndRow;
110: TBackColors FBackColor;
111: TScreenOptions FOptions;
112: System::SmallString<80> FEscBuffer;
113: bool FEscFlag;
114: bool Focused;
115: bool FAutoLF;
116: bool FAutoCR;
117: bool FAutoWrap;
118: bool FCursorOff;
119: bool FCKeyMode;
120: bool FNoXlat;
121: bool FNoXlatInitial;
122: int FCntLiteral;
123: bool FCarbonMode;
124: char *FXlatInputTable;
125: char *FXlatOutputTable;
126: char FCharSetG0;
127: char FCharSetG1;
128: char FCharSetG2;
129: char FCharSetG3;
130: bool FAllInvalid;
131: #pragma pack(push, 1)
132: Types::TRect FInvRect;
133: #pragma pack(pop)
134:
135: Classes::TNotifyEvent FOnCursorVisible;
136: __fastcall TScreen(void);
137: __fastcall virtual ~TScreen(void);
138: void __fastcall AdjustFLines(int NewCount);
139: void __fastcall CopyScreenToBack(void);
140: void __fastcall SetRowCount(int NewCount);
141: void __fastcall SetBackRowCount(int NewCount);
142: void __fastcall InvRect(int nRow, int nCol);
143: void __fastcall InvClear(void);
144: void __fastcall SetLines(int I, TLine* Value);
145: TLine* __fastcall GetLines(int I);
146: void __fastcall WriteChar(char Ch);
147: void __fastcall WriteStr(AnsiString Str);
148: AnsiString __fastcall ReadStr();
149: void __fastcall GotoXY(int X, int Y);
150: void __fastcall WriteLiteralChar(char Ch);
151: void __fastcall ProcessEscape(char EscCmd);
152: void __fastcall SetAttr(char Att);
153: void __fastcall CursorRight(void);
154: void __fastcall CursorLeft(void);
155: void __fastcall CursorDown(void);
156: void __fastcall CursorUp(void);
157: void __fastcall CarriageReturn(void);
158: void __fastcall ScrollUp(void);
159: void __fastcall ScrollDown(void);
160: void __fastcall ClearScreen(void);
161: void __fastcall BackSpace(void);
162: void __fastcall Eol(void);
163: void __fastcall Eop(void);
164: void __fastcall ProcessESC_D(void);
165: void __fastcall ProcessESC_M(void);
166: void __fastcall ProcessESC_E(void);
167: void __fastcall ProcessCSI_u(void);
168: void __fastcall ProcessCSI_I(void);
169: void __fastcall ProcessCSI_J(void);
170: void __fastcall ProcessCSI_K(void);
171: void __fastcall ProcessCSI_L(void);
172: void __fastcall ProcessCSI_M(void);
173: void __fastcall ProcessCSI_m_lc(void);
174: void __fastcall ProcessCSI_n_lc(void);
175: void __fastcall ProcessCSI_at(void);
176: void __fastcall ProcessCSI_r_lc(void);
177: void __fastcall ProcessCSI_s_lc(void);
178: void __fastcall ProcessCSI_u_lc(void);
179: void __fastcall ProcessCSI_7(void);
180: void __fastcall ProcessCSI_8(void);
181: void __fastcall ProcessCSI_H(void);
182: void __fastcall ProcessCSI_h_lc(void);
183: void __fastcall ProcessCSI_l_lc(void);
184: void __fastcall ProcessCSI_A(void);
185: void __fastcall ProcessCSI_B(void);
186: void __fastcall ProcessCSI_C(void);
187: void __fastcall ProcessCSI_D(void);
188: void __fastcall ProcessCSI_P(void);
189: void __fastcall ProcessCSI_S(void);
190: void __fastcall ProcessCSI_T(void);
191: void __fastcall process_charset_G0(char EscCmd);
192: void __fastcall process_charset_G1(char EscCmd);
193: void __fastcall process_charset_G2(char EscCmd);
194: void __fastcall process_charset_G3(char EscCmd);
195: void __fastcall UnimplementedEscape(char EscCmd);
196: void __fastcall InvalidEscape(char EscCmd);
197: int __fastcall GetEscapeParam(int From, int &Value);
198: __property Classes::TNotifyEvent OnCursorVisible = {read=FOnCursorVisible, write=FOnCursorVisible};
199: __property TLine* Lines[int I] = {read=GetLines, write=SetLines};
200: };
201:
202:
203: class DELPHICLASS TCustomEmulVT;
204: class PASCALIMPLEMENTATION TCustomEmulVT : public Controls::TCustomControl
205: {
206: typedef Controls::TCustomControl inherited;
207:
208: private:
209: int FCharPos[162];
210: int FLinePos[52];
211: TextFile FFileHandle;
212: bool FCursorVisible;
213: bool FCaretShown;
214: bool FCaretCreated;
215: int FLineHeight;
216: float FLineZoom;
217: int FCharWidth;
218: float FCharZoom;
219: bool FGraphicDraw;
220: int FInternalLeading;
221: Forms::TFormBorderStyle FBorderStyle;
222: int FBorderWidth;
223: bool FAutoRepaint;
224: Graphics::TFont* FFont;
225: Stdctrls::TScrollBar* FVScrollBar;
226: int FTopLine;
227: bool FLocalEcho;
228: TKeyBufferEvent FOnKeyBuffer;
229: TKeyDownEvent FOnKeyDown;
230: int FFKeys;
231: bool FMonoChrome;
232: bool FLog;
233: Forms::TMessageEvent FAppOnMessage;
234: bool FFlagCirconflexe;
235: bool FFlagTrema;
236: #pragma pack(push, 1)
237: Types::TRect FSelectRect;
238: #pragma pack(pop)
239:
240: int FTopMargin;
241: int FLeftMargin;
242: int FRightMargin;
243: int FBottomMargin;
244: HPALETTE FPal;
245: tagPALETTEENTRY FPaletteEntries[16];
246: int FMarginColor;
247: HIDESBASE MESSAGE void __fastcall WMPaint(Messages::TWMPaint &Message);
248: HIDESBASE MESSAGE void __fastcall WMSetFocus(Messages::TWMSetFocus &Message);
249: HIDESBASE MESSAGE void __fastcall WMKillFocus(Messages::TWMKillFocus &Message);
250: HIDESBASE MESSAGE void __fastcall WMLButtonDown(Messages::TWMMouse &Message);
251: HIDESBASE MESSAGE void __fastcall WMPaletteChanged(Messages::TMessage &Message);
252: void __fastcall VScrollBarScroll(System::TObject* Sender, Stdctrls::TScrollCode ScrollCode, int &ScrollPos);
253: void __fastcall SetCaret(void);
254: void __fastcall AdjustScrollBar(void);
255: bool __fastcall ProcessFKeys(char ScanCode, Classes::TShiftState Shift, bool Ext);
256: PFuncKeyValue __fastcall FindFKeys(char ScanCode, Classes::TShiftState Shift, bool Ext);
257: void __fastcall CursorVisibleEvent(System::TObject* Sender);
258: HIDESBASE void __fastcall SetFont(Graphics::TFont* Value);
259: void __fastcall SetAutoLF(bool Value);
260: void __fastcall SetAutoCR(bool Value);
261: void __fastcall SetAutoWrap(bool Value);
262: void __fastcall SetXlat(bool Value);
263: void __fastcall SetLog(bool Value);
264: void __fastcall SetRows(int Value);
265: void __fastcall SetCols(int Value);
266: void __fastcall SetBackRows(int Value);
267: void __fastcall SetTopLine(int Value);
268: void __fastcall SetBackColor(TBackColors Value);
269: void __fastcall SetOptions(TScreenOptions Value);
270: void __fastcall SetLineHeight(int Value);
271: bool __fastcall GetAutoLF(void);
272: bool __fastcall GetAutoCR(void);
273: bool __fastcall GetAutoWrap(void);
274: bool __fastcall GetXlat(void);
275: int __fastcall GetRows(void);
276: int __fastcall GetCols(void);
277: int __fastcall GetBackRows(void);
278: TBackColors __fastcall GetBackColor(void);
279: TScreenOptions __fastcall GetOptions(void);
280: void __fastcall SetMarginColor(const int Value);
281: void __fastcall SetLeftMargin(const int Value);
282: void __fastcall SetBottomMargin(const int Value);
283: void __fastcall SetRightMargin(const int Value);
284: void __fastcall SetTopMargin(const int Value);
285:
286: protected:
287: TScreen* FScreen;
288: void __fastcall AppMessageHandler(tagMSG &Msg, bool &Handled);
289: virtual void __fastcall DoKeyBuffer(char * Buffer, int Len);
290: void __fastcall PaintGraphicChar(HDC DC, int X, int Y, Types::PRect rc, char ch);
291:
292: public:
293: __fastcall virtual TCustomEmulVT(Classes::TComponent* AOwner);
294: __fastcall virtual ~TCustomEmulVT(void);
295: void __fastcall ShowCursor(void);
296: HIDESBASE void __fastcall SetCursor(int Row, int Col);
297: void __fastcall WriteChar(char Ch);
298: void __fastcall WriteStr(AnsiString Str);
299: void __fastcall WriteBuffer(void * Buffer, int Len);
300: AnsiString __fastcall ReadStr();
301: void __fastcall CopyHostScreen(void);
302: void __fastcall Clear(void);
303: void __fastcall UpdateScreen(void);
304: int __fastcall SnapPixelToRow(int Y);
305: int __fastcall SnapPixelToCol(int X);
306: int __fastcall PixelToRow(int Y);
307: int __fastcall PixelToCol(int X);
308: void __fastcall MouseToCell(int X, int Y, int &ACol, int &ARow);
309: void __fastcall SetLineZoom(float newValue);
310: void __fastcall SetCharWidth(int newValue);
311: void __fastcall SetCharZoom(float newValue);
312: DYNAMIC void __fastcall KeyPress(char &Key);
313: __property float LineZoom = {read=FLineZoom, write=SetLineZoom};
314: __property int CharWidth = {read=FCharWidth, write=SetCharWidth, nodefault};
315: __property float CharZoom = {read=FCharZoom, write=SetCharZoom};
316: __property bool GraphicDraw = {read=FGraphicDraw, write=FGraphicDraw, nodefault};
317: __property int TopLine = {read=FTopLine, write=SetTopLine, nodefault};
318: __property Stdctrls::TScrollBar* VScrollBar = {read=FVScrollBar};
319: __property int TopMargin = {read=FTopMargin, write=SetTopMargin, nodefault};
320: __property int LeftMargin = {read=FLeftMargin, write=SetLeftMargin, nodefault};
321: __property int RightMargin = {read=FRightMargin, write=SetRightMargin, nodefault};
322: __property int BottomMargin = {read=FBottomMargin, write=SetBottomMargin, nodefault};
323: __property int MarginColor = {read=FMarginColor, write=SetMarginColor, nodefault};
324:
325: private:
326: void __fastcall PaintOneLine(HDC DC, int Y, int Y1, const TLine* Line, int nColFrom, int nColTo, bool Blank);
327: void __fastcall SetupFont(void);
328: __property AnsiString Text = {read=ReadStr, write=WriteStr};
329: __property OnMouseMove ;
330: __property OnMouseDown ;
331: __property OnMouseUp ;
332: __property OnClick ;
333: __property OnKeyPress ;
334: __property TKeyBufferEvent OnKeyBuffer = {read=FOnKeyBuffer, write=FOnKeyBuffer};
335: __property TKeyDownEvent OnKeyDown = {read=FOnKeyDown, write=FOnKeyDown};
336: __property Ctl3D ;
337: __property Align = {default=0};
338: __property TabStop = {default=0};
339: __property TabOrder = {default=-1};
340: __property Forms::TBorderStyle BorderStyle = {read=FBorderStyle, write=FBorderStyle, nodefault};
341: __property bool AutoRepaint = {read=FAutoRepaint, write=FAutoRepaint, nodefault};
342: __property Graphics::TFont* Font = {read=FFont, write=SetFont};
343: __property bool LocalEcho = {read=FLocalEcho, write=FLocalEcho, nodefault};
344: __property bool AutoLF = {read=GetAutoLF, write=SetAutoLF, nodefault};
345: __property bool AutoCR = {read=GetAutoCR, write=SetAutoCR, nodefault};
346: __property bool AutoWrap = {read=GetAutoWrap, write=SetAutoWrap, nodefault};
347: __property bool Xlat = {read=GetXlat, write=SetXlat, nodefault};
348: __property bool MonoChrome = {read=FMonoChrome, write=FMonoChrome, nodefault};
349: __property bool Log = {read=FLog, write=SetLog, nodefault};
350: __property int Rows = {read=GetRows, write=SetRows, nodefault};
351: __property int Cols = {read=GetCols, write=SetCols, nodefault};
352: __property int LineHeight = {read=FLineHeight, write=SetLineHeight, nodefault};
353: __property int FKeys = {read=FFKeys, write=FFKeys, nodefault};
354: __property Types::TRect SelectRect = {read=FSelectRect, write=FSelectRect};
355: __property int BackRows = {read=GetBackRows, write=SetBackRows, nodefault};
356: __property TBackColors BackColor = {read=GetBackColor, write=SetBackColor, nodefault};
357: __property TScreenOptions Options = {read=GetOptions, write=SetOptions, nodefault};
358: public:
359: #pragma option push -w-inl
360: /* TWinControl.CreateParented */ inline __fastcall TCustomEmulVT(HWND ParentWindow) : Controls::TCustomControl(ParentWindow) { }
361: #pragma option pop
362:
363: };
364:
365:
366: class DELPHICLASS TEmulVT;
367: class PASCALIMPLEMENTATION TEmulVT : public TCustomEmulVT
368: {
369: typedef TCustomEmulVT inherited;
370:
371: public:
372: __property TScreen* Screen = {read=FScreen};
373: __property SelectRect ;
374: __property Text ;
375:
376: __published:
377: __property OnMouseMove ;
378: __property OnMouseDown ;
379: __property OnMouseUp ;
380: __property OnClick ;
381: __property OnKeyPress ;
382: __property OnKeyDown ;
383: __property OnKeyBuffer ;
384: __property Ctl3D ;
385: __property Align = {default=0};
386: __property BorderStyle ;
387: __property AutoRepaint ;
388: __property Font ;
389: __property LocalEcho ;
390: __property AutoLF ;
391: __property AutoCR ;
392: __property AutoWrap ;
393: __property Xlat ;
394: __property MonoChrome ;
395: __property Log ;
396: __property Rows ;
397: __property Cols ;
398: __property BackRows ;
399: __property BackColor ;
400: __property Options ;
401: __property LineHeight ;
402: __property CharWidth ;
403: __property TabStop = {default=0};
404: __property TabOrder = {default=-1};
405: __property FKeys ;
406: __property TopMargin ;
407: __property LeftMargin ;
408: __property RightMargin ;
409: __property BottomMargin ;
410: __property MarginColor ;
411: public:
412: #pragma option push -w-inl
413: /* TCustomEmulVT.Create */ inline __fastcall virtual TEmulVT(Classes::TComponent* AOwner) : TCustomEmulVT(AOwner) { }
414: #pragma option pop
415: #pragma option push -w-inl
416: /* TCustomEmulVT.Destroy */ inline __fastcall virtual ~TEmulVT(void) { }
417: #pragma option pop
418:
419: public:
420: #pragma option push -w-inl
421: /* TWinControl.CreateParented */ inline __fastcall TEmulVT(HWND ParentWindow) : TCustomEmulVT(ParentWindow) { }
422: #pragma option pop
423:
424: };
425:
426:
427: //-- var, const, procedure ---------------------------------------------------
428: static const Byte EmulVTVersion = 0xdb;
429: extern PACKAGE AnsiString CopyRight;
430: static const Shortint MAX_ROW = 0x32;
431: static const Byte MAX_COL = 0xa0;
432: static const Shortint NumPaletteEntries = 0x10;
433: static const Shortint F_BLACK = 0x0;
434: static const Shortint F_BLUE = 0x1;
435: static const Shortint F_GREEN = 0x2;
436: static const Shortint F_CYAN = 0x3;
437: static const Shortint F_RED = 0x4;
438: static const Shortint F_MAGENTA = 0x5;
439: static const Shortint F_BROWN = 0x6;
440: static const Shortint F_WHITE = 0x7;
441: static const Shortint B_BLACK = 0x0;
442: static const Shortint B_BLUE = 0x1;
443: static const Shortint B_GREEN = 0x2;
444: static const Shortint B_CYAN = 0x3;
445: static const Shortint B_RED = 0x4;
446: static const Shortint B_MAGENTA = 0x5;
447: static const Shortint B_BROWN = 0x6;
448: static const Shortint B_WHITE = 0x7;
449: static const Shortint F_INTENSE = 0x8;
450: static const Byte B_BLINK = 0x80;
451: extern PACKAGE TFuncKey FKeys1[64];
452: extern PACKAGE TFuncKey FKeys2[64];
453: extern PACKAGE TFuncKey FKeys3[64];
454: extern PACKAGE char ibm_iso8859_1_G0[256];
455: extern PACKAGE char ibm_iso8859_1_G1[256];
456: extern PACKAGE char Output[256];
457: extern PACKAGE void __fastcall Register(void);
458: extern PACKAGE bool __fastcall AddFKey(TFuncKey * FKeys, char ScanCode, Classes::TShiftState Shift, bool Ext, TFuncKeyValue &Value);
459: extern PACKAGE void __fastcall FKeysToFile(TFuncKey * FKeys, AnsiString FName);
460: extern PACKAGE void __fastcall FileToFKeys(TFuncKey * FKeys, AnsiString FName);
461:
462: } /* namespace Emulvt */
463: using namespace Emulvt;
464: #pragma option pop // -w-
465: #pragma option pop // -Vx
466:
467: #pragma delphiheader end.
468: //-- end unit ----------------------------------------------------------------
469: #endif // EmulVT
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.