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.

253 lines
8.9 KiB

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