Source code of Windows XP (NT5)
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.

236 lines
6.2 KiB

  1. /***************************************************************************
  2. * globals.h - TrueType Font Manager global data declaration.
  3. *
  4. * $keywords: globals.h 1.3 17-Mar-94 2:38:47 PM$
  5. *
  6. * Copyright (C) 1992-93 ElseWare Corporation. All rights reserved.
  7. ***************************************************************************/
  8. #ifndef __GLOBALS_H__
  9. #define __GLOBALS_H__
  10. #define ERR_FAIL 0
  11. #define NOERR 1
  12. #include <fstream.h>
  13. //
  14. // Forward declarations.
  15. //
  16. class CFontFolder;
  17. //
  18. // Constants
  19. //
  20. #define MAX_NAME_LEN 64
  21. #define MAX_LOG_NAME_LEN 32
  22. #define MAX_PATH_LEN MAX_PATH
  23. #define MAX_FILE_LEN MAX_PATH_LEN
  24. // #define MAX_DIRS 32
  25. #define IDX_NULL 0xFFFF // index out of range
  26. #define IDX_ZERO 0x0000
  27. #define PANOSE_LEN 10
  28. #define COPYRIGHT_LEN 60
  29. //
  30. // Defines
  31. //
  32. #define PATHMAX MAX_PATH // path length max - used for Get...Directory() calls
  33. #define DESCMAX 129 // max description in newexe header
  34. #define MODNAMEMAX 20 // max module name in newexe header
  35. //
  36. // Name/string types
  37. //
  38. typedef TCHAR FullPathName_t[ PATHMAX ];
  39. typedef TCHAR FontDesc_t[ DESCMAX ];
  40. typedef TCHAR ModName_t[ MODNAMEMAX ];
  41. typedef TCHAR LOGNAME[ MAX_LOG_NAME_LEN + 1 ]; // log font name
  42. typedef TCHAR FAMNAME[ MAX_LOG_NAME_LEN + 1 ]; // font Family name
  43. typedef TCHAR FONTNAME[ MAX_NAME_LEN + 1 ];
  44. typedef TCHAR PATHNAME[ MAX_PATH_LEN + 1 ];
  45. typedef TCHAR FILENAME[ MAX_FILE_LEN + 1 ];
  46. //
  47. // Globals
  48. //
  49. extern BOOL g_bTrace;
  50. extern BOOL g_bDiag;
  51. extern BOOL g_bTimer;
  52. extern HINSTANCE g_hInst;
  53. extern TCHAR g_szType1Key[];
  54. extern char g_szFontsDirA[];
  55. extern TCHAR c_szTrueType[];
  56. extern TCHAR c_szOpenType[];
  57. extern TCHAR c_szPostScript[];
  58. extern TCHAR c_szDescFormat[];
  59. extern TCHAR szNull[];
  60. extern FullPathName_t s_szSharedDir;
  61. //
  62. // Far East character handling.
  63. //
  64. extern BOOL g_bDBCS;
  65. //
  66. // Number of references to objects in this dll
  67. //
  68. extern LONG g_cRefThisDll;
  69. extern CFontFolder * g_poFontFolder;
  70. //
  71. // Types
  72. //
  73. typedef short RC;
  74. typedef WORD SFIDX; /* display sorted index into font list */
  75. typedef WORD FTIDX;
  76. typedef WORD POINTSIZE; /* Size of point measurement */
  77. // EMR: This needs to be a WORD so it fits in the ListITEMDATA struct.
  78. //typedef int FONTNUM; /* Font number */
  79. typedef WORD FONTNUM; /* Font number */
  80. typedef FONTNUM* PFONTNUM; /* Font number */
  81. typedef FONTNUM FAR* LPFONTNUM; /* Font number */
  82. //
  83. // typedefs.
  84. //
  85. //
  86. // Font description info. Used during installation and to retrieve info
  87. // about a font.
  88. //
  89. // szFile must is filled in by calling proc. The rest is filled in depending
  90. // on the flags.
  91. //
  92. #define FDI_DESC 1
  93. #define FDI_FAMILY 2
  94. #define FDI_PANOSE 4
  95. #define FDI_STYLE 8
  96. #define FDI_ALL (DWORD)(15)
  97. #define FDI_NONE 0
  98. #define FDI_VTC 16 // Version Trademark and copyright.
  99. //
  100. // Style bits. These can be OR'd together
  101. //
  102. #define FDI_S_REGULAR 0
  103. #define FDI_S_BOLD 1
  104. #define FDI_S_ITALIC 2
  105. typedef struct {
  106. DWORD dwFlags;
  107. FullPathName_t szFile;
  108. FontDesc_t szDesc;
  109. FAMNAME szFamily;
  110. DWORD dwStyle;
  111. WORD wWeight;
  112. TCHAR jPanose[ PANOSE_LEN ];
  113. //
  114. // These strings are allocated by the routine that actually retrieves
  115. // the strings. They should be deleted using the C++ delete operator.
  116. //
  117. TCHAR * lpszVersion;
  118. TCHAR * lpszTrademark;
  119. TCHAR * lpszCopyright;
  120. } FONTDESCINFO, FAR * LPFONTDESCINFO;
  121. //
  122. // Enums
  123. //
  124. typedef enum {
  125. eFKNone = 0,
  126. eFKDevice,
  127. eFKTrueType,
  128. eFKOpenType,
  129. eFKTTC,
  130. eFKType1
  131. } eFileKind;
  132. typedef enum _tagMPVIEW {
  133. eVFont = 0,
  134. eVFamily,
  135. eVFile,
  136. eVPanose
  137. } MPVIEW;
  138. extern BOOL NEAR PASCAL bIsTrueType( LPFONTDESCINFO lpFile, LPDWORD pdwTableTags = NULL, LPDWORD lpdwStatus = NULL );
  139. extern BOOL NEAR PASCAL bIsNewExe( LPFONTDESCINFO lpFile );
  140. extern int GetFontsDirectory( LPTSTR lpDir, int nSize);
  141. extern BOOL WriteToRegistry( LPTSTR lpDesc, LPTSTR lpFile );
  142. extern int FAR PASCAL iUIErrMemDlg(HWND hwndParent); // Everyone needs this
  143. extern int FAR PASCAL iUIMsgBox( HWND hwndParent,
  144. WORD wIDStr,
  145. WORD wCAPStr,
  146. UINT uiMBFlags,
  147. LPCTSTR wArg1 = 0,
  148. LPCTSTR wArg2 = 0,
  149. LPCTSTR wArg3 = 0,
  150. LPCTSTR wArg4 = 0);
  151. //
  152. // These are 3 simple covers which make calling the message routine
  153. // much simpler.
  154. //
  155. int FAR PASCAL iUIMsgBoxWithCaption(HWND hwndParent, WORD wIDStr, WORD wCaption);
  156. int FAR PASCAL iUIMsgYesNoExclaim(HWND hwndParent, WORD wIDStr, LPCTSTR wArg = 0);
  157. int FAR PASCAL iUIMsgYesNoExclaim(HWND hwndParent, WORD wIDStr, WORD wCap, LPCTSTR wArg=0);
  158. int FAR PASCAL iUIMsgOkCancelExclaim(HWND hwndParent, WORD wIDStr, WORD wCap, LPCTSTR wArg=0);
  159. int FAR PASCAL iUIMsgRetryCancelExclaim(HWND hwndParent, WORD wIDStr, LPCTSTR wArg=0 );
  160. int FAR PASCAL iUIMsgExclaim(HWND hwndParent, WORD wIDStr, LPCTSTR wArg = 0);
  161. int FAR PASCAL iUIMsgBox(HWND hwndParent, WORD wIDStr, LPCTSTR wArg = 0);
  162. int FAR PASCAL iUIMsgInfo(HWND hwndParent, WORD wIDStr, LPCTSTR wArg = 0);
  163. //
  164. // Special-purpose message box for reporting font validation failures.
  165. // dwStatusCode must be one of FVS_XXXXXXXX values as defined in fvscodes.h
  166. //
  167. int iUIMsgBoxInvalidFont(HWND hwndParent, LPCTSTR pszFontFile, LPCTSTR pszFontDesc,
  168. DWORD dwStatusCode,
  169. UINT uStyle = (MB_OKCANCEL | MB_ICONEXCLAMATION));
  170. #include "fvscodes.h" // \nt\private\windows\shell\control\t1instal\fvscodes.h
  171. // Contains FVS_xxxxx codes and related macros.
  172. #endif /* __GLOBALS_H_ */
  173. /****************************************************************************
  174. * $lgb$
  175. * 1.0 7-Mar-94 eric Initial revision.
  176. * 1.1 9-Mar-94 eric Background thread and g_hDBMutex
  177. * 1.2 9-Mar-94 eric Added Gdi mutex.
  178. * 1.3 17-Mar-94 eric Removed mutex handles.
  179. * $lge$
  180. *
  181. ****************************************************************************/