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.

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