ReactOS 0.4.15-dev-7654-g6bc40d3
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 40 of file display.c.

41{
42 WNDCLASSEXW wincl;
43
44 /* Set the fontdisplay window class structure */
45 wincl.cbSize = sizeof(WNDCLASSEX);
46 wincl.style = CS_DBLCLKS;
48 wincl.cbClsExtra = 0;
49 wincl.cbWndExtra = 0;
50 wincl.hInstance = hInstance;
51 wincl.hIcon = NULL;
54 wincl.lpszMenuName = NULL;
56 wincl.hIconSm = NULL;
57
58 /* Register the window class, and if it fails return FALSE */
59 if (!RegisterClassExW (&wincl))
60 {
61 return FALSE;
62 }
63 return TRUE;
64}
const WCHAR g_szFontDisplayClassName[]
Definition: display.c:19
LRESULT CALLBACK DisplayProc(HWND, UINT, WPARAM, LPARAM)
Definition: display.c:528
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:3225
LPCWSTR lpszMenuName
Definition: winuser.h:3224
HBRUSH hbrBackground
Definition: winuser.h:3223
WNDPROC lpfnWndProc
Definition: winuser.h:3217
UINT cbSize
Definition: winuser.h:3215
int cbWndExtra
Definition: winuser.h:3219
HCURSOR hCursor
Definition: winuser.h:3222
HICON hIconSm
Definition: winuser.h:3226
HINSTANCE hInstance
Definition: winuser.h:3220
UINT style
Definition: winuser.h:3216
int cbClsExtra
Definition: winuser.h:3218
HICON hIcon
Definition: winuser.h:3221
HGDIOBJ WINAPI GetStockObject(_In_ int)
#define WHITE_BRUSH
Definition: wingdi.h:902
#define IDC_ARROW
Definition: winuser.h:687
#define CS_DBLCLKS
Definition: winuser.h:651
ATOM WINAPI RegisterClassExW(_In_ CONST WNDCLASSEXW *)
#define LoadCursor
Definition: winuser.h:5811
WNDCLASSEXA WNDCLASSEX
Definition: winuser.h:5718

Referenced by wWinMain().

◆ Display_OnPrint()

LRESULT Display_OnPrint ( HWND  hwnd)

Definition at line 422 of file display.c.

423{
424 PRINTDLG pfont;
426 int copies, yPos;
427
428 /* Clears the memory before using it */
429 ZeroMemory(&pfont, sizeof(pfont));
430
431 pfont.lStructSize = sizeof(pfont);
432 pfont.hwndOwner = hwnd;
433 pfont.hDevMode = NULL;
434 pfont.hDevNames = NULL;
436 pfont.nCopies = 1;
437 pfont.nFromPage = 0xFFFF;
438 pfont.nToPage = 0xFFFF;
439 pfont.nMinPage = 1;
440 pfont.nMaxPage = 0xFFFF;
441
442 /* Opens up the print dialog box */
443 if (PrintDlg(&pfont))
444 {
445 DOCINFO docinfo;
446#if 0
448
449 pData = malloc(sizeof(DISPLAYDATA));
450 ZeroMemory(pData, sizeof(DISPLAYDATA));
451
452 /* Sets up the font layout */
454#endif
455 docinfo.cbSize = sizeof(DOCINFO);
456 docinfo.lpszDocName = L"Printing Font";
457 docinfo.lpszOutput = NULL;
458 docinfo.lpszDatatype = NULL;
459 docinfo.fwType = 0;
460
461 /* We start printing */
462 StartDoc(pfont.hDC, &docinfo);
463
464 /* Grabs the text metrics for the printer */
465 GetTextMetrics(pfont.hDC, &tm);
466
467 /* Start out with 0 for the y position for the page */
468 yPos = 0;
469
470 /* Starts out with the current page */
471 StartPage(pfont.hDC);
472
473 /* Used when printing for more than one copy */
474 for (copies = 0; copies < pfont.nCopies; copies++)
475 {
476 /* Test output */
477 TextOutW(pfont.hDC, 10, yPos, L"Testing...1...2...3", 19);
478
479 /* TODO: Determine if using Display_DrawText() will work for both rendering out to the
480 window and to the printer output */
481#if 0
482 Display_DrawText(pfont.hDC, pData, yPos);
483#endif
484
485 /* Ends the current page */
486 EndPage(pfont.hDC);
487
488 /* If we are making more than one copy, start a new page */
489 if (copies != pfont.nCopies)
490 {
491 yPos = 0;
492 StartPage(pfont.hDC);
493 }
494 }
495
496 /* The printing is now over */
497 EndDoc(pfont.hDC);
498
499 DeleteDC(pfont.hDC);
500#if 0
501 /* Frees the memory since we no longer need it for now */
502 free(pData);
503#endif
504 }
505
506 return 0;
507}
static int Display_DrawText(HDC hDC, DISPLAYDATA *pData, int nYPos)
Definition: display.c:67
#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:1712
_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 19 of file display.c.

Referenced by Display_InitClass(), and MainWnd_OnCreate().