From d796c9dd933ab96ec83b9a634feedd5d32e1ba3f Mon Sep 17 00:00:00 2001 From: Timothy Pearson Date: Tue, 8 Nov 2011 12:31:36 -0600 Subject: Test conversion to TQt3 from Qt3 8c6fc1f8e35fd264dd01c582ca5e7549b32ab731 --- plugins/src/inputmethods/imsw-none/imsw-none.pro | 12 +++ .../imsw-none/qnoneinputcontextplugin.cpp | 101 +++++++++++++++++++++ .../imsw-none/qnoneinputcontextplugin.h | 62 +++++++++++++ 3 files changed, 175 insertions(+) create mode 100644 plugins/src/inputmethods/imsw-none/imsw-none.pro create mode 100644 plugins/src/inputmethods/imsw-none/qnoneinputcontextplugin.cpp create mode 100644 plugins/src/inputmethods/imsw-none/qnoneinputcontextplugin.h (limited to 'plugins/src/inputmethods/imsw-none') diff --git a/plugins/src/inputmethods/imsw-none/imsw-none.pro b/plugins/src/inputmethods/imsw-none/imsw-none.pro new file mode 100644 index 000000000..0671e9648 --- /dev/null +++ b/plugins/src/inputmethods/imsw-none/imsw-none.pro @@ -0,0 +1,12 @@ +TEMPLATE = lib +TARGET = qimsw-none +DESTDIR = ../../../inputmethods + +INCLUDEPATH += . +CONFIG += qt warn_on debug plugin +target.path += $$plugins.path/inputmethods +INSTALLS += target + +# Input +HEADERS += qnoneinputcontextplugin.h +SOURCES += qnoneinputcontextplugin.cpp diff --git a/plugins/src/inputmethods/imsw-none/qnoneinputcontextplugin.cpp b/plugins/src/inputmethods/imsw-none/qnoneinputcontextplugin.cpp new file mode 100644 index 000000000..39bebe190 --- /dev/null +++ b/plugins/src/inputmethods/imsw-none/qnoneinputcontextplugin.cpp @@ -0,0 +1,101 @@ +/**************************************************************************** +** $Id$ +** +** Implementation of TQNoneInputContextPlugin class +** +** Copyright (C) 2004 immodule for TQt Project. All rights reserved. +** +** This file is written to contribute to Trolltech AS under their own +** licence. You may use this file under your TQt license. Following +** description is copied from their original file headers. Contact +** immodule-qt@freedesktop.org if any conditions of this licensing are +** not clear to you. +** +** +** This file is part of the input method module of the TQt GUI Toolkit. +** +** This file may be distributed under the terms of the Q Public License +** as defined by Trolltech AS of Norway and appearing in the file +** LICENSE.TQPL included in the packaging of this file. +** +** This file may be distributed and/or modified under the terms of the +** GNU General Public License version 2 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. +** +** Licensees holding valid TQt Enterprise Edition or TQt Professional Edition +** licenses may use this file in accordance with the TQt Commercial License +** Agreement provided with the Software. +** +** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE +** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. +** +** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for +** information about TQt Commercial License Agreements. +** See http://www.trolltech.com/qpl/ for TQPL licensing information. +** See http://www.trolltech.com/gpl/ for GPL licensing information. +** +** Contact info@trolltech.com if any conditions of this licensing are +** not clear to you. +** +**********************************************************************/ + +#ifndef QT_NO_IM +#include "qnoneinputcontextplugin.h" +#include +#include +#include + + +TQNoneInputContextPlugin::TQNoneInputContextPlugin() +{ +} + +TQNoneInputContextPlugin::~TQNoneInputContextPlugin() +{ +} + +TQStringList TQNoneInputContextPlugin::keys() const +{ + // input method switcher should named with "imsw-" prefix to + // prevent to be listed in ordinary input method list. + return TQStringList( "imsw-none" ); +} + +TQInputContext *TQNoneInputContextPlugin::create( const TQString &key ) +{ + TQString actuallySpecifiedKey; + + bool isIMSwitcher = key.startsWith( "imsw-" ); + if ( ! isIMSwitcher ) + return 0; + + if ( getenv( "QT_IM_MODULE" ) ) { + actuallySpecifiedKey = getenv( "QT_IM_MODULE" ); + } else { + TQSettings settings; + actuallySpecifiedKey = settings.readEntry( "/qt/DefaultInputMethod", "xim" ); + } + + return TQInputContextFactory::create( actuallySpecifiedKey, 0 ); +} + +TQStringList TQNoneInputContextPlugin::languages( const TQString &key ) +{ + return TQStringList( "" ); +} + +TQString TQNoneInputContextPlugin::displayName( const TQString &key ) +{ + return tr( "Dummy Input Method Switcher" ); +} + +TQString TQNoneInputContextPlugin::description( const TQString &key ) +{ + return tr( "Dummy input method switcher that uses the context menu of the text widgets" ); +} + + +Q_EXPORT_PLUGIN( TQNoneInputContextPlugin ) + +#endif diff --git a/plugins/src/inputmethods/imsw-none/qnoneinputcontextplugin.h b/plugins/src/inputmethods/imsw-none/qnoneinputcontextplugin.h new file mode 100644 index 000000000..37e59f8cd --- /dev/null +++ b/plugins/src/inputmethods/imsw-none/qnoneinputcontextplugin.h @@ -0,0 +1,62 @@ +/**************************************************************************** +** $Id$ +** +** Definition of TQNoneInputContextPlugin class +** +** Copyright (C) 2004 immodule for TQt Project. All rights reserved. +** +** This file is written to contribute to Trolltech AS under their own +** licence. You may use this file under your TQt license. Following +** description is copied from their original file headers. Contact +** immodule-qt@freedesktop.org if any conditions of this licensing are +** not clear to you. +** +** +** This file is part of the input method module of the TQt GUI Toolkit. +** +** This file may be distributed under the terms of the Q Public License +** as defined by Trolltech AS of Norway and appearing in the file +** LICENSE.TQPL included in the packaging of this file. +** +** This file may be distributed and/or modified under the terms of the +** GNU General Public License version 2 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. +** +** Licensees holding valid TQt Enterprise Edition or TQt Professional Edition +** licenses may use this file in accordance with the TQt Commercial License +** Agreement provided with the Software. +** +** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE +** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. +** +** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for +** information about TQt Commercial License Agreements. +** See http://www.trolltech.com/qpl/ for TQPL licensing information. +** See http://www.trolltech.com/gpl/ for GPL licensing information. +** +** Contact info@trolltech.com if any conditions of this licensing are +** not clear to you. +** +**********************************************************************/ + +#ifndef QT_NO_IM +#include +#include + + +class TQNoneInputContextPlugin : public TQInputContextPlugin +{ + Q_OBJECT +public: + TQNoneInputContextPlugin(); + ~TQNoneInputContextPlugin(); + + TQStringList keys() const; + TQInputContext *create( const TQString &key ); + TQStringList languages( const TQString &key ); + TQString displayName( const TQString &key ); + TQString description( const TQString &key ); +}; + +#endif -- cgit v1.2.1