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.

338 lines
9.9 KiB

  1. //
  2. //
  3. // IME.H - East Asia Input Method Editor definitions
  4. //
  5. //
  6. #ifdef DBCS_IME
  7. #ifdef KOREA // BeomOh - 10/05/92
  8. #define CP_HWND 0
  9. #define CP_OPEN 1
  10. #define CP_DIRECT 2
  11. #define CP_LEVEL 3
  12. #define lpSource(lpks) (LPSTR)((LPSTR)lpks+lpks->dchSource)
  13. #define lpDest(lpks) (LPSTR)((LPSTR)lpks+lpks->dchDest)
  14. #endif // ifdef KOREA
  15. //
  16. // virtual key
  17. //
  18. #ifdef KOREA // BeomOh - 9/29/92
  19. #define VK_FINAL 0x18 /* dummy VK to make final on mouse down */
  20. #define VK_CONVERT 0x1C
  21. #define VK_NONCONVERT 0x1D
  22. #define VK_ACCEPT 0x1E
  23. #define VK_MODECHANGE 0x1F
  24. #endif // ifdef KOREA
  25. #ifdef JAPAN
  26. #define VK_DBE_ALPHANUMERIC 0x0f0
  27. #define VK_DBE_KATAKANA 0x0f1
  28. #define VK_DBE_HIRAGANA 0x0f2
  29. #define VK_DBE_SBCSCHAR 0x0f3
  30. #define VK_DBE_DBCSCHAR 0x0f4
  31. #define VK_DBE_ROMAN 0x0f5
  32. #define VK_DBE_NOROMAN 0x0f6
  33. #define VK_DBE_ENTERWORDREGISTERMODE 0x0f7 /* 3.1 */
  34. #define VK_DBE_IME_WORDREGISTER VK_DBE_ENTERWORDREGISTERMODE /* for 3.0 */
  35. #define VK_DBE_ENTERIMECONFIGMODE 0x0f8 /* 3.1 */
  36. #define VK_DBE_IME_DIALOG VK_DBE_ENTERIMECONFIGMODE /* for 3.0 */
  37. #define VK_DBE_FLUSHSTRING 0x0f9 /* 3.1 */
  38. #define VK_DBE_FLUSH VK_DBE_FLUSHSTRING /* for 3.0 */
  39. #define VK_DBE_CODEINPUT 0x0fa
  40. #define VK_DBE_NOCODEINPUT 0x0fb
  41. #define VK_DBE_DETERMINESTRING 0x0fc /* 3.1 */
  42. #define VK_DBE_ENTERDLGCONVERSIONMODE 0xfd /* 3.1 */
  43. #endif // JAPAN
  44. #ifdef TAIWAN
  45. #define VK_OEM_SEMICLN 0x0ba // ; ** :
  46. #define VK_OEM_EQUAL 0x0bb // = ** +
  47. #define VK_OEM_COMMA 0x0bc // , ** <
  48. #define VK_OEM_MINUS 0x0bd // - ** _
  49. #define VK_OEM_PERIOD 0x0be // . ** >
  50. #define VK_OEM_SLASH 0x0bf // / ** ?
  51. #define VK_OEM_3 0x0c0 // ` ** ~
  52. #define VK_OEM_LBRACKET 0x0db // [ ** {
  53. #define VK_OEM_BSLASH 0x0dc // \ ** |
  54. #define VK_OEM_RBRACKET 0x0dd // ] ** |
  55. #define VK_OEM_QUOTE 0x0de // ' ** "
  56. #endif // TAIWAN
  57. #ifdef PRC
  58. #define VK_OEM_SEMICLN 0x0ba // ; ** :
  59. #define VK_OEM_EQUAL 0x0bb // = ** +
  60. #define VK_OEM_COMMA 0x0bc // , ** <
  61. #define VK_OEM_MINUS 0x0bd // - ** _
  62. #define VK_OEM_PERIOD 0x0be // . ** >
  63. #define VK_OEM_SLASH 0x0bf // / ** ?
  64. #define VK_OEM_3 0x0c0 // ` ** ~
  65. #define VK_OEM_LBRACKET 0x0db // [ ** {
  66. #define VK_OEM_BSLASH 0x0dc // \ ** |
  67. #define VK_OEM_RBRACKET 0x0dd // ] ** |
  68. #define VK_OEM_QUOTE 0x0de // ' ** "
  69. #endif // PRC
  70. //
  71. // switch for wParam of IME_MOVECONVERTWINDOW
  72. //
  73. #define MCW_DEFAULT 0x00
  74. #define MCW_RECT 0x01
  75. #define MCW_WINDOW 0x02
  76. #define MCW_SCREEN 0x04
  77. #define MCW_VERTICAL 0x08
  78. #define MCW_HIDDEN 0x10
  79. #define MCW_CMD 0x06 // command mask
  80. //
  81. // switch for wParam of IME_SET_MODE and IME_GET_MODE
  82. //
  83. //
  84. #if defined(JAPAN) || defined(TAIWAN) || defined(PRC)
  85. #define IME_MODE_ALPHANUMERIC 0x0001
  86. #define IME_MODE_KATAKANA 0x0002
  87. #define IME_MODE_HIRAGANA 0x0004
  88. #define IME_MODE_SBCSCHAR 0x0008
  89. #define IME_MODE_DBCSCHAR 0x0010
  90. #define IME_MODE_ROMAN 0x0020
  91. #define IME_MODE_NOROMAN 0x0040
  92. #define IME_MODE_CODEINPUT 0x0080
  93. #define IME_MODE_NOCODEINPUT 0x0100
  94. #endif // JAPAN || TAIWAN || PRC
  95. #ifdef KOREA
  96. #define IME_MODE_ALPHANUMERIC 0x0001
  97. #define IME_MODE_SBCSCHAR 0x0002
  98. #define IME_MODE_HANJACONVERT 0x0004
  99. #endif // KOREA
  100. //
  101. // IME function code
  102. //
  103. #define IME_GETIMECAPS 0x03 /* 3.1 */
  104. #define IME_QUERY IME_GETIMECAPS /* for 3.0 */
  105. #define IME_SETOPEN 0x04
  106. #define IME_GETOPEN 0x05
  107. #define IME_ENABLE 0x06 /* ;Internal */
  108. #define IME_GETVERSION 0x07 /* 3.1 */
  109. #define IME_SETCONVERSIONWINDOW 0x08 /* 3.1 */
  110. #ifdef KOREA
  111. #define IME_MOVEIMEWINDOW IME_SETCONVERSIONWINDOW /* for 3.0 */
  112. #else
  113. #define IME_MOVECONVERTWINDOW IME_SETCONVERSIONWINDOW /* for 3.0 */
  114. #endif
  115. #define IME_SETCONVERSIONMODE 0x10 /* 3.1 */
  116. #ifdef KOREA // BeomOh - 10/23/92
  117. #define IME_SET_MODE 0x12
  118. #else
  119. #define IME_SET_MODE IME_SETCONVERSIONMODE /* for 3.0 */
  120. #endif
  121. #define IME_GETCONVERSIONMODE 0x11 /* 3.1 */
  122. #define IME_GET_MODE IME_GETCONVERSIONMODE /* for 3.0 */
  123. #define IME_SETCONVERSIONFONT 0x12 /* 3.1 */
  124. #define IME_SETFONT IME_SETCONVERSIONFONT /* for 3.0 */
  125. #define IME_SENDVKEY 0x13 /* 3.1 */
  126. #define IME_SENDKEY IME_SENDVKEY /* for 3.0 */
  127. #define IME_DESTROY 0x14 /* ;Internal */
  128. #define IME_PRIVATE 0x15
  129. #define IME_WINDOWUPDATE 0x16
  130. #define IME_SELECT 0x17 /* ;Internal */
  131. #define IME_ENTERWORDREGISTERMODE 0x18 /* 3.1 */
  132. #define IME_WORDREGISTER IME_ENTERWORDREGISTERMODE /* for 3.0 */
  133. #define IME_SETCONVERSIONFONTEX 0x19 /* New for 3.1 */
  134. #ifdef KOREA
  135. #define IME_CODECONVERT 0x20
  136. #define IME_CONVERTLIST 0x21
  137. #define IME_AUTOMATA 0x30
  138. #define IME_HANJAMODE 0x31
  139. #define IME_GETLEVEL 0x40
  140. #define IME_SETLEVEL 0x41
  141. #endif // KOREA
  142. #ifdef TAIWAN
  143. #define IME_SETUSRFONT 0x20
  144. #define IME_QUERYUSRFONT 0x21
  145. #define IME_INPUTKEYTOSEQUENCE 0x22
  146. #define IME_SEQUENCETOINTERNAL 0x23
  147. #define IME_QUERYIMEINFO 0x24
  148. #define IME_DIALOG 0x25
  149. #endif // TAIWAN
  150. #ifdef PRC
  151. #define IME_SETUSRFONT 0x20
  152. #define IME_QUERYUSRFONT 0x21
  153. #define IME_INPUTKEYTOSEQUENCE 0x22
  154. #define IME_SEQUENCETOINTERNAL 0x23
  155. #define IME_QUERYIMEINFO 0x24
  156. #define IME_DIALOG 0x25
  157. #endif // PRC
  158. #define IME_SETUNDETERMINESTRING 0x50 /* New for 3.1 (PENWIN) */
  159. #define IME_SETCAPTURE 0x51 /* New for 3.1 (PENWIN) */
  160. #define IME_PRIVATEFIRST 0x0100 /* New for 3.1 */
  161. #define IME_PRIVATELAST 0x04FF /* New for 3.1 */
  162. //
  163. // error code
  164. //
  165. #define IME_RS_ERROR 0x01 // genetal error
  166. #define IME_RS_NOIME 0x02 // IME is not installed
  167. #define IME_RS_TOOLONG 0x05 // given string is too long
  168. #define IME_RS_ILLEGAL 0x06 // illegal charactor(s) is string
  169. #define IME_RS_NOTFOUND 0x07 // no (more) candidate
  170. #define IME_RS_NOROOM 0x0a // no disk/memory space
  171. #define IME_RS_DISKERROR 0x0e // disk I/O error
  172. #define IME_RS_CAPTURED 0x10 // IME is captured (PENWIN)
  173. #define IME_RS_INVALID 0x11 // invalid sub-function was specified
  174. #define IME_RS_NEST 0x12 // called nested
  175. #define IME_RS_SYSTEMMODAL 0x13 // called when system mode
  176. //
  177. // messge id
  178. //
  179. #define WM_IME_REPORT 0x0280 // WM_KANJIFIRST
  180. #define IR_STRINGSTART 0x100
  181. #define IR_STRINGEND 0x101
  182. #define IR_MOREROOM 0x110
  183. #define IR_OPENCONVERT 0x120
  184. #define IR_CHANGECONVERT 0x121
  185. #define IR_CLOSECONVERT 0x122
  186. #define IR_FULLCONVERT 0x123
  187. #define IR_IMESELECT 0x130
  188. #define IR_STRING 0x140
  189. #define IR_DBCSCHAR 0x160 /* New for 3.1 */
  190. #define IR_UNDETERMINE 0x170 /* New for 3.1 */
  191. #define IR_STRINGEX 0x180 /* New for 3.1 */
  192. #define WM_IMEKEYDOWN 0x290
  193. #define WM_IMEKEYUP 0x291
  194. //
  195. // IMM functions
  196. //
  197. typedef struct tagIMESTRUCT {
  198. WORD fnc; // function code
  199. WORD wParam; // word parameter
  200. WORD wCount; // word counter
  201. WORD dchSource; // offset to src from top of memory object
  202. WORD dchDest; // offset to dst from top of memory object
  203. LONG lParam1;
  204. LONG lParam2;
  205. LONG lParam3;
  206. } IMESTRUCT;
  207. typedef IMESTRUCT *PIMESTRUCT;
  208. typedef IMESTRUCT NEAR *NPIMESTRUCT;
  209. typedef IMESTRUCT FAR *LPIMESTRUCT;
  210. short FAR PASCAL SendIMEMessage( HWND, DWORD );
  211. LONG WINAPI SendIMEMessageEx( HWND, LPARAM ); /* New for 3.1 */
  212. #if defined(TAIWAN) || defined(PRC)
  213. LONG FAR PASCAL WINNLSIMEControl(HWND,HWND,LPIMESTRUCT);
  214. #endif
  215. typedef struct tagOLDUNDETERMINESTRUCT {
  216. UINT uSize;
  217. UINT uDefIMESize;
  218. UINT uLength;
  219. UINT uDeltaStart;
  220. UINT uCursorPos;
  221. BYTE cbColor[16];
  222. /* -- These members will have variable length. --
  223. BYTE cbAttrib[];
  224. BYTE cbText[];
  225. BYTE cbIMEDef[];
  226. */
  227. } OLDUNDETERMINESTRUCT,
  228. NEAR *NPOLDUNDETERMINESTRUCT,
  229. FAR *LPOLDUNDETERMINESTRUCT;
  230. typedef struct tagUNDETERMINESTRUCT {
  231. DWORD dwSize;
  232. UINT uDefIMESize;
  233. UINT uDefIMEPos;
  234. UINT uUndetTextLen;
  235. UINT uUndetTextPos;
  236. UINT uUndetAttrPos;
  237. UINT uCursorPos;
  238. UINT uDeltaStart;
  239. UINT uDetermineTextLen;
  240. UINT uDetermineTextPos;
  241. UINT uDetermineDelimPos;
  242. UINT uYomiTextLen;
  243. UINT uYomiTextPos;
  244. UINT uYomiDelimPos;
  245. } UNDETERMINESTRUCT,
  246. NEAR *NPUNDETERMINESTRUCT,
  247. FAR *LPUNDETERMINESTRUCT;
  248. typedef struct tagSTRINGEXSTRUCT {
  249. DWORD dwSize;
  250. UINT uDeterminePos;
  251. UINT uDetermineDelimPos;
  252. UINT uYomiPos;
  253. UINT uYomiDelimPos;
  254. } STRINGEXSTRUCT,
  255. NEAR *NPSTRINGEXSTRUCT,
  256. FAR *LPSTRINGEXSTRUCT;
  257. //
  258. // miscellaneous
  259. //
  260. #if defined(TAIWAN) || defined(PRC)
  261. #define STATUSWINEXTRA 10
  262. #endif
  263. #ifdef KOREA
  264. //
  265. // ----- definitions for level2 apps -----
  266. //
  267. typedef unsigned char far *LPKSTR ;
  268. /* VK from the keyboard driver */
  269. #define VK_FINAL 0x18 // dummy VK to make final on mouse down
  270. #define VK_IME_DIALOG 0xf1
  271. #define CP_HWND 0
  272. #define CP_OPEN 1
  273. //#define CP_DIRECT 2
  274. #define CP_LEVEL 3
  275. #define lpSource(lpks) (LPSTR)((LPSTR)lpks+lpks->dchSource)
  276. #define lpDest(lpks) (LPSTR)((LPSTR)lpks+lpks->dchDest)
  277. //
  278. // ----- definitions for level3 apps -----
  279. //
  280. /* VK to send to Applications */
  281. #define VK_CONVERT 0x1C
  282. #define VK_NONCONVERT 0x1D
  283. #define VK_ACCEPT 0x1E
  284. #define VK_MODECHANGE 0x1F
  285. /* IME_CODECONVERT subfunctions */
  286. #define IME_BANJAtoJUNJA 0x13
  287. #define IME_JUNJAtoBANJA 0x14
  288. #define IME_JOHABtoKS 0x15
  289. #define IME_KStoJOHAB 0x16
  290. /* IME_AUTOMATA subfunctions */
  291. #define IMEA_INIT 0x01
  292. #define IMEA_NEXT 0x02
  293. #define IMEA_PREV 0x03
  294. /* IME_HANJAMODE subfunctions */
  295. #define IME_REQUEST_CONVERT 0x01
  296. #define IME_ENABLE_CONVERT 0x02
  297. /* IME_MOVEIMEWINDOW subfunctions */
  298. #define INTERIM_WINDOW 0x00
  299. #define MODE_WINDOW 0x01
  300. #define HANJA_WINDOW 0x02
  301. #endif // KOREA
  302. #endif // DBCS_IME