3 Copyright (c) 1998-2001 Klaus P. Gerlicher
24 15-Nov-2000: general cleanup of source files
28 This file may be distributed under the terms of the GNU Public License.
31 typedef struct tagWindow
35 BOOLEAN bScrollDisabled
;
38 // pointer indirection table for output functions
39 typedef struct _OUTPUT_HANDLERS
41 void (*CopyLineTo
) (USHORT dest
,USHORT src
);
42 void (*PrintGraf
) (ULONG x
,ULONG y
,UCHAR c
);
44 void (*ClrLine
) (ULONG line
);
45 void (*InvertLine
) (ULONG line
);
46 void (*HatchLine
) (ULONG line
);
47 void (*PrintLogo
) (BOOLEAN bShow
);
48 void (*PrintCursor
) (BOOLEAN bForce
);
49 void (*SaveGraphicsState
) (void);
50 void (*RestoreGraphicsState
) (void);
51 void (*ShowCursor
) (void);
52 void (*HideCursor
) (void);
53 void (*SetForegroundColor
) (ECOLORS
);
54 void (*SetBackgroundColor
) (ECOLORS
);
55 }OUTPUT_HANDLERS
,*POUTPUT_HANDLERS
;
57 // pointer indirection table for input functions
58 typedef struct _INPUT_HANDLERS
60 UCHAR (*GetKeyPolled
) (void);
61 void (*FlushKeyboardQueue
) (void);
62 }INPUT_HANDLERS
,*PINPUT_HANDLERS
;
64 extern OUTPUT_HANDLERS ohandlers
;
65 extern INPUT_HANDLERS ihandlers
;
73 OUTPUT_WINDOW_UNBUFFERED
76 typedef enum _ETERMINALMODE
78 TERMINAL_MODE_HERCULES_GRAPHICS
= 0 ,
79 TERMINAL_MODE_HERCULES_TEXT
,
80 TERMINAL_MODE_VGA_TEXT
,
85 extern ETERMINALMODE eTerminalMode
;
87 extern WINDOW wWindow
[];
89 extern BOOLEAN bGrayed
;
90 extern BOOLEAN bCursorEnabled
;
92 // install and remove handler
93 BOOLEAN
ConsoleInit(void);
94 void ConsoleShutdown(void);
97 void Print(USHORT Window
,LPSTR p
);
98 void SetBackgroundColor(ECOLORS c
);
99 void SetForegroundColor(ECOLORS c
);
100 void Clear(USHORT window
);
101 void PutChar(LPSTR p
,ULONG x
,ULONG y
);
102 void ClrLine(ULONG line
);
103 void ShowCursor(void);
104 void HideCursor(void);
105 void EnableScroll(USHORT Window
);
106 void DisableScroll(USHORT Window
);
107 void CopyLineTo(USHORT dest
,USHORT src
);
108 void PrintLogo(BOOLEAN bShow
);
109 void PrintCursor(BOOLEAN bForce
);
110 void PrintGraf(ULONG x
,ULONG y
,UCHAR c
);
111 void ScrollUp(USHORT Window
);
112 void Home(USHORT Window
);
113 void InvertLine(ULONG line
);
114 void FillLine(ULONG line
,UCHAR c
);
115 void PrintTemplate(void);
116 void PrintCaption(void);
117 void ClrLineToEnd(USHORT Window
,ULONG line
,ULONG x
);
118 void SuspendPrintRingBuffer(BOOLEAN bSuspend
);
119 void HatchLine(ULONG line
);
120 void SaveGraphicsState(void);
121 void RestoreGraphicsState(void);
122 void SetWindowGeometry(PVOID pWindow
);
125 UCHAR
GetKeyPolled(void);
126 void FlushKeyboardQueue(void);
129 BOOLEAN
PrintRingBufferOffset(ULONG ulLines
,ULONG ulOffset
);
130 BOOLEAN
PrintRingBufferHome(ULONG ulLines
);
131 void PrintRingBuffer(ULONG ulLines
);
132 ULONG
LinesInRingBuffer(void);
133 void ReplaceRingBufferCurrent(LPSTR s
);
134 void EmptyRingBuffer(void);
135 void CheckRingBuffer(void);
136 BOOLEAN
AddToRingBuffer(LPSTR p
);
137 void ResetColor(void);
139 extern ULONG GLOBAL_SCREEN_WIDTH
;
140 extern ULONG GLOBAL_SCREEN_HEIGHT
;
142 extern ULONG ulOutputLock
;
144 #define Acquire_Output_Lock() \
146 save_flags(ulOutputLock); \
150 #define Release_Output_Lock() \
151 restore_flags(ulOutputLock);
153 #define NOT_IMPLEMENTED()
155 extern USHORT usCaptionColor
;
156 #define COLOR_CAPTION usCaptionColor
157 extern USHORT usCaptionText
;
158 #define COLOR_TEXT usCaptionText
159 extern USHORT usForegroundColor
;
160 #define COLOR_FOREGROUND usForegroundColor
161 extern USHORT usBackgroundColor
;
163 #undef COLOR_BACKGROUND
164 #define COLOR_BACKGROUND usBackgroundColor
165 extern USHORT usHiLiteColor
;
166 #define COLOR_HILITE usHiLiteColor