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.

237 lines
8.3 KiB

  1. /************************************************************/
  2. /* Windows Write, Copyright 1985-1992 Microsoft Corporation */
  3. /************************************************************/
  4. /* propdefs.h - MW defsfor char/para properties */
  5. #define hpsNegMin 128
  6. /* NOTE - "hpsNormal" is used for incremental encoding/decoding of chps in doc
  7. files, hpsDefault is the size the guy starts typing into a new doc with */
  8. #define hpsNormal 24
  9. #ifdef KOREA
  10. #define hpsDefault 24
  11. #else
  12. #ifdef JAPAN
  13. #define hpsDefault 24 //T-HIROYN Win3.1
  14. #else
  15. #define hpsDefault 20
  16. #endif
  17. #endif
  18. struct TBD /* Tab Descriptor */
  19. {
  20. unsigned dxa; /* distance from left margin of tab stop */
  21. unsigned char jc : 3; /* justification code */
  22. unsigned char tlc : 3; /* leader dot code */
  23. unsigned char opcode : 2; /* operation code for Format Tabs */
  24. CHAR chAlign; /* ASCII code of char to align on
  25. if jcTab=3, or 0 to align on '.' */
  26. };
  27. #define cchTBD (sizeof (struct TBD))
  28. #define cwTBD (sizeof (struct TBD) / sizeof (int))
  29. #define itbdMax 13
  30. #define itbdMaxWord 20
  31. #define cchMaxNum 10
  32. struct CHP /* Character properties */
  33. {
  34. unsigned fStyled : 1; /* BYTE 0 */
  35. unsigned stc : 7; /* style */
  36. unsigned fBold : 1; /* BYTE 1 */
  37. unsigned fItalic : 1;
  38. unsigned ftc : 6; /* Font code */
  39. unsigned hps : 8; /* Size in half pts */ /* BYTE 2 */
  40. unsigned fUline : 1; /* BYTE 3 */
  41. unsigned fStrike : 1;
  42. unsigned fDline: 1;
  43. unsigned fOverset : 1;
  44. unsigned csm : 2; /* Case modifier */
  45. unsigned fSpecial : 1;
  46. unsigned : 1;
  47. unsigned ftcXtra : 3; /* BYTE 4 */
  48. unsigned fOutline : 1;
  49. unsigned fShadow : 1;
  50. unsigned : 3;
  51. unsigned hpsPos : 8; /* BYTE 5 */
  52. unsigned fFixedPitch : 1; /* used internally only */
  53. unsigned psWidth : 7;
  54. unsigned chLeader : 8;
  55. unsigned ichRun : 8;
  56. unsigned cchRun : 8;
  57. };
  58. #define cchCHP (sizeof (struct CHP))
  59. #define cwCHP (cchCHP / sizeof (int))
  60. #define cchCHPUsed (cchCHP - 3)
  61. #define csmNormal 0
  62. #define csmUpper 1
  63. #define csmSmallCaps 3
  64. /* Justification codes: must agree with menu.mod */
  65. #define jcLeft 0
  66. #define jcCenter 1
  67. #define jcRight 2
  68. #define jcBoth 3
  69. #define jcTabMin 4
  70. #define jcTabLeft 4
  71. #define jcTabCenter 5
  72. #define jcTabRight 6
  73. #define jcTabDecimal 7
  74. /* nice, safe invalid jc value */
  75. #define jcNil -1
  76. /* Tab leader codes: must agree with menu.mod */
  77. #define tlcWhite 0
  78. #define tlcDot 1
  79. #define tlcHyphen 2
  80. #define tlcUline 3
  81. struct PAP /* Paragraph properties */
  82. {
  83. unsigned fStyled : 1; /* BYTE 0 */
  84. unsigned stc : 7;
  85. unsigned jc : 2; /* BYTE 1 */
  86. unsigned fKeep : 1;
  87. unsigned fKeepFollow : 1;
  88. unsigned : 4;
  89. unsigned stcNormChp : 7; /* BYTE 2 */
  90. unsigned : 9; /* BYTE 3 */
  91. unsigned dxaRight; /* BYTE 4-5 */
  92. unsigned dxaLeft; /* BYTE 6-7 */
  93. unsigned dxaLeft1; /* BYTE 8-9 */
  94. unsigned dyaLine; /* 10-11 */
  95. unsigned dyaBefore; /* 12-13 */
  96. unsigned dyaAfter; /* 14-15 */
  97. unsigned rhc : 4; /* Running hd code */
  98. unsigned fGraphics : 1; /* Graphics bit */
  99. unsigned wUnused1 : 11;
  100. int wUnused2;
  101. int wUnused3;
  102. struct TBD rgtbd[itbdMaxWord];
  103. };
  104. #define cchPAP (sizeof (struct PAP))
  105. #define cwPAP (cchPAP / sizeof (int))
  106. #define cwPAPBase (cwPAP - cwTBD * itbdMaxWord)
  107. struct SEP
  108. { /* Section properties */
  109. unsigned fStyled : 1; /* BYTE 0 */
  110. unsigned stc : 7;
  111. unsigned bkc : 3; /* Break code */ /* BYTE 1 */
  112. unsigned nfcPgn : 3; /* Pgn format code */
  113. unsigned :2;
  114. unsigned yaMac; /* Page height */ /* BYTE 2-3 */
  115. unsigned xaMac; /* Page width */ /* BYTE 4-5 */
  116. unsigned pgnStart; /* Starting pgn */ /* BYTE 6-7 */
  117. unsigned yaTop; /* Start of text */ /* BYTE 8-9 */
  118. unsigned dyaText; /* Height of text */ /* 10-11 */
  119. unsigned xaLeft; /* Left text margin */ /* 12-13 */
  120. unsigned dxaText; /* Width of text */ /* 14-15 */
  121. unsigned rhc : 4; /* *** RESERVED *** */ /* 16 */
  122. /* (Must be same as PAP) */
  123. unsigned : 2;
  124. unsigned fAutoPgn : 1; /* Print pgns without hdr */
  125. unsigned fEndFtns : 1; /* Footnotes at end of doc */
  126. unsigned cColumns : 8; /* # of columns */ /* BYTE 17 */
  127. unsigned yaRH1; /* Pos of top hdr */ /* 18-19 */
  128. unsigned yaRH2; /* Pos of bottom hdr */ /* 20-21 */
  129. unsigned dxaColumns; /* Intercolumn gap */ /* 22-23 */
  130. unsigned dxaGutter; /* Gutter width */ /* 24-25 */
  131. unsigned yaPgn; /* Y pos of page nos */ /* 26-27 */
  132. unsigned xaPgn; /* X pos of page nos */ /* 28-29 */
  133. CHAR rgbJunk[cchPAP - 30]; /* Pad to cchPAP */
  134. };
  135. #define cchSEP (sizeof (struct SEP))
  136. #define cwSEP (cchSEP / sizeof (int))
  137. struct PROP
  138. { /* A CHP, PAP, or SEP. */
  139. unsigned char fStyled : 1;
  140. unsigned char stc : 7;
  141. CHAR rgb[cchPAP - 1]; /* Variable size */
  142. };
  143. #define cchPROP (sizeof (struct PROP))
  144. typedef struct
  145. { /* tri-state value for character/paragraph properties */
  146. unsigned wTsv; /* 16 bit value */
  147. unsigned char fGray;
  148. }TSV;
  149. #define cchTSV (sizeof (TSV))
  150. #define itsvMax 6
  151. #define itsvchMax 6
  152. #define itsvparaMax 5
  153. /* character index values */
  154. #define itsvBold 0
  155. #define itsvItalic 1
  156. #define itsvUline 2
  157. #define itsvPosition 3 /* 0 = normal; >0 = superscript; <0 = subscript */
  158. #define itsvFfn 4 /* font name and family */
  159. #define itsvSize 5 /* font size */
  160. /* paragraph index values */
  161. #define itsvJust 0 /* justification (left, center, right, both) */
  162. #define itsvSpacing 1
  163. #define itsvLIndent 2 /* left indent */
  164. #define itsvFIndent 3 /* first line indent */
  165. #define itsvRIndent 4 /* right indent */
  166. #define cyaInch czaInch
  167. #define cxaInch czaInch
  168. #define cyaTl czaLine
  169. #define dxaNest 720
  170. extern int cxaTc;
  171. #define yaNil 0xffff
  172. #define xaNil 0xffff
  173. #define ypNil 0xffff
  174. #define xpNil 0xffff
  175. #define dyaMinUseful cyaInch
  176. #define dxaMinUseful (cxaInch / 2)
  177. #define cColumnsMax (10)
  178. #define bkcLine 0
  179. #define bkcColumn 1
  180. #define bkcPage 2
  181. #define bkcRecto 3
  182. #define bkcVerso 4
  183. #define nfcArabic 0
  184. #define nfcUCRoman 1
  185. #define nfcLCRoman 2
  186. #define nfcUCLetter 3
  187. #define nfcLCLetter 4
  188. #define pgnNil (-1)
  189. struct PROP *PpropXlate();
  190. /* Running head codes */
  191. #define RHC_fBottom 1
  192. #define RHC_fOdd 2
  193. #define RHC_fEven 4
  194. #define RHC_fFirst 8
  195. #define rhcDefault (RHC_fOdd + RHC_fEven)
  196.