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.

692 lines
25 KiB

  1. /*************************************************
  2. * imedefs.h *
  3. * *
  4. * Copyright (C) 1995-1999 Microsoft Inc. *
  5. * *
  6. *************************************************/
  7. // for engine
  8. #include "eng.h"
  9. #include "immsec.h"
  10. #define STRSAFE_NO_DEPRECATE
  11. #include "strsafe.h"
  12. #define NATIVE_CHARSET GB2312_CHARSET
  13. #define NATIVE_LANGUAGE 0x0804
  14. #define NATIVE_CP 936
  15. #define NATIVE_ANSI_CP 936
  16. #ifdef EUDC
  17. #define EUDC_NATIVE_CP 936
  18. #endif //EUDC
  19. #if defined(CROSSREF)
  20. // hack flag, I borrow one bit from fdwErrMsg for reverse conversion
  21. #define NO_REV_LENGTH 0x80000000
  22. #endif
  23. #ifndef ARRAYSIZE
  24. #define ARRAYSIZE(a) (sizeof(a)/sizeof(a[0]))
  25. #endif
  26. //Add string format position and charactor defination
  27. #define STR_FORMAT_POS 0x14
  28. #define STR_FORMAT_CHAR 0x20
  29. // resource ID
  30. #define IDI_IME 0x0100
  31. #define IDS_STATUSERR 0x0200
  32. #define IDS_CHICHAR 0x0201
  33. #define IDS_EUDC 0x0202
  34. #define IDS_NONE 0x0204
  35. #define IDS_USRDIC_FILTER 0x0210
  36. #define IDS_FILE_OPEN_ERR 0x0220
  37. #define IDS_MEM_LESS_ERR 0x0221
  38. #define IDS_SETFILE 0x0300
  39. #define IDS_IMENAME 0x0320
  40. #define IDS_IMEUICLASS 0x0321
  41. #define IDS_IMECOMPCLASS 0x0322
  42. #define IDS_IMECANDCLASS 0x0323
  43. #define IDS_IMESTATUSCLASS 0x0324
  44. #define IDS_IMECMENUCLASS 0x0325
  45. #define IDS_IMESOFTKEYMENUCLASS 0x0326
  46. #define IDS_VER_INFO 0x0350
  47. #define IDS_ORG_NAME 0x0351
  48. #define IDS_IMEMBFILENAME 0x0352
  49. #define IDS_IMEHKMBFILENAME 0x0353
  50. #ifdef EUDC
  51. #define IDS_EUDC_FILE_CLS 0x0500
  52. #define IDS_NOTOPEN_TITLE 0x0501
  53. #define IDS_NOTOPEN_MSG 0x0502
  54. #define IDS_FILESIZE_TITLE 0x0503
  55. #define IDS_FILESIZE_MSG 0x0504
  56. #define IDS_HEADERSIZE_TITLE 0x0505
  57. #define IDS_HEADERSIZE_MSG 0x0506
  58. #define IDS_INFOSIZE_TITLE 0x0507
  59. #define IDS_INFOSIZE_MSG 0x0508
  60. #define IDS_CODEPAGE_TITLE 0x0509
  61. #define IDS_CODEPAGE_MSG 0x050a
  62. #define IDS_CWINSIGN_TITLE 0x050b
  63. #define IDS_CWINSIGN_MSG 0x050c
  64. #define IDS_UNMATCHED_TITLE 0x050d
  65. #define IDS_UNMATCHED_MSG 0x050e
  66. #endif //EUDC
  67. #define IDS_ERROR_OPENFILE 0x0601
  68. #define IDS_WARN_OPENREG 0x0602
  69. #define IDS_WARN_OVEREMB 0x0603
  70. #define IDS_WARN_DUPPRASE 0x0604
  71. #define IDS_WARN_MEMPRASE 0x0605
  72. #define IDS_WARN_INVALIDCODE 0x0606
  73. #define IDS_WARN_NEEDPHRASE 0x0607
  74. #define IDS_CZ_CONFIRM 0x0701
  75. #define IDS_CZ_CONFIRM_TITLE 0x0702
  76. #define IDC_STATIC -1
  77. #define IDM_SET 0x0400
  78. #define IDM_CRTWORD 0x0401
  79. #define IDM_HLP 0x0402
  80. #define IDM_OPTGUD 0x0403
  81. #define IDM_IMEGUD 0x0405
  82. #define IDM_VER 0x0406
  83. #define IDM_IME 0x0450
  84. #define IDM_SKL1 0x0500
  85. #define IDM_SKL2 0x0501
  86. #define IDM_SKL3 0x0502
  87. #define IDM_SKL4 0x0503
  88. #define IDM_SKL5 0x0504
  89. #define IDM_SKL6 0x0505
  90. #define IDM_SKL7 0x0506
  91. #define IDM_SKL8 0x0507
  92. #define IDM_SKL9 0x0508
  93. #define IDM_SKL10 0x0509
  94. #define IDM_SKL11 0x050a
  95. #define IDM_SKL12 0x050b
  96. #define IDM_SKL13 0x050c
  97. #define DlgPROP 101
  98. #define DlgUIMODE 102
  99. #define IDC_UIMODE1 1001
  100. #define IDC_UIMODE2 1002
  101. #define IDC_USER1 1003
  102. // setting offset in .SET file
  103. #define OFFSET_MODE_CONFIG 0
  104. #define OFFSET_READLAYOUT 4
  105. // state of composition
  106. #define CST_INIT 0
  107. #define CST_INPUT 1
  108. #define CST_CHOOSE 2
  109. #define CST_SYMBOL 3
  110. #define CST_SOFTKB 4 // not in iImeState
  111. #define CST_TOGGLE_PHRASEWORD 5 // not in iImeState
  112. #define CST_ALPHABET 6 // not in iImeState
  113. #define CST_ALPHANUMERIC 7 // not in iImeState
  114. #define CST_INVALID 8 // not in iImeState
  115. #define CST_INVALID_INPUT 9 // not in iImeState
  116. #define CST_ONLINE_CZ 10
  117. #define CST_CAPITAL 11
  118. // state engin
  119. #define ENGINE_COMP 0
  120. #define ENGINE_ASCII 1
  121. #define ENGINE_RESAULT 2
  122. #define ENGINE_CHCAND 3
  123. #define ENGINE_BKSPC 4
  124. #define ENGINE_MULTISEL 5
  125. #define ENGINE_ESC 6
  126. #define CANDPERPAGE 10
  127. //CHP
  128. #if defined(COMBO_IME)
  129. #define IC_NUMBER 11
  130. #else
  131. #define IC_NUMBER 10
  132. #endif //COMBO_IME
  133. // set ime character
  134. #define SIC_INIT 0
  135. #define SIC_SAVE2 1
  136. #define SIC_READY 2
  137. #define SIC_MODIFY 3
  138. #define SIC_SAVE1 4
  139. #define BOX_UI 0
  140. #define LIN_UI 1
  141. // border for UI
  142. #define UI_MARGIN 4
  143. #define COMP_TEXT_Y 17
  144. //
  145. #define UI_CANDINF 20
  146. #define UI_CANDBTW 13
  147. #define UI_CANDBTH 13
  148. #define UI_CANDICON 16
  149. //#define UI_CANDSTR 300
  150. #define STATUS_DIM_X 20
  151. #define STATUS_DIM_Y 20
  152. #define STATUS_NAME_MARGIN 8
  153. // if UI_MOVE_OFFSET == WINDOW_NOTDRAG, not in drag operation
  154. #define WINDOW_NOT_DRAG 0xFFFFFFFF
  155. // window extra for composition window
  156. #define UI_MOVE_OFFSET 0
  157. #define UI_MOVE_XY 4
  158. // the start number of candidate list
  159. #define CAND_START 1
  160. #define uCandHome 0
  161. #define uCandUp 1
  162. #define uCandDown 2
  163. #define uCandEnd 3
  164. // the flag for an opened or start UI
  165. #define IMN_PRIVATE_UPDATE_STATUS 0x0001
  166. #define IMN_PRIVATE_COMPOSITION_SIZE 0x0002
  167. #define IMN_PRIVATE_UPDATE_QUICK_KEY 0x0004
  168. #define IMN_PRIVATE_UPDATE_SOFTKBD 0x0005
  169. #define IMN_PRIVATE_DESTROYCANDWIN 0x0006
  170. #define IMN_PRIVATE_CMENUDESTROYED 0x0007
  171. #define IMN_PRIVATE_SOFTKEYMENUDESTROYED 0x0008
  172. #define MSG_ALREADY_OPEN 0x000001
  173. #define MSG_ALREADY_OPEN2 0x000002
  174. #define MSG_OPEN_CANDIDATE 0x000010
  175. #define MSG_OPEN_CANDIDATE2 0x000020
  176. #define MSG_CLOSE_CANDIDATE 0x000100
  177. #define MSG_CLOSE_CANDIDATE2 0x000200
  178. #define MSG_CHANGE_CANDIDATE 0x001000
  179. #define MSG_CHANGE_CANDIDATE2 0x002000
  180. #define MSG_ALREADY_START 0x010000
  181. #define MSG_START_COMPOSITION 0x020000
  182. #define MSG_END_COMPOSITION 0x040000
  183. #define MSG_COMPOSITION 0x080000
  184. #define MSG_IMN_COMPOSITIONPOS 0x100000
  185. #define MSG_IMN_UPDATE_SOFTKBD 0x200000
  186. #define MSG_IMN_UPDATE_STATUS 0x000400
  187. #define MSG_GUIDELINE 0x400000
  188. #define MSG_IN_IMETOASCIIEX 0x800000
  189. #define MSG_BACKSPACE 0x000800
  190. #define MSG_IMN_DESTROYCAND 0x004000
  191. // this constant is depend on TranslateImeMessage
  192. #define GEN_MSG_MAX 6
  193. // the flag for set context
  194. #define SC_SHOW_UI 0x0001
  195. #define SC_HIDE_UI 0x0002
  196. #define SC_ALREADY_SHOW_STATUS 0x0004
  197. #define SC_WANT_SHOW_STATUS 0x0008
  198. #define SC_HIDE_STATUS 0x0010
  199. // the new flag for set context
  200. #define ISC_SHOW_SOFTKBD 0x02000000
  201. #define ISC_OPEN_STATUS_WINDOW 0x04000000
  202. #define ISC_OFF_CARET_UI 0x08000000
  203. #define ISC_SHOW_UI_ALL (ISC_SHOWUIALL|ISC_SHOW_SOFTKBD|ISC_OPEN_STATUS_WINDOW)
  204. #define ISC_SETCONTEXT_UI (ISC_SHOWUIALL|ISC_SHOW_SOFTKBD)
  205. #define ISC_HIDE_COMP_WINDOW 0x00400000
  206. #define ISC_HIDE_CAND_WINDOW 0x00800000
  207. #define ISC_HIDE_SOFTKBD 0x01000000
  208. // the flag for composition string show status
  209. #define IME_STR_SHOWED 0x0001
  210. #define IME_STR_ERROR 0x0002
  211. // the mode configuration for an IME
  212. #define MODE_CONFIG_QUICK_KEY 0x0001
  213. #define MODE_CONFIG_WORD_PREDICT 0x0002
  214. #define MODE_CONFIG_PREDICT 0x0004
  215. // the virtual key value
  216. #define VK_OEM_SEMICLN 0xba // ; :
  217. #define VK_OEM_EQUAL 0xbb // = +
  218. #define VK_OEM_SLASH 0xbf // / ?
  219. #define VK_OEM_LBRACKET 0xdb // [ {
  220. #define VK_OEM_BSLASH 0xdc // \ |
  221. #define VK_OEM_RBRACKET 0xdd // ] }
  222. #define VK_OEM_QUOTE 0xde // ' "
  223. #define MAXMBNUMS 40
  224. // for ime property info
  225. #define MAXNUMCODES 48
  226. #define LINE_LEN 80
  227. #define CLASS_LEN 24
  228. #define NAMESIZE 128
  229. #define MAXUSEDCODES 48
  230. #define MAXSOFTKEYS 48
  231. #define NumsSK 13
  232. // mb file for create word
  233. #define ID_LENGTH 28
  234. #define NUMTABLES 7
  235. #define TAG_DESCRIPTION 0x00000001
  236. #define TAG_RULER 0x00000002
  237. #define TAG_CRTWORDCODE 0x00000004
  238. #define TAG_INTERCODE 0x00000003
  239. #define TAG_RECONVINDEX 0x00000005
  240. #define TAG_BASEDICINDEX 0x00000006
  241. #define TAG_BASEDIC 0x00000007
  242. // window extra for context menu owner
  243. #define CMENU_HUIWND 0
  244. #define CMENU_MENU (CMENU_HUIWND+sizeof(LONG_PTR))
  245. #define WND_EXTRA_SIZE (CMENU_MENU+sizeof(LONG_PTR))
  246. #define SOFTKEYMENU_HUIWND 0
  247. #define SOFTKEYMENU_MENU (SOFTKEYMENU_HUIWND+sizeof(LONG_PTR))
  248. #define WM_USER_DESTROY (WM_USER + 0x0400)
  249. // the flags for GetNearCaretPosition
  250. #define NEAR_CARET_FIRST_TIME 0x0001
  251. #define NEAR_CARET_CANDIDATE 0x0002
  252. #define FFLG_MULTIELEMENT 0x2
  253. #define FFLG_RULE 0x1
  254. #define ADD_FALSE 0x0000
  255. #define ADD_TRUE 0x0001
  256. #define ADD_REP 0x0002
  257. #define ADD_FULL 0x0003
  258. #ifdef EUDC
  259. #define SIGN_CWIN 0x4E495743
  260. #define SIGN__TBL 0x4C42545F
  261. #define EUDC_MAX_READING 6 //TEMPORARY SOLUTION
  262. #endif
  263. typedef DWORD UNALIGNED FAR *LPUNADWORD;
  264. typedef WORD UNALIGNED FAR *LPUNAWORD;
  265. typedef TCHAR UNALIGNED FAR *LPUNATCHAR;
  266. typedef struct tagImeL { // local structure, per IME structure
  267. // SK data
  268. DWORD dwSKState[NumsSK];//95.10.24
  269. DWORD dwSKWant; //95.10.24
  270. HMENU hSKMenu; // SoftKeyboard Menu
  271. HMENU hPropMenu; // Property Menu
  272. HMENU hObjImeMenu; // Object IME Menu
  273. HINSTANCE hInst; // IME DLL instance handle
  274. int xCompWi; // width
  275. int yCompHi; // height
  276. POINT ptDefComp; // default composition window position
  277. int cxCompBorder; // border width of composition window
  278. int cyCompBorder; // border height of composition window
  279. RECT rcCompText; // text position relative to composition window
  280. WORD nMaxKey; // max key of compsiton str
  281. BOOL fWinLogon; // if the current client is running in WinLogon Mode.
  282. } IMEL;
  283. typedef IMEL *PIMEL;
  284. typedef IMEL NEAR *NPIMEL;
  285. typedef IMEL FAR *LPIMEL;
  286. #define NFULLABC 95
  287. typedef struct _tagFullABC { // match with the IMEG
  288. WORD wFullABC[NFULLABC];
  289. } FULLABC;
  290. typedef FULLABC *PFULLABC;
  291. typedef FULLABC NEAR *NPFULLABC;
  292. typedef FULLABC FAR *LPFULLABC;
  293. // global sturcture for ime init data
  294. typedef struct _tagImeG { // global structure, can be share by all IMEs,
  295. // the seperation (IMEL and IMEG) is only
  296. // useful in UNI-IME, other IME can use one
  297. // the system charset is not NATIVE_CHARSET
  298. BOOL fDiffSysCharSet;
  299. RECT rcWorkArea; // the work area of applications
  300. // Chinese char width & height
  301. int xChiCharWi;
  302. int yChiCharHi;
  303. // candidate list of composition
  304. int xCandWi; // width of candidate list
  305. int yCandHi; // high of candidate list
  306. int cxCandBorder; // border width of candidate list
  307. int cyCandBorder; // border height of candidate list
  308. RECT rcCandText; // text position relative to candidate window
  309. RECT rcCandBTD;
  310. RECT rcCandBTU;
  311. RECT rcCandBTE;
  312. RECT rcCandBTH;
  313. RECT rcCandInf;
  314. RECT rcCandIcon;
  315. // status window
  316. int xStatusWi; // width of status window
  317. int yStatusHi; // high of status window
  318. RECT rcStatusText; // text position relative to status window
  319. RECT rcImeIcon; // ImeIcon position relative to status window
  320. RECT rcImeName; // ImeName position relative to status window
  321. RECT rcShapeText; // shape text relative to status window
  322. RECT rcSymbol; // symbol relative to status window
  323. RECT rcSKText; // SK text relative to status window
  324. // full shape space (reversed internal code)
  325. WORD wFullSpace;
  326. // full shape chars (internal code)
  327. WORD wFullABC[NFULLABC];
  328. // error string
  329. TCHAR szStatusErr[8];
  330. int cbStatusErr;
  331. // candidate string start from 0 or 1
  332. int iCandStart;
  333. // setting of UI
  334. int iPara;
  335. int iPerp;
  336. int iParaTol;
  337. int iPerpTol;
  338. TCHAR szIMESystemPath[MAX_PATH]; // keep the system path for MB file
  339. TCHAR szIMEUserPath[MAX_PATH]; // keep the path for EMB file
  340. } IMEG;
  341. typedef IMEG *PIMEG;
  342. typedef IMEG NEAR *NPIMEG;
  343. typedef IMEG FAR *LPIMEG;
  344. //#include <privcon.h>
  345. #include "privcon.h"
  346. typedef struct _tagUIPRIV { // IME private UI data
  347. HWND hCompWnd; // composition window
  348. int nShowCompCmd;
  349. HWND hCandWnd; // candidate window for composition
  350. int nShowCandCmd;
  351. HWND hSoftKbdWnd; // soft keyboard window
  352. int nShowSoftKbdCmd;
  353. HWND hStatusWnd; // status window
  354. int nShowStatusCmd;
  355. DWORD fdwSetContext; // the actions to take at set context time
  356. HIMC hIMC; // the recent selected hIMC
  357. HWND hCMenuWnd; // a window owner for context menu
  358. HWND hSoftkeyMenuWnd; // a window owner for softkeyboard menu
  359. } UIPRIV;
  360. typedef UIPRIV *PUIPRIV;
  361. typedef UIPRIV NEAR *NPUIPRIV;
  362. typedef UIPRIV FAR *LPUIPRIV;
  363. typedef struct tagNEARCARET { // for near caret offset calculatation
  364. int iLogFontFacX;
  365. int iLogFontFacY;
  366. int iParaFacX;
  367. int iPerpFacX;
  368. int iParaFacY;
  369. int iPerpFacY;
  370. } NEARCARET;
  371. typedef NEARCARET *PNEARCARET;
  372. typedef NEARCARET NEAR *NPNEARCARET;
  373. typedef NEARCARET FAR *LPNEARCARET;
  374. // mb file for create word
  375. typedef struct tagMAININDEX {
  376. DWORD dwTag;
  377. DWORD dwOffset;
  378. DWORD dwLength;
  379. DWORD dwCheckSum; //Check if dwCheckSum=dwTag+dwOffset+dwLength
  380. } MAININDEX, FAR *LPMAININDEX;
  381. typedef struct tagDESCRIPTION {
  382. TCHAR szName[MAXSTRLEN];
  383. WORD wMaxCodes;
  384. WORD wNumCodes;
  385. TCHAR szUsedCode[MAXNUMCODES];
  386. BYTE byMaxElement;
  387. TCHAR cWildChar;
  388. WORD wNumRulers;
  389. } DESCRIPTION,FAR * LPDESCRIPTION;
  390. typedef struct tagCREATEWORDRULER {
  391. BYTE byLogicOpra;
  392. BYTE byLength;
  393. WORD wNumCodeUnits;
  394. struct CODEUNIT {
  395. DWORD dwDirectMode;
  396. WORD wDBCSPosition;
  397. WORD wCodePosition;
  398. } CodeUnit[MAXCODE];
  399. } RULER,FAR *LPRULER;
  400. extern HINSTANCE hInst;
  401. extern IMEG sImeG;
  402. extern IMEL sImeL;
  403. extern LPIMEL lpImeL;
  404. extern MBINDEX MBIndex;
  405. extern HMapStruc HMapTab[];
  406. extern HWND hCrtDlg;
  407. extern UINT uStartComp;
  408. extern UINT uOpenCand;
  409. extern UINT uCaps;
  410. extern DWORD SaTC_Trace;
  411. extern UINT UI_CANDSTR;
  412. extern TCHAR szImeMBFileName[];
  413. extern TCHAR szUIClassName[];
  414. extern TCHAR szCompClassName[];
  415. extern TCHAR szCandClassName[];
  416. extern TCHAR szStatusClassName[];
  417. extern TCHAR szCMenuClassName[];
  418. extern TCHAR szSoftkeyMenuClassName[];
  419. extern TCHAR szOrgName[];
  420. extern TCHAR szVerInfo[];
  421. extern TCHAR szAuthorName[];
  422. extern TCHAR szHandCursor[];
  423. extern TCHAR szChinese[];
  424. extern TCHAR szCZ[];
  425. extern TCHAR szCandInf1[];
  426. extern TCHAR szCandInf2[];
  427. extern TCHAR szSymbol[];
  428. extern TCHAR szNoSymbol[];
  429. extern TCHAR szEnglish[];
  430. extern TCHAR szCode[];
  431. extern TCHAR szEudc[];
  432. extern TCHAR szFullShape[];
  433. extern TCHAR szHalfShape[];
  434. extern TCHAR szNone[];
  435. extern TCHAR szSoftKBD[];
  436. extern TCHAR szNoSoftKBD[];
  437. extern TCHAR szDigit[];
  438. extern BYTE bUpper[];
  439. extern WORD fMask[];
  440. extern TCHAR szRegIMESetting[];
  441. extern TCHAR szPerp[];
  442. extern TCHAR szPara[];
  443. extern TCHAR szPerpTol[];
  444. extern TCHAR szParaTol[];
  445. extern const NEARCARET ncUIEsc[], ncAltUIEsc[];
  446. extern const POINT ptInputEsc[], ptAltInputEsc[];
  447. extern BYTE VirtKey48Map[];
  448. extern BYTE VirtKey48Map[];
  449. extern TCHAR CWCodeStr[];
  450. extern TCHAR CWDBCSStr[];
  451. extern TCHAR szTrace[];
  452. extern TCHAR szWarnTitle[];
  453. extern TCHAR szErrorTitle[];
  454. #ifdef KEYSTICKER
  455. #ifdef CHAJEI
  456. #define INDEXNUM 26
  457. #endif
  458. #ifdef PHON
  459. #define INDEXNUM 48
  460. #endif
  461. extern TCHAR KeyIndexTbl[];
  462. extern LPTSTR MapKeyStickerTbl[];
  463. #endif //KEYSTICKER
  464. #if defined(CROSSREF)
  465. extern TCHAR szRegRevKL[];
  466. extern TCHAR szRegRevMaxKey[];
  467. #endif
  468. #if defined(EUDC)
  469. extern TCHAR szRegEudcDictName[];
  470. extern TCHAR szRegEudcMapFileName[];
  471. #endif
  472. int WINAPI LibMain(HANDLE, WORD, WORD, LPTSTR); // init.c
  473. LRESULT CALLBACK UIWndProc(HWND, UINT, WPARAM, LPARAM); // ui.c
  474. LRESULT PASCAL UIPaint(HWND); //UI.C
  475. // for engine
  476. WORD PASCAL GBEngine(LPPRIVCONTEXT);
  477. WORD PASCAL AsciiToGB(LPPRIVCONTEXT);
  478. WORD PASCAL AsciiToArea(LPPRIVCONTEXT);
  479. WORD PASCAL CharToHex(TCHAR);
  480. void PASCAL AddCodeIntoCand(LPCANDIDATELIST, WORD); // compose.c
  481. void PASCAL CompWord(WORD, LPINPUTCONTEXT, LPCOMPOSITIONSTRING, LPPRIVCONTEXT,
  482. LPGUIDELINE); // compose.c
  483. UINT PASCAL Finalize(LPINPUTCONTEXT, LPCOMPOSITIONSTRING,
  484. LPPRIVCONTEXT, WORD); // compose.c
  485. void PASCAL CompEscapeKey(LPINPUTCONTEXT, LPCOMPOSITIONSTRING,
  486. LPGUIDELINE, LPPRIVCONTEXT); // compose.c
  487. void PASCAL SelectOneCand(LPINPUTCONTEXT, LPCOMPOSITIONSTRING,
  488. LPPRIVCONTEXT, LPCANDIDATELIST); // chcand.c
  489. void PASCAL CandEscapeKey(LPINPUTCONTEXT, LPPRIVCONTEXT); // chcand.c
  490. void PASCAL ChooseCand(WORD, LPINPUTCONTEXT, LPCANDIDATEINFO,
  491. LPPRIVCONTEXT); // chcand.c
  492. void PASCAL SetPrivateFileSetting(LPBYTE, int, DWORD, LPCTSTR); // ddis.c
  493. void PASCAL InitCompStr(LPCOMPOSITIONSTRING); // ddis.c
  494. BOOL PASCAL ClearCand(LPINPUTCONTEXT); // ddis.c
  495. LONG OpenReg_PathSetup(HKEY *);
  496. LONG OpenReg_User(HKEY ,LPCTSTR ,PHKEY);
  497. VOID InfoMessage(HANDLE ,WORD ); //ddis.c
  498. VOID FatalMessage(HANDLE ,WORD); //ddis.c
  499. #if defined(CROSSREF)
  500. void PASCAL ReverseConversionList(HWND); // ddis.c
  501. //CHP
  502. int CrossReverseConv(LPINPUTCONTEXT, LPCOMPOSITIONSTRING, LPPRIVCONTEXT, LPCANDIDATELIST);
  503. #endif
  504. #ifdef EUDC
  505. BOOL EUDCDicName( HWND );
  506. #endif //EUDC
  507. //UINT PASCAL TranslateImeMessage(LPTRANSMSGLIST, LPPRIVCONTEXT); // toascii.c
  508. UINT PASCAL TranslateImeMessage(LPTRANSMSGLIST, LPINPUTCONTEXT, LPPRIVCONTEXT); // toascii.c
  509. void PASCAL GenerateMessage(HIMC, LPINPUTCONTEXT,
  510. LPPRIVCONTEXT); // notify.c
  511. DWORD PASCAL ReadingToPattern(LPCTSTR, BOOL); // regword.c
  512. void PASCAL ReadingToSequence(LPCTSTR, LPBYTE, BOOL); // regword.c
  513. void PASCAL DrawDragBorder(HWND, LONG, LONG); // uisubs.c
  514. void PASCAL DrawFrameBorder(HDC, HWND); // uisubs.c
  515. void PASCAL ContextMenu(HWND, int, int); // uisubs.c
  516. void PASCAL SoftkeyMenu(HWND, int, int); // uisubs.c
  517. LRESULT CALLBACK ContextMenuWndProc(HWND, UINT, WPARAM,LPARAM); // uisubs.c
  518. LRESULT CALLBACK SoftkeyMenuWndProc(HWND, UINT, WPARAM,LPARAM); // uisubs.c
  519. #if 1 // MultiMonitor support
  520. RECT PASCAL ImeMonitorWorkAreaFromWindow(HWND); // uisubs.c
  521. RECT PASCAL ImeMonitorWorkAreaFromPoint(POINT); // uisubs.c
  522. RECT PASCAL ImeMonitorWorkAreaFromRect(LPRECT); // uisubs.c
  523. #endif
  524. HWND PASCAL GetCompWnd(HWND); // compui.c
  525. void PASCAL SetCompPosition(HWND, HIMC, LPINPUTCONTEXT); // compui.c
  526. void PASCAL SetCompWindow(HWND); // compui.c
  527. void PASCAL MoveDefaultCompPosition(HWND); // compui.c
  528. void PASCAL ShowComp(HWND, int); // compui.c
  529. void PASCAL StartComp(HWND); // compui.c
  530. void PASCAL EndComp(HWND); // compui.c
  531. void PASCAL UpdateCompWindow(HWND); // compui.c
  532. LRESULT CALLBACK CompWndProc(HWND, UINT, WPARAM, LPARAM); // compui.c
  533. void PASCAL CompCancel(HIMC, LPINPUTCONTEXT);
  534. void PASCAL PaintCompWindow(HWND, HWND, HDC);
  535. #ifdef KEYSTICKER
  536. int IndexKeySticker(TCHAR);
  537. void MapSticker(LPCTSTR, LPTSTR, int);
  538. #endif //KEYSTICKER
  539. HWND PASCAL GetCandWnd(HWND); // candui.c
  540. void PASCAL CalcCandPos(HIMC, HWND, LPPOINT); // candui.c
  541. LRESULT PASCAL SetCandPosition(HWND); // candui.c
  542. void PASCAL ShowCand(HWND, int); // candui.c
  543. void PASCAL OpenCand(HWND); // candui.c
  544. void PASCAL CloseCand(HWND); // candui.c
  545. void PASCAL PaintCandWindow(HWND, HDC); // candui.c
  546. void AdjustCandPos(HIMC, LPPOINT);
  547. void PASCAL AdjustStatusBoundary(LPPOINTS, HWND);
  548. LRESULT CALLBACK CandWndProc(HWND, UINT, WPARAM, LPARAM); // candui.c
  549. void PASCAL UpdateSoftKbd(HWND);
  550. HWND PASCAL GetStatusWnd(HWND); // statusui.c
  551. LRESULT PASCAL SetStatusWindowPos(HWND); // statusui.c
  552. void PASCAL ShowStatus(HWND, int); // statusui.c
  553. void PASCAL OpenStatus(HWND); // statusui.c
  554. LRESULT CALLBACK StatusWndProc(HWND, UINT, WPARAM, LPARAM); // statusui.c
  555. void DrawConvexRect(HDC, int, int, int, int);
  556. void DrawConvexRectP(HDC, int, int, int, int);
  557. void DrawConcaveRect(HDC, int, int, int, int);
  558. BOOL IsUsedCode(WORD, LPPRIVCONTEXT);
  559. BOOL UpdateStatusWindow(HWND);
  560. void PASCAL EngChCand(LPCOMPOSITIONSTRING, LPCANDIDATELIST, LPPRIVCONTEXT, LPINPUTCONTEXT, WORD);
  561. void PASCAL CandPageDownUP(HWND, UINT);
  562. void PASCAL GenerateImeMessage(HIMC, LPINPUTCONTEXT, DWORD);
  563. UINT PASCAL TranslateSymbolChar(LPTRANSMSGLIST, WORD, BOOL);
  564. UINT PASCAL TranslateFullChar(LPTRANSMSGLIST, WORD);
  565. void PASCAL InitStatusUIData(int, int, int);
  566. void PASCAL InitCandUIData(int, int, int);
  567. // for engine
  568. UINT WINAPI MB_SUB(HIMCC, TCHAR, BYTE, UINT);
  569. int WINAPI StartEngine(HIMCC);
  570. int WINAPI EndEngine(HIMCC);
  571. void ResetCont(HIMCC);
  572. BOOL ReadDescript(LPCTSTR, LPMBDESC);
  573. UINT Conversion(HIMCC, LPCTSTR, UINT);
  574. UINT PASCAL ForwordConversion(HIMC, LPCTSTR, LPCANDIDATELIST, UINT);
  575. int AddZCItem(HIMCC, LPTSTR, LPTSTR);
  576. BOOL GetUDCItem(HIMCC, UINT, LPTSTR, LPTSTR);
  577. // dialog procedure
  578. INT_PTR CALLBACK ImeVerDlgProc(HWND, UINT, WPARAM, LPARAM);
  579. INT_PTR CALLBACK CrtWordDlgProc(HWND, UINT, WPARAM, LPARAM);
  580. INT_PTR CALLBACK SetImeDlgProc(HWND, UINT, WPARAM, LPARAM);
  581. void SetImeCharac(HWND, int, int, DWORD);
  582. //void InitImeCharac(LPPRIVCONTEXT);
  583. void InitImeCharac(DWORD);
  584. // create word
  585. DWORD InterCodeToNo(TCHAR szDBCS[3]);
  586. void ConvCreateWord(HWND ,LPCTSTR ,LPTSTR ,LPTSTR);
  587. void MyStrFormat(LPTSTR dest, int cch, LPTSTR s1, LPTSTR s2);
  588. BOOL ConvGetMainIndex(HANDLE , HANDLE , LPMAININDEX );
  589. BOOL ConvReadDescript(HANDLE ,LPDESCRIPTION ,LPMAININDEX );
  590. BOOL ConvReadRuler(HANDLE , int,LPRULER ,LPMAININDEX );
  591. #ifdef UNICODE
  592. extern TCHAR SKLayout[NumsSK][MAXSOFTKEYS];
  593. extern TCHAR SKLayoutS[NumsSK][MAXSOFTKEYS];
  594. #else
  595. extern BYTE SKLayout[NumsSK][MAXSOFTKEYS*2];
  596. extern BYTE SKLayoutS[NumsSK][MAXSOFTKEYS*2];
  597. #endif //UNICODE
  598. //CHP
  599. #ifdef FUSSYMODE
  600. BOOL IsFussyChar(LPCTSTR, LPCTSTR);
  601. #endif //FUSSYMODE
  602. #ifndef ARRAYSIZE
  603. #define ARRAYSIZE(a) (sizeof(a)/sizeof(a[0]))
  604. #endif