[immodule-qt] Porting to Qt4

YamaKen yamaken at bp.iij4u.or.jp
Mon Aug 23 11:15:23 EEST 2004


Hi all, I've ported our code into Qt4 initially.

Ported code has been released as patch file since our svn
repository is not properly working from yesterday.

Download qt-x11-immodule-qt4.0.0-tp1-20040822.diff.gz from
following page and please review it.

http://immodule-qt.freedesktop.org/Software/ImmoduleQtDownload

Lars, is QIMEvent handling of QTextEdit implemented in Qt4 head?
If so, I'll suspend the development for the class and wait for
preview2.


commit log:
----------------------------------------------------------------------
* Initial porting to Qt4 preview1 from Qt3 trunk r110
  - coding style is not modified yet
  - Only QLineEdit is full featured immodule-ready text
    widget. Q3TextEdit and QTextEdit is not developed well.

* configure
  - Merge diffs from Qt3 trunk

* include/QtGui/QInputContextPlugin
* include/QtGui/qinputcontextplugin.h
* include/QtGui/qinputcontextfactory.h
* include/QtGui/QInputContext
* include/QtGui/qinputcontext.h
* include/QtGui/QInputContextFactory
  - New file

* src/core/global/qfeatures.h
  - Define QT_NO_IM if QT_NO_STRINGLIST is defined
  - Define QT_NO_IM_EXTENSIONS if QT_NO_IM or QT_NO_STRINGLIST is
    defined

* src/core/global/qnamespace.h
  - (Qt::Key): Merge diffs from Qt3 trunk

* src/gui/gui.pro
  - Add inputmethod subdirectory

* src/gui/kernel/kernel.pri
  - Add qinputcontext.{h,cpp}
  - Remove qinputcontext_p.h for X11 platform

* src/gui/kernel/qt_x11_p.h
  - (QX11Data::xim, QX11Data::xim_style): Remove to replace with
    equivalents in QXIMInputContext

* src/gui/kernel/qevent.cpp
  - (key): Add a comment about latin 1 keycodes to function
    description

* src/gui/kernel/qwidget.h
  - (icHolderWidget, getInputContext, changeInputContext,
    sendMouseEventToInputContext): New functions. Port from Qt3 trunk
  - (destroyInputContext): New private slot defined by Q_PRIVATE_SLOT
* src/gui/kernel/qwidget_p.h
  - (QTLWExtra::xic): Remove to replace with QWidgetPrivate::ic
  - (QWidgetPrivate::ic): New variable
  - (QWidgetPrivate::unfocusInputContext): New function. Ported from
    QWidget::unfocusInputContext of Qt3 trunk
* src/gui/kernel/qwidget.cpp
  - (setFocus): Merge a diff from Qt3 trunk and properly surrounded
    with #ifdef Q_WS_X11
  - (event): Merge a diff from Qt3 trunk
* src/gui/kernel/qwidget_x11.cpp
  - Port from Qt3 trunk
  - (icHolderWidget, getInputContext, changeInputContext,
    sendMouseEventToInputContext): New functions. Port from Qt3 trunk
  - (create, destroy, setMicroFocusHint, setActiveWindow,
    createTLSysExtra, deleteTLSysExtra, createInputContext,
    destroyInputContext, resetInputContext, focusInputContext,
    unfocusInputContext): Merge diffs from Qt3 trunk
  - (setParent_sys): Merge a diff from QWidget::reparentSys of Qt3
    trunk

* src/gui/kernel/qapplication.h
  - (create_xim, close_xim): Remove
  - (locateICHolderWidget, icHolderWidgets, changeAllInputContext,
    create_im, close_im, defaultInputMethod, postIMEvent):
    New functions. Port from Qt3 trunk
  - (defaultIM): New variable. Port from Qt3 trunk
* src/gui/kernel/qapplication.cpp
  - (compressEvent): Merge diffs from QApplication::postEvent() of Qt3
    trunk
  - (setActiveWindow): Merge a diff from Qt3 trunk and properly
    surrounded with #ifdef Q_WS_X11
* src/gui/kernel/qapplication_x11.cpp
  - Port from Qt3 trunk
  - Most XIM codes are move into qximinputcontext_x11.cpp as same as Qt3
  - (xim_default_style): Move into qximinputcontext_x11.cpp
  - (locateICHolderWidget, icHolderWidgets, changeAllInputContext,
    postIMEvent, defaultInputMethod, create_im, close_im):
    New functions. Port from Qt3 trunk
  - (x11_apply_settings, qt_set_input_encoding): Merge diffs from Qt3
    trunk
  - (qt_init):
    * Merge diffs from Qt3 trunk
    * Remove initializaton of xim and xim_style
    * Comment out '-noxim' option handling
    * Move initialization of xim_preferred_style to
      qximinputcontext_x11.cpp
  - (x11ProcessEvent):
    * Merge diffs from Qt3 trunk
    * Remove 'ascii' from args of translateKeyEventInternal() in
      accordance with specification change of QKeyEvent
  - (KeyTbl): Merge diffs from Qt3 trunk
  - (QETWidget::translateKeyEventInternal):
    * Merge diffs from Qt3 trunk
    * Add dead keys detection for proper key translation

* src/gui/kernel/qinputcontext.h
  - Port from Qt3 trunk
  - Export as proper class by Q_GUI_EXPORT
  - Replace QInputContextPrivate class definition with Q_DECLARE_PRIVATE
  - (struct QInputContextMenu): Disable member definitions for
    Qt3. This struct only exists for namespace for Qt4
  - (addActionsTo): New function for Qt4
  - (addMenusTo): Let Qt3 specific
* src/gui/kernel/qinputcontext.cpp
  - Port from Qt3 trunk
  - (class QInputContextPrivate): Inherit QObjectPrivate to use
    Private class definition with moc
  - (QInputContext): Replace d handling with QObjectPrivate
  - (~QInputContext): Remove d handling
  - (sendIMEventInternal): Replace deprecated QIMComposeEvent with
    QIMEvent
  - (identifierName, language): Change return type to QString from
    deprecated QCString to share the code between Qt3 and Qt4
  - (actions): New function for Qt4
  - (addActionsTo): New function for Qt4
* src/gui/kernel/qinputcontext_x11.cpp
  - Merge diffs from Qt3 trunk
  - Most XIM codes are move into qximinputcontext_x11.cpp as same as
    Qt3

* src/gui/inputmethod
  - New directory
* src/gui/inputmethod/inputmethod.pri
  - New file

* src/gui/inputmethod/qinputcontextfactory.h
  - Port from Qt3 trunk
  - Remove inappropriate #ifndef QT_NO_STRINGLIST. QStringList is now
    required feature for immodule. See also changes of qfeatures.h
* gui/inputmethod/qinputcontextfactory.cpp
  - New file
  - Port from Qt3 trunk with new Qt4 plugin APIs

* src/gui/inputmethod/qinputcontextplugin.h
  - New file
  - Port from qinputcontextplugin.h and qinputcontextinterface.h of
    Qt3 trunk
* src/gui/inputmethod/qinputcontextplugin.cpp
  - New file
  - Port from Qt3 trunk

* src/gui/text/qtextlayout.cpp
  - (draw): Replace (s.type() != Highlight) with (s.type() ==
    NoSelection) to fix inproper drawing about input method related
    selection
  - (drawSelection): Add underline drawing for the SelectionType
    ImText. Asian users need this popular preedit appearance. The
    drawing style should be dynamically able to specify with extended
    QIMEvent attributes. This fixed underline style is just a
    temporary solution

* src/gui/widgets/qlineedit.h
  - (sendMouseEventToInputContext): New function. Port from Qt3 trunk
* src/gui/widgets/qlineedit_p.h
  - Port from Qt3 trunk
  - (composeMode, hasIMSelection, preeditLength, imSelectionLength,
    xToPosInternal): New functions. Port from Qt3 trunk
* src/gui/widgets/qlineedit.cpp
  - Port from Qt3 trunk
  - (mousePressEvent, mouseMoveEvent, mouseReleaseEvent,
    mouseDoubleClickEvent, imComposeEvent, focusInEvent,
    contextMenuEvent, updateMicroFocusHint): Merge diffs from Qt3
    trunk
  - (sendMouseEventToInputContext): New function. Port from Qt3 trunk
  - (paintEvent):
    * Merge diffs from QLineEdit::drawContents() of Qt3 trunk
    * Replace some code fragments with ported functions of
      QLineEditPrivate
  - (createPopupMenu): Add input method menu handling
  - (QLineEditPrivate::xToPosInternal): New function. Copied from
    xToPos and Remove the safety limiter. Implemented as same as Qt3
    trunk
  - (QLineEditPrivate::xToPos): Reimprement using xToPosInternal.
    Implemented as same as Qt3 trunk

* src/gui/widgets/qtextedit.h
  - (imStartEvent, imComposeEvent, imEndEvent): New functions. Port
    from Qt3 trunk
* src/gui/widgets/qtextedit.cpp
  - Port from Qt3 trunk
  - (QTextEditPrivate::imstart, QTextEditPrivate::imend,
    QTextEditPrivate::imselstart, QTextEditPrivate::imselend): New
    variables. Ported from Qt3 trunk
  - (composeMode, hasIMSelection, preeditLength, imSelectionLength,
    xToPosInternal): New functions. Port from Qt3 trunk
  - (imStartEvent, imComposeEvent, imEndEvent): Partially ported from
    Qt3 trunk. Just a placeholder for now and not worked yet

* src/plugins/plugins.pro
  - Add 'inputmethods' to SUBDIRS. The directory name 'inputmethods'
    is intended to be compatible with Qt/Embedded
* src/plugins/inputmethods
  - New directory
* src/plugins/inputmethods/inputmethods.pro
  - New file. 'xim' directory is only build with X11 platform

* src/plugins/inputmethods/imsw-none/imsw-none.pro
  - New file
* src/plugins/inputmethods/imsw-none/qnoneinputcontextplugin.h
  - Port from Qt3 trunk
* src/plugins/inputmethods/imsw-none/qnoneinputcontextplugin.cpp
  - Port from Qt3 trunk

* src/plugins/inputmethods/imsw-multi/imsw-multi.pro
  - New file
* src/plugins/inputmethods/imsw-multi/qmultiinputcontextplugin.h
  - Port from Qt3 trunk
* src/plugins/inputmethods/imsw-multi/qmultiinputcontextplugin.cpp
  - Port from Qt3 trunk
* src/plugins/inputmethods/imsw-multi/qmultiinputcontext.h
  - Port from Qt3 trunk
  - (identifierName, language): Change return type to QString from
    deprecated QCString to share the code between Qt3 and Qt4
  - (actions): New function for Qt4
  - (createImSelMenu): New function for Qt4 based on createImSelPopup()
  - (changeInputMethodWithAction): New function for Qt4
  - (keyDict): Remove to replace with idNames
  - (idNames): New variable to replace with keyDict that uses
    deprecated intDict
  - (popup): Remove to rename to menu
  - (menu): New variable for both Qt3 and Qt4
* src/plugins/inputmethods/imsw-multi/qmultiinputcontext.cpp
  - Port from Qt3 trunk
  - Support both Qt3 and Qt4
  - (actions): New function for Qt4
  - (createImSelMenu): New function for Qt4 based on createImSelPopup()
  - (changeInputMethodWithAction): New function for Qt4
  - (createImSelPopup):
    * Let Qt3 specific
    * Replace 'IntDict keyDict' with 'QMap idNames' to be closer to
      Qt4 classes
  - (changeInputMethodWithMenuId): Let Qt3 specific

* src/plugins/inputmethods/simple/simple.pro
  - New file
* src/plugins/inputmethods/simple/qsimpleinputcontextplugin.h
  - Port from Qt3 trunk
* src/plugins/inputmethods/simple/qsimpleinputcontextplugin.cpp
  - Port from Qt3 trunk
* src/plugins/inputmethods/simple/qsimpleinputcontext.h
  - Port from Qt3 trunk
  - (identifierName, language): Change return type to QString from
    deprecated QCString to share the code between Qt3 and Qt4
* src/plugins/inputmethods/simple/qsimpleinputcontext.cpp
  - Port from Qt3 trunk
  - (identifierName, language): Change return type to QString from
    deprecated QCString to share the code between Qt3 and Qt4
* src/plugins/inputmethods/simple/composetable.cpp
  - Port from Qt3 trunk
* src/plugins/inputmethods/simple/xcompose2q.rb
  - Port from Qt3 trunk

* src/plugins/inputmethods/xim/xim.pro
  - New file
* src/plugins/inputmethods/xim/qximinputcontextplugin.h
  - Port from Qt3 trunk
* src/plugins/inputmethods/xim/qximinputcontextplugin.cpp
  - Port from Qt3 trunk
* src/plugins/inputmethods/xim/qximinputcontext.h
  - Port from Qt3 trunk
  - merge diffs between Qt3 and Qt4 about XIM
  - (_language): Change type to QString from deprecated QCString
  - (isInitialized): New class variable to replace static isInitXIM
  - (xim): New class variable to replace global qt_xim
  - (xim_style): New class variable to replace global qt_xim_style
  - (ximContextList): Remove to rename to ximContexts
  - (ximContexts):
    * Renamed from ximContextList
    * Change type to QList from deprecated QPtrList
  - (selectedChars): Change type to QBitArray from deprecated QMemArray
* src/plugins/inputmethods/xim/qximinputcontext_x11.cpp
  - Port from Qt3 trunk
  - merge diffs between Qt3 and Qt4 about XIM
  - (isInitXIM): Remove to replace with class variable isInitialized
  - (isInitialized, xim, xim_style, ximContexts): New class variable
    definition
  - (xim_default_style): New static variable. Moved from qapplication_x11.cpp
  - (xim_create_callback, xim_destroy_callback, getFontSet,
    create_xim, x11FilterEvent, lookupString): Merge Qt4 diffs
  - (~QXIMInputContext):
    * Merge Qt4 diffs
    * Rewrite around ximContexts
  - (init_xim):
    * Merge Qt4 diffs
    * Move xim_default_style handling from qapplication_x11.cpp
  - (close_xim): Rewrite around ximContexts
  - (setFocus, unsetFocus): follow variable renaming
  - (identifierName, language):
    * Move from inline definition in qximinputcontext.h
    * Change return type to QString from deprecated QCString
    to share the code between Qt3 and Qt4
  - (language): Change return type to QString from deprecated QCString
    to share the code between Qt3 and Qt4
----------------------------------------------------------------------


-------------------------------
YamaKen  yamaken at bp.iij4u.or.jp



More information about the immodule-qt mailing list