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.

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