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.

254 lines
7.2 KiB

  1. #ifndef TXTILS_DEFINED
  2. #define TXTILS_DEFINED
  3. #include "lsidefs.h"
  4. #include "pilsobj.h"
  5. #include "plsrun.h"
  6. #include "plshyph.h"
  7. #include "pheights.h"
  8. #include "plsems.h"
  9. #include "pdobj.h"
  10. #include "lsdevres.h"
  11. #include "lsdevice.h"
  12. #include "lskeop.h"
  13. #include "lstflow.h"
  14. #include "lsact.h"
  15. #include "lspract.h"
  16. #include "lspairac.h"
  17. #include "lsexpan.h"
  18. #include "lsbrk.h"
  19. #include "mwcls.h"
  20. #include "brkcls.h"
  21. #include "brkcond.h"
  22. #include "brkkind.h"
  23. #include "lsexpinf.h"
  24. #include "txtln.h"
  25. #include "txtobj.h"
  26. #include "txtinf.h"
  27. #include "txtginf.h"
  28. #include "lscbk.h"
  29. typedef enum {
  30. brktNormal,
  31. brktHyphen,
  32. brktNonReq,
  33. brktOptBreak
  34. } BRKT;
  35. typedef struct
  36. {
  37. PDOBJ pdobj;
  38. BRKKIND brkkind;
  39. LSDCP dcp;
  40. BRKT brkt;
  41. union {
  42. struct {
  43. long durFix;
  44. long igindLim;
  45. } normal;
  46. struct {
  47. long iwchLim;
  48. long dwchYsr;
  49. long durHyphen;
  50. long dupHyphen;
  51. long durPrev;
  52. long dupPrev;
  53. long durPrevPrev;
  54. long dupPrevPrev;
  55. long ddurDnodePrev;
  56. WCHAR wchPrev;
  57. WCHAR wchPrevPrev;
  58. GINDEX gindHyphen;
  59. GINDEX gindPrev;
  60. GINDEX gindPrevPrev;
  61. GINDEX gindPad1; /* makes number of gind's even */
  62. long igindHyphen;
  63. long igindPrev;
  64. long igindPrevPrev;
  65. } hyphen;
  66. struct {
  67. long iwchLim;
  68. long dwchYsr;
  69. long durHyphen;
  70. long dupHyphen;
  71. long durPrev;
  72. long dupPrev;
  73. long durPrevPrev;
  74. long dupPrevPrev;
  75. long ddurDnodePrev;
  76. long ddurDnodePrevPrev;
  77. long ddurTotal;
  78. WCHAR wchHyphenPres;
  79. WCHAR wchPrev;
  80. WCHAR wchPrevPrev;
  81. WCHAR wchPad1; /* makes number of wch's even */
  82. GINDEX gindPrev;
  83. GINDEX gindPrevPrev;
  84. long igindPrev;
  85. long igindPrevPrev;
  86. } nonreq;
  87. } u;
  88. } BREAKINFO;
  89. #define clabRegular 0
  90. #define clabSpace 1
  91. #define clabTab 2
  92. #define clabEOP1 3
  93. #define clabEOP2 4
  94. #define clabAltEOP 5
  95. #define clabEndLineInPara 6
  96. #define clabColumnBreak 7
  97. #define clabSectionBreak 8
  98. #define clabPageBreak 9
  99. #define clabNonBreakSpace 10
  100. #define clabNonBreakHyphen 11
  101. #define clabNonReqHyphen 12
  102. #define clabEmSpace 13
  103. #define clabEnSpace 14
  104. #define clabNull 15
  105. #define clabHardHyphen 16
  106. #define clabNarrowSpace 17
  107. #define clabOptBreak 18
  108. #define clabNonBreak 19
  109. #define clabFESpace 20
  110. #define clabJoiner 21
  111. #define clabNonJoiner 22
  112. #define clabToReplace 23
  113. #define clabSuspicious 32
  114. #define fSpecMask 0x1F
  115. #define wchSpecMax 24
  116. #define wchAddM 50
  117. #define gindAddM 30
  118. #define wSpacesMaxM 30
  119. typedef BYTE CLABEL;
  120. struct ilsobj
  121. {
  122. PCLSCBK plscbk; /* Callbacks */
  123. POLS pols; /* Line Services owner's context */
  124. PLSC plsc; /* LS's context */
  125. PLNOBJ plnobj; /* Available lnobj */
  126. long wchMax; /* size of char-based arrays */
  127. long wchMac; /* last used index in char-based arrays */
  128. WCHAR* pwchOrig; /* pointer to rgwchOrig (char-based) */
  129. long* pdur; /* pointer to rgdur (char-based) */
  130. long* pdurLeft; /* pointer to rgdurLeft (char-based) */
  131. long* pdurRight; /* pointer to rgdurRight (char-based) */
  132. long* pduAdjust; /* useful compression/expansion/kerning info
  133. (char-based) */
  134. TXTINF* ptxtinf; /* pointer to rgtxtinf (char-based) */
  135. long wSpacesMax; /* size of rgwSpaces array */
  136. long wSpacesMac; /* last used index in rgwSpaces array */
  137. long* pwSpaces; /* pointer to rgwSpaces */
  138. long gindMax; /* size of glyph-based arrays */
  139. long gindMac; /* last used index in glyph-based arrays */
  140. long* pdurGind; /* pointer to rgdurGind array (glyph-based) */
  141. TXTGINF* pginf; /* pointer to rgginf */
  142. long* pduGright; /* pointer to rgduGright (glyph-based) */
  143. LSEXPINFO* plsexpinf; /* useful glyph-expandion info (glyph-based)*/
  144. DWORD txtobjMac; /* last used index in rgtxtobj array */
  145. BOOL fNotSimpleText; /* Set at NTI time; used in AdjustText */
  146. BOOL fDifficultForAdjust; /* Set at formatting time; used to decide if
  147. QuickAdjustText possible */
  148. long iwchCompressFetchedFirst;/* index of the first char with known compr. */
  149. long itxtobjCompressFetchedLim;/* index of the lim chunk element with known compr. */
  150. long iwchCompressFetchedLim;/* index of the lim char with known compr. */
  151. long iwchFetchedWidth; /* Fetched unused width starts here */
  152. WCHAR wchFetchedWidthFirst; /* Expected first char of run */
  153. WCHAR wchPad1; /* Makes number of chars even */
  154. LSCP cpFirstFetchedWidth; /* cp from which we expect next run to start */
  155. long dcpFetchedWidth; /* N of chars with fetched width */
  156. long durFetchedWidth; /* width of the piece */
  157. BOOL fTruncatedBefore;
  158. DWORD breakinfMax;
  159. DWORD breakinfMac;
  160. BREAKINFO* pbreakinf;
  161. long MagicConstantX;
  162. long durRightMaxX;
  163. long MagicConstantY;
  164. long durRightMaxY;
  165. BOOL fDisplay;
  166. BOOL fPresEqualRef; /* Modified due to Visi issues */
  167. LSDEVRES lsdevres;
  168. DWORD grpf; /* flags from lsffi.h --- includes */
  169. /* fHyphenate and fWrapspaces */
  170. BOOL fSnapGrid;
  171. long duaHyphenationZone;
  172. LSKEOP lskeop; /* Kind of line ending */
  173. WCHAR wchSpace; /* space code */
  174. WCHAR wchHyphen; /* hyphen code */
  175. WCHAR wchReplace; /* replace char code */
  176. WCHAR wchNonBreakSpace; /* non-break space char code */
  177. WCHAR wchVisiNull; /* visi char for wch=0 */
  178. WCHAR wchVisiEndPara; /* visi char for end of paragraph */
  179. WCHAR wchVisiAltEndPara; /* visi char for end of table cell */
  180. WCHAR wchVisiEndLineInPara; /* visi char for wchEndLineInPara (CCRJ) */
  181. WCHAR wchVisiSpace; /* visi space */
  182. WCHAR wchVisiNonBreakSpace; /* visi NonBreakSpace */
  183. WCHAR wchVisiNonBreakHyphen;/* visi NonBreakHyphen */
  184. WCHAR wchVisiNonReqHyphen; /* visi NonReqHyphen */
  185. WCHAR wchVisiTab; /* visi Tab */
  186. WCHAR wchVisiEmSpace; /* visi emSpace */
  187. WCHAR wchVisiEnSpace; /* visi enSpace */
  188. WCHAR wchVisiNarrowSpace; /* visi NarrowSpace */
  189. WCHAR wchVisiOptBreak; /* visi char for wchOptBreak */
  190. WCHAR wchVisiNoBreak; /* visi char for wchNoBreak */
  191. WCHAR wchVisiFESpace; /* visi char for wchOptBreak */
  192. WCHAR wchPad2; /* makes number of wch's even */
  193. DWORD cwchSpec; /* number of special characters > 255 */
  194. WCHAR rgwchSpec[wchSpecMax];/* array of special characters > 255 */
  195. CLABEL rgbKind[wchSpecMax]; /* array of meanings of Spec characters>255 */
  196. CLABEL rgbSwitch[256]; /* switch table with Special Characters */
  197. DWORD cModWidthClasses; /* number of ModWidth classes */
  198. DWORD cCompPrior; /* number of compression priorities */
  199. DWORD clspairact; /* number of mod pairs info units */
  200. LSPAIRACT* plspairact; /* pointer to rglspairact(ModPair info unts)*/
  201. BYTE* pilspairact; /* rgilspairact(ModPair info---square) */
  202. DWORD clspract; /* number of compression info units */
  203. LSPRACT* plspract; /* pointer to rglspract(compress info units)*/
  204. BYTE* pilspract; /* rgilspract(comp info---linear) */
  205. DWORD clsexpan; /* number of expansion info units */
  206. LSEXPAN* plsexpan; /* pointer to rglsexpan(expan info units) */
  207. BYTE* pilsexpan; /* rgilsexpan(expan info---square) */
  208. DWORD cBreakingClasses; /* number of ModWidth classes */
  209. DWORD clsbrk; /* number of breaking info units */
  210. LSBRK* plsbrk; /* pointer to rglsbrk(breaking info units) */
  211. BYTE* pilsbrk; /* rgilsbrk(breaking info---square) */
  212. };
  213. #endif /* !TXTILS_DEFINED */