[CONSRV]
[reactos.git] / win32ss / user / consrv / include / settings.h
1 /*
2 * COPYRIGHT: See COPYING in the top level directory
3 * PROJECT: ReactOS Console Server DLL
4 * FILE: win32ss/user/consrv/include/settings.h
5 * PURPOSE: Public Console Settings Management Interface
6 * PROGRAMMERS: Johannes Anderwald
7 * Hermes Belusca-Maito (hermes.belusca@sfr.fr)
8 */
9
10 #pragma once
11
12 /* STRUCTURES *****************************************************************/
13
14 /*
15 * Structure used to hold terminal-specific information
16 */
17 typedef struct _TERMINAL_INFO
18 {
19 ULONG Size; /* Size of the memory buffer pointed by TermInfo */
20 PVOID TermInfo; /* Address (or offset when talking to console.dll) of the memory buffer holding terminal information */
21 } TERMINAL_INFO, *PTERMINAL_INFO;
22
23 /*
24 * Structure used to hold console information
25 */
26 typedef struct _CONSOLE_INFO
27 {
28 ULONG HistoryBufferSize;
29 ULONG NumberOfHistoryBuffers;
30 BOOLEAN HistoryNoDup;
31
32 /* BOOLEAN */ ULONG FullScreen; /* Give the type of console: GUI (windowed) or TUI (fullscreen) */
33 BOOLEAN QuickEdit;
34 BOOLEAN InsertMode;
35 ULONG InputBufferSize;
36 COORD ScreenBufferSize;
37 /* SIZE */ COORD ConsoleSize; /* The size of the console */
38
39 BOOLEAN CursorBlinkOn;
40 BOOLEAN ForceCursorOff;
41 ULONG CursorSize;
42
43 USHORT ScreenAttrib; // CHAR_INFO ScreenFillAttrib
44 USHORT PopupAttrib;
45
46 COLORREF Colors[16]; /* Color palette */
47
48 ULONG CodePage;
49
50 WCHAR ConsoleTitle[MAX_PATH + 1];
51 } CONSOLE_INFO, *PCONSOLE_INFO;
52
53 #define RGBFromAttrib(Console, Attribute) ((Console)->Colors[(Attribute) & 0xF])
54 #define TextAttribFromAttrib(Attribute) ((Attribute) & 0xF)
55 #define BkgdAttribFromAttrib(Attribute) (((Attribute) >> 4) & 0xF)
56 #define MakeAttrib(TextAttrib, BkgdAttrib) (DWORD)((((BkgdAttrib) & 0xF) << 4) | ((TextAttrib) & 0xF))
57
58 /*
59 * Structure used to communicate with console.dll
60 */
61 typedef struct _CONSOLE_PROPS
62 {
63 HWND hConsoleWindow;
64 BOOL ShowDefaultParams;
65
66 BOOLEAN AppliedConfig;
67 DWORD ActiveStaticControl;
68
69 CONSOLE_INFO ci; /* Console-specific informations */
70 TERMINAL_INFO TerminalInfo; /* Frontend-specific parameters */
71 } CONSOLE_PROPS, *PCONSOLE_PROPS;
72
73 /* FUNCTIONS ******************************************************************/
74
75 #ifndef CONSOLE_H__ // If we aren't included by console.dll
76
77 BOOL ConSrvOpenUserSettings(DWORD ProcessId,
78 LPCWSTR ConsoleTitle,
79 PHKEY hSubKey,
80 REGSAM samDesired,
81 BOOL bCreate);
82
83 BOOL ConSrvReadUserSettings(IN OUT PCONSOLE_INFO ConsoleInfo,
84 IN DWORD ProcessId);
85 BOOL ConSrvWriteUserSettings(IN PCONSOLE_INFO ConsoleInfo,
86 IN DWORD ProcessId);
87 VOID ConSrvGetDefaultSettings(IN OUT PCONSOLE_INFO ConsoleInfo,
88 IN DWORD ProcessId);
89 VOID ConSrvApplyUserSettings(IN PCONSOLE Console,
90 IN PCONSOLE_INFO ConsoleInfo);
91
92 #endif
93
94 /* EOF */