[Uim] [immodule_for_Qt] stabilizing API change
YamaKen
yamaken at bp.iij4u.or.jp
Sat Jun 5 23:02:04 EEST 2004
Hi IM folks, here is a newsletter from Qt world.
Sorry for posting this non uim-centric article to the list. I
will move the discussions to appropriate place once I get.
This mail is intended to start cooperating with SCIM developers
involving immodule for Qt. I apologize for the existence of
language barrier of the project. Feel free to start discussion
in English after now.
- What's going on?
In last month, the immodule project got a good notification
from Trolltech about merging the patch. I was glad to be
notified so as a participant of the immodule project. But I
felt that the patch is still contains some problems about API
design and behaviors, as a uim developer. So I decided to
spend all time for the immodule project and restructure it two
weeks ago to avoid serious regret.
The restructuring named "Simplified API" have almost done. And
I've also modified the QUimInputContextPlugin to adapt to the
new API and it works more properly than with old API.
The API changing has been transited to concluding phase
now. I'm waiting for checking by the project maintainer,
Daisuke-san. He will release new immodule patch once my patch
has been validated.
- Remaining work
* Fix some bugs
* Update comments in the patch
* Validate the specification by community
* Update documents
* Send updated patch to Trolltech
I'm now writing the ChangeLog about the patch. A half of changes
have been described as below.
2004-06-04 YamaKen <yamaken at bp.iij4u.or.jp>
* src/kernel/qinputcontext.h
- (font): New function. Returns the font of focusWidget()
* src/kernel/qinputcontext.cpp
- (font): New function
* src/kernel/qwidget_x11.cpp
- (setActiveWindow, focusInputContext): Avoid calling
qic->setFocus() if the target is identical widget
- (setMicroFocusHint, setActiveWindow, createInputContext,
destroyInputContext, resetInputContext,
focusInputContext): Remove obsolete comment around qic
retrieving
* src/input/qximinputcontext_x11.cpp
- (language): Return Chinese languages appropriately (such
as "zh_CN")
2004-06-03 YamaKen <yamaken at bp.iij4u.or.jp>
* src/kernel/qinputcontext.h
- (getOwnerWidget): Remove to rename to ownerWidget
- (ownerWidget): New function. Rename from getOwnerWidget to
be consistent with the name focusWidget
- (focusWidget): New function. Add to make IM-related
communication with focusWidget easy. The name is imported
from QApplication::focusWidget to be supposed same role
- (language): Change return type to QCString from const char *
- (filterEvent): Change args. Passes QEvent *event rather than
preexpanded key event values. This is intended to pass other
IM-related events in future. The IM-related events are
supposed as QWheelEvent, QTabletEvent and so on
- (setFocusHint): Remove to be appropriate name
- (setMicroFocus):
* Rename from setFocusHint to be appropriate name. This
function instructs 'MicroFocus' rect within a widget that
is different to normal focus for widgets, so the name
'setFocus' is invalid. And 'Hint' is a concept for the
manager of this class and loses the meaning when passed to
this class. The passed values are not a hint but have
well-defined actual effect, so the name 'Hint' is
invalid. Finally, Qt/Embedded 2.3.7 has a samely named
method in QWSInputMethod
* Remove the arg 'widget' to consistent with the new
focusWidget() method
- (mouseHandler): New function. The method interface is
imported from QWSInputMethod::mouseHandler() of Qt/Embedded
2.3.7 and extended for desktop system
- (sendIMEvent): New function. Conventional function to send
QIMEvent to appropriate widget using focusWidget(). IM
developers can send IMEvents without tracking focuswidget by
themself
- (ownerWidget): Remove to Rename to _ownerWidget
- (_ownerWidget): New variable. Renamed from ownerWidget to
avoid name conflict with ownerWidget()
- (_focusWidget): New variable.
* src/kernel/qinputcontext.cpp
- (QInputContext): Follow API change
- (~QInputContext): Clean up
- (filterEvent): Follow API change
- (sendIMEvent): New function.
- (setFocusHint): Remove to follow new API
- (setMicroFocus): copied from setFocusHint and reimplement to
follow new API
- (mouseHandler): New function
- (language): Follow API change
* src/kernel/qwidget.h
- (sendMouseEventToInputContext): New function
- (unfocusInputContext): New function
* src/kernel/qwidget.cpp
- (setFocus): Invoke unfocusInputContext() with previous
focus widget to delegate reset responsibility to input
context instead of resetInputContext() directly. See also
comment for further information
- (clearFocus): Add unfocusInputContext();
- (event): Delegate reset responsibility to input context
instead of resetInputContext() directly. See also comment
for further information
* src/kernel/qwidget_x11.cpp
- (setMicroFocusHint): Modify to follow API change
- (setActiveWindow): Modify to follow API change
- (focusInputContext): Modify to follow API change
- (unfocusInputContext): New function
- (sendMouseEventToInputContext): New function
* src/kernel/qapplication_x11.cpp
- (class QETWidget): Change translateKeyEventInternal definition
- (x11ProcessEvent): Change QInputContext::filterEvent()
invocation to follow API change
- (translateKeyEventInternal):
* Add new arg statefulTranslation to enable duplicate call
within single event loop. This is required to support both
QInputContext::filterEvent() and RTL extensions
* Restore accidencially omitted qt_mode_switch_remove_mask
handling
* src/input/qximinputcontext_p.h
- (class QXIMInputContext): Follow API change of QInputContext
- (language): Change return type to follow new API
- (setFocus): Change arg to follow new API
- (setFocusHint): Remove to follow new API
- (setMicroFocus): New method to follow new API
- (mouseHandler): New method to follow new API
- (sendIMEvent): New method (reimp)
- (focusWidget): Remove to follow new API
- (cpos): New variable
- (sellen): New variable
* src/input/qximinputcontext_x11.cpp
- (qt_compose_emptied): Remove as result of optimization. It
has become unnecessary now
- (xic_start_callback): Add IMStart event sending as
result of optimization
- (xic_draw_callback): Optimize state management for IMEvent
sending, and simplify using sendIMEvent()
- (xic_done_callback): Simplify using sendIMEvent()
- (QXIMInputContext):
* Follow class definition change
* Follow API change
- (~QXIMInputContext): Modify to follow API change
- (x11FilterEvent): Optimize state management for IMEvent
sending, and simplify using sendIMEvent()
- (sendIMEvent): New function. Implement to remember last
IMEvent information
- (reset): Simplify using sendIMEvent()
- (resetClientState): Follow class definition change
- (setFocusHint): Remove to follow new API
- (setMicroFocus): copied from setFocusHint and modified to
follow new API
- (mouseHandler): New function. Implemented to reset the
context on MouseButtonPress except for Japanese IM. See
also comment for further information
- (setFocus): Reimplement to follow new API. Automatically
handles appropriate IMEvent sending on focus transition
- (unsetFocus): Reimplement to follow new API Implemented to
reset the context on FocusOut except for Japanese IM. See
also comment for further information
* src/widgets/qlineedit.h
- (sendMouseEventToInputContext): New function
* src/widgets/qlineedit.cpp
- (QLineEditPrivate::composeMode): New function
- (QLineEditPrivate::hasIMSelection): New function
- (QLineEditPrivate::preeditLength): New function
- (QLineEditPrivate::imSelectionLength): New function
- (mousePressEvent, mouseMoveEvent, mouseReleaseEvent,
mouseDoubleClickEvent): Support QInputContext::mouseHandler()
- (sendMouseEventToInputContext): New function. Retrieve the
position and call QWidget::sendMouseEventToInputContext()
- (drawContents): Follow API change
* src/widgets/qtextedit.h
- (sendMouseEventToInputContext): New function
* src/widgets/qtextedit.cpp
- (QTextEditPrivate::composeMode): New function
- (sendMouseEventToInputContext): New function. Retrieve the
position and call QWidget::sendMouseEventToInputContext()
- (imComposeEvent, imEndEvent): Clean up with composeMode()
- (contentsMousePressEvent, contentsMouseMoveEvent,
contentsMouseReleaseEvent, contentsMouseDoubleClickEvent):
Support QInputContext::mouseHandler()
2004-06-01 YamaKen <yamaken at bp.iij4u.or.jp>
* src/input/qximinputcontext_x11.cpp (x11FilterEvent): Fix
commit problem except for on-the-spot style
2004-05-31 YamaKen <yamaken at bp.iij4u.or.jp>
* A lot of changes to be described
-------------------------------
YamaKen yamaken at bp.iij4u.or.jp
More information about the uim
mailing list