#include "precomp.h"
#include <stdio.h>
#include <malloc.h>
Go to the source code of this file.
|
LRESULT CALLBACK | DisplayProc (HWND, UINT, WPARAM, LPARAM) |
|
BOOL | Display_InitClass (HINSTANCE hInstance) |
|
static int | Display_DrawText (HDC hDC, DISPLAYDATA *pData, int nYPos) |
|
static int CALLBACK | EnumFontFamProcW (const LOGFONTW *lpelfe, const TEXTMETRICW *lptm, DWORD FontType, LPARAM lParam) |
|
static LRESULT | Display_SetTypeFace (HWND hwnd, PLOGFONTW pLogFont) |
|
static LRESULT | Display_SetString (HWND hwnd, LPCWSTR pszString) |
|
static LRESULT | Display_OnCreate (HWND hwnd) |
|
static LRESULT | Display_OnPaint (HWND hwnd) |
|
static LRESULT | Display_OnSize (HWND hwnd) |
|
static LRESULT | Display_OnVScroll (HWND hwnd, WPARAM wParam) |
|
static LRESULT | Display_OnDestroy (HWND hwnd) |
|
LRESULT | Display_OnPrint (HWND hwnd) |
|
LRESULT | Display_GetFullName (HWND hwnd, INT length, PWSTR ptr) |
|
◆ SPACING1
◆ SPACING2
◆ Display_DrawText()
Definition at line 82 of file display.c.
83{
89
90
92
95
99
100
105
106
107
108
111 swprintf(szCaption,
L"abcdefghijklmnopqrstuvwxyz");
113 y +=
tm.tmHeight + 1;
114
115 swprintf(szCaption,
L"ABCDEFGHIJKLMNOPQRSTUVWXYZ");
117 y +=
tm.tmHeight + 1;
118
119 swprintf(szCaption,
L"0123456789.:,;(\"~!@#$%%^&*')");
121 y +=
tm.tmHeight + 1;
122
123
128
129
131 {
135 y +=
tm.tmHeight + 1;
139 }
141
143}
GLint GLint GLint GLint GLint GLint y
GLsizei GLenum const GLvoid GLsizei GLenum 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 const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
_CRTIMP size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
static DWORD *static HFONT(WINAPI *pCreateFontIndirectExA)(const ENUMLOGFONTEXDVA *)
TW_UINT32 TW_UINT16 TW_UINT16 TW_MEMREF pData
HGDIOBJ WINAPI GetStockObject(_In_ int)
HGDIOBJ WINAPI SelectObject(_In_ HDC, _In_ HGDIOBJ)
BOOL WINAPI MoveToEx(_In_ HDC, _In_ int, _In_ int, _Out_opt_ LPPOINT)
BOOL WINAPI TextOutW(_In_ HDC hdc, _In_ int x, _In_ int y, _In_reads_(c) LPCWSTR lpString, _In_ int c)
BOOL WINAPI LineTo(_In_ HDC, _In_ int, _In_ int)
Referenced by Display_OnPaint(), Display_OnPrint(), and Display_SetTypeFace().
◆ Display_GetFullName()
Definition at line 525 of file display.c.
526{
529
531
533
535 {
537 }
538
540}
GLuint GLsizei GLsizei * length
Referenced by DisplayProc().
◆ Display_InitClass()
Definition at line 55 of file display.c.
56{
58
59
72
73
75 {
77 }
79}
const WCHAR g_szFontDisplayClassName[]
LRESULT CALLBACK DisplayProc(HWND, UINT, WPARAM, LPARAM)
ATOM WINAPI RegisterClassExW(_In_ CONST WNDCLASSEXW *)
Referenced by wWinMain().
◆ Display_OnCreate()
Definition at line 269 of file display.c.
270{
272 const int nSizes[
MAX_SIZES] = {8, 12, 18, 24, 36, 48, 60, 72};
278
279
282
283
285
287 {
289 }
290
294
296 L"Jackdaws love my big sphinx of quartz. 1234567890");
297
299
300 return 0;
301}
static LRESULT Display_SetString(HWND hwnd, LPCWSTR pszString)
static LRESULT Display_SetTypeFace(HWND hwnd, PLOGFONTW pLogFont)
#define OUT_DEFAULT_PRECIS
#define CLIP_DEFAULT_PRECIS
HFONT WINAPI CreateFontIndirectW(_In_ const LOGFONTW *)
Referenced by DisplayProc().
◆ Display_OnDestroy()
Definition at line 413 of file display.c.
414{
417
419
420
424
426 {
428 }
429
430
432
433 return 0;
434}
Referenced by DisplayProc().
◆ Display_OnPaint()
Definition at line 304 of file display.c.
305{
309
311
312
316
318
319
321
322
324
326
327 return 0;
328}
static int Display_DrawText(HDC hDC, DISPLAYDATA *pData, int nYPos)
int WINAPI FillRect(HDC, LPCRECT, HBRUSH)
BOOL WINAPI EndPaint(_In_ HWND, _In_ const PAINTSTRUCT *)
HDC WINAPI BeginPaint(_In_ HWND, _Out_ LPPAINTSTRUCT)
BOOL WINAPI GetScrollInfo(_In_ HWND, _In_ int, _Inout_ LPSCROLLINFO)
Referenced by DisplayProc().
◆ Display_OnPrint()
Definition at line 437 of file display.c.
438{
441 int copies, yPos;
442
443
445
456
457
459 {
461#if 0
463
466
467
469#endif
475
476
478
479
481
482
483 yPos = 0;
484
485
487
488
489 for (copies = 0; copies < pfont.
nCopies; copies++)
490 {
491
492 TextOutW(pfont.
hDC, 10, yPos,
L"Testing...1...2...3", 19);
493
494
495
496#if 0
498#endif
499
500
502
503
505 {
506 yPos = 0;
508 }
509 }
510
511
513
515#if 0
516
518#endif
519 }
520
521 return 0;
522}
#define PD_USEDEVMODECOPIESANDCOLLATE
int WINAPI EndPage(_In_ HDC)
int WINAPI EndDoc(_In_ HDC)
int WINAPI StartPage(_In_ HDC)
BOOL WINAPI DeleteDC(_In_ HDC)
Referenced by MainWndProc().
◆ Display_OnSize()
Definition at line 331 of file display.c.
332{
335 int nOldPos;
336
338
339
344
345
349
350
353
354
355 if (nOldPos != si.
nPos)
356 {
357
360 }
361
362 return 0;
363}
BOOL WINAPI GetClientRect(_In_ HWND, _Out_ LPRECT)
BOOL WINAPI UpdateWindow(_In_ HWND)
int WINAPI SetScrollInfo(_In_ HWND, _In_ int, _In_ LPCSCROLLINFO, _In_ BOOL)
int WINAPI ScrollWindowEx(_In_ HWND, _In_ int, _In_ int, _In_opt_ LPCRECT, _In_opt_ LPCRECT, _In_opt_ HRGN, _Out_opt_ LPRECT, _In_ UINT)
Referenced by DisplayProc().
◆ Display_OnVScroll()
Definition at line 366 of file display.c.
367{
369 int nPos;
370
374
376 {
379 break;
382 break;
385 break;
388 break;
392 break;
393 default:
395 }
396
400 {
407 }
408
409 return 0;
410}
Referenced by DisplayProc().
◆ Display_SetString()
Definition at line 256 of file display.c.
257{
259
262
264
265 return 0;
266}
_In_ DWORD _In_ DWORD _Out_writes_to_opt_ pcchString LPSTR pszString
BOOL WINAPI InvalidateRect(_In_opt_ HWND, _In_opt_ LPCRECT, _In_ BOOL)
Referenced by Display_OnCreate(), and DisplayProc().
◆ Display_SetTypeFace()
Definition at line 168 of file display.c.
169{
181
182
186
187
190
191 logfont = *pLogFont;
194
195
199 {
201 {
206 {
209 }
210 }
211
215
216 if (fOpenType)
218 else
220 }
222 {
224 }
225 else
226 {
228 }
229
231 {
235 }
236
237
240
241
251
252 return 0;
253}
static int CALLBACK EnumFontFamProcW(const LOGFONTW *lpelfe, const TEXTMETRICW *lptm, DWORD FontType, LPARAM lParam)
LPWSTR WINAPI lstrcatW(LPWSTR lpString1, LPCWSTR lpString2)
INT WINAPI MulDiv(INT nNumber, INT nNumerator, INT nDenominator)
WCHAR lfFaceName[LF_FACESIZE]
struct _OUTLINETEXTMETRICW * LPOUTLINETEXTMETRICW
int WINAPI GetDeviceCaps(_In_opt_ HDC, _In_ int)
int WINAPI EnumFontFamiliesExW(_In_ HDC, _In_ PLOGFONTW, _In_ FONTENUMPROCW, _In_ LPARAM, _In_ DWORD)
UINT WINAPI GetOutlineTextMetricsW(_In_ HDC hdc, _In_ UINT cjCopy, _Out_writes_bytes_opt_(cjCopy) LPOUTLINETEXTMETRICW potm)
int WINAPI ReleaseDC(_In_opt_ HWND, _In_ HDC)
HDC WINAPI GetDC(_In_opt_ HWND)
Referenced by Display_OnCreate(), and DisplayProc().
◆ DisplayProc()
Definition at line 543 of file display.c.
544{
546 {
549
552
555
558
561
564
567
570
571 default:
573 }
574
575 return 0;
576}
static LRESULT Display_OnDestroy(HWND hwnd)
LRESULT Display_GetFullName(HWND hwnd, INT length, PWSTR ptr)
static LRESULT Display_OnVScroll(HWND hwnd, WPARAM wParam)
static LRESULT Display_OnPaint(HWND hwnd)
static LRESULT Display_OnCreate(HWND hwnd)
static LRESULT Display_OnSize(HWND hwnd)
LRESULT WINAPI DefWindowProcW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
Referenced by Display_InitClass().
◆ EnumFontFamProcW()
Definition at line 147 of file display.c.
152{
155
157 {
159 {
162 }
163 }
165}
static LPTEXTMETRICW lptm
#define TRUETYPE_FONTTYPE
struct tagNEWTEXTMETRICW * PNEWTEXTMETRICW
Referenced by Display_SetTypeFace().
◆ g_FontTitle
◆ g_NumFonts
◆ g_szFontDisplayClassName
const WCHAR g_szFontDisplayClassName[] = L"FontDisplayClass" |