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.

1103 lines
30 KiB

  1. /****************************************************************************\
  2. *
  3. * WIFE.H : East Asia Windows Intelligent Font Environment definitions
  4. *
  5. ******************************************************************************
  6. *
  7. * History:
  8. * 21-Oct-1991 bent
  9. * initial merge of East Asia 3.0 versions
  10. * Should be updated to resolve local inconsistencies.
  11. *
  12. * Copyright (c) 1990 Microsoft Corporation
  13. *
  14. * Brief instruction
  15. * -----------------
  16. *
  17. * This header file is a common single header for WIFE drivers. *
  18. * If you are a developer of FontDriver, please write coding as follow *
  19. *
  20. * #define WIFE_CREATE_FONTDRIVER *
  21. * #include <wife.h> *
  22. *
  23. * If you are a developer of DeviceDriver which are display or printer
  24. * drivers, please write coding as follow. *
  25. *
  26. * #define WIFE_CREATE_DEVICEDRIVER *
  27. * #include <wife.h> *
  28. *
  29. * If you don't define both of symbols, only common defenitions are
  30. * available.
  31. *
  32. * Aug.17,1990 Akira Kawamata [AkiraK] *
  33. *
  34. \****************************************************************************/
  35. /****** OS/2-like common data type definitions ******************************/
  36. #ifndef WIFEH_NODATATYPES
  37. typedef unsigned short int USHORT;
  38. typedef short int SHORT;
  39. typedef unsigned long ULONG;
  40. typedef LONG FAR * LPLONG;
  41. typedef LONG NEAR * NPLONG;
  42. typedef ULONG FAR * LPULONG;
  43. typedef ULONG NEAR * NPULONG;
  44. typedef SHORT FAR * LPSHORT;
  45. typedef SHORT NEAR * NPSHORT;
  46. typedef USHORT FAR * LPUSHORT;
  47. typedef USHORT NEAR * NPUSHORT;
  48. typedef char CHAR;
  49. typedef unsigned char UCHAR;
  50. typedef VOID NEAR * NPVOID;
  51. /* FIXED Number */
  52. typedef struct {
  53. USHORT Fraction;
  54. SHORT Integer;
  55. } FIXED;
  56. #endif //WIFEH_NODATATYPES
  57. /****** Graphics handling support definitions *******************************/
  58. #ifndef WIFEH_NOGRAPHSUPPORT
  59. /* rotation angle by 90degree */
  60. typedef enum {
  61. ANGLE000 = 0,
  62. ANGLE090 = 1,
  63. ANGLE180 = 2,
  64. ANGLE270 = 3
  65. } QUOTER_ANGLE;
  66. #define FixedToQuoterAngle(f) ((f.Integer/90)%4)
  67. #define RotationToQuoterAngle(r) ((r/900)%4)
  68. typedef DWORD PACKEDPOINT;
  69. typedef DWORD PACKEDLOGICALPOINT;
  70. typedef DWORD PACKEDPHYSICALPOINT;
  71. typedef struct {
  72. short x,y;
  73. } XYPOINT;
  74. typedef union {
  75. PACKEDPOINT packed;
  76. XYPOINT point;
  77. } UNIONPOINT, NEAR * NPUNIONPOINT, FAR * LPUNIONPOINT;
  78. #define PartOfX(xy) ((SHORT)(xy))
  79. #define PartOfY(xy) ((SHORT)(((DWORD)(xy) >> 16) & 0xFFFF))
  80. #define MAKELONG_LO_HI MAKELONG
  81. #define PackXY(x,y) ((DWORD)MAKELONG_LO_HI((WORD)x,(WORD)y))
  82. #endif //WIFEH_NOGRAPHSUPPORT
  83. /****** UBCS : Unified Byte Character Set, data types defenition **********/
  84. #ifndef WIFEH_NOUBCS
  85. typedef USHORT UBCHAR;
  86. typedef UBCHAR NEAR * NPUBCHAR;
  87. typedef UBCHAR FAR * LPUBCHAR;
  88. #define UBEOS (0) /* End Of String */
  89. #define UBNEWLINE (0x0a0d) /* New Line (CR/LF) */
  90. #define IsSbcsUBChar(uc) ((uc & 0xff00) == 0x2000)
  91. #define IsDbcsUBChar(uc) ((uc & 0xff00) != 0x2000)
  92. #endif //WIFEH_NOUBCS
  93. /****** Utility macros *****************************************************/
  94. #ifndef WIFEH_NOUTILITYMACROS
  95. /* return type of GlobalLock is LPSTR, but it's to be LPVOID */
  96. #define AnyGlobalLock(h) ((LPVOID)GlobalLock(h))
  97. #define AnyLocalLock(h) ((NPVOID)LocalLock(h))
  98. #define TypedLocalLock(h,t) ((t NEAR *)LocalLock(h))
  99. #define TypedGlobalLock(h,t) ((t FAR *)GlobalLock(h))
  100. /* utility macro which is not included windows.h */
  101. #define MAKEWORD(l,h) ((WORD)((BYTE)l+(((BYTE)h) << 8)))
  102. #endif //WIFEH_NOUTILITYMACROS
  103. /****** GDIDEFS.H support definitions **************************************/
  104. #ifdef WIFE_ENABLE_GDIDEFS_SUPPORT
  105. typedef FONTINFO FAR * LPFONTINFO;
  106. typedef DRAWMODE FAR * LPDRAWMODE;
  107. typedef TEXTXFORM FAR * LPTEXTXFORM;
  108. #endif //WIFE_ENABLE_GDIDEFS_SUPPORT
  109. /****** Character set definitions ******************************************/
  110. #ifndef WIFEH_NOCHARSET
  111. typedef enum {
  112. CHARSET_ANSI = 0,
  113. CHARSET_SYMBOL = 2,
  114. CHARSET_SHIFTJIS = 128,
  115. CHARSET_KOREA = 129,
  116. CHARSET_CHINESEBIG5 = 136,
  117. CHARSET_OEM = 255
  118. } CHAR_SET;
  119. #endif //WIFEH_NOCHARSET
  120. /***************************************************************************/
  121. /****** Control function support definitions ******************************/
  122. #ifndef WIFEH_NOCONTROL
  123. /******************************************/
  124. /* FONT DRIVER MEDIA DESCRIPTER */
  125. /******************************************/
  126. #ifndef WIFEWH_NOMEDIA
  127. /* FDMEDIA enumration type */
  128. typedef enum {
  129. FDMEDIA_ON_FILE = 1,
  130. FDMEDIA_ON_DRIVER = 2,
  131. FDMEDIA_ON_REMOVEABLE_HARDWARE = 4,
  132. FDMEDIA_ON_FIXED_HARDWARE = 8,
  133. FDMEDIA_UNDEFINED = 0x4000,
  134. FDMEDIA_ANY_MEDIA = 0x7fff
  135. } FDMEDIA;
  136. #endif
  137. /******************************************/
  138. /* MINOR CHARACTER SETS DEFENITION */
  139. /******************************************/
  140. #ifndef WIFEH_NOMINORCHARSET_IN_JAPAN
  141. /* general default minor character set */
  142. #define FD_MINOR_CHARSET_DEFAULT 1
  143. /* Minor Character Set in Japan */
  144. #define FD_MINOR_CHARSET_NEW_JIS 1 /* new JIS */
  145. #define FD_MINOR_CHARSET_OLD_JIS 2 /* old JIS */
  146. #define FD_MINOR_CHARSET_IBM_JIS 4 /* IBM JIS */
  147. #define FD_MINOR_CHARSET_NEC_JIS 8 /* NEC JIS */
  148. #endif
  149. /******************************************/
  150. /* CODE AREA STRUCTURE */
  151. /******************************************/
  152. #ifndef WIFEH_NOCODEAREA
  153. typedef struct {
  154. UBCHAR CodeFrom;
  155. UBCHAR CodeTo;
  156. } CODEAREA, NEAR * NPCODEAREA, FAR * LPCODEAREA;
  157. #endif
  158. /******************************************/
  159. /* SPECIAL ESCAPE FUNCTION ORDERS */
  160. /******************************************/
  161. /* subfunction orders in WIFE */
  162. #define FD_CONTROL_RESERVED (0xa20)
  163. #define FD_CONTROL_RESERVED_LIMIT (FD_CONTROL_RESERVED+0x3f)
  164. /* standard subfunctions */
  165. #define FD_CONTROL_QUERY_ESC_SUPPORT (FD_CONTROL_RESERVED+0)
  166. #define FD_CONTROL_SUPPORT_CODES (FD_CONTROL_RESERVED+1)
  167. #define FD_CONTROL_NUMBER_OF_ATTRIBUTE (FD_CONTROL_RESERVED+2)
  168. #define FD_CONTROL_NAME_OF_ATTRIBUTE (FD_CONTROL_RESERVED+3)
  169. #define FD_CONTROL_SET_ATTRIBUTE (FD_CONTROL_RESERVED+4)
  170. #define FD_CONTROL_GET_ATTRIBUTE (FD_CONTROL_RESERVED+5)
  171. #define FD_CONTROL_SET_MINOR_CHARSET (FD_CONTROL_RESERVED+6)
  172. #define FD_CONTROL_GET_MINOR_CHARSET (FD_CONTROL_RESERVED+7)
  173. #define FD_CONTROL_GET_FONT_DRIVER_NAME (FD_CONTROL_RESERVED+8)
  174. #define FD_CONTROL_GET_FONT_PACK_NAME (FD_CONTROL_RESERVED+9)
  175. #define FD_CONTROL_GET_MEDIA (FD_CONTROL_RESERVED+10)
  176. #define FD_CONTROL_GET_DBCS_STRING_KERN (FD_CONTROL_RESERVED+11)
  177. /* EUDC related subfunctions */
  178. #define FD_CONTROL_LEVEL2_EUDC_INFO (FD_CONTROL_RESERVED+12)
  179. /* private interface subfunctions */
  180. #define FD_CONTROL_USER (FD_CONTROL_RESERVED+0x10)
  181. #define FD_CONTROL_USER_LIMIT (FD_CONTROL_RESERVED+0x1f)
  182. /* Chinese related functions */
  183. #define FD_CONTROL_GET_USERFONT_TECH (FD_CONTROL_RESERVED+0x20)
  184. #define FD_CONTROL_SET_USERFONT (FD_CONTROL_RESERVED+0x21)
  185. #define FD_CONTROL_SETUP_DIALOG (FD_CONTROL_RESERVED+0x22)
  186. #define FD_CONTROL_SET_DEFAULT_CHAR (FD_CONTROL_RESERVED+0x23)
  187. #ifdef WIFE_ENABLE_EUDC_SUPPORT
  188. typedef struct {
  189. ULONG cb; /* length of this structure */
  190. BOOL bForceFixedPitch; /* force fixed pitch */
  191. BOOL bVerticalFont; /* vertical font flag */
  192. FIXED fxCharRot; /* character rotation */
  193. FIXED fxInlineDir; /* inline rotation */
  194. USHORT usLimitWidth; /* maximum width of cachable */
  195. SHORT sFixedASpace; /* font width when bForceFixedPitch is TRUE */
  196. USHORT usFixedBSpace; /* font width when bForceFixedPitch is TRUE */
  197. SHORT sFixedCSpace; /* font width when bForceFixedPitch is TRUE */
  198. } EUDC_CONTEXT, NEAR * NPEUDC_CONTEXT, FAR * LPEUDC_CONTEXT;
  199. #endif
  200. #endif
  201. #ifndef WIFEH_NOFDCOMMONDEFENITION
  202. typedef LONG HFF;
  203. typedef LONG HFC;
  204. typedef HANDLE HFD;
  205. typedef HANDLE HFB;
  206. #define FACESIZE 32
  207. #define GLYPHNAMESIZE 16
  208. #define WIFEERR_FACENAME_NOT_FOUND 23004L
  209. #define WIFEERR_FD_ALREADY_INSTALLED 23005L
  210. #define WIFEERR_INVALID_CONTEXTINFO 23006L
  211. #define WIFEERR_NOT_A_FONT_FILE 23007L
  212. #define WIFEERR_INVALID_FONT_SELECTION 23008L
  213. #define WIFEERR_INVALID_FORMAT 23009L
  214. #define WIFEERR_BUSY_HFC 230010L
  215. #define WIFEERR_INVALID_HFC 230011L
  216. #define WIFEERR_INVALID_INDEX 230012L
  217. #define WIFEERR_INVALID_QUERY_TYPE 230013L
  218. #define WIFEERR_CONTEXT_NOT_SET 230014L
  219. #define FD_QUERY_ABC_WIDTHS 2L
  220. #define FD_QUERY_KERNINGPAIRS 3L
  221. #define FD_QUERY_CHARIMAGE 1L
  222. #define FD_QUERY_OUTLINE 2L
  223. #define FD_QUERY_BITMAPMETRICS 4L
  224. typedef UBCHAR GLYPH; /* gi */
  225. typedef LPUBCHAR LPGLYPH; /* lpgi */
  226. typedef struct _POINTFX { /* ptfx, npptfx, lpptfx */
  227. FIXED x;
  228. FIXED y;
  229. } POINTFX, NEAR * NPPOINTFX, FAR * LPPOINTFX;
  230. typedef struct _ABC_TRIPLETS { /* abc, npabc, lpabc */
  231. SHORT sA;
  232. USHORT usB;
  233. SHORT sC;
  234. } ABC_TRIPLETS, NEAR * NPABC_TRIPLETS, FAR * LPABC_TRIPLETS;
  235. typedef struct _SIZEL { /* sizl */
  236. ULONG cx; // Width.
  237. ULONG cy; // Height.
  238. } SIZEL;
  239. typedef struct _BITMAPMETRICS { /* bmm, npbmm, lpbmm */
  240. SIZEL sizlExtent;
  241. POINTFX pfxOrigin; /* Return character origin. */
  242. POINTFX pfxCharInc; /* Return the device advance width */
  243. } BITMAPMETRICS, NEAR * NPBITMAPMETRICS, FAR * LPBITMAPMETRICS;
  244. typedef struct _MAT2 { /* mat */
  245. FIXED eM11;
  246. FIXED eM12;
  247. FIXED eM21;
  248. FIXED eM22;
  249. } MAT2;
  250. typedef struct _FD_KERNINGPAIRS { /* krnpr, npkrnpr, lpkrnpr */
  251. GLYPH giFirst;
  252. GLYPH giSecond;
  253. LONG eKerningAmount;
  254. } FD_KERNINGPAIRS, NEAR * NPFD_KERNINGPAIRS, FAR * LPFD_KERNINGPAIRS;
  255. typedef struct _CONTEXTINFO { /* ci */
  256. ULONG cb; /* Length in bytes of this structure. */
  257. ULONG fl; /* Flags. */
  258. SIZEL sizlPPM; /* Device resolution in pels/meter. */
  259. POINTFX pfxSpot; /* Spot size in pels. */
  260. MAT2 matXform; /* Notional to Device transform. */
  261. } CONTEXTINFO, NEAR * NPCONTEXTINFO, FAR * LPCONTEXTINFO;
  262. typedef struct _CHARATTR { /* chattr */
  263. ULONG cb;
  264. ULONG iQuery; /* Query type. */
  265. GLYPH gi; /* Glyph index in font. */
  266. LPBYTE lpBuffer; /* Bitmap buffer. */
  267. ULONG cbLen; /* Size of buffer in bytes. */
  268. } CHARATTR, NEAR * NPCHARATTR, FAR * LPCHARATTR;
  269. /* bit-constants for fsType in IFIMETRICS */
  270. #define IFIMETRICS_FIXED 0x0001 /* Fixed pitch */
  271. #define IFIMETRICS_LICENSED 0x0002 /* dummy defenition */
  272. #define IFIMETRICS_SPARSE 0x0004 /* Incomplete font */
  273. #define IFIMETRICS_SCALEABLE 0x8000 /* scalable font */
  274. /* bit-constant for fsDefn in IFIMETRICS */
  275. #define IFIMETRICS_OUTLINE 0x0001 /* dummy definition */
  276. /* 1 - Outline. 0 - Raster */
  277. /* bit-constant for fsSelection in IFIMETRICS */
  278. #define IFIMETRICS_ITALIC 0x8000 /*Italic */
  279. #define IFIMETRICS_UNDERSCORE 0x4000 /*Underscored */
  280. #define IFIMETRICS_OVERSTRUCK 0x2000 /*Overstruck */
  281. /* bit-constant for fsSelection in IFIMETRICS valid for bitmap fonts */
  282. #define IFIMETRICS_NEGATIVE 0x1000 /*Negative image */
  283. #define IFIMETRICS_HOLLOW 0x0800 /*Outline (hollow) */
  284. typedef struct _IFIMETRICS { /* ifim */
  285. /* UNITS */
  286. UCHAR szFamilyname[FACESIZE]; /*Font Family Name, e.g. Roman */
  287. UCHAR szFacename[FACESIZE]; /*Face name, e.g. Tms Rmn Bold Italic */
  288. UCHAR szGlyphlistName[GLYPHNAMESIZE]; /*e.g. PM316, Latin-2, Greek */
  289. USHORT idRegistry; /*Dummy I */
  290. SHORT sCapEmHeight; /*Height of uppercase M N */
  291. SHORT sXHeight; /*Nominal height of lowercase N */
  292. SHORT sMaxAscender; /*Maximum height above baseline of any char N */
  293. SHORT sMaxDescender; /*Maximum depth below baseline of any char N */
  294. SHORT sLowerCaseAscent; /*Maximum height above baseline of any a-z N */
  295. SHORT sLowerCaseDescent; /*Maximum depth below basiline of any a-z N */
  296. SHORT sInternalLeading; /*White space within character N */
  297. SHORT sExternalLeading; /*White space between lines N */
  298. SHORT sAveCharWidth; /*Weighted average character width N */
  299. SHORT sMaxCharInc; /*Maximum character increment N */
  300. SHORT sEmInc; /*Increment for Capitals (typically 'M') N */
  301. SHORT sMaxBaselineExt; /*Height of character cell N */
  302. FIXED fxCharSlope; /*Slope angle, degrees, clockwise D */
  303. FIXED fxInlineDir; /*Drawing direction, degrees clockwise D */
  304. FIXED fxCharRot; /*Glyph rotation in cell, degrees clockwise D */
  305. USHORT usWeightClass; /*Character weight, 1-9 (1=ultra-light) I */
  306. USHORT usWidthClass; /*Character width, 1-9 (1=ultra condensed) I */
  307. SHORT sEmSquareSize; /*Em Square size, x-direction N */
  308. GLYPH giFirstChar; /*Number of first glyph in font I */
  309. GLYPH giLastChar; /*Number of last glyph in font I */
  310. GLYPH giDefaultChar; /*Glyph used if requested glyph invalid I */
  311. GLYPH giBreakChar; /*Space glyph I */
  312. ULONG aulPanose [1]; /*Panose Number */
  313. USHORT usNominalPointSize; /*Point size for which font was designed N */
  314. USHORT usMinimumPointSize; /*Minimum point size scaling for font N */
  315. USHORT usMaximumPointSize; /*Maximum point size scaling for font N */
  316. USHORT fsType; /*Type indicators (see #defines) B */
  317. USHORT fsDefn; /*Font definition data (see #defines) B */
  318. USHORT fsSelection; /*Font selection flags (see #defines) B */
  319. USHORT fsCapabilities; /*Font capabilities must be 0 B */
  320. SHORT sSubscriptXSize; /*Size in x-direction of subscript N */
  321. SHORT sSubscriptYSize; /*Size in y-direction of subscript N */
  322. SHORT sSubscriptXOffset; /*Offset in x-direction of subscript N */
  323. SHORT sSubscriptYOffset; /*Offset in y-direction of subscript N */
  324. SHORT sSuperscriptXSize; /*Size in x-direction of superscript N */
  325. SHORT sSuperscriptYSize; /*Size in y-direction of superscript N */
  326. SHORT sSuperscriptXOffset; /*Offset in x-direction of superscript N */
  327. SHORT sSuperscriptYOffset; /*Offset in y-direction of superscript N */
  328. SHORT sUnderscoreSize; /*Underscore size N */
  329. SHORT sUnderscorePosition; /*Underscore position N */
  330. SHORT sStrikeoutSize; /*Strikeout size N */
  331. SHORT sStrikeoutPosition; /*Strikeout position N */
  332. SHORT cKerningPairs; /*Number of kerning pairs in pair table I */
  333. ULONG ulFontClass; /*IBM font classification B */
  334. } IFIMETRICS, NEAR * NPIFIMETRICS, FAR * LPIFIMETRICS;
  335. #ifdef ENABLE_CONTROL_TAG
  336. /* Tag structure for Fd(i)Control */
  337. typedef struct {
  338. USHORT SubFunction;
  339. LPDEVICE lpDevice;
  340. LPFONTINFO lpFontStructure;
  341. LPTEXTXFORM lpXform;
  342. LPVOID lpInData;
  343. } CONTROLTAG, FAR * LPCONTROLTAG;
  344. #else
  345. typedef struct {
  346. USHORT SubFunction;
  347. LPVOID lpDevice;
  348. LPVOID lpFontStructure;
  349. LPVOID lpXform;
  350. LPVOID lpInData;
  351. } CONTROLTAG, FAR * LPCONTROLTAG;
  352. #endif
  353. #endif
  354. /****************************************/
  355. /* Attribute bits for FdOpenFontContext */
  356. /****************************************/
  357. #ifndef WIFEH_NOWIFEMAN_EUDCFONTCONTEXT
  358. #define OFC_EUDC_CONTEXT (0x80000000L)
  359. #endif
  360. #ifdef WIFE_CREATE_FONTDRIVER
  361. /***********************************************/
  362. /* PROTO-TYPE FOR EACH FUNCTION in FONT DRIVER */
  363. /***********************************************/
  364. LONG FAR PASCAL FdClaimFontFile( LPSTR lpszFileName );
  365. LONG FAR PASCAL FdConvertFontFile(
  366. LPSTR lpszSrcFileName,
  367. LPSTR lpszDestDirName,
  368. LPSTR lpszResultPackName
  369. );
  370. HFF FAR PASCAL FdLoadFontFile( LPSTR lpszPackName );
  371. LONG FAR PASCAL FdUnloadFontFile( HFF hFF );
  372. LONG FAR PASCAL FdQueryFaces(
  373. HFF hFF,
  374. LPIFIMETRICS lpIfiMetrics,
  375. ULONG cMetricLen,
  376. ULONG cFontCount,
  377. ULONG cStart
  378. );
  379. HFC FAR PASCAL FdOpenFontContext( HFF hFF, ULONG ulFont );
  380. LONG FAR PASCAL FdSetFontContext(
  381. HFC hFC,
  382. LPCONTEXTINFO lpContextInfo
  383. );
  384. LONG FAR PASCAL FdCloseFontContext( HFC hFC );
  385. LONG FAR PASCAL FdQueryFaceAttr(
  386. HFC hFC,
  387. ULONG iQuery,
  388. LPVOID lpBuffer,
  389. ULONG cb,
  390. LPVOID lpIndex,
  391. SHORT Start
  392. );
  393. LONG FAR PASCAL FdQueryCharAttr(
  394. HFC hFC,
  395. LPCHARATTR lpCharAttr,
  396. LPBITMAPMETRICS lpbmm
  397. );
  398. SHORT FAR PASCAL FdControl(
  399. HFC hFC,
  400. LPCONTROLTAG lpControlTag,
  401. LPVOID lpOutData
  402. );
  403. /******************************************/
  404. /* FAR PTR TO EACH FUNCTION */
  405. /******************************************/
  406. typedef LONG (FAR PASCAL * LPFDCLF)( LPSTR lpszFileName );
  407. typedef LONG (FAR PASCAL * LPFDCFF)(
  408. LPSTR lpszSrcFileName,
  409. LPSTR lpszDestDirName,
  410. LPSTR lpszResultPackName
  411. );
  412. typedef HFF (FAR PASCAL * LPFDLFF)( LPSTR lpszPackName );
  413. typedef LONG (FAR PASCAL * LPFDQF)(
  414. HFF hFF,
  415. LPIFIMETRICS lpIfiMetrics,
  416. ULONG cMetricLen,
  417. ULONG cFontCount,
  418. ULONG cStart
  419. );
  420. typedef LONG (FAR PASCAL * LPFDUFF)( HFF hFF );
  421. typedef HFC (FAR PASCAL * LPFDOFC)( HFF hFF, ULONG ulFont );
  422. typedef LONG (FAR PASCAL * LPFDSFC)(
  423. HFC hFC,
  424. LPCONTEXTINFO lpContextInfo
  425. );
  426. typedef LONG (FAR PASCAL * LPFDCFC)( HFC hFC );
  427. typedef LONG (FAR PASCAL * LPFDQFA)(
  428. HFC hFC,
  429. ULONG iQuery,
  430. LPVOID lpBuffer,
  431. ULONG cb,
  432. LPVOID lpIndex,
  433. SHORT Start
  434. );
  435. typedef LONG (FAR PASCAL * LPFDQCA)(
  436. HFC hFC,
  437. LPCHARATTR lpCharAttr,
  438. LPBITMAPMETRICS lpbmm
  439. );
  440. typedef SHORT (FAR PASCAL * LPFDCTL)(
  441. HFC hFC,
  442. LPCONTROLTAG lpControlTag,
  443. LPVOID lpOutData
  444. );
  445. typedef struct _FDHEADER { /* fdhdr */
  446. ULONG cbLength; /* Length of FDHEADER */
  447. UCHAR strId[16]; /* String 'WIFE FONT DRIVER' */
  448. UCHAR szTechnology[40]; /* Identifier of Font Driver technology */
  449. ULONG ulVersion; /* IFI version number (0x0100) */
  450. ULONG ufDeviceCaps; /* Capabilities of device */
  451. NPVOID npfddisp;
  452. SHORT dummy1;
  453. } FDHEADER, NEAR * NPFDHEADER, FAR * LPFDHEADER;
  454. #endif
  455. #ifdef WIFE_CREATE_DEVICEDRIVER
  456. /***********************************************/
  457. /* PROTO-TYPE FOR EACH FUNCTION in WIFEMAN.DLL */
  458. /***********************************************/
  459. /***********************************************/
  460. /* Module Install Manager */
  461. /***********************************************/
  462. #ifndef WIFEH_NOWIFEMAN_MIM
  463. typedef BOOL (FAR PASCAL * LPCBMEAD)
  464. ( LPSTR lpszFoundFileName, LPSTR lpszDescriptionName );
  465. BOOL FAR PASCAL MimEnumAvailableDrivers
  466. ( LPSTR lpszSeachFilePath, LPCBMEAD lpfCallBack );
  467. typedef BOOL (FAR PASCAL * LPCBMEAP)
  468. ( HFD hFD, LPSTR lpszPackName );
  469. BOOL FAR PASCAL MimEnumAvailablePacks
  470. ( HFD hFD, LPSTR lpszPackName, LPCBMEAP lpfCallBack );
  471. HFD FAR PASCAL MimAddFontDriver( LPSTR lpszFileName );
  472. HFF FAR PASCAL MimAddFontPack( HFD hFD, LPSTR lpszPackName );
  473. BOOL FAR PASCAL MimRemoveFontDriver( HFD hFD );
  474. BOOL FAR PASCAL MimRemoveFontPack( HFD hFD, HFF hFontPack );
  475. HFD FAR PASCAL MimEnumFontDrivers( HFD hLastDriver );
  476. HFF FAR PASCAL MimEnumFontPacks( HFD hFD, HFF hLastPack );
  477. HFC FAR PASCAL MimOpenFontContext( HFD hFD, HFF hFF, ULONG ulFont );
  478. LONG FAR PASCAL MimCloseFontContext( HFD hFD, HFF hFF, HFC hFC );
  479. typedef enum {
  480. MIMGETINFO_FD_DESCRIPTION = 0,
  481. MIMGETINFO_FF_DESCRIPTION = 1,
  482. MIMGETINFO_FD_FILENAME = 2,
  483. MIMGETINFO_FF_FILENAME = 3,
  484. MIMGETINFO_FD_USAGE = 4,
  485. MIMGETINFO_FF_USAGE = 5,
  486. MIMGETINFO_FD_INSTALL_COUNT = 6,
  487. MIMGETINFO_FF_INSTALL_COUNT = 7
  488. } MIMGETINFO_ORDER;
  489. SHORT FAR PASCAL MimGetInformations(
  490. MIMGETINFO_ORDER order,
  491. HFD hFD,
  492. HFF hFF,
  493. LPVOID AnswerBuffer,
  494. USHORT SizeOfBuffer
  495. );
  496. #endif
  497. /***********************************************/
  498. /* Font Driver Interface */
  499. /***********************************************/
  500. #ifndef WIFEH_NOWIFEMAN_FDI
  501. LONG FAR PASCAL FdiClaimFontFile( HFD hFD, LPSTR lpszFileName );
  502. LONG FAR PASCAL FdiConvertFontFile(
  503. HFD hFD,
  504. LPSTR lpszSrcFileName,
  505. LPSTR lpszDestDirName,
  506. LPSTR lpszResultPackName
  507. );
  508. HFF FAR PASCAL FdiLoadFontFile( HFD hFD, LPSTR lpszPackName );
  509. LONG FAR PASCAL FdiUnloadFontFile( HFD hFD, HFF hFF );
  510. LONG FAR PASCAL FdiQueryFaces(
  511. HFD hFD,
  512. HFF hFF, // Font File handle
  513. LPIFIMETRICS lpIfiMetrics, // Buffer for the metrics
  514. ULONG cMetricLen, // Length of the metrics structure
  515. ULONG cFontCount, // # of fonts wanted.
  516. ULONG cStart // index of the font to start with
  517. );
  518. HFC FAR PASCAL FdiOpenFontContext( HFD hFD, HFF hFF, ULONG ulFont );
  519. LONG FAR PASCAL FdiSetFontContext(
  520. HFD hFD,
  521. HFC hFC,
  522. LPCONTEXTINFO lpContextInfo
  523. );
  524. LONG FAR PASCAL FdiCloseFontContext( HFD hFD, HFC hFC );
  525. LONG FAR PASCAL FdiQueryFaceAttr(
  526. HFD hFD,
  527. HFC hFC,
  528. ULONG iQuery,
  529. LPVOID lpBuffer,
  530. ULONG cb,
  531. LPVOID lpIndex,
  532. SHORT Start
  533. );
  534. LONG FAR PASCAL FdiQueryCharAttr(
  535. HFD hFD,
  536. HFC hFC,
  537. LPCHARATTR lpCharAttr,
  538. LPBITMAPMETRICS lpbmm
  539. );
  540. SHORT FAR PASCAL FdiControl(
  541. HFD hFD,
  542. HFC hFC,
  543. LPCONTROLTAG lpControlTag,
  544. LPVOID lpOutData
  545. );
  546. #endif
  547. /***********************************************/
  548. /* Font Cacheing Manager */
  549. /***********************************************/
  550. #ifdef WIFE_ENABLE_FCM
  551. #define FCM_WIFE_CHARACTER 1
  552. #define FCM_CLIP_OUT 2
  553. #define FCM_LEFT_CLIP 0x0100
  554. #define FCM_RIGHT_CLIP 0x0200
  555. #define FCM_TOP_CLIP 0x0400
  556. #define FCM_BOTTOM_CLIP 0x0800
  557. typedef struct {
  558. USHORT SizeOfStruct; /* size of structire */
  559. WORD WifeFlag; /* FCM processing flags */
  560. UBCHAR ubCode; /* character code */
  561. LPSTR lpCacheBuffer; /* long ptr to cache bitmap */
  562. SHORT nBitWidth; /* x size of character image */
  563. SHORT nBitHeight; /* y size of character image */
  564. SHORT nByteWidth; /* byte width size in alloctaed buffer */
  565. USHORT InternalIndex; /* RESERVED FOR SYSTEM USE */
  566. } FCM_CHARACTERISTIC, NEAR *NP_FCM_CHARACTERISTIC, FAR *LP_FCM_CHARACTERISTIC;
  567. typedef struct {
  568. USHORT SizeOfStruct; /* size of structire */
  569. WORD WifeFlag; /* FCM processing flags */
  570. UBCHAR ubCode; /* character code */
  571. LPSTR lpCacheBuffer; /* long ptr to cache bitmap */
  572. SHORT nBitWidth; /* x size of character image */
  573. SHORT nBitHeight; /* y size of character image */
  574. SHORT nByteWidth; /* byte width size in alloctaed buffer */
  575. USHORT InternalIndex; /* RESERVED FOR SYSTEM USE */
  576. SHORT xPosOnDst; /* x position on dst device */
  577. SHORT yPosOnDst; /* y position on dst device */
  578. } FCM_EXTCHARACTERISTIC,
  579. NEAR * NP_FCM_EXTCHARACTERISTIC, FAR * LP_FCM_EXTCHARACTERISTIC;
  580. HFB FAR PASCAL FcmCreateCacheBuffer(
  581. HFD hFD,
  582. HFF hFF,
  583. ULONG ulFont,
  584. LPTEXTXFORM lpXform,
  585. USHORT usMinorCharSet,
  586. USHORT usAttribute
  587. );
  588. BOOL FAR PASCAL FcmDeleteCacheBuffer( HFB hFontBuffer );
  589. SHORT FAR PASCAL FcmRequestImages(
  590. HFB hFontBuffer,
  591. LP_FCM_CHARACTERISTIC AnswerBuffer,
  592. short length
  593. );
  594. BOOL FAR PASCAL FcmReleaseImages(
  595. HFB hFontBuffer,
  596. LP_FCM_CHARACTERISTIC AnswerBuffer,
  597. short length
  598. );
  599. HFB FAR PASCAL FcmRequestDefaultFB(
  600. LPFONTINFO lpFont,
  601. LPTEXTXFORM lpTextXform
  602. );
  603. BOOL FAR PASCAL FcmReleaseDefaultFB( HFB hFB );
  604. #define FCMCALC_BIGFONT 1
  605. #define FCMCALC_ROUGHCLIPINFO 2
  606. #define FCMCALC_DETAILCLIPINFO 4
  607. DWORD FAR PASCAL FcmCalculateTextExtent(
  608. HFB hFB,
  609. LPSTR lpString,
  610. short count,
  611. LPFONTINFO lpFont,
  612. LPDRAWMODE lpDrawMode,
  613. LPTEXTXFORM lpXform,
  614. LPSHORT lpCharWidths,
  615. USHORT usMode
  616. );
  617. SHORT FAR PASCAL FcmCalculateOutputPositions(
  618. HFB hFB,
  619. LP_FCM_EXTCHARACTERISTIC lpFcmCharacteristics,
  620. SHORT nArrayLength,
  621. LPSHORT lpx,
  622. LPSHORT lpy,
  623. LPRECT lpClipRect,
  624. LPSTR FAR * lplpString,
  625. LPSHORT lpcount,
  626. LPFONTINFO lpFont,
  627. LPDRAWMODE lpDrawMode,
  628. LPTEXTXFORM lpXform,
  629. LPSHORT FAR * lplpCharWidths,
  630. USHORT usMode
  631. );
  632. SHORT FAR PASCAL FcmCleanUp( VOID );
  633. HFB FAR PASCAL FcmEnumFontBuffers( HFB hLastBuffer );
  634. HFC FAR PASCAL FcmGetFontContext( HFB hFB );
  635. SHORT FAR PASCAL FcmCalcByteWidth( SHORT nBitWidth );
  636. SHORT FAR PASCAL FcmForceCacheIn( HFB hFB, LPUBCHAR lpubStr );
  637. BOOL FAR PASCAL FcmValidateFC( HFB hFB );
  638. BOOL FAR PASCAL FcmUnvalidateFC( HFB hFB );
  639. LONG FAR PASCAL FcmQueryFaceAttr(
  640. HFB hFB,
  641. ULONG iQuery,
  642. LPABC_TRIPLETS lpBuffer,
  643. ULONG cb,
  644. LPUBCHAR lpIndex,
  645. UBCHAR Start
  646. );
  647. #ifdef WIFE_ENABLE_FCM_CONTROL
  648. SHORT FAR PASCAL FcmIsProcessableDeviceControl(
  649. HFB hFB,
  650. SHORT nFunction,
  651. GAIJIINFO FAR * lpGI
  652. );
  653. SHORT FAR PASCAL FcmProcessDeviceControl(
  654. HFB hFB,
  655. SHORT nFunction,
  656. GAIJIINFO FAR * lpGI,
  657. LPVOID lpOutData
  658. );
  659. #endif
  660. USHORT FAR PASCAL FcmGetEUDCLeadByteRange( HFB hFB );
  661. HFB FAR PASCAL FcmGetEUDCFB( HFB hFB );
  662. USHORT FAR PASCAL FcmGetCharWidth(
  663. HFB hFB,
  664. LPUSHORT lpBuffer,
  665. USHORT wFirstChar,
  666. USHORT wLastChar,
  667. LPFONTINFO lpFont,
  668. LPDRAWMODE lpDrawMode,
  669. LPTEXTXFORM lpFontTrans,
  670. USHORT usExpandPixels,
  671. USHORT usMode
  672. );
  673. #endif
  674. #endif
  675. /***********************************************/
  676. /* WIFEMAN's Miscellaneous Service Functions */
  677. /***********************************************/
  678. #ifndef WIFEH_NOWIFEMAN_MISC
  679. BOOL FAR PASCAL MiscIsDBCSLeadByte( CHAR_SET CharSet, USHORT ch );
  680. #define MiscIsMBCSCharSet(c) (MiscIsDBCSLeadByte(c,0xffff))
  681. VOID FAR PASCAL MiscSetErroInfo( ULONG ErrorCode );
  682. ULONG FAR PASCAL MiscGetErroInfo( VOID );
  683. SHORT FAR PASCAL MiscWarningMessage(
  684. HANDLE hInst,
  685. USHORT idsMsg,
  686. USHORT idsTitle,
  687. USHORT mode
  688. );
  689. SHORT FAR PASCAL MiscWarningMessageWithArgument(
  690. HANDLE hInst,
  691. USHORT idsMsg,
  692. USHORT idsTitle,
  693. LPSTR lpszArgument,
  694. USHORT mode
  695. );
  696. #ifdef ENABLE_MESSAGEBOX
  697. /* MessageBox() Flags */
  698. #define MB_OK 0x0000
  699. #define MB_OKCANCEL 0x0001
  700. #define MB_ABORTRETRYIGNORE 0x0002
  701. #define MB_YESNOCANCEL 0x0003
  702. #define MB_YESNO 0x0004
  703. #define MB_RETRYCANCEL 0x0005
  704. #define MB_ICONHAND 0x0010
  705. #define MB_ICONQUESTION 0x0020
  706. #define MB_ICONEXCLAMATION 0x0030
  707. #define MB_ICONASTERISK 0x0040
  708. #define MB_ICONINFORMATION MB_ICONASTERISK
  709. #define MB_ICONSTOP MB_ICONHAND
  710. #define MB_DEFBUTTON1 0x0000
  711. #define MB_DEFBUTTON2 0x0100
  712. #define MB_DEFBUTTON3 0x0200
  713. #define MB_APPLMODAL 0x0000
  714. #define MB_SYSTEMMODAL 0x1000
  715. #define MB_TASKMODAL 0x2000
  716. #define MB_NOFOCUS 0x8000
  717. #define MB_TYPEMASK 0x000F
  718. #define MB_ICONMASK 0x00F0
  719. #define MB_DEFMASK 0x0F00
  720. #define MB_MODEMASK 0x3000
  721. #define MB_MISCMASK 0xC000
  722. #endif /* ENABLE_MESSAGEBOX */
  723. USHORT FAR PASCAL ubstrlen( LPUBCHAR cp );
  724. LPUBCHAR FAR PASCAL ubstrcpy( LPUBCHAR dst, LPUBCHAR src );
  725. LPUBCHAR FAR PASCAL ubstrncpy( LPUBCHAR dst, LPUBCHAR src, USHORT limit );
  726. LPUBCHAR FAR PASCAL ubstrcat( LPUBCHAR dst, LPUBCHAR src );
  727. LPUBCHAR FAR PASCAL ubstrncat( LPUBCHAR dst, LPUBCHAR src, USHORT limit );
  728. SHORT FAR PASCAL ubstrcmp( LPUBCHAR str1, LPUBCHAR str2 );
  729. USHORT FAR PASCAL AscizToUz(
  730. LPUBCHAR dst,
  731. LPSTR src,
  732. USHORT limit,
  733. CHAR_SET CharSet
  734. );
  735. USHORT FAR PASCAL UzToAsciz(
  736. LPSTR dst,
  737. LPUBCHAR src,
  738. USHORT limit
  739. );
  740. VOID FAR PASCAL MiscTrancateString(
  741. LPSTR lpszStr,
  742. SHORT length,
  743. SHORT CharSet
  744. );
  745. #define MiscTrancateByDefaultCharSet(s,l) MiscTrancateString(s,l,-1)
  746. ULONG FAR PASCAL MiscGetVersion( VOID );
  747. USHORT FAR PASCAL MiscGetEUDCLeadByteRange( CHAR_SET csCharSet );
  748. BYTE FAR PASCAL MiscConvertFontFamily( LPSTR szFamilyName );
  749. BYTE FAR PASCAL MiscConvertCharSet( LPSTR CharSetString );
  750. #ifdef WIFE_ENABLE_FONT_STRUCT_CONVERT
  751. /* follow two values are only for usLogicalMapFlag parameter */
  752. /* in MiscIfiMetricsToLogFont function. */
  753. #define LOGMAP_IGNORE_DESCENT 1
  754. #define LOGMAP_IGNORE_INTERNAL_LEADING 2
  755. #define LOGMAP_NEGATIVE (0x8000)
  756. VOID FAR PASCAL MiscIfiMetricsToLogFont(
  757. LPLOGFONT lpLogFont,
  758. LPIFIMETRICS lpIFIMetrics,
  759. USHORT usLogicalMapFlag
  760. );
  761. VOID FAR PASCAL MiscIfiMetricsToTextMetrics(
  762. LPTEXTMETRIC lpTextMetrics,
  763. LPIFIMETRICS lpIFIMetrics
  764. );
  765. #endif
  766. #ifdef WIFE_ENABLE_FONT_STRUCT_MAKE
  767. VOID FAR PASCAL MiscMakeTextXform(
  768. LPTEXTXFORM lpTXF,
  769. LPIFIMETRICS lpIM,
  770. LPLOGFONT lpLF
  771. );
  772. #endif
  773. #ifndef WIFEH_NO_HUGE_SUPPORT
  774. LPVOID FAR PASCAL MiscAddHugePtr( LPVOID src, ULONG offset );
  775. USHORT FAR PASCAL MiscGetSegmentIncrement( VOID );
  776. #endif
  777. #ifndef WIFEH_NO_CONTROL_RANGES
  778. BOOL FAR PASCAL MiscIsWifeControl( SHORT function );
  779. BOOL FAR PASCAL MiscIsGaijiControl( SHORT function );
  780. #endif
  781. #ifndef WIFEH_NO_STRETCHER
  782. BOOL FAR PASCAL MiscStretchMonoFontImage(
  783. LPVOID lpDestImage,
  784. USHORT usSizeOfDestX,
  785. USHORT usSizeOfDestY,
  786. LPVOID lpSrcImage,
  787. USHORT usSizeOfSrcX,
  788. USHORT usSizeOfSrcY
  789. );
  790. #endif
  791. #ifdef WIFE_ENABLE_QUICK_SEARCH_TABLE
  792. typedef struct {
  793. HFD hFD;
  794. HFF hFF;
  795. ULONG ulFont;
  796. BOOL bScalable;
  797. LOGFONT LogFont;
  798. }QUICK_SEARCH_TABLE, NEAR * NP_QUICK_SEARCH_TABLE, FAR * LP_QUICK_SEARCH_TABLE;
  799. LP_QUICK_SEARCH_TABLE FAR PASCAL MiscValidateQuickSearchTable(
  800. USHORT usLogicalMapFlag
  801. );
  802. BOOL FAR PASCAL MiscUnvalidateQuickSearchTable(
  803. USHORT usLogicalMapFlag
  804. );
  805. typedef LP_QUICK_SEARCH_TABLE (FAR PASCAL * LPMISCVALIDATEQST)(
  806. USHORT usLogicalMapFlag
  807. );
  808. typedef BOOL (FAR PASCAL * LPMISCUNVALIDATEQST)(
  809. USHORT usLogicalMapFlag
  810. );
  811. #define NMISCVALIDATEQST (67)
  812. #define NMISCUNVALIDATEQST (68)
  813. #endif
  814. #ifdef WIFE_ENABLE_NOTIFY_FUNCTIONS
  815. typedef enum {
  816. WN_ADD_FONTDRIVER = 0,
  817. WN_ADD_FONTPACKAGE = 1,
  818. WN_REMOVE_FONTDRIVER = 2,
  819. WN_REMOVE_FONTPACKAGE = 3,
  820. WN_REGISTER_SYSTEM_EUDC_CHAR = 4,
  821. WN_CHANGE_SYSTEM_EUDC_FILE = 5
  822. } WIFENOTIFY_ORDER;
  823. typedef struct {
  824. HFD hTargetFontDriver;
  825. } WNS_FONTDRIVER;
  826. typedef struct {
  827. HFD hTargetFontDriver;
  828. HFF hTargetFontPackage;
  829. } WNS_FONTPACKAGE;
  830. typedef struct {
  831. HFD hTargetFontDriver;
  832. HFF hTargetFontPackage;
  833. UBCHAR ubRegistedCharCode;
  834. } WNS_REGISTER_SYSTEM_EUDC_CHAR;
  835. typedef struct {
  836. HFD hTargetFontDriver;
  837. HFF hTargetFontPackage;
  838. LPSTR lpszNewFileName;
  839. } WNS_WN_CHANGE_SYSTEM_EUDC_FILE;
  840. typedef BOOL (FAR PASCAL * LPNOTIFYCALLBACKFUNC)(
  841. WIFENOTIFY_ORDER NotifyOrder,
  842. LPVOID lpParamBlock
  843. );
  844. BOOL FAR PASCAL MiscRegisterNotifyFunction(
  845. LPNOTIFYCALLBACKFUNC lpfnCallBack
  846. );
  847. BOOL FAR PASCAL MiscUnregisterNotifyFunction(
  848. LPNOTIFYCALLBACKFUNC lpfnCallBack
  849. );
  850. #endif
  851. #endif
  852. /***********************************************/
  853. /* DIAGNOSTIC TEST&CHECKING FUNCTIONS */
  854. /***********************************************/
  855. #ifdef ENABLE_DIAGNOSTIC_FUNCTION
  856. /* test and return error code */
  857. SHORT FAR PASCAL DiagSelfCheck( VOID );
  858. /* invoke self test and make error record file, display warning dialog */
  859. SHORT FAR PASCAL DiagSelfCheckAndWarning( VOID );
  860. #endif
  861. /************************************************/
  862. /* THESE ARE PRIVATE INTERFACE FOR TEST PROGRAM */
  863. /************************************************/
  864. #ifdef ENABLE_TEST_PROGRAM_INTERFACE
  865. LPVOID FAR PASCAL DiagLocalLockAnything( LOCALHANDLE hAny );
  866. LPVOID FAR PASCAL DiagLocalUnlockAnything( LOCALHANDLE hAny );
  867. SHORT FAR PASCAL DiagGetConfirmString( LPSTR buffer, SHORT length );
  868. #endif
  869. /* end of wife.h */