链接
两个关键字:XNSpotLocation、XIMPreeditPosition
- XIMPreeditPosition定义
typedef unsigned long XIMStyle;
#define XIMPreeditArea 0x0001L
#define XIMPreeditCallbacks 0x0002L
#define XIMPreeditPosition 0x0004L
#define XIMPreeditNothing 0x0008L
#define XIMPreeditNone 0x0010L
#define XIMStatusArea 0x0100L
#define XIMStatusCallbacks 0x0200L
#define XIMStatusNothing 0x0400L
#define XIMStatusNone 0x0800L
从定义来看,各占一位,应该是可以共存(当然某些情形是冲突的)。
- XIMPreeditPosition说明1
XIMPreeditPosition If chosen, the input method would require the client to provide
positional values. Refer to XIC values XNSpotLocation and XNFocusWindow.
这意思是说,如果设置了这个标志,就要求提供坐标。
- XIMPreeditPosition说明2
If the input method style is XIMPreeditPosition, XNArea specifies the clipping
region within which preediting will take place. If the focus window has been set,
the coordinates are assumed to be relative to the focus window. Otherwise, the
coordinates are assumed to be relative to the client window. If neither has been
set, the results are undefined.
此处意思是使用哪个窗口的位置。这个倒是不必关心。
- XNSpotLocation说明1
The XNSpotLocation argument specifies to the input method the coordinates
of the spot to be used by an input method executing with XNInputStyle set
to XIMPreeditPosition. When specified to any input method other than
XIMPreeditPosition, this XIC value is ignored.
从描述来看,此处意思是:如果输入法初始化不是XIMPreeditPosition,就忽略XNSpotLocation。
这有点奇怪。这个开关跟别的都冲突?
- XNSpotLocation说明2
The x coordinate specifies the position where the next character would be inserted.
The y coordinate is the position of the baseline used by the current text line in
the focus window. The x and y coordinates are relative to the focus window, if it
has been set; otherwise, they are relative to the client window. If neither the
focus window nor the client window has been set, the results are undefined.
The value of the argument is a pointer to a structure of type XPoint.
在WINDOWS上,候选框的坐标好像是屏幕上的;而LINUX上则是相对当前窗口的。
- XIMPreeditNothing说明
XIMPreeditNothing If chosen, the input method can function without any
preedit values.
如果使用了这个参数,可以不需要预编辑值就工作。