ReactOS 0.4.15-dev-6052-g2626c72
display.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define FVM_SETTYPEFACE   WM_USER
 
#define FVM_SETSTRING   (WM_USER + 1)
 
#define FVM_GETFULLNAME   (WM_USER + 2)
 
#define MAX_STRING   100
 
#define MAX_FORMAT   20
 
#define MAX_SIZES   8
 

Functions

BOOL Display_InitClass (HINSTANCE hInstance)
 
LRESULT Display_OnPrint (HWND hwnd)
 

Variables

const WCHAR g_szFontDisplayClassName []
 

Macro Definition Documentation

◆ FVM_GETFULLNAME

#define FVM_GETFULLNAME   (WM_USER + 2)

Definition at line 6 of file display.h.

◆ FVM_SETSTRING

#define FVM_SETSTRING   (WM_USER + 1)

Definition at line 5 of file display.h.

◆ FVM_SETTYPEFACE

#define FVM_SETTYPEFACE   WM_USER

Definition at line 4 of file display.h.

◆ MAX_FORMAT

#define MAX_FORMAT   20

Definition at line 10 of file display.h.

◆ MAX_SIZES

#define MAX_SIZES   8

Definition at line 11 of file display.h.

◆ MAX_STRING

#define MAX_STRING   100

Definition at line 9 of file display.h.

Function Documentation

◆ Display_InitClass()

BOOL Display_InitClass ( HINSTANCE  hInstance)

Definition at line 55 of file display.c.

56{
57 WNDCLASSEXW wincl;
58
59 /* Set the fontdisplay window class structure */
60 wincl.cbSize = sizeof(WNDCLASSEX);
61 wincl.style = CS_DBLCLKS;
63 wincl.cbClsExtra = 0;
64 wincl.cbWndExtra = 0;
65 wincl.hInstance = hInstance;
66 wincl.hIcon = NULL;
69 wincl.lpszMenuName = NULL;
71 wincl.hIconSm = NULL;
72
73 /* Register the window class, and if it fails return FALSE */
74 if (!RegisterClassExW (&wincl))
75 {
76 return FALSE;
77 }
78 return TRUE;
79}
const WCHAR g_szFontDisplayClassName[]
Definition: display.c:34
LRESULT CALLBACK DisplayProc(HWND, UINT, WPARAM, LPARAM)
Definition: display.c:543
HINSTANCE hInstance
Definition: charmap.c:19
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
LPCWSTR lpszClassName
Definition: winuser.h:3216
LPCWSTR lpszMenuName
Definition: winuser.h:3215
HBRUSH hbrBackground
Definition: winuser.h:3214
WNDPROC lpfnWndProc
Definition: winuser.h:3208
UINT cbSize
Definition: winuser.h:3206
int cbWndExtra
Definition: winuser.h:3210
HCURSOR hCursor
Definition: winuser.h:3213
HICON hIconSm
Definition: winuser.h:3217
HINSTANCE hInstance
Definition: winuser.h:3211
UINT style
Definition: winuser.h:3207
int cbClsExtra
Definition: winuser.h:3209
HICON hIcon
Definition: winuser.h:3212
HGDIOBJ WINAPI GetStockObject(_In_ int)
#define WHITE_BRUSH
Definition: wingdi.h:902
#define IDC_ARROW
Definition: winuser.h:682
#define CS_DBLCLKS
Definition: winuser.h:646
ATOM WINAPI RegisterClassExW(_In_ CONST WNDCLASSEXW *)
#define LoadCursor
Definition: winuser.h:5802
WNDCLASSEXA WNDCLASSEX
Definition: winuser.h:5709

Referenced by wWinMain().

◆ Display_OnPrint()

LRESULT Display_OnPrint ( HWND  hwnd)

Definition at line 437 of file display.c.

438{
439 PRINTDLG pfont;
441 int copies, yPos;
442
443 /* Clears the memory before using it */
444 ZeroMemory(&pfont, sizeof(pfont));
445
446 pfont.lStructSize = sizeof(pfont);
447 pfont.hwndOwner = hwnd;
448 pfont.hDevMode = NULL;
449 pfont.hDevNames = NULL;
451 pfont.nCopies = 1;
452 pfont.nFromPage = 0xFFFF;
453 pfont.nToPage = 0xFFFF;
454 pfont.nMinPage = 1;
455 pfont.nMaxPage = 0xFFFF;
456
457 /* Opens up the print dialog box */
458 if (PrintDlg(&pfont))
459 {
460 DOCINFO docinfo;
461#if 0
463
464 pData = malloc(sizeof(DISPLAYDATA));
465 ZeroMemory(pData, sizeof(DISPLAYDATA));
466
467 /* Sets up the font layout */
469#endif
470 docinfo.cbSize = sizeof(DOCINFO);
471 docinfo.lpszDocName = L"Printing Font";
472 docinfo.lpszOutput = NULL;
473 docinfo.lpszDatatype = NULL;
474 docinfo.fwType = 0;
475
476 /* We start printing */
477 StartDoc(pfont.hDC, &docinfo);
478
479 /* Grabs the text metrics for the printer */
480 GetTextMetrics(pfont.hDC, &tm);
481
482 /* Start out with 0 for the y position for the page */
483 yPos = 0;
484
485 /* Starts out with the current page */
486 StartPage(pfont.hDC);
487
488 /* Used when printing for more than one copy */
489 for (copies = 0; copies < pfont.nCopies; copies++)
490 {
491 /* Test output */
492 TextOutW(pfont.hDC, 10, yPos, L"Testing...1...2...3", 19);
493
494 /* TODO: Determine if using Display_DrawText() will work for both rendering out to the
495 window and to the printer output */
496#if 0
497 Display_DrawText(pfont.hDC, pData, yPos);
498#endif
499
500 /* Ends the current page */
501 EndPage(pfont.hDC);
502
503 /* If we are making more than one copy, start a new page */
504 if (copies != pfont.nCopies)
505 {
506 yPos = 0;
507 StartPage(pfont.hDC);
508 }
509 }
510
511 /* The printing is now over */
512 EndDoc(pfont.hDC);
513
514 DeleteDC(pfont.hDC);
515#if 0
516 /* Frees the memory since we no longer need it for now */
517 free(pData);
518#endif
519 }
520
521 return 0;
522}
static int Display_DrawText(HDC hDC, DISPLAYDATA *pData, int nYPos)
Definition: display.c:82
#define PD_USEDEVMODECOPIESANDCOLLATE
Definition: commdlg.h:166
#define PrintDlg
Definition: commdlg.h:668
#define PD_RETURNDC
Definition: commdlg.h:155
#define free
Definition: debug_ros.c:5
#define malloc
Definition: debug_ros.c:4
#define L(x)
Definition: ntvdm.h:50
int cbSize
Definition: wingdi.h:1676
LPCSTR lpszOutput
Definition: wingdi.h:1678
LPCSTR lpszDatatype
Definition: wingdi.h:1679
LPCSTR lpszDocName
Definition: wingdi.h:1677
DWORD fwType
Definition: wingdi.h:1680
WORD nMaxPage
Definition: commdlg.h:474
HDC hDC
Definition: commdlg.h:469
DWORD Flags
Definition: commdlg.h:470
WORD nCopies
Definition: commdlg.h:475
WORD nFromPage
Definition: commdlg.h:471
HGLOBAL hDevMode
Definition: commdlg.h:467
WORD nToPage
Definition: commdlg.h:472
WORD nMinPage
Definition: commdlg.h:473
HGLOBAL hDevNames
Definition: commdlg.h:468
HWND hwndOwner
Definition: commdlg.h:466
DWORD lStructSize
Definition: commdlg.h:465
Definition: time.h:68
#define GetWindowLongPtr
Definition: treelist.c:73
#define GWLP_USERDATA
Definition: treelist.c:63
TW_UINT32 TW_UINT16 TW_UINT16 TW_MEMREF pData
Definition: twain.h:1830
#define ZeroMemory
Definition: winbase.h:1670
_In_ LONG _In_ HWND hwnd
Definition: winddi.h:4023
int WINAPI EndPage(_In_ HDC)
int WINAPI EndDoc(_In_ HDC)
int WINAPI StartPage(_In_ HDC)
DOCINFOA DOCINFO
Definition: wingdi.h:4414
BOOL WINAPI TextOutW(_In_ HDC hdc, _In_ int x, _In_ int y, _In_reads_(c) LPCWSTR lpString, _In_ int c)
BOOL WINAPI DeleteDC(_In_ HDC)
#define GetTextMetrics
Definition: wingdi.h:4474
#define StartDoc
Definition: wingdi.h:4482

Referenced by MainWndProc().

Variable Documentation

◆ g_szFontDisplayClassName

const WCHAR g_szFontDisplayClassName[]
extern

Definition at line 34 of file display.c.

Referenced by Display_InitClass(), and MainWnd_OnCreate().