ReactOS  0.4.12-dev-18-gf469aca
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.

Referenced by DisplayProc(), and MainWnd_OnInstall().

◆ FVM_SETSTRING

#define FVM_SETSTRING   (WM_USER + 1)

Definition at line 5 of file display.h.

Referenced by DisplayProc(), and MainWnd_OnCreate().

◆ FVM_SETTYPEFACE

#define FVM_SETTYPEFACE   WM_USER

Definition at line 4 of file display.h.

Referenced by DisplayProc(), MainWnd_OnCreate(), MainWnd_OnNext(), and MainWnd_OnPrev().

◆ MAX_FORMAT

#define MAX_FORMAT   20

Definition at line 10 of file display.h.

◆ MAX_SIZES

#define MAX_SIZES   8

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

Referenced by wWinMain().

56 {
57  WNDCLASSEXW wincl;
58 
59  /* Set the fontdisplay window class structure */
60  wincl.cbSize = sizeof(WNDCLASSEX);
61  wincl.style = CS_DBLCLKS;
62  wincl.lpfnWndProc = DisplayProc;
63  wincl.cbClsExtra = 0;
64  wincl.cbWndExtra = 0;
65  wincl.hInstance = hInstance;
66  wincl.hIcon = NULL;
67  wincl.hCursor = LoadCursor (NULL, IDC_ARROW);
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 }
HGDIOBJ WINAPI GetStockObject(_In_ int)
#define TRUE
Definition: types.h:120
int cbWndExtra
Definition: winuser.h:3173
HICON hIcon
Definition: winuser.h:3175
#define WHITE_BRUSH
Definition: wingdi.h:900
ATOM WINAPI RegisterClassExW(_In_ CONST WNDCLASSEXW *)
HINSTANCE hInstance
Definition: charmap.c:20
LPCWSTR lpszMenuName
Definition: winuser.h:3178
smooth NULL
Definition: ftsmooth.c:416
int cbClsExtra
Definition: winuser.h:3172
LPCWSTR lpszClassName
Definition: winuser.h:3179
HBRUSH hbrBackground
Definition: winuser.h:3177
UINT cbSize
Definition: winuser.h:3169
HINSTANCE hInstance
Definition: winuser.h:3174
HCURSOR hCursor
Definition: winuser.h:3176
#define CS_DBLCLKS
Definition: winuser.h:646
UINT style
Definition: winuser.h:3170
#define LoadCursor
Definition: winuser.h:5678
WNDPROC lpfnWndProc
Definition: winuser.h:3171
LRESULT CALLBACK DisplayProc(HWND, UINT, WPARAM, LPARAM)
Definition: display.c:543
HICON hIconSm
Definition: winuser.h:3180
#define IDC_ARROW
Definition: winuser.h:682
const WCHAR g_szFontDisplayClassName[]
Definition: display.c:34
WNDCLASSEXA WNDCLASSEX
Definition: winuser.h:5585

◆ Display_OnPrint()

LRESULT Display_OnPrint ( HWND  hwnd)

Definition at line 437 of file display.c.

Referenced by MainWndProc().

438 {
439  PRINTDLG pfont;
440  TEXTMETRIC tm;
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 */
468  pData = (DISPLAYDATA*)GetWindowLongPtr(hwnd, GWLP_USERDATA);
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 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
WORD nMaxPage
Definition: commdlg.h:474
#define free
Definition: debug_ros.c:5
#define ZeroMemory
Definition: winbase.h:1635
WORD nCopies
Definition: commdlg.h:475
#define GetTextMetrics
Definition: wingdi.h:4451
int WINAPI EndPage(_In_ HDC)
WORD nMinPage
Definition: commdlg.h:473
int WINAPI StartPage(_In_ HDC)
HANDLE hDevNames
Definition: commdlg.h:468
#define PrintDlg
Definition: commdlg.h:668
#define PD_USEDEVMODECOPIESANDCOLLATE
Definition: commdlg.h:166
#define GWLP_USERDATA
Definition: treelist.c:63
WORD nFromPage
Definition: commdlg.h:471
smooth NULL
Definition: ftsmooth.c:416
#define PD_RETURNDC
Definition: commdlg.h:155
DWORD fwType
Definition: wingdi.h:1657
LPCSTR lpszOutput
Definition: wingdi.h:1655
LPCSTR lpszDatatype
Definition: wingdi.h:1656
static const WCHAR L[]
Definition: oid.c:1087
Definition: time.h:76
int cbSize
Definition: wingdi.h:1653
BOOL WINAPI TextOutW(_In_ HDC hdc, _In_ int x, _In_ int y, _In_reads_(c) LPCWSTR lpString, _In_ int c)
HWND hwndOwner
Definition: commdlg.h:466
BOOL WINAPI DeleteDC(_In_ HDC)
LPCSTR lpszDocName
Definition: wingdi.h:1654
DWORD lStructSize
Definition: commdlg.h:465
WORD nToPage
Definition: commdlg.h:472
#define malloc
Definition: debug_ros.c:4
DWORD Flags
Definition: commdlg.h:470
#define StartDoc
Definition: wingdi.h:4459
#define GetWindowLongPtr
Definition: treelist.c:73
TW_UINT32 TW_UINT16 TW_UINT16 TW_MEMREF pData
Definition: twain.h:1827
HDC hDC
Definition: commdlg.h:469
HANDLE hDevMode
Definition: commdlg.h:467
DOCINFOA DOCINFO
Definition: wingdi.h:4391
int WINAPI EndDoc(_In_ HDC)
static int Display_DrawText(HDC hDC, DISPLAYDATA *pData, int nYPos)
Definition: display.c:82

Variable Documentation

◆ g_szFontDisplayClassName

const WCHAR g_szFontDisplayClassName[]

Definition at line 34 of file display.c.

Referenced by Display_InitClass(), and MainWnd_OnCreate().