diff options
author | Jarkko Koivikko <jarkko.koivikko@code-q.fi> | 2017-04-17 11:04:04 +0300 |
---|---|---|
committer | Jarkko Koivikko <jarkko.koivikko@code-q.fi> | 2017-07-08 19:28:08 +0000 |
commit | 7f780a44c0d5ccc65880666dcf388ed6bd3769a8 (patch) | |
tree | 7a139b5c4478154ba3a509c3ca2b4bf0d96203ff /tests/auto | |
parent | 0bf1c6ad9e0b5572b8ea99f5fc8945dade5675b7 (diff) |
Add support for T9 Write CJK
This change adds support for handwriting in Simplified Chinese.
The integration is based on T9 Write CJK SDK v7.8.1.
[ChangeLog] Added support for CJK (Chinese/Japanese/Korean) handwriting
via T9 Write.
Change-Id: I18481cfd897987ecb471c49ecfcac62ea0c3489c
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Reviewed-by: Liang Qi <liang.qi@qt.io>
Diffstat (limited to 'tests/auto')
9 files changed, 2617 insertions, 224 deletions
diff --git a/tests/auto/inputpanel/data/inputpanel/handwriting.js b/tests/auto/inputpanel/data/inputpanel/handwriting.js index 5f5fd4bc..7ec5e179 100644 --- a/tests/auto/inputpanel/data/inputpanel/handwriting.js +++ b/tests/auto/inputpanel/data/inputpanel/handwriting.js @@ -30,17 +30,23 @@ .pragma library .import "unipen_data.js" as UnipenData +.import "unipen_data_simp_chinese.js" as UnipenDataSimpChinese function emulate(testcase, hwrInputArea, ch, instant) { var chKey = (((typeof ch == "number") ? ch : ch.charCodeAt(0)) + 0x100000000).toString(16).substr(1) while (chKey.length > 4 && chKey[0] === '0') chKey = chKey.substring(1) chKey = "0x" + chKey - if (!UnipenData.unipenData.hasOwnProperty(chKey)) + var unipenData + if (UnipenData.unipenData.hasOwnProperty(chKey)) + unipenData = UnipenData + else if (UnipenDataSimpChinese.unipenData.hasOwnProperty(chKey)) + unipenData = UnipenDataSimpChinese + else return false - var chData = UnipenData.unipenData[chKey] + var chData = unipenData.unipenData[chKey] var scale = Math.min(hwrInputArea.width / chData[".X_DIM"], hwrInputArea.height / chData[".Y_DIM"]) - var strokes = UnipenData.unipenData[chKey][".PEN"] + var strokes = unipenData.unipenData[chKey][".PEN"] var t = 0 for (var strokeIndex = 0; strokeIndex < strokes.length; strokeIndex++) { var stroke = strokes[strokeIndex] diff --git a/tests/auto/inputpanel/data/inputpanel/inputpanel.qml b/tests/auto/inputpanel/data/inputpanel/inputpanel.qml index f082115a..05667524 100644 --- a/tests/auto/inputpanel/data/inputpanel/inputpanel.qml +++ b/tests/auto/inputpanel/data/inputpanel/inputpanel.qml @@ -29,7 +29,7 @@ import QtTest 1.0 import QtQuick 2.0 -import QtQuick.VirtualKeyboard 2.2 +import QtQuick.VirtualKeyboard 2.3 import QtQuick.VirtualKeyboard.Settings 2.2 import "handwriting.js" as Handwriting import "utils.js" as Utils @@ -263,6 +263,8 @@ InputPanel { return InputEngine.Katakana else if (inputModeName === "FullwidthLatin") return InputEngine.FullwidthLatin + else if (inputModeName === "ChineseHandwriting") + return InputEngine.ChineseHandwriting else return -1 } diff --git a/tests/auto/inputpanel/data/inputpanel/unipen_data.js b/tests/auto/inputpanel/data/inputpanel/unipen_data.js index 4c69b43d..83ad1a2c 100644 --- a/tests/auto/inputpanel/data/inputpanel/unipen_data.js +++ b/tests/auto/inputpanel/data/inputpanel/unipen_data.js @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2016 The Qt Company Ltd. +** Copyright (C) 2017 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the Qt Virtual Keyboard module of the Qt Toolkit. @@ -10170,239 +10170,339 @@ var unipenData = { ".PEN": [ [ [ - 435, - 78, + 407, + 75, 0 ], [ - 435, - 77, - 13 - ], - [ - 435, - 76, - 33 - ], - [ - 435, - 75, - 70 + 406, + 74, + 76 ], [ - 434, + 403, 74, - 84 + 96 ], [ - 434, + 401, 73, - 109 + 100 ], [ - 431, - 70, - 130 + 395, + 73, + 128 ], [ - 417, - 65, - 156 + 392, + 73, + 129 ], [ - 407, - 65, - 174 + 388, + 73, + 131 ], [ 385, - 70, - 194 + 73, + 162 ], [ - 377, + 375, 73, - 214 + 162 ], [ - 361, - 83, - 238 + 370, + 75, + 163 ], [ - 355, - 88, - 247 + 360, + 78, + 195 ], [ 349, - 100, - 275 + 85, + 196 ], [ - 354, - 113, - 310 + 342, + 91, + 228 ], [ - 360, - 117, - 338 + 338, + 98, + 229 ], [ - 368, - 120, - 357 + 337, + 107, + 261 ], [ - 379, - 120, - 377 + 337, + 115, + 261 ], [ - 408, - 110, - 412 + 342, + 125, + 294 ], [ - 414, - 105, - 437 + 347, + 133, + 295 ], [ - 423, - 95, - 462 + 351, + 135, + 299 ], [ - 424, - 91, - 484 + 353, + 139, + 328 ], [ - 426, - 87, - 511 + 359, + 143, + 329 ], [ - 426, - 83, - 541 + 363, + 144, + 331 ], [ - 427, - 81, + 365, + 145, + 361 + ], + [ + 369, + 148, + 362 + ], + [ + 371, + 148, + 363 + ], + [ + 372, + 148, + 395 + ], + [ + 376, + 146, + 396 + ], + [ + 382, + 143, + 427 + ], + [ + 387, + 137, + 428 + ], + [ + 391, + 129, + 461 + ], + [ + 395, + 123, + 461 + ], + [ + 400, + 118, + 494 + ], + [ + 401, + 113, + 494 + ], + [ + 402, + 108, + 527 + ], + [ + 404, + 103, + 528 + ], + [ + 406, + 99, + 531 + ], + [ + 406, + 96, + 561 + ], + [ + 408, + 90, + 561 + ], + [ + 408, + 88, 564 ], [ - 426, - 80, - 591 + 408, + 86, + 593 ], [ - 427, - 79, - 648 + 409, + 84, + 594 ], [ - 427, + 409, + 83, + 627 + ], + [ + 409, + 82, + 661 + ], + [ + 409, 81, - 698 + 694 ], [ - 427, + 409, 83, - 722 + 844 ], [ - 428, - 90, - 741 + 409, + 89, + 878 ], [ - 430, + 409, + 93, + 879 + ], + [ + 409, 98, - 760 + 884 ], [ - 432, - 118, - 788 + 408, + 103, + 910 ], [ - 434, - 129, - 797 + 407, + 118, + 911 ], [ - 436, - 151, - 829 + 407, + 135, + 943 ], [ - 436, - 160, - 844 + 407, + 157, + 944 ], [ - 437, + 407, 166, - 863 + 948 ], [ - 437, - 171, - 899 + 409, + 175, + 976 ], [ - 437, - 173, - 921 + 410, + 186, + 977 ], [ - 437, - 176, - 938 + 410, + 191, + 979 ], [ - 437, - 177, - 964 + 411, + 196, + 1009 ], [ - 437, - 178, - 985 + 411, + 203, + 1010 ], [ - 437, - 179, - 1013 + 413, + 207, + 1011 ], [ - 437, - 180, - 1032 + 413, + 211, + 1042 ], [ - 437, - 181, - 1101 + 413, + 223, + 1043 ], [ - 438, - 181, - 1136 + 413, + 230, + 1076 + ], + [ + 413, + 234, + 1077 + ], + [ + 413, + 235, + 1109 + ], + [ + 413, + 236, + 1110 ] ] ], ".POINTS_PER_SECOND": 60, ".SEGMENT": "CHARACTER", ".VERSION": "1.0", - ".X_DIM": 821, - ".X_POINTS_PER_INCH": 100, - ".Y_DIM": 211, - ".Y_POINTS_PER_INCH": 100 + ".X_DIM": 1032, + ".X_POINTS_PER_INCH": 95, + ".Y_DIM": 263, + ".Y_POINTS_PER_INCH": 95 }, "0x0072": { ".COORD": [ diff --git a/tests/auto/inputpanel/data/inputpanel/unipen_data_simp_chinese.js b/tests/auto/inputpanel/data/inputpanel/unipen_data_simp_chinese.js new file mode 100644 index 00000000..b5942e6b --- /dev/null +++ b/tests/auto/inputpanel/data/inputpanel/unipen_data_simp_chinese.js @@ -0,0 +1,1851 @@ +/**************************************************************************** +** +** Copyright (C) 2017 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$ +** +****************************************************************************/ + +var unipenData = { + "0x4e2d": { + ".COORD": [ + "X", + "Y", + "T" + ], + ".HIERARCHY": "CHARACTER", + ".PEN": [ + [ + [ + 185, + 59, + 0 + ], + [ + 185, + 61, + 181 + ], + [ + 185, + 63, + 202 + ], + [ + 185, + 65, + 205 + ], + [ + 185, + 68, + 235 + ], + [ + 185, + 70, + 236 + ], + [ + 185, + 73, + 236 + ], + [ + 185, + 75, + 268 + ], + [ + 185, + 80, + 269 + ], + [ + 185, + 84, + 301 + ], + [ + 185, + 87, + 302 + ], + [ + 185, + 89, + 334 + ], + [ + 185, + 92, + 335 + ], + [ + 185, + 94, + 368 + ], + [ + 184, + 97, + 369 + ], + [ + 184, + 98, + 372 + ], + [ + 184, + 99, + 401 + ], + [ + 184, + 101, + 402 + ], + [ + 184, + 102, + 405 + ], + [ + 184, + 104, + 434 + ], + [ + 184, + 105, + 467 + ], + [ + 184, + 106, + 501 + ], + [ + 184, + 107, + 534 + ], + [ + 184, + 108, + 535 + ], + [ + 184, + 109, + 567 + ], + [ + 184, + 111, + 567 + ], + [ + 184, + 112, + 604 + ], + [ + 184, + 113, + 634 + ], + [ + 184, + 114, + 667 + ], + [ + 184, + 115, + 700 + ], + [ + 184, + 116, + 734 + ], + [ + 184, + 117, + 767 + ], + [ + 184, + 118, + 801 + ], + [ + 184, + 119, + 805 + ], + [ + 184, + 120, + 833 + ], + [ + 184, + 121, + 837 + ], + [ + 184, + 123, + 866 + ], + [ + 184, + 124, + 902 + ], + [ + 184, + 125, + 937 + ], + [ + 184, + 126, + 997 + ], + [ + 184, + 127, + 1040 + ], + [ + 184, + 128, + 1149 + ] + ], + [ + [ + 184, + 63, + 1871 + ], + [ + 185, + 63, + 1917 + ], + [ + 186, + 63, + 1918 + ], + [ + 188, + 63, + 1947 + ], + [ + 190, + 62, + 1948 + ], + [ + 191, + 62, + 1948 + ], + [ + 196, + 62, + 1980 + ], + [ + 202, + 62, + 1981 + ], + [ + 209, + 61, + 2014 + ], + [ + 217, + 61, + 2015 + ], + [ + 228, + 61, + 2047 + ], + [ + 241, + 61, + 2048 + ], + [ + 248, + 61, + 2052 + ], + [ + 253, + 61, + 2080 + ], + [ + 264, + 61, + 2081 + ], + [ + 267, + 61, + 2084 + ], + [ + 271, + 61, + 2114 + ], + [ + 277, + 61, + 2114 + ], + [ + 279, + 61, + 2117 + ], + [ + 283, + 61, + 2147 + ], + [ + 288, + 61, + 2148 + ], + [ + 290, + 61, + 2149 + ], + [ + 292, + 61, + 2180 + ], + [ + 296, + 61, + 2181 + ], + [ + 298, + 61, + 2213 + ], + [ + 299, + 61, + 2214 + ], + [ + 301, + 60, + 2246 + ], + [ + 302, + 60, + 2437 + ], + [ + 303, + 60, + 2485 + ], + [ + 304, + 60, + 2532 + ], + [ + 305, + 60, + 2564 + ], + [ + 305, + 61, + 2596 + ], + [ + 305, + 62, + 2629 + ], + [ + 305, + 64, + 2630 + ], + [ + 305, + 66, + 2662 + ], + [ + 305, + 67, + 2663 + ], + [ + 306, + 69, + 2695 + ], + [ + 306, + 71, + 2696 + ], + [ + 306, + 75, + 2729 + ], + [ + 306, + 78, + 2730 + ], + [ + 306, + 79, + 2732 + ], + [ + 306, + 81, + 2762 + ], + [ + 306, + 85, + 2763 + ], + [ + 306, + 87, + 2764 + ], + [ + 306, + 89, + 2796 + ], + [ + 306, + 93, + 2796 + ], + [ + 306, + 95, + 2796 + ], + [ + 306, + 101, + 2828 + ], + [ + 305, + 105, + 2829 + ], + [ + 305, + 109, + 2862 + ], + [ + 305, + 113, + 2863 + ], + [ + 304, + 119, + 2896 + ], + [ + 304, + 122, + 2896 + ], + [ + 304, + 123, + 2901 + ], + [ + 303, + 126, + 2929 + ], + [ + 303, + 128, + 2929 + ], + [ + 303, + 130, + 2962 + ], + [ + 303, + 131, + 2962 + ], + [ + 303, + 132, + 2995 + ], + [ + 303, + 133, + 3029 + ] + ], + [ + [ + 184, + 129, + 4367 + ], + [ + 188, + 129, + 4409 + ], + [ + 190, + 129, + 4410 + ], + [ + 191, + 129, + 4413 + ], + [ + 193, + 129, + 4441 + ], + [ + 197, + 128, + 4442 + ], + [ + 198, + 128, + 4444 + ], + [ + 200, + 128, + 4474 + ], + [ + 203, + 128, + 4475 + ], + [ + 205, + 127, + 4476 + ], + [ + 209, + 127, + 4508 + ], + [ + 219, + 127, + 4509 + ], + [ + 227, + 127, + 4541 + ], + [ + 237, + 127, + 4542 + ], + [ + 244, + 127, + 4574 + ], + [ + 246, + 127, + 4575 + ], + [ + 248, + 127, + 4607 + ], + [ + 250, + 127, + 4608 + ], + [ + 252, + 126, + 4640 + ], + [ + 255, + 126, + 4641 + ], + [ + 257, + 126, + 4644 + ], + [ + 259, + 125, + 4674 + ], + [ + 261, + 125, + 4675 + ], + [ + 263, + 125, + 4677 + ], + [ + 265, + 125, + 4707 + ], + [ + 266, + 125, + 4740 + ], + [ + 269, + 125, + 4741 + ], + [ + 270, + 125, + 4774 + ], + [ + 275, + 125, + 4775 + ], + [ + 279, + 125, + 4807 + ], + [ + 283, + 125, + 4808 + ], + [ + 287, + 125, + 4840 + ], + [ + 289, + 125, + 4841 + ], + [ + 291, + 125, + 4873 + ], + [ + 292, + 125, + 4874 + ], + [ + 293, + 125, + 4876 + ], + [ + 294, + 125, + 4907 + ], + [ + 296, + 125, + 4908 + ], + [ + 298, + 125, + 4909 + ], + [ + 299, + 125, + 4940 + ], + [ + 302, + 125, + 4941 + ], + [ + 303, + 126, + 4974 + ], + [ + 304, + 126, + 5006 + ], + [ + 305, + 126, + 5007 + ], + [ + 306, + 126, + 5040 + ] + ], + [ + [ + 244, + 32, + 6303 + ], + [ + 244, + 34, + 6340 + ], + [ + 244, + 35, + 6355 + ], + [ + 244, + 37, + 6356 + ], + [ + 244, + 40, + 6386 + ], + [ + 244, + 46, + 6387 + ], + [ + 244, + 50, + 6388 + ], + [ + 244, + 54, + 6419 + ], + [ + 245, + 67, + 6420 + ], + [ + 247, + 75, + 6453 + ], + [ + 248, + 84, + 6453 + ], + [ + 249, + 89, + 6486 + ], + [ + 249, + 96, + 6487 + ], + [ + 250, + 102, + 6519 + ], + [ + 250, + 107, + 6520 + ], + [ + 251, + 111, + 6537 + ], + [ + 251, + 113, + 6553 + ], + [ + 251, + 118, + 6553 + ], + [ + 251, + 120, + 6557 + ], + [ + 251, + 122, + 6586 + ], + [ + 251, + 126, + 6587 + ], + [ + 251, + 128, + 6588 + ], + [ + 251, + 130, + 6619 + ], + [ + 252, + 133, + 6620 + ], + [ + 252, + 135, + 6620 + ], + [ + 252, + 138, + 6652 + ], + [ + 252, + 141, + 6653 + ], + [ + 252, + 144, + 6686 + ], + [ + 252, + 147, + 6686 + ], + [ + 252, + 151, + 6719 + ], + [ + 252, + 154, + 6719 + ], + [ + 252, + 156, + 6724 + ], + [ + 252, + 157, + 6752 + ], + [ + 252, + 161, + 6753 + ], + [ + 252, + 162, + 6756 + ], + [ + 252, + 165, + 6786 + ], + [ + 252, + 167, + 6788 + ], + [ + 252, + 170, + 6819 + ], + [ + 252, + 172, + 6820 + ], + [ + 252, + 174, + 6852 + ], + [ + 252, + 176, + 6852 + ], + [ + 252, + 178, + 6885 + ], + [ + 252, + 180, + 6886 + ], + [ + 252, + 182, + 6918 + ], + [ + 252, + 183, + 6919 + ], + [ + 252, + 184, + 6935 + ], + [ + 251, + 185, + 6952 + ], + [ + 251, + 186, + 6956 + ], + [ + 251, + 187, + 6985 + ], + [ + 251, + 188, + 7018 + ], + [ + 251, + 189, + 7205 + ], + [ + 251, + 190, + 7293 + ] + ] + ], + ".POINTS_PER_SECOND": 60, + ".SEGMENT": "CHARACTER", + ".VERSION": "1.0", + ".X_DIM": 1032, + ".X_POINTS_PER_INCH": 95, + ".Y_DIM": 263, + ".Y_POINTS_PER_INCH": 95 + }, + "0x6587": { + ".COORD": [ + "X", + "Y", + "T" + ], + ".HIERARCHY": "CHARACTER", + ".PEN": [ + [ + [ + 415, + 26, + 0 + ], + [ + 416, + 28, + 46 + ], + [ + 417, + 28, + 63 + ], + [ + 418, + 30, + 96 + ], + [ + 419, + 31, + 97 + ], + [ + 420, + 31, + 100 + ], + [ + 422, + 34, + 130 + ], + [ + 424, + 36, + 163 + ], + [ + 425, + 38, + 163 + ], + [ + 426, + 39, + 164 + ], + [ + 427, + 42, + 196 + ], + [ + 428, + 45, + 196 + ], + [ + 429, + 47, + 229 + ], + [ + 430, + 50, + 230 + ], + [ + 431, + 52, + 263 + ], + [ + 431, + 54, + 263 + ], + [ + 432, + 55, + 296 + ], + [ + 433, + 56, + 296 + ], + [ + 433, + 57, + 300 + ], + [ + 433, + 58, + 330 + ], + [ + 433, + 59, + 330 + ], + [ + 433, + 60, + 364 + ], + [ + 433, + 61, + 365 + ], + [ + 433, + 62, + 404 + ] + ], + [ + [ + 356, + 80, + 1935 + ], + [ + 357, + 80, + 1980 + ], + [ + 358, + 81, + 1981 + ], + [ + 359, + 81, + 2008 + ], + [ + 361, + 81, + 2012 + ], + [ + 363, + 81, + 2041 + ], + [ + 365, + 81, + 2045 + ], + [ + 367, + 81, + 2075 + ], + [ + 370, + 81, + 2075 + ], + [ + 372, + 81, + 2076 + ], + [ + 375, + 81, + 2108 + ], + [ + 379, + 81, + 2109 + ], + [ + 385, + 80, + 2141 + ], + [ + 390, + 80, + 2142 + ], + [ + 396, + 79, + 2174 + ], + [ + 403, + 79, + 2175 + ], + [ + 406, + 79, + 2180 + ], + [ + 410, + 77, + 2208 + ], + [ + 416, + 77, + 2209 + ], + [ + 420, + 76, + 2213 + ], + [ + 422, + 76, + 2241 + ], + [ + 428, + 75, + 2242 + ], + [ + 431, + 75, + 2245 + ], + [ + 434, + 74, + 2274 + ], + [ + 443, + 73, + 2275 + ], + [ + 446, + 73, + 2276 + ], + [ + 451, + 71, + 2307 + ], + [ + 460, + 70, + 2308 + ], + [ + 464, + 68, + 2341 + ], + [ + 468, + 67, + 2341 + ], + [ + 470, + 66, + 2374 + ], + [ + 475, + 64, + 2374 + ], + [ + 477, + 64, + 2392 + ], + [ + 479, + 63, + 2407 + ], + [ + 484, + 62, + 2408 + ], + [ + 485, + 61, + 2440 + ], + [ + 487, + 60, + 2441 + ], + [ + 489, + 59, + 2444 + ], + [ + 491, + 57, + 2474 + ], + [ + 493, + 56, + 2508 + ], + [ + 495, + 55, + 2508 + ], + [ + 496, + 54, + 2508 + ], + [ + 498, + 53, + 2540 + ], + [ + 499, + 52, + 2541 + ], + [ + 500, + 50, + 2573 + ], + [ + 501, + 49, + 2607 + ], + [ + 502, + 48, + 2640 + ], + [ + 503, + 47, + 2641 + ], + [ + 504, + 46, + 2673 + ], + [ + 504, + 45, + 2724 + ], + [ + 504, + 44, + 3053 + ] + ], + [ + [ + 434, + 82, + 4671 + ], + [ + 434, + 84, + 4718 + ], + [ + 434, + 86, + 4735 + ], + [ + 434, + 88, + 4740 + ], + [ + 434, + 89, + 4768 + ], + [ + 434, + 92, + 4769 + ], + [ + 433, + 94, + 4772 + ], + [ + 432, + 96, + 4802 + ], + [ + 430, + 101, + 4802 + ], + [ + 429, + 103, + 4804 + ], + [ + 429, + 106, + 4835 + ], + [ + 428, + 112, + 4836 + ], + [ + 428, + 114, + 4836 + ], + [ + 425, + 121, + 4868 + ], + [ + 423, + 127, + 4869 + ], + [ + 421, + 132, + 4901 + ], + [ + 417, + 137, + 4902 + ], + [ + 414, + 143, + 4934 + ], + [ + 412, + 148, + 4935 + ], + [ + 406, + 156, + 4968 + ], + [ + 401, + 163, + 4969 + ], + [ + 398, + 166, + 4972 + ], + [ + 397, + 169, + 5001 + ], + [ + 393, + 173, + 5002 + ], + [ + 392, + 175, + 5005 + ], + [ + 391, + 176, + 5034 + ], + [ + 390, + 178, + 5035 + ], + [ + 389, + 179, + 5036 + ], + [ + 388, + 180, + 5067 + ], + [ + 387, + 181, + 5068 + ], + [ + 386, + 182, + 5101 + ], + [ + 385, + 182, + 5589 + ], + [ + 384, + 182, + 5616 + ] + ], + [ + [ + 385, + 84, + 6399 + ], + [ + 386, + 84, + 6468 + ], + [ + 387, + 87, + 6489 + ], + [ + 388, + 90, + 6531 + ], + [ + 391, + 95, + 6531 + ], + [ + 392, + 97, + 6532 + ], + [ + 394, + 99, + 6564 + ], + [ + 396, + 106, + 6564 + ], + [ + 401, + 113, + 6597 + ], + [ + 406, + 120, + 6598 + ], + [ + 411, + 126, + 6630 + ], + [ + 416, + 132, + 6631 + ], + [ + 422, + 138, + 6663 + ], + [ + 426, + 143, + 6664 + ], + [ + 427, + 143, + 6668 + ], + [ + 429, + 145, + 6697 + ], + [ + 432, + 150, + 6697 + ], + [ + 433, + 153, + 6700 + ], + [ + 436, + 156, + 6730 + ], + [ + 440, + 160, + 6730 + ], + [ + 444, + 163, + 6732 + ], + [ + 447, + 165, + 6763 + ], + [ + 454, + 171, + 6764 + ], + [ + 457, + 173, + 6797 + ], + [ + 458, + 173, + 6798 + ], + [ + 459, + 174, + 6830 + ], + [ + 460, + 175, + 6831 + ], + [ + 462, + 176, + 6863 + ], + [ + 466, + 178, + 6864 + ], + [ + 471, + 179, + 6897 + ], + [ + 473, + 179, + 6897 + ], + [ + 474, + 180, + 6900 + ], + [ + 475, + 180, + 6930 + ], + [ + 477, + 180, + 6964 + ], + [ + 478, + 180, + 6996 + ], + [ + 479, + 180, + 7029 + ], + [ + 480, + 180, + 7064 + ], + [ + 481, + 181, + 7097 + ], + [ + 483, + 181, + 7100 + ], + [ + 485, + 181, + 7149 + ], + [ + 486, + 181, + 7180 + ], + [ + 487, + 181, + 7213 + ], + [ + 488, + 181, + 7304 + ], + [ + 489, + 181, + 7346 + ], + [ + 490, + 181, + 7396 + ], + [ + 491, + 181, + 7428 + ], + [ + 491, + 182, + 7629 + ] + ] + ], + ".POINTS_PER_SECOND": 60, + ".SEGMENT": "CHARACTER", + ".VERSION": "1.0", + ".X_DIM": 1032, + ".X_POINTS_PER_INCH": 95, + ".Y_DIM": 263, + ".Y_POINTS_PER_INCH": 95 + } +} diff --git a/tests/auto/inputpanel/data/tst_inputpanel.qml b/tests/auto/inputpanel/data/tst_inputpanel.qml index 7d83d31d..95cbe5d1 100644 --- a/tests/auto/inputpanel/data/tst_inputpanel.qml +++ b/tests/auto/inputpanel/data/tst_inputpanel.qml @@ -105,6 +105,11 @@ Rectangle { verify(inputPanel.setLocale(locale)) if (localeChanged && !(textInput.inputMethodHints & Qt.ImhNoPredictiveText)) wait(300) + if (data !== undefined && data.hasOwnProperty("initHwrMode") && data.initHwrMode) { + if (!inputPanel.setHandwritingMode(true)) + expectFail("", "Handwriting not enabled") + verify(inputPanel.handwritingMode === true) + } if (data !== undefined && data.hasOwnProperty("initInputMode")) { var inputMode = inputPanel.mapInputMode(data.initInputMode) if (!inputPanel.isInputModeSupported(inputMode)) @@ -1093,19 +1098,16 @@ Rectangle { function test_hwrInputSequence_data() { return [ - { initInputMethodHints: Qt.ImhNoPredictiveText, toggleShiftCount: 0, inputSequence: "abcdefghij", outputText: "Abcdefghij" }, - { initInputMethodHints: Qt.ImhNoPredictiveText, toggleShiftCount: 1, inputSequence: "klmnopqrst", outputText: "klmnopqrst" }, - { initInputMethodHints: Qt.ImhNoPredictiveText, toggleShiftCount: 3, inputSequence: "uvwxyz", outputText: "UVWXYZ" }, + { initHwrMode: true, initInputMethodHints: Qt.ImhNoPredictiveText, toggleShiftCount: 0, inputSequence: "abcdefghij", outputText: "Abcdefghij" }, + { initHwrMode: true, initInputMethodHints: Qt.ImhNoPredictiveText, toggleShiftCount: 1, inputSequence: "klmnopqrst", outputText: "klmnopqrst" }, + { initHwrMode: true, initInputMethodHints: Qt.ImhNoPredictiveText, toggleShiftCount: 3, inputSequence: "uvwxyz", outputText: "UVWXYZ" }, + { initHwrMode: true, initInputMethodHints: Qt.ImhNone, initLocale: "zh_CN", initInputMode: "ChineseHandwriting", inputSequence: "\u4e2d\u6587", outputText: "\u4e2d\u6587" }, ] } function test_hwrInputSequence(data) { prepareTest(data) - if (!inputPanel.setHandwritingMode(true)) - expectFail("", "Handwriting not enabled") - verify(inputPanel.handwritingMode === true) - for (var i = 0; i < data.toggleShiftCount; i++) { inputPanel.toggleShift() } @@ -1126,20 +1128,20 @@ Rectangle { function test_hwrNumericInputSequence_data() { return [ - { initInputMethodHints: Qt.ImhNoPredictiveText | Qt.ImhPreferNumbers, modeSwitchAllowed: true, inputSequence: "0123456789", outputText: "0123456789" }, - { initInputMethodHints: Qt.ImhNoPredictiveText | Qt.ImhDigitsOnly, modeSwitchAllowed: false, inputSequence: "1234567890", outputText: "1234567890" }, - { initInputMethodHints: Qt.ImhNoPredictiveText | Qt.ImhFormattedNumbersOnly, modeSwitchAllowed: false, inputSequence: "1234567890+", outputText: "1234567890+" }, - { initInputMethodHints: Qt.ImhNoPredictiveText | Qt.ImhDialableCharactersOnly, modeSwitchAllowed: false, inputSequence: "1234567890+", outputText: "1234567890+" }, + { initHwrMode: true, initInputMethodHints: Qt.ImhNoPredictiveText | Qt.ImhPreferNumbers, modeSwitchAllowed: true, inputSequence: "0123456789", outputText: "0123456789" }, + { initHwrMode: true, initInputMethodHints: Qt.ImhNoPredictiveText | Qt.ImhDigitsOnly, modeSwitchAllowed: false, inputSequence: "1234567890", outputText: "1234567890" }, + { initHwrMode: true, initInputMethodHints: Qt.ImhNoPredictiveText | Qt.ImhFormattedNumbersOnly, modeSwitchAllowed: false, inputSequence: "1234567890+", outputText: "1234567890+" }, + { initHwrMode: true, initInputMethodHints: Qt.ImhNoPredictiveText | Qt.ImhDialableCharactersOnly, modeSwitchAllowed: false, inputSequence: "1234567890+", outputText: "1234567890+" }, + { initHwrMode: true, initLocale: "zh_CN", initInputMethodHints: Qt.ImhNoPredictiveText | Qt.ImhPreferNumbers, modeSwitchAllowed: true, inputSequence: "0123456789", outputText: "0123456789" }, + { initHwrMode: true, initLocale: "zh_CN", initInputMethodHints: Qt.ImhNoPredictiveText | Qt.ImhDigitsOnly, modeSwitchAllowed: false, inputSequence: "1234567890", outputText: "1234567890" }, + { initHwrMode: true, initLocale: "zh_CN", initInputMethodHints: Qt.ImhNoPredictiveText | Qt.ImhFormattedNumbersOnly, modeSwitchAllowed: false, inputSequence: "1234567890+", outputText: "1234567890+" }, + { initHwrMode: true, initLocale: "zh_CN", initInputMethodHints: Qt.ImhNoPredictiveText | Qt.ImhDialableCharactersOnly, modeSwitchAllowed: false, inputSequence: "1234567890+", outputText: "1234567890+" }, ] } function test_hwrNumericInputSequence(data) { prepareTest(data) - if (!inputPanel.setHandwritingMode(true)) - expectFail("", "Handwriting not enabled") - verify(inputPanel.handwritingMode === true) - for (var inputIndex in data.inputSequence) { verify(inputPanel.emulateHandwriting(data.inputSequence.charAt(inputIndex), true)) } @@ -1265,6 +1267,7 @@ Rectangle { function test_hwrFullScreenGestures_data() { return [ { initInputMethodHints: Qt.ImhNoPredictiveText, inputSequence: ["a","b","c",Qt.Key_Backspace,Qt.Key_Space,"c"], outputText: "Ab c" }, + { initHwrMode: true, initInputMethodHints: Qt.ImhNone, initLocale: "zh_CN", initInputMode: "ChineseHandwriting", inputSequence: ["\u4e2d", "\u6587", Qt.Key_Backspace], outputText: "\u4e2d" }, ] } @@ -1298,7 +1301,8 @@ Rectangle { prepareTest(data) if (!handwritingInputPanel.enabled) - skip("Handwriting not enabled") + expectFail("", "Handwriting not enabled") + verify(handwritingInputPanel.enabled) handwritingInputPanel.available = true if (!inputPanel.wordCandidateListVisibleHint) skip("Word candidates not available (spell correction/hwr suggestions)") diff --git a/tests/auto/inputpanel/hwr_test_data/alphanumeric/113_100_0.txt b/tests/auto/inputpanel/hwr_test_data/alphanumeric/113_100_0.txt index 714ad4c8..14d57b77 100644 --- a/tests/auto/inputpanel/hwr_test_data/alphanumeric/113_100_0.txt +++ b/tests/auto/inputpanel/hwr_test_data/alphanumeric/113_100_0.txt @@ -2,55 +2,75 @@ .HIERARCHY CHARACTER .COORD X Y T .SEGMENT CHARACTER -.X_DIM 821 -.Y_DIM 211 -.X_POINTS_PER_INCH 100 -.Y_POINTS_PER_INCH 100 +.X_DIM 1032 +.Y_DIM 263 +.X_POINTS_PER_INCH 95 +.Y_POINTS_PER_INCH 95 .POINTS_PER_SECOND 60 .PEN_DOWN -435 78 0 -435 77 13 -435 76 33 -435 75 70 -434 74 84 -434 73 109 -431 70 130 -417 65 156 -407 65 174 -385 70 194 -377 73 214 -361 83 238 -355 88 247 -349 100 275 -354 113 310 -360 117 338 -368 120 357 -379 120 377 -408 110 412 -414 105 437 -423 95 462 -424 91 484 -426 87 511 -426 83 541 -427 81 564 -426 80 591 -427 79 648 -427 81 698 -427 83 722 -428 90 741 -430 98 760 -432 118 788 -434 129 797 -436 151 829 -436 160 844 -437 166 863 -437 171 899 -437 173 921 -437 176 938 -437 177 964 -437 178 985 -437 179 1013 -437 180 1032 -437 181 1101 -438 181 1136 +407 75 0 +406 74 76 +403 74 96 +401 73 100 +395 73 128 +392 73 129 +388 73 131 +385 73 162 +375 73 162 +370 75 163 +360 78 195 +349 85 196 +342 91 228 +338 98 229 +337 107 261 +337 115 261 +342 125 294 +347 133 295 +351 135 299 +353 139 328 +359 143 329 +363 144 331 +365 145 361 +369 148 362 +371 148 363 +372 148 395 +376 146 396 +382 143 427 +387 137 428 +391 129 461 +395 123 461 +400 118 494 +401 113 494 +402 108 527 +404 103 528 +406 99 531 +406 96 561 +408 90 561 +408 88 564 +408 86 593 +409 84 594 +409 83 627 +409 82 661 +409 81 694 +409 83 844 +409 89 878 +409 93 879 +409 98 884 +408 103 910 +407 118 911 +407 135 943 +407 157 944 +407 166 948 +409 175 976 +410 186 977 +410 191 979 +411 196 1009 +411 203 1010 +413 207 1011 +413 211 1042 +413 223 1043 +413 230 1076 +413 234 1077 +413 235 1109 +413 236 1110 .PEN_UP diff --git a/tests/auto/inputpanel/hwr_test_data/build_unipen_data.py b/tests/auto/inputpanel/hwr_test_data/build_unipen_data.py index 639912b9..eb4231c3 100755 --- a/tests/auto/inputpanel/hwr_test_data/build_unipen_data.py +++ b/tests/auto/inputpanel/hwr_test_data/build_unipen_data.py @@ -2,19 +2,30 @@ ############################################################################# ## -## Copyright (C) 2015 The Qt Company Ltd -## All rights reserved. -## For any questions to The Qt Company, please use contact form at http://qt.io +## Copyright (C) 2017 The Qt Company Ltd. +## Contact: https://www.qt.io/licensing/ ## -## This file is part of the Qt Virtual Keyboard add-on. +## This file is part of the Qt Virtual Keyboard module of the Qt Toolkit. ## -## Licensees holding valid commercial license for Qt may use this file in -## accordance with the Qt License Agreement provided with the Software -## or, alternatively, in accordance with the terms contained in a written -## agreement between you and The Qt Company. +## $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. ## -## If you have questions regarding the use of this file, please use -## contact form at http://qt.io +## 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$ ## ############################################################################# @@ -28,23 +39,34 @@ import re unipen_file_pattern = re.compile(r'(^[0-9]{2,9}).*\.txt') def print_header(): - print """/****************************************************************************** + print """/**************************************************************************** +** +** Copyright (C) %s The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** -** Copyright (C) %s The Qt Company Ltd -** All rights reserved. -** For any questions to The Qt Company, please use contact form at http://qt.io +** This file is part of the Qt Virtual Keyboard module of the Qt Toolkit. ** -** This file is part of the Qt Virtual Keyboard add-on. +** $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. ** -** Licensees holding valid commercial license for Qt may use this file in -** accordance with the Qt License Agreement provided with the Software -** or, alternatively, in accordance with the terms contained in a written -** agreement between you and The Qt Company. +** 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. ** -** If you have questions regarding the use of this file, please use -** contact form at http://qt.io +** $QT_END_LICENSE$ ** -******************************************************************************/""" % datetime.datetime.now().year +****************************************************************************/""" % datetime.datetime.now().year def scan_unipen_files(path): file_list = [] diff --git a/tests/auto/inputpanel/hwr_test_data/simp_chinese/20013_100_0.txt b/tests/auto/inputpanel/hwr_test_data/simp_chinese/20013_100_0.txt new file mode 100644 index 00000000..27414acd --- /dev/null +++ b/tests/auto/inputpanel/hwr_test_data/simp_chinese/20013_100_0.txt @@ -0,0 +1,216 @@ +.VERSION 1.0 +.HIERARCHY CHARACTER +.COORD X Y T +.SEGMENT CHARACTER +.X_DIM 1032 +.Y_DIM 263 +.X_POINTS_PER_INCH 95 +.Y_POINTS_PER_INCH 95 +.POINTS_PER_SECOND 60 +.PEN_DOWN +185 59 0 +185 61 181 +185 63 202 +185 65 205 +185 68 235 +185 70 236 +185 73 236 +185 75 268 +185 80 269 +185 84 301 +185 87 302 +185 89 334 +185 92 335 +185 94 368 +184 97 369 +184 98 372 +184 99 401 +184 101 402 +184 102 405 +184 104 434 +184 105 467 +184 106 501 +184 107 534 +184 108 535 +184 109 567 +184 111 567 +184 112 604 +184 113 634 +184 114 667 +184 115 700 +184 116 734 +184 117 767 +184 118 801 +184 119 805 +184 120 833 +184 121 837 +184 123 866 +184 124 902 +184 125 937 +184 126 997 +184 127 1040 +184 128 1149 +.PEN_UP +.PEN_DOWN +184 63 1871 +185 63 1917 +186 63 1918 +188 63 1947 +190 62 1948 +191 62 1948 +196 62 1980 +202 62 1981 +209 61 2014 +217 61 2015 +228 61 2047 +241 61 2048 +248 61 2052 +253 61 2080 +264 61 2081 +267 61 2084 +271 61 2114 +277 61 2114 +279 61 2117 +283 61 2147 +288 61 2148 +290 61 2149 +292 61 2180 +296 61 2181 +298 61 2213 +299 61 2214 +301 60 2246 +302 60 2437 +303 60 2485 +304 60 2532 +305 60 2564 +305 61 2596 +305 62 2629 +305 64 2630 +305 66 2662 +305 67 2663 +306 69 2695 +306 71 2696 +306 75 2729 +306 78 2730 +306 79 2732 +306 81 2762 +306 85 2763 +306 87 2764 +306 89 2796 +306 93 2796 +306 95 2796 +306 101 2828 +305 105 2829 +305 109 2862 +305 113 2863 +304 119 2896 +304 122 2896 +304 123 2901 +303 126 2929 +303 128 2929 +303 130 2962 +303 131 2962 +303 132 2995 +303 133 3029 +.PEN_UP +.PEN_DOWN +184 129 4367 +188 129 4409 +190 129 4410 +191 129 4413 +193 129 4441 +197 128 4442 +198 128 4444 +200 128 4474 +203 128 4475 +205 127 4476 +209 127 4508 +219 127 4509 +227 127 4541 +237 127 4542 +244 127 4574 +246 127 4575 +248 127 4607 +250 127 4608 +252 126 4640 +255 126 4641 +257 126 4644 +259 125 4674 +261 125 4675 +263 125 4677 +265 125 4707 +266 125 4740 +269 125 4741 +270 125 4774 +275 125 4775 +279 125 4807 +283 125 4808 +287 125 4840 +289 125 4841 +291 125 4873 +292 125 4874 +293 125 4876 +294 125 4907 +296 125 4908 +298 125 4909 +299 125 4940 +302 125 4941 +303 126 4974 +304 126 5006 +305 126 5007 +306 126 5040 +.PEN_UP +.PEN_DOWN +244 32 6303 +244 34 6340 +244 35 6355 +244 37 6356 +244 40 6386 +244 46 6387 +244 50 6388 +244 54 6419 +245 67 6420 +247 75 6453 +248 84 6453 +249 89 6486 +249 96 6487 +250 102 6519 +250 107 6520 +251 111 6537 +251 113 6553 +251 118 6553 +251 120 6557 +251 122 6586 +251 126 6587 +251 128 6588 +251 130 6619 +252 133 6620 +252 135 6620 +252 138 6652 +252 141 6653 +252 144 6686 +252 147 6686 +252 151 6719 +252 154 6719 +252 156 6724 +252 157 6752 +252 161 6753 +252 162 6756 +252 165 6786 +252 167 6788 +252 170 6819 +252 172 6820 +252 174 6852 +252 176 6852 +252 178 6885 +252 180 6886 +252 182 6918 +252 183 6919 +252 184 6935 +251 185 6952 +251 186 6956 +251 187 6985 +251 188 7018 +251 189 7205 +251 190 7293 +.PEN_UP diff --git a/tests/auto/inputpanel/hwr_test_data/simp_chinese/25991_100_0.txt b/tests/auto/inputpanel/hwr_test_data/simp_chinese/25991_100_0.txt new file mode 100644 index 00000000..eec059f5 --- /dev/null +++ b/tests/auto/inputpanel/hwr_test_data/simp_chinese/25991_100_0.txt @@ -0,0 +1,172 @@ +.VERSION 1.0 +.HIERARCHY CHARACTER +.COORD X Y T +.SEGMENT CHARACTER +.X_DIM 1032 +.Y_DIM 263 +.X_POINTS_PER_INCH 95 +.Y_POINTS_PER_INCH 95 +.POINTS_PER_SECOND 60 +.PEN_DOWN +415 26 0 +416 28 46 +417 28 63 +418 30 96 +419 31 97 +420 31 100 +422 34 130 +424 36 163 +425 38 163 +426 39 164 +427 42 196 +428 45 196 +429 47 229 +430 50 230 +431 52 263 +431 54 263 +432 55 296 +433 56 296 +433 57 300 +433 58 330 +433 59 330 +433 60 364 +433 61 365 +433 62 404 +.PEN_UP +.PEN_DOWN +356 80 1935 +357 80 1980 +358 81 1981 +359 81 2008 +361 81 2012 +363 81 2041 +365 81 2045 +367 81 2075 +370 81 2075 +372 81 2076 +375 81 2108 +379 81 2109 +385 80 2141 +390 80 2142 +396 79 2174 +403 79 2175 +406 79 2180 +410 77 2208 +416 77 2209 +420 76 2213 +422 76 2241 +428 75 2242 +431 75 2245 +434 74 2274 +443 73 2275 +446 73 2276 +451 71 2307 +460 70 2308 +464 68 2341 +468 67 2341 +470 66 2374 +475 64 2374 +477 64 2392 +479 63 2407 +484 62 2408 +485 61 2440 +487 60 2441 +489 59 2444 +491 57 2474 +493 56 2508 +495 55 2508 +496 54 2508 +498 53 2540 +499 52 2541 +500 50 2573 +501 49 2607 +502 48 2640 +503 47 2641 +504 46 2673 +504 45 2724 +504 44 3053 +.PEN_UP +.PEN_DOWN +434 82 4671 +434 84 4718 +434 86 4735 +434 88 4740 +434 89 4768 +434 92 4769 +433 94 4772 +432 96 4802 +430 101 4802 +429 103 4804 +429 106 4835 +428 112 4836 +428 114 4836 +425 121 4868 +423 127 4869 +421 132 4901 +417 137 4902 +414 143 4934 +412 148 4935 +406 156 4968 +401 163 4969 +398 166 4972 +397 169 5001 +393 173 5002 +392 175 5005 +391 176 5034 +390 178 5035 +389 179 5036 +388 180 5067 +387 181 5068 +386 182 5101 +385 182 5589 +384 182 5616 +.PEN_UP +.PEN_DOWN +385 84 6399 +386 84 6468 +387 87 6489 +388 90 6531 +391 95 6531 +392 97 6532 +394 99 6564 +396 106 6564 +401 113 6597 +406 120 6598 +411 126 6630 +416 132 6631 +422 138 6663 +426 143 6664 +427 143 6668 +429 145 6697 +432 150 6697 +433 153 6700 +436 156 6730 +440 160 6730 +444 163 6732 +447 165 6763 +454 171 6764 +457 173 6797 +458 173 6798 +459 174 6830 +460 175 6831 +462 176 6863 +466 178 6864 +471 179 6897 +473 179 6897 +474 180 6900 +475 180 6930 +477 180 6964 +478 180 6996 +479 180 7029 +480 180 7064 +481 181 7097 +483 181 7100 +485 181 7149 +486 181 7180 +487 181 7213 +488 181 7304 +489 181 7346 +490 181 7396 +491 181 7428 +491 182 7629 +.PEN_UP |