ReactOS 0.4.15-dev-8222-g9164419
tconsole.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  TConsole
 

Macros

#define CON_TOP   ConsoleInfo.srWindow.Top
 
#define CON_BOTTOM   ConsoleInfo.srWindow.Bottom
 
#define CON_LEFT   0
 
#define CON_RIGHT   (ConsoleInfo.dwSize.X - 1)
 
#define CON_HEIGHT   (CON_BOTTOM - CON_TOP)
 
#define CON_WIDTH   (CON_RIGHT - CON_LEFT)
 
#define CON_LINES   (CON_HEIGHT + 1)
 
#define CON_COLS   (CON_WIDTH + 1)
 
#define CON_CUR_X   (ConsoleInfo.dwCursorPosition.X - CON_LEFT)
 
#define CON_CUR_Y   (ConsoleInfo.dwCursorPosition.Y - CON_TOP)
 

Functions

void saveScreen (CHAR_INFO *chiBuffer)
 
void restoreScreen (CHAR_INFO *chiBuffer)
 
CHAR_INFOnewBuffer ()
 
void deleteBuffer (CHAR_INFO *chiBuffer)
 

Macro Definition Documentation

◆ CON_BOTTOM

Definition at line 46 of file tconsole.h.

◆ CON_COLS

#define CON_COLS   (CON_WIDTH + 1)

Definition at line 54 of file tconsole.h.

◆ CON_CUR_X

Definition at line 56 of file tconsole.h.

◆ CON_CUR_Y

Definition at line 57 of file tconsole.h.

◆ CON_HEIGHT

#define CON_HEIGHT   (CON_BOTTOM - CON_TOP)

Definition at line 51 of file tconsole.h.

◆ CON_LEFT

#define CON_LEFT   0

Definition at line 48 of file tconsole.h.

◆ CON_LINES

#define CON_LINES   (CON_HEIGHT + 1)

Definition at line 53 of file tconsole.h.

◆ CON_RIGHT

#define CON_RIGHT   (ConsoleInfo.dwSize.X - 1)

Definition at line 49 of file tconsole.h.

◆ CON_TOP

Definition at line 45 of file tconsole.h.

◆ CON_WIDTH

#define CON_WIDTH   (CON_RIGHT - CON_LEFT)

Definition at line 52 of file tconsole.h.

Function Documentation

◆ deleteBuffer()

void deleteBuffer ( CHAR_INFO chiBuffer)

Definition at line 1004 of file tconsole.cpp.

1004 {
1005 delete[] chiBuffer;
1006}

◆ newBuffer()

CHAR_INFO * newBuffer ( )

Definition at line 995 of file tconsole.cpp.

995 {
999 CHAR_INFO * chiBuffer;
1000 chiBuffer = new CHAR_INFO[(CON_BOTTOM-CON_TOP+1)*(CON_RIGHT-CON_LEFT+1)];
1001 return chiBuffer;
1002}
HANDLE WINAPI GetStdHandle(IN DWORD nStdHandle)
Definition: console.c:203
BOOL WINAPI GetConsoleScreenBufferInfo(IN HANDLE hConsoleOutput, OUT PCONSOLE_SCREEN_BUFFER_INFO lpConsoleScreenBufferInfo)
Definition: console.c:595
HANDLE hStdout
Definition: ctm.c:56
static CONSOLE_SCREEN_BUFFER_INFO ConsoleInfo
Definition: video.c:47
#define CON_TOP
Definition: tconsole.h:45
#define CON_LEFT
Definition: tconsole.h:48
#define CON_RIGHT
Definition: tconsole.h:49
#define CON_BOTTOM
Definition: tconsole.h:46
#define STD_OUTPUT_HANDLE
Definition: winbase.h:268

Referenced by TMouse::doMouse_init(), ATL::CComEnumImpl< Base, piid, T, Copy >::Init(), TScroller::ScrollBack(), and ATL::CRegObject::strbuf_write().

◆ restoreScreen()

void restoreScreen ( CHAR_INFO chiBuffer)

Definition at line 964 of file tconsole.cpp.

964 {
967 SMALL_RECT srctReadRect;
968 COORD coordBufSize;
969 COORD coordBufCoord;
970
973
974 // restore screen
975 srctReadRect.Top = CON_TOP; /* top left: row 0, col 0 */
976 srctReadRect.Left = CON_LEFT;
977 srctReadRect.Bottom = CON_BOTTOM; /* bot. right: row 1, col 79 */
978 srctReadRect.Right = CON_RIGHT;
979
980 coordBufSize.Y = CON_BOTTOM-CON_TOP+1;
981 coordBufSize.X = CON_RIGHT-CON_LEFT+1;
982
983 coordBufCoord.X = CON_TOP;
984 coordBufCoord.Y = CON_LEFT;
986 hStdout, /* screen buffer to write to */
987 chiBuffer, /* buffer to copy from */
988 coordBufSize, /* col-row size of chiBuffer */
989 coordBufCoord, /* top left src cell in chiBuffer */
990 &srctReadRect); /* dest. screen buffer rectangle */
991 // end restore screen
992
993}
Definition: bl.h:1338
ULONG Y
Definition: bl.h:1340
ULONG X
Definition: bl.h:1339
SHORT Top
Definition: tui.c:25
SHORT Right
Definition: tui.c:26
SHORT Left
Definition: tui.c:24
SHORT Bottom
Definition: tui.c:27
#define WriteConsoleOutput
Definition: wincon.h:787

Referenced by TMouse::doMouse_cleanup(), and TScroller::ScrollBack().

◆ saveScreen()

void saveScreen ( CHAR_INFO chiBuffer)

Definition at line 934 of file tconsole.cpp.

934 {
937 SMALL_RECT srctReadRect;
938 COORD coordBufSize;
939 COORD coordBufCoord;
940
943
944 srctReadRect.Top = CON_TOP; /* top left: row 0, col 0 */
945 srctReadRect.Left = CON_LEFT;
946 srctReadRect.Bottom = CON_BOTTOM; /* bot. right: row 1, col 79 */
947 srctReadRect.Right = CON_RIGHT;
948
949 coordBufSize.Y = CON_BOTTOM-CON_TOP+1;
950 coordBufSize.X = CON_RIGHT-CON_LEFT+1;
951
952 coordBufCoord.X = CON_TOP;
953 coordBufCoord.Y = CON_LEFT;
954
956 hStdout, /* screen buffer to read from */
957 chiBuffer, /* buffer to copy into */
958 coordBufSize, /* col-row size of chiBuffer */
959
960 coordBufCoord, /* top left dest. cell in chiBuffer */
961 &srctReadRect); /* screen buffer source rectangle */
962}
#define ReadConsoleOutput
Definition: wincon.h:780

Referenced by TMouse::doMouse_init(), and TScroller::ScrollBack().