ReactOS 0.4.15-dev-8127-g6338913
precomp.h File Reference
#include <stdarg.h>
#include <windef.h>
#include <winbase.h>
#include <winuser.h>
#include <wingdi.h>
#include "resource.h"
Include dependency graph for precomp.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  _CELL
 
struct  _MAP
 
struct  MAPNOTIFY
 
struct  SETTINGS
 

Macros

#define SIZEOF(_v)   (sizeof(_v) / sizeof(*_v))
 
#define MAX_GLYPHS   65536
 
#define XCELLS   20
 
#define YCELLS   10
 
#define XLARGE   45
 
#define YLARGE   25
 
#define FM_SETFONT   (WM_USER + 1)
 
#define FM_GETCHAR   (WM_USER + 2)
 
#define FM_SETCHAR   (WM_USER + 3)
 
#define FM_GETHFONT   (WM_USER + 4)
 
#define FM_SETCHARMAP   (WM_USER + 5)
 

Typedefs

typedef struct _CELL CELL
 
typedef struct _CELLPCELL
 
typedef struct _MAP MAP
 
typedef struct _MAPPMAP
 
typedef struct MAPNOTIFYLPMAPNOTIFY
 

Functions

LRESULT CALLBACK LrgCellWndProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
 
VOID ShowAboutDlg (HWND hWndParent)
 
BOOL RegisterMapClasses (HINSTANCE hInstance)
 
VOID UnregisterMapClasses (HINSTANCE hInstance)
 
int WINAPI GetUName (IN WORD wCharCode, OUT LPWSTR lpBuf)
 
VOID UpdateStatusBar (WCHAR wch)
 
VOID ChangeMapFont (HWND hDlg)
 
void LoadSettings (void)
 
void SaveSettings (void)
 

Variables

static const UINT codePages []
 
HINSTANCE hInstance
 
SETTINGS Settings
 
HWND hCharmapDlg
 

Macro Definition Documentation

◆ FM_GETCHAR

#define FM_GETCHAR   (WM_USER + 2)

Definition at line 23 of file precomp.h.

◆ FM_GETHFONT

#define FM_GETHFONT   (WM_USER + 4)

Definition at line 25 of file precomp.h.

◆ FM_SETCHAR

#define FM_SETCHAR   (WM_USER + 3)

Definition at line 24 of file precomp.h.

◆ FM_SETCHARMAP

#define FM_SETCHARMAP   (WM_USER + 5)

Definition at line 26 of file precomp.h.

◆ FM_SETFONT

#define FM_SETFONT   (WM_USER + 1)

Definition at line 22 of file precomp.h.

◆ MAX_GLYPHS

#define MAX_GLYPHS   65536

Definition at line 15 of file precomp.h.

◆ SIZEOF

#define SIZEOF (   _v)    (sizeof(_v) / sizeof(*_v))

Definition at line 13 of file precomp.h.

◆ XCELLS

#define XCELLS   20

Definition at line 17 of file precomp.h.

◆ XLARGE

#define XLARGE   45

Definition at line 19 of file precomp.h.

◆ YCELLS

#define YCELLS   10

Definition at line 18 of file precomp.h.

◆ YLARGE

#define YLARGE   25

Definition at line 20 of file precomp.h.

Typedef Documentation

◆ CELL

typedef struct _CELL CELL

◆ LPMAPNOTIFY

◆ MAP

typedef struct _MAP MAP

◆ PCELL

typedef struct _CELL * PCELL

◆ PMAP

typedef struct _MAP * PMAP

Function Documentation

◆ ChangeMapFont()

VOID ChangeMapFont ( HWND  hDlg)

Definition at line 161 of file charmap.c.

162{
163 HWND hCombo;
164 HWND hMap;
165 LPWSTR lpFontName;
166 INT Len;
167
168 hCombo = GetDlgItem(hDlg, IDC_FONTCOMBO);
169
170 Len = GetWindowTextLengthW(hCombo);
171
172 if (Len != 0)
173 {
174 lpFontName = HeapAlloc(GetProcessHeap(),
175 0,
176 (Len + 1) * sizeof(WCHAR));
177
178 if (lpFontName)
179 {
180 SendMessageW(hCombo,
182 Len + 1,
183 (LPARAM)lpFontName);
184
185 hMap = GetDlgItem(hDlg, IDC_FONTMAP);
186
187 SendMessageW(hMap,
189 0,
190 (LPARAM)lpFontName);
191 }
192
194 0,
195 lpFontName);
196 }
197}
#define FM_SETFONT
Definition: precomp.h:22
#define IDC_FONTMAP
Definition: resource.h:14
#define IDC_FONTCOMBO
Definition: resource.h:12
#define Len
Definition: deflate.h:82
#define GetProcessHeap()
Definition: compat.h:736
#define HeapAlloc
Definition: compat.h:733
#define HeapFree(x, y, z)
Definition: compat.h:735
int32_t INT
Definition: typedefs.h:58
LONG_PTR LPARAM
Definition: windef.h:208
#define WM_GETTEXT
Definition: winuser.h:1618
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
int WINAPI GetWindowTextLengthW(_In_ HWND)
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
__wchar_t WCHAR
Definition: xmlstorage.h:180
WCHAR * LPWSTR
Definition: xmlstorage.h:184

Referenced by CharMapDlgProc(), and LoadSettings().

◆ GetUName()

int WINAPI GetUName ( IN WORD  wCharCode,
OUT LPWSTR  lpBuf 
)

Definition at line 17 of file getuname.c.

19{
21 int res = LoadStringW(hInstance, wCharCode, szDescription, 256);
22 if (res != 0)
23 {
24 wcscpy(lpBuf, szDescription);
25 return 0;
26 }
27 else
28 {
29 wcscpy(lpBuf, L"Undefined");
30 return 0;
31 }
32}
static const WCHAR szDescription[]
Definition: provider.c:55
HINSTANCE hInstance
Definition: getuname.c:13
GLuint res
Definition: glext.h:9613
#define L(x)
Definition: ntvdm.h:50
_CRTIMP wchar_t *__cdecl wcscpy(_Out_writes_z_(_String_length_(_Source)+1) wchar_t *_Dest, _In_z_ const wchar_t *_Source)
int WINAPI LoadStringW(_In_opt_ HINSTANCE hInstance, _In_ UINT uID, _Out_writes_to_(cchBufferMax, return+1) LPWSTR lpBuffer, _In_ int cchBufferMax)

Referenced by BestFit_FromNLS(), and UpdateStatusBar().

◆ LoadSettings()

void LoadSettings ( void  Dlg)

Definition at line 53 of file settings.c.

54{
55 HKEY hKey = NULL;
56 int iItemIndex = -1;
57
59 {
60 TCHAR szBuffer[MAX_PATH];
61 DWORD dwAdvancedChecked;
62 DWORD type, size = sizeof(dwAdvancedChecked);
63 LSTATUS lstatus;
64
65 /* Restore last selected font */
66 if (QueryStringValue(HKEY_CURRENT_USER, g_szGeneralRegKey, _T("Font"), szBuffer, (sizeof(szBuffer)/sizeof(szBuffer[0]))) == ERROR_SUCCESS)
67 {
68 //Get combobox handle
70
71 //Search for match and return index if match found
72 iItemIndex = ComboBox_FindStringExact(hWnd, -1, szBuffer);
73 if(iItemIndex != CB_ERR)
74 {
75 ComboBox_SetCurSel(hWnd, iItemIndex);
77 }
78 }
79
80 /* Restore last selected character set */
81 if (QueryStringValue(HKEY_CURRENT_USER, g_szGeneralRegKey, _T("CodePage"), szBuffer, (sizeof(szBuffer)/sizeof(szBuffer[0]))) == ERROR_SUCCESS)
82 {
83 //Get combobox handle
85
86 iItemIndex = ComboBox_FindStringExact(hWnd, -1, szBuffer);
87 if(iItemIndex != CB_ERR)
88 {
89 ComboBox_SetCurSel(hWnd, iItemIndex);
90 }
91 }
92
93 lstatus = RegQueryValueEx(hKey, _T("Advanced"), NULL, &type, (LPBYTE)&dwAdvancedChecked, &size);
94 if (lstatus == ERROR_SUCCESS && type == REG_DWORD && dwAdvancedChecked != FALSE)
95 {
97 }
98
100 }
101 else
102 {
103 /* Default font seems to be Arial */
105
106 iItemIndex = ComboBox_FindStringExact(hWnd, -1, _T("Arial"));
107 if(iItemIndex != CB_ERR)
108 {
109 ComboBox_SetCurSel(hWnd, iItemIndex);
111 }
112 }
113}
#define IDC_CHECK_ADVANCED
Definition: resource.h:26
#define IDC_COMBO_CHARSET
Definition: resource.h:21
LONG QueryStringValue(HKEY hKey, LPCTSTR lpSubKey, LPCTSTR lpValueName, LPTSTR pszBuffer, DWORD dwBufferLen)
Definition: settings.c:19
const TCHAR g_szGeneralRegKey[]
Definition: settings.c:16
HWND hWnd
Definition: settings.c:17
#define RegCloseKey(hKey)
Definition: registry.h:49
HWND hCharmapDlg
Definition: charmap.c:21
VOID ChangeMapFont(HWND hDlg)
Definition: charmap.c:161
#define ERROR_SUCCESS
Definition: deptool.c:10
static LSTATUS(WINAPI *pRegDeleteTreeW)(HKEY
#define NULL
Definition: types.h:112
#define FALSE
Definition: types.h:117
#define MAX_PATH
Definition: compat.h:34
unsigned long DWORD
Definition: ntddk_ex.h:95
FxAutoRegKey hKey
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
GLsizeiptr size
Definition: glext.h:5919
#define KEY_READ
Definition: nt_native.h:1023
#define REG_DWORD
Definition: sdbapi.c:596
unsigned char * LPBYTE
Definition: typedefs.h:53
#define _T(x)
Definition: vfdio.h:22
#define ComboBox_SetCurSel(hwndCtl, index)
Definition: windowsx.h:66
#define ComboBox_FindStringExact(hwndCtl, indexStart, lpszFind)
Definition: windowsx.h:47
#define HKEY_CURRENT_USER
Definition: winreg.h:11
#define RegOpenKeyEx
Definition: winreg.h:520
#define RegQueryValueEx
Definition: winreg.h:524
#define CB_ERR
Definition: winuser.h:2435
#define BM_CLICK
Definition: winuser.h:1917
#define SendDlgItemMessage
Definition: winuser.h:5842
char TCHAR
Definition: xmlstorage.h:189

Referenced by _tWinMain(), BootMain(), EfiEntry(), InitDevice(), InitInstance(), MAIN_LoadSettings(), MainDialogProc(), OnCreate(), OSK_WndProc(), RunLoader(), ScreenSaverConfigureDialog(), ScreenSaverProc(), and wWinMain().

◆ LrgCellWndProc()

LRESULT CALLBACK LrgCellWndProc ( HWND  hwnd,
UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam 
)

Definition at line 68 of file lrgcell.c.

72{
73 PMAP infoPtr;
74 LRESULT Ret = 0;
75 static INT cxClient, cyClient;
76 static RECT rc;
77 static HFONT hFont = NULL;
78
79 infoPtr = (PMAP)GetWindowLongPtrW(hwnd,
81
82 if (infoPtr == NULL && uMsg != WM_CREATE)
83 {
84 goto HandleDefaultMessage;
85 }
86
87 switch (uMsg)
88 {
89 case WM_CREATE:
90 {
91 infoPtr = (PMAP)(((LPCREATESTRUCTW)lParam)->lpCreateParams);
92
95 (LONG_PTR)infoPtr);
96
97 hFont = SetLrgFont(infoPtr);
98
99 break;
100 }
101
102 case WM_SIZE:
103 {
104 cxClient = LOWORD(lParam);
105 cyClient = HIWORD(lParam);
106
107 rc.left = 0;
108 rc.top = 0;
109 rc.right = cxClient;
110 rc.bottom = cyClient;
111
112 break;
113 }
114
115 case WM_PAINT:
116 {
117 PAINTSTRUCT ps;
118 HDC hdc;
119 HFONT hOldFont;
120
122 &ps);
123
125 0,
126 0,
127 cxClient,
128 cyClient);
129
130 hOldFont = SelectObject(hdc, hFont);
131
133 &infoPtr->pActiveCell->ch,
134 1,
135 &rc,
137
138 SelectObject(hdc, hOldFont);
139
141 &ps);
142
143 UpdateStatusBar(infoPtr->pActiveCell->ch);
144 break;
145 }
146
147 case WM_DESTROY:
148 {
150
151 break;
152 }
153
154 default:
155 {
156HandleDefaultMessage:
157 Ret = DefWindowProcW(hwnd,
158 uMsg,
159 wParam,
160 lParam);
161 break;
162 }
163 }
164
165 return Ret;
166}
struct _MAP * PMAP
HFONT hFont
Definition: main.c:53
WPARAM wParam
Definition: combotst.c:138
LPARAM lParam
Definition: combotst.c:139
pKey DeleteObject()
static HFONT SetLrgFont(PMAP infoPtr)
Definition: lrgcell.c:14
HDC hdc
Definition: main.c:9
static HDC
Definition: imagelist.c:92
static DWORD *static HFONT(WINAPI *pCreateFontIndirectExA)(const ENUMLOGFONTEXDVA *)
__int3264 LONG_PTR
Definition: mstsclib_h.h:276
INT WINAPI DrawTextW(HDC hdc, LPCWSTR str, INT count, LPRECT rect, UINT flags)
Definition: defwnd.c:16
#define LOWORD(l)
Definition: pedump.c:82
void UpdateStatusBar(void)
Definition: solitaire.cpp:150
WCHAR ch
Definition: precomp.h:40
Definition: precomp.h:44
PCELL pActiveCell
Definition: precomp.h:51
LONG right
Definition: windef.h:308
LONG bottom
Definition: windef.h:309
LONG top
Definition: windef.h:307
LONG left
Definition: windef.h:306
#define GWLP_USERDATA
Definition: treelist.c:63
#define HIWORD(l)
Definition: typedefs.h:247
_In_ LONG _In_ HWND hwnd
Definition: winddi.h:4023
LONG_PTR LRESULT
Definition: windef.h:209
HGDIOBJ WINAPI SelectObject(_In_ HDC, _In_ HGDIOBJ)
Definition: dc.c:1539
BOOL WINAPI Rectangle(_In_ HDC, _In_ int, _In_ int, _In_ int, _In_ int)
#define WM_PAINT
Definition: winuser.h:1620
#define GetWindowLongPtrW
Definition: winuser.h:4829
#define DT_CENTER
Definition: winuser.h:527
LRESULT WINAPI DefWindowProcW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define WM_CREATE
Definition: winuser.h:1608
#define WM_SIZE
Definition: winuser.h:1611
#define DT_SINGLELINE
Definition: winuser.h:540
BOOL WINAPI EndPaint(_In_ HWND, _In_ const PAINTSTRUCT *)
#define DT_VCENTER
Definition: winuser.h:543
#define WM_DESTROY
Definition: winuser.h:1609
HDC WINAPI BeginPaint(_In_ HWND, _Out_ LPPAINTSTRUCT)
#define SetWindowLongPtrW
Definition: winuser.h:5346

Referenced by RegisterMapClasses().

◆ RegisterMapClasses()

BOOL RegisterMapClasses ( HINSTANCE  hInstance)

Definition at line 849 of file map.c.

850{
851 WNDCLASSW wc = {0};
852
853 wc.style = CS_DBLCLKS;
855 wc.cbWndExtra = sizeof(PMAP);
856 wc.hInstance = hInstance;
859 wc.hbrBackground = (HBRUSH)(COLOR_WINDOW + 1);
861
862 if (RegisterClassW(&wc))
863 {
865 wc.cbWndExtra = 0;
867
868 return RegisterClassW(&wc) != 0;
869 }
870
871 return FALSE;
872}
HINSTANCE hInstance
Definition: charmap.c:19
LRESULT CALLBACK LrgCellWndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: lrgcell.c:68
static const WCHAR szMapWndClass[]
Definition: map.c:16
static const WCHAR szLrgCellWndClass[]
Definition: map.c:17
LRESULT CALLBACK MapWndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: map.c:729
LPCWSTR lpszClassName
Definition: winuser.h:3185
HBRUSH hbrBackground
Definition: winuser.h:3183
HINSTANCE hInstance
Definition: winuser.h:3180
UINT style
Definition: winuser.h:3176
WNDPROC lpfnWndProc
Definition: winuser.h:3177
int cbWndExtra
Definition: winuser.h:3179
HCURSOR hCursor
Definition: winuser.h:3182
#define COLOR_WINDOW
Definition: winuser.h:918
ATOM WINAPI RegisterClassW(_In_ CONST WNDCLASSW *)
#define IDC_ARROW
Definition: winuser.h:687
#define CS_DBLCLKS
Definition: winuser.h:651
HCURSOR WINAPI LoadCursorW(_In_opt_ HINSTANCE, _In_ LPCWSTR)
Definition: cursoricon.c:2136

Referenced by wWinMain().

◆ SaveSettings()

void SaveSettings ( void  Dlg)

Definition at line 115 of file settings.c.

116{
117 HKEY hKey = NULL;
118
120 {
121 TCHAR szBuffer[MAX_PATH];
122
124 ComboBox_GetText(hWnd, szBuffer, MAX_PATH);
125
126 if(*szBuffer != '\0')
127 RegSetValueEx(hKey, _T("Font"), 0, REG_SZ, (LPBYTE) szBuffer, (DWORD) MAX_PATH);
128
130 ComboBox_GetText(hWnd, szBuffer, MAX_PATH);
131
132 if(*szBuffer != '\0')
133 RegSetValueEx(hKey, _T("CodePage"), 0, REG_SZ, (LPBYTE) szBuffer, (DWORD) MAX_PATH);
134
135 RegSetValueEx(hKey, _T("Advanced"), 0, REG_DWORD, (LPBYTE)&Settings.IsAdvancedView, (DWORD) sizeof(DWORD));
136
138 }
139}
#define REG_SZ
Definition: layer.c:22
#define REG_OPTION_NON_VOLATILE
Definition: nt_native.h:1057
#define KEY_SET_VALUE
Definition: nt_native.h:1017
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_DEVICE_POWER_POLICY_IDLE_SETTINGS Settings
Definition: wdfdevice.h:2595
#define ComboBox_GetText(hwndCtl, lpch, cchMax)
Definition: windowsx.h:58
#define RegSetValueEx
Definition: winreg.h:533
#define RegCreateKeyEx
Definition: winreg.h:501

Referenced by _tWinMain(), ConfigDlgProc(), FrameWndProc(), GeneralPageProc(), MainDialogProc(), OSK_Close(), OSK_WndProc(), PanelWndProc(), CMainWindow::ProcessWindowMessage(), ScreenSaverConfigureDialog(), anonymous_namespace{settingsdlg.cpp}::SettingsDlgProc(), WndProc(), and wWinMain().

◆ ShowAboutDlg()

VOID ShowAboutDlg ( HWND  hWndParent)

Definition at line 77 of file about.c.

78{
83}
static INT_PTR CALLBACK AboutDialogProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
Definition: about.c:15
#define IDD_ABOUTBOX
Definition: resource.h:8
#define DialogBoxW(i, t, p, f)
Definition: winuser.h:4399
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582

Referenced by PanelWndProc().

◆ UnregisterMapClasses()

VOID UnregisterMapClasses ( HINSTANCE  hInstance)

Definition at line 875 of file map.c.

876{
879}
BOOL WINAPI UnregisterClassW(_In_ LPCWSTR, HINSTANCE)

Referenced by wWinMain().

◆ UpdateStatusBar()

VOID UpdateStatusBar ( WCHAR  wch)

Definition at line 310 of file charmap.c.

311{
313 WCHAR szDesc[MAX_PATH];
314
315 GetUName(wch, szDesc);
316 wsprintfW(buff, L"U+%04X: %s", wch, szDesc);
318}
int WINAPI GetUName(IN WORD wCharCode, OUT LPWSTR lpBuf)
Definition: getuname.c:17
HWND hStatusWnd
Definition: charmap.c:22
static unsigned char buff[32768]
Definition: fatten.c:17
#define SB_SETTEXT
Definition: commctrl.h:1949
int WINAPIV wsprintfW(_Out_ LPWSTR, _In_ _Printf_format_string_ LPCWSTR,...)

Variable Documentation

◆ codePages

const UINT codePages[]
static
Initial value:
= {
864, 775, 863, 855, 737, 856, 862, 861, 852, 869, 850, 858, 865, 860, 866, 857, 437,
1256, 1257, 1250, 1251, 1253, 1255, 932, 949, 1252, 936, 874, 950, 1254, 1258
}

Definition at line 29 of file precomp.h.

Referenced by FillCharacterSetComboList(), and GetPossibleCharacters().

◆ hCharmapDlg

HWND hCharmapDlg
extern

◆ hInstance

HINSTANCE hInstance
extern

Definition at line 19 of file charmap.c.

◆ Settings

Definition at line 25 of file charmap.c.