ReactOS  0.4.12-dev-43-g63b00d8
map.c
Go to the documentation of this file.
1 /*
2  * PROJECT: ReactOS Character Map
3  * LICENSE: GPL - See COPYING in the top level directory
4  * FILE: base/applications/charmap/map.c
5  * PURPOSE: class implementation for painting glyph region
6  * COPYRIGHT: Copyright 2007 Ged Murphy <gedmurphy@reactos.org>
7  *
8  */
9 
10 #include "precomp.h"
11 
12 #include <stdlib.h>
13 
14 static const WCHAR szMapWndClass[] = L"FontMapWnd";
15 static const WCHAR szLrgCellWndClass[] = L"LrgCellWnd";
16 
17 #define MAX_ROWS (0xFFFF / XCELLS) + 1 - YCELLS
18 
19 
20 static
21 VOID
22 SetGrid(PMAP infoPtr)
23 {
24  INT x, y;
25 
26  for (y = 0; y < YCELLS; y++)
27  for (x = 0; x < XCELLS; x++)
28  {
29  infoPtr->Cells[y][x].CellExt.left = x * infoPtr->CellSize.cx + 1;
30  infoPtr->Cells[y][x].CellExt.top = y * infoPtr->CellSize.cy + 1;
31  infoPtr->Cells[y][x].CellExt.right = (x + 1) * infoPtr->CellSize.cx + 2;
32  infoPtr->Cells[y][x].CellExt.bottom = (y + 1) * infoPtr->CellSize.cy + 2;
33 
34  CopyRect(&infoPtr->Cells[y][x].CellInt,
35  &infoPtr->Cells[y][x].CellExt);
36 
37  InflateRect(&infoPtr->Cells[y][x].CellInt,
38  -1,
39  -1);
40  }
41 }
42 
43 static
44 VOID
46  HDC hdc)
47 {
48  Rectangle(hdc,
49  infoPtr->pActiveCell->CellInt.left,
50  infoPtr->pActiveCell->CellInt.top,
51  infoPtr->pActiveCell->CellInt.right,
52  infoPtr->pActiveCell->CellInt.bottom);
53 
54 }
55 
56 
57 static
58 VOID
59 DrawGrid(PMAP infoPtr,
60  PAINTSTRUCT *ps)
61 {
62  INT x, y;
63  RECT rc;
64  PCELL Cell;
65 
66  for (y = 0; y < YCELLS; y++)
67  for (x = 0; x < XCELLS; x++)
68  {
69  Cell = &infoPtr->Cells[y][x];
70 
71  if (!IntersectRect(&rc,
72  &ps->rcPaint,
73  &Cell->CellExt))
74  {
75  continue;
76  }
77 
78  Rectangle(ps->hdc,
79  Cell->CellExt.left,
80  Cell->CellExt.top,
81  Cell->CellExt.right,
82  Cell->CellExt.bottom);
83 
84  if (infoPtr->pActiveCell == Cell)
85  {
86  DrawActiveCell(infoPtr, ps->hdc);
87  }
88  }
89 }
90 
91 
92 static
93 VOID
94 FillGrid(PMAP infoPtr,
95  PAINTSTRUCT *ps)
96 {
97  HFONT hOldFont;
98  WCHAR ch;
99  INT x, y;
100  RECT rc;
101  PCELL Cell;
102  INT i, added;
103 
104  hOldFont = SelectObject(ps->hdc,
105  infoPtr->hFont);
106 
107  i = XCELLS * infoPtr->iYStart;
108 
109  added = 0;
110 
111  for (y = 0; y < YCELLS; y++)
112  for (x = 0; x < XCELLS; x++)
113  {
114  ch = (WCHAR)infoPtr->ValidGlyphs[i];
115 
116  Cell = &infoPtr->Cells[y][x];
117 
118  if (IntersectRect(&rc,
119  &ps->rcPaint,
120  &Cell->CellExt))
121  {
122  Cell->ch = ch;
123 
124  DrawTextW(ps->hdc,
125  &ch,
126  1,
127  &Cell->CellInt,
129 
130  added++;
131  }
132 
133  i++;
134  ch = (WCHAR)i;
135  }
136  SelectObject(ps->hdc,
137  hOldFont);
138 }
139 
140 
141 static
142 BOOL
144 {
145  RECT rLarge;
146 
147  CopyRect(&rLarge,
148  &infoPtr->pActiveCell->CellExt);
149 
150  MapWindowPoints(infoPtr->hMapWnd,
151  infoPtr->hParent,
152  (VOID*)&rLarge,
153  2);
154 
155  InflateRect(&rLarge,
156  XLARGE - XCELLS,
157  YLARGE - YCELLS);
158 
159  infoPtr->hLrgWnd = CreateWindowExW(0,
161  NULL,
163  rLarge.left,
164  rLarge.top,
165  rLarge.right - rLarge.left,
166  rLarge.bottom - rLarge.top,
167  infoPtr->hParent,
168  NULL,
169  hInstance,
170  infoPtr);
171  if (!infoPtr->hLrgWnd)
172  return FALSE;
173 
174  return TRUE;
175 }
176 
177 
178 static
179 VOID
181 {
182  RECT rLarge;
183 
184  CopyRect(&rLarge,
185  &infoPtr->pActiveCell->CellExt);
186 
187  MapWindowPoints(infoPtr->hMapWnd,
188  infoPtr->hParent,
189  (VOID*)&rLarge,
190  2);
191 
192  InflateRect(&rLarge,
193  XLARGE - XCELLS,
194  YLARGE - YCELLS);
195 
196  MoveWindow(infoPtr->hLrgWnd,
197  rLarge.left,
198  rLarge.top,
199  rLarge.right - rLarge.left,
200  rLarge.bottom - rLarge.top,
201  TRUE);
202 
203  InvalidateRect(infoPtr->hLrgWnd,
204  NULL,
205  TRUE);
206 }
207 
208 
209 static
210 VOID
211 SetFont(PMAP infoPtr,
212  LPWSTR lpFontName)
213 {
214  HDC hdc;
215  WCHAR ch[MAX_GLYPHS];
217  DWORD i, j;
218 
219  /* Destroy Zoom window, since it was created with older font */
220  DestroyWindow(infoPtr->hLrgWnd);
221  infoPtr->hLrgWnd = NULL;
222 
223  if (infoPtr->hFont)
224  DeleteObject(infoPtr->hFont);
225 
226  ZeroMemory(&infoPtr->CurrentFont,
227  sizeof(LOGFONTW));
228 
229  hdc = GetDC(infoPtr->hMapWnd);
230  infoPtr->CurrentFont.lfHeight = GetDeviceCaps(hdc, LOGPIXELSY) / 5;
231 
233  wcsncpy(infoPtr->CurrentFont.lfFaceName,
234  lpFontName,
235  sizeof(infoPtr->CurrentFont.lfFaceName) / sizeof(infoPtr->CurrentFont.lfFaceName[0]));
236 
237  infoPtr->hFont = CreateFontIndirectW(&infoPtr->CurrentFont);
238 
239  InvalidateRect(infoPtr->hMapWnd,
240  NULL,
241  TRUE);
242 
243  infoPtr->pActiveCell = &infoPtr->Cells[0][0];
244 
245  // Get all the valid glyphs in this font
246 
247  SelectObject(hdc, infoPtr->hFont);
248 
249  for (i = 0; i < MAX_GLYPHS; i++)
250  ch[i] = (WCHAR)i;
251 
252  if (GetGlyphIndicesW(hdc,
253  ch,
254  MAX_GLYPHS,
255  out,
257  {
258  j = 0;
259  for (i = 0; i < MAX_GLYPHS; i++)
260  {
261  if (out[i] != 0xffff)
262  {
263  infoPtr->ValidGlyphs[j] = ch[i];
264  j++;
265  }
266  }
267  infoPtr->NumValidGlyphs = j;
268  }
269 
270  ReleaseDC(infoPtr->hMapWnd, hdc);
271 
272  infoPtr->NumRows = infoPtr->NumValidGlyphs / XCELLS;
273  if (infoPtr->NumValidGlyphs % XCELLS)
274  infoPtr->NumRows += 1;
275  infoPtr->NumRows = (infoPtr->NumRows > YCELLS) ? infoPtr->NumRows - YCELLS : 0;
276 
277  SetScrollRange(infoPtr->hMapWnd, SB_VERT, 0, infoPtr->NumRows, FALSE);
278  SetScrollPos(infoPtr->hMapWnd, SB_VERT, 0, TRUE);
279  infoPtr->iYStart = 0;
280 }
281 
282 
283 static
284 LRESULT
286  UINT code,
287  WCHAR ch)
288 {
289  LRESULT Ret = 0;
290 
291  if (infoPtr->hParent != NULL)
292  {
293  DWORD dwIdc = GetWindowLongPtr(infoPtr->hMapWnd, GWLP_ID);
294  /*
295  * Push directly into the event queue instead of waiting
296  * the parent to be unlocked.
297  * High word of LPARAM is still available for future needs...
298  */
299  Ret = PostMessage(infoPtr->hParent,
300  WM_COMMAND,
301  MAKELPARAM((WORD)dwIdc, (WORD)code),
302  (LPARAM)LOWORD(ch));
303  }
304 
305  return Ret;
306 }
307 
308 
309 static
310 VOID
311 OnClick(PMAP infoPtr,
312  WORD ptx,
313  WORD pty)
314 {
315  POINT pt;
316  INT x, y;
317 
318  pt.x = ptx;
319  pt.y = pty;
320 
321  for (x = 0; x < XCELLS; x++)
322  for (y = 0; y < YCELLS; y++)
323  {
324  if (PtInRect(&infoPtr->Cells[y][x].CellInt,
325  pt))
326  {
327  /* if the cell is not already active */
328  if (!infoPtr->Cells[y][x].bActive)
329  {
330  /* set previous active cell to inactive */
331  if (infoPtr->pActiveCell)
332  {
333  /* invalidate normal cells, required when
334  * moving a small active cell via keyboard */
335  if (!infoPtr->pActiveCell->bLarge)
336  {
337  InvalidateRect(infoPtr->hMapWnd,
338  &infoPtr->pActiveCell->CellInt,
339  TRUE);
340  }
341 
342  infoPtr->pActiveCell->bActive = FALSE;
343  infoPtr->pActiveCell->bLarge = FALSE;
344  }
345 
346  /* set new cell to active */
347  infoPtr->pActiveCell = &infoPtr->Cells[y][x];
348  infoPtr->pActiveCell->bActive = TRUE;
349  infoPtr->pActiveCell->bLarge = TRUE;
350  if (infoPtr->hLrgWnd)
351  MoveLargeCell(infoPtr);
352  else
353  CreateLargeCell(infoPtr);
354  }
355  else
356  {
357  /* flick between large and small */
358  if (infoPtr->pActiveCell->bLarge)
359  {
360  DestroyWindow(infoPtr->hLrgWnd);
361  infoPtr->hLrgWnd = NULL;
362  }
363  else
364  {
365  CreateLargeCell(infoPtr);
366  }
367 
368  infoPtr->pActiveCell->bLarge = (infoPtr->pActiveCell->bLarge) ? FALSE : TRUE;
369  }
370 
371  break;
372  }
373  }
374 }
375 
376 
377 static
378 BOOL
380  HWND hwnd,
381  HWND hParent)
382 {
383  RECT rc;
384  BOOL Ret = FALSE;
385 
386  infoPtr = HeapAlloc(GetProcessHeap(),
387  0,
388  sizeof(MAP));
389  if (infoPtr)
390  {
391  SetLastError(0);
392  SetWindowLongPtrW(hwnd,
393  0,
394  (DWORD_PTR)infoPtr);
395  if (GetLastError() == 0)
396  {
397  ZeroMemory(infoPtr,
398  sizeof(MAP));
399 
400  infoPtr->hMapWnd = hwnd;
401  infoPtr->hParent = hParent;
402 
403  GetClientRect(hwnd, &rc);
404  infoPtr->ClientSize.cx = rc.right;
405  infoPtr->ClientSize.cy = rc.bottom;
406  infoPtr->CellSize.cx = infoPtr->ClientSize.cx / XCELLS;
407  infoPtr->CellSize.cy = infoPtr->ClientSize.cy / YCELLS;
408 
409  infoPtr->pActiveCell = NULL;
410 
411  SetGrid(infoPtr);
412 
413  SetScrollPos(infoPtr->hParent, SB_VERT, 0, TRUE);
414 
415  Ret = TRUE;
416  }
417  }
418 
419  return Ret;
420 }
421 
422 
423 static
424 VOID
425 OnVScroll(PMAP infoPtr,
426  INT Value,
427  INT Pos)
428 {
429  INT iYDiff, iOldYStart = infoPtr->iYStart;
430 
431  switch (Value)
432  {
433  case SB_LINEUP:
434  infoPtr->iYStart -= 1;
435  break;
436 
437  case SB_LINEDOWN:
438  infoPtr->iYStart += 1;
439  break;
440 
441  case SB_PAGEUP:
442  infoPtr->iYStart -= YCELLS;
443  break;
444 
445  case SB_PAGEDOWN:
446  infoPtr->iYStart += YCELLS;
447  break;
448 
449  case SB_THUMBTRACK:
450  infoPtr->iYStart = Pos;
451  break;
452 
453  default:
454  break;
455  }
456 
457  infoPtr->iYStart = max(0, infoPtr->iYStart);
458  infoPtr->iYStart = min(infoPtr->iYStart, infoPtr->NumRows);
459 
460  iYDiff = iOldYStart - infoPtr->iYStart;
461  if (iYDiff)
462  {
463  if (infoPtr->hLrgWnd != NULL)
464  {
465  ShowWindow(infoPtr->hLrgWnd, SW_HIDE);
466  }
467 
468  SetScrollPos(infoPtr->hMapWnd,
469  SB_VERT,
470  infoPtr->iYStart,
471  TRUE);
472 
473  if (abs(iYDiff) < YCELLS)
474  {
475  RECT rect;
476  GetClientRect(infoPtr->hMapWnd, &rect);
477  rect.top += 2;
478  rect.bottom -= 2;
479  ScrollWindowEx(infoPtr->hMapWnd,
480  0,
481  iYDiff * infoPtr->CellSize.cy,
482  &rect,
483  &rect,
484  NULL,
485  NULL,
486  SW_INVALIDATE);
487  }
488  else
489  {
490  InvalidateRect(infoPtr->hMapWnd,
491  NULL,
492  TRUE);
493  }
494 
495  if (infoPtr->hLrgWnd != NULL)
496  {
497  ShowWindow(infoPtr->hLrgWnd, SW_SHOW);
498  }
499  }
500 }
501 
502 
503 static
504 VOID
505 OnPaint(PMAP infoPtr,
506  WPARAM wParam)
507 {
508  PAINTSTRUCT ps;
509  HDC hdc;
510 
511 
512  if (wParam != 0)
513  {
514  if (!GetUpdateRect(infoPtr->hMapWnd,
515  &ps.rcPaint,
516  TRUE))
517  {
518  return;
519  }
520  ps.hdc = (HDC)wParam;
521  }
522  else
523  {
524  hdc = BeginPaint(infoPtr->hMapWnd,
525  &ps);
526  if (hdc == NULL)
527  {
528  return;
529  }
530  }
531 
532  DrawGrid(infoPtr, &ps);
533 
534  FillGrid(infoPtr, &ps);
535 
536  if (wParam == 0)
537  {
538  EndPaint(infoPtr->hMapWnd,
539  &ps);
540  }
541 }
542 
543 
544 LRESULT
545 CALLBACK
547  UINT uMsg,
548  WPARAM wParam,
549  LPARAM lParam)
550 {
551  PMAP infoPtr;
552  LRESULT Ret = 0;
553 
554  infoPtr = (PMAP)GetWindowLongPtrW(hwnd,
555  0);
556 
557  switch (uMsg)
558  {
559  case WM_CREATE:
560  {
561  if (!MapOnCreate(infoPtr,
562  hwnd,
563  ((LPCREATESTRUCTW)lParam)->hwndParent))
564  {
565  return (LRESULT)-1;
566  }
567 
568  break;
569  }
570 
571  case WM_LBUTTONDOWN:
572  {
573  OnClick(infoPtr,
574  LOWORD(lParam),
575  HIWORD(lParam));
576 
577  break;
578  }
579 
580  case WM_LBUTTONDBLCLK:
581  {
582  NotifyParentOfSelection(infoPtr,
583  FM_SETCHAR,
584  infoPtr->pActiveCell->ch);
585 
586 
587  break;
588  }
589 
590  case WM_VSCROLL:
591  {
592  OnVScroll(infoPtr,
593  LOWORD(wParam),
594  HIWORD(wParam));
595 
596  break;
597  }
598 
599  case FM_SETFONT:
600  SetFont(infoPtr, (LPWSTR)lParam);
601  break;
602 
603  case FM_GETCHAR:
604  {
605  if (!infoPtr->pActiveCell) return 0;
606  return infoPtr->pActiveCell->ch;
607  }
608 
609  case FM_GETHFONT:
610  return (LRESULT)infoPtr->hFont;
611 
612  case WM_PAINT:
613  {
614  OnPaint(infoPtr,
615  wParam);
616  break;
617  }
618 
619  case WM_DESTROY:
620  {
621  DeleteObject(infoPtr->hFont);
623  0,
624  infoPtr);
625  SetWindowLongPtrW(hwnd,
626  0,
627  (DWORD_PTR)NULL);
628  break;
629  }
630 
631  default:
632  {
633  Ret = DefWindowProcW(hwnd,
634  uMsg,
635  wParam,
636  lParam);
637  break;
638  }
639  }
640 
641  return Ret;
642 }
643 
644 
645 BOOL
647 {
648  WNDCLASSW wc = {0};
649 
650  wc.style = CS_DBLCLKS;
651  wc.lpfnWndProc = MapWndProc;
652  wc.cbWndExtra = sizeof(PMAP);
653  wc.hInstance = hInstance;
654  wc.hCursor = LoadCursorW(NULL,
655  (LPWSTR)IDC_ARROW);
656  wc.hbrBackground = (HBRUSH)(COLOR_WINDOW + 1);
658 
659  if (RegisterClassW(&wc))
660  {
662  wc.cbWndExtra = 0;
664 
665  return RegisterClassW(&wc) != 0;
666  }
667 
668  return FALSE;
669 }
670 
671 VOID
673 {
675  hInstance);
676 
678  hInstance);
679 }
_In_opt_ ULONG _Out_ PULONG Value
Definition: rtlfuncs.h:2327
#define HDC
Definition: msvc.h:22
#define abs(i)
Definition: fconv.c:206
LOGFONTW CurrentFont
Definition: precomp.h:48
HWND hParent
Definition: precomp.h:41
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
#define SB_PAGEDOWN
Definition: winuser.h:569
#define SB_PAGEUP
Definition: winuser.h:568
#define max(a, b)
Definition: svc.c:63
static VOID OnClick(PMAP infoPtr, WORD ptx, WORD pty)
Definition: map.c:311
BOOL WINAPI InflateRect(_Inout_ LPRECT, _In_ int, _In_ int)
GLenum GLclampf GLint GLenum GLuint GLenum GLenum GLsizei GLenum const GLvoid GLfloat GLfloat GLfloat GLfloat GLclampd GLint GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean GLboolean GLboolean GLboolean GLint GLenum GLsizei const GLvoid GLenum GLint GLenum GLint GLint GLsizei GLint GLenum GLint GLint GLint GLint GLsizei GLenum GLsizei const GLuint GLboolean GLenum GLenum GLint GLsizei GLenum GLsizei GLenum const GLvoid GLboolean const GLboolean GLenum const GLdouble const GLfloat const GLdouble const GLfloat GLenum GLint GLint GLint GLint GLint GLint j
Definition: glfuncs.h:98
#define TRUE
Definition: types.h:120
long y
Definition: polytest.cpp:48
UINT style
Definition: winuser.h:3129
int WINAPI MapWindowPoints(_In_opt_ HWND hWndFrom, _In_opt_ HWND hWndTo, _Inout_updates_(cPoints) LPPOINT lpPoints, _In_ UINT cPoints)
HFONT hFont
Definition: precomp.h:47
#define WM_LBUTTONDOWN
Definition: winuser.h:1752
BOOL WINAPI UnregisterClassW(_In_ LPCWSTR, HINSTANCE)
long x
Definition: polytest.cpp:48
HDC WINAPI GetDC(_In_opt_ HWND)
BOOL WINAPI Rectangle(_In_ HDC, _In_ int, _In_ int, _In_ int, _In_ int)
#define SB_VERT
Definition: winuser.h:553
LRESULT CALLBACK MapWndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: map.c:546
#define pt(x, y)
Definition: drawing.c:79
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define SW_HIDE
Definition: winuser.h:762
#define XLARGE
Definition: precomp.h:19
struct _MAP * PMAP
static BOOL MapOnCreate(PMAP infoPtr, HWND hwnd, HWND hParent)
Definition: map.c:379
#define MAKELPARAM(l, h)
Definition: winuser.h:3915
LONG lfHeight
Definition: dimm.idl:59
BYTE lfCharSet
Definition: dimm.idl:67
#define CALLBACK
Definition: compat.h:27
ush Pos
Definition: deflate.h:92
LONG top
Definition: windef.h:297
HGDIOBJ WINAPI SelectObject(_In_ HDC, _In_ HGDIOBJ)
Definition: dc.c:1497
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1059
#define ZeroMemory
Definition: winbase.h:1635
BOOL WINAPI DeleteObject(_In_ HGDIOBJ)
static VOID OnPaint(PMAP infoPtr, WPARAM wParam)
Definition: map.c:505
#define GetWindowLongPtrW
Definition: winuser.h:4698
LONG left
Definition: windef.h:296
BOOL WINAPI ShowWindow(_In_ HWND, _In_ int)
BOOL WINAPI EndPaint(_In_ HWND, _In_ const PAINTSTRUCT *)
#define WCHAR
Definition: msvc.h:43
#define DEFAULT_CHARSET
Definition: wingdi.h:382
LONG right
Definition: windef.h:298
BOOL WINAPI DestroyWindow(_In_ HWND)
#define COLOR_WINDOW
Definition: winuser.h:908
int32_t INT
Definition: typedefs.h:56
RECT CellInt
Definition: precomp.h:32
& rect
Definition: startmenu.cpp:1413
WPARAM wParam
Definition: combotst.c:138
INT NumRows
Definition: precomp.h:50
Definition: precomp.h:29
LRESULT WINAPI DefWindowProcW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
Definition: precomp.h:38
UINT_PTR WPARAM
Definition: windef.h:207
INT INT y
Definition: msvc.h:62
static VOID SetFont(PMAP infoPtr, LPWSTR lpFontName)
Definition: map.c:211
ATOM WINAPI RegisterClassW(_In_ CONST WNDCLASSW *)
GLenum GLclampf GLint i
Definition: glfuncs.h:14
HINSTANCE hInstance
Definition: charmap.c:20
PCELL pActiveCell
Definition: precomp.h:46
LONG_PTR LPARAM
Definition: windef.h:208
#define FM_SETFONT
Definition: precomp.h:22
static BOOL CreateLargeCell(PMAP infoPtr)
Definition: map.c:143
HDC WINAPI BeginPaint(_In_ HWND, _Out_ LPPAINTSTRUCT)
BOOL bLarge
Definition: precomp.h:34
WNDPROC lpfnWndProc
Definition: winuser.h:3130
int WINAPI ReleaseDC(_In_opt_ HWND, _In_ HDC)
VOID UnregisterMapClasses(HINSTANCE hInstance)
Definition: map.c:672
HDC hdc
Definition: msvc.h:53
smooth NULL
Definition: ftsmooth.c:416
HFONT WINAPI CreateFontIndirectW(_In_ const LOGFONTW *)
static HWND hwndParent
Definition: cryptui.c:300
RECT CellExt
Definition: precomp.h:31
LONG cx
Definition: windef.h:324
LPCWSTR lpszClassName
Definition: winuser.h:3138
int WINAPI ScrollWindowEx(_In_ HWND, _In_ int, _In_ int, _In_opt_ LPCRECT, _In_opt_ LPCRECT, _In_opt_ HRGN, _Out_opt_ LPRECT, _In_ UINT)
static VOID DrawActiveCell(PMAP infoPtr, HDC hdc)
Definition: map.c:45
USHORT NumValidGlyphs
Definition: precomp.h:53
#define DT_VCENTER
Definition: winuser.h:543
#define WS_CHILDWINDOW
Definition: pedump.c:639
static const WCHAR szLrgCellWndClass[]
Definition: map.c:15
#define SW_SHOW
Definition: winuser.h:769
struct zzzz Cell
#define WM_DESTROY
Definition: winuser.h:1591
#define PostMessage
Definition: winuser.h:5698
#define MAX_GLYPHS
Definition: precomp.h:15
#define FM_GETHFONT
Definition: precomp.h:25
unsigned int BOOL
Definition: ntddk_ex.h:94
#define GetProcessHeap()
Definition: compat.h:395
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
int cbWndExtra
Definition: winuser.h:3132
if(!(yy_init))
Definition: macro.lex.yy.c:717
BOOL bActive
Definition: precomp.h:33
#define SB_THUMBTRACK
Definition: winuser.h:573
unsigned int UINT
Definition: ndis.h:50
BOOL WINAPI InvalidateRect(_In_opt_ HWND, _In_opt_ LPCRECT, _In_ BOOL)
unsigned short WORD
Definition: ntddk_ex.h:93
static FILE * out
Definition: regtests2xml.c:44
unsigned long DWORD
Definition: ntddk_ex.h:95
HCURSOR WINAPI LoadCursorW(_In_opt_ HINSTANCE, _In_ LPCWSTR)
Definition: cursoricon.c:2074
#define SetLastError(x)
Definition: compat.h:409
#define GGI_MARK_NONEXISTING_GLYPHS
Definition: wingdi.h:1066
SIZE CellSize
Definition: precomp.h:44
#define WM_PAINT
Definition: winuser.h:1602
static const WCHAR L[]
Definition: oid.c:1087
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)
#define FM_GETCHAR
Definition: precomp.h:23
USHORT ValidGlyphs[MAX_GLYPHS]
Definition: precomp.h:52
int WINAPI GetDeviceCaps(_In_opt_ HDC, _In_ int)
BOOL WINAPI GetUpdateRect(_In_ HWND, _Out_opt_ LPRECT, _In_ BOOL)
const DOCKBAR PVOID HWND hParent
Definition: tooldock.h:22
#define WM_LBUTTONDBLCLK
Definition: winuser.h:1754
#define CS_DBLCLKS
Definition: winuser.h:646
#define WM_COMMAND
Definition: winuser.h:1716
uint32_t DWORD_PTR
Definition: typedefs.h:63
BOOL WINAPI MoveWindow(_In_ HWND, _In_ int, _In_ int, _In_ int, _In_ int, _In_ BOOL)
BOOL WINAPI IntersectRect(_Out_ LPRECT, _In_ LPCRECT, _In_ LPCRECT)
HWND hLrgWnd
Definition: precomp.h:42
#define SW_INVALIDATE
Definition: winuser.h:2533
WCHAR ch
Definition: precomp.h:35
BOOL RegisterMapClasses(HINSTANCE hInstance)
Definition: map.c:646
HCURSOR hCursor
Definition: winuser.h:3135
#define FM_SETCHAR
Definition: precomp.h:24
static VOID MoveLargeCell(PMAP infoPtr)
Definition: map.c:180
INT iYStart
Definition: precomp.h:49
BOOL WINAPI GetClientRect(_In_ HWND, _Out_ LPRECT)
#define DT_SINGLELINE
Definition: winuser.h:540
static LRESULT NotifyParentOfSelection(PMAP infoPtr, UINT code, WCHAR ch)
Definition: map.c:285
#define XCELLS
Definition: precomp.h:17
CELL Cells[YCELLS][XCELLS]
Definition: precomp.h:45
_CRTIMP wchar_t *__cdecl wcsncpy(wchar_t *_Dest, const wchar_t *_Source, size_t _Count)
INT x
Definition: msvc.h:62
HBRUSH hbrBackground
Definition: winuser.h:3136
static const WCHAR szMapWndClass[]
Definition: map.c:14
#define YLARGE
Definition: precomp.h:20
static VOID DrawGrid(PMAP infoPtr, PAINTSTRUCT *ps)
Definition: map.c:59
#define min(a, b)
Definition: monoChain.cc:55
#define SB_LINEDOWN
Definition: winuser.h:565
LRESULT CALLBACK LrgCellWndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: lrgcell.c:68
#define SB_LINEUP
Definition: winuser.h:564
static VOID FillGrid(PMAP infoPtr, PAINTSTRUCT *ps)
Definition: map.c:94
BOOL WINAPI SetScrollRange(_In_ HWND, _In_ int, _In_ int, _In_ int, _In_ BOOL)
HWND hMapWnd
Definition: precomp.h:40
static DWORD *static HFONT(WINAPI *pCreateFontIndirectExA)(const ENUMLOGFONTEXDVA *)
HINSTANCE hInstance
Definition: winuser.h:3133
static VOID OnVScroll(PMAP infoPtr, INT Value, INT Pos)
Definition: map.c:425
BOOL WINAPI PtInRect(_In_ LPCRECT, _In_ POINT)
#define IDC_ARROW
Definition: winuser.h:682
static VOID SetGrid(PMAP infoPtr)
Definition: map.c:22
#define WM_CREATE
Definition: winuser.h:1590
BOOL WINAPI CopyRect(_Out_ LPRECT, _In_ LPCRECT)
DWORD WINAPI GetGlyphIndicesW(_In_ HDC hdc, _In_reads_(c) LPCWSTR lpstr, _In_ int c, _Out_writes_(c) LPWORD pgi, _In_ DWORD fl)
WCHAR lfFaceName[LF_FACESIZE]
Definition: dimm.idl:72
#define HIWORD(l)
Definition: typedefs.h:246
LONG bottom
Definition: windef.h:299
#define DT_CENTER
Definition: winuser.h:527
#define LOGPIXELSY
Definition: wingdi.h:717
#define SetWindowLongPtrW
Definition: winuser.h:5215
#define GetWindowLongPtr
Definition: treelist.c:73
WCHAR * LPWSTR
Definition: xmlstorage.h:184
LONG_PTR LRESULT
Definition: windef.h:209
#define GDI_ERROR
Definition: wingdi.h:1290
#define WS_VISIBLE
Definition: pedump.c:620
LONG cy
Definition: windef.h:325
#define YCELLS
Definition: precomp.h:18
int WINAPI SetScrollPos(_In_ HWND, _In_ int, _In_ int, _In_ BOOL)
LPARAM lParam
Definition: combotst.c:139
#define LOWORD(l)
Definition: pedump.c:82
#define HeapFree(x, y, z)
Definition: compat.h:394
#define GWLP_ID
Definition: winuser.h:854
#define WM_VSCROLL
Definition: winuser.h:1720
INT WINAPI DrawTextW(HDC hdc, LPCWSTR str, INT count, LPRECT rect, UINT flags)
Definition: defwnd.c:17