diff options
author | Alexander Golubev <fatzer2@gmail.com> | 2024-03-07 22:26:26 +0300 |
---|---|---|
committer | Alexander Golubev <fatzer2@gmail.com> | 2024-03-07 23:36:18 +0300 |
commit | fad4acbe084403340bb0ee6979ea18db464e7085 (patch) | |
tree | 557268e108f03e554cde0b12f1f49569344bc761 /src | |
parent | beb37238fa751dada93695a8b9ce1bb73aea1253 (diff) | |
download | tqt3-fad4acbe084403340bb0ee6979ea18db464e7085.tar.gz tqt3-fad4acbe084403340bb0ee6979ea18db464e7085.zip |
Fix compilation with -disable-inputmethod and -no-inputmethod
As for now here are two sets of inputmethod options:
- -enable-inputmethod/disable-inputmethod - which seems to supposed to
control whether build the 'inputmethod' module or not
- -inputmethod/-no-inputmethod - which seems to supposed to
enable/disable inputmethod support without changing the ABI.
Before the patch both -disable-inputmethod and -no-inputmethod were just
breaking the build: -no-inputmethod were disabling some code with
support for the module, but didn't disabled the module build itself nor
build of plugins. -disable-inputmethod were disabling build of plugins
and module, but didn't disabled code depending upon it.
It seems the inputmethod support were still WIP when the last release of
Qt3 came to be, hence the mess.
This patch fixes the build if both -disable-inputmethod AND
-no-inputmethod are supplied. Disabling only one is not enough due to
tqmake/configure have problems handling two different options of the
same name. Later the -inputmethod/-no-inputmethod should be probably
removed entirely.
Signed-off-by: Alexander Golubev <fatzer2@gmail.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/kernel/ntqwidget.h | 2 | ||||
-rw-r--r-- | src/kernel/qt_kernel.pri | 10 | ||||
-rw-r--r-- | src/kernel/qwidget_x11.cpp | 8 | ||||
-rw-r--r-- | src/tools/ntqglobal.h | 3 |
4 files changed, 18 insertions, 5 deletions
diff --git a/src/kernel/ntqwidget.h b/src/kernel/ntqwidget.h index aec9c6d2c..7e589c1a8 100644 --- a/src/kernel/ntqwidget.h +++ b/src/kernel/ntqwidget.h @@ -52,7 +52,7 @@ #include "ntqsizepolicy.h" #endif // QT_H -#if defined(TQ_WS_X11) && !defined(TQT_NO_IM) +#if defined(TQ_WS_X11) class TQInputContext; #endif diff --git a/src/kernel/qt_kernel.pri b/src/kernel/qt_kernel.pri index 4f591b032..684866e7d 100644 --- a/src/kernel/qt_kernel.pri +++ b/src/kernel/qt_kernel.pri @@ -98,10 +98,12 @@ kernel { $$KERNEL_CPP/qfontengine_p.h \ $$KERNEL_CPP/qtextlayout_p.h - unix:x11 { - HEADERS += $$KERNEL_H/ntqinputcontext.h - } else { - HEADERS += $$KERNEL_P/qinputcontext_p.h + inputmethod { + unix:x11 { + HEADERS += $$KERNEL_H/ntqinputcontext.h + } else { + HEADERS += $$KERNEL_P/qinputcontext_p.h + } } glibmainloop { diff --git a/src/kernel/qwidget_x11.cpp b/src/kernel/qwidget_x11.cpp index a5919b839..0591ca4cf 100644 --- a/src/kernel/qwidget_x11.cpp +++ b/src/kernel/qwidget_x11.cpp @@ -842,11 +842,13 @@ void TQWidget::destroy( bool destroyWindow, bool destroySubWindows ) if( this == icHolderWidget() ) { destroyInputContext(); } else { +#ifndef TQT_NO_IM // release previous focus information participating with // preedit preservation of qic TQInputContext *qic = getInputContext(); if ( qic ) qic->releaseComposingWidget( this ); +#endif // TQT_NO_IM } } } @@ -2932,6 +2934,7 @@ TQInputContext *TQWidget::getInputContext() { TQInputContext *qic = 0; +#ifndef TQT_NO_IM // #if !defined(TQT_NO_IM_EXTENSIONS) if ( isInputMethodEnabled() ) { #if !defined(TQT_NO_IM_EXTENSIONS) @@ -2943,6 +2946,7 @@ TQInputContext *TQWidget::getInputContext() qic = (TQInputContext *)topdata->xic; #endif } +#endif // TQT_NO_IM return qic; } @@ -2955,6 +2959,7 @@ TQInputContext *TQWidget::getInputContext() */ void TQWidget::changeInputContext( const TQString& identifierName ) { +#ifndef TQT_NO_IM TQWidget *icWidget = icHolderWidget(); #if !defined(TQT_NO_IM_EXTENSIONS) TQInputContext **qicp = &icWidget->ic; @@ -2973,6 +2978,9 @@ void TQWidget::changeInputContext( const TQString& identifierName ) TQObject::connect( qic, TQ_SIGNAL(deletionRequested()), icWidget, TQ_SLOT(destroyInputContext()) ); } +#else + (void) identifierName; /* unused */ +#endif // TQT_NO_IM } diff --git a/src/tools/ntqglobal.h b/src/tools/ntqglobal.h index 18aa92386..f83da9d79 100644 --- a/src/tools/ntqglobal.h +++ b/src/tools/ntqglobal.h @@ -767,6 +767,9 @@ class TQString; #ifndef TQT_MODULE_DIALOGS # define TQT_NO_DIALOG #endif +#ifndef TQT_MODULE_INPUTMETHOD +# define TQT_NO_IM +#endif #ifndef TQT_MODULE_WORKSPACE # define TQT_NO_WORKSPACE #endif |