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