作者: Keiichi Takahashi
日時: 2002/6/01(10:22)
ビットウォークの高橋です。

TkのXIM、あるいはIMEにおける変換ウィンドウの表示位置制御について、以前、
このMLでディスカッションしましたが、Jeff氏のサポートによりCVSにある
Tcl/Tk8.4a5ではとりあえずまともに動作するようになりました。

文字入力の際、漢字変換をする我々にとって、オリジナルソースで入力サポート
がされているということはとても嬉しいことなのですが、Tclコアチーム(TCT)で
は、新機能追加にあたって、正規の手続き(まずTIPを発行すること)を踏んで
いないのではないのかという批判が出ていました。

この度ようやくJeffしからTIP(Tcl Improvement Proposal)文書がリリースされ
ました(tk caretというコマンドが追加されているので、動作を確認してみる予
定です)。英文ですが以下が今回リリースされたTIPになります、ご参考まで。


-------- Original Message --------
Subject: TIP #96: Add [tk caret] Command and Tk_SetCaretPos API
Date: Fri, 31 May 2002 21:28:55 +0000 (UTC)
From: Jeff Hobbs <JeffH@...>
Reply-To: Jeff Hobbs <JeffH@...>
Organization: Tcl Core Team
Newsgroups: comp.lang.tcl.announce,comp.lang.tcl
Followup-To: comp.lang.tcl


 TIP #96: ADD [TK CARET] COMMAND AND TK_SETCARETPOS API
========================================================
 Version:      $Revision: 1.1 $
 Author:       Jeff Hobbs <JeffH_at_ActiveState.com>
 State:        Draft
 Type:         Project
 Tcl-Version:  8.4
 Vote:         Pending
 Created:      Wednesday, 29 May 2002
 URL:          http://purl.org/tcl/tip/96.html
 WebEdit:      http://purl.org/tcl/tip/edit/96
 Post-History:

-------------------------------------------------------------------------

 ABSTRACT
==========

 This TIP proposes to add a [tk caret] command and [Tk_SetCaretPos] C
 API to manage _carets_ in Tk. _caret_ is the term for where text of
 graphics will be inserted. It is necessary for correct accessibility
 functionality (to know where to shift focus), and for location the IME
 or XIM input box to handle complex character input (e.g. Asian
 character sets).

 RATIONALE
===========

 Tk has up until now not managed the caret within its windows. This has
 led to it being not Windows Accessibility certifiable. On Windows, this
 also cause the IME window to show in the top-left corner of the window
 (somewhat OK for entries, bad for text widgets). On X, this meant that
 Tk had to use the root-window style XIM input, which is a poor second
 to over-the-spot XIM input. Managing the caret corrects these problems.

 Exposing the functionality at the Tcl level allows extension writers to
 use the functionality without having to make Tk version API checks. A
 simple

      catch {tk caret $w -x $x -y $y}

 will suffice to work across versions.

 SPECIFICATION
===============

      tk caret window ?-x xPos? ?-y yPos? ?-height height?
      void Tk_SetCaretPos (Tk_Window tkwin, int x, int y, int height)

 _-height_ specifies the height of the input line and is important
 because Windows and X interpret the x,y coordinates differently
 (top-left and bottom-left respectively), so it must be adjusted by
 height for X. If no height is specified, the height of the window
 passed in will be used.

 I chose to use the _-option value_ format because it allows for future
 extensibility. There are APIs to control the font and other aspects of
 the IME/XIM input window that appears, but management of these is not
 covered in this tip.

 REFERENCE IMPLEMENTATION
==========================

 The Tk_SetCaretPos implementation is currently in the core. It needs to
 be modified to move the caret information to be per display, instead of
 per process.

 File: _tk/mac/tkMacXStubs.c_

 File: _tk/win/tkWinX.c_

 File: _tk/unix/tkUnixKey.c_

 Function: _Tk_SetCaretPos_

 COMMENTS
==========

 The current implementation at the C level was implemented with the
 assistance of Keiichi Takahashi (BitWalk), Koiichi Yamamoto, Moo Kim
 (NCR), and Mike Fabian (SuSE). It has been tested on Windows 98/2000/XP
 and SuSE 7.3 using kinput/canna2.

 COPYRIGHT
===========

 This document has been placed in the public domain.

-------------------------------------------------------------------------

 TIP AutoGenerator - written by Donal K. Fellows

[[Send Tcl/Tk announcements to tcl-announce@...
  Send administrivia to tcl-announce-request@...
  Announcements archived at http://groups.yahoo.com/group/tcl_announce/
  The primary Tcl/Tk archive is ftp://ftp.neosoft.com/pub/tcl/ ]]


-- 
Keiichi Takahashi, bitWalk Co.,Ltd.
mailto:bitwalk@...
http://members10.tsukaeru.net/bitwalk/