Leaked source code of windows server 2003
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.

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