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.

282 lines
8.6 KiB

  1. /*************************************************
  2. * abcsda.h *
  3. * *
  4. * Copyright (C) 1995-1999 Microsoft Inc. *
  5. * *
  6. *************************************************/
  7. #define CHR 1
  8. #define SDA_NUMBER 2
  9. #define SDA_DELETE 3
  10. #define CAP_CHR 4
  11. #define FUC_CHR 5
  12. #define SPACE 6
  13. #define ESCAPE 7
  14. #define DK_SUB 0x2d // "-"seperator
  15. #define DK_FANX 0x5c // "\"
  16. #define DK_ZHENGX 0x2f // "/"
  17. #define DK_LP 0x60
  18. #define DK_RP 0x27 // " ' " seperator
  19. #define CURSOR 8
  20. #define ZH 1
  21. #define SH 2
  22. #define VH 3
  23. #define S 2
  24. #define FIRST_KEY_TOP 4//10
  25. #define FIRST_KEY_LEFT 5//10
  26. #define KEY_WIDTH 24//25//20//32 //35
  27. #define KEY_HIGH 28//7
  28. #define KEY_GAP -1//0
  29. #define INC 3
  30. #define KEYBOARD_W 546
  31. #define KEYBOARD_H 128 //135
  32. BYTE current_flag=0;
  33. BYTE current_number=0;
  34. BYTE rule_pointer=0;
  35. BYTE input_sum=0;
  36. BYTE sound_cvt_table_index[]="AEVO\0";
  37. BYTE sound_cvt_table_value[]={ZH,VH,SH,DK_RP};
  38. RECT Rect;
  39. RECT here;
  40. RECT Base_key;
  41. RECT Special_key;
  42. RECT Middle_key;
  43. RECT rectMax; //Mouse move validate area.
  44. HANDLE old_brush;
  45. HANDLE front_brush;
  46. HANDLE old_pen;
  47. HPEN pen;
  48. HFONT T_font,B_font,S_font;
  49. HWND hW, hSdaKeyBWnd;
  50. HWND Re;
  51. FARPROC FAR *lp;
  52. HCURSOR Hand_Cursor;
  53. LPRECT win_size;
  54. BYTE Sd_Open;
  55. unsigned char key_array[]={8,12,11,10};
  56. int f_key[5]={24,36,42,60};
  57. BYTE Sheng_Mu[]="AEVO\0";
  58. BYTE Sheng_Tishi[34][5]={"Q ",
  59. "W ",
  60. "CH ",
  61. "R ",
  62. "T ",
  63. "Y ",
  64. "U ",
  65. "I ",
  66. "' ",
  67. "P ",
  68. " ",
  69. " ",
  70. //"\\ ",
  71. "ZH ",
  72. "S ",
  73. "D ",
  74. "F ",
  75. "G ",
  76. "H ",
  77. "J ",
  78. "K ",
  79. "L ",
  80. " ",
  81. " ",
  82. "Z ",
  83. "X ",
  84. "C ",
  85. "SH ",
  86. "B ",
  87. "N ",
  88. "M ",
  89. " ",
  90. " ",
  91. " "};
  92. //BYTE Sheng_Tishi[]="ZHCHSH' \0";
  93. BYTE bx_tishi[]="һ��دؼ����ʮ��"
  94. "\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20";
  95. BYTE jianpan[]="`1234567890"
  96. "\x2d"
  97. "=\x5c";
  98. BYTE left_key[]="Esc "
  99. "Tab "
  100. "Caps "
  101. "Shift";
  102. BYTE left_key_cnt[]={3,3,4,5};
  103. BYTE right_key[]="Back "
  104. "Enter"
  105. "Space"
  106. "Ctrl+'-'";
  107. BYTE right_key_cnt[]={4,5,5,8};
  108. BYTE Key_Pos_Array[]={0xc,0x1b,0x19,0xe,0x2,0xf,0x10,0x11,0x7,0x12,
  109. 0x13,0x14,0x1d,0x1c,0x8,0x9,0x0,0x3,0xd,
  110. 0x4,0x6,0x1a,0x1,0x18,0x5,0x17};
  111. BYTE Key_Exc_Value[34*4]={0};
  112. BYTE Key_Real_Value[33]="QWERTYUIOP[]ASDFGHJKL;'ZXCVBNM,./";
  113. BYTE unused [40];
  114. BYTE index;
  115. LPWORD sda_out;
  116. FARPROC FAR *lp;
  117. HWND Re;
  118. int PointFlag=0;
  119. WORD NowFocus;
  120. RECT Push_b;
  121. int disp_mark = 1;
  122. BYTE xxxx[40]={0};
  123. extern BYTE slbl_tab[];
  124. /* Because this var is defined already in abcw2.h, do not duplicate definition
  125. to avoid build warning
  126. ="ZH00\1"
  127. "SH00\2"
  128. "CH00\3"
  129. "ING0\4"
  130. "AI00\5"
  131. "AN00\6"
  132. "ANG0\7"
  133. "AO00\x8"
  134. "EI00\x9"
  135. "EN00\xa"
  136. "ENG0\xb"
  137. "IA00\xc"
  138. "IAN0\xd"
  139. "IANG\xe"
  140. "IAO0\xf"
  141. "IE00\x10"
  142. "IN00\x11"
  143. "IU00\x12"
  144. "ONG0\x13"
  145. "OU00\x14"
  146. "UA00\x15"
  147. "UAI0\x16"
  148. "UAN0\x17"
  149. "UE00\x18"
  150. "UN00\x19"
  151. "UENG\x1a" //SC4K6c?*DBASE={<I5D1AH
  152. "UI00\x1b"
  153. "UO00\x1c"
  154. "UANG\x1d"
  155. "ER00\x1e"
  156. "IONG\x1f"
  157. "VE00\x18"
  158. "UEN0\x19"
  159. "VEN0\x19"
  160. "UEI0\x1b"
  161. "IOU0\x12"; */
  162. BYTE sy_tab1[]={'A',0, //a
  163. 20,0, //b=ou
  164. 17,22, //c=in
  165. 21,12, //d=ua,ia 1993.2.1
  166. 'E',0, //e="E"
  167. 10,0, //f=en
  168. 11,0, //g=eng
  169. 7,0, //h=ang
  170. 'I',0, //i=i
  171. 6,0, //j=an
  172. 8,0, //k=ao
  173. 5,0, //l=ai
  174. 24,27, //m=ue,ui
  175. 25,'N', //n=un,"N'
  176. 'O',28, //o='O'
  177. 23,23, //p=uan,uan
  178. 9,0, //Q=ei
  179. 18,30, //R=ui,er
  180. 31,19, //s=iong,ong
  181. 29,14, //t=uang,iang
  182. 'U',0, //u="U"
  183. 'V',0, //Q="V"
  184. 13,0, //w=ian
  185. 16,0, //k=ie
  186. 4,0, //g=ing
  187. 15,0}; //z=iao
  188. ///////////////////////////////////////////////////////////////////////
  189. // A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
  190. ///////////////////////////////////////////////////////////////////////
  191. BYTE sy_tab_base[]={
  192. 1,1,S,1,1,1,1,1,1,1,1,1,S,1,S,S,1,0,S,1,1,0,0,0,0,0, //FK_A
  193. 1,0,1,0,0,1,1,1,1,1,1,1,0,0,1,0,1,0,0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0,1,1,1,1,1,1,1,1,S,1,S,S,0,0,S,0,1,0,0,0,0,0, //FK_S
  211. 1,1,0,0,1,0,1,1,1,1,1,1,S,1,S,S,1,0,S,0,1,0,1,1,1,1, //FK_T
  212. 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, //FK_U
  213. 1,1,S,1,1,1,1,1,1,1,1,1,S,1,S,S,1,S,0,1,1,0,0,0,0,0, //FK_V
  214. 1,0,0,0,0,1,1,1,0,1,0,1,0,0,1,1,1,0,0,0,1,0,0,0,0,0, //FK_W
  215. 0,0,1,S,0,0,0,0,1,0,0,0,1,1,1,1,0,1,1,S,0,1,1,1,1,1, //FK_X
  216. 1,1,1,0,1,0,0,1,1,1,1,0,1,1,1,1,0,0,S,0,1,0,0,0,1,0, //FK_Y
  217. 1,1,0,0,1,1,1,1,1,1,1,1,S,1,S,S,1,0,S,0,1,0,0,0,0,0}; //FK_Z
  218. ///////////////////////////////////////////////////////////////////////
  219. // A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
  220. ///////////////////////////////////////////////////////////////////////
  221. struct RULE{
  222. BYTE length;
  223. BYTE type;
  224. WORD chr;
  225. }rule_buf[30];
  226. int WINAPI DebugShow( LPSTR msg1, int msg2);
  227. int FAR PASCAL sda_proc(WORD, LPWORD, BYTE, HIMC);
  228. void WINAPI sda_ts(HIMC, UINT, WPARAM, LPARAM);
  229. int FAR PASCAL tran_data(int, HIMC, BYTE);
  230. int FAR PASCAL tran_data2(int);
  231. LONG FAR PASCAL Diaman(HWND,unsigned int,WORD,LONG);
  232. int WINAPI chr_type(WORD);
  233. BOOL WINAPI yuan_or_fu(WORD);
  234. BOOL WINAPI fill_rule(WORD);
  235. BOOL WINAPI match_and_find(WORD);
  236. BOOL WINAPI match_and_find_0(WORD);
  237. BOOL WINAPI match_and_find_1(WORD);
  238. BOOL WINAPI got_py(WORD);
  239. BOOL WINAPI find_tishi_pp(WORD);
  240. void WINAPI disp_tishi(HIMC hIMC, int mark);
  241. void WINAPI get_rect_base();
  242. BOOL WINAPI get_rect_left(BYTE);
  243. BOOL WINAPI get_rect_right(BYTE);
  244. BOOL WINAPI get_rect_mid(BYTE);
  245. void WINAPI paint_key(HDC hDC);
  246. void WINAPI paint_key2(HDC hDC);
  247. void WINAPI paint_first_line(HDC hDC);
  248. void WINAPI paint_mid_key(HDC hDC);