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.

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