Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

115 lines
2.9 KiB

  1. typedef enum {
  2. FFT_TRUETYPE, // FFT_TRUETYPE *Must* be the first one in the list
  3. FFT_BITMAP,
  4. FFT_PRINTER,
  5. FFT_ATM,
  6. FFT_OTF,
  7. FFT_BAD_FILE // FFT_BAD_FILE *Must* be the last one in the list
  8. } FFTYPE;
  9. typedef enum {
  10. DTP_UNUSED = 0,
  11. DTP_NORMALDRAW,
  12. DTP_SHRINKDRAW,
  13. DTP_SHRINKTEXT,
  14. DTP_WRAPDRAW,
  15. DTP_TEXTOUT
  16. } DTYPE;
  17. typedef struct {
  18. DTYPE dtyp;
  19. int cptsSize;
  20. BOOL fLineUnder;
  21. LPTSTR pszText;
  22. int cchText;
  23. } TXTLN;
  24. typedef TXTLN *PTXTLN;
  25. #define CLINES_DISPLAY 20 // max of 20 lines in sample text
  26. typedef struct {
  27. LOGFONT lfTestFont;
  28. TXTLN atlDsp[CLINES_DISPLAY];
  29. } DISPTEXT;
  30. typedef DISPTEXT *PDISPTEXT;
  31. typedef struct {
  32. int x;
  33. int y;
  34. int cx;
  35. int cy;
  36. int id;
  37. HWND hwnd;
  38. int idText;
  39. LPTSTR pszText;
  40. } BTNREC;
  41. #define FMB_TTL_ERROR ((DWORD)-1)
  42. #define C_PTS_PER_INCH 72 // 72 points per inch
  43. #define CB_ONE_K 1024
  44. #define CY_MIN_WINSIZE 300
  45. #define CX_MIN_WINSIZE 300
  46. #define CPTS_COPYRIGHT_SIZE 10
  47. #define CPTS_INFO_SIZE 12
  48. #define CPTS_SAMPLE_ALPHA 16
  49. #define CPTS_TITLE_SIZE 30
  50. #define ROUND_UP_DIV( x, y ) ( ((x) + (y-1)) / y )
  51. #define OTM_STRING( lpOTM, field ) ((LPTSTR)((LPBYTE)lpOTM + (DWORD)(lpOTM->field)))
  52. #define ABS( i ) ((i) < 0 ? -(i) : (i))
  53. #define ARRAYSIZE(a) (sizeof(a) / sizeof(a[0]))
  54. #define INDEX_TYPEFACENAME 1
  55. typedef BOOL (* PFNFONTPARSER)( HANDLE hfile, PTXTLN ptxlFontInfo );
  56. extern HANDLE hInst;
  57. extern HWND ghwndFrame;
  58. extern HWND ghwndView;
  59. extern TCHAR gszFontPath[2*MAX_PATH];
  60. extern TCHAR gszDots[];
  61. #define FmtFree( s ) if(NULL == (s) || (s) == gszDots) { /* do nothing */ } else LocalFree( s )
  62. /***************************************************************************\
  63. *
  64. * Prototypes
  65. *
  66. \***************************************************************************/
  67. //
  68. // In FONTVIEW.C
  69. //
  70. BOOL InitApplication(HANDLE hInstance, HICON hIcon);
  71. BOOL InitInstance( HANDLE hInstance, int nCmdShow, LPTSTR pszTitle);
  72. void InitGlobals();
  73. LRESULT FAR PASCAL ViewWndProc(HWND, UINT, WPARAM, LPARAM);
  74. LRESULT FAR PASCAL FrameWndProc(HWND, UINT, WPARAM, LPARAM);
  75. BOOL DoCommand( HWND hWnd, WPARAM wParam, LPARAM lParam );
  76. BOOL ParseCommand( LPTSTR lpstrCmdLine, LPTSTR pszFontPath, size_t cchFontPath, BOOL *pfPrint );
  77. FFTYPE LoadFontFile( LPTSTR pszFontPath, PDISPTEXT pdtSmpl, HICON *phIcon );
  78. WORD GetGDILangID();
  79. //
  80. // In FMTTOOLS.C
  81. //
  82. int FmtMessageBox( HWND hwnd, DWORD dwTitleID, LPTSTR pszTitleStr,
  83. UINT fuStyle, BOOL fSound, DWORD dwTextID, ... );
  84. LPTSTR FmtSprintf( DWORD id, ... );
  85. PVOID AllocMem( DWORD cb );
  86. #define FreeMem( pb ) LocalFree(pb)
  87. #ifdef FV_DEBUG
  88. extern void Dprintf( LPTSTR pszFmt, ... );
  89. # define DBTX( s ) TEXT( s ) TEXT("\n")
  90. # define DPRINT(p) Dprintf p
  91. #else
  92. # define DPRINT(p)
  93. #endif