[CONSOLE.CPL]: Minor code refactoring:
[reactos.git] / reactos / dll / cpl / console / console.h
1 #ifndef CONSOLE_H__
2 #define CONSOLE_H__
3
4 #include <stdio.h>
5 #include <wchar.h>
6
7 #define WIN32_NO_STATUS
8
9 #include <windef.h>
10 #include <winbase.h>
11 #include <wingdi.h>
12 #include <winnls.h>
13 #include <winreg.h>
14 #include <winuser.h>
15 #include <wincon.h>
16 #include <commctrl.h>
17 #include <cpl.h>
18
19 #include <strsafe.h>
20
21 #include "resource.h"
22
23 #define EnableDlgItem(hDlg, nID, bEnable) \
24 EnableWindow(GetDlgItem((hDlg), (nID)), (bEnable))
25
26 /* Shared header with the GUI Terminal Front-End from consrv.dll */
27 #include "settings.h" // in /winsrv/concfg/
28
29 typedef enum _TEXT_TYPE
30 {
31 Screen,
32 Popup
33 } TEXT_TYPE;
34
35 /* Globals */
36 extern PCONSOLE_STATE_INFO ConInfo;
37
38 VOID ApplyConsoleInfo(HWND hwndDlg);
39 BYTE CodePageToCharSet(UINT CodePage);
40 VOID PaintConsole(LPDRAWITEMSTRUCT drawItem, PCONSOLE_STATE_INFO pConInfo);
41 BOOL PaintText(LPDRAWITEMSTRUCT drawItem, PCONSOLE_STATE_INFO pConInfo, TEXT_TYPE TextMode);
42
43
44 struct _LIST_CTL;
45
46 typedef INT (*PLIST_GETCOUNT)(IN struct _LIST_CTL* ListCtl);
47 typedef ULONG_PTR (*PLIST_GETDATA)(IN struct _LIST_CTL* ListCtl, IN INT Index);
48
49 typedef struct _LIST_CTL
50 {
51 HWND hWndList;
52 PLIST_GETCOUNT GetCount;
53 PLIST_GETDATA GetData;
54 } LIST_CTL, *PLIST_CTL;
55
56 UINT
57 BisectListSortedByValueEx(
58 IN PLIST_CTL ListCtl,
59 IN ULONG_PTR Value,
60 IN UINT itemStart,
61 IN UINT itemEnd,
62 OUT PUINT pValueItem OPTIONAL,
63 IN BOOL BisectRightOrLeft);
64
65 UINT
66 BisectListSortedByValue(
67 IN PLIST_CTL ListCtl,
68 IN ULONG_PTR Value,
69 OUT PUINT pValueItem OPTIONAL,
70 IN BOOL BisectRightOrLeft);
71
72 #endif /* CONSOLE_H__ */