ReactOS  0.4.13-dev-92-gf251225
precomp.h File Reference
#include <windows.h>
#include <windowsx.h>
#include <commctrl.h>
#include <strsafe.h>
#include "resource.h"
#include "customwndclasses.h"
#include "raw.h"
#include "cpi.h"
#include "psf.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  _VGAFONT
 
struct  _MAIN_WND_INFO
 
struct  _FONT_OPEN_INFO
 
struct  _FONT_WND_INFO
 
struct  _EDIT_GLYPH_INFO
 

Macros

#define ID_MDI_FIRSTCHILD   50000
 
#define CHARACTER_INFO_BOX_WIDTH   55
 
#define CHARACTER_INFO_BOX_HEIGHT   16
 
#define CHARACTER_BITMAP_BOX_HEIGHT   14
 
#define CHARACTER_BOX_WIDTH   (CHARACTER_INFO_BOX_WIDTH)
 
#define CHARACTER_BOX_HEIGHT   (CHARACTER_INFO_BOX_HEIGHT + CHARACTER_BITMAP_BOX_HEIGHT)
 
#define CHARACTER_BOX_PADDING   5
 
#define FONT_BOXES_WND_WIDTH   (CHARACTER_BOX_WIDTH * 16 + CHARACTER_BOX_PADDING * 15)
 
#define FONT_BOXES_WND_HEIGHT   (CHARACTER_BOX_HEIGHT * 16 + CHARACTER_BOX_PADDING * 15)
 
#define FONT_WND_MIN_WIDTH   (FONT_BOXES_WND_WIDTH + 25)
 
#define FONT_WND_MIN_HEIGHT   (FONT_BOXES_WND_HEIGHT + GetSystemMetrics(SM_CYCAPTION) + 25)
 
#define HITTEST_SEPARATOR   -1
 
#define WM_USER_APPCLOSE   (WM_USER + 1)
 
#define TOOLBAR_EDIT_GLYPH   0
 
#define TOOLBOX_PEN   0
 

Typedefs

typedef struct _VGAFONT VGAFONT
 
typedef struct _VGAFONTPVGAFONT
 
typedef struct _FONT_WND_INFO FONT_WND_INFO
 
typedef struct _FONT_WND_INFOPFONT_WND_INFO
 
typedef struct _EDIT_GLYPH_INFO EDIT_GLYPH_INFO
 
typedef struct _EDIT_GLYPH_INFOPEDIT_GLYPH_INFO
 
typedef struct _MAIN_WND_INFO MAIN_WND_INFO
 
typedef struct _MAIN_WND_INFOPMAIN_WND_INFO
 
typedef struct _FONT_OPEN_INFO FONT_OPEN_INFO
 
typedef struct _FONT_OPEN_INFOPFONT_OPEN_INFO
 

Enumerations

enum  VGAFONT_TYPE { RAW, CPI, PSF }
 

Functions

INT_PTR CALLBACK AboutDlgProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
 
INT_PTR CALLBACK EditGlyphDlgProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
 
BOOL InitEditGlyphWndClasses (VOID)
 
VOID UnInitEditGlyphWndClasses (VOID)
 
VOID CreateFontBoxesWindow (PFONT_WND_INFO FontWndInfo)
 
BOOL InitFontBoxesWndClass (VOID)
 
VOID UnInitFontBoxesWndClass (VOID)
 
VOID GetCharacterRect (IN UINT uFontRow, IN UINT uFontColumn, OUT LPRECT CharacterRect)
 
__inline VOID GetCharacterPosition (IN UINT uCharacter, OUT PUINT uFontRow, OUT PUINT uFontColumn)
 
VOID EditCurrentGlyph (PFONT_WND_INFO FontWndInfo)
 
BOOL CreateFontWindow (PMAIN_WND_INFO MainWndInfo, PFONT_OPEN_INFO OpenInfo)
 
BOOL InitFontWndClass (VOID)
 
VOID UnInitFontWndClass (VOID)
 
BOOL CreateMainWindow (IN INT nCmdShow, OUT PMAIN_WND_INFO *Info)
 
BOOL InitMainWndClass (VOID)
 
VOID UnInitMainWndClass (VOID)
 
VOID DoFileSave (IN PMAIN_WND_INFO Info, IN BOOL bSaveAs)
 
VOID SetToolbarFileButtonState (IN PMAIN_WND_INFO Info, BOOL bEnabled)
 
VOID SetPasteButtonState (IN PMAIN_WND_INFO Info)
 
INT AllocAndLoadString (OUT PWSTR *lpTarget, IN UINT uID)
 
DWORD LoadAndFormatString (IN UINT uID, OUT PWSTR *lpTarget,...)
 
VOID LocalizedError (IN UINT uID,...)
 
VOID FileInitialize (HWND hwnd)
 
BOOL DoOpenFile (OUT PWSTR pszFileName)
 
BOOL DoSaveFile (IN PWSTR pszFileName)
 

Variables

PWSTR szAppName
 
HINSTANCE hInstance
 
HANDLE hProcessHeap
 
UINT uCharacterClipboardFormat
 

Macro Definition Documentation

◆ CHARACTER_BITMAP_BOX_HEIGHT

#define CHARACTER_BITMAP_BOX_HEIGHT   14

Definition at line 102 of file precomp.h.

◆ CHARACTER_BOX_HEIGHT

Definition at line 104 of file precomp.h.

◆ CHARACTER_BOX_PADDING

#define CHARACTER_BOX_PADDING   5

Definition at line 105 of file precomp.h.

◆ CHARACTER_BOX_WIDTH

#define CHARACTER_BOX_WIDTH   (CHARACTER_INFO_BOX_WIDTH)

Definition at line 103 of file precomp.h.

◆ CHARACTER_INFO_BOX_HEIGHT

#define CHARACTER_INFO_BOX_HEIGHT   16

Definition at line 101 of file precomp.h.

◆ CHARACTER_INFO_BOX_WIDTH

#define CHARACTER_INFO_BOX_WIDTH   55

Definition at line 100 of file precomp.h.

◆ FONT_BOXES_WND_HEIGHT

#define FONT_BOXES_WND_HEIGHT   (CHARACTER_BOX_HEIGHT * 16 + CHARACTER_BOX_PADDING * 15)

Definition at line 107 of file precomp.h.

◆ FONT_BOXES_WND_WIDTH

#define FONT_BOXES_WND_WIDTH   (CHARACTER_BOX_WIDTH * 16 + CHARACTER_BOX_PADDING * 15)

Definition at line 106 of file precomp.h.

◆ FONT_WND_MIN_HEIGHT

#define FONT_WND_MIN_HEIGHT   (FONT_BOXES_WND_HEIGHT + GetSystemMetrics(SM_CYCAPTION) + 25)

Definition at line 109 of file precomp.h.

◆ FONT_WND_MIN_WIDTH

#define FONT_WND_MIN_WIDTH   (FONT_BOXES_WND_WIDTH + 25)

Definition at line 108 of file precomp.h.

◆ HITTEST_SEPARATOR

#define HITTEST_SEPARATOR   -1

Definition at line 112 of file precomp.h.

◆ ID_MDI_FIRSTCHILD

#define ID_MDI_FIRSTCHILD   50000

Definition at line 97 of file precomp.h.

◆ TOOLBAR_EDIT_GLYPH

#define TOOLBAR_EDIT_GLYPH   0

Definition at line 118 of file precomp.h.

◆ TOOLBOX_PEN

#define TOOLBOX_PEN   0

Definition at line 119 of file precomp.h.

◆ WM_USER_APPCLOSE

#define WM_USER_APPCLOSE   (WM_USER + 1)

Definition at line 115 of file precomp.h.

Typedef Documentation

◆ EDIT_GLYPH_INFO

Definition at line 37 of file precomp.h.

◆ FONT_OPEN_INFO

◆ FONT_WND_INFO

Definition at line 36 of file precomp.h.

◆ MAIN_WND_INFO

◆ PEDIT_GLYPH_INFO

Definition at line 37 of file precomp.h.

◆ PFONT_OPEN_INFO

◆ PFONT_WND_INFO

Definition at line 36 of file precomp.h.

◆ PMAIN_WND_INFO

◆ PVGAFONT

◆ VGAFONT

Enumeration Type Documentation

◆ VGAFONT_TYPE

Enumerator
RAW 
CPI 
PSF 

Definition at line 22 of file precomp.h.

23 {
24  RAW,
25  CPI,
26  PSF
27 } VGAFONT_TYPE;
Definition: precomp.h:24
VGAFONT_TYPE
Definition: precomp.h:22
Definition: precomp.h:25
Definition: precomp.h:26

Function Documentation

◆ AboutDlgProc()

INT_PTR CALLBACK AboutDlgProc ( HWND  hwnd,
UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam 
)

Definition at line 83 of file sndrec32.cpp.

87 {
88  switch (msg)
89  {
90  case WM_COMMAND:
91  switch (LOWORD(wp))
92  {
93  case IDOK:
94  EndDialog(hWnd, 0);
95  return TRUE;
96  }
97  break;
98  case WM_CLOSE:
99  EndDialog(hWnd, 0);
100  return TRUE;
101  }
102  return FALSE;
103 }
#define TRUE
Definition: types.h:120
#define IDOK
Definition: winuser.h:824
HWND hWnd
Definition: settings.c:17
BOOL WINAPI EndDialog(_In_ HWND, _In_ INT_PTR)
#define WM_CLOSE
Definition: winuser.h:1603
#define WM_COMMAND
Definition: winuser.h:1716
#define msg(x)
Definition: auth_time.c:54
#define LOWORD(l)
Definition: pedump.c:82

Referenced by WndProc().

◆ AllocAndLoadString()

INT AllocAndLoadString ( OUT PWSTR lpTarget,
IN UINT  uID 
)

◆ CreateFontBoxesWindow()

VOID CreateFontBoxesWindow ( PFONT_WND_INFO  FontWndInfo)

◆ CreateFontWindow()

BOOL CreateFontWindow ( PMAIN_WND_INFO  MainWndInfo,
PFONT_OPEN_INFO  OpenInfo 
)

◆ CreateMainWindow()

BOOL CreateMainWindow ( IN INT  nCmdShow,
OUT PMAIN_WND_INFO Info 
)

Definition at line 608 of file mainwnd.c.

609 {
610  HWND hMainWnd;
611 
613 
614  if(*Info)
615  {
616  (*Info)->nCmdShow = nCmdShow;
617 
620  szAppName,
626  NULL,
628  hInstance,
629  *Info);
630 
631  if(hMainWnd)
632  return TRUE;
633  else
634  HeapFree(hProcessHeap, 0, *Info);
635  }
636 
637  return FALSE;
638 }
#define WS_CLIPSIBLINGS
Definition: pedump.c:618
#define TRUE
Definition: types.h:120
static const WCHAR szMainWndClass[]
Definition: mainwnd.c:11
#define WS_CLIPCHILDREN
Definition: pedump.c:619
struct TraceInfo Info
#define CW_USEDEFAULT
Definition: winuser.h:225
smooth NULL
Definition: ftsmooth.c:416
#define IDM_MAINMENU
Definition: resources.h:3
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
struct _MAIN_WND_INFO * PMAIN_WND_INFO
HWND hMainWnd
Definition: magnifier.c:33
HWND WINAPI CreateWindowExW(_In_ DWORD dwExStyle, _In_opt_ LPCWSTR lpClassName, _In_opt_ LPCWSTR lpWindowName, _In_ DWORD dwStyle, _In_ int X, _In_ int Y, _In_ int nWidth, _In_ int nHeight, _In_opt_ HWND hWndParent, _In_opt_ HMENU hMenu, _In_opt_ HINSTANCE hInstance, _In_opt_ LPVOID lpParam)
TCHAR szAppName[128]
Definition: solitaire.cpp:16
HINSTANCE hInstance
Definition: mainwnd.c:15
#define HEAP_ZERO_MEMORY
Definition: compat.h:123
HMENU WINAPI LoadMenuW(_In_opt_ HINSTANCE, _In_ LPCWSTR)
#define WS_OVERLAPPEDWINDOW
Definition: pedump.c:637
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582
#define HeapFree(x, y, z)
Definition: compat.h:394
HANDLE hProcessHeap
Definition: kbswitch.c:25

◆ DoFileSave()

VOID DoFileSave ( IN PMAIN_WND_INFO  Info,
IN BOOL  bSaveAs 
)

Definition at line 289 of file mainwnd.c.

290 {
291  DWORD dwBytesWritten;
292  HANDLE hFile;
293 
294  // Show the "Save" dialog
295  // - if "Save As" was clicked
296  // - if the file was not yet saved
297  // - if another format than the binary format was opened
298  if(bSaveAs || !Info->CurrentFontWnd->OpenInfo->bBinaryFileOpened)
299  {
300  if(!Info->CurrentFontWnd->OpenInfo->pszFileName)
301  {
302  Info->CurrentFontWnd->OpenInfo->pszFileName = (PWSTR) HeapAlloc(hProcessHeap, 0, MAX_PATH);
303  Info->CurrentFontWnd->OpenInfo->pszFileName[0] = 0;
304  }
305  else if(!Info->CurrentFontWnd->OpenInfo->bBinaryFileOpened)
306  {
307  // For a file in another format, the user has to enter a new file name as well
308  Info->CurrentFontWnd->OpenInfo->pszFileName[0] = 0;
309  }
310 
311  if( !DoSaveFile(Info->CurrentFontWnd->OpenInfo->pszFileName) )
312  return;
313  }
314 
315  // Save the binary font
316  hFile = CreateFileW(Info->CurrentFontWnd->OpenInfo->pszFileName, GENERIC_WRITE, FILE_SHARE_WRITE, NULL, OPEN_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
317 
319  {
321  return;
322  }
323 
324  if( !WriteFile(hFile, Info->CurrentFontWnd->Font, sizeof(BITMAP_FONT), &dwBytesWritten, NULL) )
326 
328 }
BOOL WINAPI WriteFile(IN HANDLE hFile, IN LPCVOID lpBuffer, IN DWORD nNumberOfBytesToWrite OPTIONAL, OUT LPDWORD lpNumberOfBytesWritten, IN LPOVERLAPPED lpOverlapped OPTIONAL)
Definition: rw.c:24
#define CloseHandle
Definition: compat.h:398
uint16_t * PWSTR
Definition: typedefs.h:54
#define INVALID_HANDLE_VALUE
Definition: compat.h:391
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1059
#define FILE_SHARE_WRITE
Definition: nt_native.h:681
struct TraceInfo Info
#define GENERIC_WRITE
Definition: nt_native.h:90
smooth NULL
Definition: ftsmooth.c:416
#define IDS_OPENERROR
Definition: resource.h:61
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
#define MAX_PATH
Definition: compat.h:26
VOID LocalizedError(IN UINT uID,...)
Definition: misc.c:103
unsigned long DWORD
Definition: ntddk_ex.h:95
#define OPEN_ALWAYS
Definition: disk.h:70
#define IDS_WRITEERROR
Definition: resource.h:63
#define FILE_ATTRIBUTE_NORMAL
Definition: compat.h:126
static BOOL DoSaveFile(HWND hWnd, PCONSOLE_CHILDFRM_WND pChildInfo)
Definition: console.c:205
_In_ HANDLE hFile
Definition: mswsock.h:90
#define CreateFileW
Definition: compat.h:400
HANDLE hProcessHeap
Definition: kbswitch.c:25

Referenced by FontWndProc(), and MenuCommand().

◆ DoOpenFile()

BOOL DoOpenFile ( OUT PWSTR  pszFileName)

Definition at line 36 of file opensave.c.

37 {
38  BOOL bRet;
39  PWSTR pszFilter;
40 
41  if( AllocAndLoadString(&pszFilter, IDS_OPENFILTER) )
42  {
43  PrepareFilter(pszFilter);
44  ofn.lpstrFilter = pszFilter;
47 
48  bRet = GetOpenFileNameW(&ofn);
49  HeapFree(hProcessHeap, 0, pszFilter);
50 
51  return bRet;
52  }
53 
54  return FALSE;
55 }
#define OFN_FILEMUSTEXIST
Definition: commdlg.h:106
DWORD Flags
Definition: commdlg.h:373
LPCWSTR lpstrFilter
Definition: commdlg.h:363
uint16_t * PWSTR
Definition: typedefs.h:54
LPWSTR lpstrFile
Definition: commdlg.h:367
static INT AllocAndLoadString(OUT LPTSTR *lpTarget, IN HINSTANCE hInst, IN UINT uID)
Definition: misc.c:60
#define IDS_OPENFILTER
Definition: resource.h:59
static OPENFILENAMEW ofn
Definition: opensave.c:10
static __inline VOID PrepareFilter(IN PWSTR pszFilter)
Definition: opensave.c:23
unsigned int BOOL
Definition: ntddk_ex.h:94
BOOL WINAPI GetOpenFileNameW(OPENFILENAMEW *ofn)
Definition: filedlg.c:4221
WORD WORD PSZ PSZ pszFileName
Definition: vdmdbg.h:41
#define HeapFree(x, y, z)
Definition: compat.h:394
HANDLE hProcessHeap
Definition: kbswitch.c:25

◆ DoSaveFile()

BOOL DoSaveFile ( IN PWSTR  pszFileName)

◆ EditCurrentGlyph()

VOID EditCurrentGlyph ( PFONT_WND_INFO  FontWndInfo)

Definition at line 189 of file fontboxeswnd.c.

190 {
191  PEDIT_GLYPH_INFO EditGlyphInfo;
192 
193  // Has the window for this character already been opened?
194  EditGlyphInfo = FontWndInfo->FirstEditGlyphWnd;
195 
196  while(EditGlyphInfo)
197  {
198  if(EditGlyphInfo->uCharacter == FontWndInfo->uSelectedCharacter)
199  {
200  // Yes, it has. Bring it to the front.
201  SetFocus(EditGlyphInfo->hSelf);
202  return;
203  }
204 
205  EditGlyphInfo = EditGlyphInfo->NextEditGlyphWnd;
206  }
207 
208  // No. Then create a new one
209  EditGlyphInfo = (PEDIT_GLYPH_INFO) HeapAlloc( hProcessHeap, 0, sizeof(EDIT_GLYPH_INFO) );
210  EditGlyphInfo->FontWndInfo = FontWndInfo;
211  EditGlyphInfo->uCharacter = FontWndInfo->uSelectedCharacter;
212  RtlCopyMemory( EditGlyphInfo->CharacterBits, FontWndInfo->Font->Bits + FontWndInfo->uSelectedCharacter * 8, sizeof(EditGlyphInfo->CharacterBits) );
213 
214  // Add the new window to the linked list
215  EditGlyphInfo->PrevEditGlyphWnd = FontWndInfo->LastEditGlyphWnd;
216  EditGlyphInfo->NextEditGlyphWnd = NULL;
217 
218  if(FontWndInfo->LastEditGlyphWnd)
219  FontWndInfo->LastEditGlyphWnd->NextEditGlyphWnd = EditGlyphInfo;
220  else
221  FontWndInfo->FirstEditGlyphWnd = EditGlyphInfo;
222 
223  FontWndInfo->LastEditGlyphWnd = EditGlyphInfo;
224 
225  // Open the window as a modeless dialog, so people can edit several characters at the same time.
226  EditGlyphInfo->hSelf = CreateDialogParamW(hInstance, MAKEINTRESOURCEW(IDD_EDITGLYPH), FontWndInfo->hSelf, EditGlyphDlgProc, (LPARAM)EditGlyphInfo);
227  ShowWindow(EditGlyphInfo->hSelf, SW_SHOW);
228 }
NTSYSAPI VOID NTAPI RtlCopyMemory(VOID UNALIGNED *Destination, CONST VOID UNALIGNED *Source, ULONG Length)
UCHAR Bits[2048]
Definition: raw.h:13
struct _EDIT_GLYPH_INFO * PEDIT_GLYPH_INFO
Definition: precomp.h:37
INT_PTR CALLBACK EditGlyphDlgProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: editglyphdlg.c:119
HWND WINAPI SetFocus(_In_opt_ HWND)
PEDIT_GLYPH_INFO LastEditGlyphWnd
Definition: precomp.h:78
BOOL WINAPI ShowWindow(_In_ HWND, _In_ int)
PEDIT_GLYPH_INFO NextEditGlyphWnd
Definition: precomp.h:94
HINSTANCE hInstance
Definition: charmap.c:20
PEDIT_GLYPH_INFO PrevEditGlyphWnd
Definition: precomp.h:93
smooth NULL
Definition: ftsmooth.c:416
UINT uSelectedCharacter
Definition: precomp.h:72
LONG_PTR LPARAM
Definition: windef.h:208
UINT uCharacter
Definition: precomp.h:85
PEDIT_GLYPH_INFO FirstEditGlyphWnd
Definition: precomp.h:77
#define SW_SHOW
Definition: winuser.h:769
UCHAR CharacterBits[8]
Definition: precomp.h:86
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
#define IDD_EDITGLYPH
Definition: resource.h:29
HWND hSelf
Definition: precomp.h:70
PFONT_WND_INFO FontWndInfo
Definition: precomp.h:83
PBITMAP_FONT Font
Definition: precomp.h:68
HWND WINAPI CreateDialogParamW(_In_opt_ HINSTANCE, _In_ LPCWSTR, _In_opt_ HWND, _In_opt_ DLGPROC, _In_ LPARAM)
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582
HANDLE hProcessHeap
Definition: kbswitch.c:25

Referenced by FontBoxesWndProc(), and MenuCommand().

◆ EditGlyphDlgProc()

INT_PTR CALLBACK EditGlyphDlgProc ( HWND  hwnd,
UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam 
)

Definition at line 119 of file editglyphdlg.c.

120 {
122 
124 
125  if(Info || uMsg == WM_INITDIALOG)
126  {
127  switch(uMsg)
128  {
129  case WM_COMMAND:
130  return EditGlyphCommand( LOWORD(wParam), Info );
131 
132  case WM_INITDIALOG:
134  Info->hSelf = hwnd;
137 
141 
142  InitToolbox(Info);
143 
144  return TRUE;
145  }
146  }
147 
148  return FALSE;
149 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
#define TRUE
Definition: types.h:120
struct _EDIT_GLYPH_INFO * PEDIT_GLYPH_INFO
Definition: precomp.h:37
#define GetWindowLongPtrW
Definition: winuser.h:4698
WPARAM wParam
Definition: combotst.c:138
struct TraceInfo Info
#define GWLP_USERDATA
Definition: treelist.c:63
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
#define WM_COMMAND
Definition: winuser.h:1716
#define IDC_EDIT_GLYPH_EDIT
Definition: resource.h:33
static BOOL EditGlyphCommand(IN INT idCommand, IN PEDIT_GLYPH_INFO Info)
Definition: editglyphdlg.c:71
__int3264 LONG_PTR
Definition: mstsclib_h.h:276
static VOID InitToolbox(IN PEDIT_GLYPH_INFO Info)
Definition: editglyphdlg.c:24
#define IDC_EDIT_GLYPH_PREVIEW
Definition: resource.h:34
#define SetWindowLongPtrW
Definition: winuser.h:5215
#define WM_INITDIALOG
Definition: winuser.h:1715
LPARAM lParam
Definition: combotst.c:139
#define LOWORD(l)
Definition: pedump.c:82

Referenced by EditCurrentGlyph().

◆ FileInitialize()

VOID FileInitialize ( HWND  hwnd)

Definition at line 8 of file opensave.c.

9 {
10  ZeroMemory(&ofn, sizeof(ofn));
11  ofn.lStructSize = sizeof(OPENFILENAME);
12  ofn.hwndOwner = hwnd;
15  ofn.lpstrDefExt = _T("bmp");
16 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
HWND hwndOwner
Definition: commdlg.h:330
#define ZeroMemory
Definition: winbase.h:1635
LPCSTR lpstrDefExt
Definition: commdlg.h:345
DWORD nMaxFile
Definition: commdlg.h:337
OPENFILENAMEA OPENFILENAME
Definition: commdlg.h:657
#define _T(x)
Definition: vfdio.h:22
static OPENFILENAME ofn
Definition: opensave.c:3
#define MAX_PATH
Definition: compat.h:26
DWORD lStructSize
Definition: commdlg.h:329
DWORD nMaxFileTitle
Definition: commdlg.h:339

◆ GetCharacterPosition()

__inline VOID GetCharacterPosition ( IN UINT  uCharacter,
OUT PUINT  uFontRow,
OUT PUINT  uFontColumn 
)

Definition at line 34 of file fontboxeswnd.c.

35 {
36  *uFontRow = uCharacter / 16;
37  *uFontColumn = uCharacter % 16;
38 }

Referenced by EditGlyphCommand(), PasteIntoCurrentGlyph(), and SetSelectedCharacter().

◆ GetCharacterRect()

VOID GetCharacterRect ( IN UINT  uFontRow,
IN UINT  uFontColumn,
OUT LPRECT  CharacterRect 
)

Definition at line 25 of file fontboxeswnd.c.

26 {
27  CharacterRect->left = uFontColumn * (CHARACTER_BOX_WIDTH + CHARACTER_BOX_PADDING);
28  CharacterRect->top = uFontRow * (CHARACTER_BOX_HEIGHT + CHARACTER_BOX_PADDING);
29  CharacterRect->right = CharacterRect->left + CHARACTER_BOX_WIDTH;
30  CharacterRect->bottom = CharacterRect->top + CHARACTER_BOX_HEIGHT;
31 }
#define CHARACTER_BOX_WIDTH
Definition: precomp.h:103
#define CHARACTER_BOX_HEIGHT
Definition: precomp.h:104
#define CHARACTER_BOX_PADDING
Definition: precomp.h:105

Referenced by DrawProc(), EditGlyphCommand(), FontBoxesHitTest(), PasteIntoCurrentGlyph(), and SetSelectedCharacter().

◆ InitEditGlyphWndClasses()

BOOL InitEditGlyphWndClasses ( VOID  )

Definition at line 283 of file editglyphdlg.c.

284 {
285  WNDCLASSW wc = {0,};
286 
288  wc.hInstance = hInstance;
289  wc.hCursor = LoadCursor( NULL, IDC_ARROW );
291 
292  if( !RegisterClassW(&wc) )
293  return FALSE;
294 
297 
298  return RegisterClassW(&wc) != 0;
299 }
static LRESULT CALLBACK EditGlyphEditWndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: editglyphdlg.c:152
ATOM WINAPI RegisterClassW(_In_ CONST WNDCLASSW *)
HINSTANCE hInstance
Definition: charmap.c:20
WNDPROC lpfnWndProc
Definition: winuser.h:3130
smooth NULL
Definition: ftsmooth.c:416
LPCWSTR lpszClassName
Definition: winuser.h:3138
#define LoadCursor
Definition: winuser.h:5678
#define EDIT_GLYPH_EDIT_CLASSW
HCURSOR hCursor
Definition: winuser.h:3135
HINSTANCE hInstance
Definition: winuser.h:3133
#define IDC_ARROW
Definition: winuser.h:682
#define EDIT_GLYPH_PREVIEW_CLASSW
static LRESULT CALLBACK EditGlyphPreviewWndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: editglyphdlg.c:230

Referenced by wWinMain().

◆ InitFontBoxesWndClass()

BOOL InitFontBoxesWndClass ( VOID  )

Definition at line 337 of file fontboxeswnd.c.

338 {
339  WNDCLASSW wc = {0,};
340 
342  wc.hInstance = hInstance;
343  wc.hCursor = LoadCursor( NULL, IDC_ARROW );
344  wc.hbrBackground = (HBRUSH)( COLOR_BTNFACE + 1 );
346  wc.style = CS_DBLCLKS;
347 
348  return RegisterClassW(&wc) != 0;
349 }
UINT style
Definition: winuser.h:3129
ATOM WINAPI RegisterClassW(_In_ CONST WNDCLASSW *)
HINSTANCE hInstance
Definition: charmap.c:20
WNDPROC lpfnWndProc
Definition: winuser.h:3130
smooth NULL
Definition: ftsmooth.c:416
LPCWSTR lpszClassName
Definition: winuser.h:3138
#define COLOR_BTNFACE
Definition: winuser.h:918
#define CS_DBLCLKS
Definition: winuser.h:646
#define LoadCursor
Definition: winuser.h:5678
static LRESULT CALLBACK FontBoxesWndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: fontboxeswnd.c:248
HCURSOR hCursor
Definition: winuser.h:3135
HBRUSH hbrBackground
Definition: winuser.h:3136
static const WCHAR szFontBoxesWndClass[]
Definition: fontboxeswnd.c:10
HINSTANCE hInstance
Definition: winuser.h:3133
#define IDC_ARROW
Definition: winuser.h:682

Referenced by wWinMain().

◆ InitFontWndClass()

BOOL InitFontWndClass ( VOID  )

Definition at line 421 of file fontwnd.c.

422 {
423  WNDCLASSW wc = {0,};
424 
426  wc.hInstance = hInstance;
427  wc.hCursor = LoadCursor( NULL, IDC_ARROW );
429  wc.hbrBackground = (HBRUSH)( COLOR_BTNFACE + 1 );
431 
432  return RegisterClassW(&wc) != 0;
433 }
#define IDI_DOC
Definition: resource.h:15
ATOM WINAPI RegisterClassW(_In_ CONST WNDCLASSW *)
HINSTANCE hInstance
Definition: charmap.c:20
WNDPROC lpfnWndProc
Definition: winuser.h:3130
smooth NULL
Definition: ftsmooth.c:416
LPCWSTR lpszClassName
Definition: winuser.h:3138
static const WCHAR szFontWndClass[]
Definition: fontwnd.c:10
HICON hIcon
Definition: winuser.h:3134
#define COLOR_BTNFACE
Definition: winuser.h:918
#define LoadCursor
Definition: winuser.h:5678
HCURSOR hCursor
Definition: winuser.h:3135
HBRUSH hbrBackground
Definition: winuser.h:3136
HINSTANCE hInstance
Definition: winuser.h:3133
#define IDC_ARROW
Definition: winuser.h:682
static LRESULT CALLBACK FontWndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: fontwnd.c:97
HICON WINAPI LoadIconW(_In_opt_ HINSTANCE, _In_ LPCWSTR)
Definition: cursoricon.c:2044
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582

Referenced by wWinMain().

◆ InitMainWndClass()

BOOL InitMainWndClass ( VOID  )

Definition at line 641 of file mainwnd.c.

642 {
643  WNDCLASSW wc = {0,};
644 
646  wc.hInstance = hInstance;
647  wc.hCursor = LoadCursor( NULL, IDC_ARROW );
649  wc.hbrBackground = (HBRUSH)( COLOR_BTNFACE + 1 );
651 
652  return RegisterClassW(&wc) != 0;
653 }
static const WCHAR szMainWndClass[]
Definition: mainwnd.c:11
ATOM WINAPI RegisterClassW(_In_ CONST WNDCLASSW *)
WNDPROC lpfnWndProc
Definition: winuser.h:3130
smooth NULL
Definition: ftsmooth.c:416
LPCWSTR lpszClassName
Definition: winuser.h:3138
HICON hIcon
Definition: winuser.h:3134
#define IDI_MAIN
Definition: resource.h:4
#define COLOR_BTNFACE
Definition: winuser.h:918
#define LoadCursor
Definition: winuser.h:5678
HCURSOR hCursor
Definition: winuser.h:3135
HINSTANCE hInstance
Definition: mainwnd.c:15
HBRUSH hbrBackground
Definition: winuser.h:3136
HINSTANCE hInstance
Definition: winuser.h:3133
#define IDC_ARROW
Definition: winuser.h:682
HICON WINAPI LoadIconW(_In_opt_ HINSTANCE, _In_ LPCWSTR)
Definition: cursoricon.c:2044
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582
static LRESULT CALLBACK MainWndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: mainwnd.c:503

Referenced by wWinMain().

◆ LoadAndFormatString()

DWORD LoadAndFormatString ( IN UINT  uID,
OUT PWSTR lpTarget,
  ... 
)

Definition at line 90 of file misc.c.

91 {
92  DWORD Ret;
93  va_list Args;
94 
95  va_start(Args, lpTarget);
96  Ret = VarListLoadAndFormatString(uID, lpTarget, &Args);
97  va_end(Args);
98 
99  return Ret;
100 }
#define va_end(ap)
Definition: acmsvcex.h:90
char * va_list
Definition: acmsvcex.h:78
char ** Args
Definition: acdebug.h:343
unsigned long DWORD
Definition: ntddk_ex.h:95
static DWORD VarListLoadAndFormatString(IN UINT uID, OUT PWSTR *lpTarget, IN va_list *Args)
Definition: misc.c:66
#define va_start(ap, A)
Definition: acmsvcex.h:91

◆ LocalizedError()

VOID LocalizedError ( IN UINT  uID,
  ... 
)

Definition at line 103 of file misc.c.

104 {
105  PWSTR pszError;
106  va_list Args;
107 
108  va_start(Args, uID);
109  VarListLoadAndFormatString(uID, &pszError, &Args);
110  va_end(Args);
111 
112  MessageBoxW(NULL, pszError, szAppName, MB_ICONERROR);
113  HeapFree(hProcessHeap, 0, pszError);
114 }
uint16_t * PWSTR
Definition: typedefs.h:54
#define va_end(ap)
Definition: acmsvcex.h:90
smooth NULL
Definition: ftsmooth.c:416
char * va_list
Definition: acmsvcex.h:78
char ** Args
Definition: acdebug.h:343
int WINAPI MessageBoxW(_In_opt_ HWND, _In_opt_ LPCWSTR, _In_opt_ LPCWSTR, _In_ UINT)
#define MB_ICONERROR
Definition: winuser.h:781
TCHAR szAppName[128]
Definition: solitaire.cpp:16
static DWORD VarListLoadAndFormatString(IN UINT uID, OUT PWSTR *lpTarget, IN va_list *Args)
Definition: misc.c:66
#define va_start(ap, A)
Definition: acmsvcex.h:91
#define HeapFree(x, y, z)
Definition: compat.h:394
HANDLE hProcessHeap
Definition: kbswitch.c:25

Referenced by DoFileSave(), and InitFont().

◆ SetPasteButtonState()

VOID SetPasteButtonState ( IN PMAIN_WND_INFO  Info)

Definition at line 389 of file mainwnd.c.

390 {
394 }
BOOL WINAPI IsClipboardFormatAvailable(_In_ UINT)
struct TraceInfo Info
static VOID SetToolbarButtonState(IN PMAIN_WND_INFO Info, INT idCommand, BOOL bEnabled)
Definition: mainwnd.c:80
#define ID_EDIT_PASTE
Definition: resource.h:50
UINT uCharacterClipboardFormat
Definition: main.c:15

Referenced by FontWndProc(), InitMainWnd(), and MainWndProc().

◆ SetToolbarFileButtonState()

VOID SetToolbarFileButtonState ( IN PMAIN_WND_INFO  Info,
BOOL  bEnabled 
)

Definition at line 92 of file mainwnd.c.

93 {
97 }
#define ID_EDIT_GLYPH
Definition: resource.h:44
#define ID_EDIT_COPY
Definition: resource.h:49
struct TraceInfo Info
static VOID SetToolbarButtonState(IN PMAIN_WND_INFO Info, INT idCommand, BOOL bEnabled)
Definition: mainwnd.c:80
#define ID_FILE_SAVE
Definition: resource.h:43

Referenced by FontWndProc(), and InitMainWnd().

◆ UnInitEditGlyphWndClasses()

VOID UnInitEditGlyphWndClasses ( VOID  )

Definition at line 302 of file editglyphdlg.c.

303 {
306 }
BOOL WINAPI UnregisterClassW(_In_ LPCWSTR, HINSTANCE)
HINSTANCE hInstance
Definition: charmap.c:20
#define EDIT_GLYPH_EDIT_CLASSW
#define EDIT_GLYPH_PREVIEW_CLASSW

Referenced by wWinMain().

◆ UnInitFontBoxesWndClass()

VOID UnInitFontBoxesWndClass ( VOID  )

Definition at line 352 of file fontboxeswnd.c.

353 {
355 }
BOOL WINAPI UnregisterClassW(_In_ LPCWSTR, HINSTANCE)
HINSTANCE hInstance
Definition: charmap.c:20
static const WCHAR szFontBoxesWndClass[]
Definition: fontboxeswnd.c:10

Referenced by wWinMain().

◆ UnInitFontWndClass()

VOID UnInitFontWndClass ( VOID  )

Definition at line 436 of file fontwnd.c.

437 {
439 }
BOOL WINAPI UnregisterClassW(_In_ LPCWSTR, HINSTANCE)
HINSTANCE hInstance
Definition: charmap.c:20
static const WCHAR szFontWndClass[]
Definition: fontwnd.c:10

Referenced by wWinMain().

◆ UnInitMainWndClass()

VOID UnInitMainWndClass ( VOID  )

Definition at line 656 of file mainwnd.c.

657 {
659 }
BOOL WINAPI UnregisterClassW(_In_ LPCWSTR, HINSTANCE)
static const WCHAR szMainWndClass[]
Definition: mainwnd.c:11
HINSTANCE hInstance
Definition: mainwnd.c:15

Referenced by wWinMain().

Variable Documentation

◆ hInstance

HINSTANCE hInstance

Definition at line 20 of file charmap.c.

◆ hProcessHeap

HANDLE hProcessHeap

Definition at line 25 of file kbswitch.c.

◆ szAppName

PWSTR szAppName

Definition at line 16 of file solitaire.cpp.

◆ uCharacterClipboardFormat

UINT uCharacterClipboardFormat