xref: /reactos/dll/cpl/console/console.h (revision 845faec4)
1 #ifndef CONSOLE_H__
2 #define CONSOLE_H__
3 
4 #include <stdio.h>
5 #include <stdlib.h>
6 #include <wchar.h>
7 
8 #define WIN32_NO_STATUS
9 
10 #include <windef.h>
11 #include <winbase.h>
12 
13 #include <wincon.h>
14 #include <wingdi.h>
15 #include <winnls.h>
16 #include <winreg.h>
17 
18 #include <winuser.h>
19 #include <commctrl.h>
20 #include <cpl.h>
21 
22 #include <strsafe.h>
23 
24 #include "resource.h"
25 
26 #define EnableDlgItem(hDlg, nID, bEnable)   \
27     EnableWindow(GetDlgItem((hDlg), (nID)), (bEnable))
28 
29 /* Shared header with the GUI Terminal Front-End from consrv.dll */
30 #include "concfg.h" // in /winsrv/concfg/
31 
32 typedef enum _TEXT_TYPE
33 {
34     Screen,
35     Popup
36 } TEXT_TYPE;
37 
38 /* Globals */
39 extern HINSTANCE hApplet;
40 extern PCONSOLE_STATE_INFO ConInfo;
41 extern HFONT hCurrentFont;
42 
43 VOID ApplyConsoleInfo(HWND hwndDlg);
44 
45 /* Preview Windows */
46 BOOL
47 RegisterWinPrevClass(
48     IN HINSTANCE hInstance);
49 
50 BOOL
51 UnRegisterWinPrevClass(
52     IN HINSTANCE hInstance);
53 
54 
55 VOID
56 PaintText(
57     IN LPDRAWITEMSTRUCT drawItem,
58     IN PCONSOLE_STATE_INFO pConInfo,
59     IN TEXT_TYPE TextMode);
60 
61 
62 struct _LIST_CTL;
63 
64 typedef INT (*PLIST_GETCOUNT)(IN struct _LIST_CTL* ListCtl);
65 typedef ULONG_PTR (*PLIST_GETDATA)(IN struct _LIST_CTL* ListCtl, IN INT Index);
66 
67 typedef struct _LIST_CTL
68 {
69     HWND hWndList;
70     PLIST_GETCOUNT GetCount;
71     PLIST_GETDATA  GetData;
72 } LIST_CTL, *PLIST_CTL;
73 
74 UINT
75 BisectListSortedByValueEx(
76     IN PLIST_CTL ListCtl,
77     IN ULONG_PTR Value,
78     IN UINT itemStart,
79     IN UINT itemEnd,
80     OUT PUINT pValueItem OPTIONAL,
81     IN BOOL BisectRightOrLeft);
82 
83 UINT
84 BisectListSortedByValue(
85     IN PLIST_CTL ListCtl,
86     IN ULONG_PTR Value,
87     OUT PUINT pValueItem OPTIONAL,
88     IN BOOL BisectRightOrLeft);
89 
90 #endif /* CONSOLE_H__ */
91