📄 imedefs.h
字号:
/*************************************************
* imedefs.h *
* *
* Copyright (C) 1995-1999 Microsoft Inc. *
* *
*************************************************/
#ifndef _IMEDEFS_H_
#define _IMEDEFS_H_
#define NATIVE_CHARSET GB2312_CHARSET
#define NATIVE_ANSI_CP 936
#define NATIVE_LANGUAGE 0x0804
// state of composition
#define CST_INIT 0
#define CST_INPUT 1
#define CST_CHOOSE 2
#define CST_SYMBOL 3
#define CST_SOFTKB 4 // not in iImeState
#define CST_TOGGLE_PHRASEWORD 5 // not in iImeState
#define CST_ALPHABET 6 // not in iImeState
#define CST_ALPHANUMERIC 7 // not in iImeState
#define CST_INVALID 8 // not in iImeState
#define CST_INVALID_INPUT 9 // not in iImeState
#define CST_ONLINE_CZ 10
#define CST_CAPITAL 11
#define CST_SHIFT 12
#define CST_PAGEUP 13 //com str pageup
#define CST_PAGEDOWN 14 //com str pagedown
#define CST_SELITEM 15 //enter current com item
#define CST_SELITEMPRE 16 //select current com item pre
#define CST_BACKSPACE 18//SYMBOL ,1
#define CST_ESCAPE 19//SYMBOL ,2
// state engin
#define ENGINE_COMP 0
#define ENGINE_ASCII 1
#define ENGINE_RESAULT 2
#define ENGINE_CHCAND 3
#define ENGINE_BKSPC 4
#define ENGINE_MULTISEL 5
#define ENGINE_ESC 6
#define CANDPERPAGE 5
#define MAXSTRLEN 40
#define MAXCAND 256 ////list 中个数
#define IME_MAXCAND 150
#define IME_XGB_MAXCAND 190
#define IME_UNICODE_MAXCAND 256
#define MAXCODE 12
#define MAXSOFTKEYS 48
// set ime character
#define BOX_UI 0
#define LIN_UI 1
#define IME_CMODE_INDEX_FIRST 0x1000
#define INDEX_GB 0
#define INDEX_GBK 1
#define INDEX_UNICODE 2
// border for UI
#define UI_MARGIN 4
#define COMP_TEXT_Y 17
#define UI_CANDINF 20
#define UI_CANDBTW 13
#define UI_CANDBTH 13
#define UI_CANDICON 16
#define UI_CANDSTR 300
#define STATUS_DIM_X 20
#define STATUS_DIM_Y 20
#define STATUS_NAME_MARGIN 20
// if UI_MOVE_OFFSET == WINDOW_NOTDRAG, not in drag operation
#define WINDOW_NOT_DRAG 0xFFFFFFFF
// window extra for composition window
#define UI_MOVE_OFFSET 0
#define UI_MOVE_XY 4
// the start number of candidate list
#define CAND_START 1
#define uCandHome 0
#define uCandUp 1
#define uCandDown 2
#define uCandEnd 3
#define CandGBinfoLen 64
// the flag for an opened or start UI
#define IMN_PRIVATE_UPDATE_STATUS 0x0001
#define IMN_PRIVATE_COMPOSITION_SIZE 0x0002
#define IMN_PRIVATE_UPDATE_QUICK_KEY 0x0004
#define IMN_PRIVATE_UPDATE_SOFTKBD 0x0005
#define IMN_PRIVATE_DESTROYCANDWIN 0x0006
#define IMN_PRIVATE_CMENUDESTROYED 0x0007
#define IMN_PRIVATE_SOFTKEYMENUDESTROYED 0x0008
#define MSG_ALREADY_OPEN 0x000001
#define MSG_ALREADY_OPEN2 0x000002
#define MSG_OPEN_CANDIDATE 0x000010
#define MSG_OPEN_CANDIDATE2 0x000020
#define MSG_CLOSE_CANDIDATE 0x000100
#define MSG_CLOSE_CANDIDATE2 0x000200
#define MSG_CHANGE_CANDIDATE 0x001000
#define MSG_CHANGE_CANDIDATE2 0x002000
#define MSG_ALREADY_START 0x010000
#define MSG_START_COMPOSITION 0x020000
#define MSG_END_COMPOSITION 0x040000
#define MSG_COMPOSITION 0x080000
#define MSG_IMN_COMPOSITIONPOS 0x100000
#define MSG_IMN_UPDATE_SOFTKBD 0x200000
#define MSG_IMN_UPDATE_STATUS 0x000400
#define MSG_IN_IMETOASCIIEX 0x800000
#define MSG_IMN_DESTROYCAND 0x004000
#define MSG_BACKSPACE 0x000800
// this constant is depend on TranslateImeMessage
#define GEN_MSG_MAX 6
// the new flag for set context
#define ISC_SHOW_SOFTKBD 0x02000000
#define ISC_OPEN_STATUS_WINDOW 0x04000000
#define ISC_OFF_CARET_UI 0x08000000
#define ISC_SHOW_UI_ALL (ISC_SHOWUIALL|ISC_SHOW_SOFTKBD|ISC_OPEN_STATUS_WINDOW)
#define ISC_SETCONTEXT_UI (ISC_SHOWUIALL|ISC_SHOW_SOFTKBD)
#define ISC_HIDE_COMP_WINDOW 0x00400000
#define ISC_HIDE_CAND_WINDOW 0x00800000
#define ISC_HIDE_SOFTKBD 0x01000000
// the flag for composition string show status
#define IME_STR_SHOWED 0x0001
#define IME_STR_ERROR 0x0002
// the mode configuration for an IME
#define MODE_CONFIG_QUICK_KEY 0x0001
#define MODE_CONFIG_WORD_PREDICT 0x0002
#define MODE_CONFIG_PREDICT 0x0004
#define LINE_LEN 80
#define CLASS_LEN 24
// window extra for context menu owner
#define CMENU_HUIWND 0
#define CMENU_MENU 4
#define SOFTKEYMENU_HUIWND 0
#define SOFTKEYMENU_MENU 4
#define WM_USER_DESTROY (WM_USER + 0x0400)
// the flags for GetNearCaretPosition
#define NEAR_CARET_FIRST_TIME 0x0001
#define NEAR_CARET_CANDIDATE 0x0002
typedef DWORD UNALIGNED FAR *LPUNADWORD;
typedef WORD UNALIGNED FAR *LPUNAWORD;
typedef struct tagTRANSMSG {
UINT message;
WPARAM wParam;
LPARAM lParam;
} TRANSMSG, *PTRANSMSG, NEAR *NPTRANSMSG, FAR *LPTRANSMSG;
typedef struct tagTRANSMSGLIST {
UINT uMsgCount;
TRANSMSG TransMsg[1];
} TRANSMSGLIST, *PTRANSMSGLIST, NEAR *NPTRANSMSGLIST, FAR *LPTRANSMSGLIST;
#define COMP_MAX_ITEM 3
#define COMP_MAX_PYLEN 7
typedef struct tagImeL { // local structure, per IME structure
// DWORD dwSKWant;
HINSTANCE hInst; // IME DLL instance handle
int xComSelWi; // width
int xCompWi; // width
int yCompHi; // height
TCHAR tComCurItem[COMP_MAX_PYLEN+1]; //currentShowItem
TCHAR tComSelItem[COMP_MAX_PYLEN+1]; //currentSelItem
int iTotalItem;
int iStartItem;
// BOOL bComItemEnd;
POINT ptDefComp; // default composition window position
POINT ptNewComp; // comp postion to movewindow
int cxCompBorder; // border width of composition window
int cyCompBorder; // border height of composition window
RECT rcCompText; // text position relative to composition
// window key related data
WORD fModeConfig; // quick key/prediction mode
WORD nMaxKey; // max key of compsiton str
DWORD dwRegImeIndex; // this value defers in different
// process, so can not set in sImeG
} IMEL;
typedef IMEL *PIMEL;
typedef IMEL NEAR *NPIMEL;
typedef IMEL FAR *LPIMEL;
// global sturcture for ime init data
typedef struct _tagImeG { // global structure, can be share by all IMEs,
// the seperation (IMEL and IMEG) is only
// useful in UNI-IME, other IME can use one
// the system charset is not NATIVE_CHARSET
BOOL fDiffSysCharSet;
// IME Charact
// WORD wNumCodes;
RECT rcWorkArea; // the work area of applications
// Chinese char width & height
int xChiCharWi;
int yChiCharHi;
// candidate list of composition
int xCandWi; // width of candidate list
int yCandHi; // high of candidate list
int cxCandBorder; // border width of candidate list
int cyCandBorder; // border height of candidate list
RECT rcCandText; // text position relative to candidate window
RECT rcCandBTD;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -