1 #ifndef __CHARMAP_PRECOMP_H 2 #define __CHARMAP_PRECOMP_H 3 4 #include <stdarg.h> 5 #include <windef.h> 6 #include <winbase.h> 7 #include <winuser.h> 8 #include <wingdi.h> 9 10 11 #include "resource.h" 12 13 #define SIZEOF(_v) (sizeof(_v) / sizeof(*_v)) 14 15 #define MAX_GLYPHS 65536 16 17 #define XCELLS 20 18 #define YCELLS 10 19 #define XLARGE 45 20 #define YLARGE 25 21 22 #define FM_SETFONT (WM_USER + 1) 23 #define FM_GETCHAR (WM_USER + 2) 24 #define FM_SETCHAR (WM_USER + 3) 25 #define FM_GETHFONT (WM_USER + 4) 26 #define FM_SETCHARMAP (WM_USER + 5) 27 28 // the code pages to display in the advanced 'character set' combobox 29 static const UINT codePages[] = { 30 864, 775, 863, 855, 737, 856, 862, 861, 852, 869, 850, 858, 865, 860, 866, 857, 437, // OEM code pages 31 1256, 1257, 1250, 1251, 1253, 1255, 932, 949, 1252, 936, 874, 950, 1254, 1258 // ANSI code pages 32 }; 33 34 extern HINSTANCE hInstance; 35 36 typedef struct _CELL 37 { 38 RECT CellExt; 39 RECT CellInt; 40 BOOL bActive; 41 BOOL bLarge; 42 WCHAR ch; 43 } CELL, *PCELL; 44 45 typedef struct _MAP 46 { 47 HWND hMapWnd; 48 HWND hParent; 49 HWND hLrgWnd; 50 SIZE ClientSize; 51 SIZE CellSize; 52 CELL Cells[YCELLS][XCELLS]; 53 PCELL pActiveCell; 54 HFONT hFont; 55 LOGFONTW CurrentFont; 56 INT iYStart; 57 INT NumRows; 58 INT CharMap; 59 60 USHORT ValidGlyphs[MAX_GLYPHS]; 61 USHORT NumValidGlyphs; 62 63 } MAP, *PMAP; 64 65 typedef struct { 66 NMHDR hdr; 67 WCHAR ch; 68 } MAPNOTIFY, *LPMAPNOTIFY; 69 70 typedef struct { 71 BOOL IsAdvancedView; 72 } SETTINGS; 73 74 extern SETTINGS Settings; 75 extern HWND hCharmapDlg; 76 77 LRESULT CALLBACK LrgCellWndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam); 78 79 VOID ShowAboutDlg(HWND hWndParent); 80 81 BOOL RegisterMapClasses(HINSTANCE hInstance); 82 VOID UnregisterMapClasses(HINSTANCE hInstance); 83 84 int WINAPI GetUName(IN WORD wCharCode, OUT LPWSTR lpBuf); 85 86 /* charmap.c */ 87 VOID UpdateStatusBar(WCHAR wch); 88 extern VOID ChangeMapFont(HWND hDlg); 89 90 /* settings.c */ 91 extern void LoadSettings(void); 92 extern void SaveSettings(void); 93 94 #endif /* __CHARMAP_PRECOMP_H */ 95