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.

252 lines
8.9 KiB

  1. /*************************************************
  2. * imeattr.h *
  3. * *
  4. * Copyright (C) 1999 Microsoft Inc. *
  5. * *
  6. *************************************************/
  7. #if !defined(ROMANIME)
  8. // the mode configuration for an IME
  9. #define MODE_CONFIG_QUICK_KEY 0x0001
  10. #define MODE_CONFIG_PREDICT 0x0004
  11. #endif
  12. #define MODE_CONFIG_OFF_CARET_UI 0x0008
  13. #if defined(PHON)
  14. // the different layout for Phonetic reading
  15. #define READ_LAYOUT_DEFAULT 0
  16. #define READ_LAYOUT_ETEN 1
  17. #define READ_LAYOUT_IBM 2
  18. #define READ_LAYOUT_CHINGYEAH 3
  19. #define READ_LAYOUTS 4
  20. #endif
  21. // the bit of fwProperties1
  22. #define IMEPROP_CAND_NOBEEP_GUIDELINE 0x0001
  23. #define IMEPROP_UNICODE 0x0002
  24. #if !defined(WINIME) && !defined(UNICDIME) && !defined(ROMANIME)
  25. #define USR_DIC_SIZE 160
  26. typedef struct tagUsrDic {
  27. TCHAR szUsrDic[USR_DIC_SIZE/sizeof(TCHAR)];
  28. } USRDIC;
  29. typedef USRDIC *PUSRDIC;
  30. typedef USRDIC NEAR *NPUSRDIC;
  31. typedef USRDIC FAR *LPUSRDIC;
  32. #endif
  33. #define MAX_NAME_LENGTH 32
  34. #if !defined(ROMANIME)
  35. #if defined(UNIIME) || defined(MINIIME)
  36. #define MAX_IME_TABLES 6
  37. #else
  38. #define MAX_IME_TABLES 4
  39. #endif
  40. typedef struct tagTableFiles { // match with the IMEL
  41. TCHAR szTblFile[MAX_IME_TABLES][MAX_NAME_LENGTH / sizeof(TCHAR)];
  42. } TABLEFILES;
  43. typedef TABLEFILES *PTABLEFILES;
  44. typedef TABLEFILES NEAR *NPTABLEFILES;
  45. typedef TABLEFILES FAR *LPTABLEFILES;
  46. typedef struct tagValidChar { // match with the IMEL
  47. DWORD dwVersion;
  48. WORD fwProperties1;
  49. WORD fwProperties2;
  50. WORD nMaxKey;
  51. WORD nSeqCode;
  52. WORD fChooseChar[6];
  53. WORD wReserved1[2];
  54. #if defined(DAYI) || defined(UNIIME) || defined(MINIIME)
  55. BYTE cChooseTrans[0x60];
  56. #endif
  57. WORD fCompChar[6];
  58. WORD wReserved2[2];
  59. WORD wCandPerPage;
  60. WORD wCandStart;
  61. WORD wCandRangeStart;
  62. WORD wReserved3[1];
  63. WORD wSeq2CompTbl[64];
  64. WORD wChar2SeqTbl[0x42];
  65. WORD wReserved4[2];
  66. #if defined(WINAR30)
  67. WORD wSymbol[356];
  68. #elif defined(DAYI)
  69. WORD wSymbol[340];
  70. #elif defined(UNIIME) || defined(MINIME)
  71. DWORD dwReserved5[32];
  72. #endif
  73. } VALIDCHAR;
  74. typedef VALIDCHAR *PVALIDCHAR;
  75. typedef VALIDCHAR NEAR *NPVALIDCHAR;
  76. typedef VALIDCHAR FAR *LPVALIDCHAR;
  77. #endif // !defined(ROMANIME)
  78. typedef struct tagImeL { // local structure, per IME structure
  79. // interlock protection variables
  80. LONG lConfigGeneral;
  81. LONG lConfigRegWord;
  82. LONG lConfigSelectDic;
  83. TCHAR szIMEName[MAX_NAME_LENGTH / sizeof(TCHAR)];
  84. TCHAR szUIClassName[MAX_NAME_LENGTH / sizeof(TCHAR)];
  85. TCHAR szStatusClassName[MAX_NAME_LENGTH / sizeof(TCHAR)];
  86. TCHAR szOffCaretClassName[MAX_NAME_LENGTH / sizeof(TCHAR)];
  87. TCHAR szCMenuClassName[MAX_NAME_LENGTH / sizeof(TCHAR)];
  88. // Configuration of the IME
  89. DWORD fdwModeConfig; // quick key/prediction mode
  90. // status window
  91. int xStatusWi; // width of status window
  92. int yStatusHi; // high of status window
  93. int cxStatusBorder; // border width of status window
  94. int cyStatusBorder; // border height of status window
  95. RECT rcStatusText; // text position relative to status window
  96. RECT rcInputText; // input text relateive to status window
  97. RECT rcShapeText; // shape text relative to status window
  98. #if defined(ROMANIME)
  99. WORD nMaxKey; // max key of a Chinese word
  100. WORD wDummy; // DWORD bounary
  101. #else
  102. int xCompWi; // width
  103. int yCompHi; // height
  104. int cxCompBorder; // border width of composition window
  105. int cyCompBorder; // border height of composition window
  106. RECT rcCompText; // text position relative to composition window
  107. // candidate list of composition
  108. int xCandWi; // width of candidate list
  109. int yCandHi; // high of candidate list
  110. int cxCandBorder; // border width of candidate list
  111. int cyCandBorder; // border height of candidate list
  112. int cxCandMargin; // interior border width of candidate list
  113. int cyCandMargin; // interior border height of candidate list
  114. RECT rcCandText; // text position relative to candidate window
  115. RECT rcCandPrompt; // candidate prompt bitmap
  116. RECT rcCandPageText; // candidate page controls - up / home / down
  117. RECT rcCandPageUp; // candidate page up
  118. RECT rcCandHome; // candidate home page
  119. RECT rcCandPageDn; // candidate page down
  120. TCHAR szCompClassName[MAX_NAME_LENGTH / sizeof(TCHAR)];
  121. TCHAR szCandClassName[MAX_NAME_LENGTH / sizeof(TCHAR)];
  122. DWORD fdwErrMsg; // error message flag
  123. #if !defined(WINIME) && !defined(UNICDIME)
  124. // standard table related data
  125. // size of standard table
  126. UINT uTblSize[MAX_IME_TABLES];
  127. // filename of tables
  128. TCHAR szTblFile[MAX_IME_TABLES][MAX_NAME_LENGTH / sizeof(TCHAR)];
  129. // the IME tables
  130. // user create word related data
  131. // user dictionary file name of IME
  132. TCHAR szUsrDic[USR_DIC_SIZE / sizeof(TCHAR)];
  133. // user dictionary map file name
  134. TCHAR szUsrDicMap[USR_DIC_SIZE / sizeof(TCHAR)];
  135. UINT uUsrDicSize; // memory size of user create words table
  136. UINT uUsrDicReserved1;
  137. UINT uUsrDicReserved2;
  138. // user create phrase box // not implemented
  139. TCHAR szUsrBox[USR_DIC_SIZE / sizeof(TCHAR)];
  140. TCHAR szUsrBoxMap[USR_DIC_SIZE / sizeof(TCHAR)];
  141. UINT uUsrBoxSize;
  142. UINT uUsrBoxReserved1;
  143. UINT uUsrBoxReserved2;
  144. #endif
  145. // the calculated sequence mask bits
  146. DWORD dwSeqMask; // the sequence bits for one stoke
  147. DWORD dwPatternMask; // the pattern bits for one result string
  148. int nSeqBytes; // how many bytes for nMaxKey sequence chars
  149. // reverse conversion
  150. HKL hRevKL; // the HKL of reverse mapping IME
  151. WORD nRevMaxKey;
  152. // key related data
  153. #if defined(PHON)
  154. WORD nReadLayout; // ACER, ETen, IBM, or other - phonetic only
  155. #else
  156. WORD wDummy; // DWORD boundary
  157. #endif
  158. WORD nSeqBits; // no. of sequence bits
  159. // must match with .RC file and VALIDCHAR
  160. DWORD dwVersion;
  161. WORD fwProperties1;
  162. WORD fwProperties2;
  163. WORD nMaxKey; // max key of a Chinese word
  164. WORD nSeqCode; // no. of sequence code
  165. WORD fChooseChar[6]; // valid char in choose state
  166. // translate the char code to
  167. // choose constants
  168. WORD wReserved1[2];
  169. #if defined(DAYI) || defined(UNIIME) || defined(MINIIME)
  170. BYTE cChooseTrans[0x60];
  171. #endif
  172. WORD fCompChar[6]; // valid char in input state
  173. WORD wReserved2[2];
  174. WORD wCandPerPage; // number of candidate strings per page
  175. WORD wCandStart; // 1. 2. 3. ... 0. start from 1
  176. // 1. 2. 3. ... 0. range start from 0
  177. WORD wCandRangeStart;
  178. WORD wReserved3[1];
  179. // convert sequence code to composition char
  180. WORD wSeq2CompTbl[64];
  181. // convert char to sequence code
  182. WORD wChar2SeqTbl[0x42];
  183. WORD wReserved4[2];
  184. #if defined(WINAR30)
  185. WORD wSymbol[524];
  186. #elif defined(DAYI)
  187. WORD wSymbol[340];
  188. #elif defined(UNIIME) || defined(MINIIME)
  189. DWORD fdwReserved5[32];
  190. #endif
  191. #endif // defined(ROMANIME)
  192. } IMEL;
  193. typedef IMEL *PIMEL;
  194. typedef IMEL NEAR *NPIMEL;
  195. typedef IMEL FAR *LPIMEL;
  196. typedef struct tagInstL { // local instance structure, per IME instance
  197. HINSTANCE hInst; // IME DLL instance handle
  198. LPIMEL lpImeL;
  199. #if !defined(ROMANIME)
  200. DWORD fdwTblLoad; // the *.TBL load status
  201. int cRefCount; // reference count
  202. #if !defined(WINIME) && !defined(UNICDIME)
  203. HANDLE hMapTbl[MAX_IME_TABLES];
  204. HANDLE hUsrDicMem; // memory handle for user dictionary
  205. TCHAR szUsrDicReserved[USR_DIC_SIZE / sizeof(TCHAR)];
  206. UINT uUsrDicReserved1;
  207. UINT uUsrDicReserved2;
  208. HANDLE hUsrBoxMem;
  209. TCHAR szUsrBoxReserved[USR_DIC_SIZE / sizeof(TCHAR)];
  210. UINT uUsrBoxReserved1;
  211. UINT uUsrBoxReserved2;
  212. #endif
  213. #endif
  214. DWORD dwReserved1[32];
  215. } INSTDATAL;
  216. typedef INSTDATAL *PINSTDATAL;
  217. typedef INSTDATAL NEAR *NPINSTDATAL;
  218. typedef INSTDATAL FAR *LPINSTDATAL;
  219. #if !defined(UNIIME)
  220. extern IMEL sImeL;
  221. extern LPIMEL lpImeL;
  222. extern INSTDATAL sInstL;
  223. extern LPINSTDATAL lpInstL;
  224. #endif