该楼层疑似违规已被系统折叠 隐藏此楼查看此楼
GNU吧人少贴稀,屮特来发点最近学习输服噐编程时翻译的文档,以飨贴友、过客。
IM Server Developers Kit - C Language Interface
输入法服务噐开发套件--C语言接口
Hidetoshi Tajima
隐蒇到死他急吗
X11R6 Xi18n Implementation Group
X11R6 Xi18n 实现组
May 15, 1994
1994年5月15日
1. Functions List //1. 函数列表
1.1. Open IM Servive //1.1. 打开输入法服务噐
XIMS IMOpenIM(Display display,...)
display specifies the connection to the X server.
... specifies the variable length argument list to set
IMValues. For further information, see the Section 2
"IMValues".
display 指定至X服务噐的连接。
... 指定变长参数列表设置输入法值组。更进一步的信息,参见节2“输入法值组”
IMOpenIM initializes the connection for the Input Method Service, and
also sets one or more IMValues which are specified by a variable length
argument list programming interface, and when succeeding to open the
connection, IMOpenIM allocates a new XIMS structure and returns it,
otherwise IMOpenIM returns NULL. XIMS is an opaque data structure to
abstract the Input Method Service. ()
IMOpenIM初始化输入服务连接,同时也设置一个或更多IMValues。IMValues由变长参数
列表的编程接口指定,而且当成功打开连接,IMOpenIM 分配一个新XIMS结构并返回它(实则
返回的氏它的已分配内存块指针),否则IMOpenIM返回NULL。XIMS氏一个opaque数据结构用来
抽象化输入法服务。
First, IMOpenIM initializes a preconnection method by which clients
can search for the IMserver. The convention of the preconnection varies
with the IMProtocol model as below, however, you don't have to pay much
attention to such difference, because IMOpenIM encapsulates it.
首先,IMOpenIM根据哪一个客户端能被输入法服务噐找到,初化化一个预连接方法。
预连接的情况根据下面输入法协议模型而变化,然而,你不必付出大量注意力对付象这样的
差异,因为IMOpenIM函数会封装它。
Preconnection for R5 Ximp
IMserver must create the selection owner window of the ATOM for
the string, such as "_XIMP_%locale" or something, which are used
by clients to search for the IMserver.
适用于R5 ximp的预连接
输入法服务噐必须创建选择拥有者窗口,用于串之的ATOM,例如"_XIMP_%locale"
或者某些事物,它由客户端程序据此搜索输入法服务噐。
Preconnection for R6 IMProtocol
IMserver must create the selection owner window of the ATOM for
the string, such as "@server=%im_name", and registers the ATOM
with the list of "XIM_SERVERS" property of the default root
window, which contains a list of ATOMs, each of which represents
each available IMservers on the display.
适用于R6 IMProtocol输入法协议的预连接
输入法服务噐IMserver必须创建适用此串ATOM的拥有者窗口,例如"@server=%im_name",
并且注册这个ATOM用这个"XIM_SERVERS"列表,正确的默认根窗口,它包含一个ATOMs列表,它们
中的每一个代表各个可以获得的在显示上的输入法服务噐IMservers。
Second, IMOpenIM initialize a transport connection on which clients
and the IMserver can send and receive IMProtocols with each other. The
procedures to initialize the transport connection varies with the
transport mechanism as below, however, you don't have to pay any
attention to such difference, either, because IMOpenIM also encapsulates
it.
其次,IMOpenIM函数初始化一个传输端口连接,在此端口,接受输入的客户端和输服噐IMserver
能彼此发送和接收输入法协议数据。此初始化处理传输端口连接的过程根据下面传输机制的不同
而有差异,然而,你不必花费太多注意力了解象这样的差别,与前述类似,因IMOpenIM已封装它。
Transport connection for X
IMserver must intern a number of ATOMs for the properties which
are used to set some IMserver specific feature and
characteristic.
适用X的传输端口连接
输服噐IMserver必须保留一些ATOMs数字用于设置IMserver指定的特征和行为的属性。
Transport connection for TCP/IP
IMserver must open a listening socket to wait for connection
request from clients.
适用TCP/IP的传输端口连接
输服噐TCP/IP必须打开一个监听套接字以等待来自客户端的连接请求。
1.2. Set IM Attributes //设置输入法IM属性集
char *IMSetIMValues(XIMS ims,...)
ims specifies the input method service.
... specifies the variable length argument list to set
IMValues.
ims 指定输入法服务。
... 指定设置输入法参数集IMValues的变长参数列表。
IMSetIMValues registers one or more IMValues, which are specified by
a variable length argument list programming interface, with the XIMS
structure. Note that IMOpenIM is also used to set all IMValues, and some
IMValues must be set when IMOpenIM is called.
IMSetIMValues函数注册一个或多个输入法参数集IMValues,它由一个变长参数列表编程
接口指定,带有XIMS结构。注意IMOpenIM函数也用于设置所有输入法参数集IMValues,并且
某些输入法参数集IMValues必须在IMOpenIM函数被调用时设置。