reactos/base/applications/charmap/precomp.h
Katayama Hirofumi MZ 7e9f1e67f3
[CHARMAP] Improve keyboard usability (#4839)
- Use IsDialogMessage function in message loop to enable Tab.
- Add WS_TABSTOP style to IDC_FONTCOMBO control.
- Set focus on create.
- Handle WM_KEYDOWN and WM_GETDLGCODE messages.
- Add UpdateCells, LimitCaretXY SetCaretXY, MoveUpDown, and MoveLeftRight helper functions.
- Delete DrawGrid, and DrawActiveCell functions for simplicity.
- Add and delete some members in MAP structure.
CORE-13806
2022-11-06 08:37:18 +09:00

93 lines
1.9 KiB
C

#ifndef __CHARMAP_PRECOMP_H
#define __CHARMAP_PRECOMP_H
#include <stdarg.h>
#include <windef.h>
#include <winbase.h>
#include <winuser.h>
#include <wingdi.h>
#include "resource.h"
#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)
// the code pages to display in the advanced 'character set' combobox
static const UINT codePages[] = {
864, 775, 863, 855, 737, 856, 862, 861, 852, 869, 850, 858, 865, 860, 866, 857, 437, // OEM code pages
1256, 1257, 1250, 1251, 1253, 1255, 932, 949, 1252, 936, 874, 950, 1254, 1258 // ANSI code pages
};
extern HINSTANCE hInstance;
typedef struct _CELL
{
RECT CellExt;
RECT CellInt;
WCHAR ch;
} CELL, *PCELL;
typedef struct _MAP
{
HWND hMapWnd;
HWND hParent;
HWND hLrgWnd;
SIZE ClientSize;
SIZE CellSize;
CELL Cells[YCELLS][XCELLS];
PCELL pActiveCell;
HFONT hFont;
LOGFONTW CurrentFont;
INT CaretX, CaretY;
INT iYStart;
INT NumRows;
INT CharMap;
USHORT ValidGlyphs[MAX_GLYPHS];
USHORT NumValidGlyphs;
} MAP, *PMAP;
typedef struct {
NMHDR hdr;
WCHAR ch;
} MAPNOTIFY, *LPMAPNOTIFY;
typedef struct {
BOOL IsAdvancedView;
} SETTINGS;
extern SETTINGS Settings;
extern HWND hCharmapDlg;
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);
/* charmap.c */
VOID UpdateStatusBar(WCHAR wch);
extern VOID ChangeMapFont(HWND hDlg);
/* settings.c */
extern void LoadSettings(void);
extern void SaveSettings(void);
#endif /* __CHARMAP_PRECOMP_H */