home *** CD-ROM | disk | FTP | other *** search
/ Tools / WinSN5.0Ver.iso / NETSCAP.50 / WIN1998.ZIP / ns / cmd / winfe / edtrcdll / public / ime16.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-04-08  |  8.7 KB  |  244 lines

  1. /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
  2.  *
  3.  * The contents of this file are subject to the Netscape Public License
  4.  * Version 1.0 (the "NPL"); you may not use this file except in
  5.  * compliance with the NPL.  You may obtain a copy of the NPL at
  6.  * http://www.mozilla.org/NPL/
  7.  *
  8.  * Software distributed under the NPL is distributed on an "AS IS" basis,
  9.  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
  10.  * for the specific language governing rights and limitations under the
  11.  * NPL.
  12.  *
  13.  * The Initial Developer of this code under the NPL is Netscape
  14.  * Communications Corporation.  Portions created by Netscape are
  15.  * Copyright (C) 1998 Netscape Communications Corporation.  All Rights
  16.  * Reserved.
  17.  */
  18.  
  19. #ifdef KOREA     // BeomOh - 10/05/92
  20. #define CP_HWND                 0
  21. #define CP_OPEN                 1
  22. #define CP_DIRECT               2
  23. #define CP_LEVEL                3
  24.  
  25. #define lpSource(lpks) (LPSTR)((LPSTR)lpks+lpks->dchSource)
  26. #define lpDest(lpks)   (LPSTR)((LPSTR)lpks+lpks->dchDest)
  27. #endif   // ifdef KOREA
  28.  
  29. /* virtual key */
  30. #ifdef KOREA    // BeomOh - 9/29/92
  31. #define VK_FINAL        0x18    /* dummy VK to make final on mouse down */
  32. #define VK_CONVERT      0x1C
  33. #define VK_NONCONVERT   0x1D
  34. #define VK_ACCEPT       0x1E
  35. #define VK_MODECHANGE   0x1F
  36. #else
  37. #define VK_DBE_ALPHANUMERIC     0x0f0
  38. #define VK_DBE_KATAKANA         0x0f1
  39. #define VK_DBE_HIRAGANA         0x0f2
  40. #define VK_DBE_SBCSCHAR         0x0f3
  41. #define VK_DBE_DBCSCHAR         0x0f4
  42. #define VK_DBE_ROMAN            0x0f5
  43. #define VK_DBE_NOROMAN          0x0f6
  44. #define VK_DBE_ENTERWORDREGISTERMODE 0x0f7 /* 3.1 */
  45. #define VK_DBE_IME_WORDREGISTER VK_DBE_ENTERWORDREGISTERMODE /* for 3.0 */
  46. #define VK_DBE_ENTERIMECONFIGMODE       0x0f8 /* 3.1 */
  47. #define VK_DBE_IME_DIALOG       VK_DBE_ENTERIMECONFIGMODE    /* for 3.0 */
  48. #define VK_DBE_FLUSHSTRING      0x0f9   /* 3.1 */
  49. #define VK_DBE_FLUSH            VK_DBE_FLUSHSTRING      /* for 3.0 */
  50. #define VK_DBE_CODEINPUT        0x0fa
  51. #define VK_DBE_NOCODEINPUT      0x0fb
  52. #define VK_DBE_DETERMINESTRING          0x0fc /* 3.1 */
  53. #define VK_DBE_ENTERDLGCONVERSIONMODE 0xfd /* 3.1 */
  54. #endif  // ifdef KOREA
  55.  
  56.  
  57. /* switch for wParam of IME_MOVECONVERTWINDOW (IME_SETCONVERSIONWINDOW) */
  58. #define MCW_DEFAULT     0x00
  59. #define MCW_RECT        0x01
  60. #define MCW_WINDOW      0x02
  61. #define MCW_SCREEN      0x04
  62. #define MCW_VERTICAL    0x08
  63. #define MCW_HIDDEN      0x10
  64. #define MCW_CMD         0x16            /* command mask                 */
  65.  
  66. /* switch for wParam of IME_SETCONVERSIONMODE(IME_SET_MODE) and
  67. ** IME_GETCONVERSIONMODE(IME_GET_MODE)
  68. */
  69.  
  70. #define IME_MODE_ALPHANUMERIC   0x0001
  71. #ifdef KOREA    // BeomOh - 9/29/92
  72. #define IME_MODE_SBCSCHAR       0x0002
  73. #define IME_MODE_HANJACONVERT   0x0004
  74. #else
  75. #define IME_MODE_KATAKANA       0x0002
  76. #define IME_MODE_HIRAGANA       0x0004
  77. #define IME_MODE_SBCSCHAR       0x0008
  78. #define IME_MODE_DBCSCHAR       0x0010
  79. #define IME_MODE_ROMAN          0x0020
  80. #define IME_MODE_NOROMAN        0x0040
  81. #define IME_MODE_CODEINPUT      0x0080
  82. #define IME_MODE_NOCODEINPUT    0x0100
  83. #endif
  84.  
  85. /* functions */
  86. #define IME_GETIMECAPS          0x03    /* 3.1 */
  87. #define IME_QUERY               IME_GETIMECAPS           /* for 3.0 */
  88. #define IME_SETOPEN             0x04
  89. #define IME_GETOPEN             0x05
  90. #define IME_GETVERSION          0x07    /* 3.1 */
  91. #define IME_SETCONVERSIONWINDOW 0x08    /* 3.1 */
  92. #ifdef  KOREA
  93. #define IME_MOVEIMEWINDOW       IME_SETCONVERSIONWINDOW  /* for 3.0 */
  94. #else
  95. #define IME_MOVECONVERTWINDOW   IME_SETCONVERSIONWINDOW  /* for 3.0 */
  96. #endif
  97. #define IME_SETCONVERSIONMODE   0x10    /* 3.1 */
  98. #ifdef KOREA    // BeomOh - 10/23/92
  99. #define IME_SET_MODE            0x12
  100. #else
  101. #define IME_SET_MODE            IME_SETCONVERSIONMODE    /* for 3.0 */
  102. #endif
  103. #define IME_GETCONVERSIONMODE   0x11    /* 3.1 */
  104. #define IME_GET_MODE            IME_GETCONVERSIONMODE    /* for 3.0 */
  105. #define IME_SETCONVERSIONFONT   0x12    /* 3.1 */
  106. #define IME_SETFONT             IME_SETCONVERSIONFONT    /* for 3.0 */
  107. #define IME_SENDVKEY            0x13    /* 3.1 */
  108. #define IME_SENDKEY             IME_SENDVKEY             /* for 3.0 */
  109. #define IME_PRIVATE             0x15
  110. #define IME_WINDOWUPDATE        0x16
  111. #define IME_ENTERWORDREGISTERMODE       0x18    /* 3.1 */
  112. #define IME_WORDREGISTER        IME_ENTERWORDREGISTERMODE /* for 3.0 */
  113. #define IME_SETCONVERSIONFONTEX 0x19            /* New for 3.1 */
  114. #ifdef  KOREA   // 01/12/93 KDLee MSCH
  115. #endif
  116.  
  117. #define IME_SETUNDETERMINESTRING        0x50    /* New for 3.1 (PENWIN) */
  118. #define IME_SETCAPTURE                  0x51    /* New for 3.1 (PENWIN) */
  119.  
  120. #define IME_PRIVATEFIRST        0x0100   /* New for 3.1 */
  121. #define IME_PRIVATELAST         0x04FF   /* New for 3.1 */
  122.  
  123. #ifdef KOREA    // BeomOh - 9/29/92
  124. /* IME_CODECONVERT subfunctions */
  125. #define IME_BANJAtoJUNJA        0x13
  126. #define IME_JUNJAtoBANJA        0x14
  127. #define IME_JOHABtoKS           0x15
  128. #define IME_KStoJOHAB           0x16
  129.  
  130. /* IME_AUTOMATA subfunctions */
  131. #define IMEA_INIT               0x01
  132. #define IMEA_NEXT               0x02
  133. #define IMEA_PREV               0x03
  134.  
  135. /* IME_HANJAMODE subfunctions */
  136. #define IME_REQUEST_CONVERT     0x01
  137. #define IME_ENABLE_CONVERT      0x02
  138.  
  139. /* IME_MOVEIMEWINDOW subfunctions */
  140. #define INTERIM_WINDOW          0x00
  141. #define MODE_WINDOW             0x01
  142. #define HANJA_WINDOW            0x02
  143. #endif  // ifdef KOREA
  144.  
  145.  
  146.  
  147.  
  148.  
  149.  
  150.  
  151.  
  152. // CTRL_MODIFY is "or" all modify bits, but now only one
  153.  
  154. /* error code */
  155. #define IME_RS_ERROR            0x01    /* general error                */
  156. #define IME_RS_NOIME            0x02    /* IME is not installed         */
  157. #define IME_RS_TOOLONG          0x05    /* given string is too long     */
  158. #define IME_RS_ILLEGAL          0x06    /* illegal charactor(s) is string */
  159. #define IME_RS_NOTFOUND         0x07    /* no (more) candidate          */
  160. #define IME_RS_NOROOM           0x0a    /* no disk/memory space         */
  161. #define IME_RS_DISKERROR        0x0e    /* disk I/O error               */
  162. #define IME_RS_CAPTURED         0x10    /* IME is captured (PENWIN)     */
  163. #define IME_RS_INVALID          0x11    /* invalid sub-function was specified */
  164. #define IME_RS_NEST             0x12    /* called nested */
  165. #define IME_RS_SYSTEMMODAL      0x13    /* called when system mode */
  166.  
  167. /* messge ids */
  168. #define WM_IME_REPORT           0x0280
  169. #define IR_STRINGSTART          0x100
  170. #define IR_STRINGEND            0x101
  171. #define IR_OPENCONVERT          0x120
  172. #define IR_CHANGECONVERT        0x121
  173. #define IR_CLOSECONVERT         0x122
  174. #define IR_FULLCONVERT          0x123
  175. #define IR_IMESELECT            0x130
  176. #define IR_STRING               0x140
  177. #define IR_DBCSCHAR             0x160   /* New for 3.1 */
  178. #define IR_UNDETERMINE          0x170   /* New for 3.1 */
  179. #define IR_STRINGEX             0x180   /* New for 3.1 */
  180.  
  181. #define WM_IMEKEYDOWN           0x290
  182. #define WM_IMEKEYUP             0x291
  183.  
  184.  
  185. WORD WINAPI SendIMEMessage( HWND, LPARAM );
  186. LRESULT WINAPI SendIMEMessageEx( HWND, LPARAM ); /* New for 3.1 */
  187.  
  188.  
  189. typedef struct tagIMESTRUCT {
  190.     UINT        fnc;                    /* function code                */
  191.     WPARAM      wParam;                 /* word parameter               */
  192.     UINT        wCount;                 /* word counter                 */
  193.     UINT        dchSource;/* offset to Source from top of memory object */
  194.     UINT        dchDest;  /* offset to Desrination from top of memory object */
  195.     LPARAM      lParam1;
  196.     LPARAM      lParam2;
  197.     LPARAM      lParam3;
  198.  
  199. } IMESTRUCT;
  200. typedef IMESTRUCT      *PIMESTRUCT;
  201. typedef IMESTRUCT NEAR *NPIMESTRUCT;
  202. typedef IMESTRUCT FAR  *LPIMESTRUCT;
  203.  
  204. typedef struct tagOLDUNDETERMINESTRUCT {
  205.     UINT        uSize;
  206.     UINT        uDefIMESize;
  207.     UINT        uLength;
  208.     UINT        uDeltaStart;
  209.     UINT        uCursorPos;
  210.     BYTE        cbColor[16];
  211. } OLDUNDETERMINESTRUCT,
  212.   NEAR *NPOLDUNDETERMINESTRUCT,
  213.   FAR *LPOLDUNDETERMINESTRUCT;
  214.  
  215. typedef struct tagUNDETERMINESTRUCT {
  216.     DWORD    dwSize;
  217.     UINT     uDefIMESize;
  218.     UINT     uDefIMEPos;
  219.     UINT     uUndetTextLen;
  220.     UINT     uUndetTextPos;
  221.     UINT     uUndetAttrPos;
  222.     UINT     uCursorPos;
  223.     UINT     uDeltaStart;
  224.     UINT     uDetermineTextLen;
  225.     UINT     uDetermineTextPos;
  226.     UINT     uDetermineDelimPos;
  227.     UINT     uYomiTextLen;
  228.     UINT     uYomiTextPos;
  229.     UINT     uYomiDelimPos;
  230. } UNDETERMINESTRUCT,
  231.   NEAR *NPUNDETERMINESTRUCT,
  232.   FAR *LPUNDETERMINESTRUCT;
  233.  
  234. typedef struct tagSTRINGEXSTRUCT {
  235.     DWORD    dwSize;
  236.     UINT     uDeterminePos;
  237.     UINT     uDetermineDelimPos;
  238.     UINT     uYomiPos;
  239.     UINT     uYomiDelimPos;
  240. } STRINGEXSTRUCT,
  241.   NEAR *NPSTRINGEXSTRUCT,
  242.   FAR *LPSTRINGEXSTRUCT;
  243.  
  244.