summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforminputcontexts
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/platforminputcontexts')
-rw-r--r--src/plugins/platforminputcontexts/CMakeLists.txt3
-rw-r--r--src/plugins/platforminputcontexts/compose/CMakeLists.txt11
-rw-r--r--src/plugins/platforminputcontexts/compose/qcomposeplatforminputcontext.cpp46
-rw-r--r--src/plugins/platforminputcontexts/compose/qcomposeplatforminputcontext.h40
-rw-r--r--src/plugins/platforminputcontexts/compose/qcomposeplatforminputcontextmain.cpp46
-rw-r--r--src/plugins/platforminputcontexts/ibus/CMakeLists.txt7
-rw-r--r--src/plugins/platforminputcontexts/ibus/interfaces/org.freedesktop.IBus.InputContext.xml18
-rw-r--r--src/plugins/platforminputcontexts/ibus/main.cpp49
-rw-r--r--src/plugins/platforminputcontexts/ibus/qibusinputcontextproxy.cpp2
-rw-r--r--src/plugins/platforminputcontexts/ibus/qibusinputcontextproxy.h73
-rw-r--r--src/plugins/platforminputcontexts/ibus/qibusplatforminputcontext.cpp226
-rw-r--r--src/plugins/platforminputcontexts/ibus/qibusplatforminputcontext.h43
-rw-r--r--src/plugins/platforminputcontexts/ibus/qibusproxy.cpp1
-rw-r--r--src/plugins/platforminputcontexts/ibus/qibusproxy.h2
-rw-r--r--src/plugins/platforminputcontexts/ibus/qibusproxyportal.cpp2
-rw-r--r--src/plugins/platforminputcontexts/ibus/qibusproxyportal.h19
-rw-r--r--src/plugins/platforminputcontexts/ibus/qibustypes.cpp82
-rw-r--r--src/plugins/platforminputcontexts/ibus/qibustypes.h80
18 files changed, 320 insertions, 430 deletions
diff --git a/src/plugins/platforminputcontexts/CMakeLists.txt b/src/plugins/platforminputcontexts/CMakeLists.txt
index b5150df4f3..78b3ec99d9 100644
--- a/src/plugins/platforminputcontexts/CMakeLists.txt
+++ b/src/plugins/platforminputcontexts/CMakeLists.txt
@@ -1,4 +1,5 @@
-# Generated from platforminputcontexts.pro.
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
if(QT_FEATURE_xkbcommon)
add_subdirectory(compose)
diff --git a/src/plugins/platforminputcontexts/compose/CMakeLists.txt b/src/plugins/platforminputcontexts/compose/CMakeLists.txt
index e3fbf913b9..9e71a7a07c 100644
--- a/src/plugins/platforminputcontexts/compose/CMakeLists.txt
+++ b/src/plugins/platforminputcontexts/compose/CMakeLists.txt
@@ -1,11 +1,12 @@
-# Generated from compose.pro.
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
#####################################################################
## QComposePlatformInputContextPlugin Plugin:
#####################################################################
-qt_find_package(XKB) # special case
-pkg_get_variable(PKG_X11_PREFIX x11 prefix) # special case
+qt_find_package(XKB)
+pkg_get_variable(PKG_X11_PREFIX x11 prefix)
qt_internal_add_plugin(QComposePlatformInputContextPlugin
OUTPUT_NAME composeplatforminputcontextplugin
@@ -21,7 +22,3 @@ qt_internal_add_plugin(QComposePlatformInputContextPlugin
Qt::GuiPrivate
XKB::XKB
)
-
-#### Keys ignored in scope 1:.:.:compose.pro:<TRUE>:
-# OTHER_FILES = "$$PWD/compose.json"
-# PLUGIN_EXTENDS = "-"
diff --git a/src/plugins/platforminputcontexts/compose/qcomposeplatforminputcontext.cpp b/src/plugins/platforminputcontexts/compose/qcomposeplatforminputcontext.cpp
index da5235e491..3e74189076 100644
--- a/src/plugins/platforminputcontexts/compose/qcomposeplatforminputcontext.cpp
+++ b/src/plugins/platforminputcontexts/compose/qcomposeplatforminputcontext.cpp
@@ -1,44 +1,9 @@
-/****************************************************************************
-**
-** Copyright (C) 2019 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** 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 The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/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 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2019 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#include "qcomposeplatforminputcontext.h"
#include <QtCore/QCoreApplication>
+#include <QtCore/qvarlengtharray.h>
#include <QtGui/QKeyEvent>
#include <QtGui/QGuiApplication>
@@ -143,8 +108,7 @@ bool QComposeInputContext::filterEvent(const QEvent *event)
case XKB_COMPOSE_NOTHING:
return false;
default:
- Q_UNREACHABLE();
- return false;
+ Q_UNREACHABLE_RETURN(false);
}
}
@@ -170,3 +134,5 @@ void QComposeInputContext::update(Qt::InputMethodQueries q)
}
QT_END_NAMESPACE
+
+#include "moc_qcomposeplatforminputcontext.cpp"
diff --git a/src/plugins/platforminputcontexts/compose/qcomposeplatforminputcontext.h b/src/plugins/platforminputcontexts/compose/qcomposeplatforminputcontext.h
index bb03808155..79b98de3fa 100644
--- a/src/plugins/platforminputcontexts/compose/qcomposeplatforminputcontext.h
+++ b/src/plugins/platforminputcontexts/compose/qcomposeplatforminputcontext.h
@@ -1,41 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2019 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** 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 The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/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 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2019 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#ifndef QCOMPOSEPLATFORMINPUTCONTEXT_H
#define QCOMPOSEPLATFORMINPUTCONTEXT_H
diff --git a/src/plugins/platforminputcontexts/compose/qcomposeplatforminputcontextmain.cpp b/src/plugins/platforminputcontexts/compose/qcomposeplatforminputcontextmain.cpp
index d062d4fd6a..804ced957b 100644
--- a/src/plugins/platforminputcontexts/compose/qcomposeplatforminputcontextmain.cpp
+++ b/src/plugins/platforminputcontexts/compose/qcomposeplatforminputcontextmain.cpp
@@ -1,41 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2019 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** 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 The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/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 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2019 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#include <qpa/qplatforminputcontextplugin_p.h>
@@ -45,6 +9,8 @@
QT_BEGIN_NAMESPACE
+using namespace Qt::StringLiterals;
+
class QComposePlatformInputContextPlugin : public QPlatformInputContextPlugin
{
Q_OBJECT
@@ -58,8 +24,8 @@ QComposeInputContext *QComposePlatformInputContextPlugin::create(const QString &
{
Q_UNUSED(paramList);
- if (system.compare(system, QLatin1String("compose"), Qt::CaseInsensitive) == 0
- || system.compare(system, QLatin1String("xim"), Qt::CaseInsensitive) == 0)
+ if (system.compare(system, "compose"_L1, Qt::CaseInsensitive) == 0
+ || system.compare(system, "xim"_L1, Qt::CaseInsensitive) == 0)
return new QComposeInputContext;
return nullptr;
}
diff --git a/src/plugins/platforminputcontexts/ibus/CMakeLists.txt b/src/plugins/platforminputcontexts/ibus/CMakeLists.txt
index 7ccc627eb1..54847e86fd 100644
--- a/src/plugins/platforminputcontexts/ibus/CMakeLists.txt
+++ b/src/plugins/platforminputcontexts/ibus/CMakeLists.txt
@@ -1,4 +1,5 @@
-# Generated from ibus.pro.
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
#####################################################################
## QIbusPlatformInputContextPlugin Plugin:
@@ -22,7 +23,3 @@ qt_internal_add_plugin(QIbusPlatformInputContextPlugin
Qt::GuiPrivate
XKB::XKB
)
-
-#### Keys ignored in scope 1:.:.:ibus.pro:<TRUE>:
-# OTHER_FILES = "$$PWD/ibus.json"
-# PLUGIN_EXTENDS = "-"
diff --git a/src/plugins/platforminputcontexts/ibus/interfaces/org.freedesktop.IBus.InputContext.xml b/src/plugins/platforminputcontexts/ibus/interfaces/org.freedesktop.IBus.InputContext.xml
index 9c67a38c57..30fa7431c3 100644
--- a/src/plugins/platforminputcontexts/ibus/interfaces/org.freedesktop.IBus.InputContext.xml
+++ b/src/plugins/platforminputcontexts/ibus/interfaces/org.freedesktop.IBus.InputContext.xml
@@ -2,6 +2,12 @@
"http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd">
<node>
<interface name="org.freedesktop.IBus.InputContext">
+ <property name="ClientCommitPreedit" type="(b)" access="readwrite">
+ <annotation name="org.qtproject.QtDBus.QtTypeName" value="QIBusPropTypeClientCommitPreedit"/>
+ </property>
+ <property name='ContentType' type='(uu)' access='readwrite'>
+ <annotation name="org.qtproject.QtDBus.QtTypeName" value="QIBusPropTypeContentType"/>
+ </property>
<method name="ProcessKeyEvent">
<arg name="keyval" direction="in" type="u"/>
<arg name="keycode" direction="in" type="u"/>
@@ -14,6 +20,12 @@
<arg name="w" direction="in" type="i"/>
<arg name="h" direction="in" type="i"/>
</method>
+ <method name='SetCursorLocationRelative'>
+ <arg name="x" direction="in" type="i"/>
+ <arg name="y" direction="in" type="i"/>
+ <arg name="w" direction="in" type="i"/>
+ <arg name="h" direction="in" type="i"/>
+ </method>
<method name="FocusIn"/>
<method name="FocusOut"/>
<method name="Reset"/>
@@ -56,6 +68,12 @@
<arg name="cursor_pos" type="u"/>
<arg name="visible" type="b"/>
</signal>
+ <signal name="UpdatePreeditTextWithMode">
+ <arg name="text" type="v"/>
+ <arg name="cursor_pos" type="u"/>
+ <arg name="visible" type="b"/>
+ <arg name="mode" type="u"/>
+ </signal>
<signal name="ShowPreeditText"/>
<signal name="HidePreeditText"/>
<signal name="UpdateAuxiliaryText">
diff --git a/src/plugins/platforminputcontexts/ibus/main.cpp b/src/plugins/platforminputcontexts/ibus/main.cpp
index 0a7da3b14c..d74be4bedf 100644
--- a/src/plugins/platforminputcontexts/ibus/main.cpp
+++ b/src/plugins/platforminputcontexts/ibus/main.cpp
@@ -1,41 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** 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 The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/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 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#include <qpa/qplatforminputcontextplugin_p.h>
#include <QtCore/QStringList>
@@ -45,6 +9,8 @@
QT_BEGIN_NAMESPACE
+using namespace Qt::StringLiterals;
+
class QIbusPlatformInputContextPlugin : public QPlatformInputContextPlugin
{
Q_OBJECT
@@ -58,13 +24,16 @@ QIBusPlatformInputContext *QIbusPlatformInputContextPlugin::create(const QString
{
Q_UNUSED(paramList);
- if (system.compare(system, QLatin1String("ibus"), Qt::CaseInsensitive) == 0) {
+ if (system.compare(system, "ibus"_L1, Qt::CaseInsensitive) == 0) {
qDBusRegisterMetaType<QIBusAttribute>();
qDBusRegisterMetaType<QIBusAttributeList>();
qDBusRegisterMetaType<QIBusText>();
+ qDBusRegisterMetaType<QIBusPropTypeClientCommitPreedit>();
+ qDBusRegisterMetaType<QIBusPropTypeContentType>();
return new QIBusPlatformInputContext;
}
- return 0;
+
+ return nullptr;
}
QT_END_NAMESPACE
diff --git a/src/plugins/platforminputcontexts/ibus/qibusinputcontextproxy.cpp b/src/plugins/platforminputcontexts/ibus/qibusinputcontextproxy.cpp
index 793c9dd95c..248abbc32b 100644
--- a/src/plugins/platforminputcontexts/ibus/qibusinputcontextproxy.cpp
+++ b/src/plugins/platforminputcontexts/ibus/qibusinputcontextproxy.cpp
@@ -2,7 +2,7 @@
* This file was generated by qdbusxml2cpp version 0.8
* Command line was: qdbusxml2cpp -N -p qibusinputcontextproxy -c QIBusInputContextProxy interfaces/org.freedesktop.IBus.InputContext.xml
*
- * qdbusxml2cpp is Copyright (C) 2015 The Qt Company Ltd.
+ * qdbusxml2cpp is Copyright (C) 2023 The Qt Company Ltd and other contributors.
*
* This is an auto-generated file.
* This file may have been hand-edited. Look for HAND-EDIT comments
diff --git a/src/plugins/platforminputcontexts/ibus/qibusinputcontextproxy.h b/src/plugins/platforminputcontexts/ibus/qibusinputcontextproxy.h
index 3d11706c06..82e78aa35b 100644
--- a/src/plugins/platforminputcontexts/ibus/qibusinputcontextproxy.h
+++ b/src/plugins/platforminputcontexts/ibus/qibusinputcontextproxy.h
@@ -2,25 +2,26 @@
* This file was generated by qdbusxml2cpp version 0.8
* Command line was: qdbusxml2cpp -N -p qibusinputcontextproxy -c QIBusInputContextProxy interfaces/org.freedesktop.IBus.InputContext.xml
*
- * qdbusxml2cpp is Copyright (C) 2015 The Qt Company Ltd.
+ * qdbusxml2cpp is Copyright (C) 2023 The Qt Company Ltd and other contributors.
*
* This is an auto-generated file.
* Do not edit! All changes made to it will be lost.
*/
-#ifndef QIBUSINPUTCONTEXTPROXY_H_1394889529
-#define QIBUSINPUTCONTEXTPROXY_H_1394889529
+#ifndef QIBUSINPUTCONTEXTPROXY_H
+#define QIBUSINPUTCONTEXTPROXY_H
-#include <QObject>
-#include <QByteArray>
-#include <QList>
-#include <QMap>
-#include <QString>
-#include <QStringList>
-#include <QVariant>
-#include <QDBusAbstractInterface>
-#include <QDBusPendingReply>
+#include <QtCore/QObject>
+#include <QtCore/QByteArray>
+#include <QtCore/QList>
+#include <QtCore/QMap>
+#include <QtCore/QString>
+#include <QtCore/QStringList>
+#include <QtCore/QVariant>
+#include <QtDBus/QtDBus>
+// Added for QIBusPropTypeClientCommitPreedit and QIBusPropTypeContentType
+#include "qibustypes.h"
/*
* Proxy class for interface org.freedesktop.IBus.InputContext
@@ -37,95 +38,114 @@ public:
~QIBusInputContextProxy();
+ Q_PROPERTY(QIBusPropTypeClientCommitPreedit ClientCommitPreedit READ clientCommitPreedit WRITE setClientCommitPreedit)
+ inline QIBusPropTypeClientCommitPreedit clientCommitPreedit() const
+ { return qvariant_cast< QIBusPropTypeClientCommitPreedit >(property("ClientCommitPreedit")); }
+ inline void setClientCommitPreedit(const QIBusPropTypeClientCommitPreedit &value)
+ { setProperty("ClientCommitPreedit", QVariant::fromValue(value)); }
+
+ Q_PROPERTY(QIBusPropTypeContentType ContentType READ contentType WRITE setContentType)
+ inline QIBusPropTypeContentType contentType() const
+ { return qvariant_cast< QIBusPropTypeContentType >(property("ContentType")); }
+ inline void setContentType(const QIBusPropTypeContentType &value)
+ { setProperty("ContentType", QVariant::fromValue(value)); }
+
public Q_SLOTS: // METHODS
inline QDBusPendingReply<> Destroy()
{
QList<QVariant> argumentList;
- return asyncCallWithArgumentList(QLatin1String("Destroy"), argumentList);
+ return asyncCallWithArgumentList(QStringLiteral("Destroy"), argumentList);
}
inline QDBusPendingReply<> Disable()
{
QList<QVariant> argumentList;
- return asyncCallWithArgumentList(QLatin1String("Disable"), argumentList);
+ return asyncCallWithArgumentList(QStringLiteral("Disable"), argumentList);
}
inline QDBusPendingReply<> Enable()
{
QList<QVariant> argumentList;
- return asyncCallWithArgumentList(QLatin1String("Enable"), argumentList);
+ return asyncCallWithArgumentList(QStringLiteral("Enable"), argumentList);
}
inline QDBusPendingReply<> FocusIn()
{
QList<QVariant> argumentList;
- return asyncCallWithArgumentList(QLatin1String("FocusIn"), argumentList);
+ return asyncCallWithArgumentList(QStringLiteral("FocusIn"), argumentList);
}
inline QDBusPendingReply<> FocusOut()
{
QList<QVariant> argumentList;
- return asyncCallWithArgumentList(QLatin1String("FocusOut"), argumentList);
+ return asyncCallWithArgumentList(QStringLiteral("FocusOut"), argumentList);
}
inline QDBusPendingReply<QDBusVariant> GetEngine()
{
QList<QVariant> argumentList;
- return asyncCallWithArgumentList(QLatin1String("GetEngine"), argumentList);
+ return asyncCallWithArgumentList(QStringLiteral("GetEngine"), argumentList);
}
inline QDBusPendingReply<bool> IsEnabled()
{
QList<QVariant> argumentList;
- return asyncCallWithArgumentList(QLatin1String("IsEnabled"), argumentList);
+ return asyncCallWithArgumentList(QStringLiteral("IsEnabled"), argumentList);
}
inline QDBusPendingReply<bool> ProcessKeyEvent(uint keyval, uint keycode, uint state)
{
QList<QVariant> argumentList;
argumentList << QVariant::fromValue(keyval) << QVariant::fromValue(keycode) << QVariant::fromValue(state);
- return asyncCallWithArgumentList(QLatin1String("ProcessKeyEvent"), argumentList);
+ return asyncCallWithArgumentList(QStringLiteral("ProcessKeyEvent"), argumentList);
}
inline QDBusPendingReply<> PropertyActivate(const QString &name, int state)
{
QList<QVariant> argumentList;
argumentList << QVariant::fromValue(name) << QVariant::fromValue(state);
- return asyncCallWithArgumentList(QLatin1String("PropertyActivate"), argumentList);
+ return asyncCallWithArgumentList(QStringLiteral("PropertyActivate"), argumentList);
}
inline QDBusPendingReply<> Reset()
{
QList<QVariant> argumentList;
- return asyncCallWithArgumentList(QLatin1String("Reset"), argumentList);
+ return asyncCallWithArgumentList(QStringLiteral("Reset"), argumentList);
}
inline QDBusPendingReply<> SetCapabilities(uint caps)
{
QList<QVariant> argumentList;
argumentList << QVariant::fromValue(caps);
- return asyncCallWithArgumentList(QLatin1String("SetCapabilities"), argumentList);
+ return asyncCallWithArgumentList(QStringLiteral("SetCapabilities"), argumentList);
}
inline QDBusPendingReply<> SetCursorLocation(int x, int y, int w, int h)
{
QList<QVariant> argumentList;
argumentList << QVariant::fromValue(x) << QVariant::fromValue(y) << QVariant::fromValue(w) << QVariant::fromValue(h);
- return asyncCallWithArgumentList(QLatin1String("SetCursorLocation"), argumentList);
+ return asyncCallWithArgumentList(QStringLiteral("SetCursorLocation"), argumentList);
+ }
+
+ inline QDBusPendingReply<> SetCursorLocationRelative(int x, int y, int w, int h)
+ {
+ QList<QVariant> argumentList;
+ argumentList << QVariant::fromValue(x) << QVariant::fromValue(y) << QVariant::fromValue(w) << QVariant::fromValue(h);
+ return asyncCallWithArgumentList(QStringLiteral("SetCursorLocationRelative"), argumentList);
}
inline QDBusPendingReply<> SetEngine(const QString &name)
{
QList<QVariant> argumentList;
argumentList << QVariant::fromValue(name);
- return asyncCallWithArgumentList(QLatin1String("SetEngine"), argumentList);
+ return asyncCallWithArgumentList(QStringLiteral("SetEngine"), argumentList);
}
inline QDBusPendingReply<> SetSurroundingText(const QDBusVariant &text, uint cursor_pos, uint anchor_pos)
{
QList<QVariant> argumentList;
argumentList << QVariant::fromValue(text) << QVariant::fromValue(cursor_pos) << QVariant::fromValue(anchor_pos);
- return asyncCallWithArgumentList(QLatin1String("SetSurroundingText"), argumentList);
+ return asyncCallWithArgumentList(QStringLiteral("SetSurroundingText"), argumentList);
}
Q_SIGNALS: // SIGNALS
@@ -149,6 +169,7 @@ Q_SIGNALS: // SIGNALS
void UpdateAuxiliaryText(const QDBusVariant &text, bool visible);
void UpdateLookupTable(const QDBusVariant &table, bool visible);
void UpdatePreeditText(const QDBusVariant &text, uint cursor_pos, bool visible);
+ void UpdatePreeditTextWithMode(const QDBusVariant &text, uint cursor_pos, bool visible, uint mode);
void UpdateProperty(const QDBusVariant &prop);
};
diff --git a/src/plugins/platforminputcontexts/ibus/qibusplatforminputcontext.cpp b/src/plugins/platforminputcontexts/ibus/qibusplatforminputcontext.cpp
index 32f9a834e0..00c7884cda 100644
--- a/src/plugins/platforminputcontexts/ibus/qibusplatforminputcontext.cpp
+++ b/src/plugins/platforminputcontexts/ibus/qibusplatforminputcontext.cpp
@@ -1,41 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** 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 The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/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 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#include "qibusplatforminputcontext.h"
#include <QDebug>
@@ -44,6 +8,7 @@
#include <QWindow>
#include <QEvent>
#include <QFile>
+#include <QFileInfo>
#include <QStandardPaths>
#include <QDBusVariant>
#include <QDBusPendingReply>
@@ -62,6 +27,8 @@
#include <private/qguiapplication_p.h>
#include <private/qxkbcommon_p.h>
+#include <memory>
+
#include <sys/types.h>
#include <signal.h>
@@ -76,30 +43,41 @@
QT_BEGIN_NAMESPACE
+using namespace Qt::StringLiterals;
+
enum { debug = 0 };
class QIBusPlatformInputContextPrivate
{
+ Q_DISABLE_COPY_MOVE(QIBusPlatformInputContextPrivate)
public:
+ // This enum might be synced with IBusPreeditFocusMode
+ // in ibustypes.h of IBUS project
+ enum PreeditFocusMode {
+ PREEDIT_CLEAR = 0,
+ PREEDIT_COMMIT = 1,
+ };
+
QIBusPlatformInputContextPrivate();
~QIBusPlatformInputContextPrivate()
{
- delete context;
- delete bus;
- delete portalBus;
- delete connection;
+ // dereference QDBusConnection to actually disconnect
+ serviceWatcher.setConnection(QDBusConnection(QString()));
+ context = nullptr;
+ portalBus = nullptr;
+ bus = nullptr;
+ QDBusConnection::disconnectFromBus("QIBusProxy"_L1);
}
static QString getSocketPath();
- QDBusConnection *createConnection();
+ void createConnection();
void initBus();
void createBusProxy();
- QDBusConnection *connection;
- QIBusProxy *bus;
- QIBusProxyPortal *portalBus; // bus and portalBus are alternative.
- QIBusInputContextProxy *context;
+ std::unique_ptr<QIBusProxy> bus;
+ std::unique_ptr<QIBusProxyPortal> portalBus; // bus and portalBus are alternative.
+ std::unique_ptr<QIBusInputContextProxy> context;
QDBusServiceWatcher serviceWatcher;
bool usePortal; // return value of shouldConnectIbusPortal
@@ -109,6 +87,7 @@ public:
QList<QInputMethodEvent::Attribute> attributes;
bool needsSurroundingText;
QLocale locale;
+ PreeditFocusMode preeditFocusMode = PREEDIT_COMMIT; // for backward compatibility
};
@@ -180,8 +159,6 @@ void QIBusPlatformInputContext::invokeAction(QInputMethod::Action a, int)
void QIBusPlatformInputContext::reset()
{
- QPlatformInputContext::reset();
-
if (!d->busConnected)
return;
@@ -192,8 +169,6 @@ void QIBusPlatformInputContext::reset()
void QIBusPlatformInputContext::commit()
{
- QPlatformInputContext::commit();
-
if (!d->busConnected)
return;
@@ -204,10 +179,18 @@ void QIBusPlatformInputContext::commit()
return;
}
- if (!d->predit.isEmpty()) {
- QInputMethodEvent event;
- event.setCommitString(d->predit);
- QCoreApplication::sendEvent(input, &event);
+ if (d->preeditFocusMode == QIBusPlatformInputContextPrivate::PREEDIT_COMMIT) {
+ if (!d->predit.isEmpty()) {
+ QInputMethodEvent event;
+ event.setCommitString(d->predit);
+ QCoreApplication::sendEvent(input, &event);
+ }
+ } else {
+ if (!d->predit.isEmpty()) {
+ // Clear the existing preedit
+ QInputMethodEvent event;
+ QCoreApplication::sendEvent(input, &event);
+ }
}
d->context->Reset();
@@ -242,7 +225,6 @@ void QIBusPlatformInputContext::update(Qt::InputMethodQueries q)
d->context->SetSurroundingText(dbusText, cursorPosition, anchorPosition);
}
- QPlatformInputContext::update(q);
}
void QIBusPlatformInputContext::cursorRectChanged()
@@ -257,10 +239,31 @@ void QIBusPlatformInputContext::cursorRectChanged()
QWindow *inputWindow = qApp->focusWindow();
if (!inputWindow)
return;
- r.moveTopLeft(inputWindow->mapToGlobal(r.topLeft()));
+ if (!inputWindow->screen())
+ return;
+
+ if (QGuiApplication::platformName().startsWith("wayland"_L1)) {
+ auto margins = inputWindow->frameMargins();
+ r.translate(margins.left(), margins.top());
+ qreal scale = inputWindow->devicePixelRatio();
+ QRect newRect = QRect(r.x() * scale, r.y() * scale, r.width() * scale, r.height() * scale);
+ if (debug)
+ qDebug() << "microFocus" << newRect;
+ d->context->SetCursorLocationRelative(newRect.x(), newRect.y(),
+ newRect.width(), newRect.height());
+ return;
+ }
+
+ // x11/xcb
+ auto screenGeometry = inputWindow->screen()->geometry();
+ auto point = inputWindow->mapToGlobal(r.topLeft());
+ qreal scale = inputWindow->devicePixelRatio();
+ auto native = (point - screenGeometry.topLeft()) * scale + screenGeometry.topLeft();
+ QRect newRect(native, r.size() * scale);
if (debug)
- qDebug() << "microFocus" << r;
- d->context->SetCursorLocation(r.x(), r.y(), r.width(), r.height());
+ qDebug() << "microFocus" << newRect;
+ d->context->SetCursorLocation(newRect.x(), newRect.y(),
+ newRect.width(), newRect.height());
}
void QIBusPlatformInputContext::setFocusObject(QObject *object)
@@ -271,7 +274,7 @@ void QIBusPlatformInputContext::setFocusObject(QObject *object)
// It would seem natural here to call FocusOut() on the input method if we
// transition from an IME accepted focus object to one that does not accept it.
// Mysteriously however that is not sufficient to fix bug QTBUG-63066.
- if (!inputMethodAccepted())
+ if (object && !inputMethodAccepted())
return;
if (debug)
@@ -331,6 +334,15 @@ void QIBusPlatformInputContext::updatePreeditText(const QDBusVariant &text, uint
d->predit = t.text;
}
+void QIBusPlatformInputContext::updatePreeditTextWithMode(const QDBusVariant &text, uint cursorPos, bool visible, uint mode)
+{
+ updatePreeditText(text, cursorPos, visible);
+ if (mode > 0)
+ d->preeditFocusMode = QIBusPlatformInputContextPrivate::PreeditFocusMode::PREEDIT_COMMIT;
+ else
+ d->preeditFocusMode = QIBusPlatformInputContextPrivate::PreeditFocusMode::PREEDIT_CLEAR;
+}
+
void QIBusPlatformInputContext::forwardKeyEvent(uint keyval, uint keycode, uint state)
{
if (!qApp)
@@ -507,7 +519,7 @@ void QIBusPlatformInputContext::filterEventFinished(QDBusPendingCallWatcher *cal
if (!filtered) {
#ifndef QT_NO_CONTEXTMENU
if (type == QEvent::KeyPress && qtcode == Qt::Key_Menu
- && window != NULL) {
+ && window != nullptr) {
const QPoint globalPos = window->screen()->handle()->cursor()->pos();
const QPoint pos = window->mapFromGlobal(globalPos);
QWindowSystemInterfacePrivate::ContextMenuEvent contextMenuEvent(window, false, pos,
@@ -537,12 +549,12 @@ void QIBusPlatformInputContext::socketChanged(const QString &str)
m_timer.stop();
- if (d->context)
- disconnect(d->context);
- if (d->bus && d->bus->isValid())
- disconnect(d->bus);
- if (d->connection)
- d->connection->disconnectFromBus(QLatin1String("QIBusProxy"));
+ // dereference QDBusConnection to actually disconnect
+ d->serviceWatcher.setConnection(QDBusConnection(QString()));
+ d->context = nullptr;
+ d->bus = nullptr;
+ d->busConnected = false;
+ QDBusConnection::disconnectFromBus("QIBusProxy"_L1);
m_timer.start(100);
}
@@ -594,37 +606,34 @@ void QIBusPlatformInputContext::globalEngineChanged(const QString &engine_name)
void QIBusPlatformInputContext::connectToContextSignals()
{
if (d->bus && d->bus->isValid()) {
- connect(d->bus, SIGNAL(GlobalEngineChanged(QString)), this, SLOT(globalEngineChanged(QString)));
+ connect(d->bus.get(), SIGNAL(GlobalEngineChanged(QString)), this, SLOT(globalEngineChanged(QString)));
}
if (d->context) {
- connect(d->context, SIGNAL(CommitText(QDBusVariant)), SLOT(commitText(QDBusVariant)));
- connect(d->context, SIGNAL(UpdatePreeditText(QDBusVariant,uint,bool)), this, SLOT(updatePreeditText(QDBusVariant,uint,bool)));
- connect(d->context, SIGNAL(ForwardKeyEvent(uint,uint,uint)), this, SLOT(forwardKeyEvent(uint,uint,uint)));
- connect(d->context, SIGNAL(DeleteSurroundingText(int,uint)), this, SLOT(deleteSurroundingText(int,uint)));
- connect(d->context, SIGNAL(RequireSurroundingText()), this, SLOT(surroundingTextRequired()));
- connect(d->context, SIGNAL(HidePreeditText()), this, SLOT(hidePreeditText()));
- connect(d->context, SIGNAL(ShowPreeditText()), this, SLOT(showPreeditText()));
+ connect(d->context.get(), SIGNAL(CommitText(QDBusVariant)), SLOT(commitText(QDBusVariant)));
+ connect(d->context.get(), SIGNAL(UpdatePreeditText(QDBusVariant,uint,bool)), this, SLOT(updatePreeditText(QDBusVariant,uint,bool)));
+ connect(d->context.get(), SIGNAL(UpdatePreeditTextWithMode(QDBusVariant,uint,bool,uint)), this, SLOT(updatePreeditTextWithMode(QDBusVariant,uint,bool,uint)));
+ connect(d->context.get(), SIGNAL(ForwardKeyEvent(uint,uint,uint)), this, SLOT(forwardKeyEvent(uint,uint,uint)));
+ connect(d->context.get(), SIGNAL(DeleteSurroundingText(int,uint)), this, SLOT(deleteSurroundingText(int,uint)));
+ connect(d->context.get(), SIGNAL(RequireSurroundingText()), this, SLOT(surroundingTextRequired()));
+ connect(d->context.get(), SIGNAL(HidePreeditText()), this, SLOT(hidePreeditText()));
+ connect(d->context.get(), SIGNAL(ShowPreeditText()), this, SLOT(showPreeditText()));
}
}
-static inline bool checkRunningUnderFlatpak()
+static inline bool checkNeedPortalSupport()
{
- return !QStandardPaths::locate(QStandardPaths::RuntimeLocation, QLatin1String("flatpak-info")).isEmpty();
+ return QFileInfo::exists("/.flatpak-info"_L1) || qEnvironmentVariableIsSet("SNAP");
}
static bool shouldConnectIbusPortal()
{
// honor the same env as ibus-gtk
- return (checkRunningUnderFlatpak() || !qgetenv("IBUS_USE_PORTAL").isNull());
+ return (checkNeedPortalSupport() || qEnvironmentVariableIsSet("IBUS_USE_PORTAL"));
}
QIBusPlatformInputContextPrivate::QIBusPlatformInputContextPrivate()
- : connection(0),
- bus(0),
- portalBus(0),
- context(0),
- usePortal(shouldConnectIbusPortal()),
+ : usePortal(shouldConnectIbusPortal()),
valid(false),
busConnected(false),
needsSurroundingText(false)
@@ -648,42 +657,43 @@ QIBusPlatformInputContextPrivate::QIBusPlatformInputContextPrivate()
void QIBusPlatformInputContextPrivate::initBus()
{
- connection = createConnection();
+ createConnection();
busConnected = false;
createBusProxy();
}
void QIBusPlatformInputContextPrivate::createBusProxy()
{
- if (!connection || !connection->isConnected())
+ QDBusConnection connection("QIBusProxy"_L1);
+ if (!connection.isConnected())
return;
const char* ibusService = usePortal ? "org.freedesktop.portal.IBus" : "org.freedesktop.IBus";
QDBusReply<QDBusObjectPath> ic;
if (usePortal) {
- portalBus = new QIBusProxyPortal(QLatin1String(ibusService),
- QLatin1String("/org/freedesktop/IBus"),
- *connection);
+ portalBus = std::make_unique<QIBusProxyPortal>(QLatin1StringView(ibusService),
+ "/org/freedesktop/IBus"_L1,
+ connection);
if (!portalBus->isValid()) {
qWarning("QIBusPlatformInputContext: invalid portal bus.");
return;
}
- ic = portalBus->CreateInputContext(QLatin1String("QIBusInputContext"));
+ ic = portalBus->CreateInputContext("QIBusInputContext"_L1);
} else {
- bus = new QIBusProxy(QLatin1String(ibusService),
- QLatin1String("/org/freedesktop/IBus"),
- *connection);
+ bus = std::make_unique<QIBusProxy>(QLatin1StringView(ibusService),
+ "/org/freedesktop/IBus"_L1,
+ connection);
if (!bus->isValid()) {
qWarning("QIBusPlatformInputContext: invalid bus.");
return;
}
- ic = bus->CreateInputContext(QLatin1String("QIBusInputContext"));
+ ic = bus->CreateInputContext("QIBusInputContext"_L1);
}
serviceWatcher.removeWatchedService(ibusService);
- serviceWatcher.setConnection(*connection);
+ serviceWatcher.setConnection(connection);
serviceWatcher.addWatchedService(ibusService);
if (!ic.isValid()) {
@@ -691,7 +701,7 @@ void QIBusPlatformInputContextPrivate::createBusProxy()
return;
}
- context = new QIBusInputContextProxy(QLatin1String(ibusService), ic.value().path(), *connection);
+ context = std::make_unique<QIBusInputContextProxy>(QLatin1StringView(ibusService), ic.value().path(), connection);
if (!context->isValid()) {
qWarning("QIBusPlatformInputContext: invalid input context.");
@@ -708,6 +718,8 @@ void QIBusPlatformInputContextPrivate::createBusProxy()
};
context->SetCapabilities(IBUS_CAP_PREEDIT_TEXT|IBUS_CAP_FOCUS|IBUS_CAP_SURROUNDING_TEXT);
+ context->setClientCommitPreedit(QIBusPropTypeClientCommitPreedit(true));
+
if (debug)
qDebug(">>>> bus connected!");
busConnected = true;
@@ -748,19 +760,21 @@ QString QIBusPlatformInputContextPrivate::getSocketPath()
qDebug() << "host=" << host << "displayNumber" << displayNumber;
return QStandardPaths::writableLocation(QStandardPaths::ConfigLocation) +
- QLatin1String("/ibus/bus/") +
- QLatin1String(QDBusConnection::localMachineId()) +
- QLatin1Char('-') + QString::fromLocal8Bit(host) + QLatin1Char('-') + QString::fromLocal8Bit(displayNumber);
+ "/ibus/bus/"_L1 +
+ QLatin1StringView(QDBusConnection::localMachineId()) +
+ u'-' + QString::fromLocal8Bit(host) + u'-' + QString::fromLocal8Bit(displayNumber);
}
-QDBusConnection *QIBusPlatformInputContextPrivate::createConnection()
+void QIBusPlatformInputContextPrivate::createConnection()
{
- if (usePortal)
- return new QDBusConnection(QDBusConnection::connectToBus(QDBusConnection::SessionBus, QLatin1String("QIBusProxy")));
- QFile file(getSocketPath());
+ if (usePortal) {
+ QDBusConnection::connectToBus(QDBusConnection::SessionBus, "QIBusProxy"_L1);
+ return;
+ }
+ QFile file(getSocketPath());
if (!file.open(QFile::ReadOnly))
- return 0;
+ return;
QByteArray address;
int pid = -1;
@@ -779,9 +793,11 @@ QDBusConnection *QIBusPlatformInputContextPrivate::createConnection()
if (debug)
qDebug() << "IBUS_ADDRESS=" << address << "PID=" << pid;
if (address.isEmpty() || pid < 0 || kill(pid, 0) != 0)
- return 0;
+ return;
- return new QDBusConnection(QDBusConnection::connectToBus(QString::fromLatin1(address), QLatin1String("QIBusProxy")));
+ QDBusConnection::connectToBus(QString::fromLatin1(address), "QIBusProxy"_L1);
}
QT_END_NAMESPACE
+
+#include "moc_qibusplatforminputcontext.cpp"
diff --git a/src/plugins/platforminputcontexts/ibus/qibusplatforminputcontext.h b/src/plugins/platforminputcontexts/ibus/qibusplatforminputcontext.h
index e9c9c55f6a..ef8c0b7c8f 100644
--- a/src/plugins/platforminputcontexts/ibus/qibusplatforminputcontext.h
+++ b/src/plugins/platforminputcontexts/ibus/qibusplatforminputcontext.h
@@ -1,41 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** 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 The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/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 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#ifndef QIBUSPLATFORMINPUTCONTEXT_H
#define QIBUSPLATFORMINPUTCONTEXT_H
@@ -50,6 +14,8 @@
#include <QTimer>
#include <QWindow>
+#include "qibustypes.h"
+
QT_BEGIN_NAMESPACE
class QIBusPlatformInputContextPrivate;
@@ -102,6 +68,7 @@ public:
public Q_SLOTS:
void commitText(const QDBusVariant &text);
void updatePreeditText(const QDBusVariant &text, uint cursor_pos, bool visible);
+ void updatePreeditTextWithMode(const QDBusVariant &text, uint cursor_pos, bool visible, uint mode);
void forwardKeyEvent(uint keyval, uint keycode, uint state);
void cursorRectChanged();
void deleteSurroundingText(int offset, uint n_chars);
diff --git a/src/plugins/platforminputcontexts/ibus/qibusproxy.cpp b/src/plugins/platforminputcontexts/ibus/qibusproxy.cpp
index 9f6fbf4392..8f104a782d 100644
--- a/src/plugins/platforminputcontexts/ibus/qibusproxy.cpp
+++ b/src/plugins/platforminputcontexts/ibus/qibusproxy.cpp
@@ -98,3 +98,4 @@ void QIBusProxy::globalEngineChanged(const QString &engine_name)
emit GlobalEngineChanged(engine_name);
}
+#include "moc_qibusproxy.cpp"
diff --git a/src/plugins/platforminputcontexts/ibus/qibusproxy.h b/src/plugins/platforminputcontexts/ibus/qibusproxy.h
index c66e900664..73aff1a3d9 100644
--- a/src/plugins/platforminputcontexts/ibus/qibusproxy.h
+++ b/src/plugins/platforminputcontexts/ibus/qibusproxy.h
@@ -110,7 +110,7 @@ public Q_SLOTS: // METHODS
#endif
QIBusEngineDesc getGlobalEngine();
-private:
+private Q_SLOTS:
void globalEngineChanged(const QString &engine_name);
Q_SIGNALS: // SIGNALS
diff --git a/src/plugins/platforminputcontexts/ibus/qibusproxyportal.cpp b/src/plugins/platforminputcontexts/ibus/qibusproxyportal.cpp
index 50482e2d9a..dc5b37aa6e 100644
--- a/src/plugins/platforminputcontexts/ibus/qibusproxyportal.cpp
+++ b/src/plugins/platforminputcontexts/ibus/qibusproxyportal.cpp
@@ -2,7 +2,7 @@
* This file was generated by qdbusxml2cpp version 0.8
* Command line was: qdbusxml2cpp -N -p qibusproxyportal -c QIBusProxyPortal interfaces/org.freedesktop.IBus.Portal.xml
*
- * qdbusxml2cpp is Copyright (C) 2017 The Qt Company Ltd.
+ * qdbusxml2cpp is Copyright (C) 2023 The Qt Company Ltd and other contributors.
*
* This is an auto-generated file.
* This file may have been hand-edited. Look for HAND-EDIT comments
diff --git a/src/plugins/platforminputcontexts/ibus/qibusproxyportal.h b/src/plugins/platforminputcontexts/ibus/qibusproxyportal.h
index 4b921db814..450205f12a 100644
--- a/src/plugins/platforminputcontexts/ibus/qibusproxyportal.h
+++ b/src/plugins/platforminputcontexts/ibus/qibusproxyportal.h
@@ -2,7 +2,7 @@
* This file was generated by qdbusxml2cpp version 0.8
* Command line was: qdbusxml2cpp -N -p qibusproxyportal -c QIBusProxyPortal interfaces/org.freedesktop.IBus.Portal.xml
*
- * qdbusxml2cpp is Copyright (C) 2017 The Qt Company Ltd.
+ * qdbusxml2cpp is Copyright (C) 2023 The Qt Company Ltd and other contributors.
*
* This is an auto-generated file.
* Do not edit! All changes made to it will be lost.
@@ -11,15 +11,14 @@
#ifndef QIBUSPROXYPORTAL_H
#define QIBUSPROXYPORTAL_H
-#include <QObject>
-#include <QByteArray>
-#include <QList>
-#include <QMap>
-#include <QString>
-#include <QStringList>
-#include <QVariant>
-#include <QDBusAbstractInterface>
-#include <QDBusPendingReply>
+#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.freedesktop.IBus.Portal
diff --git a/src/plugins/platforminputcontexts/ibus/qibustypes.cpp b/src/plugins/platforminputcontexts/ibus/qibustypes.cpp
index eb1c0e3e06..ab1a244b6d 100644
--- a/src/plugins/platforminputcontexts/ibus/qibustypes.cpp
+++ b/src/plugins/platforminputcontexts/ibus/qibustypes.cpp
@@ -1,41 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** 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 The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/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 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#include "qibustypes.h"
@@ -214,7 +178,7 @@ QList<QInputMethodEvent::Attribute> QIBusAttributeList::imAttributes() const
QHash<QPair<int, int>, QTextCharFormat> rangeAttrs;
const int numAttributes = attributes.size();
- // Merge text fomats for identical ranges into a single QTextFormat.
+ // Merge text formats for identical ranges into a single QTextFormat.
for (int i = 0; i < numAttributes; ++i) {
const QIBusAttribute &attr = attributes.at(i);
const QTextCharFormat &format = attr.format();
@@ -358,4 +322,44 @@ newest:
argument.endStructure();
}
+QIBusPropTypeClientCommitPreedit::QIBusPropTypeClientCommitPreedit(bool inClientCommitPreedit)
+ : clientCommitPreedit(inClientCommitPreedit)
+{
+}
+
+void QIBusPropTypeClientCommitPreedit::serializeTo(QDBusArgument &argument) const
+{
+ argument.beginStructure();
+ argument << clientCommitPreedit;
+ argument.endStructure();
+}
+
+void QIBusPropTypeClientCommitPreedit::deserializeFrom(const QDBusArgument &argument)
+{
+ argument.beginStructure();
+ argument >> clientCommitPreedit;
+ argument.endStructure();
+}
+
+QIBusPropTypeContentType::QIBusPropTypeContentType(unsigned int inPurpose, unsigned int inHints)
+ : purpose(inPurpose)
+ , hints(inHints)
+{
+}
+
+void QIBusPropTypeContentType::serializeTo(QDBusArgument &argument) const
+{
+ argument.beginStructure();
+ argument << purpose << hints;
+ argument.endStructure();
+}
+
+void QIBusPropTypeContentType::deserializeFrom(const QDBusArgument &argument)
+{
+ argument.beginStructure();
+ argument >> purpose;
+ argument >> hints;
+ argument.endStructure();
+}
+
QT_END_NAMESPACE
diff --git a/src/plugins/platforminputcontexts/ibus/qibustypes.h b/src/plugins/platforminputcontexts/ibus/qibustypes.h
index ef2dcc341a..b697e432a0 100644
--- a/src/plugins/platforminputcontexts/ibus/qibustypes.h
+++ b/src/plugins/platforminputcontexts/ibus/qibustypes.h
@@ -1,41 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** 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 The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/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 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#ifndef QIBUSTYPES_H
#define QIBUSTYPES_H
@@ -169,6 +133,44 @@ inline QDBusArgument &operator<<(QDBusArgument &argument, const QIBusEngineDesc
inline const QDBusArgument &operator>>(const QDBusArgument &argument, QIBusEngineDesc &desc)
{ desc.deserializeFrom(argument); return argument; }
+class QIBusPropTypeClientCommitPreedit
+{
+public:
+ QIBusPropTypeClientCommitPreedit() {};
+
+ QIBusPropTypeClientCommitPreedit(bool inClientCommitPreedit);
+
+ void serializeTo(QDBusArgument &argument) const;
+ void deserializeFrom(const QDBusArgument &argument);
+
+ bool clientCommitPreedit;
+};
+inline QDBusArgument &operator<<(QDBusArgument &argument, const QIBusPropTypeClientCommitPreedit &data)
+{ data.serializeTo(argument); return argument; }
+inline const QDBusArgument &operator>>(const QDBusArgument &argument, QIBusPropTypeClientCommitPreedit &data)
+{ data.deserializeFrom(argument); return argument; }
+
+class QIBusPropTypeContentType
+{
+public:
+ QIBusPropTypeContentType() {};
+
+ QIBusPropTypeContentType(unsigned int inPurpose, unsigned int inHint);
+
+ void serializeTo(QDBusArgument &argument) const;
+ void deserializeFrom(const QDBusArgument &argument);
+
+ unsigned int purpose;
+ unsigned int hints;
+};
+inline QDBusArgument &operator<<(QDBusArgument &argument, const QIBusPropTypeContentType &data)
+{ data.serializeTo(argument); return argument; }
+inline const QDBusArgument &operator>>(const QDBusArgument &argument, QIBusPropTypeContentType &data)
+{ data.deserializeFrom(argument); return argument; }
+
+Q_DECLARE_TYPEINFO(QIBusPropTypeClientCommitPreedit, Q_RELOCATABLE_TYPE);
+Q_DECLARE_TYPEINFO(QIBusPropTypeContentType, Q_RELOCATABLE_TYPE);
+
QT_END_NAMESPACE
Q_DECLARE_METATYPE(QIBusAttribute)
@@ -176,4 +178,6 @@ Q_DECLARE_METATYPE(QIBusAttributeList)
Q_DECLARE_METATYPE(QIBusText)
Q_DECLARE_METATYPE(QIBusEngineDesc)
+Q_DECLARE_METATYPE(QIBusPropTypeClientCommitPreedit)
+Q_DECLARE_METATYPE(QIBusPropTypeContentType)
#endif