summaryrefslogtreecommitdiffstats
path: root/src/plugins
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/platforminputcontexts/maliit/contextadaptor.cpp158
-rw-r--r--src/plugins/platforminputcontexts/maliit/contextadaptor.h148
-rw-r--r--src/plugins/platforminputcontexts/maliit/main.cpp68
-rw-r--r--src/plugins/platforminputcontexts/maliit/maliit.json3
-rw-r--r--src/plugins/platforminputcontexts/maliit/maliit.pro19
-rw-r--r--src/plugins/platforminputcontexts/maliit/qmaliitplatforminputcontext.cpp583
-rw-r--r--src/plugins/platforminputcontexts/maliit/qmaliitplatforminputcontext.h96
-rw-r--r--src/plugins/platforminputcontexts/maliit/serveraddressproxy.cpp56
-rw-r--r--src/plugins/platforminputcontexts/maliit/serveraddressproxy.h84
-rw-r--r--src/plugins/platforminputcontexts/maliit/serverproxy.cpp56
-rw-r--r--src/plugins/platforminputcontexts/maliit/serverproxy.h166
-rw-r--r--src/plugins/platforminputcontexts/platforminputcontexts.pro2
-rw-r--r--src/plugins/platforms/android/src/androidjnimain.cpp20
-rw-r--r--src/plugins/platforms/android/src/androidjnimain.h2
-rw-r--r--src/plugins/platforms/android/src/opengl/qandroidopenglplatformwindow.cpp6
-rw-r--r--src/plugins/platforms/android/src/qandroidplatformintegration.cpp1
-rw-r--r--src/plugins/platforms/android/src/raster/qandroidplatformwindow.cpp13
-rw-r--r--src/plugins/platforms/android/src/raster/qandroidplatformwindow.h2
-rw-r--r--src/plugins/platforms/windows/qtwindows_additional.h4
-rw-r--r--src/plugins/platforms/windows/qtwindowsglobal.h3
-rw-r--r--src/plugins/platforms/windows/qwindowscontext.cpp3
-rw-r--r--src/plugins/platforms/windows/qwindowswindow.cpp75
-rw-r--r--src/plugins/platforms/windows/qwindowswindow.h1
23 files changed, 131 insertions, 1438 deletions
diff --git a/src/plugins/platforminputcontexts/maliit/contextadaptor.cpp b/src/plugins/platforminputcontexts/maliit/contextadaptor.cpp
deleted file mode 100644
index 134ff94f6b..0000000000
--- a/src/plugins/platforminputcontexts/maliit/contextadaptor.cpp
+++ /dev/null
@@ -1,158 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
-**
-** This file is part of the plugins of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 2.1 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Digia gives you certain additional
-** rights. These rights are described in the Digia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "contextadaptor.h"
-#include <QtCore/QByteArray>
-#include <QtCore/QList>
-#include <QtCore/QMetaObject>
-#include <QtCore/QMap>
-#include <QtCore/QString>
-#include <QtCore/QStringList>
-#include <QtCore/QVariant>
-
-#include "qmaliitplatforminputcontext.h"
-
-/*
- * Implementation of adaptor class Inputcontext1Adaptor
- */
-
-Inputcontext1Adaptor::Inputcontext1Adaptor(QObject *parent)
- : QDBusAbstractAdaptor(parent)
-{
- // constructor
- setAutoRelaySignals(true);
-}
-
-Inputcontext1Adaptor::~Inputcontext1Adaptor()
-{
- // destructor
-}
-
-void Inputcontext1Adaptor::activationLostEvent()
-{
- // handle method call com.meego.inputmethod.inputcontext1.activationLostEvent
- QMetaObject::invokeMethod(parent(), "activationLostEvent");
-}
-
-void Inputcontext1Adaptor::commitString(const QString &in0, int in1, int in2, int in3)
-{
- // handle method call com.meego.inputmethod.inputcontext1.commitString
- QMetaObject::invokeMethod(parent(), "commitString", Q_ARG(QString, in0), Q_ARG(int, in1), Q_ARG(int, in2), Q_ARG(int, in3));
-}
-
-void Inputcontext1Adaptor::updatePreedit(const QDBusMessage &message)
-{
- // handle method call com.meego.inputmethod.inputcontext1.updatePreedit
- QMetaObject::invokeMethod(parent(), "updatePreedit", Q_ARG(QDBusMessage, message));
-}
-
-void Inputcontext1Adaptor::copy()
-{
- // handle method call com.meego.inputmethod.inputcontext1.copy
- QMetaObject::invokeMethod(parent(), "copy");
-}
-
-void Inputcontext1Adaptor::imInitiatedHide()
-{
- // handle method call com.meego.inputmethod.inputcontext1.imInitiatedHide
- QMetaObject::invokeMethod(parent(), "imInitiatedHide");
-}
-
-void Inputcontext1Adaptor::keyEvent(int in0, int in1, int in2, const QString &in3, bool in4, int in5, uchar in6)
-{
- // handle method call com.meego.inputmethod.inputcontext1.keyEvent
- QMetaObject::invokeMethod(parent(), "keyEvent", Q_ARG(int, in0), Q_ARG(int, in1), Q_ARG(int, in2), Q_ARG(QString, in3), Q_ARG(bool, in4), Q_ARG(int, in5), Q_ARG(uchar, in6));
-}
-
-void Inputcontext1Adaptor::paste()
-{
- // handle method call com.meego.inputmethod.inputcontext1.paste
- QMetaObject::invokeMethod(parent(), "paste");
-}
-
-bool Inputcontext1Adaptor::preeditRectangle(int &out1, int &out2, int &out3, int &out4)
-{
- // handle method call com.meego.inputmethod.inputcontext1.preeditRectangle
- return static_cast<QMaliitPlatformInputContext *>(parent())->preeditRectangle(out1, out2, out3, out4);
-}
-
-bool Inputcontext1Adaptor::selection(QString &out1)
-{
- // handle method call com.meego.inputmethod.inputcontext1.selection
- return static_cast<QMaliitPlatformInputContext *>(parent())->selection(out1);
-}
-
-void Inputcontext1Adaptor::setDetectableAutoRepeat(bool in0)
-{
- // handle method call com.meego.inputmethod.inputcontext1.setDetectableAutoRepeat
- QMetaObject::invokeMethod(parent(), "setDetectableAutoRepeat", Q_ARG(bool, in0));
-}
-
-void Inputcontext1Adaptor::setGlobalCorrectionEnabled(bool in0)
-{
- // handle method call com.meego.inputmethod.inputcontext1.setGlobalCorrectionEnabled
- QMetaObject::invokeMethod(parent(), "setGlobalCorrectionEnabled", Q_ARG(bool, in0));
-}
-
-void Inputcontext1Adaptor::setLanguage(const QString &in0)
-{
- // handle method call com.meego.inputmethod.inputcontext1.setLanguage
- QMetaObject::invokeMethod(parent(), "setLanguage", Q_ARG(QString, in0));
-}
-
-void Inputcontext1Adaptor::setRedirectKeys(bool in0)
-{
- // handle method call com.meego.inputmethod.inputcontext1.setRedirectKeys
- QMetaObject::invokeMethod(parent(), "setRedirectKeys", Q_ARG(bool, in0));
-}
-
-void Inputcontext1Adaptor::setSelection(int in0, int in1)
-{
- // handle method call com.meego.inputmethod.inputcontext1.setSelection
- QMetaObject::invokeMethod(parent(), "setSelection", Q_ARG(int, in0), Q_ARG(int, in1));
-}
-
-void Inputcontext1Adaptor::updateInputMethodArea(int in0, int in1, int in2, int in3)
-{
- // handle method call com.meego.inputmethod.inputcontext1.updateInputMethodArea
- QMetaObject::invokeMethod(parent(), "updateInputMethodArea", Q_ARG(int, in0), Q_ARG(int, in1), Q_ARG(int, in2), Q_ARG(int, in3));
-}
-
diff --git a/src/plugins/platforminputcontexts/maliit/contextadaptor.h b/src/plugins/platforminputcontexts/maliit/contextadaptor.h
deleted file mode 100644
index e959a7cb5b..0000000000
--- a/src/plugins/platforminputcontexts/maliit/contextadaptor.h
+++ /dev/null
@@ -1,148 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
-**
-** This file is part of the plugins of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 2.1 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Digia gives you certain additional
-** rights. These rights are described in the Digia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef CONTEXT_H_1318935171
-#define CONTEXT_H_1318935171
-
-#include <QtCore/QObject>
-#include <QtCore/QByteArray>
-#include <QtCore/QList>
-#include <QtCore/QMap>
-#include <QtCore/QString>
-#include <QtCore/QStringList>
-#include <QtCore/QVariant>
-#include <QtDBus/QtDBus>
-
-/*
- * Adaptor class for interface com.meego.inputmethod.inputcontext1
- */
-class Inputcontext1Adaptor: public QDBusAbstractAdaptor
-{
- Q_OBJECT
- Q_CLASSINFO("D-Bus Interface", "com.meego.inputmethod.inputcontext1")
- Q_CLASSINFO("D-Bus Introspection", ""
-" <interface name=\"com.meego.inputmethod.inputcontext1\">\n"
-" <method name=\"activationLostEvent\"/>\n"
-" <method name=\"imInitiatedHide\"/>\n"
-" <method name=\"commitString\">\n"
-" <arg type=\"s\"/>\n"
-" <arg type=\"i\"/>\n"
-" <arg type=\"i\"/>\n"
-" <arg type=\"i\"/>\n"
-" </method>\n"
-" <method name=\"updatePreedit\">\n"
-" <arg type=\"s\"/>\n"
-" <arg type=\"a(iii)\"/>\n"
-" <arg type=\"i\"/>\n"
-" <arg type=\"i\"/>\n"
-" <arg type=\"i\"/>\n"
-" </method>\n"
-" <method name=\"keyEvent\">\n"
-" <arg type=\"i\"/>\n"
-" <arg type=\"i\"/>\n"
-" <arg type=\"i\"/>\n"
-" <arg type=\"s\"/>\n"
-" <arg type=\"b\"/>\n"
-" <arg type=\"i\"/>\n"
-" <arg type=\"y\"/>\n"
-" </method>\n"
-" <method name=\"updateInputMethodArea\">\n"
-" <arg type=\"i\"/>\n"
-" <arg type=\"i\"/>\n"
-" <arg type=\"i\"/>\n"
-" <arg type=\"i\"/>\n"
-" </method>\n"
-" <method name=\"setGlobalCorrectionEnabled\">\n"
-" <arg type=\"b\"/>\n"
-" </method>\n"
-" <method name=\"preeditRectangle\">\n"
-" <arg direction=\"out\" type=\"b\"/>\n"
-" <arg direction=\"out\" type=\"i\"/>\n"
-" <arg direction=\"out\" type=\"i\"/>\n"
-" <arg direction=\"out\" type=\"i\"/>\n"
-" <arg direction=\"out\" type=\"i\"/>\n"
-" </method>\n"
-" <method name=\"copy\"/>\n"
-" <method name=\"paste\"/>\n"
-" <method name=\"setRedirectKeys\">\n"
-" <arg type=\"b\"/>\n"
-" </method>\n"
-" <method name=\"setDetectableAutoRepeat\">\n"
-" <arg type=\"b\"/>\n"
-" </method>\n"
-" <method name=\"setSelection\">\n"
-" <arg type=\"i\"/>\n"
-" <arg type=\"i\"/>\n"
-" </method>\n"
-" <method name=\"selection\">\n"
-" <arg direction=\"out\" type=\"b\"/>\n"
-" <arg direction=\"out\" type=\"s\"/>\n"
-" </method>\n"
-" <method name=\"setLanguage\">\n"
-" <arg type=\"s\"/>\n"
-" </method>\n"
-" </interface>\n"
- "")
-public:
- Inputcontext1Adaptor(QObject *parent);
- virtual ~Inputcontext1Adaptor();
-
-public: // PROPERTIES
-public Q_SLOTS: // METHODS
- void activationLostEvent();
- void commitString(const QString &in0, int in1, int in2, int in3);
- void updatePreedit(const QDBusMessage &message);
- void copy();
- void imInitiatedHide();
- void keyEvent(int in0, int in1, int in2, const QString &in3, bool in4, int in5, uchar in6);
- void paste();
- bool preeditRectangle(int &out1, int &out2, int &out3, int &out4);
- bool selection(QString &out1);
- void setDetectableAutoRepeat(bool in0);
- void setGlobalCorrectionEnabled(bool in0);
- void setLanguage(const QString &in0);
- void setRedirectKeys(bool in0);
- void setSelection(int in0, int in1);
- void updateInputMethodArea(int in0, int in1, int in2, int in3);
-Q_SIGNALS: // SIGNALS
-};
-
-#endif
diff --git a/src/plugins/platforminputcontexts/maliit/main.cpp b/src/plugins/platforminputcontexts/maliit/main.cpp
deleted file mode 100644
index ca4845afd7..0000000000
--- a/src/plugins/platforminputcontexts/maliit/main.cpp
+++ /dev/null
@@ -1,68 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
-**
-** This file is part of the plugins of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 2.1 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Digia gives you certain additional
-** rights. These rights are described in the Digia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include <qpa/qplatforminputcontextplugin_p.h>
-#include <QtCore/QStringList>
-#include "qmaliitplatforminputcontext.h"
-
-QT_BEGIN_NAMESPACE
-
-class QMaliitPlatformInputContextPlugin : public QPlatformInputContextPlugin
-{
- Q_OBJECT
- Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QPlatformInputContextFactoryInterface" FILE "maliit.json")
-
-public:
- QPlatformInputContext *create(const QString&, const QStringList&);
-};
-
-QPlatformInputContext *QMaliitPlatformInputContextPlugin::create(const QString& system, const QStringList& paramList)
-{
- Q_UNUSED(paramList);
-
- if (system.compare(system, QStringLiteral("maliit"), Qt::CaseInsensitive) == 0)
- return new QMaliitPlatformInputContext;
- return 0;
-}
-
-QT_END_NAMESPACE
-
-#include "main.moc"
diff --git a/src/plugins/platforminputcontexts/maliit/maliit.json b/src/plugins/platforminputcontexts/maliit/maliit.json
deleted file mode 100644
index f828e1426e..0000000000
--- a/src/plugins/platforminputcontexts/maliit/maliit.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "Keys": [ "maliit" ]
-}
diff --git a/src/plugins/platforminputcontexts/maliit/maliit.pro b/src/plugins/platforminputcontexts/maliit/maliit.pro
deleted file mode 100644
index 1e50f7289b..0000000000
--- a/src/plugins/platforminputcontexts/maliit/maliit.pro
+++ /dev/null
@@ -1,19 +0,0 @@
-TARGET = maliitplatforminputcontextplugin
-
-PLUGIN_TYPE = platforminputcontexts
-PLUGIN_CLASS_NAME = QMaliitPlatformInputContextPlugin
-load(qt_plugin)
-
-QT += dbus gui-private
-SOURCES += $$PWD/qmaliitplatforminputcontext.cpp \
- $$PWD/serverproxy.cpp \
- $$PWD/serveraddressproxy.cpp \
- $$PWD/contextadaptor.cpp \
- $$PWD/main.cpp
-
-HEADERS += $$PWD/qmaliitplatforminputcontext.h \
- $$PWD/serverproxy.h \
- $$PWD/serveraddressproxy.h \
- $$PWD/contextadaptor.h
-
-OTHER_FILES += $$PWD/maliit.json
diff --git a/src/plugins/platforminputcontexts/maliit/qmaliitplatforminputcontext.cpp b/src/plugins/platforminputcontexts/maliit/qmaliitplatforminputcontext.cpp
deleted file mode 100644
index 6d748d44a1..0000000000
--- a/src/plugins/platforminputcontexts/maliit/qmaliitplatforminputcontext.cpp
+++ /dev/null
@@ -1,583 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
-**
-** This file is part of the plugins of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 2.1 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Digia gives you certain additional
-** rights. These rights are described in the Digia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#include "qmaliitplatforminputcontext.h"
-
-#include <QtDebug>
-#include <QTextCharFormat>
-#include <QGuiApplication>
-#include <qwindow.h>
-#include <qevent.h>
-#include <qscreen.h>
-
-#include "serveraddressproxy.h"
-#include "serverproxy.h"
-#include "contextadaptor.h"
-
-#include <sys/types.h>
-#include <signal.h>
-
-#include <QtDBus>
-
-QT_BEGIN_NAMESPACE
-
-enum { debug = 0 };
-
-enum InputPanelVisibility {
- InputPanelHidden,
- InputPanelShowRequested,
- InputPanelShown
-};
-
-enum MaliitOrientationAngle {
- Angle0 = 0,
- Angle90 = 90,
- Angle180 = 180,
- Angle270 = 270
-};
-
-static int orientationAngle(Qt::ScreenOrientation orientation)
-{
- switch (orientation) {
- case Qt::PrimaryOrientation: // Urgh.
- case Qt::PortraitOrientation:
- return Angle270;
- case Qt::LandscapeOrientation:
- return Angle0;
- case Qt::InvertedPortraitOrientation:
- return Angle90;
- case Qt::InvertedLandscapeOrientation:
- return Angle180;
- }
- return Angle0;
-}
-
-// From MTF:
-//! Content type for text entries. Used at least with MTextEdit
-enum TextContentType {
- //! all characters allowed
- FreeTextContentType,
-
- //! only integer numbers allowed
- NumberContentType,
-
- //! allows numbers and certain other characters used in phone numbers
- PhoneNumberContentType,
-
- //! allows only characters permitted in email address
- EmailContentType,
-
- //! allows only character permitted in URL address
- UrlContentType,
-
- //! allows content with user defined format
- CustomContentType
-};
-static TextContentType contentTypeFromHints(Qt::InputMethodHints hints)
-{
- TextContentType type = FreeTextContentType;
- hints &= Qt::ImhExclusiveInputMask;
-
- if (hints == Qt::ImhFormattedNumbersOnly || hints == Qt::ImhDigitsOnly)
- type = NumberContentType;
- else if (hints == Qt::ImhDialableCharactersOnly)
- type = PhoneNumberContentType;
- else if (hints == Qt::ImhEmailCharactersOnly)
- type = EmailContentType;
- else if (hints == Qt::ImhUrlCharactersOnly)
- type = UrlContentType;
-
- return type;
-}
-
-/// From Maliit's namespace.h
-enum MaliitEventRequestType {
- EventRequestBoth, //!< Both a Qt::KeyEvent and a signal
- EventRequestSignalOnly, //!< Only a signal
- EventRequestEventOnly //!< Only a Qt::KeyEvent
-};
-
-static QString maliitServerAddress()
-{
- org::maliit::Server::Address serverAddress(QStringLiteral("org.maliit.server"), QStringLiteral("/org/maliit/server/address"), QDBusConnection::sessionBus());
-
- QString address(serverAddress.address());
-
- // Fallback to old socket when org.maliit.server service is not available
- if (address.isEmpty())
- return QStringLiteral("unix:path=/tmp/meego-im-uiserver/imserver_dbus");
-
- return address;
-}
-
-class QMaliitPlatformInputContextPrivate
-{
-public:
- QMaliitPlatformInputContextPrivate(QMaliitPlatformInputContext *qq);
- ~QMaliitPlatformInputContextPrivate()
- {
- delete adaptor;
- delete server;
- }
-
- void sendStateUpdate(bool focusChanged = false);
-
- QDBusConnection connection;
- ComMeegoInputmethodUiserver1Interface *server;
- Inputcontext1Adaptor *adaptor;
-
- QMap<QString, QVariant> imState;
-
- InputPanelVisibility visibility;
-
- bool valid;
- bool active;
- bool correctionEnabled;
- QRect keyboardRect;
- QString preedit;
- QPointer<QWindow> window;
- QMaliitPlatformInputContext *q;
-};
-
-
-QMaliitPlatformInputContext::QMaliitPlatformInputContext()
- : d(new QMaliitPlatformInputContextPrivate(this))
-{
- if (debug)
- qDebug() << "QMaliitPlatformInputContext::QMaliitPlatformInputContext()";
-}
-
-QMaliitPlatformInputContext::~QMaliitPlatformInputContext(void)
-{
- delete d;
-}
-
-bool QMaliitPlatformInputContext::isValid() const
-{
- return d->valid;
-}
-
-void QMaliitPlatformInputContext::invokeAction(QInputMethod::Action action, int x)
-{
- if (!inputMethodAccepted())
- return;
-
- if (action == QInputMethod::Click) {
- if (x < 0 || x >= d->preedit.length()) {
- reset();
- return;
- }
-
- d->imState["preeditClickPos"] = x;
- d->sendStateUpdate();
- // The first argument is the mouse pos and the second is the
- // preedit rectangle. Both are unused on the server side.
- d->server->mouseClickedOnPreedit(0, 0, 0, 0, 0, 0);
- } else {
- QPlatformInputContext::invokeAction(action, x);
- }
-}
-
-void QMaliitPlatformInputContext::reset()
-{
- const bool hadPreedit = !d->preedit.isEmpty();
- if (hadPreedit && inputMethodAccepted()) {
- // ### selection
- QInputMethodEvent event;
- event.setCommitString(d->preedit);
- QGuiApplication::sendEvent(qGuiApp->focusObject(), &event);
- d->preedit.clear();
- }
-
- QDBusPendingReply<void> reply = d->server->reset();
- if (hadPreedit)
- reply.waitForFinished();
-}
-
-void QMaliitPlatformInputContext::update(Qt::InputMethodQueries queries)
-{
- if (!qGuiApp->focusObject())
- return;
-
- QInputMethodQueryEvent query(queries);
- QGuiApplication::sendEvent(qGuiApp->focusObject(), &query);
-
- if (queries & Qt::ImSurroundingText)
- d->imState["surroundingText"] = query.value(Qt::ImSurroundingText);
- if (queries & Qt::ImCursorPosition)
- d->imState["cursorPosition"] = query.value(Qt::ImCursorPosition);
- if (queries & Qt::ImAnchorPosition)
- d->imState["anchorPosition"] = query.value(Qt::ImAnchorPosition);
- if (queries & Qt::ImCursorRectangle) {
- QRect rect = query.value(Qt::ImCursorRectangle).toRect();
- rect = qGuiApp->inputMethod()->inputItemTransform().mapRect(rect);
- QWindow *window = qGuiApp->focusWindow();
- if (window)
- d->imState["cursorRectangle"] = QRect(window->mapToGlobal(rect.topLeft()), rect.size());
- }
-
- if (queries & Qt::ImCurrentSelection)
- d->imState["hasSelection"] = !query.value(Qt::ImCurrentSelection).toString().isEmpty();
-
- if (queries & Qt::ImHints) {
- Qt::InputMethodHints hints = Qt::InputMethodHints(query.value(Qt::ImHints).toUInt());
-
- d->imState["predictionEnabled"] = !(hints & Qt::ImhNoPredictiveText);
- d->imState["autocapitalizationEnabled"] = !(hints & Qt::ImhNoAutoUppercase);
- d->imState["hiddenText"] = (hints & Qt::ImhHiddenText) != 0;
-
- d->imState["contentType"] = contentTypeFromHints(hints);
- }
-
- d->sendStateUpdate(/*focusChanged*/true);
-}
-
-QRectF QMaliitPlatformInputContext::keyboardRect() const
-{
- return d->keyboardRect;
-}
-
-void QMaliitPlatformInputContext::activationLostEvent()
-{
- d->active = false;
- d->visibility = InputPanelHidden;
-}
-
-void QMaliitPlatformInputContext::commitString(const QString &string, int replacementStart, int replacementLength, int /* cursorPos */)
-{
- if (!inputMethodAccepted())
- return;
-
- d->preedit.clear();
-
- if (debug)
- qWarning() << "CommitString" << string;
- // ### start/cursorPos
- QInputMethodEvent event;
- event.setCommitString(string, replacementStart, replacementLength);
- QCoreApplication::sendEvent(qGuiApp->focusObject(), &event);
-}
-
-void QMaliitPlatformInputContext::updatePreedit(const QDBusMessage &message)
-{
- if (!inputMethodAccepted())
- return;
-
- QList<QVariant> arguments = message.arguments();
- if (arguments.count() != 5) {
- qWarning() << "QMaliitPlatformInputContext::updatePreedit: Received message from input method server with wrong parameters.";
- return;
- }
-
- d->preedit = arguments[0].toString();
-
- QList<QInputMethodEvent::Attribute> attributes;
-
- const QDBusArgument formats = arguments[1].value<QDBusArgument>();
- formats.beginArray();
- while (!formats.atEnd()) {
- formats.beginStructure();
- int start, length, preeditFace;
- formats >> start >> length >> preeditFace;
- formats.endStructure();
-
- QTextCharFormat format;
-
- enum PreeditFace {
- PreeditDefault,
- PreeditNoCandidates,
- PreeditKeyPress, //!< Used for displaying the hwkbd key just pressed
- PreeditUnconvertible, //!< Inactive preedit region, not clickable
- PreeditActive, //!< Preedit region with active suggestions
-
- };
- switch (PreeditFace(preeditFace)) {
- case PreeditDefault:
- case PreeditKeyPress:
- format.setUnderlineStyle(QTextCharFormat::SingleUnderline);
- format.setUnderlineColor(QColor(0, 0, 0));
- break;
- case PreeditNoCandidates:
- format.setUnderlineStyle(QTextCharFormat::SingleUnderline);
- format.setUnderlineColor(QColor(255, 0, 0));
- break;
- case PreeditUnconvertible:
- format.setForeground(QBrush(QColor(128, 128, 128)));
- break;
- case PreeditActive:
- format.setForeground(QBrush(QColor(153, 50, 204)));
- format.setFontWeight(QFont::Bold);
- break;
- default:
- break;
- }
-
- attributes << QInputMethodEvent::Attribute(QInputMethodEvent::TextFormat, start, length, format);
- }
- formats.endArray();
-
- int replacementStart = arguments[2].toInt();
- int replacementLength = arguments[3].toInt();
- int cursorPos = arguments[4].toInt();
-
- if (debug)
- qWarning() << "updatePreedit" << d->preedit << replacementStart << replacementLength << cursorPos;
-
- if (cursorPos >= 0)
- attributes << QInputMethodEvent::Attribute(QInputMethodEvent::Cursor, cursorPos, 1, QVariant());
-
- QInputMethodEvent event(d->preedit, attributes);
- if (replacementStart || replacementLength)
- event.setCommitString(QString(), replacementStart, replacementLength);
- QCoreApplication::sendEvent(qGuiApp->focusObject(), &event);
-}
-
-void QMaliitPlatformInputContext::copy()
-{
- // Not supported at the moment.
-}
-
-void QMaliitPlatformInputContext::imInitiatedHide()
-{
- d->visibility = InputPanelHidden;
- emitInputPanelVisibleChanged();
- // ### clear focus
-}
-
-void QMaliitPlatformInputContext::keyEvent(int type, int key, int modifiers, const QString &text,
- bool autoRepeat, int count, uchar requestType_)
-{
- MaliitEventRequestType requestType = MaliitEventRequestType(requestType_);
- if (requestType == EventRequestSignalOnly) {
- qWarning() << "Maliit: Signal emitted key events are not supported.";
- return;
- }
-
- // HACK: This code relies on QEvent::Type for key events and modifiers to be binary compatible between
- // Qt 4 and 5.
- QEvent::Type eventType = static_cast<QEvent::Type>(type);
- if (type != QEvent::KeyPress && type != QEvent::KeyRelease) {
- qWarning() << "Maliit: Unknown key event type" << type;
- return;
- }
-
- QKeyEvent event(eventType, key, static_cast<Qt::KeyboardModifiers>(modifiers),
- text, autoRepeat, count);
- if (d->window)
- QCoreApplication::sendEvent(d->window.data(), &event);
-}
-
-void QMaliitPlatformInputContext::paste()
-{
- // Not supported at the moment.
-}
-
-bool QMaliitPlatformInputContext::preeditRectangle(int &x, int &y, int &width, int &height)
-{
- // ###
- QRect r = qApp->inputMethod()->cursorRectangle().toRect();
- if (!r.isValid())
- return false;
- x = r.x();
- y = r.y();
- width = r.width();
- height = r.height();
- return true;
-}
-
-bool QMaliitPlatformInputContext::selection(QString &selection)
-{
- selection.clear();
-
- if (!inputMethodAccepted())
- return false;
-
- QInputMethodQueryEvent query(Qt::ImCurrentSelection);
- QGuiApplication::sendEvent(qGuiApp->focusObject(), &query);
- QVariant value = query.value(Qt::ImCurrentSelection);
- if (!value.isValid())
- return false;
-
- selection = value.toString();
- return true;
-}
-
-void QMaliitPlatformInputContext::setDetectableAutoRepeat(bool)
-{
- // Not supported.
-}
-
-void QMaliitPlatformInputContext::setGlobalCorrectionEnabled(bool enable)
-{
- d->correctionEnabled = enable;
-}
-
-void QMaliitPlatformInputContext::setLanguage(const QString &)
-{
- // Unused at the moment.
-}
-
-void QMaliitPlatformInputContext::setRedirectKeys(bool)
-{
- // Not supported.
-}
-
-void QMaliitPlatformInputContext::setSelection(int start, int length)
-{
- if (!inputMethodAccepted())
- return;
-
- QList<QInputMethodEvent::Attribute> attributes;
- attributes << QInputMethodEvent::Attribute(QInputMethodEvent::Selection, start, length, QVariant());
- QInputMethodEvent event(QString(), attributes);
- QGuiApplication::sendEvent(qGuiApp->focusObject(), &event);
-}
-
-void QMaliitPlatformInputContext::updateInputMethodArea(int x, int y, int width, int height)
-{
- d->keyboardRect = QRect(x, y, width, height);
- emitKeyboardRectChanged();
-}
-
-void QMaliitPlatformInputContext::updateServerWindowOrientation(Qt::ScreenOrientation orientation)
-{
- d->server->appOrientationChanged(orientationAngle(orientation));
-}
-
-void QMaliitPlatformInputContext::setFocusObject(QObject *object)
-{
- if (!d->valid)
- return;
-
- QWindow *window = qGuiApp->focusWindow();
- if (window != d->window.data()) {
- if (d->window)
- disconnect(d->window.data(), SIGNAL(contentOrientationChanged(Qt::ScreenOrientation)),
- this, SLOT(updateServerWindowOrientation(Qt::ScreenOrientation)));
- d->window = window;
- if (d->window)
- connect(d->window.data(), SIGNAL(contentOrientationChanged(Qt::ScreenOrientation)),
- this, SLOT(updateServerWindowOrientation(Qt::ScreenOrientation)));
- }
-
- d->imState["focusState"] = (object != 0);
- if (inputMethodAccepted()) {
- if (window)
- d->imState["winId"] = static_cast<qulonglong>(window->winId());
-
- if (!d->active) {
- d->active = true;
- d->server->activateContext();
-
- if (window)
- d->server->appOrientationChanged(orientationAngle(window->contentOrientation()));
- }
- }
- d->sendStateUpdate(/*focusChanged*/true);
- if (inputMethodAccepted() && window && d->visibility == InputPanelShowRequested)
- showInputPanel();
-}
-
-void QMaliitPlatformInputContext::showInputPanel()
-{
- if (debug)
- qDebug() << "showInputPanel";
-
- if (!inputMethodAccepted())
- d->visibility = InputPanelShowRequested;
- else {
- d->server->showInputMethod();
- d->visibility = InputPanelShown;
- emitInputPanelVisibleChanged();
- }
-}
-
-void QMaliitPlatformInputContext::hideInputPanel()
-{
- d->server->hideInputMethod();
- d->visibility = InputPanelHidden;
- emitInputPanelVisibleChanged();
-}
-
-bool QMaliitPlatformInputContext::isInputPanelVisible() const
-{
- return d->visibility == InputPanelShown;
-}
-
-QMaliitPlatformInputContextPrivate::QMaliitPlatformInputContextPrivate(QMaliitPlatformInputContext* qq)
- : connection(QDBusConnection::connectToPeer(maliitServerAddress(), QLatin1String("MaliitIMProxy")))
- , server(0)
- , adaptor(0)
- , visibility(InputPanelHidden)
- , valid(false)
- , active(false)
- , correctionEnabled(false)
- , q(qq)
-{
- if (!connection.isConnected())
- return;
-
- server = new ComMeegoInputmethodUiserver1Interface(QStringLiteral(""), QStringLiteral("/com/meego/inputmethod/uiserver1"), connection);
- adaptor = new Inputcontext1Adaptor(qq);
- connection.registerObject("/com/meego/inputmethod/inputcontext", qq);
-
- enum InputMethodMode {
- //! Normal mode allows to use preedit and error correction
- InputMethodModeNormal,
-
- //! Virtual keyboard sends QKeyEvent for every key press or release
- InputMethodModeDirect,
-
- //! Used with proxy widget
- InputMethodModeProxy
- };
- imState["inputMethodMode"] = InputMethodModeNormal;
-
- imState["correctionEnabled"] = true;
-
- valid = true;
-}
-
-void QMaliitPlatformInputContextPrivate::sendStateUpdate(bool focusChanged)
-{
- server->updateWidgetInformation(imState, focusChanged);
-}
-
-QT_END_NAMESPACE
diff --git a/src/plugins/platforminputcontexts/maliit/qmaliitplatforminputcontext.h b/src/plugins/platforminputcontexts/maliit/qmaliitplatforminputcontext.h
deleted file mode 100644
index 1686983bd7..0000000000
--- a/src/plugins/platforminputcontexts/maliit/qmaliitplatforminputcontext.h
+++ /dev/null
@@ -1,96 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
-**
-** This file is part of the plugins of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 2.1 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Digia gives you certain additional
-** rights. These rights are described in the Digia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#ifndef QMALIITPLATFORMINPUTCONTEXT_H
-#define QMALIITPLATFORMINPUTCONTEXT_H
-
-#include <qpa/qplatforminputcontext.h>
-#include <QDBusArgument>
-
-QT_BEGIN_NAMESPACE
-
-class QMaliitPlatformInputContextPrivate;
-class QDBusVariant;
-class QDBusMessage;
-
-class QMaliitPlatformInputContext : public QPlatformInputContext
-{
- Q_OBJECT
-public:
- QMaliitPlatformInputContext();
- ~QMaliitPlatformInputContext();
-
- bool isValid() const;
-
- void invokeAction(QInputMethod::Action action, int x);
- void reset(void);
- void update(Qt::InputMethodQueries);
- virtual QRectF keyboardRect() const;
-
- virtual void showInputPanel();
- virtual void hideInputPanel();
- virtual bool isInputPanelVisible() const;
- void setFocusObject(QObject *object);
-
-public Q_SLOTS:
- void activationLostEvent();
- void commitString(const QString &in0, int in1, int in2, int in3);
- void updatePreedit(const QDBusMessage &message);
- void copy();
- void imInitiatedHide();
- void keyEvent(int type, int key, int modifiers, const QString &text, bool autoRepeat, int count, uchar requestType_);
- void paste();
- bool preeditRectangle(int &x, int &y, int &width, int &height);
- bool selection(QString &selection);
- void setDetectableAutoRepeat(bool in0);
- void setGlobalCorrectionEnabled(bool enable);
- void setLanguage(const QString &);
- void setRedirectKeys(bool );
- void setSelection(int start, int length);
- void updateInputMethodArea(int x, int y, int width, int height);
- void updateServerWindowOrientation(Qt::ScreenOrientation orientation);
-
-private:
- QMaliitPlatformInputContextPrivate *d;
-};
-
-QT_END_NAMESPACE
-
-#endif
diff --git a/src/plugins/platforminputcontexts/maliit/serveraddressproxy.cpp b/src/plugins/platforminputcontexts/maliit/serveraddressproxy.cpp
deleted file mode 100644
index 6ff508d66c..0000000000
--- a/src/plugins/platforminputcontexts/maliit/serveraddressproxy.cpp
+++ /dev/null
@@ -1,56 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
-**
-** This file is part of the plugins of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 2.1 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Digia gives you certain additional
-** rights. These rights are described in the Digia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "serveraddressproxy.h"
-
-/*
- * Implementation of interface class OrgMaliitServerAddressInterface
- */
-
-OrgMaliitServerAddressInterface::OrgMaliitServerAddressInterface(const QString &service, const QString &path, const QDBusConnection &connection, QObject *parent)
- : QDBusAbstractInterface(service, path, staticInterfaceName(), connection, parent)
-{
-}
-
-OrgMaliitServerAddressInterface::~OrgMaliitServerAddressInterface()
-{
-}
-
diff --git a/src/plugins/platforminputcontexts/maliit/serveraddressproxy.h b/src/plugins/platforminputcontexts/maliit/serveraddressproxy.h
deleted file mode 100644
index a9c31de4af..0000000000
--- a/src/plugins/platforminputcontexts/maliit/serveraddressproxy.h
+++ /dev/null
@@ -1,84 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
-**
-** This file is part of the plugins of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 2.1 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Digia gives you certain additional
-** rights. These rights are described in the Digia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef SERVERADDRESSPROXY_H
-#define SERVERADDRESSPROXY_H
-
-#include <QtCore/QObject>
-#include <QtCore/QByteArray>
-#include <QtCore/QList>
-#include <QtCore/QMap>
-#include <QtCore/QString>
-#include <QtCore/QStringList>
-#include <QtCore/QVariant>
-#include <QtDBus/QtDBus>
-
-/*
- * Proxy class for interface org.maliit.Server.Address
- */
-class OrgMaliitServerAddressInterface: public QDBusAbstractInterface
-{
- Q_OBJECT
-public:
- static inline const char *staticInterfaceName()
- { return "org.maliit.Server.Address"; }
-
-public:
- OrgMaliitServerAddressInterface(const QString &service, const QString &path, const QDBusConnection &connection, QObject *parent = 0);
-
- ~OrgMaliitServerAddressInterface();
-
- Q_PROPERTY(QString address READ address)
- inline QString address() const
- { return qvariant_cast< QString >(property("address")); }
-
-public Q_SLOTS: // METHODS
-Q_SIGNALS: // SIGNALS
-};
-
-namespace org {
- namespace maliit {
- namespace Server {
- typedef ::OrgMaliitServerAddressInterface Address;
- }
- }
-}
-#endif
diff --git a/src/plugins/platforminputcontexts/maliit/serverproxy.cpp b/src/plugins/platforminputcontexts/maliit/serverproxy.cpp
deleted file mode 100644
index fe104c23f9..0000000000
--- a/src/plugins/platforminputcontexts/maliit/serverproxy.cpp
+++ /dev/null
@@ -1,56 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
-**
-** This file is part of the plugins of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 2.1 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Digia gives you certain additional
-** rights. These rights are described in the Digia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "serverproxy.h"
-
-/*
- * Implementation of interface class ComMeegoInputmethodUiserver1Interface
- */
-
-ComMeegoInputmethodUiserver1Interface::ComMeegoInputmethodUiserver1Interface(const QString &service, const QString &path, const QDBusConnection &connection, QObject *parent)
- : QDBusAbstractInterface(service, path, staticInterfaceName(), connection, parent)
-{
-}
-
-ComMeegoInputmethodUiserver1Interface::~ComMeegoInputmethodUiserver1Interface()
-{
-}
-
diff --git a/src/plugins/platforminputcontexts/maliit/serverproxy.h b/src/plugins/platforminputcontexts/maliit/serverproxy.h
deleted file mode 100644
index e32adfdd94..0000000000
--- a/src/plugins/platforminputcontexts/maliit/serverproxy.h
+++ /dev/null
@@ -1,166 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
-**
-** This file is part of the plugins of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 2.1 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Digia gives you certain additional
-** rights. These rights are described in the Digia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef SERVER_H_1318935108
-#define SERVER_H_1318935108
-
-#include <QtCore/QObject>
-#include <QtCore/QByteArray>
-#include <QtCore/QList>
-#include <QtCore/QMap>
-#include <QtCore/QString>
-#include <QtCore/QStringList>
-#include <QtCore/QVariant>
-#include <QtDBus/QtDBus>
-
-/*
- * Proxy class for interface com.meego.inputmethod.uiserver1
- */
-class ComMeegoInputmethodUiserver1Interface: public QDBusAbstractInterface
-{
- Q_OBJECT
-public:
- static inline const char *staticInterfaceName()
- { return "com.meego.inputmethod.uiserver1"; }
-
-public:
- ComMeegoInputmethodUiserver1Interface(const QString &service, const QString &path, const QDBusConnection &connection, QObject *parent = 0);
-
- ~ComMeegoInputmethodUiserver1Interface();
-
-public Q_SLOTS: // METHODS
- inline QDBusPendingReply<> activateContext()
- {
- QList<QVariant> argumentList;
- return asyncCallWithArgumentList(QLatin1String("activateContext"), argumentList);
- }
-
- inline QDBusPendingReply<> appOrientationAboutToChange(int in0)
- {
- QList<QVariant> argumentList;
- argumentList << QVariant::fromValue(in0);
- return asyncCallWithArgumentList(QLatin1String("appOrientationAboutToChange"), argumentList);
- }
-
- inline QDBusPendingReply<> appOrientationChanged(int in0)
- {
- QList<QVariant> argumentList;
- argumentList << QVariant::fromValue(in0);
- return asyncCallWithArgumentList(QLatin1String("appOrientationChanged"), argumentList);
- }
-
- inline QDBusPendingReply<> hideInputMethod()
- {
- QList<QVariant> argumentList;
- return asyncCallWithArgumentList(QLatin1String("hideInputMethod"), argumentList);
- }
-
- inline QDBusPendingReply<> mouseClickedOnPreedit(int in0, int in1, int in2, int in3, int in4, int in5)
- {
- QList<QVariant> argumentList;
- argumentList << QVariant::fromValue(in0) << QVariant::fromValue(in1) << QVariant::fromValue(in2) << QVariant::fromValue(in3) << QVariant::fromValue(in4) << QVariant::fromValue(in5);
- return asyncCallWithArgumentList(QLatin1String("mouseClickedOnPreedit"), argumentList);
- }
-
- inline QDBusPendingReply<> processKeyEvent(int in0, int in1, int in2, const QString &in3, bool in4, int in5, uint in6, uint in7, uint in8)
- {
- QList<QVariant> argumentList;
- argumentList << QVariant::fromValue(in0) << QVariant::fromValue(in1) << QVariant::fromValue(in2) << QVariant::fromValue(in3) << QVariant::fromValue(in4) << QVariant::fromValue(in5) << QVariant::fromValue(in6) << QVariant::fromValue(in7) << QVariant::fromValue(in8);
- return asyncCallWithArgumentList(QLatin1String("processKeyEvent"), argumentList);
- }
-
- inline QDBusPendingReply<> setPreedit(const QString &in0, int in1)
- {
- QList<QVariant> argumentList;
- argumentList << QVariant::fromValue(in0) << QVariant::fromValue(in1);
- return asyncCallWithArgumentList(QLatin1String("setPreedit"), argumentList);
- }
-
- inline QDBusPendingReply<> showInputMethod()
- {
- QList<QVariant> argumentList;
- return asyncCallWithArgumentList(QLatin1String("showInputMethod"), argumentList);
- }
-
- inline QDBusPendingReply<> updateWidgetInformation(const QMap<QString, QVariant> &stateInformation, bool focusChanged)
- {
- QDBusMessage msg = QDBusMessage::createMethodCall(service(), path(), interface(), "updateWidgetInformation");
-
- QDBusArgument map;
- map.beginMap(QVariant::String, qMetaTypeId<QDBusVariant>());
- for (QMap<QString, QVariant>::ConstIterator it = stateInformation.constBegin(), end = stateInformation.constEnd();
- it != end; ++it) {
- map.beginMapEntry();
- map << it.key();
- map << QDBusVariant(it.value());
- map.endMapEntry();
- }
- map.endMap();
-
- QList<QVariant> args;
- args << QVariant::fromValue(map) << QVariant(focusChanged);
- msg.setArguments(args);
- return connection().asyncCall(msg);
- }
-
- inline QDBusPendingReply<> reset()
- {
- return asyncCall(QLatin1String("reset"));
- }
-
- inline QDBusPendingReply<> setCopyPasteState(bool in0, bool in1)
- {
- QList<QVariant> argumentList;
- argumentList << QVariant::fromValue(in0) << QVariant::fromValue(in1);
- return asyncCallWithArgumentList(QLatin1String("setCopyPasteState"), argumentList);
- }
-
-Q_SIGNALS: // SIGNALS
-};
-
-namespace com {
- namespace meego {
- namespace inputmethod {
- typedef ::ComMeegoInputmethodUiserver1Interface uiserver1;
- }
- }
-}
-#endif
diff --git a/src/plugins/platforminputcontexts/platforminputcontexts.pro b/src/plugins/platforminputcontexts/platforminputcontexts.pro
index 733b70be58..60b66bfb35 100644
--- a/src/plugins/platforminputcontexts/platforminputcontexts.pro
+++ b/src/plugins/platforminputcontexts/platforminputcontexts.pro
@@ -1,7 +1,7 @@
TEMPLATE = subdirs
qtHaveModule(dbus) {
-!mac:!win32:SUBDIRS += ibus maliit
+!mac:!win32:SUBDIRS += ibus
}
unix:!macx:!contains(DEFINES, QT_NO_XKBCOMMON): {
diff --git a/src/plugins/platforms/android/src/androidjnimain.cpp b/src/plugins/platforms/android/src/androidjnimain.cpp
index 8282b3b558..023cce30ec 100644
--- a/src/plugins/platforms/android/src/androidjnimain.cpp
+++ b/src/plugins/platforms/android/src/androidjnimain.cpp
@@ -89,6 +89,9 @@ static AAssetManager *m_assetManager = NULL;
static jobject m_resourcesObj;
static jobject m_activityObject = NULL;
+static bool m_activityActive = true; // defaults to true because when the platform plugin is
+ // initialized, QtActivity::onResume() has already been called
+
static jclass m_bitmapClass = 0;
static jmethodID m_createBitmapMethodID = 0;
static jobject m_ARGB_8888_BitmapConfigValue = 0;
@@ -320,6 +323,12 @@ namespace QtAndroid
return m_activityObject;
}
+ void setApplicationActive()
+ {
+ if (m_activityActive)
+ QWindowSystemInterface::handleApplicationStateChanged(Qt::ApplicationActive);
+ }
+
jobject createBitmap(QImage img, JNIEnv *env)
{
if (img.format() != QImage::Format_ARGB32 && img.format() != QImage::Format_RGB16)
@@ -652,6 +661,16 @@ static void updateWindow(JNIEnv */*env*/, jobject /*thiz*/)
#endif
}
+static void updateApplicationState(JNIEnv */*env*/, jobject /*thiz*/, jint state)
+{
+ m_activityActive = (state == Qt::ApplicationActive);
+
+ if (!m_androidPlatformIntegration)
+ return;
+
+ QWindowSystemInterface::handleApplicationStateChanged(Qt::ApplicationState(state));
+}
+
static void handleOrientationChanged(JNIEnv */*env*/, jobject /*thiz*/, jint newOrientation)
{
if (m_androidPlatformIntegration == 0)
@@ -678,6 +697,7 @@ static JNINativeMethod methods[] = {
{"lockSurface", "()V", (void *)lockSurface},
{"unlockSurface", "()V", (void *)unlockSurface},
{"updateWindow", "()V", (void *)updateWindow},
+ {"updateApplicationState", "(I)V", (void *)updateApplicationState},
{"handleOrientationChanged", "(I)V", (void *)handleOrientationChanged}
};
diff --git a/src/plugins/platforms/android/src/androidjnimain.h b/src/plugins/platforms/android/src/androidjnimain.h
index f75df55e02..9a3d8a9607 100644
--- a/src/plugins/platforms/android/src/androidjnimain.h
+++ b/src/plugins/platforms/android/src/androidjnimain.h
@@ -88,6 +88,8 @@ namespace QtAndroid
jclass applicationClass();
jobject activity();
+ void setApplicationActive();
+
jobject createBitmap(QImage img, JNIEnv *env = 0);
jobject createBitmapDrawable(jobject bitmap, JNIEnv *env = 0);
diff --git a/src/plugins/platforms/android/src/opengl/qandroidopenglplatformwindow.cpp b/src/plugins/platforms/android/src/opengl/qandroidopenglplatformwindow.cpp
index 24a7debd1f..f9262c69f6 100644
--- a/src/plugins/platforms/android/src/opengl/qandroidopenglplatformwindow.cpp
+++ b/src/plugins/platforms/android/src/opengl/qandroidopenglplatformwindow.cpp
@@ -120,6 +120,12 @@ void QAndroidOpenGLPlatformWindow::raise()
void QAndroidOpenGLPlatformWindow::setVisible(bool visible)
{
QEglFSWindow::setVisible(visible);
+
+ // The Android Activity is activated before Qt is initialized, causing the application state to
+ // never be set to 'active'. We explicitly set this state when the first window becomes visible.
+ if (visible)
+ QtAndroid::setApplicationActive();
+
QWindowSystemInterface::handleExposeEvent(window(), QRegion(geometry())); // Expose event
QWindowSystemInterface::flushWindowSystemEvents();
}
diff --git a/src/plugins/platforms/android/src/qandroidplatformintegration.cpp b/src/plugins/platforms/android/src/qandroidplatformintegration.cpp
index 3e7b046edb..045eb57148 100644
--- a/src/plugins/platforms/android/src/qandroidplatformintegration.cpp
+++ b/src/plugins/platforms/android/src/qandroidplatformintegration.cpp
@@ -121,6 +121,7 @@ bool QAndroidPlatformIntegration::hasCapability(Capability cap) const
{
switch (cap) {
case ThreadedPixmaps: return true;
+ case ApplicationState: return true;
case NonFullScreenWindows: return false;
case NativeWidgets: return false;
default:
diff --git a/src/plugins/platforms/android/src/raster/qandroidplatformwindow.cpp b/src/plugins/platforms/android/src/raster/qandroidplatformwindow.cpp
index 94a69c10c7..f5fce0ae34 100644
--- a/src/plugins/platforms/android/src/raster/qandroidplatformwindow.cpp
+++ b/src/plugins/platforms/android/src/raster/qandroidplatformwindow.cpp
@@ -41,6 +41,9 @@
#include "qandroidplatformwindow.h"
+#include "androidjnimain.h"
+#include <qpa/qwindowsysteminterface.h>
+
QAndroidPlatformWindow::QAndroidPlatformWindow(QWindow *window) : QFbWindow(window)
{
}
@@ -54,3 +57,13 @@ void QAndroidPlatformWindow::propagateSizeHints()
{
//shut up warning from default implementation
}
+
+void QAndroidPlatformWindow::setVisible(bool visible)
+{
+ QFbWindow::setVisible(visible);
+
+ // The Android Activity is activated before Qt is initialized, causing the application state to
+ // never be set to 'active'. We explicitly set this state when the first window becomes visible.
+ if (visible)
+ QtAndroid::setApplicationActive();
+}
diff --git a/src/plugins/platforms/android/src/raster/qandroidplatformwindow.h b/src/plugins/platforms/android/src/raster/qandroidplatformwindow.h
index 3ee815fd69..58e6451ea1 100644
--- a/src/plugins/platforms/android/src/raster/qandroidplatformwindow.h
+++ b/src/plugins/platforms/android/src/raster/qandroidplatformwindow.h
@@ -52,6 +52,8 @@ public:
void propagateSizeHints();
+ void setVisible(bool visible);
+
public slots:
void setGeometry(const QRect &rect);
diff --git a/src/plugins/platforms/windows/qtwindows_additional.h b/src/plugins/platforms/windows/qtwindows_additional.h
index 49ddf3106b..4c08a664d8 100644
--- a/src/plugins/platforms/windows/qtwindows_additional.h
+++ b/src/plugins/platforms/windows/qtwindows_additional.h
@@ -49,6 +49,10 @@
# define WM_THEMECHANGED 0x031A
#endif
+#ifndef WM_DWMCOMPOSITIONCHANGED
+# define WM_DWMCOMPOSITIONCHANGED 0x31E
+#endif
+
#ifndef GWL_HWNDPARENT
# define GWL_HWNDPARENT (-8)
#endif
diff --git a/src/plugins/platforms/windows/qtwindowsglobal.h b/src/plugins/platforms/windows/qtwindowsglobal.h
index 64bf1d71ca..e9eb50799e 100644
--- a/src/plugins/platforms/windows/qtwindowsglobal.h
+++ b/src/plugins/platforms/windows/qtwindowsglobal.h
@@ -105,6 +105,7 @@ enum WindowsEventType // Simplify event types
InputMethodCloseCandidateWindowEvent = InputMethodEventFlag + 5,
InputMethodRequest = InputMethodEventFlag + 6,
ThemeChanged = ThemingEventFlag + 1,
+ CompositionSettingsChanged = ThemingEventFlag + 2,
DisplayChangedEvent = 437,
SettingChangedEvent = DisplayChangedEvent + 1,
ContextMenu = 123,
@@ -201,6 +202,8 @@ inline QtWindows::WindowsEventType windowsEventType(UINT message, WPARAM wParamI
return QtWindows::DisplayChangedEvent;
case WM_THEMECHANGED:
return QtWindows::ThemeChanged;
+ case WM_DWMCOMPOSITIONCHANGED:
+ return QtWindows::CompositionSettingsChanged;
#ifndef QT_NO_CONTEXTMENU
case WM_CONTEXTMENU:
return QtWindows::ContextMenu;
diff --git a/src/plugins/platforms/windows/qwindowscontext.cpp b/src/plugins/platforms/windows/qwindowscontext.cpp
index 132b3684e9..c676ca3c46 100644
--- a/src/plugins/platforms/windows/qwindowscontext.cpp
+++ b/src/plugins/platforms/windows/qwindowscontext.cpp
@@ -884,6 +884,9 @@ bool QWindowsContext::windowsProc(HWND hwnd, UINT message,
theme->windowsThemeChanged(platformWindow->window());
return true;
}
+ case QtWindows::CompositionSettingsChanged:
+ platformWindow->handleCompositionSettingsChanged();
+ return true;
#ifndef Q_OS_WINCE
case QtWindows::ActivateWindowEvent:
#ifndef QT_NO_TABLETEVENT
diff --git a/src/plugins/platforms/windows/qwindowswindow.cpp b/src/plugins/platforms/windows/qwindowswindow.cpp
index ace18ddf5b..f3faccbc14 100644
--- a/src/plugins/platforms/windows/qwindowswindow.cpp
+++ b/src/plugins/platforms/windows/qwindowswindow.cpp
@@ -56,6 +56,7 @@
#include <QtGui/QScreen>
#include <QtGui/QWindow>
#include <QtGui/QRegion>
+#include <private/qsystemlibrary_p.h>
#include <private/qwindow_p.h>
#include <private/qguiapplication_p.h>
#include <qpa/qwindowsysteminterface.h>
@@ -203,6 +204,69 @@ static inline QSize clientSize(HWND hwnd)
return qSizeOfRect(rect);
}
+static bool applyBlurBehindWindow(HWND hwnd)
+{
+#ifdef Q_OS_WINCE
+ Q_UNUSED(hwnd);
+ return false;
+#else
+ enum { dwmBbEnable = 0x1, dwmBbBlurRegion = 0x2 };
+
+ struct DwmBlurBehind {
+ DWORD dwFlags;
+ BOOL fEnable;
+ HRGN hRgnBlur;
+ BOOL fTransitionOnMaximized;
+ };
+
+ typedef HRESULT (WINAPI *PtrDwmEnableBlurBehindWindow)(HWND, const DwmBlurBehind*);
+ typedef HRESULT (WINAPI *PtrDwmIsCompositionEnabled)(BOOL *);
+
+ // DWM API is available only from Windows Vista
+ if (QSysInfo::windowsVersion() < QSysInfo::WV_VISTA)
+ return false;
+
+ static bool functionPointersResolved = false;
+ static PtrDwmEnableBlurBehindWindow dwmBlurBehind = 0;
+ static PtrDwmIsCompositionEnabled dwmIsCompositionEnabled = 0;
+
+ if (Q_UNLIKELY(!functionPointersResolved)) {
+ QSystemLibrary library(QStringLiteral("dwmapi"));
+ if (library.load()) {
+ dwmBlurBehind = (PtrDwmEnableBlurBehindWindow)(library.resolve("DwmEnableBlurBehindWindow"));
+ dwmIsCompositionEnabled = (PtrDwmIsCompositionEnabled)(library.resolve("DwmIsCompositionEnabled"));
+ }
+
+ functionPointersResolved = true;
+ }
+
+ if (Q_UNLIKELY(!dwmBlurBehind || !dwmIsCompositionEnabled))
+ return false;
+
+ BOOL compositionEnabled;
+ if (dwmIsCompositionEnabled(&compositionEnabled) != S_OK)
+ return false;
+
+ DwmBlurBehind blurBehind = {0, 0, 0, 0};
+
+ if (compositionEnabled) {
+ blurBehind.dwFlags = dwmBbEnable | dwmBbBlurRegion;
+ blurBehind.fEnable = TRUE;
+ blurBehind.hRgnBlur = CreateRectRgn(0, 0, -1, -1);
+ } else {
+ blurBehind.dwFlags = dwmBbEnable;
+ blurBehind.fEnable = FALSE;
+ }
+
+ const bool result = dwmBlurBehind(hwnd, &blurBehind) == S_OK;
+
+ if (blurBehind.hRgnBlur)
+ DeleteObject(blurBehind.hRgnBlur);
+
+ return result;
+#endif // Q_OS_WINCE
+}
+
// from qwidget_win.cpp, pass flags separately in case they have been "autofixed".
static bool shouldShowMaximizeButton(const QWindow *w, Qt::WindowFlags flags)
{
@@ -543,6 +607,10 @@ QWindowsWindow::WindowData
result.frame = context->margins;
result.embedded = embedded;
result.customMargins = context->customMargins;
+
+ if (isGL && hasAlpha)
+ applyBlurBehindWindow(result.hwnd);
+
return result;
}
@@ -1167,6 +1235,13 @@ void QWindowsWindow::handleHidden()
fireExpose(QRegion());
}
+void QWindowsWindow::handleCompositionSettingsChanged()
+{
+ const QWindow *w = window();
+ if (w->surfaceType() == QWindow::OpenGLSurface && w->format().hasAlpha())
+ applyBlurBehindWindow(handle());
+}
+
void QWindowsWindow::setGeometry(const QRect &rectIn)
{
QRect rect = rectIn;
diff --git a/src/plugins/platforms/windows/qwindowswindow.h b/src/plugins/platforms/windows/qwindowswindow.h
index afcfa8b821..f055864482 100644
--- a/src/plugins/platforms/windows/qwindowswindow.h
+++ b/src/plugins/platforms/windows/qwindowswindow.h
@@ -221,6 +221,7 @@ public:
void handleMoved();
void handleResized(int wParam);
void handleHidden();
+ void handleCompositionSettingsChanged();
static inline HWND handleOf(const QWindow *w);
static inline QWindowsWindow *baseWindowOf(const QWindow *w);