WindowsXP-SP1/windows/feime/chs/ntabc/winabc/abcw2.h
2020-09-30 16:53:49 +02:00

732 lines
22 KiB
C
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/*************************************************
* abcw2.h *
* *
* Copyright (C) 1995-1999 Microsoft Inc. *
* *
*************************************************/
extern CHAR SKLayoutS[NumsSK];
extern CHAR SKLayout[NumsSK][48*2];
extern CHAR PcKb[48*2],SdaKb[48*2];
extern CHAR SPcKb[48*2],SSdaKb[48*2];
extern LPIMEL lpImeL;
extern IMEG sImeG ;
#define WM_NEW_DEF_CODE 1993+0x400 //1993.4.19
#define WM_NEW_DEF_RESTORE 1993+0x401 //1993.4.19
HIMC ghIMC = 0;
LPINPUTCONTEXT glpIMC;
LPPRIVCONTEXT glpIMCP;
int wait_flag , waitzl_flag; //waitzl 6
int TypeOfOutMsg;
int biaodian_len;
BYTE I_U_Flag=0; //produce the "i, u" input
struct INPUT_TISHI prompt[1];
struct INPT_BF in={40,0,{0}};
struct W_SLBL wp;
struct ATTR msx_area[120];
struct INDEX ndx;
struct INDEX kzk_ndx;
struct TBF FAR *cisu;
struct PD_TAB pindu;
struct FMT now={10,53,27};
struct T_REM tmmr;
int form[] ={10,/*9*/8,5,/*4*/4,3,2,2,1,1,1}; //form[0] not used
BYTE spbx_tab[((87-15)*94+15)/16*16+16]={0};
BYTE logging_stack[0x400]={0};
WORD logging_stack_size=sizeof logging_stack;
/*******************************************
display result area DATA
**********************************************/
unsigned char space_char[]={0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20};
BYTE out_svw[400];
unsigned char group_counter[]="0.";
/*********************************************
input area DATA
**********************************************/
int input_cur;
int new_no;
int jlxw_mode;
int jiyi_mode;
/******************************************************
result area DATA
*******************************************************/
int result_area_pointer;
BYTE result_area[40];
BYTE out_result_area[40];
WORD out_bfb[40];
int out_pointer;
int now_cs;
int now_cs_dot;
/********************************************
biaodian table
*********************************************/
//unsigned char biaodian_table[]="~`!@?():<>,.;_\x22\x27"; //Note \0x22 will be 0 x 2 2
//unsigned char cc_biaodian[]="<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>";
unsigned char biaodian_table[]="@&$^\\!@?():<>,.;_\x22\x27"; //Note \0x22 will be 0 x 2 2
unsigned char cc_biaodian[]="<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>";
int biaodian_pos;
WORD biaodian_value;
BYTE yinhao_flag=0;
/*******************************************
control variabe
********************************************/
//BYTE int_asc_mode=0; // int or half character switch
extern BYTE step_mode;
//BYTE cp_ajust_flag;
BYTE bdd_flag; // the function of punctuation switch
//BYTE cbx_flag =0; // for written-stroke input flag
// =0 NO writen-stroke input module
// =1 the method with STD_MODE
// =2 ............... SDA_MODE
BOOL IfTopMost; // top window flag
BYTE word_back_flag;
BYTE msg_type;
/*****************************************
temp memory area
******************************************/
BYTE temp_rem_area[512];
BYTE rem_area[512];
/**************************************
display buffer parameter
***************************************/
BYTE out_length;
BYTE last_out_length;
BYTE cap_mode;
/******************************************
user_definition parameter
*******************************************/
WORD mulu_record_length=10;
WORD data_record_length=32;
WORD mulu_true_length=56;
WORD data_start=0x1000;
WORD mulu_max_length=0x1000;
BYTE user_word_max_length=32;
OFSTRUCT reopen;
HWND active_win_keep;
BYTE d_yinhao_flag=0,book_name=0,book_name_sub=0;
/*******************************************************************
This part of defination is cut from the beginning of ABCW.c
********************************************************************/
BYTE SdaPromptOpen=0,DefNewNow=0; //cock
FARPROC _hh1,_hh2;
HANDLE hInst;
HANDLE cisu_hd;
HCURSOR hCursor; //1993.2
FARPROC FAR *hh1,*hh2;
FARPROC lpFunc,lpFunc2;
HANDLE mdl;
BYTE opt_flag;
BYTE kb_buffer[35];
int OldCaps;
BYTE in_buffer[1]; /* buffer for input */
int n,end_flg,CharHi,CharWi;
HFONT hFont;
HFONT hOldFont;
HFONT hSFont=0;
HPEN hPen;
BYTE V_Flag=0; // V input flag
OFSTRUCT ofstruct;
HDC hDC;
HDC hMemoryDC;
HBITMAP cur_h;
int count2;
int pass_word=0;
HWND NowFocus,OptFocus; //keep the user's focus
BOOL cur_flag=0,op_flag;
WORD old_curx=CUR_START_X,cur_hibit=1,cur_start_ps=0,cur_start_count=0;
HWND hWnd,act_focus;
int input_count=0;
int kb_mode=CIN_STD,kb_flag = 0xffff;
int local_focus=0;
int timer_counter=0;
int msg_count=0;
BYTE msg_bf[50];
TimerCounter=2;
KeyBoardState=0;
SdaInst = 0;
HWND Return;
HWND act_win;
HANDLE Hdopt; //for dynamic call .dll proc
unsigned char jiyi[]="{<7B><><EFBFBD><EFBFBD>}";
WORD sda_trans[5]={9,9,9,9,0};
HWND hInputWnd;
HWND hABCWnd;
char ExeCmdLine[]="abcwin 0";
BYTE UpdateFlag=0; //1993.3 increase the user.rem
char jiyi_wenjian_cuo[]="<EFBFBD>ģ<EFBFBD><EFBFBD>û<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>!";
BYTE InputBuffer[43];
WORD SoftKeyNum=0;
TCHAR tmmr_rem[MAX_PATH];
TCHAR user_lib[MAX_PATH];
HANDLE hAccTable;
HANDLE hImeL;
LPIMEL lpImeL;
int MoveFlag = 0;
POINT pot;
HWND hSetOp =0,NewWordWin=0;
char *szMsgStr[] = { "0","0"}; // messages shown on diff sections
BYTE Sd_Open_flag=0; //flag for display the keyboard
BYTE kb_mode_save=0; //1993.4.19
/******************************************************************
This part of defination is cut from ABCWM.c
*******************************************************************/
char TMMR_OPEN_WRONG[]= "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD><EFBFBD>򿪴<EFBFBD>";
/******************************************************************
This part of defination is cut before DIAMAN.c
*******************************************************************/
BYTE cpjy,bxsr,qj,bdzh;
/******************************************************************
This part of defination is cut before OKRETURN.c
*******************************************************************/
OFSTRUCT ofs;
struct SLBL sb;
struct N_SLBL neg;
BYTE slbl_tab[]="ZH00\1"
"SH00\2"
"CH00\3"
"ING0\4"
"AI00\5"
"AN00\6"
"ANG0\7"
"AO00\x8"
"EI00\x9"
"EN00\xa"
"ENG0\xb"
"IA00\xc"
"IAN0\xd"
"IANG\xe"
"IAO0\xf"
"IE00\x10"
"IN00\x11"
"IU00\x12"
"ONG0\x13"
"OU00\x14"
"UA00\x15"
"UAI0\x16"
"UAN0\x17"
"UE00\x18"
"UN00\x19"
"UENG\x1a" //SC4K6c?*DBASE={<I5D1AH
"UI00\x1b"
"UO00\x1c"
"UANG\x1d"
"ER00\x1e"
"IONG\x1f"
"VE00\x18"
"UEN0\x19"
"VEN0\x19"
"UEI0\x1b"
"IOU0\x12";
OFSTRUCT openbuf;
OFSTRUCT openbuf_kzk,open_user,open_tmmr;
BYTE buffer[30];
BYTE cmp_head,cmp_state,cmp_bx,by_cchar_flag;
WORD cmp_yj,cmp_cisu;
// about search lib
LONG r_addr;
WORD out_svw_cnt,msx_area_cnt;
WORD search_start,search_end,kzk_search_start,kzk_search_end;
WORD item_length,kzk_item_length,last_item_name,item_addr,slib_addr;
BYTE word_lib_state;
WORD lib_w[0xa00];
WORD kzk_lib_w[0x400];
BYTE auto_mode,word_source,xs_flag,sfx_attr,jiyi_pindu,system_info;
BYTE stack1_move_counter;
WORD extb_ps;
/******************************************************************
This part of defination is cut before READ_A_PAGE.c
*******************************************************************/
char *std_dct="winabc.cwd";
char *user_dct="user.rem";
BYTE last_flag;
LONG last_start_ps;
WORD last_size;
/******************************************************************
This part of defination is cut before REM_PD1.c
*******************************************************************/
BYTE stack1_move_counter;
//................................................................
// function tables definition
//
char fk_tab[]="0<EFBFBD><EFBFBD>1һ2<EFBFBD><EFBFBD>3<EFBFBD><EFBFBD>4<EFBFBD><EFBFBD>5<EFBFBD><EFBFBD>6<EFBFBD><EFBFBD>7<EFBFBD><EFBFBD>8<EFBFBD><EFBFBD>9<EFBFBD><EFBFBD>SʮB<EFBFBD><EFBFBD>"
"\0<EFBFBD><EFBFBD>\1Ҽ\2<EFBFBD><EFBFBD>\3<EFBFBD><EFBFBD>\4<EFBFBD><EFBFBD>\5<EFBFBD><EFBFBD>\6½\7<EFBFBD><EFBFBD>\x8<EFBFBD><EFBFBD>\x9<EFBFBD><EFBFBD>sʰb<EFBFBD><EFBFBD>"
"G<EFBFBD><EFBFBD>"
"W<EFBFBD><EFBFBD>"
"Z<EFBFBD><EFBFBD>"
"N<EFBFBD><EFBFBD>"
"Y<EFBFBD><EFBFBD>"
"R<EFBFBD><EFBFBD>"
"J<EFBFBD><EFBFBD>"
"D<EFBFBD><EFBFBD>"
""
"K<EFBFBD><EFBFBD>"
"M<EFBFBD><EFBFBD>"
"F<EFBFBD><EFBFBD>"
"L<EFBFBD><EFBFBD>"
"T<EFBFBD><EFBFBD>"
"E<EFBFBD><EFBFBD>"
"O<EFBFBD><EFBFBD>"
""
"P<EFBFBD><EFBFBD>"
"C<EFBFBD><EFBFBD>"
""
"A<EFBFBD><EFBFBD>"
"I<EFBFBD><EFBFBD>"
"X<EFBFBD><EFBFBD>"
"+<2B><>"
"-<2D><>"
"*<2A><>"
"/<2F><>";
WORD sfx_table[]={
//<2F><> DA- 1
0x102, 0x80CC, //0x80C4,
// <20><> DE- 1
0x202, 0x80E6, //0x80DE,
// <20><> BA- 1
0x202, 0x2048,
// <20><> BAI- 1
0x102, 0x2056,
// <20><> BAN- 1
0x202, 0x205F,
// <20><> BAN- 1
0x102, 0x206A,
// <20><> BAO- 1
0x202, 0x2085,
// <20><> BEN- 1
0x102, 0x209B,
// <20><> BIAN- 1
0x202, 0x20BC,
// <20><> BIAO- 1
0x202, 0x20CA,
// <20><> BU- 1
0x102, 0x8058, //0x8054,
// <20><> BU- 1
0x202, 0x20FA,
// <20><> C,ANG- 1
0x102, 0x8088, //0x8080,
// <20><> C,ANG- 1
0x202, 0x808E, //0x8086,
// <20><> C,AO- 1
0x102, 0x2145,
// <20><> C,E- 1
0x202, 0x8098, //0x8090,
// 3<> C,U- 1
0x202, 0x218F,
// <20><> C,U- 1
0x202, 0x219D,
// <20><> C,UN- 1
0x102, 0x21B6,
// <20><> CONG- 1
0x202, 0x21CB,
// <20><> CUN- 1
0x202, 0x21DC,
// <20><> DAI- 1
0x202, 0x21EF,
// <20><> DAN- 1
0x102, 0x80D6, //0x80CE,
// <20><> DANG- 1
0x202, 0x2208,
// <20><> DAO- 1
0x202, 0x2212,
// <20><> DI- 1
0x102, 0x2222,
// <20><> DI- 1
0x102, 0x80F4, //0x80EC,
// <20><> DI- 1
0x202, 0x80F8, //0x80F0,
// <20><> DIAN- 1
0x202, 0x2238,
// <20><> DIAN- 1
0x102, 0x223C,
// <20><><EFBFBD><EFBFBD> DIAN-ZI- 1
0x104, 0x223C, 0x2EA4,
// <20><> DIAO- 1
0x202, 0x2249,
// <20>, DU- 1
0x202, 0x8116, //0x810E,
// <20><> DUAN- 1
0x102, 0x227F,
// <20><> DUI- 1
0x202, 0x2286,
// <20><> DUO- 11
0x302, 0x2293,
// <20><> E- 1
0x202, 0x22A1,
// <20><> FA- 1
0x202, 0x22B9,
// <20><> FANG- 1
0x102, 0x22D1,
// <20><> FEI- 1
0x102, 0x22D8,
// <20><> FEI- 1
0x202, 0x22E2,
// <20><> FEN- 1
0x202, 0x22EC,
// <20><> FENG- 1
0x202, 0x22F8,
// <20><> FU- 1
0x102, 0x2320,
// <20><> GAI- 1
0x102, 0x2332,
// <20><> GAN- 1
0x202, 0x233F,
// <20><> GAO- 1
0x102, 0x234E,
// <20><> GE- 1
0x102, 0x2366,
// <20><> GENG- 1
0x102, 0x236B,
// <20><> GONG- 1
0x202, 0x2371,
// <20><> GONG- 1
0x102, 0x237F,
// <20><> GU- 1
0x102, 0x2392,
// <20><> GUAN- 1
0x202, 0x23A8,
// <20><> GUO- 1
0x202, 0x23C7,
// <20><> ,AO- 1
0x102, 0x23EE,
// <20><> ,EI- 1
0x102, 0x2405,
// <20><> ,EN- 1
0x102, 0x2407,
// <20><> ,ONG- 1
0x102, 0x819E, //0x8194,
// <20><> ,OU- 1
0x202, 0x241E,
// ;<3B> ,U- 1
0x202, 0x2430,
// <20><> ,UA- 1
0x202, 0x2438,
// <20><> ,UAI- 1
0x102, 0x243E,
// <20><> ,UI- 1
0x202, 0x81B0, //0x81A6,
// <20><> ,UO- 1
0x202, 0x247E,
// <20><> JI- 1
0x202, 0x2483,
// <20><> JIA- 1
0x202, 0x81CC, //0x81C2,
// <20><> JIAN- 1
0x202, 0x24E5,
// <20><> JIANG- 1
0x202, 0x24F6,
// <20><> JIE- 1
0x202, 0x252C,
// <20><> JIN- 1
0x202, 0x2535,
// <20><> JIU- 1
0x102, 0x256C,
// <20><> JU- 1
0x202, 0x2579,
// <20><> JUN- 1
0x202, 0x259F,
// <20><> KE- 1
0x202, 0x25C4,
// <20><> KE- 1
0x202, 0x25C6,
// <20><> KE- 1
0x202, 0x25C7,
// <20><> KE- 1
0x102, 0x25CA,
// <20><> KE- 1
0x202, 0x25CF,
// <20><> KOU- 1
0x202, 0x25DB,
// <20><> LAO- 1
0x102, 0x262E,
// <20><> LE- 1
0x202, 0x827A, //0x826C,
// <20><> LEI- 1
0x202, 0x263F,
// <20><> LI- 1
0x202, 0x264E,
// <20><> LI- 1
0x202, 0x2663,
// <20><><EFBFBD><EFBFBD> LI-LUN- 1
0x204, 0x264C, 0x26F6,
// <20><> LIANG- 1
0x202, 0x267C,
// <20><> LIN- 1
0x202, 0x2693,
// <20><> LUN- 1
0x202, 0x26F6,
// <20><> LV- 1
0x202, 0x828E, //0x8280,
// ÿ MEI- 1
0x102, 0x2738,
// <20><> MEN- 1
0x202, 0x2740,
// <20><> MI- 1
0x202, 0x274D,
// <20><> MIAN- 1
0x102, 0x2757,
// <20><> MIAN- 1
0x202, 0x275F,
// ij MOU- 1
0x102, 0x278A,
// <20><> NAN- 1
0x102, 0x27A7,
// <20><> NAO- 1
0x102, 0x27AD,
// <20><> NEI- 11
0x302, 0x27B1,
// <20><> NIAN- 1
0x202, 0x27C1,
// Ů NV- 1
0x102, 0x27E3,
// <20><> PAI- 1
0x202, 0x8320, //0x8312,
// <20><> PANG- 1
0x202, 0x2809,
// Ƥ PI- 1
0x202, 0x2837,
// Ƭ PIAN- 1
0x202, 0x283F,
// Ʒ PIN- 1
0x202, 0x284A,
// ,<2C> QAUN- 1
0x102, 0x28FA,
// <20><> QI- 1
0x102, 0x8354, //0x8346,
// <20><> QI- 1
0x202, 0x288A,
// ǰ QIAN- 1
0x202, 0x28A1,
// <20><> QU- 1
0x202, 0x8388, //0x837A,
// ,<2C> QUAN- 1
0x202, 0x28F7,
// ,<2C> QUN- 1
0x202, 0x2909,
// ,<2C> REN- 1
0x202, 0x291A,
// ,<2C> RI- 1
0x202, 0x2924,
// <20><> S,ANG- 11
0x302, 0x297C,
// <20><> S,E- 1
0x202, 0x2994,
// <20><> S,ENG- 1
0x202, 0x29A6,
// ʡ S,ENG- 1
0x202, 0x83BE, //0x83B0,
// <20><> S,I- 1
0x202, 0x83E2, //0x83D4,
// <20><> S,I- 1
0x202, 0x29DD,
// <20><> S,OU- 1
0x202, 0x29E1,
// <20><> S,OU- 1
0x102, 0x29E7,
// <20><> S,U- 1
0x202, 0x29F4,
// ˫ S,UANG- 1
0x102, 0x2A14,
// ˮ S,UI- 1
0x202, 0x2A17,
// ˾ SI- 1
0x202, 0x2A27,
// ˼<><CBBC> SI-XIANG- 1
0x204, 0x8404, 0x2BCC, //0x83F8, 0x2BCC,
// <20><> SUO- 1
0x202, 0x2A62,
// ̨ TAI- 1
0x202, 0x2A6F,
// <20><> TI- 1
0x202, 0x2AAC,
// <20><> TIAO- 1
0x202, 0x2ABC,
// <20><> TIE- 1
0x102, 0x2AC1,
// ͷ TOU- 1
0x202, 0x2ADC,
// <20><> WAI- 11
0x302, 0x2B07,
// Ϊ WEI- 1
0x202, 0x2B2D,
// <20><> WU- 1
0x102, 0x8450, //0x8444,
// <20><> WU- 1
0x202, 0x2B72,
// ϵ XI- 1
0x202, 0x8458, //0x844C,
// <20><> XIA- 11
0x302, 0x2BA3,
// <20><> XIAN- 1
0x202, 0x2BB9,
// <20><> XIANG- 1
0x202, 0x2BC8,
// <20><>Ŀ XIANG-MU- 1
0x204, 0x2BCF, 0x2796,
// С XIAO- 1
0x102, 0x2BE0,
// <20><> XIN- 1
0x102, 0x2C01,
// <20><> XIN- 1
0x202, 0x2C03,
// <20><> XING- 1
0x202, 0x2C13,
// <20><> XING- 1
0x202, 0x2C0C,
// <20><><EFBFBD><EFBFBD> XING-Z,I- 1
0x204, 0x2C13, 0x2E3D,
// ѧ XUE- 1
0x202, 0x2C44,
// ѧ˵ XUE-S,UO- 1
0x204, 0x2C44, 0x83FE, //0x83F2,
// <20><> YAN- 1
0x202, 0x2C78,
// <20><> YANG- 1
0x102, 0x2C90,
// ҵ YE- 1
0x202, 0x2CB0,
// <20><> YI- 1
0x202, 0x2CC2,
// <20><> YOU- 1
0x102, 0x2D29,
// <20><> YU- 1
0x202, 0x2D33,
// ԭ YUAN- 1
0x102, 0x2D64,
// Ա YUAN- 1
0x202, 0x84C0, //0x84B4,
// Ժ YUAN- 1
0x202, 0x2D71,
// <20>˶<EFBFBD> YUN-DONG- 1
0x204, 0x2D82, 0x2262,
// <20><> ZI- 1
0x202, 0x2EA4,
// <20><> ZAI- 1
0x102, 0x2D90,
// <20><> ZAI- 1
0x102, 0x2D91,
// վ Z,AN- 1
0x202, 0x2DD3,
// <20><> Z,ANG- 1
0x202, 0x808A, //0x8082,
// <20><> Z,E- 1
0x202, 0x2DF4,
// <20><> Z,E- 1
0x202, 0x8532, //0x8526,
// <20><> Z,EN- 1
0x102, 0x2DFB,
// <20><> Z,EN- 1
0x202, 0x2E07,
// <20><> Z,ENG- 1
0x102, 0x2E12,
// <20><> Z,I- 1
0x202, 0x2E39,
// <20><> Z,ONG- 11
0x302, 0x2E43,
// <20><> Z,U- 1
0x102, 0x2E6A,
// ס Z,U- 1
0x202, 0x2E72,
// <20><><EFBFBD><EFBFBD> Z,U-YI- 1
0x204, 0x2E6A, 0x2CE0,
// רҵ Z,UAN-YE- 1
0x204, 0x2E79, 0x2CB0,
// ״ Z,UANG- 1
0x202, 0x2E85,
// ׼ Z,UN- 1
0x102, 0x2E8D,
// <20><> ZONG- 1
0x102, 0x2EAD,
// <20><> ZU- 1
0x202, 0x2EBA,
// <20><> ZUI- 1
0x102, 0x2EBF,
// <20><> ZUO- 1
0x102, 0x2EC8};
WORD sfx_table_size=sizeof sfx_table;
int FAR PASCAL sda_proc(WORD, LPWORD, BYTE, HIMC);
int FAR PASCAL tran_data(int, HIMC, BYTE);