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.

198 lines
5.9 KiB

  1. #ifdef __cplusplus
  2. extern "C" {
  3. #endif
  4. /************************************************************************
  5. *
  6. * MVDBCS.H
  7. *
  8. * Copyright (c) Microsoft Corporation 1994
  9. * All rights reserved.
  10. *
  11. *************************************************************************
  12. *
  13. * Module intent: Header file for the DBCS support.
  14. *
  15. *************************************************************************
  16. *
  17. * Current owner: DougO
  18. *
  19. ************************************************************************/
  20. #define LANGUAGE_ENGLISH 0x00
  21. #define LANGUAGE_JAPANESE 0x01
  22. #define LANGUAGE_TRAD_CHINESE 0x02 // Mapped to old LANGUAGE_CHINESE
  23. #define LANGUAGE_KOREAN 0x03
  24. #define LANGUAGE_ANSI 0x04
  25. #define LANGUAGE_SIMP_CHINESE 0x05
  26. #define SZ_LANGUAGE_ENGLISH L"English"
  27. #define SZ_LANGUAGE_JAPANESE L"Japanese"
  28. #define SZ_LANGUAGE_TRAD_CHINESE L"TradChinese"
  29. #define SZ_LANGUAGE_KOREAN L"Korean"
  30. #define SZ_LANGUAGE_ANSI L"ANSI"
  31. #define SZ_LANGUAGE_SIMP_CHINESE L"SimpChinese"
  32. #define CSZ_LANGUAGE_ENGLISH 7 // strlen (SZ_LANGUAGE_ENGLISH)
  33. #define CSZ_LANGUAGE_JAPANESE 8 // strlen (SZ_LANGUAGE_JAPANESE)
  34. #define CSZ_LANGUAGE_TRAD_CHINESE 11 // strlen (SZ_LANGUAGE_TRAD_CHINESE)
  35. #define CSZ_LANGUAGE_KOREAN 6 // strlen (SZ_LANGUAGE_KOREAN)
  36. #define CSZ_LANGUAGE_ANSI 4 // strlen (SZ_LANGUAGE_ANSI)
  37. #define CSZ_LANGUAGE_SIMP_CHINESE 11 // strlen (SZ_LANGUAGE_SIMP_CHINESE)
  38. #define IS_DBCS(qde) ((qde)->bCurLanguage != LANGUAGE_ANSI)
  39. // for speed, the layout engine sometimes bypasses these macros by having
  40. // two separate routines: DBCS and non-DBCS
  41. #define PREVINDEX(qde, a,b) (IS_DBCS(qde) ? PchPrevDbcsIndex(qde, a,b) : (b) - 1)
  42. #define NEXTINDEX(qde, a,b) (IS_DBCS(qde) ? PchNextDbcsIndex(qde, a,b) : (b) + 1)
  43. #define FLINEBREAK(qde,qlin, a,b,c) (IS_DBCS(qde) ? FLineBreak(qde, (qlin)->kl.qbCommand, a,b,c) : 0)
  44. #define CHARNEXT(qde, ch) (IS_DBCS(qde) ? ch=PchNextDbcs(qde, ch) : ch++)
  45. //#ifdef _DBCS
  46. #ifdef _32BIT
  47. #include <winnls.h>
  48. #else
  49. #include <olenls.h>
  50. #endif
  51. BOOL FIsDbcsLeadByte(QDE, char);
  52. BOOL FIsDbcsLeadByte2(QDE, char *, char *);
  53. BOOL FLineBreak(QDE, LPBYTE lpbCom, char *psz, char *pch, BOOL);
  54. char * PchPrevDbcs(QDE, char *, char *);
  55. char * PchPrevDbcs2(QDE, char *, char *);
  56. long PchPrevDbcsIndex(QDE, char *, long);
  57. long PchNextDbcsIndex(QDE, char *, long);
  58. char * PchNextDbcs(QDE, char *);
  59. ERR InitDBCS(QDE qde, HANDLE hTitle);
  60. void FreeDBCS(QDE qde);
  61. extern BOOL bUseDBCBoundary;
  62. //#define CHARNEXT(a) a=PchNextDbcs(a)
  63. //#define ISDBCSLEADBYTE(a) FIsDbcsLeadByte(a)
  64. //#define CHARPREV2(a,b) b=PchPrevDbcs2(a,b)
  65. //#define NEXTCHAR(a) PchNextDbcs(a)
  66. //#define PREVINDEX(a,b) PchPrevDbcsIndex(a,b)
  67. //#define NEXTINDEX(a,b) PchNextDbcsIndex(a,b)
  68. #define chKataMin 0xa1
  69. #define chKataMac 0xe0
  70. #define wchSpace 0x8140
  71. #define lchSpace 0x4081
  72. #define wchPlus 0x7b81
  73. #define wchMinus 0x7c81
  74. #define wchNum0 0x4f82
  75. #define wchNum9 0x5882
  76. #define wchUppA 0x6082
  77. #define wchUppZ 0x7982
  78. #define wchLowA 0x8182
  79. #define wchLowZ 0x9a82
  80. #define wchKanaMin 0x9f82
  81. #define wchKanaMac 0x9783
  82. #define wchKataMin 0x4083
  83. #define wchHiraMin 0x9f82
  84. #define wchHaveKDakuMin 0x4a83 /* Katakana */
  85. #define wchHaveHDakuMin 0xa982 /* Hiragana */
  86. #define wchHaveHDakuMac 0xdc82 /* Hiragana */
  87. #define wchHaveDakuMac 0x7c83
  88. #define wchHiraganaFirst 0x9f82
  89. #define wchHiraganaLast 0xf182
  90. #define wchKatakanaFirst 0x4083
  91. #define wchKatakanaLast 0x9683
  92. #define wchKanjiFirst 0x9f88
  93. // list of leading punctuations: don't break line after these
  94. #define chLeft0 0xa2
  95. #define wchLeft0 0x6581
  96. #define wchLeft1 0x6781
  97. #define wchLeft2 0x6981
  98. #define wchLeft3 0x6b81
  99. #define wchLeft4 0x6d81
  100. #define wchLeft5 0x6f81
  101. #define wchLeft6 0x7181
  102. #define wchLeft7 0x7381
  103. #define wchLeft8 0x7581
  104. #define wchLeft9 0x7781
  105. #define wchLeftA 0x7981
  106. // list of following punctuations: don't break line before these
  107. #define chKuten 0xa1
  108. #define chRight0 0xa3
  109. #define chTouten 0xa4
  110. #define chMidDot 0xa5
  111. // small kata are also forbidden followers..0xa7 thru 0xaf
  112. #define chChohon 0xb0
  113. #define chDakuten 0xde
  114. #define chHandaku 0xdf
  115. #define wchTouten 0x4181
  116. #define wchKuten 0x4281
  117. #define wchComma 0x4381
  118. #define wchPeriod 0x4481
  119. #define wchMidDot 0x4581
  120. #define wchColon 0x4681
  121. #define wchSemiCol 0x4781
  122. #define wchQuestion 0x4881
  123. #define wchExclam 0x4981
  124. #define wchDakuten 0x4a81
  125. #define wchHandaku 0x4b81
  126. #define wchChohon 0x5b81
  127. #define wchRight0 0x6681
  128. #define wchRight1 0x6881
  129. #define wchRight2 0x6a81
  130. #define wchRight3 0x6c81
  131. #define wchRight4 0x6e81
  132. #define wchRight5 0x7081
  133. #define wchRight6 0x7281
  134. #define wchRight7 0x7481
  135. #define wchRight8 0x7681
  136. #define wchRight9 0x7881
  137. #define wchRightA 0x7a81
  138. // other defines
  139. #define chShade 0x7f
  140. #define wchEqual 0x8181 /* '=' of DBC */
  141. #define wchQuote 0x6881 /* '"' of DBC */
  142. #define wchAt 0x9781 /* '@' of DBC */
  143. #define wchLessThan 0x8381 /* '<' of DBC */
  144. #define wchGrtThan 0x8481 /* '>' of DBC */
  145. #define wchLParen 0x6981 /* '(' of DBC */
  146. #define wchRParen 0x6a81 /* ')' of DBC */
  147. #define wchAsterisk 0x9681 /* '*' of DBC */
  148. #define wchSlash 0x5e81 /* '/' of DBC */
  149. #define wchCircumflex 0x4f81 /* '^' of DBC */
  150. #define wchAnd 0x9581 /* '&' of DBC */
  151. #define wchOr 0x6281 /* '|' of DBC */
  152. #define wchPercent 0x9381 /* '%' of DBC */
  153. #define wchTilde 0x6081 /* '~' of DBC */
  154. #define wchName 0x6681 /* pc's chName */
  155. #define wchNameAlt 0x6881 /* pc's chNameAlt */
  156. #define wchRow 0x7182 /* pc's chRow */
  157. #define wchCol 0x6282 /* pc's chCol */
  158. #define cwchLedPunct 15
  159. #define cwchFlwPunct 39
  160. // double width character end mark
  161. #define wchDwidthMark 0x814e
  162. //#else not DBCS
  163. //
  164. //#define CHARNEXT(a) (a++)
  165. //#define NEXTCHAR(a) ((a)+1)
  166. //#define CHARPREV2(a,b) (b--)
  167. //#define PREVINDEX(a,b) (b-1)
  168. //#define NEXTINDEX(a,b) (b+1)
  169. //#endif
  170. #ifdef __cplusplus
  171. }
  172. #endif