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.

265 lines
8.4 KiB

  1. #ifndef RUBY_DEFINED
  2. #define RUBY_DEFINED
  3. #include "lsimeth.h"
  4. /* Only valid version number for Ruby initialization */
  5. #define RUBY_VERSION 0x300
  6. /* Used for intialization to tell Ruby object which line comes first */
  7. typedef enum rubysyntax { RubyPronunciationLineFirst, RubyMainLineFirst } RUBYSYNTAX;
  8. /* Type of Adjustment for Ruby text returned by FetchRubyPosition callback */
  9. enum rubycharjust {
  10. rcjCenter, /* Centering occurs on longer text line */
  11. rcj010, /* Difference in space between longer text
  12. * and shorter is distributed in the shorter
  13. * string evenly between each character
  14. */
  15. rcj121, /* Difference in space between longer string
  16. * and shorter is distributed in the shorter
  17. * using a ratio of 1:2:1 which corresponds
  18. * to lead : inter-character : end.
  19. */
  20. rcjLeft, /* Align ruby with the left of the main line.
  21. */
  22. rcjRight /* Align ruby with the right of the main line.
  23. */
  24. };
  25. /* Location of character input to FetchRubyWidthAdjust callback */
  26. enum rubycharloc {
  27. rubyBefore, /* Character preceeds Ruby object */
  28. rubyAfter /* Character follows Ruby object */
  29. };
  30. /*
  31. *
  32. * Ruby Object callbacks to client application
  33. *
  34. */
  35. typedef struct RUBYCBK
  36. {
  37. LSERR (WINAPI *pfnFetchRubyPosition)(
  38. POLS pols,
  39. LSCP cp,
  40. LSTFLOW lstflow,
  41. DWORD cdwMainRuns,
  42. const PLSRUN *pplsrunMain,
  43. PCHEIGHTS pcheightsRefMain,
  44. PCHEIGHTS pcheightsPresMain,
  45. DWORD cdwRubyRuns,
  46. const PLSRUN *pplsrunRuby,
  47. PCHEIGHTS pcheightsRefRuby,
  48. PCHEIGHTS pcheightsPresRuby,
  49. PHEIGHTS pheightsRefRubyObj,
  50. PHEIGHTS pheightsPresRubyObj,
  51. long *pdvpOffsetMainBaseline,
  52. long *pdvrOffsetRubyBaseline,
  53. long *pdvpOffsetRubyBaseline,
  54. enum rubycharjust *prubycharjust,
  55. BOOL *pfSpecialLineStartEnd);
  56. /* FetchRubyPosition
  57. * pols (IN): The client context for the request.
  58. *
  59. * cp (IN): the cp of the Ruby object.
  60. *
  61. * lstflow (IN): the lstflow of Ruby parent subline
  62. *
  63. * pplsrunMain (IN): array of PLSRUNs created by the client application
  64. * for each of the runs in the main text for the Ruby object.
  65. *
  66. * pcheightsRefMain (IN): height of the line of the main text in reference
  67. * device units.
  68. *
  69. * pcheightsPresMain (IN): height of the line of the main text in presentation
  70. * device units.
  71. *
  72. * cdwRubyRuns (IN): count of pronunciation runs supplied in the following
  73. * parameter.
  74. *
  75. * pplsrunRuby (IN): array of PLSRUNS created by the client application for
  76. * each of the runs in the pronunciation text for the Ruby object.
  77. *
  78. * pcheightsRefRuby (IN): height of the line of the Ruby pronunciation text in
  79. * reference device units.
  80. *
  81. * pcheightsPresRuby (IN): height of the line of the Ruby pronunciation text in
  82. * presentation device units.
  83. *
  84. * pheightsRefRubyObj (OUT): returned height values in reference device units
  85. * that ruby object will report back to line services.
  86. *
  87. * pheightsPresRubyObj (OUT): returned height values in presentation device units
  88. * that ruby object will report back to line services.
  89. *
  90. * pdvpOffsetMainBaseline (OUT): offset of baseline of main line of Ruby
  91. * text from base line of Ruby object in presentation units. Note
  92. * a negative value puts the baseline of the main line below the
  93. * base line of the Ruby object.
  94. *
  95. * pdvrOffsetRubyBaseline (OUT): offset of baseline of pronunciation line
  96. * of Ruby text from base line of Ruby object in reference units.
  97. * Note a negative value puts the baseline of the pronunciation line
  98. * below the base line of the Ruby object.
  99. *
  100. * pdvpOffsetRubyBaseline (OUT): offset of baseline of pronunciation line
  101. * of Ruby text from base line of Ruby object in presentation units.
  102. * Note a negative value puts the baseline of the pronunciation line
  103. * below the base line of the Ruby object.
  104. *
  105. * prubycharjust (OUT): type of justification to use for Ruby Object.
  106. *
  107. * pfSpecialLineStartEnd (OUT): specifies that the optional alignment that
  108. * overrides the usual centering algorithm when the Ruby is the
  109. * first or last character of the line.
  110. *
  111. */
  112. LSERR (WINAPI *pfnFetchRubyWidthAdjust)(
  113. POLS pols,
  114. LSCP cp,
  115. PLSRUN plsrunForChar,
  116. WCHAR wch,
  117. MWCLS mwclsForChar,
  118. PLSRUN plsrunForRuby,
  119. enum rubycharloc rcl,
  120. long durMaxOverhang,
  121. long *pdurAdjustChar,
  122. long *pdurAdjustRuby);
  123. /* FetchRubyWidthAdjust
  124. * pols (IN): The client context for the request.
  125. *
  126. * cp (IN): the cp of the Ruby object.
  127. *
  128. * plsrunForChar (IN): the run that is either previous or following the
  129. * Ruby object.
  130. *
  131. * wch (IN): character that is either before or after the Ruby object.
  132. *
  133. * mwcls (IN): mod width class for the character.
  134. *
  135. * plsrunForRuby (IN): plsrun for entire ruby object.
  136. *
  137. * rcl (IN): tells the location of the character.
  138. *
  139. * durMaxOverhang (IN): designates the maximum amount of overhang that is
  140. * possible following the JIS spec with respect to overhang.
  141. * Adjusting the Ruby object by a negative value whose absolute
  142. * value is greater than durMaxOverhang will cause part of the
  143. * main text to be clipped. If the value of this parameter is 0,
  144. * this indicates that there is no possible overhang.
  145. *
  146. * pdurAdjustChar (OUT): designates the amount to adjust the width of the
  147. * character prior to or following the Ruby object. Returing a negative
  148. * value will decrease the size of the character preceeding or following
  149. * the Ruby while returning a positive value will increase the size
  150. * of that character.
  151. *
  152. * pdurAdjustRuby (OUT): designates the amount adjust the width of the Ruby
  153. * object. Returing a negative value will decrease the size of the
  154. * Ruby object and potentially cause the Ruby pronunciation text to
  155. * overhang the preceeding or following character while returning a
  156. * positive value will increase the size of the Ruby object.
  157. */
  158. LSERR (WINAPI* pfnRubyEnum)(
  159. POLS pols,
  160. PLSRUN plsrun,
  161. PCLSCHP plschp,
  162. LSCP cp,
  163. LSDCP dcp,
  164. LSTFLOW lstflow,
  165. BOOL fReverse,
  166. BOOL fGeometryNeeded,
  167. const POINT* pt,
  168. PCHEIGHTS pcheights,
  169. long dupRun,
  170. const POINT *ptMain,
  171. PCHEIGHTS pcheightsMain,
  172. long dupMain,
  173. const POINT *ptRuby,
  174. PCHEIGHTS pcheightsRuby,
  175. long dupRuby,
  176. PLSSUBL plssublMain,
  177. PLSSUBL plssublRuby);
  178. /* RubyEnum
  179. *
  180. * pols (IN): client context.
  181. *
  182. * plsrun (IN): plsrun for the entire Ruby Object.
  183. *
  184. * plschp (IN): is lschp for lead character of Ruby Object.
  185. *
  186. * cp (IN): is cp of first character of Ruby Object.
  187. *
  188. * dcp (IN): is number of characters in Ruby Object
  189. *
  190. * lstflow (IN): is text flow at Ruby Object.
  191. *
  192. * fReverse (IN): is whether text should be reversed for visual order.
  193. *
  194. * fGeometryNeeded (IN): is whether Geometry should be returned.
  195. *
  196. * pt (IN): is starting position , iff fGeometryNeeded .
  197. *
  198. * pcheights (IN): is height of Ruby object, iff fGeometryNeeded.
  199. *
  200. * dupRun (IN): is length of Ruby Object, iff fGeometryNeeded.
  201. *
  202. * ptMain (IN): is starting point for main line iff fGeometryNeeded
  203. *
  204. * pcheightsMain (IN): is height of main line iff fGeometryNeeded
  205. *
  206. * dupMain (IN): is length of main line iff fGeometryNeeded
  207. *
  208. * ptRuby (IN): is point for Ruby pronunciation line iff fGeometryNeeded
  209. *
  210. * pcheightsRuby (IN): is height for ruby line iff fGeometryNeeded
  211. *
  212. * dupRuby (IN): is length of Ruby line iff fGeometryNeeded
  213. *
  214. * plssublMain (IN): is main subline.
  215. *
  216. * plssublRuby (IN): is Ruby subline.
  217. *
  218. */
  219. } RUBYCBK;
  220. /*
  221. *
  222. * Ruby Object initialization data that the client application must return
  223. * when the Ruby object handler calls the GetObjectHandlerInfo callback.
  224. *
  225. */
  226. typedef struct RUBYINIT
  227. {
  228. DWORD dwVersion; /* Version of the structure */
  229. RUBYSYNTAX rubysyntax; /* Used to determine order of lines during format */
  230. WCHAR wchEscRuby; /* Escape char for end of Ruby pronunciation line */
  231. WCHAR wchEscMain; /* Escape char for end of main text */
  232. WCHAR wchUnused1; /* For aligment */
  233. WCHAR wchUnused2; /* For aligment */
  234. RUBYCBK rcbk; /* Ruby callbacks */
  235. } RUBYINIT;
  236. LSERR WINAPI LsGetRubyLsimethods(
  237. LSIMETHODS *plsim);
  238. /* GetRubyLsimethods
  239. *
  240. * plsim (OUT): Ruby object methods for Line Services.
  241. *
  242. */
  243. #endif /* RUBY_DEFINED */