xref: /reactos/sdk/lib/conutils/screen.h (revision 0623a6f8)
1 /*
2  * PROJECT:     ReactOS Console Utilities Library
3  * LICENSE:     GPL-2.0+ (https://spdx.org/licenses/GPL-2.0+)
4  * PURPOSE:     Console/terminal screen management.
5  * COPYRIGHT:   Copyright 2017-2018 ReactOS Team
6  *              Copyright 2017-2018 Hermes Belusca-Maito
7  */
8 
9 /**
10  * @file    screen.h
11  * @ingroup ConUtils
12  *
13  * @brief   Console/terminal screen management.
14  **/
15 
16 #ifndef __SCREEN_H__
17 #define __SCREEN_H__
18 
19 #pragma once
20 
21 #ifndef _UNICODE
22 #error The ConUtils library at the moment only supports compilation with _UNICODE defined!
23 #endif
24 
25 #ifdef __cplusplus
26 extern "C" {
27 #endif
28 
29 
30 #if 0
31 
32 VOID
33 ConClearLine(IN PCON_STREAM Stream);
34 
35 #endif
36 
37 
38 
39 #include <wincon.h>
40 
41 typedef struct _CON_SCREEN
42 {
43     PCON_STREAM Stream; // Out
44     // PCON_STREAM In;
45     CONSOLE_SCREEN_BUFFER_INFO csbi;
46     CONSOLE_CURSOR_INFO cci;
47 } CON_SCREEN, *PCON_SCREEN;
48 
49 #define INIT_CON_SCREEN(pStream)    {(pStream)} /* {(pStream), {{}}, {{}}} */
50 
51 #define InitializeConScreen(pScreen, pStream)   \
52 do { \
53     (pScreen)->Stream = (pStream);  \
54     RtlZeroMemory(&(pScreen)->csbi, sizeof((pScreen)->csbi));   \
55     RtlZeroMemory(&(pScreen)->cci , sizeof((pScreen)->cci ));   \
56 } while (0)
57 
58 BOOL
59 ConGetScreenInfo(
60     IN PCON_SCREEN Screen,
61     OUT PCONSOLE_SCREEN_BUFFER_INFO pcsbi);
62 
63 VOID
64 ConClearScreen(IN PCON_SCREEN Screen);
65 
66 
67 #ifdef __cplusplus
68 }
69 #endif
70 
71 #endif  /* __SCREEN_H__ */
72 
73 /* EOF */
74