ReactOS 0.4.16-dev-297-gc569aee
fontboxeswnd.c File Reference
#include "precomp.h"
Include dependency graph for fontboxeswnd.c:

Go to the source code of this file.

Functions

static VOID DrawCharacterPixel (IN PAINTSTRUCT *ps, IN UINT uCharacter, IN UCHAR uRow, IN UCHAR uColumn, IN UCHAR uBit, IN COLORREF clBackground)
 
VOID GetCharacterRect (IN UINT uFontRow, IN UINT uFontColumn, OUT LPRECT CharacterRect)
 
static INT FontBoxesHitTest (IN UINT xPos, IN UINT yPos, OUT LPRECT CharacterRect)
 
static VOID SetSelectedCharacter (IN PFONT_WND_INFO Info, IN UINT uNewCharacter, OPTIONAL IN LPRECT NewCharacterRect)
 
static VOID DrawProc (IN PFONT_WND_INFO Info, IN PAINTSTRUCT *ps)
 
VOID EditCurrentGlyph (PFONT_WND_INFO FontWndInfo)
 
VOID CreateFontBoxesWindow (IN PFONT_WND_INFO FontWndInfo)
 
static LRESULT CALLBACK FontBoxesWndProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
 
BOOL InitFontBoxesWndClass (VOID)
 
VOID UnInitFontBoxesWndClass (VOID)
 

Variables

static const WCHAR szFontBoxesWndClass [] = L"VGAFontEditFontBoxesWndClass"
 

Function Documentation

◆ CreateFontBoxesWindow()

VOID CreateFontBoxesWindow ( IN PFONT_WND_INFO  FontWndInfo)

Definition at line 224 of file fontboxeswnd.c.

225{
226 FontWndInfo->hFontBoxesWnd = CreateWindowExW(0,
228 0,
230 0,
231 0,
232 0,
233 0,
234 FontWndInfo->hSelf,
235 NULL,
236 hInstance,
237 FontWndInfo);
238}
HINSTANCE hInstance
Definition: charmap.c:19
#define NULL
Definition: types.h:112
static const WCHAR szFontBoxesWndClass[]
Definition: fontboxeswnd.c:10
#define WS_CHILD
Definition: pedump.c:617
#define WS_VISIBLE
Definition: pedump.c:620
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)

Referenced by FontWndProc().

◆ DrawCharacterPixel()

static VOID DrawCharacterPixel ( IN PAINTSTRUCT ps,
IN UINT  uCharacter,
IN UCHAR  uRow,
IN UCHAR  uColumn,
IN UCHAR  uBit,
IN COLORREF  clBackground 
)
static

Definition at line 13 of file fontboxeswnd.c.

14{
15 INT x;
16 INT y;
17
18 x = (uCharacter % 16) * (CHARACTER_BOX_WIDTH + CHARACTER_BOX_PADDING) + 24 + uColumn;
19 y = (uCharacter / 16) * (CHARACTER_BOX_HEIGHT + CHARACTER_BOX_PADDING)+ 1 + CHARACTER_INFO_BOX_HEIGHT + 2 + uRow;
20
21 SetPixel( ps->hdc, x, y, (uBit ? 0 : clBackground) );
22}
FORCEINLINE VOID SetPixel(_In_ ULONG Left, _In_ ULONG Top, _In_ UCHAR Color)
Definition: arm.h:55
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548
#define CHARACTER_BOX_PADDING
Definition: precomp.h:105
#define CHARACTER_BOX_WIDTH
Definition: precomp.h:103
#define CHARACTER_INFO_BOX_HEIGHT
Definition: precomp.h:101
#define CHARACTER_BOX_HEIGHT
Definition: precomp.h:104
int32_t INT
Definition: typedefs.h:58

Referenced by DrawProc().

◆ DrawProc()

static VOID DrawProc ( IN PFONT_WND_INFO  Info,
IN PAINTSTRUCT ps 
)
static

Definition at line 83 of file fontboxeswnd.c.

84{
85 COLORREF clBackground;
86 HBRUSH hBrush = 0;
87 HBRUSH hOldBrush = 0;
88 HDC hBoxDC;
90 HFONT hOldFont;
91 RECT CharacterRect;
92 UINT uFontColumn;
93 UINT uStartColumn;
94 UINT uEndColumn;
95 UINT uFontRow;
96 UINT uStartRow;
97 UINT uEndRow;
98 UINT uCharacter;
99 UCHAR uCharacterColumn;
100 UCHAR uCharacterRow;
101 UCHAR uBit;
102 WCHAR szInfoText[9];
103 HBITMAP hBitmapOld;
104
105 // Preparations
106 hBoxDC = CreateCompatibleDC(NULL);
107 hBitmapOld = SelectObject(hBoxDC, Info->MainWndInfo->hBoxBmp);
108
109 hFont = CreateFontW(13, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, L"Tahoma");
110 hOldFont = SelectObject(ps->hdc, hFont);
111
112 SetBkMode( ps->hdc, TRANSPARENT );
113
114 // What ranges do we have to draw?
115 uStartRow = ps->rcPaint.top / (CHARACTER_BOX_HEIGHT + CHARACTER_BOX_PADDING);
116 uEndRow = ps->rcPaint.bottom / (CHARACTER_BOX_HEIGHT + CHARACTER_BOX_PADDING);
117 uStartColumn = ps->rcPaint.left / (CHARACTER_BOX_WIDTH + CHARACTER_BOX_PADDING);
118 uEndColumn = ps->rcPaint.right / (CHARACTER_BOX_WIDTH + CHARACTER_BOX_PADDING);
119
120 for(uFontRow = uStartRow; uFontRow <= uEndRow; uFontRow++)
121 {
122 for(uFontColumn = uStartColumn; uFontColumn <= uEndColumn; uFontColumn++)
123 {
124 GetCharacterRect(uFontRow, uFontColumn, &CharacterRect);
125 uCharacter = uFontRow * 16 + uFontColumn;
126
127 // Draw the Character Info Box (header)
128 BitBlt(ps->hdc,
129 CharacterRect.left,
130 CharacterRect.top,
133 hBoxDC,
134 0,
135 0,
136 SRCCOPY);
137
138 // Draw the header text
139 wsprintfW(szInfoText, L"%02u = %02X", uCharacter, uCharacter);
140 DrawTextW( ps->hdc, szInfoText, -1, &CharacterRect, DT_CENTER );
141
142 // Draw the Character Bitmap Box (rectangle with the actual character)
143 if(Info->uSelectedCharacter == uCharacter)
144 {
145 clBackground = RGB(255, 255, 0);
146 hBrush = CreateSolidBrush(clBackground);
147 hOldBrush = SelectObject(ps->hdc, hBrush);
148 }
149 else
150 {
151 clBackground = RGB(255, 255, 255);
153 }
154
155 Rectangle(ps->hdc,
156 CharacterRect.left,
157 CharacterRect.top + CHARACTER_INFO_BOX_HEIGHT,
158 CharacterRect.right,
159 CharacterRect.bottom);
160
161 // Draw the actual character into the box
162 for(uCharacterRow = 0; uCharacterRow < 8; uCharacterRow++)
163 {
164 for(uCharacterColumn = 0; uCharacterColumn < 8; uCharacterColumn++)
165 {
166 uBit = Info->Font->Bits[uCharacter * 8 + uCharacterRow] << uCharacterColumn & 0x80;
167 DrawCharacterPixel(ps, uCharacter, uCharacterRow, uCharacterColumn, uBit, clBackground);
168 }
169 }
170 }
171 }
172
173 SelectObject(hBoxDC, hBitmapOld);
174 SelectObject(ps->hdc, hOldFont);
176 SelectObject(ps->hdc, hOldBrush);
177 DeleteObject(hBrush);
178 DeleteDC(hBoxDC);
179}
HFONT hFont
Definition: main.c:53
static VOID BitBlt(_In_ ULONG Left, _In_ ULONG Top, _In_ ULONG Width, _In_ ULONG Height, _In_reads_bytes_(Delta *Height) PUCHAR Buffer, _In_ ULONG BitsPerPixel, _In_ ULONG Delta)
Definition: common.c:57
#define RGB(r, g, b)
Definition: precomp.h:71
VOID GetCharacterRect(IN UINT uFontRow, IN UINT uFontColumn, OUT LPRECT CharacterRect)
Definition: fontboxeswnd.c:25
static VOID DrawCharacterPixel(IN PAINTSTRUCT *ps, IN UINT uCharacter, IN UCHAR uRow, IN UCHAR uColumn, IN UCHAR uBit, IN COLORREF clBackground)
Definition: fontboxeswnd.c:13
pKey DeleteObject()
static HBITMAP
Definition: button.c:44
static HDC
Definition: imagelist.c:88
static DWORD *static HFONT(WINAPI *pCreateFontIndirectExA)(const ENUMLOGFONTEXDVA *)
unsigned int UINT
Definition: ndis.h:50
INT WINAPI DrawTextW(HDC hdc, LPCWSTR str, INT count, LPRECT rect, UINT flags)
Definition: defwnd.c:16
#define L(x)
Definition: ntvdm.h:50
LONG right
Definition: windef.h:308
LONG bottom
Definition: windef.h:309
LONG top
Definition: windef.h:307
LONG left
Definition: windef.h:306
_Must_inspect_result_ _In_ WDFCHILDLIST _In_ PWDF_CHILD_LIST_ITERATOR _Out_ WDFDEVICE _Inout_opt_ PWDF_CHILD_RETRIEVE_INFO Info
Definition: wdfchildlist.h:690
DWORD COLORREF
Definition: windef.h:300
HGDIOBJ WINAPI GetStockObject(_In_ int)
HGDIOBJ WINAPI SelectObject(_In_ HDC, _In_ HGDIOBJ)
Definition: dc.c:1546
HDC WINAPI CreateCompatibleDC(_In_opt_ HDC hdc)
#define TRANSPARENT
Definition: wingdi.h:950
#define SRCCOPY
Definition: wingdi.h:333
#define WHITE_BRUSH
Definition: wingdi.h:902
HFONT WINAPI CreateFontW(_In_ int, _In_ int, _In_ int, _In_ int, _In_ int, _In_ DWORD, _In_ DWORD, _In_ DWORD, _In_ DWORD, _In_ DWORD, _In_ DWORD, _In_ DWORD, _In_ DWORD, _In_opt_ LPCWSTR)
BOOL WINAPI Rectangle(_In_ HDC, _In_ int, _In_ int, _In_ int, _In_ int)
int WINAPI SetBkMode(_In_ HDC, _In_ int)
Definition: dc.c:1056
HBRUSH WINAPI CreateSolidBrush(_In_ COLORREF)
BOOL WINAPI DeleteDC(_In_ HDC)
#define DT_CENTER
Definition: winuser.h:527
int WINAPIV wsprintfW(_Out_ LPWSTR, _In_ _Printf_format_string_ LPCWSTR,...)
unsigned char UCHAR
Definition: xmlstorage.h:181
__wchar_t WCHAR
Definition: xmlstorage.h:180

Referenced by FontBoxesWndProc().

◆ EditCurrentGlyph()

VOID EditCurrentGlyph ( PFONT_WND_INFO  FontWndInfo)

Definition at line 182 of file fontboxeswnd.c.

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

Referenced by FontBoxesWndProc(), and MenuCommand().

◆ FontBoxesHitTest()

static INT FontBoxesHitTest ( IN UINT  xPos,
IN UINT  yPos,
OUT LPRECT  CharacterRect 
)
static

Definition at line 34 of file fontboxeswnd.c.

35{
36 UINT uFontColumn;
37 UINT uFontRow;
38
39 uFontColumn = xPos / (CHARACTER_BOX_WIDTH + CHARACTER_BOX_PADDING);
40 uFontRow = yPos / (CHARACTER_BOX_HEIGHT + CHARACTER_BOX_PADDING);
41 GetCharacterRect(uFontRow, uFontColumn, CharacterRect);
42
43 if(xPos > (UINT)CharacterRect->right || yPos > (UINT)CharacterRect->bottom)
44 // The user clicked on separator space, so return HITTEST_SEPARATOR
45 return HITTEST_SEPARATOR;
46 else
47 // Return the character number
48 return (uFontRow * 16 + uFontColumn);
49}
#define HITTEST_SEPARATOR
Definition: precomp.h:112

Referenced by FontBoxesWndProc().

◆ FontBoxesWndProc()

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

Definition at line 241 of file fontboxeswnd.c.

242{
244
246
247 if(Info || uMsg == WM_CREATE)
248 {
249 switch(uMsg)
250 {
251 case WM_CREATE:
252 Info = (PFONT_WND_INFO)( ( (LPCREATESTRUCT)lParam )->lpCreateParams );
254
255 // Set a fixed window size
257
258 return 0;
259
260 case WM_DESTROY:
262 return 0;
263
264 case WM_KEYDOWN:
265 switch(wParam)
266 {
267 case VK_DOWN:
268 if(Info->uSelectedCharacter < 239)
269 SetSelectedCharacter(Info, Info->uSelectedCharacter + 16, NULL);
270 return 0;
271
272 case VK_LEFT:
273 if(Info->uSelectedCharacter)
274 SetSelectedCharacter(Info, Info->uSelectedCharacter - 1, NULL);
275 return 0;
276
277 case VK_RETURN:
279 return 0;
280
281 case VK_RIGHT:
282 if(Info->uSelectedCharacter < 255)
283 SetSelectedCharacter(Info, Info->uSelectedCharacter + 1, NULL);
284 return 0;
285
286 case VK_UP:
287 if(Info->uSelectedCharacter > 15)
288 SetSelectedCharacter(Info, Info->uSelectedCharacter - 16, NULL);
289 return 0;
290 }
291
292 break;
293
294 case WM_LBUTTONDBLCLK:
295 {
297 return 0;
298 }
299
300 case WM_LBUTTONDOWN:
301 {
302 RECT CharacterRect;
303 INT iRet;
304
305 iRet = FontBoxesHitTest( GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam), &CharacterRect );
306
307 if(iRet >= 0)
308 SetSelectedCharacter( Info, (UINT)iRet, &CharacterRect );
309
310 return 0;
311 }
312
313 case WM_PAINT:
314 {
315 PAINTSTRUCT ps;
316
317 BeginPaint(hwnd, &ps);
318 DrawProc(Info, &ps);
319 EndPaint(hwnd, &ps);
320
321 return 0;
322 }
323 }
324 }
325
326 return DefWindowProcW(hwnd, uMsg, wParam, lParam);
327}
WPARAM wParam
Definition: combotst.c:138
LPARAM lParam
Definition: combotst.c:139
static VOID SetSelectedCharacter(IN PFONT_WND_INFO Info, IN UINT uNewCharacter, OPTIONAL IN LPRECT NewCharacterRect)
Definition: fontboxeswnd.c:52
VOID EditCurrentGlyph(PFONT_WND_INFO FontWndInfo)
Definition: fontboxeswnd.c:182
static INT FontBoxesHitTest(IN UINT xPos, IN UINT yPos, OUT LPRECT CharacterRect)
Definition: fontboxeswnd.c:34
static VOID DrawProc(IN PFONT_WND_INFO Info, IN PAINTSTRUCT *ps)
Definition: fontboxeswnd.c:83
#define FONT_BOXES_WND_HEIGHT
Definition: precomp.h:107
struct _FONT_WND_INFO * PFONT_WND_INFO
Definition: precomp.h:36
#define FONT_BOXES_WND_WIDTH
Definition: precomp.h:106
__int3264 LONG_PTR
Definition: mstsclib_h.h:276
#define GWLP_USERDATA
Definition: treelist.c:63
_In_ LONG _In_ HWND hwnd
Definition: winddi.h:4023
#define GET_Y_LPARAM(lp)
Definition: windowsx.h:300
#define GET_X_LPARAM(lp)
Definition: windowsx.h:299
#define WM_PAINT
Definition: winuser.h:1623
#define GetWindowLongPtrW
Definition: winuser.h:4832
LRESULT WINAPI DefWindowProcW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define WM_CREATE
Definition: winuser.h:1611
BOOL WINAPI SetWindowPos(_In_ HWND, _In_opt_ HWND, _In_ int, _In_ int, _In_ int, _In_ int, _In_ UINT)
#define WM_LBUTTONDBLCLK
Definition: winuser.h:1781
#define SWP_NOMOVE
Definition: winuser.h:1247
#define VK_UP
Definition: winuser.h:2228
#define WM_LBUTTONDOWN
Definition: winuser.h:1779
#define VK_RETURN
Definition: winuser.h:2204
BOOL WINAPI EndPaint(_In_ HWND, _In_ const PAINTSTRUCT *)
#define VK_LEFT
Definition: winuser.h:2227
#define VK_RIGHT
Definition: winuser.h:2229
#define VK_DOWN
Definition: winuser.h:2230
#define WM_DESTROY
Definition: winuser.h:1612
#define WM_KEYDOWN
Definition: winuser.h:1718
#define SWP_NOZORDER
Definition: winuser.h:1250
HDC WINAPI BeginPaint(_In_ HWND, _Out_ LPPAINTSTRUCT)
#define SetWindowLongPtrW
Definition: winuser.h:5358

Referenced by InitFontBoxesWndClass().

◆ 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}

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

◆ InitFontBoxesWndClass()

BOOL InitFontBoxesWndClass ( VOID  )

Definition at line 330 of file fontboxeswnd.c.

331{
332 WNDCLASSW wc = {0,};
333
335 wc.hInstance = hInstance;
337 wc.hbrBackground = (HBRUSH)( COLOR_BTNFACE + 1 );
339 wc.style = CS_DBLCLKS;
340
341 return RegisterClassW(&wc) != 0;
342}
static LRESULT CALLBACK FontBoxesWndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: fontboxeswnd.c:241
LPCWSTR lpszClassName
Definition: winuser.h:3188
HBRUSH hbrBackground
Definition: winuser.h:3186
HINSTANCE hInstance
Definition: winuser.h:3183
UINT style
Definition: winuser.h:3179
WNDPROC lpfnWndProc
Definition: winuser.h:3180
HCURSOR hCursor
Definition: winuser.h:3185
ATOM WINAPI RegisterClassW(_In_ CONST WNDCLASSW *)
#define IDC_ARROW
Definition: winuser.h:687
#define CS_DBLCLKS
Definition: winuser.h:651
#define LoadCursor
Definition: winuser.h:5824
#define COLOR_BTNFACE
Definition: winuser.h:931

Referenced by wWinMain().

◆ SetSelectedCharacter()

static VOID SetSelectedCharacter ( IN PFONT_WND_INFO  Info,
IN UINT  uNewCharacter,
OPTIONAL IN LPRECT  NewCharacterRect 
)
static

Definition at line 52 of file fontboxeswnd.c.

53{
54 LPRECT pCharacterRect;
55 RECT OldCharacterRect;
56 UINT uFontColumn;
57 UINT uFontRow;
58
59 // Remove the selection of the old character
60 GetCharacterPosition(Info->uSelectedCharacter, &uFontRow, &uFontColumn);
61 GetCharacterRect(uFontRow, uFontColumn, &OldCharacterRect);
62 InvalidateRect(Info->hFontBoxesWnd, &OldCharacterRect, FALSE);
63
64 // You may pass the RECT of the new character, otherwise we'll allocate memory for one and get it ourselves
65 if(NewCharacterRect)
66 pCharacterRect = NewCharacterRect;
67 else
68 {
69 GetCharacterPosition(uNewCharacter, &uFontRow, &uFontColumn);
70 pCharacterRect = (LPRECT) HeapAlloc( hProcessHeap, 0, sizeof(RECT) );
71 GetCharacterRect(uFontRow, uFontColumn, pCharacterRect);
72 }
73
74 // Select the new character
75 Info->uSelectedCharacter = uNewCharacter;
76 InvalidateRect(Info->hFontBoxesWnd, pCharacterRect, FALSE);
77
78 if(!NewCharacterRect)
79 HeapFree(hProcessHeap, 0, pCharacterRect);
80}
#define FALSE
Definition: types.h:117
#define HeapFree(x, y, z)
Definition: compat.h:735
static __inline VOID GetCharacterPosition(IN UINT uCharacter, OUT PUINT uFontRow, OUT PUINT uFontColumn)
Definition: precomp.h:142
#define LPRECT
Definition: precomp.h:28
BOOL WINAPI InvalidateRect(_In_opt_ HWND, _In_opt_ LPCRECT, _In_ BOOL)

Referenced by FontBoxesWndProc().

◆ UnInitFontBoxesWndClass()

VOID UnInitFontBoxesWndClass ( VOID  )

Definition at line 345 of file fontboxeswnd.c.

346{
348}
BOOL WINAPI UnregisterClassW(_In_ LPCWSTR, HINSTANCE)

Referenced by wWinMain().

Variable Documentation

◆ szFontBoxesWndClass

const WCHAR szFontBoxesWndClass[] = L"VGAFontEditFontBoxesWndClass"
static