ReactOS 0.4.15-dev-7924-g5949c20
tconsole.cpp File Reference
#include "precomp.h"
Include dependency graph for tconsole.cpp:

Go to the source code of this file.

Functions

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

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().