/* ### ### This file is part of ### ### TurboLinux ZWinPro ### ### Copyright (C) 1999-2000 TurboLinux, Inc. ### All Rights Reserved ### Distributed under the terms of the GNU General Public License (GPL) ### ### ### Authors: TurboLinux Chinese Development Team: ### Justin Yu ### Sean Chen ### Daniel Fang ### WWW: http://www.turbolinux.com.cn/ZWinPro/ ### FTP: ftp://ftp.turbolinux.com.cn/pub/ZWinPro/ ### */ #define HZINPUT_CLIENT_VERSION "3.0.1" #define HZINPUT_SERVER_VERSION "3.0.1" #define HZINPUT_SERVER_PROTOCOL "CHINESE_CONVERSION" #define HZSERVER_ENCODING_GB 0 #define HZSERVER_ENCODING_BIG5 1 #define HZSERVER_ENCODING_JIS 2 #define HZSERVER_ENCODING_KS 3 #define HZSERVER_ENCODING_LATIN1 4 #define HZSERVER_ENCODING_LATIN2 5 #define HZSERVER_ENCODING_LATIN3 6 #define HZSERVER_ENCODING_LATIN4 7 #define HZSERVER_ENCODING_CYRILLIC 8 #define HZSERVER_ENCODING_ARABIC 9 #define HZSERVER_ENCODING_GREEK 10 #define HZSERVER_ENCODING_HEBREW 11 #define HZSERVER_ENCODING_LATIN5 12 #define HZSERVER_ENCODING_LATIN6 13 #define HZSERVER_ENCODING_UNKNOWN (-1) #define HZCLIENT_QUERY_PROTOCOL 0 #define HZCLIENT_QUERY_VERSION 1 #define HZCLIENT_QUERY_ENCODING 2 #define HZCLIENT_QUERY_INPUTMETHOD 3 #define HZCLIENT_QUERY_STATUS 4 #define HZCLIENT_QUERY_UNKNOWN (-1) #define HZCLIENT_CONFIG_DEFAULTCOLOR 0 #define HZCLIENT_CONFIG_DIMCOLOR 1 #define HZCLIENT_CONFIG_LIGHTCOLOR 2 #define HZCLIENT_CONFIG_PANELCOLOR 3 #define HZCLIENT_CONFIG_TEXTCOLOR 4 #define HZCLIENT_CONFIG_HZFONT 5 #define HZCLIENT_CONFIG_FONT 6 #define HZCLIENT_CONFIG_INMETHOD 7 #define HZCLIENT_CONFIG_ENCODING 8 #define HZCLIENT_CONFIG_DICTIONARY 9 #define HZCLIENT_CONFIG_ASSOCIATION 10 #define HZCLIENT_CONFIG_LOCKWINDOW 11 #define HZCLIENT_CONFIG_RELEASEWINDOW 12 #define HZCLIENT_CONFIG_PLUGIN 13 #define HZCLIENT_CONFIG_FREEWIN 14 #define HZCLIENT_CONFIG_HIDE 15 #define HZCLIENT_CONFIG_SHOW 16 #define HZCLIENT_CONFIG_ROOTDRAW 17 #define HZCLIENT_CONFIG_WINDRAW 18 #define HZCLIENT_CONFIG_POSITION 19 #define HZCLIENT_CONFIG_QJ 20 #define HZCLIENT_CONFIG_PUNCT 21 #define HZCLIENT_CONFIG_LOCK 22 #define HZCLIENT_CONFIG_SWITCH 23 #define HZCLIENT_CONFIG_KEYBOARD 24 #define HZCLIENT_CONFIG_HANDWRITING 25 #define HZCLIENT_CONFIG_VOICE 26 #define HZCLIENT_CONFIG_CLOSE 27 #define HZSERVER_STATUS_DISABLED 0 #define HZSERVER_STATUS_ENABLED 1 #define HZSERVER_KEYBOARD_NULL 0 #define HZSERVER_KEYBOARD_SYMBOL_NUMERIC 1 #define HZSERVER_KEYBOARD_QJ_PY 2 #define HZSERVER_KEYBOARD_JAPANESE 3 #define HZSERVER_KEYBOARD_GREEK_RUSSIAN 4 #define HZSERVER_KEYBOARD_TABLE 5 #define HZSERVER_OUTPUT_NORMAL_KEY 0 #define HZSERVER_OUTPUT_FUNCTION_KEY 1 #define HZSERVER_OUTPUT_HANZI 2 #define HZSERVER_OUTPUT_BAD -1 #define HZSERVER_INPUT_METHOD_DISABLE -1 #define HZSERVER_INPUT_METHOD_ENABLE -2 #define HZSERVER_INPUT_METHOD_GB_ASCII 1 #define HZSERVER_INPUT_METHOD_GB_IC 2 #define HZSERVER_INPUT_METHOD_GB_QW 3 #define HZSERVER_INPUT_METHOD_GB_TONEPY 4 #define HZSERVER_INPUT_METHOD_GB_QJ 5 #define HZSERVER_INPUT_METHOD_GB_PUNCT 6 #define HZSERVER_INPUT_METHOD_GB_PY 7 #define HZSERVER_INPUT_METHOD_GB_CCDOSPY 8 #define HZSERVER_INPUT_METHOD_GB_WUBI 9 #define HZSERVER_INPUT_METHOD_GB_CANGJIE 10 #define HZSERVER_INPUT_METHOD_GB_ENGLISH 11 #define HZSERVER_INPUT_METHOD_GB_CTLAU 12 #define HZSERVER_INPUT_METHOD_GB_SW 13 #define HZSERVER_INPUT_METHOD_GB_QIANMA 14 #define HZSERVER_INPUT_METHOD_GB_TELECODE 15 #define HZSERVER_INPUT_METHOD_GB_HIRAGANA 16 #define HZSERVER_INPUT_METHOD_GB_KATAKANA 17 #define HZSERVER_INPUT_METHOD_GB_ZNPY 18 #define HZSERVER_INPUT_METHOD_GB_MGM 19 #define HZSERVER_INPUT_METHOD_GB_TABLE 20 #define HZSERVER_INPUT_METHOD_GB_CODE 21 #define HZSERVER_INPUT_METHOD_BIG5_ASCII 101 #define HZSERVER_INPUT_METHOD_BIG5_IC 102 #define HZSERVER_INPUT_METHOD_BIG5_PY 103 #define HZSERVER_INPUT_METHOD_BIG5_QJ 104 #define HZSERVER_INPUT_METHOD_BIG5_PUNCT 105 #define HZSERVER_INPUT_METHOD_BIG5_ETZY 106 #define HZSERVER_INPUT_METHOD_BIG5_ZOZY 107 #define HZSERVER_INPUT_METHOD_BIG5_SIMPLEX 108 #define HZSERVER_INPUT_METHOD_BIG5_CANGJIE 109 #define HZSERVER_INPUT_METHOD_BIG5_ENGLISH 110 #define HZSERVER_INPUT_METHOD_BIG5_4CORNER 111 #define HZSERVER_INPUT_METHOD_BIG5_HSU 112 #define HZSERVER_INPUT_METHOD_BIG5_ARRAY30 113 #define HZSERVER_INPUT_METHOD_BIG5_BOSHIAMY 114 #define HZSERVER_INPUT_METHOD_BIG5_ZNPY 115 #define HZ_PROTOCOL_ATOM "_CHINESE_CONVERSION" #define HZ_HPROTOCOL_ATOM "_CHINESE_HANDWRITING" #define HZ_VPROTOCOL_ATOM "_CHINESE_VOICERECOGNITION" #define HZ_TOOLBAR_ATOM "_CHINESE_CONTROLBAR" #define HZ_OUTPUT_ATOM "_HZ_OUTPUT_ATOM" #define HZ_HANDWRITING_ATOM "_HZ_HANDWRITING_ATOM" #define HZ_VOICE_ATOM "_HZ_VOICE_ATOM" #define HZ_INPUT_ATOM "_HZ_INPUT_ATOM" #define HZ_CONFIG_ATOM "_HZ_CONFIG_ATOM" #define HZ_QUERY_ATOM "_HZ_QUERY_ATOM" #define HZ_REPLY_ATOM "_HZ_REPLY_ATOM" #define HZ_GRASP_ATOM "_HZ_GRASP_ATOM" #define HZ_GRASP2_ATOM "_HZ_GRASP2_ATOM" Atom hz_protocol_atom; /* protocol atom marking the server */ Atom hz_hprotocol_atom; /* protocol of handwriting */ Atom hz_vprotocol_atom; /* from voice recognition */ Atom hz_toolbar_atom; /* protocol atom for toolbar */ Atom hz_output_atom; /* atom for output from the server */ Atom hz_handwriting_atom; Atom hz_voice_atom; Atom hz_input_atom; /* atom for key press */ Atom hz_query_atom; /* query server */ Atom hz_reply_atom; /* reply client query */ Atom hz_config_atom; /* config server attributes and state */ Atom hz_grasp_atom; /* grasp word from screen */ Atom hz_grasp2_atom; /* grasp word, with small edict */ int HZclientInit(); /* argument: null return: 0 success, 1: failed */ int HZsendKey(); /* argument: dpy display win client window event send keypress event return: 0 -- server not on 1 -- OK */ int HZprocInput(); /* argument: clientevent number number chars returned by server(or client) code key code returned state key state(modifier) str string buffer(hanzi) return: -1 nothing happened 0 normal key; 1 function key; 2 string */ int HZqueryServer(); /* argument: display display window client window which want to accept event type query type str returned string return: 0 -- server not on 1 -- OK */ /* input event destination: server window event.xclient.message_type = hz_input_atom event.xclient.format = 32 event.xclient.data.l[0] = keysym; event.xclient.data.l[1] = key_status_mask; event.xclient.data.l[2...4] unused if server not loaded, then the client will send itself a client event for the client to process conveniently.... destination: client window event.xclient.message_type = hz_output_atom event.xclient.format = 32 event.xclient.data.b[0] = 1; event.xclient.data.l[1] = keysym; event.xclient.data.l[2] = status(modifier) event.xclient.data.l[3...4] unused */ /* output event destination: client window event.xclient.message_type = hz_output_atom event.xclient.format = 32 event.xclient.data.b[0] = total_chars_converted; event.xclient.data.b[1] = charbuf... */ /* query event destination: server window event.xclient.message_type = hz_query_atom event.xclient.format = 32 event.xclient.data.l[0] = query_type; event.xclient.data.l[1...4] unused query_type: HZCLIENT_QUERY_PROTOCOL 0 HZCLIENT_QUERY_VERSION 1 HZCLIENT_QUERY_ENCODING 2 HZCLIENT_QUERY_STATUS 3 */ /* reply event destination: client window event.xclient.message_type = hz_reply_atom event.xclient.format = 32 event.xclient.data.b[0] = reply_type; event.xclient.data.b[1...] = answer .... */ /* config event destination: server window event.xclient.message_type = hz_config_atom event.xclient.format = 32 event.xclient.data.l[0] = config_type; config_type: HZSERVER_CONFIG_FGCOLOR 1 HZSERVER_CONFIG_BGCOLOR 2 HZSERVER_CONFIG_PANELCOLOR 3 HZSERVER_CONFIG_ENCODING 4 HZSERVER_CONFIG_INPUTMTHD 5 HZSERVER_CONFIG_INPUTKBD 6 color type: event.xclient.data.l[1] = red event.xclient.data.l[2] = green event.xclient.data.l[3] = blue encoding type: event.xclient.data.l[1] = encoding_type input method type: event.xclient.data.l[1] = encoding_method input keyboard type: event.xclient.data.l[1] = keyboard_type; */