1 /*
2  * COPYRIGHT:       See COPYING in the top level directory
3  * PROJECT:         ReactOS Console Server DLL
4  * FILE:            win32ss/user/winsrv/consrv/frontends/gui/conwnd.h
5  * PURPOSE:         GUI Console Window Class
6  * PROGRAMMERS:     G� van Geldorp
7  *                  Johannes Anderwald
8  *                  Jeffrey Morlan
9  *                  Hermes Belusca-Maito (hermes.belusca@sfr.fr)
10  */
11 
12 #pragma once
13 
14 /* GUI Console Window Class name */
15 #define GUI_CONWND_CLASS L"ConsoleWindowClass"
16 
17 #ifndef WM_APP
18     #define WM_APP 0x8000
19 #endif
20 #define PM_RESIZE_TERMINAL      (WM_APP + 3)
21 #define PM_CONSOLE_BEEP         (WM_APP + 4)
22 #define PM_CONSOLE_SET_TITLE    (WM_APP + 5)
23 
24 /* Flags for GetKeyState */
25 #define KEY_TOGGLED 0x0001
26 #define KEY_PRESSED 0x8000
27 
28 /*
29 typedef struct _CONSOLE_FONT
30 {
31     HFONT Font;
32     ULONG Flag;
33 } CONSOLE_FONT, *PCONSOLE_FONT;
34 */
35 #define FONT_NORMAL     0x00
36 #define FONT_BOLD       0x01
37 #define FONT_UNDERLINE  0x02
38 #define FONT_MAXNO      0x04
39 
40 typedef struct _GUI_CONSOLE_DATA
41 {
42     CRITICAL_SECTION Lock;
43     BOOL WindowSizeLock;
44     HANDLE hGuiInitEvent;
45     HANDLE hGuiTermEvent;
46 
47     // HANDLE InputThreadHandle;
48     ULONG_PTR InputThreadId;
49     HWINSTA WinSta;
50     HDESK   Desktop;
51 
52     BOOLEAN IsWindowVisible;
53     BOOLEAN IsWindowActive;
54 
55     POINT OldCursor;
56 
57     LONG_PTR WndStyle;
58     LONG_PTR WndStyleEx;
59     BOOL IsWndMax;
60     WINDOWPLACEMENT WndPl;
61 
62     HWND hWindow;               /* Handle to the console's window            */
63     HDC  hMemDC;                /* Memory DC holding the console framebuffer */
64     HBITMAP  hBitmap;           /* Console framebuffer                       */
65     HPALETTE hSysPalette;       /* Handle to the original system palette     */
66 
67     HICON hIcon;                /* Handle to the console's icon (big)   */
68     HICON hIconSm;              /* Handle to the console's icon (small) */
69 
70 /*** The following may be put per-screen-buffer !! ***/
71     HCURSOR hCursor;            /* Handle to the mouse cursor */
72     INT  MouseCursorRefCount;   /* The reference counter associated with the mouse cursor. >= 0 and the cursor is shown; < 0 and the cursor is hidden. */
73     BOOL IgnoreNextMouseEvent;  /* Used when we need to not process a mouse event */
74 
75     BOOL HackCORE8394IgnoreNextMove; /* HACK FOR CORE-8394. See conwnd.c!OnMouse for more details. */
76 
77     HMENU hSysMenu;             /* Handle to the console window system menu */
78     BOOL IsCloseButtonEnabled;  /* TRUE if the Close button and the corresponding system menu item are enabled (default), FALSE otherwise */
79     UINT CmdIdLow ;             /* Lowest menu id of the user-reserved menu id range */
80     UINT CmdIdHigh;             /* Highest menu id of the user-reserved menu id range */
81 
82 //  COLORREF Colors[16];
83 
84 //  PVOID   ScreenBuffer;       /* Hardware screen buffer */
85 
86     HFONT Font[FONT_MAXNO];
87     UINT CharWidth;     /* The character width and height should be the same for */
88     UINT CharHeight;    /* both normal and bold/underlined fonts...              */
89 /*****************************************************/
90 
91     PCONSRV_CONSOLE Console;           /* Pointer to the owned console */
92     PCONSOLE_SCREEN_BUFFER ActiveBuffer;    /* Pointer to the active screen buffer (then maybe the previous Console member is redundant?? Or not...) */
93     CONSOLE_SELECTION_INFO Selection;       /* Contains information about the selection */
94     COORD dwSelectionCursor;                /* Selection cursor position, most of the time different from Selection.dwSelectionAnchor */
95     BOOL  LineSelection;                    /* TRUE if line-oriented selection (a la *nix terminals), FALSE if block-oriented selection (default on Windows) */
96 
97     GUI_CONSOLE_INFO GuiInfo;   /* GUI terminal settings */
98 } GUI_CONSOLE_DATA, *PGUI_CONSOLE_DATA;
99