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.

628 lines
28 KiB

  1. /* ***************************************************************************** */
  2. /* * DTI header file Created 12/3/1993 AVP Last modified 3/30/1998 * */
  3. /* ***************************************************************************** */
  4. #ifndef DTI_H_INCLUDED
  5. #define DTI_H_INCLUDED
  6. #include "ams_mg.h"
  7. /* -------------------------- Defines for DTI ---------------------------------- */
  8. #ifdef DTI_COMPRESSED_ON
  9. #define DTI_COMPRESSED 1 /* Define to enable use of DTI in compr form */
  10. #else
  11. #define DTI_COMPRESSED 0 /* Define to enable use of DTI in compr form */
  12. #endif
  13. #if defined PEGASUS && !defined PSR_DLL
  14. #define DTI_LRN_SUPPORTFUNC 1 /* Enables functions supporting DTI learning */
  15. #define DTI_LOAD_FROM_ROM 1 /* Initialize DTI from linked-in resource */
  16. #define DTILRN_FLY_LEARN 0 /* Enable Fly Learn functions */
  17. #else
  18. #ifndef DTI_LRN_SUPPORTFUNC
  19. #define DTI_LRN_SUPPORTFUNC 1 /* Enables functions supporting DTI learning */
  20. #endif
  21. #ifndef DTI_LOAD_FROM_ROM
  22. #define DTI_LOAD_FROM_ROM 0 /* Initialize DTI from linked-in resource */
  23. #endif
  24. #ifndef DTILRN_FLY_LEARN
  25. #define DTILRN_FLY_LEARN 1 /* Enable Fly Learn functions */
  26. #endif
  27. #endif
  28. /* -------------------------- Defines for DTI -------------------------------- */
  29. #define XT_COUNT 64 /* Number of Type elements */
  30. #define XZ_COUNT 16 /* Number of sizes */
  31. #define XH_COUNT 16 /* Number of Height values */
  32. #define XS_COUNT 16 /* Number of Shift values */
  33. #define XO_COUNT 32 /* Number of Orientation values */
  34. #define XR_COUNT XT_COUNT
  35. #define DTI_XTB_SIZE (XT_COUNT/2) /* Size of dti buffer for XR */
  36. #define DTI_XZB_SIZE (XZ_COUNT/2) /* Size of dti buffer for XZ */
  37. #define DTI_XHB_SIZE (XH_COUNT/2) /* Size of dti buffer for H values */
  38. #define DTI_XSB_SIZE (XS_COUNT/2) /* Size of dti buffer for S values */
  39. #define DTI_XOB_SIZE (XO_COUNT/2) /* Size of dti buffer for O values */
  40. #define DTI_MAXVARSPERLET 16 /* How many vars each letter has */
  41. #define DTI_FIRSTSYM 32 /* First definable DTI sym */
  42. #define DTI_XR_SIZE 12 /* Max length of DTI prototype*/
  43. #define DTI_XT_PALETTE_SIZE 256 /* Number of vectors in 'type' palette */
  44. #define DTI_XZ_PALETTE_SIZE 256 /* Number of vectors in 'size' palette */
  45. #define DTI_XH_PALETTE_SIZE 256 /* Number of vectors in 'height' palette */
  46. #define DTI_XS_PALETTE_SIZE 256 /* Number of vectors in 'shift' palette */
  47. #define DTI_XO_PALETTE_SIZE 256 /* Number of vectors in 'orient' palette */
  48. #define DTI_XT_LSB 0x01 /* LSB bit of pallete num (select of upper/lower half) */
  49. #define DTI_XH_LSB 0x02 /* LSB bit of pallete num (select of upper/lower half) */
  50. #define DTI_XS_LSB 0x04 /* LSB bit of pallete num (select of upper/lower half) */
  51. #define DTI_XZ_LSB 0x08 /* LSB bit of pallete num (select of upper/lower half) */
  52. #define DTI_XO_LSB 0x10 /* LSB bit of pallete num (select of upper/lower half) */
  53. #define ST_CONV_RANGE 128
  54. #define DTI_NUMSYMBOLS (128+72-DTI_FIRSTSYM) /* How many letters in DTI */
  55. #if DTI_COMPRESSED
  56. #define DTI_DTI_OBJTYPE "DTI5" /* Object type of current DTI */
  57. #define DTI_DTI_VER "1.02" /* Version of current DTI */
  58. #else
  59. #define DTI_DTI_OBJTYPE "DTI4" /* Object type of current DTI */
  60. #define DTI_DTI_VER "2.00" /* Version of current DTI */
  61. #endif
  62. #define DTI_DTI_TYPE "EngM" /* Object type of current DTI */
  63. #define DTI_ID_LEN 4 /* LEngth of ID string in DTI */
  64. #define DTI_FNAME_LEN 32 /* Pathname of dti len */
  65. #define DTI_CAP_BIT 0x01 /* Var capitalization flagiting */
  66. #define DTI_PICT_OFS 1 /* Offset from right of picture group */
  67. #define DTI_OFS_WW 4 /* Offset from right of WritingWay field in var_veis */
  68. #define DTI_RESTRICTED_SET 0x10 /* Veis flag of restricted prototype set */
  69. #define DTI_VEX_MASK 0xF0 /* Vex mask */
  70. #define DTI_VEX_OFFS 4 /* Offset of vex in var header */
  71. #define DTI_NXR_MASK 0x0F /* Mask of num var field */
  72. #define DTI_XRTYPE_OFFS 4 /* Offset of XR type high bits in xrp->penl field*/
  73. #define DTI_PENL_MASK 0x0F /* Mask of penl ion xrp->penl field*/
  74. #define DTI_SIZEOFVEXT (DTI_NUMSYMBOLS*DTI_MAXVARSPERLET*sizeof(_UCHAR)) // Size of learn vex table
  75. #define DTI_SIZEOFCAPT (DTI_NUMSYMBOLS*DTI_MAXVARSPERLET/8) // Size of capitalization table
  76. /* ---------------- Definitions for OS to REC conversions ------------------ */
  77. #define REC_BritishPound ((_UCHAR)0x7f)
  78. #define REC_A_umlaut ((_UCHAR)0x80)
  79. #define REC_a_umlaut ((_UCHAR)0x81)
  80. #define REC_O_umlaut ((_UCHAR)0x82)
  81. #define REC_o_umlaut ((_UCHAR)0x83)
  82. #define REC_U_umlaut ((_UCHAR)0x84)
  83. #define REC_u_umlaut ((_UCHAR)0x85)
  84. #define REC_ESZET ((_UCHAR)0x86)
  85. #define REC_A_grave ((_UCHAR)0x87)
  86. #define REC_a_grave ((_UCHAR)0x88)
  87. #define REC_A_circumflex ((_UCHAR)0x89)
  88. #define REC_a_circumflex ((_UCHAR)0x8a)
  89. #define REC_C_cedilla ((_UCHAR)0x8b)
  90. #define REC_c_cedilla ((_UCHAR)0x8c)
  91. #define REC_E_grave ((_UCHAR)0x8d)
  92. #define REC_e_grave ((_UCHAR)0x8e)
  93. #define REC_E_acute ((_UCHAR)0x8f)
  94. #define REC_e_acute ((_UCHAR)0x90)
  95. #define REC_E_circumflex ((_UCHAR)0x91)
  96. #define REC_e_circumflex ((_UCHAR)0x92)
  97. #define REC_I_circumflex ((_UCHAR)0x93)
  98. #define REC_i_circumflex ((_UCHAR)0x94)
  99. #define REC_I_umlaut ((_UCHAR)0x95)
  100. #define REC_i_umlaut ((_UCHAR)0x96)
  101. #define REC_O_circumflex ((_UCHAR)0x97)
  102. #define REC_o_circumflex ((_UCHAR)0x98)
  103. #define REC_U_grave ((_UCHAR)0x99)
  104. #define REC_u_grave ((_UCHAR)0x9a)
  105. #define REC_U_circumflex ((_UCHAR)0x9b)
  106. #define REC_u_circumflex ((_UCHAR)0x9c)
  107. #define REC_e_umlaut ((_UCHAR)0x9d)
  108. #define REC_DIV_sign ((_UCHAR)0x9e)
  109. #define REC_n_numero ((_UCHAR)0x9f)
  110. #define REC_A_angstrem ((_UCHAR)0xa0)
  111. #define REC_a_angstrem ((_UCHAR)0xa1)
  112. #define REC_Yenn_sign ((_UCHAR)0xa2)
  113. #define REC_DblBrace_left ((_UCHAR)0xa3)
  114. #define REC_DblBrace_right ((_UCHAR)0xa4)
  115. //#define REC_Paragraph_sign ((_UCHAR)0xa5)
  116. #define REC_Copyright_sign ((_UCHAR)0xa5)
  117. #define REC_Y_umlaut ((_UCHAR)0xa6)
  118. #define REC_y_umlaut ((_UCHAR)0xa7)
  119. #define REC_N_tilda ((_UCHAR)0xa8)
  120. #define REC_n_tilda ((_UCHAR)0xa9)
  121. //#define REC_Cent_sign ((_UCHAR)0xaa)
  122. #define REC_TradeName_sign ((_UCHAR)0xaa)
  123. #define REC_Question_inv ((_UCHAR)0xab)
  124. #define REC_Exclamation_inv ((_UCHAR)0xac)
  125. #define REC_A_acute ((_UCHAR)0xad)
  126. #define REC_a_acute ((_UCHAR)0xae)
  127. #define REC_I_acute ((_UCHAR)0xaf)
  128. #define REC_i_acute ((_UCHAR)0xb0)
  129. #define REC_I_grave ((_UCHAR)0xb1)
  130. #define REC_i_grave ((_UCHAR)0xb2)
  131. #define REC_O_acute ((_UCHAR)0xb3)
  132. #define REC_o_acute ((_UCHAR)0xb4)
  133. #define REC_O_grave ((_UCHAR)0xb5)
  134. #define REC_o_grave ((_UCHAR)0xb6)
  135. #define REC_U_acute ((_UCHAR)0xb7)
  136. #define REC_u_acute ((_UCHAR)0xb8)
  137. #define REC_A_tilda ((_UCHAR)0xb9)
  138. #define REC_a_tilda ((_UCHAR)0xba)
  139. #define REC_O_tilda ((_UCHAR)0xbb)
  140. #define REC_o_tilda ((_UCHAR)0xbc)
  141. #define REC_E_umlaut ((_UCHAR)0xbd)
  142. #define REC_oe_letter ((_UCHAR)0xbe)
  143. #define REC_OE_letter ((_UCHAR)0xbf)
  144. #define REC_euro_currency ((unsigned char)0xc0)
  145. /* These definitions are for Windows OS: */
  146. #define OS_euro_currency ((unsigned char)0x80)
  147. #define OS_BritishPound ((unsigned char)0xa3)
  148. #define OS_A_umlaut ((unsigned char)0xc4)
  149. #define OS_a_umlaut ((unsigned char)0xe4)
  150. #define OS_O_umlaut ((unsigned char)0xd6)
  151. #define OS_o_umlaut ((unsigned char)0xf6)
  152. #define OS_U_umlaut ((unsigned char)0xdc)
  153. #define OS_u_umlaut ((unsigned char)0xfc)
  154. #define OS_ESZET ((unsigned char)0xdf)
  155. #define OS_A_grave ((unsigned char)0xc0)
  156. #define OS_a_grave ((unsigned char)0xe0)
  157. #define OS_A_circumflex ((unsigned char)0xc2)
  158. #define OS_a_circumflex ((unsigned char)0xe2)
  159. #define OS_C_cedilla ((unsigned char)0xc7)
  160. #define OS_c_cedilla ((unsigned char)0xe7)
  161. #define OS_E_grave ((unsigned char)0xc8)
  162. #define OS_e_grave ((unsigned char)0xe8)
  163. #define OS_E_acute ((unsigned char)0xc9)
  164. #define OS_e_acute ((unsigned char)0xe9)
  165. #define OS_E_circumflex ((unsigned char)0xca)
  166. #define OS_e_circumflex ((unsigned char)0xea)
  167. #define OS_I_circumflex ((unsigned char)0xce)
  168. #define OS_i_circumflex ((unsigned char)0xee)
  169. #define OS_I_umlaut ((unsigned char)0xcf)
  170. #define OS_i_umlaut ((unsigned char)0xef)
  171. #define OS_O_circumflex ((unsigned char)0xd4)
  172. #define OS_o_circumflex ((unsigned char)0xf4)
  173. #define OS_U_grave ((unsigned char)0xd9)
  174. #define OS_u_grave ((unsigned char)0xf9)
  175. #define OS_U_circumflex ((unsigned char)0xdb)
  176. #define OS_u_circumflex ((unsigned char)0xfb)
  177. #define OS_e_umlaut ((unsigned char)0xeb)
  178. //#define OS_N_numero ((unsigned char)0xaa)
  179. //#define OS_n_numero ((unsigned char)0xba)
  180. #define OS_A_angstrem ((unsigned char)0xc5)
  181. #define OS_a_angstrem ((unsigned char)0xe5)
  182. #define OS_Yenn_sign ((unsigned char)0xa5)
  183. #define OS_DblBrace_left ((unsigned char)0xab)
  184. #define OS_DblBrace_right ((unsigned char)0xbb)
  185. //#define OS_Paragraph_sign ((unsigned char)0xb6)
  186. #define OS_Copyright_sign ((unsigned char)0xa9)
  187. #define OS_Y_umlaut ((unsigned char)0x9f)
  188. #define OS_y_umlaut ((unsigned char)0xff)
  189. #define OS_N_tilda ((unsigned char)0xd1)
  190. #define OS_n_tilda ((unsigned char)0xf1)
  191. //#define OS_Cent_sign ((unsigned char)0xa2)
  192. #define OS_TradeName_sign ((unsigned char)0xae)
  193. #define OS_Question_inv ((unsigned char)0xbf)
  194. #define OS_Exclamation_inv ((unsigned char)0xa1)
  195. #define OS_A_acute ((unsigned char)0xc1)
  196. #define OS_a_acute ((unsigned char)0xe1)
  197. #define OS_I_acute ((unsigned char)0xcd)
  198. #define OS_i_acute ((unsigned char)0xed)
  199. #define OS_I_grave ((unsigned char)0xcc)
  200. #define OS_i_grave ((unsigned char)0xec)
  201. #define OS_O_acute ((unsigned char)0xd3)
  202. #define OS_o_acute ((unsigned char)0xf3)
  203. #define OS_O_grave ((unsigned char)0xd2)
  204. #define OS_o_grave ((unsigned char)0xf2)
  205. #define OS_U_acute ((unsigned char)0xda)
  206. #define OS_u_acute ((unsigned char)0xfa)
  207. #define OS_A_tilda ((unsigned char)0xc3)
  208. #define OS_a_tilda ((unsigned char)0xe3)
  209. #define OS_O_tilda ((unsigned char)0xd5)
  210. #define OS_o_tilda ((unsigned char)0xf5)
  211. #define OS_E_umlaut ((unsigned char)0xcb)
  212. #define OS_oe_letter ((unsigned char)0x9c)
  213. #define OS_OE_letter ((unsigned char)0x8c)
  214. #define OS_ae_letter ((unsigned char)198)
  215. #define OS_AE_letter ((unsigned char)230)
  216. #define OS_MUL_sign ((unsigned char)215)
  217. #define OS_DIV_sign ((unsigned char)247)
  218. #define OS_O_crossed ((unsigned char)216)
  219. #define OS_o_crossed ((unsigned char)248)
  220. #define OS_Y_acute ((unsigned char)221)
  221. #define OS_y_acute ((unsigned char)253)
  222. //#if 0 /*Macintosh definitions - don't use them for now */
  223. /* Definitions for OS (Macintosh Roman) FOR_INTERNATIONAL characters */
  224. #define MAC_euro_currency ((_UCHAR)0xf0) // FIXME or do we care ??? MR, april 2000
  225. #define MAC_BritishPound ((_UCHAR)0xa3)
  226. #define MAC_A_umlaut ((_UCHAR)0x80)
  227. #define MAC_a_umlaut ((_UCHAR)0x8a)
  228. #define MAC_O_umlaut ((_UCHAR)0x85)
  229. #define MAC_o_umlaut ((_UCHAR)0x9a)
  230. #define MAC_U_umlaut ((_UCHAR)0x86)
  231. #define MAC_u_umlaut ((_UCHAR)0x9f)
  232. #define MAC_ESZET ((_UCHAR)0xa7)
  233. #define MAC_A_grave ((_UCHAR)0xcb)
  234. #define MAC_a_grave ((_UCHAR)0x88)
  235. #define MAC_A_circumflex ((_UCHAR)0xe5)
  236. #define MAC_a_circumflex ((_UCHAR)0x89)
  237. #define MAC_C_cedilla ((_UCHAR)0x82)
  238. #define MAC_c_cedilla ((_UCHAR)0x8d)
  239. #define MAC_E_grave ((_UCHAR)0xe9)
  240. #define MAC_e_grave ((_UCHAR)0x8f)
  241. #define MAC_E_acute ((_UCHAR)0x83)
  242. #define MAC_e_acute ((_UCHAR)0x8e)
  243. #define MAC_E_circumflex ((_UCHAR)0xe6)
  244. #define MAC_e_circumflex ((_UCHAR)0x90)
  245. #define MAC_I_circumflex ((_UCHAR)0xeb)
  246. #define MAC_i_circumflex ((_UCHAR)0x94)
  247. #define MAC_I_umlaut ((_UCHAR)0xec)
  248. #define MAC_i_umlaut ((_UCHAR)0x95)
  249. #define MAC_O_circumflex ((_UCHAR)0xef)
  250. #define MAC_o_circumflex ((_UCHAR)0x99)
  251. #define MAC_U_grave ((_UCHAR)0xf4)
  252. #define MAC_u_grave ((_UCHAR)0x9d)
  253. #define MAC_U_circumflex ((_UCHAR)0xf3)
  254. #define MAC_u_circumflex ((_UCHAR)0x9e)
  255. #define MAC_e_umlaut ((_UCHAR)0x91)
  256. #define MAC_N_numero ((_UCHAR)0xbb)
  257. #define MAC_n_numero ((_UCHAR)0xbc)
  258. #define MAC_A_angstrem ((_UCHAR)0x81)
  259. #define MAC_a_angstrem ((_UCHAR)0x8c)
  260. #define MAC_Yenn_sign ((_UCHAR)0xb4)
  261. #define MAC_DblBrace_left ((_UCHAR)0xc7)
  262. #define MAC_DblBrace_right ((_UCHAR)0xc8)
  263. //#define MAC_Paragraph_sign ((_UCHAR)0xa6)
  264. #define MAC_Y_umlaut ((_UCHAR)0xd9)
  265. #define MAC_y_umlaut ((_UCHAR)0xd8)
  266. #define MAC_N_tilda ((_UCHAR)0x84)
  267. #define MAC_n_tilda ((_UCHAR)0x96)
  268. //#define MAC_Cent_sign ((_UCHAR)0xa2)
  269. #define MAC_Question_inv ((_UCHAR)0xc0)
  270. #define MAC_Exclamation_inv ((_UCHAR)0xc1)
  271. #define MAC_A_acute ((_UCHAR)0xe7)
  272. #define MAC_a_acute ((_UCHAR)0x87)
  273. #define MAC_I_acute ((_UCHAR)0xea)
  274. #define MAC_i_acute ((_UCHAR)0x92)
  275. #define MAC_I_grave ((_UCHAR)0xed)
  276. #define MAC_i_grave ((_UCHAR)0x93)
  277. #define MAC_O_acute ((_UCHAR)0xee)
  278. #define MAC_o_acute ((_UCHAR)0x97)
  279. #define MAC_O_grave ((_UCHAR)0xf1)
  280. #define MAC_o_grave ((_UCHAR)0x98)
  281. #define MAC_U_acute ((_UCHAR)0xf2)
  282. #define MAC_u_acute ((_UCHAR)0x9c)
  283. #define MAC_A_tilda ((_UCHAR)0xcc)
  284. #define MAC_a_tilda ((_UCHAR)0x8b)
  285. #define MAC_O_tilda ((_UCHAR)0xcd)
  286. #define MAC_o_tilda ((_UCHAR)0x9b)
  287. #define MAC_E_umlaut ((_UCHAR)0xe8)
  288. #define MAC_oe_letter ((_UCHAR)0xcf)
  289. #define MAC_OE_letter ((_UCHAR)0xce)
  290. #define MAC_Copyright_sign ((_UCHAR)0xa9)
  291. #define MAC_TradeName_sign ((_UCHAR)0xa8)
  292. #define MAC_Y_acute ((_UCHAR)0)
  293. #define MAC_y_acute ((_UCHAR)0)
  294. //#endif /*Macintosh definitions - don't use them for now */
  295. /* ------------------- Defines for ROM tables -------------------------------- */
  296. #if defined (FOR_FRENCH)
  297. #define CAP_TABLE_NUM_LET 1
  298. #define CAP_TABLE_NUM_VAR 1
  299. #elif defined (FOR_GERMAN)
  300. #define CAP_TABLE_NUM_LET 30
  301. #define CAP_TABLE_NUM_VAR 9
  302. #elif defined (FOR_INTERNATIONAL)
  303. #define CAP_TABLE_NUM_LET 1
  304. #define CAP_TABLE_NUM_VAR 1
  305. #elif defined (FOR_SWED)
  306. #define CAP_TABLE_NUM_LET 29
  307. #define CAP_TABLE_NUM_VAR 9
  308. #else
  309. #define CAP_TABLE_NUM_LET 26
  310. #define CAP_TABLE_NUM_VAR 9
  311. #endif
  312. /* -------------------------- Types definitions ------------------------------ */
  313. typedef _UCHAR cap_table_type[CAP_TABLE_NUM_LET][CAP_TABLE_NUM_VAR];
  314. typedef _UCHAR dti_xrt_type[XT_COUNT][XT_COUNT/2];/* Reference XR Corr table */
  315. typedef dti_xrt_type _PTR p_dti_xrt_type;
  316. typedef struct { /* Header of DTI file */
  317. _CHAR object_type[DTI_ID_LEN]; /* Type file (now DTI1) */
  318. _CHAR type[DTI_ID_LEN]; /* Type of DTI (EngM, EngP..) */
  319. _CHAR version[DTI_ID_LEN]; /* Version number */
  320. _ULONG dte_offset; /* File offset of DTE part */
  321. _ULONG dte_len; /* Length of DTE part of data */
  322. _ULONG dte_chsum; /* Checksum of DTE part */
  323. _ULONG xrt_offset; /* File offset of XRT part */
  324. _ULONG xrt_len; /* Length of XRT part of data */
  325. _ULONG xrt_chsum; /* Checksum of XRT part */
  326. _ULONG pdf_offset; /* Start of PDF part in DTI */
  327. _ULONG pdf_len; /* Length of PDF part */
  328. _ULONG pdf_chsum; /* ChekSum of PDF part */
  329. _ULONG pict_offset; /* Offset of pictures from the beg of DTI file */
  330. _ULONG pict_len; /* Length of pictures */
  331. _ULONG pict_chsum; /* CheckSum of pictures */
  332. } dti_header_type, _PTR p_dti_header_type;
  333. typedef struct { /* DTI memory descriptor */
  334. _CHAR dti_fname[DTI_FNAME_LEN]; /* File name of loaded DTI */
  335. _CHAR object_type[DTI_ID_LEN]; /* Type file (now DTI1) */
  336. _CHAR type[DTI_ID_LEN]; /* Type of DTI (EngM, EngP..) */
  337. _CHAR version[DTI_ID_LEN]; /* Version number */
  338. _ULONG h_dte; /* Handle of dte memory */
  339. p_UCHAR p_dte; /* Pointer to locked dte mem */
  340. _ULONG h_ram_dte; /* Handle of dte memory */
  341. p_UCHAR p_ram_dte; /* Pointer to RAM dte addresses */
  342. _ULONG dte_chsum; /* CheckSum of dte memory */
  343. _ULONG h_vex; /* Handle of vex learning buffer */
  344. p_UCHAR p_vex; /* Pointer of vex learning buffer */
  345. _ULONG h_xrt; /* Handle of reference xrtabl */
  346. p_UCHAR p_xrt; /* Pointer to locked xrtabl */
  347. _ULONG xrt_chsum; /* CheckSum of xrtabl memory */
  348. _ULONG h_pdf; /* Same for pdf */
  349. p_UCHAR p_pdf;
  350. p_UCHAR p_ram_pdf;
  351. _ULONG pdf_chsum;
  352. _ULONG h_pict; /* Same for pictures */
  353. p_UCHAR p_pict;
  354. p_UCHAR p_ram_pict;
  355. _ULONG pict_chsum;
  356. // #if HWR_SYSTEM != MACINTOSH
  357. // #define LRM_FNAME_LEN 128
  358. //
  359. // _CHAR szLrmName[LRM_FNAME_LEN];
  360. // _BOOL bLoadLRM;
  361. // _BOOL bSaveLRM;
  362. // #endif /*HWR_SYSTEM != MACINTOSH*/
  363. } dti_descr_type, _PTR p_dti_descr_type;
  364. #if DTI_COMPRESSED // ------------- Compressed DTI header -____--------------
  365. typedef struct {
  366. _ULONG len;
  367. _USHORT sym_index[256];
  368. _UCHAR xt_palette[DTI_XT_PALETTE_SIZE][XT_COUNT];
  369. _UCHAR xz_palette[DTI_XZ_PALETTE_SIZE][XZ_COUNT];
  370. _UCHAR xh_palette[DTI_XH_PALETTE_SIZE][XH_COUNT];
  371. _UCHAR xs_palette[DTI_XS_PALETTE_SIZE][XS_COUNT];
  372. _UCHAR xo_palette[DTI_XO_PALETTE_SIZE][XO_COUNT];
  373. } dte_index_type, _PTR p_dte_index_type;
  374. typedef struct { /* Prototype XR element definition */
  375. _UCHAR type; /* Temp: main type definition */
  376. // _UCHAR height; /* Temp: main h of xr */
  377. _UCHAR attr; /* Attributes (flag bits) */
  378. _UCHAR penl; /* Penalty value for element */
  379. _UCHAR xtc; /* Type(64) Line of XR corr vaues */
  380. _UCHAR xhc; /* Height(16) Line of H corr values */
  381. _UCHAR xsc; /* Shift(16) Line of S corr values */
  382. _UCHAR xzc; /* Size(16) Line of Z corr vaues */
  383. _UCHAR xoc; /* Orientation(16) of O corr values */
  384. } xrp_type, _PTR p_xrp_type;
  385. typedef struct { /* Header of prototype in DTI */
  386. _UCHAR nx_and_vex; /* Num xrs and VarExtraInfo */
  387. _UCHAR veis; /* Additional VEXs */
  388. _UCHAR pos; /* Box relative position */
  389. _UCHAR size; /* Box relative size */
  390. xrp_type xrs[1]; /* Prototype XRs */
  391. } dte_var_header_type, _PTR p_dte_var_header_type;
  392. typedef struct { /* Header of symbol in DTI */
  393. _UCHAR num_vars; /* Number of variants of sym */
  394. _UCHAR loc_vs_border; /* Sym location vs border */
  395. _UCHAR let; /* Temp: symbol itself */
  396. _UCHAR language; /* Temp: language of symbol */
  397. } dte_sym_header_type, _PTR p_dte_sym_header_type;
  398. #else // ------------- Not compressed DTI header ----------------------------
  399. typedef _ULONG let_table_type[256]; /* Header of DTE (sym loc table) */
  400. typedef let_table_type _PTR p_let_table_type;
  401. typedef struct { /* Header of symbol in DTI */
  402. _UCHAR num_vars; /* Number of variants of sym */
  403. _UCHAR loc_vs_border; /* Sym location vs border */
  404. _UCHAR let; /* Temp: symbol itself */
  405. _UCHAR language; /* Temp: language of symbol */
  406. _UCHAR var_lens[DTI_MAXVARSPERLET]; /* Array of var lens */
  407. _UCHAR var_vexs[DTI_MAXVARSPERLET]; /* Array of VarExtraInfo's */
  408. _UCHAR var_veis[DTI_MAXVARSPERLET]; /* Array of Additional VEXs */
  409. _UCHAR var_pos[DTI_MAXVARSPERLET]; /* Array of Additional VEXs */
  410. _UCHAR var_size[DTI_MAXVARSPERLET]; /* Array of Additional VEXs */
  411. } dte_sym_header_type, _PTR p_dte_sym_header_type;
  412. typedef struct { /* Prototype XR element definition */
  413. _UCHAR type; /* Temp: main type definition */
  414. _UCHAR height; /* Temp: main h of xr */
  415. _UCHAR attr; /* Attributes (flag bits) */
  416. _UCHAR penl; /* Penalty value for element */
  417. _UCHAR xtc[DTI_XTB_SIZE]; /* Type(64) Line of XR corr vaues */
  418. _UCHAR xhc[DTI_XHB_SIZE]; /* Height(16) Line of H corr values */
  419. _UCHAR xsc[DTI_XSB_SIZE]; /* Shift(16) Line of S corr values */
  420. _UCHAR xzc[DTI_XZB_SIZE]; /* Size(16) Line of Z corr vaues */
  421. _UCHAR xoc[DTI_XOB_SIZE]; /* Orientation(16) of O corr values */
  422. } xrp_type, _PTR p_xrp_type;
  423. #endif // ------------- Not compressed DTI header ----------------------------
  424. typedef struct {
  425. _USHORT len; /* length of groups' descriptions */
  426. _UCHAR symbol; /* ASCII code of symbol */
  427. _UCHAR num_groups; /* number of groups */
  428. /* groups are placed after this header */
  429. } pict_symb_header_type, _PTR p_pict_symb_header_type;
  430. typedef struct {
  431. _USHORT len; /* length of pictures' descriptions */
  432. _UCHAR groupno; /* number of group */
  433. _UCHAR num_pictures; /* number of groups */
  434. /* pictures are placed after this header */
  435. } pict_group_header_type, _PTR p_pict_group_header_type;
  436. typedef struct {
  437. _USHORT len; /* length of pictures' descriptions */
  438. /* traces are placed after this header */
  439. } pict_picture_header_type, _PTR p_pict_picture_header_type;
  440. typedef struct {
  441. _UCHAR x;
  442. _UCHAR y;
  443. } pict_point_type, _PTR p_pict_point_type;
  444. typedef _UCHAR dte_vex_type[DTI_NUMSYMBOLS][DTI_MAXVARSPERLET];/* Type for learning vex buffer */
  445. typedef dte_vex_type _PTR p_dte_vex_type; /* Type for learning vex buffer */
  446. /* -------------------------- Prototypes ------------------------------------- */
  447. #ifdef DTE_CONVERTER
  448. #define dti_load dti_load_2
  449. #define dti_unload dti_unload_2
  450. #define dti_save dti_save_2
  451. #define dti_lock dti_lock_2
  452. #define dti_unlock dti_unlock_2
  453. #define LetXrLength LetXrLength_2
  454. #define GetNumVarsOfChar GetNumVarsOfChar_2
  455. #define GetVarOfChar GetVarOfChar_2
  456. #define GetVarLenOfChar GetVarLenOfChar_2
  457. #define GetVarVex GetVarVex_2
  458. #define GetVarExtra GetVarExtra_2
  459. #define SetVarVex SetVarVex_2
  460. #define SetDefVexes SetDefVexes_2
  461. #define SetVarCounter SetVarCounter_2
  462. #define GetVarGroup GetVarGroup_2
  463. #define OSToRec OSToRec_2
  464. #define RecToOS RecToOS_2
  465. #endif // DTE_CONVERTER
  466. _INT dti_load(p_CHAR dtiname, _INT what_to_load, p_VOID _PTR dp);
  467. _INT dti_unload(p_VOID _PTR dp);
  468. _INT dti_save(p_CHAR fname, _INT what_to_save, p_VOID dp);
  469. _INT dti_lock(p_VOID dti_ptr);
  470. _INT dti_unlock(p_VOID dti_ptr);
  471. //#if PG_DEBUG
  472. //_VOID LoadLRMIfAny( p_dti_descr_type dti_descr,
  473. // _CHAR szLrmName[LRM_FNAME_LEN],
  474. // _BOOL bLoadLRM, _BOOL bSaveLRM );
  475. //#endif /*PG_DEBUG*/
  476. _VOID LetXrLength(p_UCHAR min, p_UCHAR max, _SHORT let, _VALUE hdte);
  477. _INT CheckVarActive(_UCHAR chIn, _UCHAR nv, _UCHAR ww, p_VOID dtp);
  478. _INT GetNumVarsOfChar(_UCHAR chIn, p_VOID dtp);
  479. _INT GetVarOfChar(_UCHAR chIn, _UCHAR nv, p_xrp_type xvb, p_VOID dtp);
  480. _INT GetVarLenOfChar(_UCHAR chIn, _UCHAR nv, p_VOID dtp);
  481. _INT GetVarVex(_UCHAR chIn, _UCHAR nv, p_VOID dtp);
  482. _INT GetVarExtra(_UCHAR chIn, _UCHAR nv, p_VOID dtp);
  483. _INT SetVarVex(_UCHAR chIn, _UCHAR nv, _UCHAR vex, p_VOID dtp);
  484. _INT SetDefVexes(p_VOID dtp);
  485. _INT SetVarCounter(_UCHAR chIn, _UCHAR nv, _UCHAR cnt, p_VOID dtp);
  486. _INT GetVarGroup(_UCHAR chIn, _UCHAR nv, p_VOID dtp);
  487. _INT GetPairCapGroup(_UCHAR let, _UCHAR groupNum, _UCHAR EnableVariantSet);
  488. _INT SetDefCaps(p_VOID dtp);
  489. _INT SetVarCap(_UCHAR chIn, _UCHAR nv, _UCHAR cap, p_VOID dtp);
  490. _INT GetVarCap(_UCHAR chIn, _UCHAR nv, p_VOID dtp);
  491. _INT GetVarRewcapAllow(_UCHAR chIn, _UCHAR nv, p_VOID dtp);
  492. _INT GetAutoCorr(_UCHAR chIn, _UCHAR nv, p_VOID dtp);
  493. _INT GetShiftCorr(_UCHAR chIn, _UCHAR nv,_UCHAR nXr, _UCHAR nIn, p_VOID dtp);
  494. _INT GetSymDescriptor(_UCHAR sym, _UCHAR numv, p_dte_sym_header_type _PTR psfc, p_VOID dtp);
  495. _INT GetVarPosSize(_UCHAR chIn, _UCHAR nv, p_VOID dtp);
  496. #if DTI_COMPRESSED
  497. _INT GetSymIndexTable(_UCHAR sym, _UCHAR numv, p_dte_index_type _PTR pi, p_VOID dtp);
  498. _INT GetVarHeader(_UCHAR sym, _UCHAR var_num, p_dte_var_header_type _PTR ppvh, p_VOID dtp);
  499. #endif
  500. /* ---------------- Definitions for OS to REC conversions ------------------ */
  501. #ifdef __cplusplus
  502. extern "C" {
  503. #endif
  504. _INT OSToRec(_INT sym);
  505. _INT RecToOS(_INT sym);
  506. _INT MacToOS(_INT sym);
  507. _INT OSToMac(_INT sym);
  508. #ifdef __cplusplus
  509. }
  510. #endif
  511. /* ------------------------------------------------------------------------- */
  512. /* For FOR_INTERNATIONAL versions: changes the os-rec table */
  513. /* and charset used: */
  514. #define TBL_AMERICAN 0
  515. #define TBL_FOR_INTERNATIONAL 1
  516. #define TBL_INTER_NODIACR 2
  517. _VOID SetOsRecTableAndCharSet( _INT interTable );
  518. _INT SetFOR_INTERNATIONALCharSet( _INT interTable, p_VOID rcv, p_VOID xrd );
  519. /* --------------------------------------------------------------------------- */
  520. #endif
  521. /* ************************************************************************ */
  522. /* * End Of All ... * */
  523. /* ************************************************************************ */