aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/thai
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/thai')
-rw-r--r--src/plugins/thai/CMakeLists.txt53
-rw-r--r--src/plugins/thai/plugin/.prev_CMakeLists.txt58
-rw-r--r--src/plugins/thai/plugin/CMakeLists.txt58
-rw-r--r--src/plugins/thai/plugin/plugin.pro50
-rw-r--r--src/plugins/thai/plugin/thai.json6
-rw-r--r--src/plugins/thai/plugin/thaiinputmethod_p.h65
-rw-r--r--src/plugins/thai/plugin/thaiplugin.cpp43
-rw-r--r--src/plugins/thai/plugin/thaiplugin.h49
-rw-r--r--src/plugins/thai/thai.pro4
-rw-r--r--src/plugins/thai/thaiinputmethod.cpp (renamed from src/plugins/thai/plugin/thaiinputmethod.cpp)32
-rw-r--r--src/plugins/thai/thaiinputmethod_p.h42
11 files changed, 96 insertions, 364 deletions
diff --git a/src/plugins/thai/CMakeLists.txt b/src/plugins/thai/CMakeLists.txt
index c70b9a73..64b7b440 100644
--- a/src/plugins/thai/CMakeLists.txt
+++ b/src/plugins/thai/CMakeLists.txt
@@ -1,3 +1,52 @@
-# Generated from thai.pro.
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
-add_subdirectory(plugin)
+#####################################################################
+## QtVirtualKeyboardThaiPlugin Plugin:
+#####################################################################
+
+qt_internal_add_qml_module(qtvkbthaiplugin
+ URI "QtQuick.VirtualKeyboard.Plugins.Thai"
+ VERSION "${PROJECT_VERSION}"
+ PAST_MAJOR_VERSIONS 2
+ PLUGIN_TARGET qtvkbthaiplugin
+ NO_PLUGIN_OPTIONAL
+ DEPENDENCIES
+ QtQuick.VirtualKeyboard/auto
+ SOURCES
+ thaiinputmethod.cpp thaiinputmethod_p.h
+ DEFINES
+ QT_ASCII_CAST_WARNINGS
+ QT_NO_CAST_FROM_ASCII
+ QT_NO_CAST_FROM_BYTEARRAY
+ QT_NO_CAST_TO_ASCII
+ LIBRARIES
+ Qt::Core
+ Qt::Gui
+ Qt::Qml
+ Qt::VirtualKeyboard
+ NO_GENERATE_CPP_EXPORTS
+)
+
+# Resources:
+set(qmake_virtualkeyboard_thai_layouts_resource_files
+ "${VKB_LAYOUTS_BASE}/th_TH/dialpad.fallback"
+ "${VKB_LAYOUTS_BASE}/th_TH/digits.fallback"
+ "${VKB_LAYOUTS_BASE}/th_TH/main.qml"
+ "${VKB_LAYOUTS_BASE}/th_TH/numbers.fallback"
+ "${VKB_LAYOUTS_BASE}/th_TH/symbols.qml"
+)
+
+qt_internal_add_resource(qtvkbthaiplugin "qmake_virtualkeyboard_thai_layouts"
+ PREFIX
+ "${VKB_LAYOUTS_PREFIX}"
+ BASE
+ "${VKB_LAYOUTS_BASE}"
+ FILES
+ ${qmake_virtualkeyboard_thai_layouts_resource_files}
+)
+
+qt_internal_extend_target(qtvkbthaiplugin CONDITION QT_FEATURE_hunspell
+ LIBRARIES
+ Qt::HunspellInputMethodPrivate
+)
diff --git a/src/plugins/thai/plugin/.prev_CMakeLists.txt b/src/plugins/thai/plugin/.prev_CMakeLists.txt
deleted file mode 100644
index 36694722..00000000
--- a/src/plugins/thai/plugin/.prev_CMakeLists.txt
+++ /dev/null
@@ -1,58 +0,0 @@
-# Generated from plugin.pro.
-
-#####################################################################
-## QtVirtualKeyboardThaiPlugin Plugin:
-#####################################################################
-
-qt_internal_add_plugin(QtVirtualKeyboardThaiPlugin
- OUTPUT_NAME qtvirtualkeyboard_thai
- TYPE virtualkeyboard
- SOURCES
- thaiinputmethod.cpp thaiinputmethod_p.h
- thaiplugin.cpp thaiplugin.h
- DEFINES
- QT_ASCII_CAST_WARNINGS
- QT_NO_CAST_FROM_ASCII
- QT_NO_CAST_FROM_BYTEARRAY
- QT_NO_CAST_TO_ASCII
- PUBLIC_LIBRARIES
- Qt::Core
- Qt::Gui
- Qt::Qml
- Qt::VirtualKeyboard
-)
-
-# Resources:
-set(qmake_virtualkeyboard_thai_layouts_resource_files
- "virtualkeyboard/content/layouts/th_TH/dialpad.fallback"
- "virtualkeyboard/content/layouts/th_TH/digits.fallback"
- "virtualkeyboard/content/layouts/th_TH/main.qml"
- "virtualkeyboard/content/layouts/th_TH/numbers.fallback"
- "virtualkeyboard/content/layouts/th_TH/symbols.qml"
-)
-
-qt_add_resource(QtVirtualKeyboardThaiPlugin "qmake_virtualkeyboard_thai_layouts"
- PREFIX
- "$$LAYOUTS_PREFIX"
- BASE
- "$$LAYOUTS_BASE"
- FILES
- ${qmake_virtualkeyboard_thai_layouts_resource_files}
-)
-
-
-#### Keys ignored in scope 1:.:.:plugin.pro:<TRUE>:
-# OTHER_FILES = "thai.json" "$$LAYOUT_FILES"
-# QT_FOR_CONFIG = "virtualkeyboard-private"
-
-## Scopes:
-#####################################################################
-
-qt_extend_target(QtVirtualKeyboardThaiPlugin CONDITION QT_FEATURE_hunspell
- PUBLIC_LIBRARIES
- Qt::HunspellInputMethodPrivate
-)
-
-#### Keys ignored in scope 3:.:.:plugin.pro:WIN32:
-# QMAKE_TARGET_DESCRIPTION = "Virtual Keyboard Extension for Qt."
-# QMAKE_TARGET_PRODUCT = "Qt Virtual Keyboard Thai (Qt $$QT_VERSION)"
diff --git a/src/plugins/thai/plugin/CMakeLists.txt b/src/plugins/thai/plugin/CMakeLists.txt
deleted file mode 100644
index 846e1ea0..00000000
--- a/src/plugins/thai/plugin/CMakeLists.txt
+++ /dev/null
@@ -1,58 +0,0 @@
-# Generated from plugin.pro.
-
-#####################################################################
-## QtVirtualKeyboardThaiPlugin Plugin:
-#####################################################################
-
-qt_internal_add_plugin(QtVirtualKeyboardThaiPlugin
- OUTPUT_NAME qtvirtualkeyboard_thai
- TYPE virtualkeyboard
- SOURCES
- thaiinputmethod.cpp thaiinputmethod_p.h
- thaiplugin.cpp thaiplugin.h
- DEFINES
- QT_ASCII_CAST_WARNINGS
- QT_NO_CAST_FROM_ASCII
- QT_NO_CAST_FROM_BYTEARRAY
- QT_NO_CAST_TO_ASCII
- PUBLIC_LIBRARIES
- Qt::Core
- Qt::Gui
- Qt::Qml
- Qt::VirtualKeyboard
-)
-
-# Resources:
-set(qmake_virtualkeyboard_thai_layouts_resource_files
- "virtualkeyboard/content/layouts/th_TH/dialpad.fallback"
- "virtualkeyboard/content/layouts/th_TH/digits.fallback"
- "virtualkeyboard/content/layouts/th_TH/main.qml"
- "virtualkeyboard/content/layouts/th_TH/numbers.fallback"
- "virtualkeyboard/content/layouts/th_TH/symbols.qml"
-)
-
-qt_add_resource(QtVirtualKeyboardThaiPlugin "qmake_virtualkeyboard_thai_layouts"
- PREFIX
- "${VKB_LAYOUTS_PREFIX}" #special case
- BASE
- "${VKB_LAYOUTS_BASE}" #special case
- FILES
- ${qmake_virtualkeyboard_thai_layouts_resource_files}
-)
-
-
-#### Keys ignored in scope 1:.:.:plugin.pro:<TRUE>:
-# OTHER_FILES = "thai.json" "$$LAYOUT_FILES"
-# QT_FOR_CONFIG = "virtualkeyboard-private"
-
-## Scopes:
-#####################################################################
-
-qt_extend_target(QtVirtualKeyboardThaiPlugin CONDITION QT_FEATURE_hunspell
- PUBLIC_LIBRARIES
- Qt::HunspellInputMethodPrivate
-)
-
-#### Keys ignored in scope 3:.:.:plugin.pro:WIN32:
-# QMAKE_TARGET_DESCRIPTION = "Virtual Keyboard Extension for Qt."
-# QMAKE_TARGET_PRODUCT = "Qt Virtual Keyboard Thai (Qt $$QT_VERSION)"
diff --git a/src/plugins/thai/plugin/plugin.pro b/src/plugins/thai/plugin/plugin.pro
deleted file mode 100644
index dd756029..00000000
--- a/src/plugins/thai/plugin/plugin.pro
+++ /dev/null
@@ -1,50 +0,0 @@
-TARGET = qtvirtualkeyboard_thai
-QT += qml virtualkeyboard
-
-QT_FOR_CONFIG += virtualkeyboard-private
-
-include(../../../shared.pri)
-
-HEADERS += \
- thaiinputmethod_p.h \
- thaiplugin.h
-SOURCES += \
- thaiinputmethod.cpp \
- thaiplugin.cpp
-OTHER_FILES += \
- thai.json
-
-DEFINES += \
- QT_NO_CAST_TO_ASCII \
- QT_ASCII_CAST_WARNINGS \
- QT_NO_CAST_FROM_ASCII \
- QT_NO_CAST_FROM_BYTEARRAY
-
-
-qtConfig(hunspell) {
- QT += hunspellinputmethod-private
-}
-
-LAYOUT_FILES += \
- $$LAYOUTS_BASE/content/layouts/th_TH/dialpad.fallback \
- $$LAYOUTS_BASE/content/layouts/th_TH/digits.fallback \
- $$LAYOUTS_BASE/content/layouts/th_TH/main.qml \
- $$LAYOUTS_BASE/content/layouts/th_TH/numbers.fallback \
- $$LAYOUTS_BASE/content/layouts/th_TH/symbols.qml
-
-OTHER_FILES += \
- $$LAYOUT_FILES
-
-virtualkeyboard_thai_layouts.files = $$LAYOUT_FILES
-virtualkeyboard_thai_layouts.base = $$LAYOUTS_BASE
-virtualkeyboard_thai_layouts.prefix = $$LAYOUTS_PREFIX
-RESOURCES += virtualkeyboard_thai_layouts
-
-win32 {
- QMAKE_TARGET_PRODUCT = "Qt Virtual Keyboard Thai (Qt $$QT_VERSION)"
- QMAKE_TARGET_DESCRIPTION = "Virtual Keyboard Extension for Qt."
-}
-
-PLUGIN_TYPE = virtualkeyboard
-PLUGIN_CLASS_NAME = QtVirtualKeyboardThaiPlugin
-load(qt_plugin)
diff --git a/src/plugins/thai/plugin/thai.json b/src/plugins/thai/plugin/thai.json
deleted file mode 100644
index aac036cb..00000000
--- a/src/plugins/thai/plugin/thai.json
+++ /dev/null
@@ -1,6 +0,0 @@
-{
- "Name": "thai",
- "Provider": "Qt Thai Extension",
- "InputMethod": "ThaiInputMethod",
- "Version": 100
-}
diff --git a/src/plugins/thai/plugin/thaiinputmethod_p.h b/src/plugins/thai/plugin/thaiinputmethod_p.h
deleted file mode 100644
index ef1dd547..00000000
--- a/src/plugins/thai/plugin/thaiinputmethod_p.h
+++ /dev/null
@@ -1,65 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2018 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the Qt Virtual Keyboard module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** 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 or (at your option) 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.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-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef THAIINPUTMETHOD_H
-#define THAIINPUTMETHOD_H
-
-#ifdef QT_HUNSPELLINPUTMETHOD_LIB
-#include <QtHunspellInputMethod/private/hunspellinputmethod_p.h>
-#define ThaiInputMethodBase HunspellInputMethod
-#else
-#include <QtVirtualKeyboard/qvirtualkeyboardabstractinputmethod.h>
-#define ThaiInputMethodBase QVirtualKeyboardAbstractInputMethod
-#endif
-
-QT_BEGIN_NAMESPACE
-namespace QtVirtualKeyboard {
-
-class ThaiInputMethodPrivate;
-
-class ThaiInputMethod : public ThaiInputMethodBase
-{
- Q_OBJECT
- Q_DECLARE_PRIVATE(ThaiInputMethod)
-public:
- explicit ThaiInputMethod(QObject *parent = nullptr);
-
-#ifndef QT_HUNSPELLINPUTMETHOD_LIB
- QList<QVirtualKeyboardInputEngine::InputMode> inputModes(const QString &locale) override;
- bool setInputMode(const QString &locale, QVirtualKeyboardInputEngine::InputMode inputMode) override;
- bool setTextCase(QVirtualKeyboardInputEngine::TextCase textCase) override;
-#endif
-
- bool keyEvent(Qt::Key key, const QString &text, Qt::KeyboardModifiers modifiers) override;
-};
-
-} // namespace QtVirtualKeyboard
-QT_END_NAMESPACE
-
-#endif
diff --git a/src/plugins/thai/plugin/thaiplugin.cpp b/src/plugins/thai/plugin/thaiplugin.cpp
deleted file mode 100644
index 1f9428fc..00000000
--- a/src/plugins/thai/plugin/thaiplugin.cpp
+++ /dev/null
@@ -1,43 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2018 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the Qt Virtual Keyboard module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** 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 or (at your option) 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.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-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "thaiplugin.h"
-#include "thaiinputmethod_p.h"
-#include <QtQml>
-
-QT_BEGIN_NAMESPACE
-
-using namespace QtVirtualKeyboard;
-
-void QtVirtualKeyboardThaiPlugin::registerTypes(const char *uri) const
-{
- qmlRegisterType<ThaiInputMethod>(uri, 2, 3, "ThaiInputMethod");
-}
-
-QT_END_NAMESPACE
diff --git a/src/plugins/thai/plugin/thaiplugin.h b/src/plugins/thai/plugin/thaiplugin.h
deleted file mode 100644
index 6af272cb..00000000
--- a/src/plugins/thai/plugin/thaiplugin.h
+++ /dev/null
@@ -1,49 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2018 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the Qt Virtual Keyboard module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** 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 or (at your option) 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.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-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef THAIPLUGIN_H
-#define THAIPLUGIN_H
-
-#include <QVirtualKeyboardExtensionPlugin>
-
-QT_BEGIN_NAMESPACE
-
-class QtVirtualKeyboardThaiPlugin : public QVirtualKeyboardExtensionPlugin
-{
- Q_OBJECT
- Q_INTERFACES(QVirtualKeyboardExtensionPlugin)
- Q_PLUGIN_METADATA(IID QVirtualKeyboardExtensionPluginFactoryInterface_iid
- FILE "thai.json")
-public:
- void registerTypes(const char *uri) const override;
-};
-
-QT_END_NAMESPACE
-
-#endif
diff --git a/src/plugins/thai/thai.pro b/src/plugins/thai/thai.pro
deleted file mode 100644
index b6e92972..00000000
--- a/src/plugins/thai/thai.pro
+++ /dev/null
@@ -1,4 +0,0 @@
-TEMPLATE = subdirs
-
-SUBDIRS += \
- plugin
diff --git a/src/plugins/thai/plugin/thaiinputmethod.cpp b/src/plugins/thai/thaiinputmethod.cpp
index f4e9663e..670b7958 100644
--- a/src/plugins/thai/plugin/thaiinputmethod.cpp
+++ b/src/plugins/thai/thaiinputmethod.cpp
@@ -1,31 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2018 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the Qt Virtual Keyboard module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:GPL$
-** 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 or (at your option) 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.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-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2018 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
#include "thaiinputmethod_p.h"
#include <QtVirtualKeyboard/qvirtualkeyboardinputengine.h>
@@ -71,7 +45,7 @@ bool ThaiInputMethod::keyEvent(Qt::Key key,
const QString &text,
Qt::KeyboardModifiers modifiers)
{
- const bool isMark = text.length() == 2 && text.at(0) == QLatin1Char(' ');
+ const bool isMark = text.size() == 2 && text.at(0) == QLatin1Char(' ');
#ifdef QT_HUNSPELLINPUTMETHOD_LIB
if (isMark) {
const QString mark(text.right(1));
diff --git a/src/plugins/thai/thaiinputmethod_p.h b/src/plugins/thai/thaiinputmethod_p.h
new file mode 100644
index 00000000..af1f4217
--- /dev/null
+++ b/src/plugins/thai/thaiinputmethod_p.h
@@ -0,0 +1,42 @@
+// Copyright (C) 2018 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
+
+#ifndef THAIINPUTMETHOD_H
+#define THAIINPUTMETHOD_H
+
+#ifdef QT_HUNSPELLINPUTMETHOD_LIB
+#include <QtHunspellInputMethod/private/hunspellinputmethod_p.h>
+#define ThaiInputMethodBase HunspellInputMethod
+#else
+#include <QtVirtualKeyboard/qvirtualkeyboardabstractinputmethod.h>
+#define ThaiInputMethodBase QVirtualKeyboardAbstractInputMethod
+#endif
+
+QT_BEGIN_NAMESPACE
+namespace QtVirtualKeyboard {
+
+class ThaiInputMethodPrivate;
+
+class ThaiInputMethod : public ThaiInputMethodBase
+{
+ Q_OBJECT
+ Q_DECLARE_PRIVATE(ThaiInputMethod)
+ QML_ELEMENT
+ QML_ADDED_IN_VERSION(2, 0)
+
+public:
+ explicit ThaiInputMethod(QObject *parent = nullptr);
+
+#ifndef QT_HUNSPELLINPUTMETHOD_LIB
+ QList<QVirtualKeyboardInputEngine::InputMode> inputModes(const QString &locale) override;
+ bool setInputMode(const QString &locale, QVirtualKeyboardInputEngine::InputMode inputMode) override;
+ bool setTextCase(QVirtualKeyboardInputEngine::TextCase textCase) override;
+#endif
+
+ bool keyEvent(Qt::Key key, const QString &text, Qt::KeyboardModifiers modifiers) override;
+};
+
+} // namespace QtVirtualKeyboard
+QT_END_NAMESPACE
+
+#endif