summaryrefslogtreecommitdiffstats
path: root/tests/auto/client/shared
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@qt.io>2021-10-21 14:10:33 +0200
committerLiang Qi <liang.qi@qt.io>2021-11-09 12:07:31 +0000
commitcac38b4c15cf64d44920eb301acdafd768d969a3 (patch)
tree25a20792204a5f41b109506959902651182d020c /tests/auto/client/shared
parentd6d67aa9e9946c0ee3a68bd21b1501cd831d0a13 (diff)
tests: add test for multiple text input
Change-Id: Ief343ebf9d0d6d00533eb3c698c416f4205bbfac Reviewed-by: Inho Lee <inho.lee@qt.io>
Diffstat (limited to 'tests/auto/client/shared')
-rw-r--r--tests/auto/client/shared/CMakeLists.txt3
-rw-r--r--tests/auto/client/shared/qttextinput.cpp45
-rw-r--r--tests/auto/client/shared/qttextinput.h51
3 files changed, 99 insertions, 0 deletions
diff --git a/tests/auto/client/shared/CMakeLists.txt b/tests/auto/client/shared/CMakeLists.txt
index 2ce9c23a3..b028dff16 100644
--- a/tests/auto/client/shared/CMakeLists.txt
+++ b/tests/auto/client/shared/CMakeLists.txt
@@ -10,6 +10,7 @@ qt_manual_moc(moc_files
fullscreenshellv1.h
iviapplication.h
textinput.h
+ qttextinput.h
xdgoutputv1.h
xdgshell.h
)
@@ -23,6 +24,7 @@ add_library(SharedClientTest
iviapplication.cpp iviapplication.h
mockcompositor.cpp mockcompositor.h
textinput.cpp textinput.h
+ qttextinput.cpp qttextinput.h
xdgoutputv1.cpp xdgoutputv1.h
xdgshell.cpp xdgshell.h
${moc_files}
@@ -35,6 +37,7 @@ qt6_generate_wayland_protocol_server_sources(SharedClientTest
${PROJECT_SOURCE_DIR}/src/3rdparty/protocol/wp-primary-selection-unstable-v1.xml
${PROJECT_SOURCE_DIR}/src/3rdparty/protocol/tablet-unstable-v2.xml
${PROJECT_SOURCE_DIR}/src/3rdparty/protocol/text-input-unstable-v2.xml
+ ${PROJECT_SOURCE_DIR}/src/extensions/qt-text-input-method-unstable-v1.xml
${PROJECT_SOURCE_DIR}/src/3rdparty/protocol/wayland.xml
${PROJECT_SOURCE_DIR}/src/3rdparty/protocol/xdg-decoration-unstable-v1.xml
${PROJECT_SOURCE_DIR}/src/3rdparty/protocol/xdg-output-unstable-v1.xml
diff --git a/tests/auto/client/shared/qttextinput.cpp b/tests/auto/client/shared/qttextinput.cpp
new file mode 100644
index 000000000..5cd9a6b61
--- /dev/null
+++ b/tests/auto/client/shared/qttextinput.cpp
@@ -0,0 +1,45 @@
+/****************************************************************************
+**
+** Copyright (C) 2021 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:GPL-EXCEPT$
+** 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 General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3 as published by the Free Software
+** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
+** 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-3.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qttextinput.h"
+
+namespace MockCompositor {
+
+QtTextInputManager::QtTextInputManager(CoreCompositor *compositor)
+{
+ init(compositor->m_display, 1);
+}
+
+void QtTextInputManager::text_input_method_manager_v1_get_text_input_method(Resource *resource, uint32_t id, wl_resource *seatResource)
+{
+ Q_UNUSED(resource);
+ Q_UNUSED(id);
+ Q_UNUSED(seatResource);
+}
+
+} // namespace MockCompositor
diff --git a/tests/auto/client/shared/qttextinput.h b/tests/auto/client/shared/qttextinput.h
new file mode 100644
index 000000000..525711cce
--- /dev/null
+++ b/tests/auto/client/shared/qttextinput.h
@@ -0,0 +1,51 @@
+/****************************************************************************
+**
+** Copyright (C) 2021 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:GPL-EXCEPT$
+** 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 General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3 as published by the Free Software
+** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
+** 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-3.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef MOCKCOMPOSITOR_QTTEXTINPUT_H
+#define MOCKCOMPOSITOR_QTTEXTINPUT_H
+
+#include "coreprotocol.h"
+#include <qwayland-server-qt-text-input-method-unstable-v1.h>
+
+#include <QtGui/qpa/qplatformnativeinterface.h>
+
+namespace MockCompositor {
+
+class QtTextInputManager : public Global, public QtWaylandServer::qt_text_input_method_manager_v1
+{
+ Q_OBJECT
+public:
+ QtTextInputManager(CoreCompositor *compositor);
+
+protected:
+ void text_input_method_manager_v1_get_text_input_method(Resource *resource, uint32_t id, struct ::wl_resource *seatResource) override;
+};
+
+} // namespace MockCompositor
+
+#endif // MOCKCOMPOSITOR_QTTEXTINPUT_H