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.

331 lines
11 KiB

  1. #ifndef __PCONTROL_H__
  2. #define __PCONTROL_H__
  3. #ifdef __cplusplus
  4. extern "C" {
  5. #endif
  6. #include "fvscodes.h" // FVS_xxxxxx (font validation status) codes & macros.
  7. // \nt\private\windows\shell\control\t1instal\fvscodes.h
  8. //
  9. // Global definitions
  10. //
  11. //
  12. // Note for file macros below.
  13. // The LZxxx functions are no longer used in the macro substitutions.
  14. // The need to use LZxxx implementations is a function of the file type, not
  15. // the target platform. Wherever LZxxx functions are required, they
  16. // are now used explicitely.
  17. //
  18. #ifdef WINNT
  19. #define FOPEN( sz, lpsz ) MyOpenFile( sz, lpsz, OF_READ )
  20. #define FREAD( fh, buf, len ) MyAnsiReadFile( fh, CP_ACP, buf, len )
  21. #define FWRITE( fh, buf, len ) MyAnsiWriteFile( fh, CP_ACP, buf, len )
  22. #define FREADBYTES(fh,buf,len) MyByteReadFile( fh, buf, len )
  23. #define FWRITEBYTES(fh,buf,len) MyByteWriteFile( fh, buf, len )
  24. #define FSEEK( fh, off, i ) MyFileSeek( fh, (DWORD) off, i )
  25. #define FCLOSE( fh ) MyCloseFile( fh )
  26. #define FCREATE( sz ) MyOpenFile( sz, NULL, OF_READWRITE | OF_CREATE )
  27. #else
  28. #define FOPEN( sz ) _lopen( sz, OF_READ )
  29. #define FCLOSE( fh ) _lclose( fh )
  30. #define FREAD( fh, buf, len ) _lread( fh, buf, len )
  31. #define FREADBYTES(fh, buf, len) _lread( fh, buf, len )
  32. #define FSEEK( fh, off, i ) _llseek( fh, (DWORD) off, i )
  33. #define FCREATE( sz ) _lcreat( sz, 0 )
  34. #define FWRITE( fh, buf, len ) _lwrite( fh, buf, len )
  35. #define FWRITEBYTES(fh, buf, len) _lwrite( fh, buf, len )
  36. #endif // WINNT
  37. //
  38. // Global variables
  39. //
  40. extern FullPathName_t e_szDirOfSrc;
  41. extern UINT s_wBrowseDoneMsg;
  42. //
  43. // Flags for ReadLine
  44. //
  45. #define RL_MORE_MEM -1
  46. #define RL_SECTION_END -2
  47. #define SEEK_BEG 0
  48. #define SEEK_CUR 1
  49. #define SEEK_END 2
  50. #define PRN 148
  51. #define MON_OF_YR 276
  52. #define MOUSE MON_OF_YR+48
  53. #define INSTALL MOUSE+16
  54. //
  55. // Font file types used in Fonts applet - installation
  56. //
  57. #define NOT_TT_OR_T1 0 // Neither TrueType or Type 1 font (FALSE)
  58. #define TRUETYPE_FONT 1 // This is a TrueType font (TRUE)
  59. #define TYPE1_FONT 2 // This is an Adobe Type1 font
  60. #define TYPE1_FONT_NC 3 // Type1 font that cannot be converted to TT
  61. #define OPENTYPE_FONT 4 // Font is OpenType.
  62. //
  63. // Font file types used in Fonts applet - Main dlg "Installed Fonts" lbox
  64. //
  65. #define IF_OTHER 0 // TrueType or Bitmap 1 font (FALSE)
  66. #define IF_TYPE1 1 // Adobe Type1 font
  67. #define IF_TYPE1_TT 2 // Matching TT font for Adobe Type1 font
  68. #define T1_MAX_DATA (2 * PATHMAX + 6)
  69. //
  70. // Return codes from InstallT1Font routine
  71. //
  72. #define TYPE1_INSTALL_IDOK IDOK // User pressed OK from MessageBox error
  73. #define TYPE1_INSTALL_IDYES IDYES // Same as IDOK
  74. #define TYPE1_INSTALL_IDNO IDNO // Font not installed - user pressed NO
  75. #define TYPE1_INSTALL_IDCANCEL IDCANCEL // Entire installation cancelled
  76. #define TYPE1_INSTALL_PS_ONLY 10 // Only the PS Font installed.
  77. #define TYPE1_INSTALL_PS_AND_MTT 11 // PostScript Font installed and matching
  78. // TT font already installed.
  79. #define TYPE1_INSTALL_TT_AND_PS 12 // PS Font installed and converted to TT.
  80. #define TYPE1_INSTALL_TT_ONLY 13 // PS Font converted to TT only.
  81. #define TYPE1_INSTALL_TT_AND_MPS 14 // PS Font converted to TT and matching
  82. // PS font already installed.
  83. //
  84. // Global functions
  85. //
  86. //
  87. // append.cpp
  88. //
  89. BOOL FAR PASCAL fnAppendSplitFiles( LPTSTR FAR *, LPTSTR, int );
  90. //
  91. // instfls.c
  92. //
  93. typedef int (FAR PASCAL *INSTALL_PROC)(HWND hDlg, WORD wMsg, int i,
  94. LPTSTR FAR *pszFiles, LPTSTR lpszDir );
  95. #define IFF_CHECKINI 0x0001
  96. #define IFF_SRCANDDST 0x0002
  97. #define IF_ALREADY_INSTALLED 1
  98. #define IF_ALREADY_RUNNING 2
  99. #define IF_JUST_INSTALLED 3
  100. PTSTR FAR PASCAL CopyString( LPTSTR szStr );
  101. PTSTR FAR PASCAL MyLoadString( WORD wId );
  102. LPTSTR FAR PASCAL CpyToChr( LPTSTR pDest, LPTSTR pSrc, TCHAR cChr, int iMax );
  103. VOID FAR PASCAL GetDiskAndFile( LPTSTR pszInf,
  104. short /* int */ FAR *nDsk,
  105. LPTSTR pszDriver,
  106. WORD wSize );
  107. DWORD FAR PASCAL InstallFiles( HWND hwnd, LPTSTR FAR *pszFiles, int nCount,
  108. INSTALL_PROC lpfnNewFile, WORD wFlags );
  109. //
  110. // PFONT.CPP
  111. //
  112. extern VOID NEAR PASCAL vConvertExtension( LPTSTR pszFile, LPTSTR szExt );
  113. class CFontManager;
  114. extern BOOL FAR PASCAL bCPAddFonts( HWND ma );
  115. #define CPDI_CANCEL -1
  116. #define CPDI_FAIL 0
  117. #define CPDI_SUCCESS 1
  118. extern int FAR PASCAL CPDropInstall( HWND hwndParent,
  119. LPTSTR szFile,
  120. DWORD dwEffect,
  121. LPTSTR lpszDestName = NULL,
  122. int iCount = 0 );
  123. extern VOID FAR PASCAL vCPDeleteFromSharedDir( LPTSTR pszFileOnly );
  124. extern VOID FAR PASCAL vCPFilesToDescs( );
  125. extern BOOL NEAR PASCAL bUniqueOnSharedDir( LPTSTR lpszDst, LPTSTR lpszSrc );
  126. extern VOID NEAR PASCAL vHashToNulls( LPTSTR lpStr );
  127. extern BOOL FAR PASCAL bUniqueFilename (LPTSTR lpszDst, LPTSTR lpszSrc, LPTSTR lpszDir);
  128. //
  129. // cpsetup.c
  130. //
  131. typedef WORD (*LPSETUPINFPROC)( LPTSTR, LPVOID );
  132. extern DWORD ReadSetupInfSection( LPTSTR pszInfPath,
  133. LPTSTR pszSection,
  134. LPTSTR *ppszSectionItems );
  135. extern WORD ReadSetupInfCB( LPTSTR pszInfPath,
  136. LPTSTR pszSection,
  137. LPSETUPINFPROC,
  138. LPVOID pData);
  139. extern int FAR PASCAL ReadSetupInfIntoLBs( HWND hLBName,
  140. HWND hLBDBase,
  141. WORD wAddMsg,
  142. LPTSTR pszSection,
  143. WORD (FAR PASCAL *lpfnGetName)(LPTSTR, LPTSTR) );
  144. //
  145. // PINSTALL.CPP
  146. //
  147. extern BOOL FAR PASCAL bCPInstallFile( HWND hwndParent,
  148. LPTSTR lpDir,
  149. LPTSTR lpFrom,
  150. LPTSTR lpTo );
  151. //
  152. // PFILES.CPP
  153. //
  154. extern BOOL FAR PASCAL bCPValidFontFile( LPTSTR lpszFile,
  155. LPTSTR lpszDesc = NULL,
  156. WORD FAR *lpwType = NULL,
  157. BOOL bFOTOK = FALSE,
  158. LPDWORD lpdwStatus = NULL);
  159. //
  160. // PUTIL.CPP
  161. //
  162. extern BOOL FAR PASCAL bCPSetupFromSource( );
  163. extern BOOL FAR PASCAL bCPIsHelp( WORD message );
  164. extern BOOL FAR PASCAL bCPIsBrowseDone( WORD message );
  165. extern RC FAR PASCAL rcCPLoadFontList( );
  166. extern VOID FAR PASCAL vCPHelp( HWND );
  167. extern VOID FAR PASCAL vCPStripBlanks( LPTSTR lpszString );
  168. extern VOID FAR PASCAL vCPUpdateSourceDir( );
  169. extern VOID FAR PASCAL vCPWinIniFontChange( );
  170. extern VOID FAR PASCAL vCPPanelInit( );
  171. extern LPTSTR FAR PASCAL lpCPBackSlashTerm( LPTSTR lpszPath );
  172. extern BOOL bFileIsInFontsDirectory(LPCTSTR lpszPath);
  173. extern int FAR PASCAL DoDialogBoxParam( int nDlg,
  174. HWND hParent,
  175. DLGPROC lpProc,
  176. DWORD dwHelpContext,
  177. LPARAM dwParam);
  178. #ifdef WINNT
  179. extern HANDLE PASCAL wCPOpenFileWithShare( LPTSTR, LPTSTR, WORD );
  180. #else
  181. extern WORD FAR PASCAL wCPOpenFileWithShare( LPTSTR, LPOFSTRUCT, WORD );
  182. #endif // WINNT
  183. extern UINT MyAnsiReadFile( HANDLE hFile,
  184. UINT uCodePage,
  185. LPVOID lpUnicode,
  186. DWORD cchUnicode );
  187. extern UINT MyAnsiWriteFile( HANDLE hFile,
  188. UINT uCodePage,
  189. LPVOID lpUnicode,
  190. DWORD cchUnicode );
  191. extern UINT MyByteReadFile( HANDLE hFile, LPVOID lpBuffer, DWORD nBytes );
  192. extern UINT MyByteWriteFile( HANDLE hFile, LPVOID lpBuffer, DWORD nBytes );
  193. extern BOOL MyCloseFile( HANDLE hFile );
  194. extern LONG MyFileSeek( HANDLE hFile, LONG lDistanceToMove, DWORD dwMoveMethod );
  195. extern HANDLE MyOpenFile( LPTSTR lpszFile, TCHAR * lpszPath, DWORD fuMode );
  196. VOID CentreWindow( HWND hwnd );
  197. typedef struct _StringObject {
  198. HANDLE h;
  199. DWORD dwLen;
  200. } StringObject;
  201. extern BOOL FAR PASCAL AddStringToObject( StringObject&, LPTSTR, WORD );
  202. #define ASO_GLOBAL 0x0001
  203. #define ASO_FIXED 0x0002
  204. #define ASO_EXACT 0x0004
  205. #define ASO_COMPACT 0x0008
  206. #ifdef ROM
  207. extern HANDLE FAR PASCAL IsROMModule( LPTSTR lpName, BOOL fSelector );
  208. #endif
  209. LPVOID AllocMem( DWORD cb );
  210. BOOL FreeMem( LPVOID pMem, DWORD cb );
  211. LPVOID ReallocMem( LPVOID lpOldMem, DWORD cbOld, DWORD cbNew );
  212. LPTSTR AllocStr( LPTSTR lpStr );
  213. BOOL FreeStr( LPTSTR lpStr );
  214. BOOL ReallocStr( LPTSTR *plpStr, LPTSTR lpStr );
  215. /* t1.cpp */
  216. BOOL CheckT1Install( LPTSTR pszDesc, LPTSTR pszData );
  217. BOOL DeleteT1Install( HWND hwndParent, LPTSTR pszDesc, BOOL bDeleteFiles );
  218. BOOL EnumType1Fonts( HWND hLBox );
  219. BOOL GetT1Install( LPTSTR pszDesc, LPTSTR pszPfmFile, LPTSTR pszPfbFile );
  220. int InstallT1Font( HWND hwndParent, BOOL bCopyTTFile, BOOL bCopyType1Files,
  221. BOOL bInSharedDir, LPTSTR szPfmName, LPTSTR szDesc );
  222. HWND InitProgress( HWND hwnd );
  223. BOOL InstallCancelled(void);
  224. void InitPSInstall( );
  225. BOOL IsPSFont( LPTSTR lpszKey, LPTSTR lpszDesc, LPTSTR lpszPfm, LPTSTR lpszPfb,
  226. BOOL *pbCreatedPFM, LPDWORD lpdwStatus = NULL );
  227. BOOL OkToConvertType1ToTrueType(LPCTSTR pszFontDesc, LPCTSTR pszPFB, HWND hwndParent);
  228. BOOL ExtractT1Files( LPTSTR pszMulti, LPTSTR pszPfmFile, LPTSTR pszPfbFile );
  229. void Progress2( int PercentDone, LPTSTR szDesc );
  230. void RemoveDecoration( LPTSTR pszDesc, BOOL bDeleteTrailingSpace );
  231. void ResetProgress( );
  232. void TermProgress( );
  233. void TermPSInstall( );
  234. void UpdateProgress( int iTotalCount, int iFontInstalling, int iProgress );
  235. BOOL WriteType1RegistryEntry( HWND hwndParent, LPTSTR szDesc, LPTSTR szPfmName,
  236. LPTSTR szPfbName, BOOL bInFontsDir );
  237. HWND GetFirstAncestor( HWND hWnd );
  238. #ifdef WINNT
  239. BOOL BuildType1FontResourceName(LPCTSTR pszPfm, LPCTSTR pszPfb,
  240. LPTSTR pszDest, DWORD cchDest);
  241. #define MAX_TYPE1_FONT_RESOURCE (MAX_PATH * 2) // 2 paths + separator.
  242. #endif // WINNT
  243. #ifdef __cplusplus
  244. }
  245. #endif
  246. #endif
  247. /****************************************************************************
  248. * $lgb$
  249. * 1.0 7-Mar-94 eric Initial revision.
  250. * $lge$
  251. *
  252. ****************************************************************************/