Xlib/XWindow/X11关于输入法定位的资料说明


  • 链接

Xlib - C Language X Interface

两个关键字: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.

如果使用了这个参数,可以不需要预编辑值就工作。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

柳鲲鹏

能给阁下一点帮助,非常荣幸

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值