00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033 typedef struct _CHAR_ROW {
00034 SHORT Right;
00035 SHORT OldRight;
00036 SHORT Left;
00037 SHORT OldLeft;
00038 PWCHAR
Chars;
00039
#if defined(FE_SB)
00040
PBYTE KAttrs;
00041
#define ATTR_LEADING_BYTE 0x01
00042
#define ATTR_TRAILING_BYTE 0x02
00043
#define ATTR_DBCSSBCS_BYTE 0x03
00044
#define ATTR_SEPARATE_BYTE 0x10
00045
#define ATTR_EUDCFLAG_BYTE 0x20
00046
#endif
00047
}
CHAR_ROW, *
PCHAR_ROW;
00048
00049
00050
00051
typedef struct _ATTR_PAIR {
00052 SHORT Length;
00053 WORD
Attr;
00054 }
ATTR_PAIR, *
PATTR_PAIR;
00055
00056
00057
00058 typedef struct _ATTR_ROW {
00059 SHORT Length;
00060 ATTR_PAIR AttrPair;
00061 PATTR_PAIR Attrs;
00062 }
ATTR_ROW, *
PATTR_ROW;
00063
00064
00065
00066 typedef struct _ROW {
00067 CHAR_ROW CharRow;
00068 ATTR_ROW AttrRow;
00069 }
ROW, *
PROW;
00070
00071
#if defined(FE_SB)
00072
typedef struct _DBCS_SCREEN_BUFFER {
00073
00074
00075
00076
PBYTE KAttrRows;
00077
00078
00079
00080
00081
00082
00083
00084
00085 PWCHAR TransBufferCharacter;
00086
PBYTE TransBufferAttribute;
00087
00088
00089
00090
00091 PWCHAR TransWriteConsole;
00092 } DBCS_SCREEN_BUFFER, *PDBCS_SCREEN_BUFFER;
00093
#endif
00094
00095 typedef struct _TEXT_BUFFER_FONT_INFO {
00096 struct _TEXT_BUFFER_FONT_INFO *
NextTextBufferFont;
00097 COORD
FontSize;
00098 DWORD FontNumber;
00099 WCHAR
FaceName[LF_FACESIZE];
00100 LONG
Weight;
00101 BYTE Family;
00102 UINT FontCodePage;
00103 }
TEXT_BUFFER_FONT_INFO, *
PTEXT_BUFFER_FONT_INFO;
00104
00105 typedef struct _TEXT_BUFFER_INFO {
00106 PROW Rows;
00107 PWCHAR
TextRows;
00108 SHORT FirstRow;
00109 BOOLEAN
CursorMoved;
00110 BOOLEAN
CursorVisible;
00111 BOOLEAN
CursorOn;
00112 BOOLEAN
DoubleCursor;
00113 BOOLEAN
DelayCursor;
00114 COORD
CursorPosition;
00115 ULONG
CursorSize;
00116 WORD
CursorYSize;
00117 WORD
UpdatingScreen;
00118 ULONG
ModeIndex;
00119
#ifdef i386
00120
00121 COORD WindowedWindowSize;
00122 COORD WindowedScreenSize;
00123 COORD MousePosition;
00124
#endif
00125 ULONG
Flags;
00126
00127 PTEXT_BUFFER_FONT_INFO ListOfTextBufferFont;
00128 TEXT_BUFFER_FONT_INFO CurrentTextBufferFont;
00129
00130
#if defined(FE_SB)
00131
BOOLEAN CursorBlink;
00132 BOOLEAN CursorDBEnable;
00133 DBCS_SCREEN_BUFFER DbcsScreenBuffer;
00134
#endif
00135
}
TEXT_BUFFER_INFO, *
PTEXT_BUFFER_INFO;
00136
00137 typedef struct _GRAPHICS_BUFFER_INFO {
00138 ULONG
BitMapInfoLength;
00139 LPBITMAPINFO
lpBitMapInfo;
00140 PVOID
BitMap;
00141 PVOID
ClientBitMap;
00142 HANDLE
ClientProcess;
00143 HANDLE
hMutex;
00144 HANDLE
hSection;
00145 DWORD dwUsage;
00146 }
GRAPHICS_BUFFER_INFO, *
PGRAPHICS_BUFFER_INFO;
00147
00148 #define CONSOLE_TEXTMODE_BUFFER 1
00149 #define CONSOLE_GRAPHICS_BUFFER 2
00150 #define CONSOLE_OEMFONT_DISPLAY 4
00151
00152 typedef struct _SCREEN_INFORMATION {
00153 struct _CONSOLE_INFORMATION *
Console;
00154 ULONG
Flags;
00155 DWORD OutputMode;
00156 ULONG
RefCount;
00157 CONSOLE_SHARE_ACCESS ShareAccess;
00158 COORD
ScreenBufferSize;
00159 SMALL_RECT
Window;
00160 WORD
ResizingWindow;
00161 WORD
Attributes;
00162 WORD
PopupAttributes;
00163 BOOLEAN
WindowMaximizedX;
00164 BOOLEAN
WindowMaximizedY;
00165 BOOLEAN
WindowMaximized;
00166 UINT CommandIdLow;
00167 UINT CommandIdHigh;
00168 HCURSOR
CursorHandle;
00169 HPALETTE
hPalette;
00170 UINT dwUsage;
00171 int CursorDisplayCount;
00172 int WheelDelta;
00173
union {
00174 TEXT_BUFFER_INFO TextInfo;
00175 GRAPHICS_BUFFER_INFO GraphicsInfo;
00176 } BufferInfo;
00177 struct _SCREEN_INFORMATION *
Next;
00178
#if defined(FE_SB)
00179
BYTE WriteConsoleDbcsLeadByte[2];
00180
BYTE FillOutDbcsLeadChar;
00181 WCHAR LineChar[6];
00182
#define UPPER_LEFT_CORNER 0
00183
#define UPPER_RIGHT_CORNER 1
00184
#define HORIZONTAL_LINE 2
00185
#define VERTICAL_LINE 3
00186
#define BOTTOM_LEFT_CORNER 4
00187
#define BOTTOM_RIGHT_CORNER 5
00188
BYTE BisectFlag;
00189
#define BISECT_LEFT 0x01
00190
#define BISECT_TOP 0x02
00191
#define BISECT_RIGHT 0x04
00192
#define BISECT_BOTTOM 0x08
00193
#if defined(FE_IME)
00194
struct _CONVERSIONAREA_INFORMATION *ConvScreenInfo;
00195
#else
00196
PVOID ConvScreenInfo;
00197
#endif // FE_IME
00198
#endif
00199
}
SCREEN_INFORMATION, *
PSCREEN_INFORMATION;
00200
00201 typedef struct _WINDOW_LIMITS {
00202 COORD
MinimumWindowSize;
00203 COORD
MaximumWindowSize;
00204 COORD
MaxWindow;
00205 COORD
FullScreenSize;
00206 }
WINDOW_LIMITS, *
PWINDOW_LIMITS;
00207
00208
00209
00210
00211
00212 #define TEXT_VALID_HINT 1
00213 #define SINGLE_ATTRIBUTES_PER_LINE 2 // only one attribute per line
00214
#if defined(FE_IME)
00215
#define CONSOLE_CONVERSION_AREA_REDRAW 4
00216
#endif
00217
00218
00219
00220
00221
00222
00223 #define INVALID_OLD_LENGTH -1
00224
00225
00226
00227
00228
00229
#if defined(FE_SB)
00230
#define VALID_TEXT_ATTRIBUTES (FOREGROUND_BLUE | FOREGROUND_GREEN | FOREGROUND_RED | FOREGROUND_INTENSITY | BACKGROUND_BLUE | BACKGROUND_GREEN | BACKGROUND_RED | BACKGROUND_INTENSITY | \
00231
COMMON_LVB_LEADING_BYTE | COMMON_LVB_TRAILING_BYTE | COMMON_LVB_GRID_HORIZONTAL | COMMON_LVB_GRID_LVERTICAL | COMMON_LVB_GRID_RVERTICAL | COMMON_LVB_REVERSE_VIDEO | COMMON_LVB_UNDERSCORE )
00232
#else
00233 #define VALID_TEXT_ATTRIBUTES (FOREGROUND_BLUE | FOREGROUND_GREEN | FOREGROUND_RED | FOREGROUND_INTENSITY | BACKGROUND_BLUE | BACKGROUND_GREEN | BACKGROUND_RED | BACKGROUND_INTENSITY)
00234
#endif
00235
00236
00237
00238
00239
00240
00241
00242 #define CURSOR_SIZE_IN_PIXELS(FONT_SIZE_Y,SIZE) ((((FONT_SIZE_Y)*(SIZE))+99)/100)
00243 #define CURSOR_Y_OFFSET_IN_PIXELS(FONT_SIZE_Y,YSIZE) ((FONT_SIZE_Y) - (YSIZE))
00244
00245
00246
00247
00248
00249 #define CURSOR_TIMER 1
00250 #define CURSOR_SMALL_SIZE 25 // large enough to be one pixel on a six pixel font
00251 #define CURSOR_BIG_SIZE 50
00252
00253
00254
00255
00256
00257
00258 #define ACTIVE_SCREEN_BUFFER(SCREEN_INFO) ((SCREEN_INFO)->Console->CurrentScreenBuffer == SCREEN_INFO)
00259
00260
00261
00262
00263
00264 #define CONSOLE_WINDOW_FLAGS (WS_OVERLAPPEDWINDOW | WS_VISIBLE | WS_HSCROLL | WS_VSCROLL)
00265 #define CONSOLE_WINDOW_EX_FLAGS (WS_EX_OVERLAPPEDWINDOW | WS_EX_ACCEPTFILES | WS_EX_APPWINDOW )
00266
00267 #define WINDOW_SIZE_X(WINDOW) ((SHORT)(((WINDOW)->Right - (WINDOW)->Left + 1)))
00268 #define WINDOW_SIZE_Y(WINDOW) ((SHORT)(((WINDOW)->Bottom - (WINDOW)->Top + 1)))
00269 #define CONSOLE_WINDOW_SIZE_X(SCREEN) (WINDOW_SIZE_X(&(SCREEN)->Window))
00270 #define CONSOLE_WINDOW_SIZE_Y(SCREEN) (WINDOW_SIZE_Y(&(SCREEN)->Window))
00271
00272 #define CONSOLE_MIN_SCREENBUFFER_X 1
00273 #define CONSOLE_MIN_SCREENBUFFER_Y 1