From d7f73f3078de0a605e2eb0f1ad3dc84f3389af54 Mon Sep 17 00:00:00 2001 From: Marc Durdin Date: Fri, 1 Sep 2023 20:30:43 +0800 Subject: [PATCH 01/47] chore: workaround npm/cli#3466 when bundling internal deps Works around npm/cli#3466 when bundling internal dependencies using the bundleDependencies package.json property. This change works in tandem with the npm pack/publish process -- when we run `developer/src/kmc/build.sh publish` (or `pack`), we end up with `npm version` stomping on all our package.json files, so the repo is dirty after this. We need a copy of the top-level package.json before this stomping happens, in order to get a simple map of the location of each of our internal dependencies, from the `dependencies` property (it would be possible to figure this out with a lot more parsing of our package.json files, but this is simpler). This means, in future, we should avoid publishing our internal dependencies such as those under common/ to npm, as they serve no practical purpose there. --- developer/src/kmc/build.sh | 10 +++++ resources/build/build-utils-ci.inc.sh | 63 ++++++++++++++++++++++++++- 2 files changed, 72 insertions(+), 1 deletion(-) diff --git a/developer/src/kmc/build.sh b/developer/src/kmc/build.sh index 0c85d8764e..e7c809419e 100755 --- a/developer/src/kmc/build.sh +++ b/developer/src/kmc/build.sh @@ -133,6 +133,10 @@ fi if builder_start_action publish; then . "$KEYMAN_ROOT/resources/build/build-utils-ci.inc.sh" + # To ensure that we cache the top-level package.json, we must call this before + # the global publish + builder_publish_cleanup + # For now, kmc will have responsibility for publishing keyman-version and # common-types, as well as all the other dependent modules. In the future, we # should probably have a top-level npm publish script that publishes all @@ -143,14 +147,20 @@ if builder_start_action publish; then # Finally, publish kmc builder_publish_to_npm + builder_publish_cleanup builder_finish_action success publish elif builder_start_action pack; then . "$KEYMAN_ROOT/resources/build/build-utils-ci.inc.sh" + # To ensure that we cache the top-level package.json, we must call this before + # the global pack + builder_publish_cleanup + for package in "${PACKAGES[@]}"; do "$KEYMAN_ROOT/$package/build.sh" pack $DRY_RUN done builder_publish_to_pack + builder_publish_cleanup builder_finish_action success pack fi diff --git a/resources/build/build-utils-ci.inc.sh b/resources/build/build-utils-ci.inc.sh index cab449a463..973f6f8aca 100644 --- a/resources/build/build-utils-ci.inc.sh +++ b/resources/build/build-utils-ci.inc.sh @@ -100,7 +100,9 @@ function _builder_publish_npm_package() { dry_run=--dry-run fi + _builder_publish_cache_package_json _builder_write_npm_version + _builder_prepublish # Note: In either case, npm publish MUST be given --access public to publish a # package in the @keymanapp scope on the public npm package index. @@ -141,9 +143,68 @@ function _builder_write_npm_version() { . + (try { dependencies: (.dependencies | to_entries | . + map(select(.key | match("@keymanapp/.*")) .value |= $VERSION_WITH_TAG) | from_entries) } catch {}) + (try { devDependencies: (.devDependencies | to_entries | . + map(select(.key | match("@keymanapp/.*")) .value |= $VERSION_WITH_TAG) | from_entries) } catch {}) + - (try { bundleDependencies: (.bundleDependencies | to_entries | . + map(select(.key | match("@keymanapp/.*")) .value |= $VERSION_WITH_TAG) | from_entries) } catch {}) + (try { optionalDependencies: (.optionalDependencies | to_entries | . + map(select(.key | match("@keymanapp/.*")) .value |= $VERSION_WITH_TAG) | from_entries) } catch {}) ' > "${line}_" mv -f "${line}_" "$line" done +} + +# +# Due to https://github.com/npm/cli/issues/3466, we manually create all +# bundleDependencies (__NOT__ bundledDependencies, beware typos) from +# the target's package.json in its node_modules folder. Must run from +# the target's folder. +# +function _builder_prepublish() { + mkdir -p node_modules/@keymanapp + local packages=($(cat package.json | "$JQ" --raw-output '.bundleDependencies | join(" ")')) + local package + + # For each @keymanapp/ package, we'll do a local symlink, note that Windows + # mklink is internal to cmd! + for package in "${packages[@]}"; do + if [[ $package =~ ^@keymanapp/ ]]; then + # Creating local symlink under node_modules + local link_source=node_modules/$package + + # lookup the link_target from top-level package.json/dependencies + local link_target="$(cat "$KEYMAN_ROOT/builder_package_publish.json" | jq -r .dependencies.\"$package\")" + + if [[ $link_target =~ ^file: ]]; then + link_target="$KEYMAN_ROOT"/${link_target#file:} + + builder_echo "Manually linking $link_source -> $link_target (see https://github.com/npm/cli/issues/3466)" + rm -rf $link_source + if [[ $BUILDER_OS == win ]]; then + link_source="$(cygpath -w "$link_source")" + link_target="$(cygpath -w "$link_target")" + cmd //c mklink //j "$link_source" "$link_target" + else + ln -sr "$link_target" "$link_source" + fi + fi + fi + done +} + +# +# We need to cache /package.json before npm version gets its sticky fingers on +# it, because afterwards, we lose the file: paths that help us to resolve +# dependencies easily. Part of the https://github.com/npm/cli/issues/3466 +# workaround. +# +function _builder_publish_cache_package_json() { + if [[ -f "$KEYMAN_ROOT/builder_package_publish.json" ]]; then + return 0 + fi + + if "$JQ" -e '.version' "$KEYMAN_ROOT/developer/src/kmc/package.json" > /dev/null; then + builder_die "npm version has already been run. Revert the version changes to all package.json files before re-running" + fi + + cp "$KEYMAN_ROOT/package.json" "$KEYMAN_ROOT/builder_package_publish.json" +} + +function builder_publish_cleanup() { + rm -f "$KEYMAN_ROOT/builder_package_publish.json" } \ No newline at end of file From 026568009ca7c4685075522c0323b019c483ac42 Mon Sep 17 00:00:00 2001 From: "Steven R. Loomis" Date: Thu, 14 Sep 2023 08:41:40 +0100 Subject: [PATCH 02/47] =?UTF-8?q?chore(resources):=20ldml=20update=20(CLDR?= =?UTF-8?q?=20v44=20alpha=202)=20=F0=9F=99=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - unicode-org/cldr:61b74a36de8329daed152005133a699ae7f2012b - for feat(core): ldml drop \u1234 format 🙀 #9515 --- .../techpreview/3.0/fr-t-k0-azerty.xml | 20 +- .../ldml-keyboards/techpreview/cldr_info.json | 6 +- .../techpreview/dtd/ldmlKeyboard.dtd | 19 +- .../techpreview/dtd/ldmlKeyboard.xsd | 1177 +++++++---------- .../techpreview/dtd/ldmlKeyboardTest.xsd | 391 ++---- .../techpreview/import/scanCodes-implied.xml | 28 + .../techpreview/ldml-keyboard.schema.json | 71 +- .../techpreview/test/fr-t-k0-azerty-test.xml | 10 +- .../techpreview/test/ja-Latn-test.xml | 2 +- .../techpreview/test/pt-t-k0-abnt2-test.xml | 4 +- 10 files changed, 722 insertions(+), 1006 deletions(-) create mode 100644 resources/standards-data/ldml-keyboards/techpreview/import/scanCodes-implied.xml diff --git a/resources/standards-data/ldml-keyboards/techpreview/3.0/fr-t-k0-azerty.xml b/resources/standards-data/ldml-keyboards/techpreview/3.0/fr-t-k0-azerty.xml index f91943f3b9..b7162f6e01 100644 --- a/resources/standards-data/ldml-keyboards/techpreview/3.0/fr-t-k0-azerty.xml +++ b/resources/standards-data/ldml-keyboards/techpreview/3.0/fr-t-k0-azerty.xml @@ -43,7 +43,7 @@ - + - - - + + + @@ -99,9 +99,9 @@ - - - + + + @@ -203,9 +203,9 @@ - - - + + + diff --git a/resources/standards-data/ldml-keyboards/techpreview/cldr_info.json b/resources/standards-data/ldml-keyboards/techpreview/cldr_info.json index 43c89392c5..23d8cfe40d 100644 --- a/resources/standards-data/ldml-keyboards/techpreview/cldr_info.json +++ b/resources/standards-data/ldml-keyboards/techpreview/cldr_info.json @@ -1,5 +1,5 @@ { - "sha": "44903d0867e42df37f17cf21d28938044eb1edc0", - "description": "release-44-m1-75-g44903d0867", - "date": "Thu, 17 Aug 2023 19:14:19 +0000" + "sha": "61b74a36de8329daed152005133a699ae7f2012b", + "description": "release-44-alpha2-5-g61b74a36de", + "date": "Thu, 14 Sep 2023 07:38:47 +0000" } diff --git a/resources/standards-data/ldml-keyboards/techpreview/dtd/ldmlKeyboard.dtd b/resources/standards-data/ldml-keyboards/techpreview/dtd/ldmlKeyboard.dtd index d1734c8b0e..e668787eaf 100644 --- a/resources/standards-data/ldml-keyboards/techpreview/dtd/ldmlKeyboard.dtd +++ b/resources/standards-data/ldml-keyboards/techpreview/dtd/ldmlKeyboard.dtd @@ -10,7 +10,7 @@ The CLDR Keyboard Subcommittee is currently developing major changes to the CLDR Please view the subcommittee page for the most recent information. --> - + @@ -161,9 +161,24 @@ Please view the subcommittee page for the most recent information. + + + + + + + + + + + + + + - + + diff --git a/resources/standards-data/ldml-keyboards/techpreview/dtd/ldmlKeyboard.xsd b/resources/standards-data/ldml-keyboards/techpreview/dtd/ldmlKeyboard.xsd index cd8fda5879..1a88185499 100644 --- a/resources/standards-data/ldml-keyboards/techpreview/dtd/ldmlKeyboard.xsd +++ b/resources/standards-data/ldml-keyboards/techpreview/dtd/ldmlKeyboard.xsd @@ -1,5 +1,8 @@ - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/resources/standards-data/ldml-keyboards/techpreview/dtd/ldmlKeyboardTest.xsd b/resources/standards-data/ldml-keyboards/techpreview/dtd/ldmlKeyboardTest.xsd index 29b7b7c2bb..612ab789c1 100644 --- a/resources/standards-data/ldml-keyboards/techpreview/dtd/ldmlKeyboardTest.xsd +++ b/resources/standards-data/ldml-keyboards/techpreview/dtd/ldmlKeyboardTest.xsd @@ -1,5 +1,8 @@ - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/resources/standards-data/ldml-keyboards/techpreview/import/scanCodes-implied.xml b/resources/standards-data/ldml-keyboards/techpreview/import/scanCodes-implied.xml new file mode 100644 index 0000000000..2ebb0ac85a --- /dev/null +++ b/resources/standards-data/ldml-keyboards/techpreview/import/scanCodes-implied.xml @@ -0,0 +1,28 @@ + + + +
+ + + + + + + +
+ + + + + \ No newline at end of file diff --git a/resources/standards-data/ldml-keyboards/techpreview/ldml-keyboard.schema.json b/resources/standards-data/ldml-keyboards/techpreview/ldml-keyboard.schema.json index 169c9c1f3b..cd91f563a1 100644 --- a/resources/standards-data/ldml-keyboards/techpreview/ldml-keyboard.schema.json +++ b/resources/standards-data/ldml-keyboards/techpreview/ldml-keyboard.schema.json @@ -101,6 +101,55 @@ ], "type": "object" }, + "form": { + "additionalProperties": false, + "properties": { + "id": { + "type": "string" + }, + "scanCodes": { + "items": { + "$ref": "#/definitions/scanCodes" + }, + "minItems": 1, + "type": "array" + }, + "special": { + "items": { + "$ref": "#/definitions/special" + }, + "type": "array" + } + }, + "required": [ + "scanCodes" + ], + "type": "object" + }, + "forms": { + "additionalProperties": false, + "properties": { + "form": { + "items": { + "$ref": "#/definitions/form" + }, + "type": "array" + }, + "import": { + "items": { + "$ref": "#/definitions/import" + }, + "type": "array" + }, + "special": { + "items": { + "$ref": "#/definitions/special" + }, + "type": "array" + } + }, + "type": "object" + }, "import": { "additionalProperties": false, "properties": { @@ -250,13 +299,6 @@ "additionalProperties": false, "properties": { "form": { - "enum": [ - "touch", - "us", - "iso", - "jis", - "abnt2" - ], "type": "string" }, "import": { @@ -389,6 +431,18 @@ ], "type": "object" }, + "scanCodes": { + "additionalProperties": false, + "properties": { + "codes": { + "type": "string" + } + }, + "required": [ + "codes" + ], + "type": "object" + }, "set": { "additionalProperties": false, "properties": { @@ -636,6 +690,9 @@ "displays": { "$ref": "#/definitions/displays" }, + "forms": { + "$ref": "#/definitions/forms" + }, "import": { "items": { "$ref": "#/definitions/import" diff --git a/resources/standards-data/ldml-keyboards/techpreview/test/fr-t-k0-azerty-test.xml b/resources/standards-data/ldml-keyboards/techpreview/test/fr-t-k0-azerty-test.xml index 638fe3954f..5c827d6b87 100644 --- a/resources/standards-data/ldml-keyboards/techpreview/test/fr-t-k0-azerty-test.xml +++ b/resources/standards-data/ldml-keyboards/techpreview/test/fr-t-k0-azerty-test.xml @@ -6,17 +6,17 @@ - + - + - + - + - + diff --git a/resources/standards-data/ldml-keyboards/techpreview/test/ja-Latn-test.xml b/resources/standards-data/ldml-keyboards/techpreview/test/ja-Latn-test.xml index 047795bad4..a1e3a185eb 100644 --- a/resources/standards-data/ldml-keyboards/techpreview/test/ja-Latn-test.xml +++ b/resources/standards-data/ldml-keyboards/techpreview/test/ja-Latn-test.xml @@ -3,7 +3,7 @@ + chars="[a-z A-Z 0-9 !\u{0022}#$%\u{0026}\[\]\{\}=\-|¥~\^_\u{0020}\u{003c}>,./?`@\+\*]" type="simple" /> diff --git a/resources/standards-data/ldml-keyboards/techpreview/test/pt-t-k0-abnt2-test.xml b/resources/standards-data/ldml-keyboards/techpreview/test/pt-t-k0-abnt2-test.xml index 3457ab67fa..4eb59db813 100644 --- a/resources/standards-data/ldml-keyboards/techpreview/test/pt-t-k0-abnt2-test.xml +++ b/resources/standards-data/ldml-keyboards/techpreview/test/pt-t-k0-abnt2-test.xml @@ -3,7 +3,7 @@ @@ -35,7 +35,7 @@ - + From 71c6bfb9604ff737ad98aa33dbc2492d0cf657ab Mon Sep 17 00:00:00 2001 From: Eberhard Beilharz Date: Thu, 14 Sep 2023 11:31:29 +0200 Subject: [PATCH 03/47] refactor(linux): Reformat file --- linux/ibus-keyman/src/main.c | 144 +++++++++++++++++------------------ 1 file changed, 68 insertions(+), 76 deletions(-) diff --git a/linux/ibus-keyman/src/main.c b/linux/ibus-keyman/src/main.c index e23a1a58e3..1ced759047 100644 --- a/linux/ibus-keyman/src/main.c +++ b/linux/ibus-keyman/src/main.c @@ -23,125 +23,117 @@ #include #include -#include #include -#include "keymanutil.h" +#include #include "engine.h" #include "keyman-service.h" +#include "keymanutil.h" -static IBusBus *bus = NULL; +static IBusBus *bus = NULL; static IBusFactory *factory = NULL; /* options */ -static gboolean xml = FALSE; +static gboolean xml = FALSE; static gboolean ibus = FALSE; -gboolean testing = FALSE; +gboolean testing = FALSE; -static const GOptionEntry entries[] = -{ - { "xml", 'x', 0, G_OPTION_ARG_NONE, &xml, "generate xml for engines", NULL }, - { "ibus", 'i', 0, G_OPTION_ARG_NONE, &ibus, "component is executed by ibus", NULL }, - { "testing", 0, 0, G_OPTION_ARG_NONE, &testing, "component is executed by integration testing", NULL}, - { NULL }, +static const GOptionEntry entries[] = { + {"xml", 'x', 0, G_OPTION_ARG_NONE, &xml, "generate xml for engines", NULL}, + {"ibus", 'i', 0, G_OPTION_ARG_NONE, &ibus, "component is executed by ibus", NULL}, + {"testing", 0, 0, G_OPTION_ARG_NONE, &testing, "component is executed by integration testing", NULL}, + {NULL}, }; // Add an environment variable to see debug messages: export G_MESSAGES_DEBUG=all static void -ibus_disconnected_cb (IBusBus *unused_bus, - gpointer unused_data) -{ - g_debug ("bus disconnected"); - KeymanService *service = km_service_get_default(NULL); - g_clear_object(&service); +ibus_disconnected_cb(IBusBus *unused_bus, gpointer unused_data) { + g_debug("bus disconnected"); + KeymanService *service = km_service_get_default(NULL); + g_clear_object(&service); - g_object_unref(factory); - g_object_unref(bus); + g_object_unref(factory); + g_object_unref(bus); - ibus_quit (); + ibus_quit(); } - static void -start_component (void) -{ - GList *engines, *p; - IBusComponent *component; +start_component(void) { + GList *engines, *p; + IBusComponent *component; - ibus_init (); + ibus_init(); - bus = ibus_bus_new (); - g_signal_connect (bus, "disconnected", G_CALLBACK (ibus_disconnected_cb), NULL); + bus = ibus_bus_new(); + g_signal_connect(bus, "disconnected", G_CALLBACK(ibus_disconnected_cb), NULL); - component = ibus_keyman_get_component (); + component = ibus_keyman_get_component(); - factory = ibus_factory_new (ibus_bus_get_connection (bus)); + factory = ibus_factory_new(ibus_bus_get_connection(bus)); - engines = ibus_component_get_engines (component); - for (p = engines; p != NULL; p = p->next) { - IBusEngineDesc *engine = (IBusEngineDesc *)p->data; -#if IBUS_CHECK_VERSION(1,3,99) - const gchar *engine_name = ibus_engine_desc_get_name (engine); + engines = ibus_component_get_engines(component); + for (p = engines; p != NULL; p = p->next) { + IBusEngineDesc *engine = (IBusEngineDesc *)p->data; +#if IBUS_CHECK_VERSION(1, 3, 99) + const gchar *engine_name = ibus_engine_desc_get_name(engine); #else - const gchar *engine_name = engine->name; -#endif /* !IBUS_CHECK_VERSION(1,3,99) */ - ibus_factory_add_engine (factory, engine_name, IBUS_TYPE_KEYMAN_ENGINE); - } + const gchar *engine_name = engine->name; +#endif /* !IBUS_CHECK_VERSION(1,3,99) */ + ibus_factory_add_engine(factory, engine_name, IBUS_TYPE_KEYMAN_ENGINE); + } - if (ibus) { - ibus_bus_request_name (bus, "org.freedesktop.IBus.Keyman", 0); - } - else { - ibus_bus_register_component (bus, component); - } + if (ibus) { + ibus_bus_request_name(bus, "org.freedesktop.IBus.Keyman", 0); + } else { + ibus_bus_register_component(bus, component); + } - g_object_unref (component); - km_service_get_default(NULL); // initialise dbus service + g_object_unref(component); + km_service_get_default(NULL); // initialise dbus service - ibus_main (); + ibus_main(); } static void -print_engines_xml (void) -{ - IBusComponent *component; - GString *output; +print_engines_xml(void) { + IBusComponent *component; + GString *output; - ibus_init (); + ibus_init(); - component = ibus_keyman_get_component (); - output = g_string_new (""); + component = ibus_keyman_get_component(); + output = g_string_new(""); - ibus_component_output_engines (component, output, 0); + ibus_component_output_engines(component, output, 0); - fprintf (stdout, "%s", output->str); + fprintf(stdout, "%s", output->str); - g_string_free (output, TRUE); - g_object_unref(component); + g_string_free(output, TRUE); + g_object_unref(component); } int -main (gint argc, gchar **argv) -{ - GError *error = NULL; - GOptionContext *context; +main(gint argc, gchar **argv) { + GError *error = NULL; + GOptionContext *context; - setlocale (LC_ALL, ""); + setlocale(LC_ALL, ""); - context = g_option_context_new ("- ibus Keyman engine component"); + context = g_option_context_new("- ibus Keyman engine component"); - g_option_context_add_main_entries (context, entries, "ibus-keyman"); + g_option_context_add_main_entries(context, entries, "ibus-keyman"); - if (!g_option_context_parse (context, &argc, &argv, &error)) { - g_print ("Option parsing failed: %s\n", error->message); - exit (-1); - } + if (!g_option_context_parse(context, &argc, &argv, &error)) { + g_print("Option parsing failed: %s\n", error->message); + exit(-1); + } - if (xml) { - print_engines_xml (); - exit (0); - } + if (xml) { + print_engines_xml(); + exit(0); + } - start_component (); - return 0; + start_component(); + return 0; } From 7c7d46720c13fadd1ecf36394874b0e3c79e8fc9 Mon Sep 17 00:00:00 2001 From: Eberhard Beilharz Date: Fri, 15 Sep 2023 12:08:17 +0200 Subject: [PATCH 04/47] chore(linux): Split startup process This change improves the startup method so that it will also work if ibus hasn't started yet. Also fixes two memory leaks. --- linux/ibus-keyman/src/keymanutil.c | 16 +++++---- linux/ibus-keyman/src/main.c | 57 +++++++++++++++++++++--------- 2 files changed, 51 insertions(+), 22 deletions(-) diff --git a/linux/ibus-keyman/src/keymanutil.c b/linux/ibus-keyman/src/keymanutil.c index c9fbed80d9..ce06280a5e 100644 --- a/linux/ibus-keyman/src/keymanutil.c +++ b/linux/ibus-keyman/src/keymanutil.c @@ -290,10 +290,17 @@ ibus_keyman_list_engines (void) return engines; } +void +add_engine(gpointer data, gpointer user_data) { + IBusEngineDesc *desc = IBUS_ENGINE_DESC(data); + IBusComponent *component = IBUS_COMPONENT(user_data); + ibus_component_add_engine(component, desc); +} + IBusComponent * ibus_keyman_get_component (void) { - GList *engines, *p; + GList *engines; IBusComponent *component; component = ibus_component_new ("org.freedesktop.IBus.Keyman", @@ -306,12 +313,9 @@ ibus_keyman_get_component (void) "ibus-keyman"); engines = ibus_keyman_list_engines (); - - for (p = engines; p != NULL; p = p->next) { - ibus_component_add_engine (component, (IBusEngineDesc *) p->data); - } - + g_list_foreach(engines, add_engine, component); g_list_free (engines); + return component; } diff --git a/linux/ibus-keyman/src/main.c b/linux/ibus-keyman/src/main.c index 1ced759047..80e67458bc 100644 --- a/linux/ibus-keyman/src/main.c +++ b/linux/ibus-keyman/src/main.c @@ -59,29 +59,33 @@ ibus_disconnected_cb(IBusBus *unused_bus, gpointer unused_data) { } static void -start_component(void) { - GList *engines, *p; +add_single_keyboard(gpointer data, gpointer user_data) { + IBusEngineDesc *engine = IBUS_ENGINE_DESC(data); +#if IBUS_CHECK_VERSION(1, 3, 99) + const gchar *engine_name = ibus_engine_desc_get_name(engine); +#else + const gchar *engine_name = engine->name; +#endif /* !IBUS_CHECK_VERSION(1,3,99) */ + ibus_factory_add_engine(factory, engine_name, IBUS_TYPE_KEYMAN_ENGINE); +} + +static void +add_keyboards(IBusBus *bus, gpointer user_data) { + GList *engines; IBusComponent *component; - ibus_init(); - - bus = ibus_bus_new(); - g_signal_connect(bus, "disconnected", G_CALLBACK(ibus_disconnected_cb), NULL); + g_message("Adding keyboards to ibus"); component = ibus_keyman_get_component(); - factory = ibus_factory_new(ibus_bus_get_connection(bus)); + GDBusConnection *connection = ibus_bus_get_connection(bus); + factory = ibus_factory_new(connection); + + g_signal_connect(bus, "disconnected", G_CALLBACK(ibus_disconnected_cb), NULL); engines = ibus_component_get_engines(component); - for (p = engines; p != NULL; p = p->next) { - IBusEngineDesc *engine = (IBusEngineDesc *)p->data; -#if IBUS_CHECK_VERSION(1, 3, 99) - const gchar *engine_name = ibus_engine_desc_get_name(engine); -#else - const gchar *engine_name = engine->name; -#endif /* !IBUS_CHECK_VERSION(1,3,99) */ - ibus_factory_add_engine(factory, engine_name, IBUS_TYPE_KEYMAN_ENGINE); - } + g_list_foreach(engines, add_single_keyboard, NULL); + g_list_free(engines); if (ibus) { ibus_bus_request_name(bus, "org.freedesktop.IBus.Keyman", 0); @@ -91,6 +95,22 @@ start_component(void) { g_object_unref(component); km_service_get_default(NULL); // initialise dbus service +} + +static void +start_component(void) { + g_message("Starting ibus-engine-keyman"); + + ibus_init(); + + bus = ibus_bus_new(); + + if (ibus_bus_is_connected(bus)) { + add_keyboards(bus, NULL); + } else { + g_message("Waiting for ibus-daemon to start up..."); + g_signal_connect(bus, "connected", G_CALLBACK(add_keyboards), NULL); + } ibus_main(); } @@ -126,14 +146,19 @@ main(gint argc, gchar **argv) { if (!g_option_context_parse(context, &argc, &argv, &error)) { g_print("Option parsing failed: %s\n", error->message); + g_option_context_free(context); exit(-1); } if (xml) { print_engines_xml(); + g_option_context_free(context); exit(0); } start_component(); + + g_option_context_free(context); + g_message("Exiting ibus-engine-keyman"); return 0; } From 28012d1f7d0b7eefa37f432de5ee5057e901903e Mon Sep 17 00:00:00 2001 From: "Steven R. Loomis" Date: Fri, 15 Sep 2023 14:23:28 -0400 Subject: [PATCH 05/47] =?UTF-8?q?chore(developer):=20ldml=20fix=20for=20up?= =?UTF-8?q?date=20=F0=9F=99=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - hardware types isn't a fixed set anymore - un-mothball the pertinent error type Related to #9403, exposed during #9515 CLDR update --- developer/src/kmc-ldml/src/compiler/messages.ts | 3 --- developer/src/kmc-ldml/test/test-layr.ts | 10 ++++------ 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/developer/src/kmc-ldml/src/compiler/messages.ts b/developer/src/kmc-ldml/src/compiler/messages.ts index a701abbcb0..804ec1d02d 100644 --- a/developer/src/kmc-ldml/src/compiler/messages.ts +++ b/developer/src/kmc-ldml/src/compiler/messages.ts @@ -90,9 +90,6 @@ export class CompilerMessages { static Error_InvalidHardware = (o:{form: string}) => m(this.ERROR_InvalidHardware, `layers has invalid value form=${o.form}`); - /** - * Note: may not hit this due to XML validation. - */ static ERROR_InvalidHardware = SevError | 0x0013; static Error_InvalidModifier = (o:{layer: string, modifier: string}) => m(this.ERROR_InvalidModifier, diff --git a/developer/src/kmc-ldml/test/test-layr.ts b/developer/src/kmc-ldml/test/test-layr.ts index e928882698..86c7e2729b 100644 --- a/developer/src/kmc-ldml/test/test-layr.ts +++ b/developer/src/kmc-ldml/test/test-layr.ts @@ -3,7 +3,7 @@ import { assert } from 'chai'; import { LayrCompiler } from '../src/compiler/layr.js'; import { CompilerMessages } from '../src/compiler/messages.js'; import { compilerTestCallbacks, loadSectionFixture, testCompilationCases } from './helpers/index.js'; -import { KMXPlus, CommonTypesMessages } from '@keymanapp/common-types'; +import { KMXPlus } from '@keymanapp/common-types'; import { constants } from '@keymanapp/ldml-keyboard-constants'; import Layr = KMXPlus.Layr; @@ -106,11 +106,9 @@ describe('layr', function () { }, { subpath: 'sections/layr/invalid-invalid-form.xml', - errors: [CommonTypesMessages.Error_SchemaValidationError({ - instancePath: '/keyboard/layers/0/form', - keyword: 'enum', - message: 'must be equal to one of the allowed values', - params: `allowedValues="touch,us,iso,jis,abnt2"`}),], + errors: [CompilerMessages.Error_InvalidHardware({ + form: 'holographic', + }),], }, { // missing layer element From 213dd7d2adcfbfdcc96b7d71b9bf34bed26c9fa1 Mon Sep 17 00:00:00 2001 From: "Steven R. Loomis" Date: Fri, 15 Sep 2023 18:22:41 +0100 Subject: [PATCH 06/47] =?UTF-8?q?fix(developer):=20ldml=20drop=20\u1234=20?= =?UTF-8?q?=F0=9F=99=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - for now, convert \u{1234} to \u1234 before going into UnicodeSet. - for feat(core): ldml drop \u1234 format 🙀 #9515 --- developer/src/kmc-kmn/src/compiler/compiler.ts | 10 ++++++++++ developer/src/kmc-kmn/test/test-wasm-uset.ts | 12 ++++++++++++ 2 files changed, 22 insertions(+) diff --git a/developer/src/kmc-kmn/src/compiler/compiler.ts b/developer/src/kmc-kmn/src/compiler/compiler.ts index 33d1b545f5..c3c3bb3256 100644 --- a/developer/src/kmc-kmn/src/compiler/compiler.ts +++ b/developer/src/kmc-kmn/src/compiler/compiler.ts @@ -421,6 +421,12 @@ export class KmnCompiler implements UnicodeSetParser { return Module.kmcmp_testSentry(); } + /** convert `\u{1234}` to `\u1234` */ + public static fixNewPattern(pattern: string) : string { + return pattern.replaceAll(/\\u\{([0-9a-fA-F]{4})\}/g, `\\u$1`); + // TODO-LDML: other lengths! #9515 + } + /** * * @param pattern UnicodeSet pattern such as `[a-z]` @@ -435,6 +441,8 @@ export class KmnCompiler implements UnicodeSetParser { // TODO-LDML: Catch OOM const buf = this.wasmExports.malloc(rangeCount * 2 * Module.HEAPU32.BYTES_PER_ELEMENT); + // fix \u1234 pattern format + pattern = KmnCompiler.fixNewPattern(pattern); /** If <= 0: return code. If positive: range count */ const rc = Module.kmcmp_parseUnicodeSet(pattern, buf, rangeCount * 2); if (rc >= 0) { @@ -459,6 +467,8 @@ export class KmnCompiler implements UnicodeSetParser { /* c8 ignore next 2 */ return null; } + // fix \u1234 pattern format + pattern = KmnCompiler.fixNewPattern(pattern); // call with rangeCount = 0 to invoke in 'preflight' mode. const rc = Module.kmcmp_parseUnicodeSet(pattern, 0, 0); if (rc >= 0) { diff --git a/developer/src/kmc-kmn/test/test-wasm-uset.ts b/developer/src/kmc-kmn/test/test-wasm-uset.ts index a924f9fe05..3d9c4e0139 100644 --- a/developer/src/kmc-kmn/test/test-wasm-uset.ts +++ b/developer/src/kmc-kmn/test/test-wasm-uset.ts @@ -6,6 +6,18 @@ import { CompilerMessages } from '../src/compiler/messages.js'; import { compilerErrorFormatCode } from '@keymanapp/common-types'; describe('Compiler UnicodeSet function', function() { + it('should fixup \\u1234 format escapes', function() { + assert.equal(KmnCompiler.fixNewPattern(`\\u{1234}`), `\\u1234`); + assert.equal(KmnCompiler.fixNewPattern(`\\u1234`), `\\u1234`); + assert.equal(KmnCompiler.fixNewPattern(`[\\u{1234}-\\u{5678}]`), `[\\u1234-\\u5678]`); + assert.equal(KmnCompiler.fixNewPattern(`something else`), `something else`); + }); + + it.skip('should fixup more creative \\u format escapes', function() { + assert.equal(KmnCompiler.fixNewPattern(`\\u{22}`), `\\u0022`); // " + assert.equal(KmnCompiler.fixNewPattern(`\\u{1F640}`), `\\uD83D\\uDE40`); // TODO-LDM #9515: or something, 🙀 + }); + it('should start', async function() { const compiler = new KmnCompiler(); const callbacks = new TestCompilerCallbacks(); From 256017110b1908e5aeb68f4dfe430e76e32c754e Mon Sep 17 00:00:00 2001 From: "Steven R. Loomis" Date: Fri, 15 Sep 2023 14:40:09 -0400 Subject: [PATCH 07/47] =?UTF-8?q?fix(developer):=20ldml=20drop=20\u1234=20?= =?UTF-8?q?=F0=9F=99=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - temporarily roll back change to test.xml - for feat(core): ldml drop \u1234 format 🙀 #9515 --- .../techpreview/test/fr-t-k0-azerty-test.xml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/resources/standards-data/ldml-keyboards/techpreview/test/fr-t-k0-azerty-test.xml b/resources/standards-data/ldml-keyboards/techpreview/test/fr-t-k0-azerty-test.xml index 5c827d6b87..23a0cdba51 100644 --- a/resources/standards-data/ldml-keyboards/techpreview/test/fr-t-k0-azerty-test.xml +++ b/resources/standards-data/ldml-keyboards/techpreview/test/fr-t-k0-azerty-test.xml @@ -2,21 +2,21 @@ - + - + - + - + - + - + From 27508571c9bebee37e1b14f27939d410b3a4784d Mon Sep 17 00:00:00 2001 From: "Steven R. Loomis" Date: Fri, 15 Sep 2023 15:27:47 -0400 Subject: [PATCH 08/47] =?UTF-8?q?fix(developer):=20ldml=20drop=20\u1234=20?= =?UTF-8?q?=F0=9F=99=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - fix 1..6 char Unicode escapes with an unrolled loop - for feat(core): ldml drop \u1234 format 🙀 #9515 --- .../src/kmc-kmn/src/compiler/compiler.ts | 11 ++++-- developer/src/kmc-kmn/test/test-wasm-uset.ts | 39 +++++++++++++++++-- 2 files changed, 43 insertions(+), 7 deletions(-) diff --git a/developer/src/kmc-kmn/src/compiler/compiler.ts b/developer/src/kmc-kmn/src/compiler/compiler.ts index c3c3bb3256..6f5f9b331a 100644 --- a/developer/src/kmc-kmn/src/compiler/compiler.ts +++ b/developer/src/kmc-kmn/src/compiler/compiler.ts @@ -421,10 +421,15 @@ export class KmnCompiler implements UnicodeSetParser { return Module.kmcmp_testSentry(); } - /** convert `\u{1234}` to `\u1234` */ + /** convert `\u{1234}` to `\u1234` etc */ public static fixNewPattern(pattern: string) : string { - return pattern.replaceAll(/\\u\{([0-9a-fA-F]{4})\}/g, `\\u$1`); - // TODO-LDML: other lengths! #9515 + pattern = pattern.replaceAll(/\\u\{([0-9a-fA-F]{6})\}/g, `\\U00$1`); + pattern = pattern.replaceAll(/\\u\{([0-9a-fA-F]{5})\}/g, `\\U000$1`); + pattern = pattern.replaceAll(/\\u\{([0-9a-fA-F]{4})\}/g, `\\u$1`); + pattern = pattern.replaceAll(/\\u\{([0-9a-fA-F]{3})\}/g, `\\u0$1`); + pattern = pattern.replaceAll(/\\u\{([0-9a-fA-F]{2})\}/g, `\\u00$1`); + pattern = pattern.replaceAll(/\\u\{([0-9a-fA-F]{1})\}/g, `\\u000$1`); + return pattern; } /** diff --git a/developer/src/kmc-kmn/test/test-wasm-uset.ts b/developer/src/kmc-kmn/test/test-wasm-uset.ts index 3d9c4e0139..0b11ddf789 100644 --- a/developer/src/kmc-kmn/test/test-wasm-uset.ts +++ b/developer/src/kmc-kmn/test/test-wasm-uset.ts @@ -6,16 +6,20 @@ import { CompilerMessages } from '../src/compiler/messages.js'; import { compilerErrorFormatCode } from '@keymanapp/common-types'; describe('Compiler UnicodeSet function', function() { + it('should fixup "short" \\u{} escapes', function () { + assert.equal(KmnCompiler.fixNewPattern(`\\u{A}`), `\\u000A`); // " + assert.equal(KmnCompiler.fixNewPattern(`\\u{22}`), `\\u0022`); // " + assert.equal(KmnCompiler.fixNewPattern(`\\u{ead}`), `\\u0ead`); // " + }); it('should fixup \\u1234 format escapes', function() { assert.equal(KmnCompiler.fixNewPattern(`\\u{1234}`), `\\u1234`); assert.equal(KmnCompiler.fixNewPattern(`\\u1234`), `\\u1234`); assert.equal(KmnCompiler.fixNewPattern(`[\\u{1234}-\\u{5678}]`), `[\\u1234-\\u5678]`); assert.equal(KmnCompiler.fixNewPattern(`something else`), `something else`); }); - - it.skip('should fixup more creative \\u format escapes', function() { - assert.equal(KmnCompiler.fixNewPattern(`\\u{22}`), `\\u0022`); // " - assert.equal(KmnCompiler.fixNewPattern(`\\u{1F640}`), `\\uD83D\\uDE40`); // TODO-LDM #9515: or something, 🙀 + it('should fixup supplemental \\u format escapes', function() { + assert.equal(KmnCompiler.fixNewPattern(`\\u{1F640}`), `\\U0001F640`); + assert.equal(KmnCompiler.fixNewPattern(`\\u{10FFFD}`),`\\U0010FFFD`); }); it('should start', async function() { @@ -63,6 +67,33 @@ describe('Compiler UnicodeSet function', function() { assert.deepEqual(callbacks.messages, []); assert.equal(len2, set.length); }); + it('should compile an even more complex uset', async function() { + const compiler = new KmnCompiler(); + const callbacks = new TestCompilerCallbacks(); + assert(await compiler.init(callbacks)); + assert(compiler.verifyInitialized()); + + const pat = "[\\u{10FFFD}\\u{2019}\\u{22}\\u{a}\\u{ead}\\u{1F640}]"; + const set = compiler.parseUnicodeSet(pat, 23); + + assert.equal(set.length, 6); + // verify we're all single chars + for (let i = 0; i Date: Sat, 16 Sep 2023 14:02:22 -0400 Subject: [PATCH 09/47] auto: increment master version to 17.0.175 --- HISTORY.md | 4 ++++ VERSION.md | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/HISTORY.md b/HISTORY.md index 09a45f661b..2f82a38f36 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -1,5 +1,9 @@ # Keyman Version History +## 17.0.174 alpha 2023-09-16 + +* refactor(linux): Reformat file (#9569) + ## 17.0.173 alpha 2023-09-13 * chore(common): Update to Unicode 15.1 (#9555) diff --git a/VERSION.md b/VERSION.md index 5ebcd945ab..60908d105a 100644 --- a/VERSION.md +++ b/VERSION.md @@ -1 +1 @@ -17.0.174 \ No newline at end of file +17.0.175 \ No newline at end of file From 1e734a47f5337515b58cfdc55145bc5dd4de2660 Mon Sep 17 00:00:00 2001 From: Eberhard Beilharz Date: Mon, 18 Sep 2023 18:49:04 +0200 Subject: [PATCH 10/47] docs(common): Fix documentation for builder_describe_internal_dependency Fixes #9581. --- resources/build/build-utils.md | 4 ++-- resources/builder.inc.sh | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/resources/build/build-utils.md b/resources/build/build-utils.md index 6c27e5e8a4..5ba91cffc6 100644 --- a/resources/build/build-utils.md +++ b/resources/build/build-utils.md @@ -510,8 +510,8 @@ builder_describe_internal_dependency action:target depaction:deptarget ... ```bash builder_describe_internal_dependency \ - mac:build mac-x86_64:build \ - mac:build mac-arm64:build + build:mac build:mac-x86_64 \ + build:mac build:mac-arm64 ``` **Note:** actions and targets must be fully specified, and this _must_ be called diff --git a/resources/builder.inc.sh b/resources/builder.inc.sh index d4d6bf7e2a..0eb4b995b6 100755 --- a/resources/builder.inc.sh +++ b/resources/builder.inc.sh @@ -1143,8 +1143,8 @@ _builder_define_default_internal_dep() { # 2: depaction:deptarget The dependency action and target # Example: # builder_describe_internal_dependency \ -# mac:build mac-x86_64:build \ -# mac:build mac-arm64:build +# build:mac build:mac-x86_64 \ +# build:mac build:mac-arm64 # # Note: actions and targets must be fully specified, and this _must_ # be called before either builder_describe_outputs or builder_parse in From a03eca3d817f7cb9dbe26676c2544154d6cf24be Mon Sep 17 00:00:00 2001 From: Eberhard Beilharz Date: Thu, 3 Aug 2023 19:50:11 +0200 Subject: [PATCH 11/47] =?UTF-8?q?refactor(linux):=20Rename=20defines=20to?= =?UTF-8?q?=20clarify=20purpose=20=F0=9F=8F=98=EF=B8=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- linux/ibus-keyman/src/keymanutil.c | 8 ++-- linux/ibus-keyman/src/keymanutil.h | 9 +++-- linux/ibus-keyman/src/test/keymanutil_tests.c | 40 +++++++++---------- linux/keyman-config/.editorconfig | 2 +- 4 files changed, 31 insertions(+), 28 deletions(-) diff --git a/linux/ibus-keyman/src/keymanutil.c b/linux/ibus-keyman/src/keymanutil.c index ce06280a5e..9eb42c173b 100644 --- a/linux/ibus-keyman/src/keymanutil.c +++ b/linux/ibus-keyman/src/keymanutil.c @@ -335,8 +335,8 @@ keyman_get_options_fromdconf(gchar *package_id, g_message("keyman_get_options_fromdconf"); // Obtain keyboard options from DConf - gchar *path = g_strdup_printf("%s%s/%s/", KEYMAN_DCONF_PATH, package_id, keyboard_id); - GSettings *child_settings = g_settings_new_with_path(KEYMAN_CHILD_DCONF_NAME, path); + gchar *path = g_strdup_printf("%s%s/%s/", KEYMAN_DCONF_OPTIONS_PATH, package_id, keyboard_id); + GSettings *child_settings = g_settings_new_with_path(KEYMAN_DCONF_OPTIONS_CHILD_NAME, path); gchar **options = NULL; if (child_settings != NULL) { @@ -456,8 +456,8 @@ keyman_put_options_todconf(gchar *package_id, } // Write to DConf - gchar *path = g_strdup_printf("%s%s/%s/", KEYMAN_DCONF_PATH, package_id, keyboard_id); - GSettings *child_settings = g_settings_new_with_path(KEYMAN_CHILD_DCONF_NAME, path); + gchar *path = g_strdup_printf("%s%s/%s/", KEYMAN_DCONF_OPTIONS_PATH, package_id, keyboard_id); + GSettings *child_settings = g_settings_new_with_path(KEYMAN_DCONF_OPTIONS_CHILD_NAME, path); if (child_settings != NULL) { g_message("writing keyboard options to DConf"); diff --git a/linux/ibus-keyman/src/keymanutil.h b/linux/ibus-keyman/src/keymanutil.h index 1c455dd167..4b358c02ea 100644 --- a/linux/ibus-keyman/src/keymanutil.h +++ b/linux/ibus-keyman/src/keymanutil.h @@ -61,11 +61,14 @@ #define KEYMAN_ENVIRONMENT_OPTIONS 3 // Path information for Keyman keyboard options in DConf -#define KEYMAN_DCONF_NAME "com.keyman.options" -#define KEYMAN_CHILD_DCONF_NAME "com.keyman.options.child" -#define KEYMAN_DCONF_PATH "/desktop/ibus/keyman/options/" +#define KEYMAN_DCONF_OPTIONS_NAME "com.keyman.options" +#define KEYMAN_DCONF_OPTIONS_CHILD_NAME "com.keyman.options.child" +// TODO: migrate to /com/keyman/options to better follow Gnome recommmendations +// (https://docs.gtk.org/gio/class.Settings.html) (#9579) +#define KEYMAN_DCONF_OPTIONS_PATH "/desktop/ibus/keyman/options/" #define KEYMAN_DCONF_OPTIONS_KEY "options" + G_BEGIN_DECLS void ibus_keyman_init (void); diff --git a/linux/ibus-keyman/src/test/keymanutil_tests.c b/linux/ibus-keyman/src/test/keymanutil_tests.c index 8b49488cf7..80f77a72ea 100644 --- a/linux/ibus-keyman/src/test/keymanutil_tests.c +++ b/linux/ibus-keyman/src/test/keymanutil_tests.c @@ -6,27 +6,27 @@ #define TEST_FIXTURE "keymanutil-test" void -delete_key(gchar* testname) { - gchar *path = g_strdup_printf("%s%s/%s/", KEYMAN_DCONF_PATH, TEST_FIXTURE, testname); - GSettings *settings = g_settings_new_with_path(KEYMAN_CHILD_DCONF_NAME, path); +delete_options_key(gchar* testname) { + gchar *path = g_strdup_printf("%s%s/%s/", KEYMAN_DCONF_OPTIONS_PATH, TEST_FIXTURE, testname); + GSettings *settings = g_settings_new_with_path(KEYMAN_DCONF_OPTIONS_CHILD_NAME, path); g_settings_reset(settings, KEYMAN_DCONF_OPTIONS_KEY); g_object_unref(G_OBJECT(settings)); g_free(path); } void -set_key(gchar* testname, gchar** options) { - gchar *path = g_strdup_printf("%s%s/%s/", KEYMAN_DCONF_PATH, TEST_FIXTURE, testname); - GSettings *settings = g_settings_new_with_path(KEYMAN_CHILD_DCONF_NAME, path); +set_options_key(gchar* testname, gchar** options) { + gchar *path = g_strdup_printf("%s%s/%s/", KEYMAN_DCONF_OPTIONS_PATH, TEST_FIXTURE, testname); + GSettings *settings = g_settings_new_with_path(KEYMAN_DCONF_OPTIONS_CHILD_NAME, path); g_settings_set_strv(settings, KEYMAN_DCONF_OPTIONS_KEY, (const gchar* const*)options); g_object_unref(G_OBJECT(settings)); g_free(path); } gchar** -get_key(gchar* testname) { - gchar* path = g_strdup_printf("%s%s/%s/", KEYMAN_DCONF_PATH, TEST_FIXTURE, testname); - GSettings* settings = g_settings_new_with_path(KEYMAN_CHILD_DCONF_NAME, path); +get_options_key(gchar* testname) { + gchar* path = g_strdup_printf("%s%s/%s/", KEYMAN_DCONF_OPTIONS_PATH, TEST_FIXTURE, testname); + GSettings* settings = g_settings_new_with_path(KEYMAN_DCONF_OPTIONS_CHILD_NAME, path); gchar** result = g_settings_get_strv(settings, KEYMAN_DCONF_OPTIONS_KEY); g_object_unref(G_OBJECT(settings)); g_free(path); @@ -37,14 +37,14 @@ void test_keyman_put_options_todconf__new_key() { // Initialize gchar* testname = "test_keyman_put_options_todconf__new_key"; - delete_key(testname); + delete_options_key(testname); gchar* value = g_strdup_printf("%d", g_test_rand_int()); // Execute keyman_put_options_todconf(TEST_FIXTURE, testname, "new_key", value); // Verify - gchar** options = get_key(testname); + gchar** options = get_options_key(testname); gchar* expected = g_strdup_printf("new_key=%s", value); g_assert_nonnull(options); g_assert_cmpstr(options[0], ==, expected); @@ -54,23 +54,23 @@ test_keyman_put_options_todconf__new_key() { g_free(expected); g_free(value); g_strfreev(options); - delete_key(testname); + delete_options_key(testname); } void test_keyman_put_options_todconf__other_keys() { // Initialize gchar* testname = "test_keyman_put_options_todconf__other_keys"; - delete_key(testname); + delete_options_key(testname); gchar* existingKeys[] = {"key1=val1", "key2=val2", NULL}; - set_key(testname, existingKeys); + set_options_key(testname, existingKeys); gchar* value = g_strdup_printf("%d", g_test_rand_int()); // Execute keyman_put_options_todconf(TEST_FIXTURE, testname, "new_key", value); // Verify - gchar** options = get_key(testname); + gchar** options = get_options_key(testname); gchar* expected = g_strdup_printf("new_key=%s", value); g_assert_nonnull(options); g_assert_cmpstr(options[0], ==, "key1=val1"); @@ -82,23 +82,23 @@ test_keyman_put_options_todconf__other_keys() { g_free(expected); g_free(value); g_strfreev(options); - delete_key(testname); + delete_options_key(testname); } void test_keyman_put_options_todconf__existing_key() { // Initialize gchar* testname = "test_keyman_put_options_todconf__existing_key"; - delete_key(testname); + delete_options_key(testname); gchar* existingKeys[] = {"key1=val1", "new_key=val2", NULL}; - set_key(testname, existingKeys); + set_options_key(testname, existingKeys); gchar* value = g_strdup_printf("%d", g_test_rand_int()); // Execute keyman_put_options_todconf(TEST_FIXTURE, testname, "new_key", value); // Verify - gchar** options = get_key(testname); + gchar** options = get_options_key(testname); gchar* expected = g_strdup_printf("new_key=%s", value); g_assert_nonnull(options); g_assert_cmpstr(options[0], ==, "key1=val1"); @@ -109,7 +109,7 @@ test_keyman_put_options_todconf__existing_key() { g_free(expected); g_free(value); g_strfreev(options); - delete_key(testname); + delete_options_key(testname); } int diff --git a/linux/keyman-config/.editorconfig b/linux/keyman-config/.editorconfig index f65775da76..47f432c7aa 100644 --- a/linux/keyman-config/.editorconfig +++ b/linux/keyman-config/.editorconfig @@ -1,5 +1,5 @@ # Editor configuration, see https://editorconfig.org -[*] +[*.py] indent_style = space indent_size = 4 From a870b9a6c05f85ad3466d3e3af799bf119fcbd6a Mon Sep 17 00:00:00 2001 From: Eberhard Beilharz Date: Mon, 18 Sep 2023 18:44:11 +0200 Subject: [PATCH 12/47] chore(linux): Add coverage action to `ibus-keyman/build.sh` --- docs/settings/linux/tasks.json | 17 +++++++++++++++++ linux/ibus-keyman/build.sh | 22 ++++++++++++++++++++-- 2 files changed, 37 insertions(+), 2 deletions(-) diff --git a/docs/settings/linux/tasks.json b/docs/settings/linux/tasks.json index 9751c95a44..c5f2d06361 100644 --- a/docs/settings/linux/tasks.json +++ b/docs/settings/linux/tasks.json @@ -166,6 +166,23 @@ "group": "build", "detail": "run unit and integration tests of ibus-keyman" }, + { + "type": "shell", + "label": "ibus-keyman: report", + "command": "./build.sh", + "args": [ + "test", + "report", + "--debug", + "--coverage", + "--no-integration" + ], + "options": { + "cwd": "${workspaceFolder}/linux/ibus-keyman/", + }, + "group": "build", + "detail": "create unit test coverage" + }, { "type": "shell", "label": "keyman-config: tests", diff --git a/linux/ibus-keyman/build.sh b/linux/ibus-keyman/build.sh index 58bc057691..ecb6bd5e08 100755 --- a/linux/ibus-keyman/build.sh +++ b/linux/ibus-keyman/build.sh @@ -19,11 +19,16 @@ builder_describe \ "test" \ "install install artifacts" \ "uninstall uninstall artifacts" \ + "report create coverage report" \ "@/core:arch" \ - "--no-integration don't run integration tests" + "--no-integration don't run integration tests" \ + "--coverage capture test coverage" builder_parse "$@" +builder_describe_internal_dependency \ + report:engine test:engine + if builder_is_debug_build; then MESON_TARGET=debug export CPPFLAGS=-DG_MESSAGES_DEBUG @@ -40,6 +45,12 @@ builder_describe_outputs \ configure "${MESON_PATH}/build.ninja" \ build "${MESON_PATH}/src/ibus-engine-keyman" +if builder_has_option --coverage; then + MESON_COVERAGE=-Db_coverage=true +else + MESON_COVERAGE= +fi + if builder_start_action clean; then rm -rf "$THIS_SCRIPT_PATH/../build/" builder_finish_action success clean @@ -48,7 +59,7 @@ fi if builder_start_action configure; then cd "$THIS_SCRIPT_PATH" # shellcheck disable=SC2086 - meson setup "$MESON_PATH" --werror --buildtype $MESON_TARGET "${builder_extra_params[@]}" + meson setup "$MESON_PATH" --werror --buildtype $MESON_TARGET ${MESON_COVERAGE} "${builder_extra_params[@]}" builder_finish_action success configure fi @@ -79,3 +90,10 @@ if builder_start_action uninstall; then ninja uninstall builder_finish_action success uninstall fi + +if builder_start_action report; then + cd "$THIS_SCRIPT_PATH/$MESON_PATH" + # Note: requires lcov > 1.16 to properly work (see https://github.com/mesonbuild/meson/issues/6747) + ninja coverage-html + builder_finish_action success report +fi From 0c4d5067174dd757748f34c0042a616eb0c78624 Mon Sep 17 00:00:00 2001 From: Keyman Build Agent Date: Mon, 18 Sep 2023 14:02:08 -0400 Subject: [PATCH 13/47] auto: increment master version to 17.0.176 --- HISTORY.md | 4 ++++ VERSION.md | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/HISTORY.md b/HISTORY.md index 2f82a38f36..f2bd7ab3df 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -1,5 +1,9 @@ # Keyman Version History +## 17.0.175 alpha 2023-09-18 + +* chore(linux): Split startup process (#9570) + ## 17.0.174 alpha 2023-09-16 * refactor(linux): Reformat file (#9569) diff --git a/VERSION.md b/VERSION.md index 60908d105a..dd9aca5084 100644 --- a/VERSION.md +++ b/VERSION.md @@ -1 +1 @@ -17.0.175 \ No newline at end of file +17.0.176 \ No newline at end of file From f969c13423c17d6b8cbfddc025370657dbfa6332 Mon Sep 17 00:00:00 2001 From: Darcy Wong Date: Mon, 18 Sep 2023 18:07:16 +0700 Subject: [PATCH 14/47] change(web): Remove Android pendingLongpress --- web/src/app/webview/src/keymanEngine.ts | 1 - .../app/webview/src/osk/pendingLongpress.ts | 52 ------------------- web/src/app/webview/src/oskConfiguration.ts | 32 ------------ 3 files changed, 85 deletions(-) delete mode 100644 web/src/app/webview/src/osk/pendingLongpress.ts diff --git a/web/src/app/webview/src/keymanEngine.ts b/web/src/app/webview/src/keymanEngine.ts index 1cc7f08248..c22943d6b1 100644 --- a/web/src/app/webview/src/keymanEngine.ts +++ b/web/src/app/webview/src/keymanEngine.ts @@ -69,7 +69,6 @@ export default class KeymanEngine extends KeymanEngineBase void; - private readonly vkbd: VisualKeyboard; - - public readonly baseKey: KeyElement; - public readonly promise: Promise; - - constructor(vkbd: VisualKeyboard, e: KeyElement) { - this.vkbd = vkbd; - let _this = this; - - this.promise = new Promise(function(resolve) { - _this.resolver = resolve; - }); - this.baseKey = e; - } - - public resolve() { - if(this.resolver) { - this.resolver(new SubkeyDelegator(this.vkbd, this.baseKey)); - } - this.resolver = null; - } - - public cancel() { - if(this.resolver) { - this.resolver(null); - this.resolver = null; - } - } -} \ No newline at end of file diff --git a/web/src/app/webview/src/oskConfiguration.ts b/web/src/app/webview/src/oskConfiguration.ts index 80a8cdb698..242b130bff 100644 --- a/web/src/app/webview/src/oskConfiguration.ts +++ b/web/src/app/webview/src/oskConfiguration.ts @@ -5,7 +5,6 @@ import { type EmbeddedGestureConfig } from "keyman/engine/osk"; import { GlobeHint } from './osk/globeHint.js'; import { KeyTip } from './osk/keytip.js'; -import { PendingLongpress } from './osk/pendingLongpress.js'; import type KeymanEngine from "./keymanEngine.js"; export function setupEmbeddedListeners(engine: KeymanEngine, osk: OSKView) { @@ -45,35 +44,4 @@ export function buildEmbeddedGestureConfig(device: DeviceSpec) { return new GlobeHint(vkbd); } } - - if(device.OS == DeviceSpec.OperatingSystem.Android) { - embeddedGestureConfig.createKeyTip = (vkbd) => { - if(vkbd.device.formFactor == 'phone') { - return new KeyTip(window['oskCreateKeyPreview'], window['oskClearKeyPreview']); - } else { - return null; - } - } - - embeddedGestureConfig.startLongpress = (vkbd, key) => { - if(typeof(window['oskCreatePopup']) == 'function') { - var xBase = getAbsoluteX(key) - getAbsoluteX(vkbd.kbdDiv) + key.offsetWidth/2, - yBase = getAbsoluteY(key); - - // #3718: No longer prepend base key to subkey array - window['oskCreatePopup'](key['subKeys'], xBase, yBase, key.offsetWidth, key.offsetHeight); - - return new PendingLongpress(vkbd, key); - } else { - // When embedded within our Android app, we expect the `oskCreatePopup` function to - // exist; all subkey control is delegated to the app. - // - // No function = big problem. - console.error("Missing `oskCreatePopup` function for engine integration."); - return null; - } - } - - return embeddedGestureConfig; - } }; \ No newline at end of file From 584053af771c4eebe0bdaf55f1ef6374095263f0 Mon Sep 17 00:00:00 2001 From: Darcy Wong Date: Mon, 18 Sep 2023 18:07:51 +0700 Subject: [PATCH 15/47] change(android/engine): Use web-based longpress --- .../KMEA/app/src/main/assets/android-host.js | 2 +- .../java/com/keyman/engine/KMKeyboard.java | 26 ++----------------- 2 files changed, 3 insertions(+), 25 deletions(-) diff --git a/android/KMEA/app/src/main/assets/android-host.js b/android/KMEA/app/src/main/assets/android-host.js index 25e4223032..61e6c70d36 100644 --- a/android/KMEA/app/src/main/assets/android-host.js +++ b/android/KMEA/app/src/main/assets/android-host.js @@ -323,7 +323,7 @@ function showKeyboard() { function executePopupKey(keyID, keyText) { // KMW only needs keyID to process the popup key. keyText merely logged to console //window.console.log('executePopupKey('+keyID+'); keyText: ' + keyText); - keyman.executePopupKey(keyID); + keyman.executePopupKey(keyID, keyText); } // Cannot make it explicitly async / await on API 21. diff --git a/android/KMEA/app/src/main/java/com/keyman/engine/KMKeyboard.java b/android/KMEA/app/src/main/java/com/keyman/engine/KMKeyboard.java index bc0aed1d04..e6e4113e69 100644 --- a/android/KMEA/app/src/main/java/com/keyman/engine/KMKeyboard.java +++ b/android/KMEA/app/src/main/java/com/keyman/engine/KMKeyboard.java @@ -268,22 +268,12 @@ final class KMKeyboard extends WebView { @Override public boolean onScroll(MotionEvent e1, MotionEvent e2, float distanceX, float distanceY) { - if(e2.getY() - e1.getY() < -5) { // TODO: get better threshold value from KMW - if (subKeysList != null && (subKeysWindow == null || !subKeysWindow.isShowing())) { - showSubKeys(context); - return true; - } - } return false; } @Override public void onLongPress(MotionEvent event) { - // This is also called for banner longpresses! Need a way to differentiate the sources. - if (subKeysList != null && (subKeysWindow == null || !subKeysWindow.isShowing())) { - showSubKeys(context); - return; - } else if (KMManager.getGlobeKeyState() == KMManager.GlobeKeyState.GLOBE_KEY_STATE_DOWN) { + if (KMManager.getGlobeKeyState() == KMManager.GlobeKeyState.GLOBE_KEY_STATE_DOWN) { KMManager.setGlobeKeyState(KMManager.GlobeKeyState.GLOBE_KEY_STATE_LONGPRESS); KMManager.handleGlobeKeyAction(context, true, keyboardType); return; @@ -381,11 +371,7 @@ final class KMKeyboard extends WebView { // Come to think of it, I wonder if suggestionMenuWindow was work being done to link with // suggestion banner longpresses - if so, it's not yet ready for proper integration... // and would need its own rung in this if-else ladder. - if (subKeysWindow != null && suggestionMenuWindow == null && subKeysWindow.isShowing()) { - // Passes KMKeyboard (subclass of WebView)'s touch events off to our subkey window - // if active, allowing for smooth, integrated gesture control. - subKeysWindow.getContentView().findViewById(R.id.grid).dispatchTouchEvent(event); - } else { + if (true) { if (event.getPointerCount() > 1) { // Multiple points touch the screen at the same time, so dismiss any pending subkeys dismissKeyPreview(0); @@ -451,14 +437,6 @@ final class KMKeyboard extends WebView { } public void dismissSubKeysWindow() { - try { - if (subKeysWindow != null && subKeysWindow.isShowing()) { - subKeysWindow.dismiss(); - } - subKeysList = null; - } catch (Exception e) { - KMLog.LogException(TAG, "", e); - } } public void dismissSuggestionMenuWindow() { From 15de700db41d6dd5b6d41ee4fa01389897975a9b Mon Sep 17 00:00:00 2001 From: "Steven R. Loomis" Date: Mon, 18 Sep 2023 18:35:57 -0500 Subject: [PATCH 16/47] =?UTF-8?q?chore(resources):=20ldml=20update=20keybo?= =?UTF-8?q?ard=20->=20keyboard3=20=F0=9F=99=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - unicode-org/cldr:bd40148d4c8675d0fb2db8c36cfb9f8e328250a8 --- .../techpreview/3.0/fr-t-k0-azerty.xml | 6 +++--- .../ldml-keyboards/techpreview/3.0/ja-Latn.xml | 6 +++--- .../techpreview/3.0/mt-t-k0-47key.xml | 6 +++--- .../ldml-keyboards/techpreview/3.0/mt.xml | 6 +++--- .../techpreview/3.0/pt-t-k0-abnt2.xml | 6 +++--- .../ldml-keyboards/techpreview/cldr_info.json | 6 +++--- .../{ldmlKeyboard.dtd => ldmlKeyboard3.dtd} | 6 +++--- .../{ldmlKeyboard.xsd => ldmlKeyboard3.xsd} | 2 +- ...lKeyboardTest.dtd => ldmlKeyboardTest3.dtd} | 4 ++-- ...lKeyboardTest.xsd => ldmlKeyboardTest3.xsd} | 2 +- .../fetch-latest-cldr-techpreview.sh | 8 ++++++-- .../ldml-keyboards/techpreview/fixup-schema.js | 8 ++++---- .../techpreview/import/keys-Latn-implied.xml | 2 +- .../techpreview/import/keys-Zyyy-currency.xml | 2 +- .../import/keys-Zyyy-punctuation.xml | 2 +- ....schema.json => ldml-keyboard3.schema.json} | 6 +++--- ...ema.json => ldml-keyboardtest3.schema.json} | 6 +++--- .../techpreview/test/fr-t-k0-azerty-test.xml | 18 +++++++++--------- .../techpreview/test/ja-Latn-test.xml | 6 +++--- .../techpreview/test/pt-t-k0-abnt2-test.xml | 6 +++--- 20 files changed, 59 insertions(+), 55 deletions(-) rename resources/standards-data/ldml-keyboards/techpreview/dtd/{ldmlKeyboard.dtd => ldmlKeyboard3.dtd} (96%) rename resources/standards-data/ldml-keyboards/techpreview/dtd/{ldmlKeyboard.xsd => ldmlKeyboard3.xsd} (99%) rename resources/standards-data/ldml-keyboards/techpreview/dtd/{ldmlKeyboardTest.dtd => ldmlKeyboardTest3.dtd} (95%) rename resources/standards-data/ldml-keyboards/techpreview/dtd/{ldmlKeyboardTest.xsd => ldmlKeyboardTest3.xsd} (99%) rename resources/standards-data/ldml-keyboards/techpreview/{ldml-keyboard.schema.json => ldml-keyboard3.schema.json} (99%) rename resources/standards-data/ldml-keyboards/techpreview/{ldml-keyboardtest.schema.json => ldml-keyboardtest3.schema.json} (97%) diff --git a/resources/standards-data/ldml-keyboards/techpreview/3.0/fr-t-k0-azerty.xml b/resources/standards-data/ldml-keyboards/techpreview/3.0/fr-t-k0-azerty.xml index b7162f6e01..4ccedc062f 100644 --- a/resources/standards-data/ldml-keyboards/techpreview/3.0/fr-t-k0-azerty.xml +++ b/resources/standards-data/ldml-keyboards/techpreview/3.0/fr-t-k0-azerty.xml @@ -1,5 +1,5 @@ - + - + @@ -209,4 +209,4 @@ - + diff --git a/resources/standards-data/ldml-keyboards/techpreview/3.0/ja-Latn.xml b/resources/standards-data/ldml-keyboards/techpreview/3.0/ja-Latn.xml index a381fca230..8b5b845bf2 100644 --- a/resources/standards-data/ldml-keyboards/techpreview/3.0/ja-Latn.xml +++ b/resources/standards-data/ldml-keyboards/techpreview/3.0/ja-Latn.xml @@ -1,6 +1,6 @@ - - + + @@ -31,4 +31,4 @@ - + diff --git a/resources/standards-data/ldml-keyboards/techpreview/3.0/mt-t-k0-47key.xml b/resources/standards-data/ldml-keyboards/techpreview/3.0/mt-t-k0-47key.xml index 99a6b39d7b..02db33accc 100644 --- a/resources/standards-data/ldml-keyboards/techpreview/3.0/mt-t-k0-47key.xml +++ b/resources/standards-data/ldml-keyboards/techpreview/3.0/mt-t-k0-47key.xml @@ -1,6 +1,6 @@ - - + + @@ -81,4 +81,4 @@ - + diff --git a/resources/standards-data/ldml-keyboards/techpreview/3.0/mt.xml b/resources/standards-data/ldml-keyboards/techpreview/3.0/mt.xml index d52184fcc1..a5a415d874 100644 --- a/resources/standards-data/ldml-keyboards/techpreview/3.0/mt.xml +++ b/resources/standards-data/ldml-keyboards/techpreview/3.0/mt.xml @@ -1,12 +1,12 @@ - + - + @@ -84,4 +84,4 @@ - + diff --git a/resources/standards-data/ldml-keyboards/techpreview/3.0/pt-t-k0-abnt2.xml b/resources/standards-data/ldml-keyboards/techpreview/3.0/pt-t-k0-abnt2.xml index ddd35bcd68..6de82a8f9d 100644 --- a/resources/standards-data/ldml-keyboards/techpreview/3.0/pt-t-k0-abnt2.xml +++ b/resources/standards-data/ldml-keyboards/techpreview/3.0/pt-t-k0-abnt2.xml @@ -1,6 +1,6 @@ - - + + @@ -62,4 +62,4 @@ - + diff --git a/resources/standards-data/ldml-keyboards/techpreview/cldr_info.json b/resources/standards-data/ldml-keyboards/techpreview/cldr_info.json index 23d8cfe40d..f0014664bb 100644 --- a/resources/standards-data/ldml-keyboards/techpreview/cldr_info.json +++ b/resources/standards-data/ldml-keyboards/techpreview/cldr_info.json @@ -1,5 +1,5 @@ { - "sha": "61b74a36de8329daed152005133a699ae7f2012b", - "description": "release-44-alpha2-5-g61b74a36de", - "date": "Thu, 14 Sep 2023 07:38:47 +0000" + "sha": "bd40148d4c8675d0fb2db8c36cfb9f8e328250a8", + "description": "release-44-alpha3-3-gbd40148d4c", + "date": "Mon, 18 Sep 2023 23:31:25 +0000" } diff --git a/resources/standards-data/ldml-keyboards/techpreview/dtd/ldmlKeyboard.dtd b/resources/standards-data/ldml-keyboards/techpreview/dtd/ldmlKeyboard3.dtd similarity index 96% rename from resources/standards-data/ldml-keyboards/techpreview/dtd/ldmlKeyboard.dtd rename to resources/standards-data/ldml-keyboards/techpreview/dtd/ldmlKeyboard3.dtd index e668787eaf..668aa1740b 100644 --- a/resources/standards-data/ldml-keyboards/techpreview/dtd/ldmlKeyboard.dtd +++ b/resources/standards-data/ldml-keyboards/techpreview/dtd/ldmlKeyboard3.dtd @@ -10,11 +10,11 @@ The CLDR Keyboard Subcommittee is currently developing major changes to the CLDR Please view the subcommittee page for the most recent information. --> - + - + - + diff --git a/resources/standards-data/ldml-keyboards/techpreview/dtd/ldmlKeyboard.xsd b/resources/standards-data/ldml-keyboards/techpreview/dtd/ldmlKeyboard3.xsd similarity index 99% rename from resources/standards-data/ldml-keyboards/techpreview/dtd/ldmlKeyboard.xsd rename to resources/standards-data/ldml-keyboards/techpreview/dtd/ldmlKeyboard3.xsd index 1a88185499..027abb8a14 100644 --- a/resources/standards-data/ldml-keyboards/techpreview/dtd/ldmlKeyboard.xsd +++ b/resources/standards-data/ldml-keyboards/techpreview/dtd/ldmlKeyboard3.xsd @@ -16,7 +16,7 @@ Note: DTD @-annotations are not currently converted to .xsd. For full CLDR file Please view the subcommittee page for the most recent information. --> - + diff --git a/resources/standards-data/ldml-keyboards/techpreview/dtd/ldmlKeyboardTest.dtd b/resources/standards-data/ldml-keyboards/techpreview/dtd/ldmlKeyboardTest3.dtd similarity index 95% rename from resources/standards-data/ldml-keyboards/techpreview/dtd/ldmlKeyboardTest.dtd rename to resources/standards-data/ldml-keyboards/techpreview/dtd/ldmlKeyboardTest3.dtd index 1cb20db71e..f08d3b8a2b 100644 --- a/resources/standards-data/ldml-keyboards/techpreview/dtd/ldmlKeyboardTest.dtd +++ b/resources/standards-data/ldml-keyboards/techpreview/dtd/ldmlKeyboardTest3.dtd @@ -13,9 +13,9 @@ This DTD is a work in progress. Please see CLDR-15034 for the latest information. --> - + - + diff --git a/resources/standards-data/ldml-keyboards/techpreview/dtd/ldmlKeyboardTest.xsd b/resources/standards-data/ldml-keyboards/techpreview/dtd/ldmlKeyboardTest3.xsd similarity index 99% rename from resources/standards-data/ldml-keyboards/techpreview/dtd/ldmlKeyboardTest.xsd rename to resources/standards-data/ldml-keyboards/techpreview/dtd/ldmlKeyboardTest3.xsd index 612ab789c1..1c61ec482f 100644 --- a/resources/standards-data/ldml-keyboards/techpreview/dtd/ldmlKeyboardTest.xsd +++ b/resources/standards-data/ldml-keyboards/techpreview/dtd/ldmlKeyboardTest3.xsd @@ -19,7 +19,7 @@ Note: DTD @-annotations are not currently converted to .xsd. For full CLDR file Please see CLDR-15034 for the latest information. --> - + diff --git a/resources/standards-data/ldml-keyboards/techpreview/fetch-latest-cldr-techpreview.sh b/resources/standards-data/ldml-keyboards/techpreview/fetch-latest-cldr-techpreview.sh index a51566515c..b2ddcbda58 100755 --- a/resources/standards-data/ldml-keyboards/techpreview/fetch-latest-cldr-techpreview.sh +++ b/resources/standards-data/ldml-keyboards/techpreview/fetch-latest-cldr-techpreview.sh @@ -33,8 +33,8 @@ DATA_DIR="${KEYBOARDS_DIR}/3.0" TEST_DIR="${KEYBOARDS_DIR}/test" # a file to check -CHECK_1="${DTD_DIR}/ldmlKeyboard.dtd" # Critical, present in prior CLDR -CHECK_2="${DTD_DIR}/ldmlKeyboardTest.dtd" # Only in Keyboard 3.0+ +CHECK_1="${DTD_DIR}/ldmlKeyboard3.dtd" # Critical, present in prior CLDR +CHECK_2="${DTD_DIR}/ldmlKeyboardTest3.dtd" # Only in Keyboard 3.0+ if [[ ! -f "${CHECK_1}" ]]; then @@ -59,6 +59,10 @@ rm -rf ./import ./3.0 ./dtd ./test # copy over everything cp -Rv "${IMPORT_DIR}" "${DATA_DIR}" "${DTD_DIR}" "${TEST_DIR}" . +# delete old files, no reason to keep them +rm -vf dtd/{ldmlKeyboard,ldmlPlatform}.{xsd,dtd} + + echo "{\"sha\": \"${GIT_SHA}\",\"description\":\"${GIT_DESCRIBE}\",\"date\":\"${NOW}\"}" | ${JQ} . | tee cldr_info.json echo "Updated cldr_info.json" diff --git a/resources/standards-data/ldml-keyboards/techpreview/fixup-schema.js b/resources/standards-data/ldml-keyboards/techpreview/fixup-schema.js index 8c1fb54012..84f00f6711 100644 --- a/resources/standards-data/ldml-keyboards/techpreview/fixup-schema.js +++ b/resources/standards-data/ldml-keyboards/techpreview/fixup-schema.js @@ -48,12 +48,12 @@ function singleToArray(o) { } } -if (data.title.endsWith('ldmlKeyboard.xsd')) { - if (data?.properties?.keyboard) { - data.properties.keyboard.type = 'object'; +if (data.title.endsWith('ldmlKeyboard3.xsd')) { + if (data?.properties?.keyboard3) { + data.properties.keyboard3.type = 'object'; } - arrayToSingle(data?.properties?.keyboard?.properties?.vkeys); + arrayToSingle(data?.properties?.keyboard3?.properties?.vkeys); singleToArray(data?.definitions?.keys?.properties?.key); singleToArray(data?.definitions?.keys?.properties?.flicks); arrayToSingle(data?.definitions?.displays?.properties?.displayOptions); diff --git a/resources/standards-data/ldml-keyboards/techpreview/import/keys-Latn-implied.xml b/resources/standards-data/ldml-keyboards/techpreview/import/keys-Latn-implied.xml index 8de55e4185..eed84d38f8 100644 --- a/resources/standards-data/ldml-keyboards/techpreview/import/keys-Latn-implied.xml +++ b/resources/standards-data/ldml-keyboards/techpreview/import/keys-Latn-implied.xml @@ -9,7 +9,7 @@ CLDR data files are interpreted according to the LDML specification (http://unic This is the implied import for implied keys. Please note that any implied keys may be overridden by keyboard layouts. --> - + diff --git a/resources/standards-data/ldml-keyboards/techpreview/import/keys-Zyyy-currency.xml b/resources/standards-data/ldml-keyboards/techpreview/import/keys-Zyyy-currency.xml index e5e87c9a76..778cad451a 100644 --- a/resources/standards-data/ldml-keyboards/techpreview/import/keys-Zyyy-currency.xml +++ b/resources/standards-data/ldml-keyboards/techpreview/import/keys-Zyyy-currency.xml @@ -11,7 +11,7 @@ CLDR data files are interpreted according to the LDML specification (http://unic This file is subject to change. Please see https://cldr.unicode.org/index/keyboard-workgroup for the latest information. --> - + diff --git a/resources/standards-data/ldml-keyboards/techpreview/import/keys-Zyyy-punctuation.xml b/resources/standards-data/ldml-keyboards/techpreview/import/keys-Zyyy-punctuation.xml index 91f8f9dfaf..1e540cf024 100644 --- a/resources/standards-data/ldml-keyboards/techpreview/import/keys-Zyyy-punctuation.xml +++ b/resources/standards-data/ldml-keyboards/techpreview/import/keys-Zyyy-punctuation.xml @@ -5,7 +5,7 @@ This file is subject to change. Please see https://cldr.unicode.org/index/keyboard-workgroup for the latest information. --> - + diff --git a/resources/standards-data/ldml-keyboards/techpreview/ldml-keyboard.schema.json b/resources/standards-data/ldml-keyboards/techpreview/ldml-keyboard3.schema.json similarity index 99% rename from resources/standards-data/ldml-keyboards/techpreview/ldml-keyboard.schema.json rename to resources/standards-data/ldml-keyboards/techpreview/ldml-keyboard3.schema.json index cd91f563a1..c5d13311ef 100644 --- a/resources/standards-data/ldml-keyboards/techpreview/ldml-keyboard.schema.json +++ b/resources/standards-data/ldml-keyboards/techpreview/ldml-keyboard3.schema.json @@ -678,7 +678,7 @@ } }, "properties": { - "keyboard": { + "keyboard3": { "additionalProperties": false, "properties": { "conformsTo": { @@ -754,8 +754,8 @@ } }, "required": [ - "keyboard" + "keyboard3" ], - "title": "techpreview/dtd/ldmlKeyboard.xsd", + "title": "techpreview/dtd/ldmlKeyboard3.xsd", "type": "object" } diff --git a/resources/standards-data/ldml-keyboards/techpreview/ldml-keyboardtest.schema.json b/resources/standards-data/ldml-keyboards/techpreview/ldml-keyboardtest3.schema.json similarity index 97% rename from resources/standards-data/ldml-keyboards/techpreview/ldml-keyboardtest.schema.json rename to resources/standards-data/ldml-keyboards/techpreview/ldml-keyboardtest3.schema.json index 6d163770f9..cbf09b39d5 100644 --- a/resources/standards-data/ldml-keyboards/techpreview/ldml-keyboardtest.schema.json +++ b/resources/standards-data/ldml-keyboards/techpreview/ldml-keyboardtest3.schema.json @@ -176,7 +176,7 @@ } }, "properties": { - "keyboardTest": { + "keyboardTest3": { "additionalProperties": false, "properties": { "conformsTo": { @@ -214,8 +214,8 @@ } }, "required": [ - "keyboardTest" + "keyboardTest3" ], - "title": "techpreview/dtd/ldmlKeyboardTest.xsd", + "title": "techpreview/dtd/ldmlKeyboardTest3.xsd", "type": "object" } diff --git a/resources/standards-data/ldml-keyboards/techpreview/test/fr-t-k0-azerty-test.xml b/resources/standards-data/ldml-keyboards/techpreview/test/fr-t-k0-azerty-test.xml index 23a0cdba51..0228dae7c1 100644 --- a/resources/standards-data/ldml-keyboards/techpreview/test/fr-t-k0-azerty-test.xml +++ b/resources/standards-data/ldml-keyboards/techpreview/test/fr-t-k0-azerty-test.xml @@ -1,22 +1,22 @@ - - + + - + - + - + - + - + - + - + diff --git a/resources/standards-data/ldml-keyboards/techpreview/test/ja-Latn-test.xml b/resources/standards-data/ldml-keyboards/techpreview/test/ja-Latn-test.xml index a1e3a185eb..c4d950f8d9 100644 --- a/resources/standards-data/ldml-keyboards/techpreview/test/ja-Latn-test.xml +++ b/resources/standards-data/ldml-keyboards/techpreview/test/ja-Latn-test.xml @@ -1,6 +1,6 @@ - - + + @@ -24,4 +24,4 @@ - + diff --git a/resources/standards-data/ldml-keyboards/techpreview/test/pt-t-k0-abnt2-test.xml b/resources/standards-data/ldml-keyboards/techpreview/test/pt-t-k0-abnt2-test.xml index 4eb59db813..c9f7148438 100644 --- a/resources/standards-data/ldml-keyboards/techpreview/test/pt-t-k0-abnt2-test.xml +++ b/resources/standards-data/ldml-keyboards/techpreview/test/pt-t-k0-abnt2-test.xml @@ -1,6 +1,6 @@ - - + + - + From 8be00cb482a9327fe7ebc468151f2a2ff63ca584 Mon Sep 17 00:00:00 2001 From: "Steven R. Loomis" Date: Mon, 18 Sep 2023 18:38:16 -0500 Subject: [PATCH 17/47] =?UTF-8?q?chore(resources):=20code=20changes=20for?= =?UTF-8?q?=20keyboard=20to=20keyboard3=20=20=F0=9F=99=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- common/web/types/build.sh | 4 +- .../ldml-keyboard-testdata-xml.ts | 2 +- .../ldml-keyboard/ldml-keyboard-xml-reader.ts | 60 +++++++++---------- .../src/ldml-keyboard/ldml-keyboard-xml.ts | 2 +- common/web/types/src/schemas.ts | 10 ++-- .../types/test/fixtures/import-minimal.xml | 6 +- .../types/test/fixtures/import-minimal1.xml | 6 +- .../types/test/fixtures/import-minimal2.xml | 6 +- .../types/test/fixtures/import-symbols.xml | 6 +- .../test/fixtures/invalid-conforms-to.xml | 4 +- .../test/fixtures/invalid-import-base.xml | 6 +- .../test/fixtures/invalid-import-path.xml | 6 +- .../test/fixtures/invalid-import-readfail.xml | 6 +- .../fixtures/invalid-import-wrongroot.xml | 6 +- .../fixtures/invalid-structure-per-dtd.xml | 6 +- common/web/types/test/fixtures/test-fr.xml | 6 +- .../test/helpers/reader-callback-test.ts | 2 +- .../test-ldml-keyboard-testdata-reader.ts | 16 ++--- .../test-ldml-keyboard-xml-reader.ts | 20 +++---- .../invalid-keyboards/ik_000_null_invalid.xml | 2 +- .../ldml/keyboards/k_000_null_keyboard.xml | 2 +- .../unit/ldml/keyboards/k_001_tiny-test.xml | 6 +- core/tests/unit/ldml/keyboards/k_001_tiny.xml | 6 +- .../unit/ldml/keyboards/k_002_tinyu32.xml | 6 +- .../unit/ldml/keyboards/k_003_transform.xml | 6 +- .../unit/ldml/keyboards/k_004_tinyshift.xml | 6 +- .../unit/ldml/keyboards/k_005_modbittest.xml | 6 +- .../unit/ldml/keyboards/k_006_backspace.xml | 6 +- .../keyboards/k_007_transform_rgx-test.xml | 6 +- .../ldml/keyboards/k_007_transform_rgx.xml | 6 +- core/tests/unit/ldml/keyboards/k_010_mt.xml | 6 +- .../unit/ldml/keyboards/k_011_mt_iso.xml | 6 +- .../unit/ldml/keyboards/k_020_fr-test.xml | 6 +- core/tests/unit/ldml/keyboards/k_020_fr.xml | 6 +- .../unit/ldml/keyboards/k_100_keytest.xml | 6 +- .../unit/ldml/keyboards/k_101_keytest.xml | 6 +- .../unit/ldml/keyboards/k_102_keytest.xml | 6 +- .../keyboards/k_200_reorder_nod_Lana-test.xml | 6 +- .../ldml/keyboards/k_200_reorder_nod_Lana.xml | 6 +- .../unit/ldml/keyboards/k_210_marker-test.xml | 6 +- .../unit/ldml/keyboards/k_210_marker.xml | 6 +- developer/src/inst/download.in.mak | 2 +- developer/src/kmc-ldml/src/compiler/disp.ts | 8 +-- .../src/compiler/keymanweb-compiler.ts | 6 +- developer/src/kmc-ldml/src/compiler/keys.ts | 20 +++---- developer/src/kmc-ldml/src/compiler/layr.ts | 4 +- developer/src/kmc-ldml/src/compiler/loca.ts | 4 +- developer/src/kmc-ldml/src/compiler/meta.ts | 22 +++---- developer/src/kmc-ldml/src/compiler/name.ts | 4 +- .../kmc-ldml/src/compiler/section-compiler.ts | 4 +- .../src/compiler/touch-layout-compiler.ts | 6 +- developer/src/kmc-ldml/src/compiler/tran.ts | 4 +- developer/src/kmc-ldml/src/compiler/vars.ts | 12 ++-- .../src/compiler/visual-keyboard-compiler.ts | 4 +- developer/src/kmc-ldml/src/compiler/vkey.ts | 8 +-- .../src/kmc-ldml/test/fixtures/basic.xml | 6 +- .../test/fixtures/sections/bksp/minimal.xml | 6 +- .../test/fixtures/sections/disp/escaped.xml | 6 +- .../fixtures/sections/disp/invalid-both.xml | 6 +- .../fixtures/sections/disp/invalid-dupid.xml | 6 +- .../fixtures/sections/disp/invalid-dupto.xml | 6 +- .../fixtures/sections/disp/invalid-none.xml | 6 +- .../test/fixtures/sections/disp/maximal.xml | 6 +- .../test/fixtures/sections/disp/minimal.xml | 6 +- .../fixtures/sections/disp/options-only.xml | 6 +- .../test/fixtures/sections/disp/typical.xml | 6 +- .../test/fixtures/sections/finl/minimal.xml | 6 +- .../test/fixtures/sections/keys/escaped.xml | 6 +- .../test/fixtures/sections/keys/escaped2.xml | 6 +- .../fixtures/sections/keys/gap-switch.xml | 6 +- .../test/fixtures/sections/keys/hardware.xml | 6 +- .../fixtures/sections/keys/hardware_iso.xml | 6 +- .../fixtures/sections/keys/hardware_us.xml | 6 +- .../sections/keys/invalid-bad-modifier.xml | 6 +- .../keys/invalid-hardware-too-many-keys.xml | 6 +- .../keys/invalid-hardware-too-many-rows.xml | 6 +- .../keys/invalid-key-missing-attrs.xml | 6 +- .../sections/keys/invalid-missing-flick.xml | 6 +- .../sections/keys/invalid-undefined-key.xml | 6 +- .../test/fixtures/sections/keys/markers.xml | 6 +- .../test/fixtures/sections/keys/maximal.xml | 6 +- .../test/fixtures/sections/keys/minimal.xml | 6 +- .../sections/layr/invalid-invalid-form.xml | 6 +- .../layr/invalid-missing-hardware.xml | 6 +- .../sections/layr/invalid-missing-layer.xml | 6 +- .../sections/layr/invalid-missing-layer2.xml | 6 +- .../sections/layr/invalid-multi-hardware.xml | 6 +- .../fixtures/sections/loca/invalid-locale.xml | 6 +- .../test/fixtures/sections/loca/minimal.xml | 6 +- .../test/fixtures/sections/loca/multiple.xml | 6 +- .../sections/meta/invalid-normalization.xml | 6 +- .../sections/meta/invalid-version-1.0.xml | 6 +- .../sections/meta/invalid-version-v1.0.3.xml | 6 +- .../test/fixtures/sections/meta/maximal.xml | 6 +- .../test/fixtures/sections/meta/minimal.xml | 6 +- .../test/fixtures/sections/name/minimal.xml | 6 +- .../test/fixtures/sections/name/multiple.xml | 6 +- .../test/fixtures/sections/ordr/minimal.xml | 6 +- .../fixtures/sections/ordr/multi-escape.xml | 6 +- .../test/fixtures/sections/ordr/nod-Lana.xml | 6 +- .../sections/tran/fail-duplicate-type.xml | 6 +- .../fixtures/sections/tran/fail-empty.xml | 6 +- .../tran/fail-invalid-duplicate-type.xml | 6 +- .../sections/tran/fail-invalid-type.xml | 6 +- .../fixtures/sections/tran/fail-mixed.xml | 6 +- .../test/fixtures/sections/tran/minimal.xml | 6 +- .../test/fixtures/sections/tran/tran-vars.xml | 6 +- .../test/fixtures/sections/vars/dup0.xml | 6 +- .../test/fixtures/sections/vars/dup1.xml | 6 +- .../fixtures/sections/vars/fail-badref-0.xml | 6 +- .../fixtures/sections/vars/fail-badref-1.xml | 6 +- .../fixtures/sections/vars/fail-badref-2.xml | 6 +- .../fixtures/sections/vars/fail-badref-3.xml | 6 +- .../fixtures/sections/vars/fail-badref-4.xml | 6 +- .../fixtures/sections/vars/fail-badref-5.xml | 6 +- .../fixtures/sections/vars/fail-badref-6.xml | 6 +- .../sections/vars/fail-markers-badref-0.xml | 6 +- .../sections/vars/fail-uset-props1.xml | 6 +- .../sections/vars/fail-uset-props2.xml | 6 +- .../sections/vars/fail-uset-strings.xml | 6 +- .../sections/vars/fail-uset-syntax.xml | 6 +- .../sections/vars/markers-maximal.xml | 6 +- .../test/fixtures/sections/vars/maximal.xml | 6 +- .../test/fixtures/sections/vars/minimal.xml | 6 +- .../sections/vkey/invalid-from-vkey.xml | 6 +- .../sections/vkey/invalid-repeated-vkey.xml | 6 +- .../sections/vkey/invalid-to-vkey.xml | 6 +- .../test/fixtures/sections/vkey/minimal.xml | 6 +- .../test/fixtures/sections/vkey/redundant.xml | 6 +- .../fixtures/sections/vkey/same-target.xml | 6 +- .../src/kmc-ldml/test/fixtures/test-fr.json | 2 +- .../src/kmc-ldml/test/fixtures/test-fr.xml | 6 +- .../src/kmc-ldml/test/test-dependencies.ts | 2 +- .../standards-data/ldml-keyboards/readme.md | 2 +- .../ldml-keyboards/techpreview/3.0/pcm.xml | 6 +- .../techpreview/test/pcm-test.xml | 6 +- 136 files changed, 443 insertions(+), 443 deletions(-) diff --git a/common/web/types/build.sh b/common/web/types/build.sh index 74b200e6d6..f0c73b0e07 100755 --- a/common/web/types/build.sh +++ b/common/web/types/build.sh @@ -29,8 +29,8 @@ builder_parse "$@" function compile_schemas() { # We need the schema files at runtime and bundled, so always copy it for all actions except `clean` local schemas=( - "$KEYMAN_ROOT/resources/standards-data/ldml-keyboards/techpreview/ldml-keyboard.schema.json" - "$KEYMAN_ROOT/resources/standards-data/ldml-keyboards/techpreview/ldml-keyboardtest.schema.json" + "$KEYMAN_ROOT/resources/standards-data/ldml-keyboards/techpreview/ldml-keyboard3.schema.json" + "$KEYMAN_ROOT/resources/standards-data/ldml-keyboards/techpreview/ldml-keyboardtest3.schema.json" "$KEYMAN_ROOT/common/schemas/kvks/kvks.schema.json" "$KEYMAN_ROOT/common/schemas/kpj/kpj.schema.json" "$KEYMAN_ROOT/common/schemas/kpj-9.0/kpj-9.0.schema.json" diff --git a/common/web/types/src/ldml-keyboard/ldml-keyboard-testdata-xml.ts b/common/web/types/src/ldml-keyboard/ldml-keyboard-testdata-xml.ts index c0a5e9dd6d..86a05e3893 100644 --- a/common/web/types/src/ldml-keyboard/ldml-keyboard-testdata-xml.ts +++ b/common/web/types/src/ldml-keyboard/ldml-keyboard-testdata-xml.ts @@ -11,7 +11,7 @@ export interface LDMLKeyboardTestDataXMLSourceFile { /** * -- the root element. */ - keyboardTest: LKTKeyboardTest; + keyboardTest3: LKTKeyboardTest; } export interface LKTKeyboardTest { diff --git a/common/web/types/src/ldml-keyboard/ldml-keyboard-xml-reader.ts b/common/web/types/src/ldml-keyboard/ldml-keyboard-xml-reader.ts index 3e7bda502e..3fdd9a7402 100644 --- a/common/web/types/src/ldml-keyboard/ldml-keyboard-xml-reader.ts +++ b/common/web/types/src/ldml-keyboard/ldml-keyboard-xml-reader.ts @@ -39,27 +39,27 @@ export class LDMLKeyboardXMLSourceFileReader { * @returns true on success, false on failure */ private boxArrays(source: any) : boolean { - if (source?.keyboard) { - if (!source.keyboard.keys) { - source.keyboard.keys = { + if (source?.keyboard3) { + if (!source.keyboard3.keys) { + source.keyboard3.keys = { key: [], flicks: [], }; } - if (!source.keyboard.keys.import) { - source.keyboard.keys.import = []; + if (!source.keyboard3.keys.import) { + source.keyboard3.keys.import = []; } } - boxXmlArray(source?.keyboard, 'layers'); - boxXmlArray(source?.keyboard?.displays, 'display'); - boxXmlArray(source?.keyboard?.names, 'name'); - boxXmlArray(source?.keyboard?.vkeys, 'vkey'); - boxXmlArray(source?.keyboard?.keys, 'key'); - boxXmlArray(source?.keyboard?.keys, 'flicks'); - boxXmlArray(source?.keyboard?.locales, 'locale'); - boxXmlArray(source?.keyboard, 'transforms'); - if(source?.keyboard?.layers) { - for(let layers of source?.keyboard?.layers) { + boxXmlArray(source?.keyboard3, 'layers'); + boxXmlArray(source?.keyboard3?.displays, 'display'); + boxXmlArray(source?.keyboard3?.names, 'name'); + boxXmlArray(source?.keyboard3?.vkeys, 'vkey'); + boxXmlArray(source?.keyboard3?.keys, 'key'); + boxXmlArray(source?.keyboard3?.keys, 'flicks'); + boxXmlArray(source?.keyboard3?.locales, 'locale'); + boxXmlArray(source?.keyboard3, 'transforms'); + if(source?.keyboard3?.layers) { + for(let layers of source?.keyboard3?.layers) { boxXmlArray(layers, 'layer'); if(layers?.layer) { for(let layer of layers?.layer) { @@ -68,18 +68,18 @@ export class LDMLKeyboardXMLSourceFileReader { } } } - if(source?.keyboard?.keys?.flicks) { - for(let flicks of source?.keyboard?.keys?.flicks) { + if(source?.keyboard3?.keys?.flicks) { + for(let flicks of source?.keyboard3?.keys?.flicks) { boxXmlArray(flicks, 'flick'); } } - if(source?.keyboard?.variables) { - boxXmlArray(source?.keyboard?.variables, 'set'); - boxXmlArray(source?.keyboard?.variables, 'string'); - boxXmlArray(source?.keyboard?.variables, 'unicodeSet'); + if(source?.keyboard3?.variables) { + boxXmlArray(source?.keyboard3?.variables, 'set'); + boxXmlArray(source?.keyboard3?.variables, 'string'); + boxXmlArray(source?.keyboard3?.variables, 'unicodeSet'); } - if(source?.keyboard?.transforms) { - for(let transforms of source.keyboard.transforms) { + if(source?.keyboard3?.transforms) { + for(let transforms of source.keyboard3.transforms) { boxXmlArray(transforms, 'transformGroup'); for (let transformGroup of transforms.transformGroup) { boxXmlArray(transformGroup, 'transform'); @@ -208,7 +208,7 @@ export class LDMLKeyboardXMLSourceFileReader { */ public validate(source: LDMLKeyboardXMLSourceFile | LDMLKeyboardTestDataXMLSourceFile): boolean { const ajv = new Ajv(); - if(!ajv.validate(Schemas.ldmlKeyboard, source)) { + if(!ajv.validate(Schemas.ldmlKeyboard3, source)) { for (let err of ajv.errors) { this.callbacks.reportMessage(CommonTypesMessages.Error_SchemaValidationError({ instancePath: err.instancePath, @@ -345,16 +345,16 @@ export class LDMLKeyboardXMLSourceFileReader { boxTestDataArrays(raw: any) : LDMLKeyboardTestDataXMLSourceFile | null { if (!raw) return null; const a : LDMLKeyboardTestDataXMLSourceFile = { - keyboardTest: { - conformsTo: raw?.keyboardTest?.$?.conformsTo, + keyboardTest3: { + conformsTo: raw?.keyboardTest3?.$?.conformsTo, } }; - const $$ : NameAndProps[] = raw?.keyboardTest?.$$; + const $$ : NameAndProps[] = raw?.keyboardTest3?.$$; - this.stuffBoxes(a.keyboardTest, $$, 'info'); - this.stuffBoxes(a.keyboardTest, $$, 'repertoire', true); - this.stuffBoxes(a.keyboardTest, $$, 'tests', true, (o, r) => { + this.stuffBoxes(a.keyboardTest3, $$, 'info'); + this.stuffBoxes(a.keyboardTest3, $$, 'repertoire', true); + this.stuffBoxes(a.keyboardTest3, $$, 'tests', true, (o, r) => { // start with basic unpack const tests : LKTTests = LDMLKeyboardXMLSourceFileReader.defaultMapper(o, r); // add ingredients diff --git a/common/web/types/src/ldml-keyboard/ldml-keyboard-xml.ts b/common/web/types/src/ldml-keyboard/ldml-keyboard-xml.ts index 396f3589a0..629b8e8aa2 100644 --- a/common/web/types/src/ldml-keyboard/ldml-keyboard-xml.ts +++ b/common/web/types/src/ldml-keyboard/ldml-keyboard-xml.ts @@ -11,7 +11,7 @@ export interface LDMLKeyboardXMLSourceFile { /** * -- the root element. */ - keyboard: LKKeyboard; + keyboard3: LKKeyboard; } export interface LKKeyboard { diff --git a/common/web/types/src/schemas.ts b/common/web/types/src/schemas.ts index 451afc416b..3d1ce0cbf1 100644 --- a/common/web/types/src/schemas.ts +++ b/common/web/types/src/schemas.ts @@ -2,8 +2,8 @@ import kpj from './schemas/kpj.schema.js'; import kpj90 from './schemas/kpj-9.0.schema.js'; import kvks from './schemas/kvks.schema.js'; -import ldmlKeyboard from './schemas/ldml-keyboard.schema.js'; -import ldmlKeyboardTest from './schemas/ldml-keyboardtest.schema.js'; +import ldmlKeyboard3 from './schemas/ldml-keyboard3.schema.js'; +import ldmlKeyboardTest3 from './schemas/ldml-keyboardtest3.schema.js'; import displayMap from './schemas/displaymap.schema.js'; import touchLayoutClean from './schemas/keyman-touch-layout.clean.spec.js'; import touchLayout from './schemas/keyman-touch-layout.spec.js'; @@ -12,11 +12,11 @@ const Schemas = { kpj, kpj90, kvks, - ldmlKeyboard, - ldmlKeyboardTest, + ldmlKeyboard3, + ldmlKeyboardTest3, displayMap, touchLayoutClean, touchLayout, }; -export default Schemas; \ No newline at end of file +export default Schemas; diff --git a/common/web/types/test/fixtures/import-minimal.xml b/common/web/types/test/fixtures/import-minimal.xml index 500367699d..f23bc5c325 100644 --- a/common/web/types/test/fixtures/import-minimal.xml +++ b/common/web/types/test/fixtures/import-minimal.xml @@ -1,8 +1,8 @@ - - + + - + diff --git a/common/web/types/test/fixtures/import-minimal1.xml b/common/web/types/test/fixtures/import-minimal1.xml index 439741d041..ce2140893e 100644 --- a/common/web/types/test/fixtures/import-minimal1.xml +++ b/common/web/types/test/fixtures/import-minimal1.xml @@ -1,6 +1,6 @@ - - + + @@ -8,4 +8,4 @@ - + diff --git a/common/web/types/test/fixtures/import-minimal2.xml b/common/web/types/test/fixtures/import-minimal2.xml index f04e32d673..66a836057d 100644 --- a/common/web/types/test/fixtures/import-minimal2.xml +++ b/common/web/types/test/fixtures/import-minimal2.xml @@ -1,6 +1,6 @@ - - + + @@ -8,4 +8,4 @@ - + diff --git a/common/web/types/test/fixtures/import-symbols.xml b/common/web/types/test/fixtures/import-symbols.xml index 9ca4638204..e3421c8ff3 100644 --- a/common/web/types/test/fixtures/import-symbols.xml +++ b/common/web/types/test/fixtures/import-symbols.xml @@ -1,6 +1,6 @@ - - + + @@ -10,4 +10,4 @@ - + diff --git a/common/web/types/test/fixtures/invalid-conforms-to.xml b/common/web/types/test/fixtures/invalid-conforms-to.xml index e2fdf8e422..e5cca5ebac 100644 --- a/common/web/types/test/fixtures/invalid-conforms-to.xml +++ b/common/web/types/test/fixtures/invalid-conforms-to.xml @@ -4,7 +4,7 @@ DOCTYPE keyboard SYSTEM "../../../../../resources/standards-data/ldml-keyboards/techpreview/dtd/ldmlKeyboard.dtd" Disabling doctype for this invalid file, not used by compiler, and avoids complaints in IDEs etc. --> - + @@ -16,4 +16,4 @@ - + diff --git a/common/web/types/test/fixtures/invalid-import-base.xml b/common/web/types/test/fixtures/invalid-import-base.xml index 3b56f1feeb..f52a13031e 100644 --- a/common/web/types/test/fixtures/invalid-import-base.xml +++ b/common/web/types/test/fixtures/invalid-import-base.xml @@ -1,6 +1,6 @@ - - + + @@ -13,4 +13,4 @@ - + diff --git a/common/web/types/test/fixtures/invalid-import-path.xml b/common/web/types/test/fixtures/invalid-import-path.xml index a9e670f882..c52b18ff56 100644 --- a/common/web/types/test/fixtures/invalid-import-path.xml +++ b/common/web/types/test/fixtures/invalid-import-path.xml @@ -1,6 +1,6 @@ - - + + @@ -13,4 +13,4 @@ - + diff --git a/common/web/types/test/fixtures/invalid-import-readfail.xml b/common/web/types/test/fixtures/invalid-import-readfail.xml index e254b55350..d66288ecda 100644 --- a/common/web/types/test/fixtures/invalid-import-readfail.xml +++ b/common/web/types/test/fixtures/invalid-import-readfail.xml @@ -1,6 +1,6 @@ - - + + @@ -13,4 +13,4 @@ - + diff --git a/common/web/types/test/fixtures/invalid-import-wrongroot.xml b/common/web/types/test/fixtures/invalid-import-wrongroot.xml index 522e106e86..45d6b3b713 100644 --- a/common/web/types/test/fixtures/invalid-import-wrongroot.xml +++ b/common/web/types/test/fixtures/invalid-import-wrongroot.xml @@ -1,6 +1,6 @@ - - + + @@ -13,4 +13,4 @@ - + diff --git a/common/web/types/test/fixtures/invalid-structure-per-dtd.xml b/common/web/types/test/fixtures/invalid-structure-per-dtd.xml index be504fdbf9..961e6033fa 100644 --- a/common/web/types/test/fixtures/invalid-structure-per-dtd.xml +++ b/common/web/types/test/fixtures/invalid-structure-per-dtd.xml @@ -1,8 +1,8 @@ - - + + diff --git a/common/web/types/test/fixtures/test-fr.xml b/common/web/types/test/fixtures/test-fr.xml index c97825385a..e138a1b5d1 100644 --- a/common/web/types/test/fixtures/test-fr.xml +++ b/common/web/types/test/fixtures/test-fr.xml @@ -1,6 +1,6 @@ - - + + @@ -19,4 +19,4 @@ - + diff --git a/common/web/types/test/helpers/reader-callback-test.ts b/common/web/types/test/helpers/reader-callback-test.ts index 4515aa15ea..86758ad413 100644 --- a/common/web/types/test/helpers/reader-callback-test.ts +++ b/common/web/types/test/helpers/reader-callback-test.ts @@ -105,7 +105,7 @@ export function testReaderCases(cases : CompilationCase[]) { assert.includeDeepMembers(callbacks.messages, testcase.warnings, 'expected warnings to be included'); } else if (!expectFailure) { // no warnings, so expect zero messages - assert.strictEqual(callbacks.messages.length, 0, 'expected zero messages'); + assert.deepEqual(callbacks.messages, [], 'expected zero messages'); } // run the user-supplied callback if any diff --git a/common/web/types/test/ldml-keyboard/test-ldml-keyboard-testdata-reader.ts b/common/web/types/test/ldml-keyboard/test-ldml-keyboard-testdata-reader.ts index 6a789c7493..80a78a1187 100644 --- a/common/web/types/test/ldml-keyboard/test-ldml-keyboard-testdata-reader.ts +++ b/common/web/types/test/ldml-keyboard/test-ldml-keyboard-testdata-reader.ts @@ -11,16 +11,16 @@ describe('ldml keyboard xml reader tests', function () { subpath: 'test-fr.xml', callback: (data, source) => { assert.ok(source); - assert.ok(source.keyboardTest); - assert.equal(source.keyboardTest.conformsTo, constants.cldr_version_latest); + assert.ok(source.keyboardTest3); + assert.equal(source.keyboardTest3.conformsTo, constants.cldr_version_latest); - assert.deepEqual(source.keyboardTest.info, { + assert.deepEqual(source.keyboardTest3.info, { keyboard: 'fr-t-k0-azerty.xml', author: 'Team Keyboard', name: 'fr-test' }); - assert.sameDeepMembers(source.keyboardTest.repertoire, [ + assert.sameDeepMembers(source.keyboardTest3.repertoire, [ { name: 'simple-repertoire', chars: '[a b c d e \\u{22}]', @@ -29,10 +29,10 @@ describe('ldml keyboard xml reader tests', function () { { name: 'chars-repertoire', chars: '[á é ó]', type: 'gesture' } ]); - assert.equal(1, source.keyboardTest.tests?.length); - assert.equal('key-tests', source.keyboardTest.tests[0].name); - assert.equal(1, source.keyboardTest.tests[0].test?.length); - const test0 = source.keyboardTest.tests[0].test[0]; + assert.equal(1, source.keyboardTest3.tests?.length); + assert.equal('key-tests', source.keyboardTest3.tests[0].name); + assert.equal(1, source.keyboardTest3.tests[0].test?.length); + const test0 = source.keyboardTest3.tests[0].test[0]; assert.equal('key-test', test0.name); assert.equal('abc\\u0022...', test0.startContext?.to); assert.sameDeepOrderedMembers([ diff --git a/common/web/types/test/ldml-keyboard/test-ldml-keyboard-xml-reader.ts b/common/web/types/test/ldml-keyboard/test-ldml-keyboard-xml-reader.ts index ac791dac33..4da7a00663 100644 --- a/common/web/types/test/ldml-keyboard/test-ldml-keyboard-xml-reader.ts +++ b/common/web/types/test/ldml-keyboard/test-ldml-keyboard-xml-reader.ts @@ -15,7 +15,7 @@ describe('ldml keyboard xml reader tests', function () { { subpath: 'invalid-structure-per-dtd.xml', errors: [CommonTypesMessages.Error_SchemaValidationError({ - instancePath: '/keyboard', + instancePath: '/keyboard3', keyword: 'required', message: `must have required property 'names'`, params: 'missingProperty="names"', @@ -24,7 +24,7 @@ describe('ldml keyboard xml reader tests', function () { { subpath: 'invalid-conforms-to.xml', errors: [CommonTypesMessages.Error_SchemaValidationError({ - instancePath: '/keyboard/conformsTo', + instancePath: '/keyboard3/conformsTo', keyword: 'enum', message: `must be equal to one of the allowed values`, params: 'allowedValues="techpreview"', @@ -33,8 +33,8 @@ describe('ldml keyboard xml reader tests', function () { { subpath: 'import-minimal.xml', callback: (data, source, subpath, callbacks) => { - assert.ok(source?.keyboard?.keys); - const k = pluckKeysFromKeybag(source?.keyboard?.keys.key, ['a', 'b', 'c']); + assert.ok(source?.keyboard3?.keys); + const k = pluckKeysFromKeybag(source?.keyboard3?.keys.key, ['a', 'b', 'c']); assert.sameDeepOrderedMembers(k, [ {id: 'a', to: 'a'}, {id: 'b', to: 'b'}, @@ -45,8 +45,8 @@ describe('ldml keyboard xml reader tests', function () { { subpath: 'import-minimal1.xml', callback: (data, source, subpath, callbacks) => { - assert.ok(source?.keyboard?.keys); - const k = pluckKeysFromKeybag(source?.keyboard?.keys.key, ['a', 'b', 'c']); + assert.ok(source?.keyboard3?.keys); + const k = pluckKeysFromKeybag(source?.keyboard3?.keys.key, ['a', 'b', 'c']); assert.sameDeepOrderedMembers(k, [ {id: 'a', to: 'a'}, {id: 'b', to: 'b'}, @@ -57,8 +57,8 @@ describe('ldml keyboard xml reader tests', function () { { subpath: 'import-minimal2.xml', callback: (data, source, subpath, callbacks) => { - assert.ok(source?.keyboard?.keys); - const k = pluckKeysFromKeybag(source?.keyboard?.keys.key, ['a', 'b', 'c']); + assert.ok(source?.keyboard3?.keys); + const k = pluckKeysFromKeybag(source?.keyboard3?.keys.key, ['a', 'b', 'c']); assert.sameDeepOrderedMembers(k, [ {id: 'a', to: 'a'}, {id: 'b', to: 'b'}, @@ -70,8 +70,8 @@ describe('ldml keyboard xml reader tests', function () { { subpath: 'import-symbols.xml', callback: (data, source, subpath, callbacks) => { - assert.ok(source?.keyboard?.keys); - const k = pluckKeysFromKeybag(source?.keyboard?.keys.key, ['a', 'b', 'c', 'zz', 'hash', 'hyphen']); + assert.ok(source?.keyboard3?.keys); + const k = pluckKeysFromKeybag(source?.keyboard3?.keys.key, ['a', 'b', 'c', 'zz', 'hash', 'hyphen']); assert.sameDeepOrderedMembers(k, [ {id: 'a', to: 'a'}, // implied {id: 'b', to: 'b'}, diff --git a/core/tests/unit/ldml/invalid-keyboards/ik_000_null_invalid.xml b/core/tests/unit/ldml/invalid-keyboards/ik_000_null_invalid.xml index 85b7023d5a..a16eb61346 100644 --- a/core/tests/unit/ldml/invalid-keyboards/ik_000_null_invalid.xml +++ b/core/tests/unit/ldml/invalid-keyboards/ik_000_null_invalid.xml @@ -7,4 +7,4 @@ @@expect-error: This keyboard is invalid, so it will fail to load --> - + diff --git a/core/tests/unit/ldml/keyboards/k_000_null_keyboard.xml b/core/tests/unit/ldml/keyboards/k_000_null_keyboard.xml index 516c336b24..73dfce5dd9 100644 --- a/core/tests/unit/ldml/keyboards/k_000_null_keyboard.xml +++ b/core/tests/unit/ldml/keyboards/k_000_null_keyboard.xml @@ -7,4 +7,4 @@ @@expect: --> - + diff --git a/core/tests/unit/ldml/keyboards/k_001_tiny-test.xml b/core/tests/unit/ldml/keyboards/k_001_tiny-test.xml index 63fba5778a..231523458c 100644 --- a/core/tests/unit/ldml/keyboards/k_001_tiny-test.xml +++ b/core/tests/unit/ldml/keyboards/k_001_tiny-test.xml @@ -1,6 +1,6 @@ - - + + @@ -13,4 +13,4 @@ - + diff --git a/core/tests/unit/ldml/keyboards/k_001_tiny.xml b/core/tests/unit/ldml/keyboards/k_001_tiny.xml index 65bf21ea51..e17284025d 100644 --- a/core/tests/unit/ldml/keyboards/k_001_tiny.xml +++ b/core/tests/unit/ldml/keyboards/k_001_tiny.xml @@ -8,8 +8,8 @@ @@expected: \u0127\u1790\u17B6\u0127 --> - - + + @@ -26,4 +26,4 @@ - + diff --git a/core/tests/unit/ldml/keyboards/k_002_tinyu32.xml b/core/tests/unit/ldml/keyboards/k_002_tinyu32.xml index 85d5f7d943..7ef6c0b379 100644 --- a/core/tests/unit/ldml/keyboards/k_002_tinyu32.xml +++ b/core/tests/unit/ldml/keyboards/k_002_tinyu32.xml @@ -6,8 +6,8 @@ @@expected: \u0127\u1790\u17B6\u0127\uD83D\uDE40\u0127 --> - - + + @@ -25,4 +25,4 @@ - + diff --git a/core/tests/unit/ldml/keyboards/k_003_transform.xml b/core/tests/unit/ldml/keyboards/k_003_transform.xml index 565378400a..814b6829d8 100644 --- a/core/tests/unit/ldml/keyboards/k_003_transform.xml +++ b/core/tests/unit/ldml/keyboards/k_003_transform.xml @@ -7,8 +7,8 @@ from https://github.com/unicode-org/cldr/blob/keyboard-preview/docs/ldml/tr35-ke @@expected: qu\u00ea --> - - + + @@ -58,4 +58,4 @@ from https://github.com/unicode-org/cldr/blob/keyboard-preview/docs/ldml/tr35-ke - + diff --git a/core/tests/unit/ldml/keyboards/k_004_tinyshift.xml b/core/tests/unit/ldml/keyboards/k_004_tinyshift.xml index 212e41d8fe..fa7df96878 100644 --- a/core/tests/unit/ldml/keyboards/k_004_tinyshift.xml +++ b/core/tests/unit/ldml/keyboards/k_004_tinyshift.xml @@ -6,8 +6,8 @@ @@expected: \u0037\u1790\u17B6\u0127 --> - - + + @@ -29,4 +29,4 @@ - + diff --git a/core/tests/unit/ldml/keyboards/k_005_modbittest.xml b/core/tests/unit/ldml/keyboards/k_005_modbittest.xml index 8d1a934016..a739728092 100644 --- a/core/tests/unit/ldml/keyboards/k_005_modbittest.xml +++ b/core/tests/unit/ldml/keyboards/k_005_modbittest.xml @@ -6,8 +6,8 @@ @@expected: \u0061\u0041\u0062\u0063\u0064\u0064\u0065\u0066\u0067\u0067 --> - - + + @@ -42,4 +42,4 @@ - + diff --git a/core/tests/unit/ldml/keyboards/k_006_backspace.xml b/core/tests/unit/ldml/keyboards/k_006_backspace.xml index f1ab58c695..b3f126eeab 100644 --- a/core/tests/unit/ldml/keyboards/k_006_backspace.xml +++ b/core/tests/unit/ldml/keyboards/k_006_backspace.xml @@ -7,8 +7,8 @@ from https://github.com/unicode-org/cldr/blob/keyboard-preview/docs/ldml/tr35-ke @@expected: t --> - - + + @@ -58,4 +58,4 @@ from https://github.com/unicode-org/cldr/blob/keyboard-preview/docs/ldml/tr35-ke - + diff --git a/core/tests/unit/ldml/keyboards/k_007_transform_rgx-test.xml b/core/tests/unit/ldml/keyboards/k_007_transform_rgx-test.xml index d79f4f92b4..e6cc5ce387 100644 --- a/core/tests/unit/ldml/keyboards/k_007_transform_rgx-test.xml +++ b/core/tests/unit/ldml/keyboards/k_007_transform_rgx-test.xml @@ -1,6 +1,6 @@ - - + + @@ -21,4 +21,4 @@ - + diff --git a/core/tests/unit/ldml/keyboards/k_007_transform_rgx.xml b/core/tests/unit/ldml/keyboards/k_007_transform_rgx.xml index 32c690b76d..c2addf9dc1 100644 --- a/core/tests/unit/ldml/keyboards/k_007_transform_rgx.xml +++ b/core/tests/unit/ldml/keyboards/k_007_transform_rgx.xml @@ -4,8 +4,8 @@ from https://github.com/unicode-org/cldr/blob/keyboard-preview/docs/ldml/tr35-keyboards.md#element-transform --> - - + + @@ -45,4 +45,4 @@ from https://github.com/unicode-org/cldr/blob/keyboard-preview/docs/ldml/tr35-ke - + diff --git a/core/tests/unit/ldml/keyboards/k_010_mt.xml b/core/tests/unit/ldml/keyboards/k_010_mt.xml index c0734ac180..3253c1f095 100644 --- a/core/tests/unit/ldml/keyboards/k_010_mt.xml +++ b/core/tests/unit/ldml/keyboards/k_010_mt.xml @@ -10,9 +10,9 @@ Gets part of the way, Based on mt.xml from CLDR. 'TODO-LDML' denotes modifications. Note this is the 47-key version. --> - + - + @@ -93,4 +93,4 @@ Gets part of the way, - + diff --git a/core/tests/unit/ldml/keyboards/k_011_mt_iso.xml b/core/tests/unit/ldml/keyboards/k_011_mt_iso.xml index f572bac9ec..30378708cf 100644 --- a/core/tests/unit/ldml/keyboards/k_011_mt_iso.xml +++ b/core/tests/unit/ldml/keyboards/k_011_mt_iso.xml @@ -11,8 +11,8 @@ Exact copy of mt.xml from CLDR, but with: - an updated DTD path - test case --> - - + + @@ -90,4 +90,4 @@ Exact copy of mt.xml from CLDR, but with: - + diff --git a/core/tests/unit/ldml/keyboards/k_020_fr-test.xml b/core/tests/unit/ldml/keyboards/k_020_fr-test.xml index 04066ae220..99cbe4bd6f 100644 --- a/core/tests/unit/ldml/keyboards/k_020_fr-test.xml +++ b/core/tests/unit/ldml/keyboards/k_020_fr-test.xml @@ -1,7 +1,7 @@ - - + + @@ -20,4 +20,4 @@ - + diff --git a/core/tests/unit/ldml/keyboards/k_020_fr.xml b/core/tests/unit/ldml/keyboards/k_020_fr.xml index 1f6fc2c32f..843ad80ede 100644 --- a/core/tests/unit/ldml/keyboards/k_020_fr.xml +++ b/core/tests/unit/ldml/keyboards/k_020_fr.xml @@ -1,7 +1,7 @@ - - + + @@ -195,4 +195,4 @@ - + diff --git a/core/tests/unit/ldml/keyboards/k_100_keytest.xml b/core/tests/unit/ldml/keyboards/k_100_keytest.xml index 8076620494..0078ed9c26 100644 --- a/core/tests/unit/ldml/keyboards/k_100_keytest.xml +++ b/core/tests/unit/ldml/keyboards/k_100_keytest.xml @@ -5,8 +5,8 @@ @@expected: \u0061 --> - - + + @@ -23,4 +23,4 @@ - + diff --git a/core/tests/unit/ldml/keyboards/k_101_keytest.xml b/core/tests/unit/ldml/keyboards/k_101_keytest.xml index f3ef3fbdce..827fe9cd9d 100644 --- a/core/tests/unit/ldml/keyboards/k_101_keytest.xml +++ b/core/tests/unit/ldml/keyboards/k_101_keytest.xml @@ -4,8 +4,8 @@ @@keys: [K_BKQUOTE] @@expected: \u0061 --> - - + + @@ -26,4 +26,4 @@ - + diff --git a/core/tests/unit/ldml/keyboards/k_102_keytest.xml b/core/tests/unit/ldml/keyboards/k_102_keytest.xml index f541fbfd7b..3f379fd76b 100644 --- a/core/tests/unit/ldml/keyboards/k_102_keytest.xml +++ b/core/tests/unit/ldml/keyboards/k_102_keytest.xml @@ -5,8 +5,8 @@ @@expected: \u0061 --> - - + + @@ -19,4 +19,4 @@ - + diff --git a/core/tests/unit/ldml/keyboards/k_200_reorder_nod_Lana-test.xml b/core/tests/unit/ldml/keyboards/k_200_reorder_nod_Lana-test.xml index d23862ca2b..d8fc776ac9 100644 --- a/core/tests/unit/ldml/keyboards/k_200_reorder_nod_Lana-test.xml +++ b/core/tests/unit/ldml/keyboards/k_200_reorder_nod_Lana-test.xml @@ -1,6 +1,6 @@ - - + + @@ -54,4 +54,4 @@ - + diff --git a/core/tests/unit/ldml/keyboards/k_200_reorder_nod_Lana.xml b/core/tests/unit/ldml/keyboards/k_200_reorder_nod_Lana.xml index 8df0d5ffd7..061b40c882 100644 --- a/core/tests/unit/ldml/keyboards/k_200_reorder_nod_Lana.xml +++ b/core/tests/unit/ldml/keyboards/k_200_reorder_nod_Lana.xml @@ -5,8 +5,8 @@ see https://keyman.com/keyboards/sil_boonkit --> - - + + @@ -46,4 +46,4 @@ - + diff --git a/core/tests/unit/ldml/keyboards/k_210_marker-test.xml b/core/tests/unit/ldml/keyboards/k_210_marker-test.xml index 9853a3dca6..5d7fdb51bd 100644 --- a/core/tests/unit/ldml/keyboards/k_210_marker-test.xml +++ b/core/tests/unit/ldml/keyboards/k_210_marker-test.xml @@ -1,6 +1,6 @@ - - + + @@ -43,4 +43,4 @@ - + diff --git a/core/tests/unit/ldml/keyboards/k_210_marker.xml b/core/tests/unit/ldml/keyboards/k_210_marker.xml index 80f4559a27..1635ce0a2a 100644 --- a/core/tests/unit/ldml/keyboards/k_210_marker.xml +++ b/core/tests/unit/ldml/keyboards/k_210_marker.xml @@ -4,8 +4,8 @@ Test Keyboard --> - - + + @@ -50,4 +50,4 @@ - + diff --git a/developer/src/inst/download.in.mak b/developer/src/inst/download.in.mak index bed37b413f..eeadd67ac0 100644 --- a/developer/src/inst/download.in.mak +++ b/developer/src/inst/download.in.mak @@ -127,7 +127,7 @@ make-kmcomp-install-zip: copy-schemas # TODO: are these required? # kpj.schema.json kvks.schema.json \ -# ldml-keyboard.schema.json ldml-keyboardtest.schema.json \ +# ldml-keyboard3.schema.json ldml-keyboardtest3.schema.json \ copy-schemas: copy $(KEYMAN_ROOT)\common\schemas\keyboard_info\keyboard_info.source.json $(DEVELOPER_ROOT)\bin diff --git a/developer/src/kmc-ldml/src/compiler/disp.ts b/developer/src/kmc-ldml/src/compiler/disp.ts index 8f6d65d79b..77c9609876 100644 --- a/developer/src/kmc-ldml/src/compiler/disp.ts +++ b/developer/src/kmc-ldml/src/compiler/disp.ts @@ -27,8 +27,8 @@ export class DispCompiler extends SectionCompiler { const tos = new Set(); const ids = new Set(); - if (this.keyboard.displays?.display) { - for (const { to, id } of this.keyboard.displays?.display) { + if (this.keyboard3.displays?.display) { + for (const { to, id } of this.keyboard3.displays?.display) { if ((to && id) || (!to && !id)) { this.callbacks.reportMessage(CompilerMessages.Error_DisplayNeedsToOrId({ to, id })); return false; @@ -57,12 +57,12 @@ export class DispCompiler extends SectionCompiler { let result = new Disp(); // displayOptions - result.baseCharacter = sections.strs.allocAndUnescapeString(this.keyboard.displays?.displayOptions?.baseCharacter); + result.baseCharacter = sections.strs.allocAndUnescapeString(this.keyboard3.displays?.displayOptions?.baseCharacter); // TODO-LDML: substitute variables! // displays - result.disps = this.keyboard.displays?.display.map(display => ({ + result.disps = this.keyboard3.displays?.display.map(display => ({ to: sections.strs.allocAndUnescapeString(sections.vars.substituteMarkerString(display.to)), id: sections.strs.allocString(display.id), // not escaped, not substituted display: sections.strs.allocAndUnescapeString(display.display), diff --git a/developer/src/kmc-ldml/src/compiler/keymanweb-compiler.ts b/developer/src/kmc-ldml/src/compiler/keymanweb-compiler.ts index 0087e1356d..542cbc7d8f 100644 --- a/developer/src/kmc-ldml/src/compiler/keymanweb-compiler.ts +++ b/developer/src/kmc-ldml/src/compiler/keymanweb-compiler.ts @@ -73,13 +73,13 @@ export class LdmlKeyboardKeymanWebCompiler { // `${tab}${this.setupDebug()}${nl}` + ? we may use this for modifierBitmask in future // `${tab}this._v=(typeof keyman!="undefined"&&typeof keyman.version=="string")?parseInt(keyman.version,10):9;${nl}` + ? we probably don't need this, it's for back-compat `${tab}this.KI="${sName}";${nl}` + - `${tab}this.KN=${JSON.stringify(source.keyboard.names.name[0])};${nl}` + + `${tab}this.KN=${JSON.stringify(source.keyboard3.names.name[0])};${nl}` + `${tab}this.KMINVER=${JSON.stringify(MINIMUM_KMW_VERSION)};${nl}` + `${tab}this.KV=${this.compileVisualKeyboard(source)};${nl}` + `${tab}this.KDU=${displayUnderlying ? '1' : '0'};${nl}` + `${tab}this.KH="";${nl}` + // TODO-LDML: help text not supported `${tab}this.KM=0;${nl}` + // TODO-LDML: mnemonic layout not supported for LDML keyboards - `${tab}this.KBVER=${JSON.stringify(source.keyboard.version?.number || '0.0')};${nl}` + + `${tab}this.KBVER=${JSON.stringify(source.keyboard3.version?.number || '0.0')};${nl}` + `${tab}this.KMBM=${modifierBitmask};${nl}`; if(isRTL) { @@ -111,4 +111,4 @@ export class LdmlKeyboardKeymanWebCompiler { result += `}${nl}`; return result; } -} \ No newline at end of file +} diff --git a/developer/src/kmc-ldml/src/compiler/keys.ts b/developer/src/kmc-ldml/src/compiler/keys.ts index 5301c93bee..652b584d0f 100644 --- a/developer/src/kmc-ldml/src/compiler/keys.ts +++ b/developer/src/kmc-ldml/src/compiler/keys.ts @@ -30,15 +30,15 @@ export class KeysCompiler extends SectionCompiler { * @returns just the non-touch layers. */ public hardwareLayers() { - return this.keyboard.layers?.filter(({ form }) => form !== "touch"); + return this.keyboard3.layers?.filter(({ form }) => form !== "touch"); } public validate() { let valid = true; // general key-level validation here, only of used keys - const usedKeys = allUsedKeyIdsInLayers(this.keyboard?.layers); - const uniqueKeys = calculateUniqueKeys([...this.keyboard.keys?.key]); + const usedKeys = allUsedKeyIdsInLayers(this.keyboard3?.layers); + const uniqueKeys = calculateUniqueKeys([...this.keyboard3.keys?.key]); for (let key of uniqueKeys) { const { id, flicks } = key; if (!usedKeys.has(id)) { @@ -48,7 +48,7 @@ export class KeysCompiler extends SectionCompiler { if (!flicks) { continue; // no flicks } - const flickEntry = this.keyboard.keys?.flicks?.find( + const flickEntry = this.keyboard3.keys?.flicks?.find( (x) => x.id === flicks ); if (!flickEntry) { @@ -80,7 +80,7 @@ export class KeysCompiler extends SectionCompiler { public compile(sections: DependencySections): Keys { /* c8 ignore next 4 */ - if (!this.keyboard?.keys?.key && !this.keyboard?.keys?.flicks) { + if (!this.keyboard3?.keys?.key && !this.keyboard3?.keys?.flicks) { // short-circuit if no keys or flicks. Doesn't happen in practice due to implied import. return null; } @@ -114,7 +114,7 @@ export class KeysCompiler extends SectionCompiler { } public loadFlicks(sections: DependencySections, sect: Keys) { - for (let lkflicks of this.keyboard.keys.flicks) { + for (let lkflicks of this.keyboard3.keys.flicks) { let flicks: KeysFlicks = new KeysFlicks( sections.strs.allocString(lkflicks.id) ); @@ -142,8 +142,8 @@ export class KeysCompiler extends SectionCompiler { } public loadKeys(sections: DependencySections, sect: Keys) { - const usedKeys = allUsedKeyIdsInLayers(this.keyboard?.layers); - const uniqueKeys = calculateUniqueKeys([...this.keyboard.keys?.key]); + const usedKeys = allUsedKeyIdsInLayers(this.keyboard3?.layers); + const uniqueKeys = calculateUniqueKeys([...this.keyboard3.keys?.key]); for (let key of uniqueKeys) { if (!usedKeys.has(key.id)) { @@ -227,7 +227,7 @@ export class KeysCompiler extends SectionCompiler { valid = false; } - const uniqueKeys = calculateUniqueKeys([...this.keyboard.keys?.key]); + const uniqueKeys = calculateUniqueKeys([...this.keyboard3.keys?.key]); if (layer.row.length > keymap.length) { this.callbacks.reportMessage( CompilerMessages.Error_HardwareLayerHasTooManyRows() @@ -300,7 +300,7 @@ export class KeysCompiler extends SectionCompiler { // TODO-LDML: we already validated that the key exists, above. // So here we only need the ID? - // let keydef = this.keyboard.keys?.key?.find(x => x.id == key); + // let keydef = this.keyboard3.keys?.key?.find(x => x.id == key); sect.kmap.push({ vkey: keymap[y][x], diff --git a/developer/src/kmc-ldml/src/compiler/layr.ts b/developer/src/kmc-ldml/src/compiler/layr.ts index e0be7a6f5e..281ca8d5db 100644 --- a/developer/src/kmc-ldml/src/compiler/layr.ts +++ b/developer/src/kmc-ldml/src/compiler/layr.ts @@ -22,7 +22,7 @@ export class LayrCompiler extends SectionCompiler { let totalLayerCount = 0; let hardwareLayers = 0; // let touchLayers = 0; - this.keyboard.layers?.forEach((layers) => { + this.keyboard3.layers?.forEach((layers) => { const { form } = layers; if (form === 'touch') { // touchLayers++; @@ -62,7 +62,7 @@ export class LayrCompiler extends SectionCompiler { public compile(sections: DependencySections): Layr { const sect = new Layr(); - sect.lists = this.keyboard.layers.map((layers) => { + sect.lists = this.keyboard3.layers.map((layers) => { const hardware = constants.layr_list_hardware_map.get(layers.form); // Already validated in validate const list: LayrList = { diff --git a/developer/src/kmc-ldml/src/compiler/loca.ts b/developer/src/kmc-ldml/src/compiler/loca.ts index a57a8224ae..84be9e0bbf 100644 --- a/developer/src/kmc-ldml/src/compiler/loca.ts +++ b/developer/src/kmc-ldml/src/compiler/loca.ts @@ -24,7 +24,7 @@ export class LocaCompiler extends SectionCompiler { public validate(): boolean { let valid = true; - const locales = this.getLocales(this.keyboard); + const locales = this.getLocales(this.keyboard3); for(let tag of locales) { try { new Intl.Locale(tag); @@ -46,7 +46,7 @@ export class LocaCompiler extends SectionCompiler { // This also minimizes locales according to Remove Likely Subtags algorithm: // https://www.unicode.org/reports/tr35/#Likely_Subtags - const sourceLocales = this.getLocales(this.keyboard); + const sourceLocales = this.getLocales(this.keyboard3); const locales = sourceLocales.map((sourceLocale: string) => { const locale = new Intl.Locale(sourceLocale).minimize().toString(); if(locale != sourceLocale) { diff --git a/developer/src/kmc-ldml/src/compiler/meta.ts b/developer/src/kmc-ldml/src/compiler/meta.ts index 2606692d99..187a2ca951 100644 --- a/developer/src/kmc-ldml/src/compiler/meta.ts +++ b/developer/src/kmc-ldml/src/compiler/meta.ts @@ -20,8 +20,8 @@ export class MetaCompiler extends SectionCompiler { public validate(): boolean { let valid = true; - valid &&= this.validateNormalization(this.keyboard.info?.normalization); - valid &&= this.validateVersion(this.keyboard.version?.number); + valid &&= this.validateNormalization(this.keyboard3.info?.normalization); + valid &&= this.validateVersion(this.keyboard3.version?.number); return valid; } @@ -53,16 +53,16 @@ export class MetaCompiler extends SectionCompiler { public compile(sections: DependencySections): Meta { let result = new Meta(); - result.author = sections.strs.allocString(this.keyboard.info?.author); - result.conform = sections.strs.allocString(this.keyboard.conformsTo); - result.layout = sections.strs.allocString(this.keyboard.info?.layout); - result.normalization = sections.strs.allocString(this.keyboard.info?.normalization); - result.indicator = sections.strs.allocString(this.keyboard.info?.indicator); - result.version = sections.strs.allocString(this.keyboard.version?.number ?? "0.0.0"); + result.author = sections.strs.allocString(this.keyboard3.info?.author); + result.conform = sections.strs.allocString(this.keyboard3.conformsTo); + result.layout = sections.strs.allocString(this.keyboard3.info?.layout); + result.normalization = sections.strs.allocString(this.keyboard3.info?.normalization); + result.indicator = sections.strs.allocString(this.keyboard3.info?.indicator); + result.version = sections.strs.allocString(this.keyboard3.version?.number ?? "0.0.0"); result.settings = - (this.keyboard.settings?.fallback == "omit" ? KeyboardSettings.fallback : 0) | - (this.keyboard.settings?.transformFailure == "omit" ? KeyboardSettings.transformFailure : 0) | - (this.keyboard.settings?.transformPartial == "hide" ? KeyboardSettings.transformPartial : 0); + (this.keyboard3.settings?.fallback == "omit" ? KeyboardSettings.fallback : 0) | + (this.keyboard3.settings?.transformFailure == "omit" ? KeyboardSettings.transformFailure : 0) | + (this.keyboard3.settings?.transformPartial == "hide" ? KeyboardSettings.transformPartial : 0); return result; } } diff --git a/developer/src/kmc-ldml/src/compiler/name.ts b/developer/src/kmc-ldml/src/compiler/name.ts index 21307cbc00..138732ae30 100644 --- a/developer/src/kmc-ldml/src/compiler/name.ts +++ b/developer/src/kmc-ldml/src/compiler/name.ts @@ -13,13 +13,13 @@ export class NameCompiler extends SectionCompiler { public validate(): boolean { let valid = true; - valid = (this.keyboard.names?.name?.length ?? 0) > 0; + valid = (this.keyboard3.names?.name?.length ?? 0) > 0; return valid; } public compile(sections: DependencySections): Name { let result = new Name(); - result.names = this.keyboard.names?.name?.map(v => sections.strs.allocString(v.value)) ?? []; + result.names = this.keyboard3.names?.name?.map(v => sections.strs.allocString(v.value)) ?? []; return result; } } diff --git a/developer/src/kmc-ldml/src/compiler/section-compiler.ts b/developer/src/kmc-ldml/src/compiler/section-compiler.ts index 9e187fafe6..8744059f7b 100644 --- a/developer/src/kmc-ldml/src/compiler/section-compiler.ts +++ b/developer/src/kmc-ldml/src/compiler/section-compiler.ts @@ -3,11 +3,11 @@ import { SectionIdent, constants } from '@keymanapp/ldml-keyboard-constants'; /* istanbul ignore next */ export class SectionCompiler { - protected readonly keyboard: LDMLKeyboard.LKKeyboard; + protected readonly keyboard3: LDMLKeyboard.LKKeyboard; protected readonly callbacks: CompilerCallbacks; constructor(source: LDMLKeyboard.LDMLKeyboardXMLSourceFile, callbacks: CompilerCallbacks) { - this.keyboard = source.keyboard; + this.keyboard3 = source.keyboard3; this.callbacks = callbacks; } diff --git a/developer/src/kmc-ldml/src/compiler/touch-layout-compiler.ts b/developer/src/kmc-ldml/src/compiler/touch-layout-compiler.ts index 311f213749..19ac78f13c 100644 --- a/developer/src/kmc-ldml/src/compiler/touch-layout-compiler.ts +++ b/developer/src/kmc-ldml/src/compiler/touch-layout-compiler.ts @@ -10,7 +10,7 @@ export class TouchLayoutCompiler { layer: [] }; - for(let layers of source.keyboard.layers) { + for(let layers of source.keyboard3.layers) { for(let layer of layers.layer) { const resultLayer = this.compileHardwareLayer(source, result, layer); result.desktop.layer.push(resultLayer); @@ -41,7 +41,7 @@ export class TouchLayoutCompiler { const keys = row.keys.split(' '); for(let key of keys) { - const keydef = source.keyboard.keys?.key?.find(x => x.id == key); + const keydef = source.keyboard3.keys?.key?.find(x => x.id == key); if(keydef) { const fileKey: TouchLayout.TouchLayoutKey = { id: this.translateKeyIdentifierToTouch(keydef.id) as TouchLayout.TouchLayoutKeyId, @@ -106,4 +106,4 @@ export class TouchLayoutCompiler { // Not a standard key return 'T_'+id; } -} \ No newline at end of file +} diff --git a/developer/src/kmc-ldml/src/compiler/tran.ts b/developer/src/kmc-ldml/src/compiler/tran.ts index fa1f828622..9f39e302ef 100644 --- a/developer/src/kmc-ldml/src/compiler/tran.ts +++ b/developer/src/kmc-ldml/src/compiler/tran.ts @@ -41,7 +41,7 @@ export class TransformCompiler type); if (!verifyValidAndUnique(types, @@ -167,7 +167,7 @@ export class TransformCompiler x.id == key); + let keydef = source.keyboard3.keys?.key?.find(x => x.id == key); if (!keydef) { throw Error(`Internal Error: could not find key id="${key}" in layer "${layer.id || ''}", row "${y}"`); diff --git a/developer/src/kmc-ldml/src/compiler/vkey.ts b/developer/src/kmc-ldml/src/compiler/vkey.ts index 2d6d44d9d0..1c4c69403b 100644 --- a/developer/src/kmc-ldml/src/compiler/vkey.ts +++ b/developer/src/kmc-ldml/src/compiler/vkey.ts @@ -14,10 +14,10 @@ export class VkeyCompiler extends SectionCompiler { public validate(): boolean { let valid = true; - if(this.keyboard.vkeys) { + if(this.keyboard3.vkeys) { let from: string[] = [], to: string[] = []; - this.keyboard.vkeys.vkey.forEach(vk => { + this.keyboard3.vkeys.vkey.forEach(vk => { if(LdmlVkeyNames[vk.from] === undefined) { // TODO-LDML: When we do #7135 this may need to change back to an error. this.callbacks.reportMessage(CompilerMessages.Hint_VkeyIsNotValid({vkey: vk.from})); @@ -51,12 +51,12 @@ export class VkeyCompiler extends SectionCompiler { public compile(): Vkey { let result = new Vkey(); - if(!this.keyboard.vkeys) { + if(!this.keyboard3.vkeys) { /* c8 ignore next 2 */ return result; // not hit due to boxing } - result.vkeys = this.keyboard.vkeys?.vkey.map(vk => { + result.vkeys = this.keyboard3.vkeys?.vkey.map(vk => { return { vkey: LdmlVkeyNames[vk.from], target: LdmlVkeyNames[vk.to] diff --git a/developer/src/kmc-ldml/test/fixtures/basic.xml b/developer/src/kmc-ldml/test/fixtures/basic.xml index 15266ceb66..9c45f5e07f 100644 --- a/developer/src/kmc-ldml/test/fixtures/basic.xml +++ b/developer/src/kmc-ldml/test/fixtures/basic.xml @@ -4,8 +4,8 @@ @@keys: [K_Q][K_W][K_Q] @@expected: \u0127\u1790\u17B6\u0127 --> - - + + @@ -65,4 +65,4 @@ - + diff --git a/developer/src/kmc-ldml/test/fixtures/sections/bksp/minimal.xml b/developer/src/kmc-ldml/test/fixtures/sections/bksp/minimal.xml index 6de012b33a..cdff4b37fa 100644 --- a/developer/src/kmc-ldml/test/fixtures/sections/bksp/minimal.xml +++ b/developer/src/kmc-ldml/test/fixtures/sections/bksp/minimal.xml @@ -1,7 +1,7 @@ - - + + @@ -13,4 +13,4 @@ - + diff --git a/developer/src/kmc-ldml/test/fixtures/sections/disp/escaped.xml b/developer/src/kmc-ldml/test/fixtures/sections/disp/escaped.xml index 56508009fd..d934eb8399 100644 --- a/developer/src/kmc-ldml/test/fixtures/sections/disp/escaped.xml +++ b/developer/src/kmc-ldml/test/fixtures/sections/disp/escaped.xml @@ -1,7 +1,7 @@ - - + + @@ -11,4 +11,4 @@ - + diff --git a/developer/src/kmc-ldml/test/fixtures/sections/disp/invalid-both.xml b/developer/src/kmc-ldml/test/fixtures/sections/disp/invalid-both.xml index 9554fcd9b6..4c2be92e49 100644 --- a/developer/src/kmc-ldml/test/fixtures/sections/disp/invalid-both.xml +++ b/developer/src/kmc-ldml/test/fixtures/sections/disp/invalid-both.xml @@ -1,7 +1,7 @@ - - + + @@ -10,4 +10,4 @@ - + diff --git a/developer/src/kmc-ldml/test/fixtures/sections/disp/invalid-dupid.xml b/developer/src/kmc-ldml/test/fixtures/sections/disp/invalid-dupid.xml index 8766cbd6c6..20cda7475f 100644 --- a/developer/src/kmc-ldml/test/fixtures/sections/disp/invalid-dupid.xml +++ b/developer/src/kmc-ldml/test/fixtures/sections/disp/invalid-dupid.xml @@ -1,7 +1,7 @@ - - + + @@ -12,4 +12,4 @@ - + diff --git a/developer/src/kmc-ldml/test/fixtures/sections/disp/invalid-dupto.xml b/developer/src/kmc-ldml/test/fixtures/sections/disp/invalid-dupto.xml index 3f4c264cec..0018f0a5d9 100644 --- a/developer/src/kmc-ldml/test/fixtures/sections/disp/invalid-dupto.xml +++ b/developer/src/kmc-ldml/test/fixtures/sections/disp/invalid-dupto.xml @@ -1,7 +1,7 @@ - - + + @@ -12,4 +12,4 @@ - + diff --git a/developer/src/kmc-ldml/test/fixtures/sections/disp/invalid-none.xml b/developer/src/kmc-ldml/test/fixtures/sections/disp/invalid-none.xml index ce5cd689e7..fd05facbaa 100644 --- a/developer/src/kmc-ldml/test/fixtures/sections/disp/invalid-none.xml +++ b/developer/src/kmc-ldml/test/fixtures/sections/disp/invalid-none.xml @@ -1,7 +1,7 @@ - - + + @@ -10,4 +10,4 @@ - + diff --git a/developer/src/kmc-ldml/test/fixtures/sections/disp/maximal.xml b/developer/src/kmc-ldml/test/fixtures/sections/disp/maximal.xml index 22fb293a69..1a698edddb 100644 --- a/developer/src/kmc-ldml/test/fixtures/sections/disp/maximal.xml +++ b/developer/src/kmc-ldml/test/fixtures/sections/disp/maximal.xml @@ -1,7 +1,7 @@ - - + + @@ -12,4 +12,4 @@ - + diff --git a/developer/src/kmc-ldml/test/fixtures/sections/disp/minimal.xml b/developer/src/kmc-ldml/test/fixtures/sections/disp/minimal.xml index feb599c825..23ff75e29b 100644 --- a/developer/src/kmc-ldml/test/fixtures/sections/disp/minimal.xml +++ b/developer/src/kmc-ldml/test/fixtures/sections/disp/minimal.xml @@ -1,10 +1,10 @@ - - + + - + diff --git a/developer/src/kmc-ldml/test/fixtures/sections/disp/options-only.xml b/developer/src/kmc-ldml/test/fixtures/sections/disp/options-only.xml index c030909cc9..e2b9869521 100644 --- a/developer/src/kmc-ldml/test/fixtures/sections/disp/options-only.xml +++ b/developer/src/kmc-ldml/test/fixtures/sections/disp/options-only.xml @@ -1,7 +1,7 @@ - - + + @@ -9,4 +9,4 @@ - + diff --git a/developer/src/kmc-ldml/test/fixtures/sections/disp/typical.xml b/developer/src/kmc-ldml/test/fixtures/sections/disp/typical.xml index 935225e214..78ab408dec 100644 --- a/developer/src/kmc-ldml/test/fixtures/sections/disp/typical.xml +++ b/developer/src/kmc-ldml/test/fixtures/sections/disp/typical.xml @@ -1,7 +1,7 @@ - - + + @@ -9,4 +9,4 @@ - + diff --git a/developer/src/kmc-ldml/test/fixtures/sections/finl/minimal.xml b/developer/src/kmc-ldml/test/fixtures/sections/finl/minimal.xml index b9d5176bc1..6ed9631029 100644 --- a/developer/src/kmc-ldml/test/fixtures/sections/finl/minimal.xml +++ b/developer/src/kmc-ldml/test/fixtures/sections/finl/minimal.xml @@ -1,7 +1,7 @@ - - + + @@ -13,4 +13,4 @@ - + diff --git a/developer/src/kmc-ldml/test/fixtures/sections/keys/escaped.xml b/developer/src/kmc-ldml/test/fixtures/sections/keys/escaped.xml index d0a968927b..6caeda0dfd 100644 --- a/developer/src/kmc-ldml/test/fixtures/sections/keys/escaped.xml +++ b/developer/src/kmc-ldml/test/fixtures/sections/keys/escaped.xml @@ -1,7 +1,7 @@ - - + + @@ -34,4 +34,4 @@ - + diff --git a/developer/src/kmc-ldml/test/fixtures/sections/keys/escaped2.xml b/developer/src/kmc-ldml/test/fixtures/sections/keys/escaped2.xml index fee8847897..63a4384260 100644 --- a/developer/src/kmc-ldml/test/fixtures/sections/keys/escaped2.xml +++ b/developer/src/kmc-ldml/test/fixtures/sections/keys/escaped2.xml @@ -1,7 +1,7 @@ - - + + @@ -16,4 +16,4 @@ - + diff --git a/developer/src/kmc-ldml/test/fixtures/sections/keys/gap-switch.xml b/developer/src/kmc-ldml/test/fixtures/sections/keys/gap-switch.xml index 4cba4320e4..9734a7cf82 100644 --- a/developer/src/kmc-ldml/test/fixtures/sections/keys/gap-switch.xml +++ b/developer/src/kmc-ldml/test/fixtures/sections/keys/gap-switch.xml @@ -1,7 +1,7 @@ - - + + @@ -23,4 +23,4 @@ - + diff --git a/developer/src/kmc-ldml/test/fixtures/sections/keys/hardware.xml b/developer/src/kmc-ldml/test/fixtures/sections/keys/hardware.xml index fc282c7a6c..2c23b582c3 100644 --- a/developer/src/kmc-ldml/test/fixtures/sections/keys/hardware.xml +++ b/developer/src/kmc-ldml/test/fixtures/sections/keys/hardware.xml @@ -1,7 +1,7 @@ - - + + @@ -23,4 +23,4 @@ - + diff --git a/developer/src/kmc-ldml/test/fixtures/sections/keys/hardware_iso.xml b/developer/src/kmc-ldml/test/fixtures/sections/keys/hardware_iso.xml index 84afa0dddb..6c9e5e4708 100644 --- a/developer/src/kmc-ldml/test/fixtures/sections/keys/hardware_iso.xml +++ b/developer/src/kmc-ldml/test/fixtures/sections/keys/hardware_iso.xml @@ -1,7 +1,7 @@ - - + + @@ -19,4 +19,4 @@ - + diff --git a/developer/src/kmc-ldml/test/fixtures/sections/keys/hardware_us.xml b/developer/src/kmc-ldml/test/fixtures/sections/keys/hardware_us.xml index 8182e8c3f0..35be4e6ee3 100644 --- a/developer/src/kmc-ldml/test/fixtures/sections/keys/hardware_us.xml +++ b/developer/src/kmc-ldml/test/fixtures/sections/keys/hardware_us.xml @@ -1,7 +1,7 @@ - - + + @@ -19,4 +19,4 @@ - + diff --git a/developer/src/kmc-ldml/test/fixtures/sections/keys/invalid-bad-modifier.xml b/developer/src/kmc-ldml/test/fixtures/sections/keys/invalid-bad-modifier.xml index 77f2ff39d1..8bb9f69513 100644 --- a/developer/src/kmc-ldml/test/fixtures/sections/keys/invalid-bad-modifier.xml +++ b/developer/src/kmc-ldml/test/fixtures/sections/keys/invalid-bad-modifier.xml @@ -1,7 +1,7 @@ - - + + @@ -14,4 +14,4 @@ - + diff --git a/developer/src/kmc-ldml/test/fixtures/sections/keys/invalid-hardware-too-many-keys.xml b/developer/src/kmc-ldml/test/fixtures/sections/keys/invalid-hardware-too-many-keys.xml index 6c2f01a085..59abe6c9bf 100644 --- a/developer/src/kmc-ldml/test/fixtures/sections/keys/invalid-hardware-too-many-keys.xml +++ b/developer/src/kmc-ldml/test/fixtures/sections/keys/invalid-hardware-too-many-keys.xml @@ -1,7 +1,7 @@ - - + + @@ -30,4 +30,4 @@ - + diff --git a/developer/src/kmc-ldml/test/fixtures/sections/keys/invalid-hardware-too-many-rows.xml b/developer/src/kmc-ldml/test/fixtures/sections/keys/invalid-hardware-too-many-rows.xml index f868fb3db3..5c6cc4ae4f 100644 --- a/developer/src/kmc-ldml/test/fixtures/sections/keys/invalid-hardware-too-many-rows.xml +++ b/developer/src/kmc-ldml/test/fixtures/sections/keys/invalid-hardware-too-many-rows.xml @@ -1,7 +1,7 @@ - - + + @@ -22,4 +22,4 @@ - + diff --git a/developer/src/kmc-ldml/test/fixtures/sections/keys/invalid-key-missing-attrs.xml b/developer/src/kmc-ldml/test/fixtures/sections/keys/invalid-key-missing-attrs.xml index 98e2131b5d..53af177744 100644 --- a/developer/src/kmc-ldml/test/fixtures/sections/keys/invalid-key-missing-attrs.xml +++ b/developer/src/kmc-ldml/test/fixtures/sections/keys/invalid-key-missing-attrs.xml @@ -1,7 +1,7 @@ - - + + @@ -16,4 +16,4 @@ - + diff --git a/developer/src/kmc-ldml/test/fixtures/sections/keys/invalid-missing-flick.xml b/developer/src/kmc-ldml/test/fixtures/sections/keys/invalid-missing-flick.xml index 4bce8aa31d..0ccd239239 100644 --- a/developer/src/kmc-ldml/test/fixtures/sections/keys/invalid-missing-flick.xml +++ b/developer/src/kmc-ldml/test/fixtures/sections/keys/invalid-missing-flick.xml @@ -1,7 +1,7 @@ - - + + @@ -20,4 +20,4 @@ - + diff --git a/developer/src/kmc-ldml/test/fixtures/sections/keys/invalid-undefined-key.xml b/developer/src/kmc-ldml/test/fixtures/sections/keys/invalid-undefined-key.xml index 65a86838ee..5d030c2929 100644 --- a/developer/src/kmc-ldml/test/fixtures/sections/keys/invalid-undefined-key.xml +++ b/developer/src/kmc-ldml/test/fixtures/sections/keys/invalid-undefined-key.xml @@ -1,7 +1,7 @@ - - + + @@ -15,4 +15,4 @@ - + diff --git a/developer/src/kmc-ldml/test/fixtures/sections/keys/markers.xml b/developer/src/kmc-ldml/test/fixtures/sections/keys/markers.xml index b911be9760..42b7013bd8 100644 --- a/developer/src/kmc-ldml/test/fixtures/sections/keys/markers.xml +++ b/developer/src/kmc-ldml/test/fixtures/sections/keys/markers.xml @@ -1,7 +1,7 @@ - - + + @@ -24,6 +24,6 @@ - + diff --git a/developer/src/kmc-ldml/test/fixtures/sections/keys/maximal.xml b/developer/src/kmc-ldml/test/fixtures/sections/keys/maximal.xml index 61554e8dd9..6c9b983fbd 100644 --- a/developer/src/kmc-ldml/test/fixtures/sections/keys/maximal.xml +++ b/developer/src/kmc-ldml/test/fixtures/sections/keys/maximal.xml @@ -1,7 +1,7 @@ - - + + @@ -34,4 +34,4 @@ - + diff --git a/developer/src/kmc-ldml/test/fixtures/sections/keys/minimal.xml b/developer/src/kmc-ldml/test/fixtures/sections/keys/minimal.xml index d8f9a64bff..801524e65f 100644 --- a/developer/src/kmc-ldml/test/fixtures/sections/keys/minimal.xml +++ b/developer/src/kmc-ldml/test/fixtures/sections/keys/minimal.xml @@ -1,7 +1,7 @@ - - + + @@ -17,4 +17,4 @@ - + diff --git a/developer/src/kmc-ldml/test/fixtures/sections/layr/invalid-invalid-form.xml b/developer/src/kmc-ldml/test/fixtures/sections/layr/invalid-invalid-form.xml index 064a59df80..9758cf8bbd 100644 --- a/developer/src/kmc-ldml/test/fixtures/sections/layr/invalid-invalid-form.xml +++ b/developer/src/kmc-ldml/test/fixtures/sections/layr/invalid-invalid-form.xml @@ -1,7 +1,7 @@ - - + + @@ -17,4 +17,4 @@ - + diff --git a/developer/src/kmc-ldml/test/fixtures/sections/layr/invalid-missing-hardware.xml b/developer/src/kmc-ldml/test/fixtures/sections/layr/invalid-missing-hardware.xml index 8d1c63e801..4be11f2604 100644 --- a/developer/src/kmc-ldml/test/fixtures/sections/layr/invalid-missing-hardware.xml +++ b/developer/src/kmc-ldml/test/fixtures/sections/layr/invalid-missing-hardware.xml @@ -1,7 +1,7 @@ - - + + @@ -17,4 +17,4 @@ - + diff --git a/developer/src/kmc-ldml/test/fixtures/sections/layr/invalid-missing-layer.xml b/developer/src/kmc-ldml/test/fixtures/sections/layr/invalid-missing-layer.xml index 0a2cdf0610..f0ca747ae7 100644 --- a/developer/src/kmc-ldml/test/fixtures/sections/layr/invalid-missing-layer.xml +++ b/developer/src/kmc-ldml/test/fixtures/sections/layr/invalid-missing-layer.xml @@ -1,7 +1,7 @@ - - + + @@ -14,4 +14,4 @@ - + diff --git a/developer/src/kmc-ldml/test/fixtures/sections/layr/invalid-missing-layer2.xml b/developer/src/kmc-ldml/test/fixtures/sections/layr/invalid-missing-layer2.xml index dd08e40e58..062e745dd1 100644 --- a/developer/src/kmc-ldml/test/fixtures/sections/layr/invalid-missing-layer2.xml +++ b/developer/src/kmc-ldml/test/fixtures/sections/layr/invalid-missing-layer2.xml @@ -1,11 +1,11 @@ - - + + - + diff --git a/developer/src/kmc-ldml/test/fixtures/sections/layr/invalid-multi-hardware.xml b/developer/src/kmc-ldml/test/fixtures/sections/layr/invalid-multi-hardware.xml index dadef48404..644b8d452f 100644 --- a/developer/src/kmc-ldml/test/fixtures/sections/layr/invalid-multi-hardware.xml +++ b/developer/src/kmc-ldml/test/fixtures/sections/layr/invalid-multi-hardware.xml @@ -1,7 +1,7 @@ - - + + @@ -24,4 +24,4 @@ - + diff --git a/developer/src/kmc-ldml/test/fixtures/sections/loca/invalid-locale.xml b/developer/src/kmc-ldml/test/fixtures/sections/loca/invalid-locale.xml index 1644742c73..0661d9a021 100644 --- a/developer/src/kmc-ldml/test/fixtures/sections/loca/invalid-locale.xml +++ b/developer/src/kmc-ldml/test/fixtures/sections/loca/invalid-locale.xml @@ -1,9 +1,9 @@ - - + + - + diff --git a/developer/src/kmc-ldml/test/fixtures/sections/loca/minimal.xml b/developer/src/kmc-ldml/test/fixtures/sections/loca/minimal.xml index 7ca838be6f..4fe10cba2a 100644 --- a/developer/src/kmc-ldml/test/fixtures/sections/loca/minimal.xml +++ b/developer/src/kmc-ldml/test/fixtures/sections/loca/minimal.xml @@ -1,10 +1,10 @@ - - + + - + diff --git a/developer/src/kmc-ldml/test/fixtures/sections/loca/multiple.xml b/developer/src/kmc-ldml/test/fixtures/sections/loca/multiple.xml index 30d00bea2e..a6363c3533 100644 --- a/developer/src/kmc-ldml/test/fixtures/sections/loca/multiple.xml +++ b/developer/src/kmc-ldml/test/fixtures/sections/loca/multiple.xml @@ -1,7 +1,7 @@ - - + + @@ -15,4 +15,4 @@ - + diff --git a/developer/src/kmc-ldml/test/fixtures/sections/meta/invalid-normalization.xml b/developer/src/kmc-ldml/test/fixtures/sections/meta/invalid-normalization.xml index 13723cbb2e..ffb1befffe 100644 --- a/developer/src/kmc-ldml/test/fixtures/sections/meta/invalid-normalization.xml +++ b/developer/src/kmc-ldml/test/fixtures/sections/meta/invalid-normalization.xml @@ -1,7 +1,7 @@ - - + + @@ -9,4 +9,4 @@ - + diff --git a/developer/src/kmc-ldml/test/fixtures/sections/meta/invalid-version-1.0.xml b/developer/src/kmc-ldml/test/fixtures/sections/meta/invalid-version-1.0.xml index f7246e40cb..9e2536ba75 100644 --- a/developer/src/kmc-ldml/test/fixtures/sections/meta/invalid-version-1.0.xml +++ b/developer/src/kmc-ldml/test/fixtures/sections/meta/invalid-version-1.0.xml @@ -1,7 +1,7 @@ - - + + @@ -9,4 +9,4 @@ - + diff --git a/developer/src/kmc-ldml/test/fixtures/sections/meta/invalid-version-v1.0.3.xml b/developer/src/kmc-ldml/test/fixtures/sections/meta/invalid-version-v1.0.3.xml index dd6e292345..04ecb5a656 100644 --- a/developer/src/kmc-ldml/test/fixtures/sections/meta/invalid-version-v1.0.3.xml +++ b/developer/src/kmc-ldml/test/fixtures/sections/meta/invalid-version-v1.0.3.xml @@ -1,7 +1,7 @@ - - + + @@ -9,4 +9,4 @@ - + diff --git a/developer/src/kmc-ldml/test/fixtures/sections/meta/maximal.xml b/developer/src/kmc-ldml/test/fixtures/sections/meta/maximal.xml index f42d892e91..06f56ebbb0 100644 --- a/developer/src/kmc-ldml/test/fixtures/sections/meta/maximal.xml +++ b/developer/src/kmc-ldml/test/fixtures/sections/meta/maximal.xml @@ -1,7 +1,7 @@ - - + + @@ -13,4 +13,4 @@ - + diff --git a/developer/src/kmc-ldml/test/fixtures/sections/meta/minimal.xml b/developer/src/kmc-ldml/test/fixtures/sections/meta/minimal.xml index 9de105e868..e523031e53 100644 --- a/developer/src/kmc-ldml/test/fixtures/sections/meta/minimal.xml +++ b/developer/src/kmc-ldml/test/fixtures/sections/meta/minimal.xml @@ -1,10 +1,10 @@ - - + + - + diff --git a/developer/src/kmc-ldml/test/fixtures/sections/name/minimal.xml b/developer/src/kmc-ldml/test/fixtures/sections/name/minimal.xml index 7181aa65f3..f1e4914e99 100644 --- a/developer/src/kmc-ldml/test/fixtures/sections/name/minimal.xml +++ b/developer/src/kmc-ldml/test/fixtures/sections/name/minimal.xml @@ -1,10 +1,10 @@ - - + + - + diff --git a/developer/src/kmc-ldml/test/fixtures/sections/name/multiple.xml b/developer/src/kmc-ldml/test/fixtures/sections/name/multiple.xml index 8838c4b4a6..8f4fd6d72f 100644 --- a/developer/src/kmc-ldml/test/fixtures/sections/name/multiple.xml +++ b/developer/src/kmc-ldml/test/fixtures/sections/name/multiple.xml @@ -1,7 +1,7 @@ - - + + @@ -12,4 +12,4 @@ - + diff --git a/developer/src/kmc-ldml/test/fixtures/sections/ordr/minimal.xml b/developer/src/kmc-ldml/test/fixtures/sections/ordr/minimal.xml index c29f6621cb..e019298c24 100644 --- a/developer/src/kmc-ldml/test/fixtures/sections/ordr/minimal.xml +++ b/developer/src/kmc-ldml/test/fixtures/sections/ordr/minimal.xml @@ -1,7 +1,7 @@ - - + + @@ -14,4 +14,4 @@ - + diff --git a/developer/src/kmc-ldml/test/fixtures/sections/ordr/multi-escape.xml b/developer/src/kmc-ldml/test/fixtures/sections/ordr/multi-escape.xml index 754d8fc003..6d27dc48e3 100644 --- a/developer/src/kmc-ldml/test/fixtures/sections/ordr/multi-escape.xml +++ b/developer/src/kmc-ldml/test/fixtures/sections/ordr/multi-escape.xml @@ -1,6 +1,6 @@ - - + + @@ -12,4 +12,4 @@ - + diff --git a/developer/src/kmc-ldml/test/fixtures/sections/ordr/nod-Lana.xml b/developer/src/kmc-ldml/test/fixtures/sections/ordr/nod-Lana.xml index be2da52469..1053655c9d 100644 --- a/developer/src/kmc-ldml/test/fixtures/sections/ordr/nod-Lana.xml +++ b/developer/src/kmc-ldml/test/fixtures/sections/ordr/nod-Lana.xml @@ -1,6 +1,6 @@ - - + + @@ -18,4 +18,4 @@ - + diff --git a/developer/src/kmc-ldml/test/fixtures/sections/tran/fail-duplicate-type.xml b/developer/src/kmc-ldml/test/fixtures/sections/tran/fail-duplicate-type.xml index ac26d5b175..ec268acfe3 100644 --- a/developer/src/kmc-ldml/test/fixtures/sections/tran/fail-duplicate-type.xml +++ b/developer/src/kmc-ldml/test/fixtures/sections/tran/fail-duplicate-type.xml @@ -1,7 +1,7 @@ - - + + @@ -18,4 +18,4 @@ - + diff --git a/developer/src/kmc-ldml/test/fixtures/sections/tran/fail-empty.xml b/developer/src/kmc-ldml/test/fixtures/sections/tran/fail-empty.xml index ec295a4261..61d3ab896a 100644 --- a/developer/src/kmc-ldml/test/fixtures/sections/tran/fail-empty.xml +++ b/developer/src/kmc-ldml/test/fixtures/sections/tran/fail-empty.xml @@ -1,7 +1,7 @@ - - + + @@ -19,4 +19,4 @@ - + diff --git a/developer/src/kmc-ldml/test/fixtures/sections/tran/fail-invalid-duplicate-type.xml b/developer/src/kmc-ldml/test/fixtures/sections/tran/fail-invalid-duplicate-type.xml index 3cf5de1982..15d3b5dcb0 100644 --- a/developer/src/kmc-ldml/test/fixtures/sections/tran/fail-invalid-duplicate-type.xml +++ b/developer/src/kmc-ldml/test/fixtures/sections/tran/fail-invalid-duplicate-type.xml @@ -1,7 +1,7 @@ - - + + @@ -18,4 +18,4 @@ - + diff --git a/developer/src/kmc-ldml/test/fixtures/sections/tran/fail-invalid-type.xml b/developer/src/kmc-ldml/test/fixtures/sections/tran/fail-invalid-type.xml index e881965f66..9fc7f7c3f5 100644 --- a/developer/src/kmc-ldml/test/fixtures/sections/tran/fail-invalid-type.xml +++ b/developer/src/kmc-ldml/test/fixtures/sections/tran/fail-invalid-type.xml @@ -1,7 +1,7 @@ - - + + @@ -13,4 +13,4 @@ - + diff --git a/developer/src/kmc-ldml/test/fixtures/sections/tran/fail-mixed.xml b/developer/src/kmc-ldml/test/fixtures/sections/tran/fail-mixed.xml index 56f962e52d..d16e55fd4e 100644 --- a/developer/src/kmc-ldml/test/fixtures/sections/tran/fail-mixed.xml +++ b/developer/src/kmc-ldml/test/fixtures/sections/tran/fail-mixed.xml @@ -1,7 +1,7 @@ - - + + @@ -14,4 +14,4 @@ - + diff --git a/developer/src/kmc-ldml/test/fixtures/sections/tran/minimal.xml b/developer/src/kmc-ldml/test/fixtures/sections/tran/minimal.xml index d93ef22dd5..a5392f596e 100644 --- a/developer/src/kmc-ldml/test/fixtures/sections/tran/minimal.xml +++ b/developer/src/kmc-ldml/test/fixtures/sections/tran/minimal.xml @@ -1,7 +1,7 @@ - - + + @@ -16,4 +16,4 @@ - + diff --git a/developer/src/kmc-ldml/test/fixtures/sections/tran/tran-vars.xml b/developer/src/kmc-ldml/test/fixtures/sections/tran/tran-vars.xml index 383ecd4386..676d281f97 100644 --- a/developer/src/kmc-ldml/test/fixtures/sections/tran/tran-vars.xml +++ b/developer/src/kmc-ldml/test/fixtures/sections/tran/tran-vars.xml @@ -1,7 +1,7 @@ - - + + @@ -26,4 +26,4 @@ - + diff --git a/developer/src/kmc-ldml/test/fixtures/sections/vars/dup0.xml b/developer/src/kmc-ldml/test/fixtures/sections/vars/dup0.xml index 6cd9fdf987..12c2706730 100644 --- a/developer/src/kmc-ldml/test/fixtures/sections/vars/dup0.xml +++ b/developer/src/kmc-ldml/test/fixtures/sections/vars/dup0.xml @@ -1,7 +1,7 @@ - - + + @@ -17,4 +17,4 @@ - + diff --git a/developer/src/kmc-ldml/test/fixtures/sections/vars/dup1.xml b/developer/src/kmc-ldml/test/fixtures/sections/vars/dup1.xml index e5d53b507b..a5bef8196f 100644 --- a/developer/src/kmc-ldml/test/fixtures/sections/vars/dup1.xml +++ b/developer/src/kmc-ldml/test/fixtures/sections/vars/dup1.xml @@ -1,7 +1,7 @@ - - + + @@ -18,4 +18,4 @@ - + diff --git a/developer/src/kmc-ldml/test/fixtures/sections/vars/fail-badref-0.xml b/developer/src/kmc-ldml/test/fixtures/sections/vars/fail-badref-0.xml index af37a292da..be94255504 100644 --- a/developer/src/kmc-ldml/test/fixtures/sections/vars/fail-badref-0.xml +++ b/developer/src/kmc-ldml/test/fixtures/sections/vars/fail-badref-0.xml @@ -1,7 +1,7 @@ - - + + @@ -14,4 +14,4 @@ - + diff --git a/developer/src/kmc-ldml/test/fixtures/sections/vars/fail-badref-1.xml b/developer/src/kmc-ldml/test/fixtures/sections/vars/fail-badref-1.xml index ec687e7bf0..45b7670a80 100644 --- a/developer/src/kmc-ldml/test/fixtures/sections/vars/fail-badref-1.xml +++ b/developer/src/kmc-ldml/test/fixtures/sections/vars/fail-badref-1.xml @@ -1,7 +1,7 @@ - - + + @@ -14,4 +14,4 @@ - + diff --git a/developer/src/kmc-ldml/test/fixtures/sections/vars/fail-badref-2.xml b/developer/src/kmc-ldml/test/fixtures/sections/vars/fail-badref-2.xml index dc4e143a8f..656faf0cd0 100644 --- a/developer/src/kmc-ldml/test/fixtures/sections/vars/fail-badref-2.xml +++ b/developer/src/kmc-ldml/test/fixtures/sections/vars/fail-badref-2.xml @@ -1,7 +1,7 @@ - - + + @@ -14,4 +14,4 @@ - + diff --git a/developer/src/kmc-ldml/test/fixtures/sections/vars/fail-badref-3.xml b/developer/src/kmc-ldml/test/fixtures/sections/vars/fail-badref-3.xml index c0a100ceb2..628148a821 100644 --- a/developer/src/kmc-ldml/test/fixtures/sections/vars/fail-badref-3.xml +++ b/developer/src/kmc-ldml/test/fixtures/sections/vars/fail-badref-3.xml @@ -1,7 +1,7 @@ - - + + @@ -14,4 +14,4 @@ - + diff --git a/developer/src/kmc-ldml/test/fixtures/sections/vars/fail-badref-4.xml b/developer/src/kmc-ldml/test/fixtures/sections/vars/fail-badref-4.xml index 6fcca4d0e0..c05a8ec653 100644 --- a/developer/src/kmc-ldml/test/fixtures/sections/vars/fail-badref-4.xml +++ b/developer/src/kmc-ldml/test/fixtures/sections/vars/fail-badref-4.xml @@ -1,7 +1,7 @@ - - + + @@ -16,4 +16,4 @@ - + diff --git a/developer/src/kmc-ldml/test/fixtures/sections/vars/fail-badref-5.xml b/developer/src/kmc-ldml/test/fixtures/sections/vars/fail-badref-5.xml index 161c69154a..82721d834b 100644 --- a/developer/src/kmc-ldml/test/fixtures/sections/vars/fail-badref-5.xml +++ b/developer/src/kmc-ldml/test/fixtures/sections/vars/fail-badref-5.xml @@ -1,7 +1,7 @@ - - + + @@ -14,4 +14,4 @@ - + diff --git a/developer/src/kmc-ldml/test/fixtures/sections/vars/fail-badref-6.xml b/developer/src/kmc-ldml/test/fixtures/sections/vars/fail-badref-6.xml index 2b24b4c71e..dbe9deb07c 100644 --- a/developer/src/kmc-ldml/test/fixtures/sections/vars/fail-badref-6.xml +++ b/developer/src/kmc-ldml/test/fixtures/sections/vars/fail-badref-6.xml @@ -1,7 +1,7 @@ - - + + @@ -13,4 +13,4 @@ - + diff --git a/developer/src/kmc-ldml/test/fixtures/sections/vars/fail-markers-badref-0.xml b/developer/src/kmc-ldml/test/fixtures/sections/vars/fail-markers-badref-0.xml index fd63c36b02..cdfaf3f324 100644 --- a/developer/src/kmc-ldml/test/fixtures/sections/vars/fail-markers-badref-0.xml +++ b/developer/src/kmc-ldml/test/fixtures/sections/vars/fail-markers-badref-0.xml @@ -4,8 +4,8 @@ This will fail because the two markers given don't exist anywhere. --> - - + + @@ -40,4 +40,4 @@ This will fail because the two markers given don't exist anywhere. - + diff --git a/developer/src/kmc-ldml/test/fixtures/sections/vars/fail-uset-props1.xml b/developer/src/kmc-ldml/test/fixtures/sections/vars/fail-uset-props1.xml index c7930181d3..110af57940 100644 --- a/developer/src/kmc-ldml/test/fixtures/sections/vars/fail-uset-props1.xml +++ b/developer/src/kmc-ldml/test/fixtures/sections/vars/fail-uset-props1.xml @@ -1,7 +1,7 @@ - - + + @@ -14,4 +14,4 @@ - + diff --git a/developer/src/kmc-ldml/test/fixtures/sections/vars/fail-uset-props2.xml b/developer/src/kmc-ldml/test/fixtures/sections/vars/fail-uset-props2.xml index 761c2251c3..5c03b0d682 100644 --- a/developer/src/kmc-ldml/test/fixtures/sections/vars/fail-uset-props2.xml +++ b/developer/src/kmc-ldml/test/fixtures/sections/vars/fail-uset-props2.xml @@ -1,7 +1,7 @@ - - + + @@ -13,4 +13,4 @@ - + diff --git a/developer/src/kmc-ldml/test/fixtures/sections/vars/fail-uset-strings.xml b/developer/src/kmc-ldml/test/fixtures/sections/vars/fail-uset-strings.xml index a207df13f1..5d691f3d4b 100644 --- a/developer/src/kmc-ldml/test/fixtures/sections/vars/fail-uset-strings.xml +++ b/developer/src/kmc-ldml/test/fixtures/sections/vars/fail-uset-strings.xml @@ -1,7 +1,7 @@ - - + + @@ -13,4 +13,4 @@ - + diff --git a/developer/src/kmc-ldml/test/fixtures/sections/vars/fail-uset-syntax.xml b/developer/src/kmc-ldml/test/fixtures/sections/vars/fail-uset-syntax.xml index 0fd29f5bab..9ed1b08c9a 100644 --- a/developer/src/kmc-ldml/test/fixtures/sections/vars/fail-uset-syntax.xml +++ b/developer/src/kmc-ldml/test/fixtures/sections/vars/fail-uset-syntax.xml @@ -1,7 +1,7 @@ - - + + @@ -13,4 +13,4 @@ - + diff --git a/developer/src/kmc-ldml/test/fixtures/sections/vars/markers-maximal.xml b/developer/src/kmc-ldml/test/fixtures/sections/vars/markers-maximal.xml index cbe36d4db1..345e70d8f4 100644 --- a/developer/src/kmc-ldml/test/fixtures/sections/vars/markers-maximal.xml +++ b/developer/src/kmc-ldml/test/fixtures/sections/vars/markers-maximal.xml @@ -8,8 +8,8 @@ into something testable for implementation. --> - - + + @@ -41,4 +41,4 @@ - + diff --git a/developer/src/kmc-ldml/test/fixtures/sections/vars/maximal.xml b/developer/src/kmc-ldml/test/fixtures/sections/vars/maximal.xml index 1747026a76..89d32d89db 100644 --- a/developer/src/kmc-ldml/test/fixtures/sections/vars/maximal.xml +++ b/developer/src/kmc-ldml/test/fixtures/sections/vars/maximal.xml @@ -1,7 +1,7 @@ - - + + @@ -18,4 +18,4 @@ - + diff --git a/developer/src/kmc-ldml/test/fixtures/sections/vars/minimal.xml b/developer/src/kmc-ldml/test/fixtures/sections/vars/minimal.xml index 1113008dc6..6e6a3ab02e 100644 --- a/developer/src/kmc-ldml/test/fixtures/sections/vars/minimal.xml +++ b/developer/src/kmc-ldml/test/fixtures/sections/vars/minimal.xml @@ -1,7 +1,7 @@ - - + + @@ -16,4 +16,4 @@ - + diff --git a/developer/src/kmc-ldml/test/fixtures/sections/vkey/invalid-from-vkey.xml b/developer/src/kmc-ldml/test/fixtures/sections/vkey/invalid-from-vkey.xml index d28c9f09d0..9ed1d1b63f 100644 --- a/developer/src/kmc-ldml/test/fixtures/sections/vkey/invalid-from-vkey.xml +++ b/developer/src/kmc-ldml/test/fixtures/sections/vkey/invalid-from-vkey.xml @@ -1,7 +1,7 @@ - - + + @@ -15,4 +15,4 @@ - + diff --git a/developer/src/kmc-ldml/test/fixtures/sections/vkey/invalid-repeated-vkey.xml b/developer/src/kmc-ldml/test/fixtures/sections/vkey/invalid-repeated-vkey.xml index 15641e6855..36deceb4d8 100644 --- a/developer/src/kmc-ldml/test/fixtures/sections/vkey/invalid-repeated-vkey.xml +++ b/developer/src/kmc-ldml/test/fixtures/sections/vkey/invalid-repeated-vkey.xml @@ -1,7 +1,7 @@ - - + + @@ -13,4 +13,4 @@ - + diff --git a/developer/src/kmc-ldml/test/fixtures/sections/vkey/invalid-to-vkey.xml b/developer/src/kmc-ldml/test/fixtures/sections/vkey/invalid-to-vkey.xml index ff47597000..58b573adc2 100644 --- a/developer/src/kmc-ldml/test/fixtures/sections/vkey/invalid-to-vkey.xml +++ b/developer/src/kmc-ldml/test/fixtures/sections/vkey/invalid-to-vkey.xml @@ -1,7 +1,7 @@ - - + + @@ -12,4 +12,4 @@ - + diff --git a/developer/src/kmc-ldml/test/fixtures/sections/vkey/minimal.xml b/developer/src/kmc-ldml/test/fixtures/sections/vkey/minimal.xml index 3223d31189..4af6dd3032 100644 --- a/developer/src/kmc-ldml/test/fixtures/sections/vkey/minimal.xml +++ b/developer/src/kmc-ldml/test/fixtures/sections/vkey/minimal.xml @@ -1,7 +1,7 @@ - - + + @@ -14,4 +14,4 @@ - + diff --git a/developer/src/kmc-ldml/test/fixtures/sections/vkey/redundant.xml b/developer/src/kmc-ldml/test/fixtures/sections/vkey/redundant.xml index 8d5d1caf61..612d12c014 100644 --- a/developer/src/kmc-ldml/test/fixtures/sections/vkey/redundant.xml +++ b/developer/src/kmc-ldml/test/fixtures/sections/vkey/redundant.xml @@ -1,7 +1,7 @@ - - + + @@ -12,4 +12,4 @@ - + diff --git a/developer/src/kmc-ldml/test/fixtures/sections/vkey/same-target.xml b/developer/src/kmc-ldml/test/fixtures/sections/vkey/same-target.xml index 65aa1fa2a5..9dd34420eb 100644 --- a/developer/src/kmc-ldml/test/fixtures/sections/vkey/same-target.xml +++ b/developer/src/kmc-ldml/test/fixtures/sections/vkey/same-target.xml @@ -1,7 +1,7 @@ - - + + @@ -13,4 +13,4 @@ - + diff --git a/developer/src/kmc-ldml/test/fixtures/test-fr.json b/developer/src/kmc-ldml/test/fixtures/test-fr.json index 9e3341f824..895360dd85 100644 --- a/developer/src/kmc-ldml/test/fixtures/test-fr.json +++ b/developer/src/kmc-ldml/test/fixtures/test-fr.json @@ -1,5 +1,5 @@ { - "keyboardTest": { + "keyboardTest3": { "conformsTo": "techpreview", "info": { "keyboard": "fr-t-k0-azerty.xml", diff --git a/developer/src/kmc-ldml/test/fixtures/test-fr.xml b/developer/src/kmc-ldml/test/fixtures/test-fr.xml index c97825385a..e138a1b5d1 100644 --- a/developer/src/kmc-ldml/test/fixtures/test-fr.xml +++ b/developer/src/kmc-ldml/test/fixtures/test-fr.xml @@ -1,6 +1,6 @@ - - + + @@ -19,4 +19,4 @@ - + diff --git a/developer/src/kmc-ldml/test/test-dependencies.ts b/developer/src/kmc-ldml/test/test-dependencies.ts index e58fd36c55..5171648c4a 100644 --- a/developer/src/kmc-ldml/test/test-dependencies.ts +++ b/developer/src/kmc-ldml/test/test-dependencies.ts @@ -7,7 +7,7 @@ describe('test of section compiler dependencies', () => { const sects : Set = new Set(); for (const sect of SECTION_COMPILERS) { // construct the compiler - const c = new sect({ keyboard: null }, null); // For now, this is OK for the inspection + const c = new sect({ keyboard3: null }, null); // For now, this is OK for the inspection const id = c.id; assert.ok(id); assert.isFalse(sects.has(id), `Duplicate compiler ${id} in SECTION_COMPILERS`); diff --git a/resources/standards-data/ldml-keyboards/readme.md b/resources/standards-data/ldml-keyboards/readme.md index 188c80ec76..66f54789c0 100644 --- a/resources/standards-data/ldml-keyboards/readme.md +++ b/resources/standards-data/ldml-keyboards/readme.md @@ -12,7 +12,7 @@ Each directory contains: - `ldmlKeyboard.dtd` - the DTD file - `ldmlKeyboard.xsd` - the XSD file, automatically converted from the DTD using Visual Studio, hand tweaked as necessary -- `ldml-keyboard.schema.json` - the JSON schema file, automatically converted +- `ldml-keyboard3.schema.json` - the JSON schema file, automatically converted from the XSD using xsd2json (https://github.com/Mermade/jgeXml), hand tweaked as necessary: - change toplevel "id" to "$id" diff --git a/resources/standards-data/ldml-keyboards/techpreview/3.0/pcm.xml b/resources/standards-data/ldml-keyboards/techpreview/3.0/pcm.xml index 5796575ee8..f175fbd039 100644 --- a/resources/standards-data/ldml-keyboards/techpreview/3.0/pcm.xml +++ b/resources/standards-data/ldml-keyboards/techpreview/3.0/pcm.xml @@ -1,6 +1,6 @@ - - + + @@ -55,4 +55,4 @@ - + diff --git a/resources/standards-data/ldml-keyboards/techpreview/test/pcm-test.xml b/resources/standards-data/ldml-keyboards/techpreview/test/pcm-test.xml index 88fc500091..8f85126acc 100644 --- a/resources/standards-data/ldml-keyboards/techpreview/test/pcm-test.xml +++ b/resources/standards-data/ldml-keyboards/techpreview/test/pcm-test.xml @@ -1,6 +1,6 @@ - - + + @@ -18,4 +18,4 @@ - + From f58cd50e6281c3d198e6b6ac08eb46f1b71ba642 Mon Sep 17 00:00:00 2001 From: Darcy Wong Date: Tue, 19 Sep 2023 09:23:10 +0700 Subject: [PATCH 18/47] chore(web): Update background color for Android popup keys Match from styles/colors.xml https://github.com/keymanapp/keyman/blob/31fd6ea42afef1dddd7d883fc31c5086fe9ae9b2/android/KMEA/app/src/main/res/values/colors.xml#L11 --- web/src/resources/osk/kmwosk.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web/src/resources/osk/kmwosk.css b/web/src/resources/osk/kmwosk.css index 1044d17722..029a0f7466 100644 --- a/web/src/resources/osk/kmwosk.css +++ b/web/src/resources/osk/kmwosk.css @@ -490,7 +490,7 @@ div.android div.kmw-keytip-cap { .tablet.ios #kmw-popup-keys .kmw-key{border:none;} .phone.ios #kmw-popup-keys .kmw-key{border:none;} -.phone.android #kmw-popup-keys {border:none; border-radius: 2px; background-color:#ccc; padding:5px 5px 0 0;} +.phone.android #kmw-popup-keys {border:none; border-radius: 2px; background-color:#333333; padding:5px 5px 0 0;} .tablet.android #kmw-popup-keys {border:1px solid #eee; border-radius: 3px; background-color:#888; padding:8px 12px 4px 4px;} @media (prefers-color-scheme: dark) { From 250b8a6b7d2a32b9209c1cab8b2c2155582964b2 Mon Sep 17 00:00:00 2001 From: Darcy Wong Date: Tue, 19 Sep 2023 09:40:41 +0700 Subject: [PATCH 19/47] chore(android): Remove popup code --- .../KMEA/app/src/main/assets/android-host.js | 52 --- .../com/keyman/engine/KMKeyPreviewView.java | 111 ------ .../java/com/keyman/engine/KMKeyboard.java | 359 ------------------ .../keyman/engine/KMKeyboardJSHandler.java | 8 - .../engine/KMKeyboardWebViewClient.java | 72 ---- .../java/com/keyman/engine/KMManager.java | 9 - .../app/src/main/res/layout/subkey_layout.xml | 10 - .../main/res/layout/subkeys_popup_layout.xml | 19 - .../KMEA/app/src/main/res/values/colors.xml | 4 - 9 files changed, 644 deletions(-) delete mode 100644 android/KMEA/app/src/main/java/com/keyman/engine/KMKeyPreviewView.java delete mode 100644 android/KMEA/app/src/main/res/layout/subkey_layout.xml delete mode 100644 android/KMEA/app/src/main/res/layout/subkeys_popup_layout.xml diff --git a/android/KMEA/app/src/main/assets/android-host.js b/android/KMEA/app/src/main/assets/android-host.js index 61e6c70d36..afa2825e33 100644 --- a/android/KMEA/app/src/main/assets/android-host.js +++ b/android/KMEA/app/src/main/assets/android-host.js @@ -229,58 +229,12 @@ function updateKMSelectionRange(start, end) { } var lastKeyTip = null; -function oskCreateKeyPreview(x,y,w,h,t) { - if(lastKeyTip && - lastKeyTip.t == t && - lastKeyTip.x == x && - lastKeyTip.y == y && - lastKeyTip.w == w && - lastKeyTip.h == h) { - return; - } - lastKeyTip = {x:x,y:y,w:w,h:h,t:t}; - - fragmentToggle = (fragmentToggle + 1) % 100; - var div = document.createElement('div'); - div.innerHTML = t; - var dt = div.firstChild.nodeValue; - window.location.hash = 'showKeyPreview-'+fragmentToggle+'+x='+x+'+y='+y+'+w='+w+'+h='+h+'+t='+toHex(dt); -} - -function oskClearKeyPreview() { - lastKeyTip = null; - fragmentToggle = (fragmentToggle + 1) % 100; - window.location.hash = 'dismissKeyPreview-'+fragmentToggle; -} function signalHelpBubbleDismissal() { fragmentToggle = (fragmentToggle + 1) % 100; window.location.hash = 'helpBubbleDismissed-'+fragmentToggle; } -function oskCreatePopup(obj,x,y) { - if(obj != null) { - var i; - var s = ''; - var shift = false; - var keyPos = x.toString() + ',' + y.toString(); - for(i=0; i> subKeysList = null; - public String[] subKeysWindowPos = {"0", "0"}; - // public something-something for the suggestion. public PopupWindow suggestionMenuWindow = null; public double[] suggestionWindowPos = {0, 0}; @@ -343,8 +337,6 @@ final class KMKeyboard extends WebView { } public void hideKeyboard() { - dismissKeyPreview(0); - dismissSubKeysWindow(); String jsString = "hideKeyboard()"; loadJavascript(jsString); @@ -372,18 +364,11 @@ final class KMKeyboard extends WebView { // suggestion banner longpresses - if so, it's not yet ready for proper integration... // and would need its own rung in this if-else ladder. if (true) { - if (event.getPointerCount() > 1) { - // Multiple points touch the screen at the same time, so dismiss any pending subkeys - dismissKeyPreview(0); - dismissSubKeysWindow(); - } gestureDetector.onTouchEvent(event); } if (action == MotionEvent.ACTION_UP) { // Cleanup popups. #6636 - dismissKeyPreview(0); - dismissSubKeysWindow(); } return super.onTouchEvent(event); @@ -402,23 +387,15 @@ final class KMKeyboard extends WebView { } public void onPause() { - dismissKeyPreview(0); - dismissSubKeysWindow(); - dismissHelpBubble(); } public void onDestroy() { - dismissKeyPreview(0); - dismissSubKeysWindow(); - dismissHelpBubble(); } public void onConfigurationChanged(Configuration newConfig) { super.onConfigurationChanged(newConfig); - dismissKeyPreview(0); - dismissSubKeysWindow(); RelativeLayout.LayoutParams params = KMManager.getKeyboardLayoutParams(); this.setLayoutParams(params); @@ -436,9 +413,6 @@ final class KMKeyboard extends WebView { } } - public void dismissSubKeysWindow() { - } - public void dismissSuggestionMenuWindow() { try { if (suggestionMenuWindow != null && suggestionMenuWindow.isShowing()) { @@ -946,234 +920,6 @@ final class KMKeyboard extends WebView { return; } - @SuppressLint({"InflateParams", "ClickableViewAccessibility"}) - private void showSubKeys(Context context) { - if (subKeysList == null || subKeysWindow != null) { - return; - } - - WindowManager wm = (WindowManager) context.getSystemService(Context.WINDOW_SERVICE); - DisplayMetrics metrics = new DisplayMetrics(); - wm.getDefaultDisplay().getMetrics(metrics); - float density = metrics.density; - - String[] pos = subKeysWindowPos; - int x = (int) (Float.valueOf(pos[0]) * density); - int y = (int) (Float.valueOf(pos[1]) * density); - - // Calculate desired size for subkey display, # of rows/cols, etc. - int kbWidth = getWidth(); - float pvWidth, pvHeight; - - float margin = getResources().getDimension(R.dimen.popup_margin); - int padding = getResources().getDimensionPixelSize(R.dimen.popup_padding); - int rows, columns; - float buttonWidth = getResources().getDimension(R.dimen.key_width); - float buttonHeight = getResources().getDimension(R.dimen.key_height); - float arrowWidth = getResources().getDimension(R.dimen.popup_arrow_width); - float arrowHeight = getResources().getDimension(R.dimen.popup_arrow_height); - float offset_y = getResources().getDimension(R.dimen.popup_offset_y); - - //int orientation = getResources().getConfiguration().orientation; - //columns = (orientation == Configuration.ORIENTATION_PORTRAIT)?6:10; - columns = (int) ((getWidth() - margin) / (buttonWidth + margin)); - int subKeysCount = subKeysList.size(); - if (subKeysCount <= columns) { - rows = 1; - pvWidth = (subKeysCount * (buttonWidth + padding)) + 2 * margin + padding; - pvHeight = (buttonHeight + padding) + 2 * margin + padding + arrowHeight; - } else { - rows = (subKeysCount / columns); - if (subKeysCount % columns > 0) { - rows++; - } - - if (subKeysCount % rows == 0) { - columns = subKeysCount / rows; - } else { - int s = (columns * rows - subKeysCount) / 2; - columns -= s / (rows - 1); - } - - pvWidth = (columns * (buttonWidth + padding)) + 2 * margin + padding; - pvHeight = (rows * (buttonHeight + padding)) + 2 * margin + padding + arrowHeight; - } - - // Construct from resources. - LayoutInflater inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE); - View contentView = inflater.inflate(R.layout.subkeys_popup_layout, null, false); - - // Configure the popover view with desired size and construct its popup "arrow." - KMPopoverView popoverView = (KMPopoverView) contentView.findViewById(R.id.kmPopoverView); - popoverView.setSize((int) pvWidth, (int) pvHeight); - popoverView.setArrowSize(arrowWidth, arrowHeight); - - float px = x - pvWidth / 2.0f; - float py = y + offset_y - pvHeight; - if (px < 0) { - px = 0; - } else if ((px + pvWidth) > kbWidth) { - px = kbWidth - pvWidth; - } - - if (px == 0) { - popoverView.setArrowPosX(x); - } else if (px == (kbWidth - pvWidth)) { - popoverView.setArrowPosX(x - px); - } else { - popoverView.setArrowPosX(pvWidth / 2.0f); - } - - popoverView.redraw(); - - // Add needed subkeys to the popup view. - GridLayout grid = (GridLayout) contentView.findViewById(R.id.grid); - grid.setColumnCount(columns); - - for (int i = 0; i < subKeysCount; i++) { - Button button = (Button) inflater.inflate(R.layout.subkey_layout, null); - button.setId(i + 1); - button.setLayoutParams(new FrameLayout.LayoutParams((int) buttonWidth, (int) buttonHeight)); - // May as well set them here, keeping them in a closure than a prone-to-change field. - // Helps keep things from totally breaking when the event handler triggering subkey menu - // generation and the menu's event handler stop talking to each other. - final ArrayList> subkeyList = subKeysList; - button.setOnClickListener(new OnClickListener() { - @Override - public void onClick(View v) { - int index = v.getId() - 1; - String keyId = subkeyList.get(index).get("keyId"); - String keyText = getSubkeyText(keyId, subkeyList.get(index).get("keyText")); - String jsFormat = "executePopupKey('%s','%s')"; - String jsString = KMString.format(jsFormat, keyId, keyText); - loadJavascript(jsString); - } - }); - button.setClickable(false); - - // Show existing text for subkeys. If subkey text is blank, get from id - String kId = subKeysList.get(i).get("keyId"); - String kText = getSubkeyText(kId, subKeysList.get(i).get("keyText")); - String title = convertKeyText(kText); - - // Disable Android's default uppercasing transformation on buttons. - button.setTransformationMethod(null); - button.setText(title); - - if (!specialOskFont.isEmpty()) { - button.setTypeface(KMManager.getFontTypeface(context, specialOSKFontFilename(specialOskFont))); - } else { - Typeface font = KMManager.getFontTypeface(context, (oskFont != null) ? oskFontFilename() : textFontFilename()); - if (font != null) { - button.setTypeface(font); - } else { - button.setTypeface(Typeface.SANS_SERIF); - } - } - - FrameLayout frame = new FrameLayout(context); - frame.setPadding(padding, padding, 0, 0); - frame.addView(button); - grid.addView(frame); - } - - grid.setOnTouchListener(new OnTouchListener() { - @SuppressLint("ClickableViewAccessibility") - @Override - public boolean onTouch(View v, MotionEvent event) { - int action = event.getAction(); - int tx = (int) event.getRawX(); - int ty = (int) event.getRawY(); - - if (action == MotionEvent.ACTION_UP) { - int count = ((ViewGroup) v).getChildCount(); - for (int i = 0; i < count; i++) { - FrameLayout frame = (FrameLayout) ((ViewGroup) v).getChildAt(i); - Button button = (Button) frame.getChildAt(0); - if (button.isPressed()) { - button.performClick(); - break; - } - } - dismissSubKeysWindow(); - return true; - } else if (action == MotionEvent.ACTION_MOVE) { - int count = ((ViewGroup) v).getChildCount(); - for (int i = 0; i < count; i++) { - FrameLayout frame = (FrameLayout) ((ViewGroup) v).getChildAt(i); - Button button = (Button) frame.getChildAt(0); - int[] pos = new int[2]; - button.getLocationOnScreen(pos); - Rect rect = new Rect(); - button.getDrawingRect(rect); - rect.offset(pos[0], pos[1]); - if (rect.contains(tx, ty)) { - button.setPressed(true); - } else { - button.setPressed(false); - } - } - return true; - } else if (action == MotionEvent.ACTION_DOWN) { - // Must return true if we want the others to properly process if and when this handler - // becomes decoupled from the keyboard's touch handler. - return true; - } - return false; - } - }); - - // Now to finalize the actual window. - subKeysWindow = new PopupWindow(contentView, (int) pvWidth, (int) pvHeight, false); - subKeysWindow.setTouchable(true); - subKeysWindow.setOnDismissListener(new OnDismissListener() { - @Override - public void onDismiss() { - subKeysList = null; - subKeysWindow = null; - String jsString = "popupVisible(0)"; - loadJavascript(jsString); - } - }); - - int posX, posY; - if (keyboardType == KeyboardType.KEYBOARD_TYPE_INAPP) { - int[] kbPos = new int[2]; - KMKeyboard.this.getLocationOnScreen(kbPos); - posX = (int) px; - posY = kbPos[1] + (int) py; - } else { - int[] kbPos = new int[2]; - KMKeyboard.this.getLocationInWindow(kbPos); - posX = (int) px; - posY = kbPos[1] + (int) py; - } - - dismissHelpBubble(); - this.setShouldShowHelpBubble(false); - dismissKeyPreview(0); - //subKeysWindow.setAnimationStyle(R.style.PopupAnim); - - // And now to actually display it. - subKeysWindow.showAtLocation(KMKeyboard.this, Gravity.TOP | Gravity.LEFT, posX, posY); - String jsString = "popupVisible(1)"; - loadJavascript(jsString); - } - - // Attempt to get the subkey text. - // If the subkey popup text is empty, parse the ID - private String getSubkeyText(String keyID, String keyText) { - String text = keyText; - if (text.isEmpty()) { - if(keyID.indexOf("U_") != -1 && keyID.indexOf("+") != -1 ) { - // Chop off any appended '+____' portion of the key ID. - keyID = keyID.substring(0, keyID.indexOf("+")); - } - text = keyID.replaceAll("U_", "\\\\u"); - } - return text; - } - /** * Take a font JSON object and adjust to pass to JS * 1. Replace "source" keys for "files" keys @@ -1233,111 +979,6 @@ final class KMKeyboard extends WebView { return null; } - @SuppressLint("InflateParams") - protected void showKeyPreview(Context context, int px, int py, RectF baseKeyFrame, String text) { - WindowManager wm = (WindowManager) context.getSystemService(Context.WINDOW_SERVICE); - DisplayMetrics metrics = new DisplayMetrics(); - wm.getDefaultDisplay().getMetrics(metrics); - float density = metrics.density; - - if (keyPreviewWindow != null && keyPreviewWindow.isShowing()) { - View contentView = keyPreviewWindow.getContentView(); - KMKeyPreviewView keyPreview = (KMKeyPreviewView) contentView.findViewById(R.id.kmKeyPreviewView); - TextView textView = (TextView) contentView.findViewById(R.id.textView1); - textView.setText(text); - Typeface font = KMManager.getFontTypeface(context, (oskFont != null) ? oskFontFilename() : textFontFilename()); - if (font != null) { - textView.setTypeface(font); - } else { - textView.setTypeface(Typeface.SANS_SERIF); - } - - int w = (int)getResources().getDimension(R.dimen.key_width); - int h = (int)getResources().getDimension(R.dimen.key_height); - RectF frame = keyPreview.setKeySize(w, h); - keyPreview.redraw(); - - float offset_y = getResources().getDimension(R.dimen.popup_offset_y); - int posX, posY; - if (keyboardType == KeyboardType.KEYBOARD_TYPE_INAPP) { - int[] kbPos = new int[2]; - KMKeyboard.this.getLocationOnScreen(kbPos); - posX = (int) (px * density - frame.width() / 2.0f); - posY = kbPos[1] + (int) (py * density - frame.height() + offset_y); - } else { - int[] kbPos = new int[2]; - KMKeyboard.this.getLocationInWindow(kbPos); - posX = (int) (px * density - frame.width() / 2.0f); - posY = kbPos[1] + (int) (py * density - frame.height() + offset_y); - } - - keyPreviewWindow.update(posX, posY, (int) frame.width(), (int) frame.height()); - return; - } - - LayoutInflater inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE); - View contentView = inflater.inflate(R.layout.key_preview_layout, null, false); - KMKeyPreviewView keyPreview = (KMKeyPreviewView) contentView.findViewById(R.id.kmKeyPreviewView); - TextView textView = (TextView) contentView.findViewById(R.id.textView1); - textView.setText(text); - Typeface font = KMManager.getFontTypeface(context, (oskFont != null) ? oskFontFilename() : textFontFilename()); - if (font != null) { - textView.setTypeface(font); - } else { - textView.setTypeface(Typeface.SANS_SERIF); - } - - int w = (int)getResources().getDimension(R.dimen.key_width); - int h = (int)getResources().getDimension(R.dimen.key_height); - RectF frame = keyPreview.setKeySize(w, h); - keyPreview.redraw(); - keyPreviewWindow = new PopupWindow(contentView, (int) frame.width(), (int) frame.height(), false); - keyPreviewWindow.setTouchable(true); - keyPreviewWindow.setOnDismissListener(new OnDismissListener() { - @Override - public void onDismiss() { - keyPreviewWindow = null; - } - }); - - float offset_y = getResources().getDimension(R.dimen.popup_offset_y); - int posX, posY; - if (keyboardType == KeyboardType.KEYBOARD_TYPE_INAPP) { - int[] kbPos = new int[2]; - KMKeyboard.this.getLocationOnScreen(kbPos); - posX = (int) (px * density - frame.width() / 2.0f); - posY = kbPos[1] + (int) (py * density - frame.height() + offset_y); - } else { - int[] kbPos = new int[2]; - KMKeyboard.this.getLocationInWindow(kbPos); - posX = (int) (px * density - frame.width() / 2.0f); - posY = kbPos[1] + (int) (py * density - frame.height() + offset_y); - } - - dismissHelpBubble(); - this.setShouldShowHelpBubble(false); - //keyPreviewWindow.setAnimationStyle(R.style.KeyPreviewAnim); - if (keyPreviewWindow != null) { - keyPreviewWindow.showAtLocation(KMKeyboard.this, Gravity.TOP | Gravity.LEFT, posX, posY); - } - } - - protected void dismissKeyPreview(long delay) { - // dismiss after delay - Handler handler = new Handler(); - handler.postDelayed(new Runnable() { - @Override - public void run() { - try { - if (keyPreviewWindow != null && keyPreviewWindow.isShowing()) - keyPreviewWindow.dismiss(); - } catch (Exception e) { - KMLog.LogException(TAG, "", e); - } - } - }, delay); - } - protected void showHelpBubble() { if(keyboardType == KeyboardType.KEYBOARD_TYPE_SYSTEM) { return; // Help bubble is disabled for System-wide keyboard diff --git a/android/KMEA/app/src/main/java/com/keyman/engine/KMKeyboardJSHandler.java b/android/KMEA/app/src/main/java/com/keyman/engine/KMKeyboardJSHandler.java index 2e939d15ba..6c959b0056 100644 --- a/android/KMEA/app/src/main/java/com/keyman/engine/KMKeyboardJSHandler.java +++ b/android/KMEA/app/src/main/java/com/keyman/engine/KMKeyboardJSHandler.java @@ -92,10 +92,6 @@ public class KMKeyboardJSHandler { return; } - if (k.subKeysWindow != null) { - return; - } - if (!isInappKMTextViewValid(k.keyboardType)) { return; } @@ -204,10 +200,6 @@ public class KMKeyboardJSHandler { return; } - if (k.subKeysWindow != null) { - return; - } - if (!isInappKMTextViewValid(k.keyboardType)) { return; } diff --git a/android/KMEA/app/src/main/java/com/keyman/engine/KMKeyboardWebViewClient.java b/android/KMEA/app/src/main/java/com/keyman/engine/KMKeyboardWebViewClient.java index 7ea366f0d1..e7188a94f9 100644 --- a/android/KMEA/app/src/main/java/com/keyman/engine/KMKeyboardWebViewClient.java +++ b/android/KMEA/app/src/main/java/com/keyman/engine/KMKeyboardWebViewClient.java @@ -163,78 +163,6 @@ public final class KMKeyboardWebViewClient extends WebViewClient { // The user has begun interacting with the keyboard; we'll disable the help bubble // for the rest of the lifetime of this keyboard instance. kmKeyboard.setShouldShowHelpBubble(false); - } else if (url.indexOf("showKeyPreview") >= 0) { - String deviceType = context.getResources().getString(R.string.device_type); - if (deviceType.equals("AndroidTablet")) { - return false; - } - - if (kmKeyboard.subKeysWindow != null) { - return false; - } - - int start = url.indexOf("x=") + 2; - int end = url.indexOf("+y="); - float x = Float.valueOf(url.substring(start, end)); - - start = url.indexOf("y=") + 2; - end = url.indexOf("+w="); - float y = Float.valueOf(url.substring(start, end)); - - start = url.indexOf("w=") + 2; - end = url.indexOf("+h="); - float w = Float.valueOf(url.substring(start, end)); - - start = url.indexOf("h=") + 2; - end = url.indexOf("+t="); - float h = Float.valueOf(url.substring(start, end)); - - start = url.indexOf("t=") + 2; - String t = url.substring(start); - String text = kmKeyboard.convertKeyText(t); - - float left = x - w / 2.0f; - float right = left + w; - float top = y - 1; - float bottom = top + h; - - RectF keyFrame = new RectF(left, top, right, bottom); - kmKeyboard.showKeyPreview(context, (int) x, (int) y, keyFrame, text); - } else if (url.indexOf("dismissKeyPreview") >= 0) { - kmKeyboard.dismissKeyPreview(100); - } else if (url.indexOf("showMore") >= 0) { - if (kmKeyboard.subKeysWindow != null && kmKeyboard.subKeysWindow.isShowing()) { - return false; - } - - int start = url.indexOf("keyPos=") + 7; - int end = url.indexOf("+keys="); - kmKeyboard.subKeysWindowPos = url.substring(start, end).split("\\,"); - - start = end + 6; - end = url.indexOf("+font="); - if (end < 0) { - end = url.length(); - kmKeyboard.specialOskFont = ""; - } else { - kmKeyboard.specialOskFont = KMManager.KMFilename_Osk_Ttf_Font; - } - - String keys = url.substring(start, end); - - String[] keyList = keys.split("\\;"); - int klCount = keyList.length; - kmKeyboard.subKeysList = new ArrayList>(); - for (int i = 0; i < klCount; i++) { - String[] values = keyList[i].split("\\:"); - String keyId = (values.length > 0) ? values[0] : ""; - String keyText = (values.length > 1) ? values[1] : ""; - - HashMap hashMap = new HashMap(); - hashMap.put("keyId", keyId); - hashMap.put("keyText", keyText); - kmKeyboard.subKeysList.add(hashMap); - } } else if (url.indexOf("refreshBannerHeight") >= 0) { int start = url.indexOf("change=") + 7; String change = url.substring(start); diff --git a/android/KMEA/app/src/main/java/com/keyman/engine/KMManager.java b/android/KMEA/app/src/main/java/com/keyman/engine/KMManager.java index 6777de8133..cbcb28053a 100644 --- a/android/KMEA/app/src/main/java/com/keyman/engine/KMManager.java +++ b/android/KMEA/app/src/main/java/com/keyman/engine/KMManager.java @@ -2153,15 +2153,6 @@ public final class KMManager { * @param keyboardType KeyboardType KEYBOARD_TYPE_INAPP or KEYBOARD_TYPE_SYSTEM */ public static void handleGlobeKeyAction(Context context, boolean globeKeyDown, KeyboardType keyboardType) { - // Clear preview and subkeys - if (keyboardType == KeyboardType.KEYBOARD_TYPE_INAPP) { - InAppKeyboard.dismissKeyPreview(0); - InAppKeyboard.dismissSubKeysWindow(); - } else if (keyboardType == KeyboardType.KEYBOARD_TYPE_SYSTEM) { - SystemKeyboard.dismissKeyPreview(0); - SystemKeyboard.dismissSubKeysWindow(); - } - // Update globeKeyState if (globeKeyState != GlobeKeyState.GLOBE_KEY_STATE_LONGPRESS) { globeKeyState = globeKeyDown ? GlobeKeyState.GLOBE_KEY_STATE_DOWN : GlobeKeyState.GLOBE_KEY_STATE_UP; diff --git a/android/KMEA/app/src/main/res/layout/subkey_layout.xml b/android/KMEA/app/src/main/res/layout/subkey_layout.xml deleted file mode 100644 index 547400e3d0..0000000000 --- a/android/KMEA/app/src/main/res/layout/subkey_layout.xml +++ /dev/null @@ -1,10 +0,0 @@ - - diff --git a/android/KMEA/app/src/main/res/layout/subkeys_popup_layout.xml b/android/KMEA/app/src/main/res/layout/subkeys_popup_layout.xml deleted file mode 100644 index 4cdd7356fd..0000000000 --- a/android/KMEA/app/src/main/res/layout/subkeys_popup_layout.xml +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - - - - - diff --git a/android/KMEA/app/src/main/res/values/colors.xml b/android/KMEA/app/src/main/res/values/colors.xml index 86ce5e004e..497d9ca350 100644 --- a/android/KMEA/app/src/main/res/values/colors.xml +++ b/android/KMEA/app/src/main/res/values/colors.xml @@ -6,9 +6,5 @@ #ff282828 #ff000000 #ff282828 - - #ff838383 - #ff333333 - #ff737373 From 07854ef6116d5acab962add3f62311535e4aa08c Mon Sep 17 00:00:00 2001 From: Darcy Wong Date: Tue, 19 Sep 2023 10:35:10 +0700 Subject: [PATCH 20/47] chore(oem/fv/android): Update Gradle to 7.4 --- oem/firstvoices/android/app/build.gradle | 4 ++-- oem/firstvoices/android/build.gradle | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/oem/firstvoices/android/app/build.gradle b/oem/firstvoices/android/app/build.gradle index d03c5634ae..646152a81a 100644 --- a/oem/firstvoices/android/app/build.gradle +++ b/oem/firstvoices/android/app/build.gradle @@ -1,7 +1,7 @@ plugins { id 'com.android.application' id 'io.sentry.android.gradle' - id 'com.github.triplet.play' version '3.7.0-agp4.2' apply false + id 'com.github.triplet.play' version '3.8.1' apply false } ext.rootPath = '../../../../android' @@ -121,7 +121,7 @@ dependencies { implementation 'androidx.appcompat:appcompat:1.6.0-rc01' implementation 'com.google.android.material:material:1.6.0' api(name: 'keyman-engine', ext: 'aar') - implementation 'io.sentry:sentry-android:6.9.0' + implementation 'io.sentry:sentry-android:6.9.2' implementation 'androidx.preference:preference:1.2.0' } diff --git a/oem/firstvoices/android/build.gradle b/oem/firstvoices/android/build.gradle index ecbb2b0fcc..50f3647165 100644 --- a/oem/firstvoices/android/build.gradle +++ b/oem/firstvoices/android/build.gradle @@ -6,7 +6,7 @@ buildscript { } dependencies { - classpath 'com.android.tools.build:gradle:4.2.2' + classpath 'com.android.tools.build:gradle:7.4.0' classpath 'io.sentry:sentry-android-gradle-plugin:2.1.2' // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files From d1c12c4e57018cc5ca8df9eb42cc759ffaf741fd Mon Sep 17 00:00:00 2001 From: Darcy Wong Date: Tue, 19 Sep 2023 11:37:59 +0700 Subject: [PATCH 21/47] chore(android/engine): Remove key preview layout --- .../main/res/layout/key_preview_layout.xml | 22 ------------------- 1 file changed, 22 deletions(-) delete mode 100644 android/KMEA/app/src/main/res/layout/key_preview_layout.xml diff --git a/android/KMEA/app/src/main/res/layout/key_preview_layout.xml b/android/KMEA/app/src/main/res/layout/key_preview_layout.xml deleted file mode 100644 index bb03d58347..0000000000 --- a/android/KMEA/app/src/main/res/layout/key_preview_layout.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - - From e76936fcecf7680882a3f312abdf799b819200e6 Mon Sep 17 00:00:00 2001 From: Darcy Wong Date: Tue, 19 Sep 2023 14:58:46 +0700 Subject: [PATCH 22/47] fix(web): Revert buildEmbeddedGestureConfig Per review comments --- web/src/app/webview/src/keymanEngine.ts | 1 + web/src/app/webview/src/oskConfiguration.ts | 2 ++ 2 files changed, 3 insertions(+) diff --git a/web/src/app/webview/src/keymanEngine.ts b/web/src/app/webview/src/keymanEngine.ts index c22943d6b1..1cc7f08248 100644 --- a/web/src/app/webview/src/keymanEngine.ts +++ b/web/src/app/webview/src/keymanEngine.ts @@ -69,6 +69,7 @@ export default class KeymanEngine extends KeymanEngineBase Date: Tue, 19 Sep 2023 10:23:00 +0200 Subject: [PATCH 23/47] chore(linux): make `--report` an option instead of action This addresses code review comments. --- docs/settings/linux/tasks.json | 4 ++-- linux/ibus-keyman/build.sh | 13 +++++-------- 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/docs/settings/linux/tasks.json b/docs/settings/linux/tasks.json index c5f2d06361..891c8b5d15 100644 --- a/docs/settings/linux/tasks.json +++ b/docs/settings/linux/tasks.json @@ -172,7 +172,7 @@ "command": "./build.sh", "args": [ "test", - "report", + "--report", "--debug", "--coverage", "--no-integration" @@ -181,7 +181,7 @@ "cwd": "${workspaceFolder}/linux/ibus-keyman/", }, "group": "build", - "detail": "create unit test coverage" + "detail": "run tests and create unit test coverage report" }, { "type": "shell", diff --git a/linux/ibus-keyman/build.sh b/linux/ibus-keyman/build.sh index ecb6bd5e08..9f9de96488 100755 --- a/linux/ibus-keyman/build.sh +++ b/linux/ibus-keyman/build.sh @@ -19,9 +19,9 @@ builder_describe \ "test" \ "install install artifacts" \ "uninstall uninstall artifacts" \ - "report create coverage report" \ "@/core:arch" \ "--no-integration don't run integration tests" \ + "--report create coverage report" \ "--coverage capture test coverage" builder_parse "$@" @@ -76,6 +76,10 @@ if builder_start_action test; then else meson test --print-errorlogs $builder_verbose fi + if builder_has_option --coverage; then + # Note: requires lcov > 1.16 to properly work (see https://github.com/mesonbuild/meson/issues/6747) + ninja coverage-html + fi builder_finish_action success test fi @@ -90,10 +94,3 @@ if builder_start_action uninstall; then ninja uninstall builder_finish_action success uninstall fi - -if builder_start_action report; then - cd "$THIS_SCRIPT_PATH/$MESON_PATH" - # Note: requires lcov > 1.16 to properly work (see https://github.com/mesonbuild/meson/issues/6747) - ninja coverage-html - builder_finish_action success report -fi From 8bf0ac094aae8c27f926f17b5c7c1758a88f5183 Mon Sep 17 00:00:00 2001 From: Darcy Wong Date: Tue, 19 Sep 2023 15:26:20 +0700 Subject: [PATCH 24/47] chore(web): More cleanup --- web/src/app/webview/src/keymanEngine.ts | 89 -------------- .../app/webview/src/osk/subkeyDelegator.ts | 116 ------------------ 2 files changed, 205 deletions(-) delete mode 100644 web/src/app/webview/src/osk/subkeyDelegator.ts diff --git a/web/src/app/webview/src/keymanEngine.ts b/web/src/app/webview/src/keymanEngine.ts index 1cc7f08248..5774c4edb6 100644 --- a/web/src/app/webview/src/keymanEngine.ts +++ b/web/src/app/webview/src/keymanEngine.ts @@ -8,7 +8,6 @@ import { WebviewConfiguration, WebviewInitOptionDefaults, WebviewInitOptionSpec import ContextManager from './contextManager.js'; import PassthroughKeyboard from './passthroughKeyboard.js'; import { buildEmbeddedGestureConfig, setupEmbeddedListeners } from './oskConfiguration.js'; -import { SubkeyDelegator } from './osk/subkeyDelegator.js'; export default class KeymanEngine extends KeymanEngineBase { // Ideally, we would be able to auto-detect `sourceUri`: https://stackoverflow.com/a/60244278. @@ -92,53 +91,6 @@ export default class KeymanEngine extends KeymanEngineBase void = null; hideKeyboard?: () => void = null; diff --git a/web/src/app/webview/src/osk/subkeyDelegator.ts b/web/src/app/webview/src/osk/subkeyDelegator.ts deleted file mode 100644 index 30289e8aee..0000000000 --- a/web/src/app/webview/src/osk/subkeyDelegator.ts +++ /dev/null @@ -1,116 +0,0 @@ -import { type ActiveKey, type KeyEvent } from '@keymanapp/keyboard-processor'; - -import { - type InputEventCoordinate, - type KeyElement, - type OSKKeySpec, - RealizedGesture, - VisualKeyboard -} from 'keyman/engine/osk'; - -/** - * As the subkey popup view is handled by the host app when in embedded mode - * within our Android app, this class represents the fact that KMW has - * "delegated" subkey UI and selection to the host app. Hence, "Delegator", - * rather than "Popup". - * - * The `resolve` method should be triggered, in some fashion, by the host app - * whenever the user has completed their longpress, potentially selecting - * a subkey. - * - * This class will also track the ongoing touch event in case the base key is - * reselected, which _is_ managed by this class, not the host app. - */ -export class SubkeyDelegator implements RealizedGesture { - private resolver: (keyEvent: KeyEvent) => void; - private readonly vkbd: VisualKeyboard; - - public readonly baseKey: KeyElement; - public readonly promise: Promise; - - private movedFromBaseKey: boolean = false; - private baseKeySelected: boolean = false; - - constructor(vkbd: VisualKeyboard, e: KeyElement) { - this.vkbd = vkbd; - - let _this = this; - this.promise = new Promise(function(resolve) { - _this.resolver = resolve; - }); - - this.baseKey = e; - } - - /** - * Resolves the ongoing longpress -> subkey gesture, fulfilling this - * `SubkeyDelegator`'s `promise` of a `KeyEvent`. - * - * If no subkey is selected but the original base key is, `resolve(null)` - * will return a key event corresponding to the base key. - * - * @param keyCoreID {string} The 'core ID' (id + modifier layer) of - * a selected subkey. May be `null`. - */ - public resolve(keyCoreID: string) { - if(this.resolver) { - let keyEvent: KeyEvent = null; - - if(keyCoreID == null && this.baseKeySelected) { - // Handle selection of base key underneath the subkey array. - keyEvent = this.vkbd.keyEventFromSpec(this.baseKey.key.spec as ActiveKey, null); - this.baseKey.key.highlight(false); - } else if(keyCoreID != null) { - // This is set with the base key of our current subkey elsewhere within the engine. - let baseKey: OSKKeySpec = this.baseKey.key.spec; - let selectedKey: OSKKeySpec; - - if(baseKey.coreID == keyCoreID) { - selectedKey = baseKey; - } else { - // ... yeah, there are some funky type shenanigans between the two. - // OSKKeySpec is the OSK's... reinterpretation of the ActiveKey type. - selectedKey = (baseKey as ActiveKey).getSubkey(keyCoreID) as OSKKeySpec; - } - - if(!selectedKey) { - // While we can't complete successfully, the subkey operation is done; we - // should still signal that and update related gesture state management. - this.resolver(null); - console.error("Could not find subkey '" + keyCoreID + "' under base key '" + baseKey.coreID + "'!"); - return; - } - - keyEvent = this.vkbd.keyEventFromSpec(selectedKey as ActiveKey, null); - keyEvent.vkCode=keyEvent.Lcode; - } // else /* if(keyCoreID == null) */ keyEvent = null; // As initialized at the top. - - this.resolver(keyEvent); - } - this.resolver = null; - } - - public isVisible(): boolean { - return true; - } - - public clear() { - // no-op; it's fully controlled on the app side. - } - - /** - * Allows this class to detect if the user may have changed their mind and - * re-selected the base key. - * @param touch - */ - updateTouch(input: InputEventCoordinate) { - this.baseKeySelected = this.baseKey.key.isUnderTouch(input); - - // Prevent highlighting & selection before the touch has moved from the base key. - if(this.movedFromBaseKey) { - this.baseKey.key.highlight(this.baseKeySelected); - } else { - this.movedFromBaseKey = !this.baseKeySelected; - } - } -} \ No newline at end of file From 807a11b0daff57d32979dbdf5e1aeb7240d2687b Mon Sep 17 00:00:00 2001 From: Keyman Build Agent Date: Tue, 19 Sep 2023 14:02:45 -0400 Subject: [PATCH 25/47] auto: increment master version to 17.0.177 --- HISTORY.md | 6 ++++++ VERSION.md | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/HISTORY.md b/HISTORY.md index f2bd7ab3df..05c7adad0a 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -1,5 +1,11 @@ # Keyman Version History +## 17.0.176 alpha 2023-09-19 + +* chore(oem/fv/android): Update Gradle to 7.4 (#9590) +* refactor(linux): Rename defines to clarify purpose ️ (#9584) +* (#9560) + ## 17.0.175 alpha 2023-09-18 * chore(linux): Split startup process (#9570) diff --git a/VERSION.md b/VERSION.md index dd9aca5084..67199519cf 100644 --- a/VERSION.md +++ b/VERSION.md @@ -1 +1 @@ -17.0.176 \ No newline at end of file +17.0.177 \ No newline at end of file From 5a0c1a38a09047ff7e45a4bfc0b3b35dcd5b1378 Mon Sep 17 00:00:00 2001 From: Darcy Wong Date: Wed, 20 Sep 2023 13:51:27 +0700 Subject: [PATCH 26/47] Update android/KMEA/app/src/main/java/com/keyman/engine/KMKeyboard.java Co-authored-by: Marc Durdin --- .../KMEA/app/src/main/java/com/keyman/engine/KMKeyboard.java | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/android/KMEA/app/src/main/java/com/keyman/engine/KMKeyboard.java b/android/KMEA/app/src/main/java/com/keyman/engine/KMKeyboard.java index ca17c879cf..6471e87510 100644 --- a/android/KMEA/app/src/main/java/com/keyman/engine/KMKeyboard.java +++ b/android/KMEA/app/src/main/java/com/keyman/engine/KMKeyboard.java @@ -363,9 +363,7 @@ final class KMKeyboard extends WebView { // Come to think of it, I wonder if suggestionMenuWindow was work being done to link with // suggestion banner longpresses - if so, it's not yet ready for proper integration... // and would need its own rung in this if-else ladder. - if (true) { - gestureDetector.onTouchEvent(event); - } + gestureDetector.onTouchEvent(event); if (action == MotionEvent.ACTION_UP) { // Cleanup popups. #6636 From 20149b6a2ff2fb03e18ce90280ab93bf350efe03 Mon Sep 17 00:00:00 2001 From: Eberhard Beilharz Date: Wed, 20 Sep 2023 08:52:13 +0200 Subject: [PATCH 27/47] chore(linux): Remove obsolete code Addresses code review comment. --- linux/ibus-keyman/build.sh | 3 --- 1 file changed, 3 deletions(-) diff --git a/linux/ibus-keyman/build.sh b/linux/ibus-keyman/build.sh index 9f9de96488..bc136546d6 100755 --- a/linux/ibus-keyman/build.sh +++ b/linux/ibus-keyman/build.sh @@ -26,9 +26,6 @@ builder_describe \ builder_parse "$@" -builder_describe_internal_dependency \ - report:engine test:engine - if builder_is_debug_build; then MESON_TARGET=debug export CPPFLAGS=-DG_MESSAGES_DEBUG From 98660fef562ed2eed904e53b5fca568928a5f74f Mon Sep 17 00:00:00 2001 From: Darcy Wong Date: Wed, 20 Sep 2023 14:22:12 +0700 Subject: [PATCH 28/47] chore(web): Cleanup embeddedGestureConfig Remove createKeyTip and startLongpress --- web/src/engine/osk/src/config/embeddedGestureConfig.ts | 2 -- web/src/engine/osk/src/visualKeyboard.ts | 8 +------- 2 files changed, 1 insertion(+), 9 deletions(-) diff --git a/web/src/engine/osk/src/config/embeddedGestureConfig.ts b/web/src/engine/osk/src/config/embeddedGestureConfig.ts index bf36498b6e..57f756d771 100644 --- a/web/src/engine/osk/src/config/embeddedGestureConfig.ts +++ b/web/src/engine/osk/src/config/embeddedGestureConfig.ts @@ -6,6 +6,4 @@ import VisualKeyboard from "../visualKeyboard.js"; export default interface EmbeddedGestureConfig { createGlobeHint?: (vkbd: VisualKeyboard) => GlobeHint; - createKeyTip?: (vkbd: VisualKeyboard) => KeyTip; - startLongpress?: (vkbd: VisualKeyboard, key: KeyElement) => PendingGesture; } \ No newline at end of file diff --git a/web/src/engine/osk/src/visualKeyboard.ts b/web/src/engine/osk/src/visualKeyboard.ts index 2a649d8e31..d450c661a0 100644 --- a/web/src/engine/osk/src/visualKeyboard.ts +++ b/web/src/engine/osk/src/visualKeyboard.ts @@ -1711,10 +1711,6 @@ export default class VisualKeyboard extends EventEmitter implements Ke * @returns */ startLongpress(key: KeyElement): PendingGesture { - if(this.config.embeddedGestureConfig.startLongpress) { - return this.config.embeddedGestureConfig.startLongpress(this, key); - } - // First-level object/Promise: will produce a subkey popup when the longpress gesture completes. // 'Returns' a second-level object/Promise: resolves when a subkey is selected or is cancelled. let pendingLongpress = new InternalPendingLongpress(this, key); @@ -1895,9 +1891,7 @@ export default class VisualKeyboard extends EventEmitter implements Ke * Create a key preview element for phone devices */ createKeyTip() { - if(this.config.embeddedGestureConfig.createKeyTip) { - this.keytip = this.config.embeddedGestureConfig.createKeyTip(this); - } else if (this.device.formFactor == 'phone') { + if(this.device.formFactor == 'phone') { if (this.keytip == null) { // For now, should only be true (in production) when keyman.isEmbedded == true. let constrainPopup = this.isEmbedded; From b764a1c965b488323f4dd461c5aa765470eda4e7 Mon Sep 17 00:00:00 2001 From: Eberhard Beilharz Date: Wed, 20 Sep 2023 11:49:53 +0200 Subject: [PATCH 29/47] fix(linux): Correctly open files linked from help page This works around the issue where browsers installed as snap package can't access files under `$HOME/.local`. Instead we now only open external links with the browser. Local non-html files we open with the default app, and links to local html file we open in webview (like we did previously with `welcome.htm` files). Fixes #9600. --- linux/keyman-config/keyman_config/welcome.py | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/linux/keyman-config/keyman_config/welcome.py b/linux/keyman-config/keyman_config/welcome.py index cc414df516..d770a5a4c9 100644 --- a/linux/keyman-config/keyman_config/welcome.py +++ b/linux/keyman-config/keyman_config/welcome.py @@ -1,6 +1,7 @@ #!/usr/bin/python3 import logging +import os import webbrowser import gi @@ -55,17 +56,25 @@ class WelcomeView(Gtk.Dialog): def doc_policy(self, web_view, decision, decision_type): logging.info("Checking policy") logging.debug("received policy decision request of type: {0}".format(decision_type.value_name)) - if decision_type == WebKit2.PolicyDecisionType.NAVIGATION_ACTION or \ - decision_type == WebKit2.PolicyDecisionType.NEW_WINDOW_ACTION: + if decision_type in [ + WebKit2.PolicyDecisionType.NAVIGATION_ACTION, + WebKit2.PolicyDecisionType.NEW_WINDOW_ACTION, + ]: nav_action = decision.get_navigation_action() request = nav_action.get_request() uri = request.get_uri() logging.debug("nav request is for uri %s", uri) - if "welcome.htm" not in uri: - logging.debug("opening uri %s in webbrowser") + if not uri.startswith("file://"): + logging.debug("opening external uri %s in webbrowser", uri) webbrowser.open(uri) decision.ignore() return True + elif ".htm" not in uri: + cmd = f'xdg-open {uri}' + logging.debug('opening uri in default app: %s', cmd) + os.system(cmd) + decision.ignore() + return True return False def on_openweb_clicked(self, button): From 05063a814d2c5a4acde13a01d6e66360cccbf255 Mon Sep 17 00:00:00 2001 From: Keyman Build Agent Date: Wed, 20 Sep 2023 14:02:50 -0400 Subject: [PATCH 30/47] auto: increment master version to 17.0.178 --- HISTORY.md | 5 +++++ VERSION.md | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/HISTORY.md b/HISTORY.md index 05c7adad0a..8706ab6d89 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -1,5 +1,10 @@ # Keyman Version History +## 17.0.177 alpha 2023-09-20 + +* chore(linux): Add coverage action to `ibus-keyman/build.sh` (#9583) +* docs(common): Fix documentation for `builder_describe_internal_dependency` (#9582) + ## 17.0.176 alpha 2023-09-19 * chore(oem/fv/android): Update Gradle to 7.4 (#9590) diff --git a/VERSION.md b/VERSION.md index 67199519cf..981cad9c9f 100644 --- a/VERSION.md +++ b/VERSION.md @@ -1 +1 @@ -17.0.177 \ No newline at end of file +17.0.178 \ No newline at end of file From 0a8eec113c2ec3dd24bba49f4f140650b1d1092b Mon Sep 17 00:00:00 2001 From: "Steven R. Loomis" Date: Wed, 20 Sep 2023 17:30:23 -0500 Subject: [PATCH 31/47] =?UTF-8?q?chore(resources):=20ldml=20update=20keybo?= =?UTF-8?q?ard=20->=20keyboard3=20=F0=9F=99=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit For: #9604 - unicode-org/cldr:f3daab445e2e3ee88f8b94c6b46d380777035051 - un-deleting pcm, still in progress --- .../ldml-keyboards/techpreview/cldr_info.json | 6 +++--- .../techpreview/dtd/ldmlKeyboard3.dtd | 16 ++++++++-------- .../techpreview/dtd/ldmlKeyboard3.xsd | 4 ++-- .../techpreview/dtd/ldmlKeyboardTest3.dtd | 2 +- 4 files changed, 14 insertions(+), 14 deletions(-) diff --git a/resources/standards-data/ldml-keyboards/techpreview/cldr_info.json b/resources/standards-data/ldml-keyboards/techpreview/cldr_info.json index f0014664bb..601f341a25 100644 --- a/resources/standards-data/ldml-keyboards/techpreview/cldr_info.json +++ b/resources/standards-data/ldml-keyboards/techpreview/cldr_info.json @@ -1,5 +1,5 @@ { - "sha": "bd40148d4c8675d0fb2db8c36cfb9f8e328250a8", - "description": "release-44-alpha3-3-gbd40148d4c", - "date": "Mon, 18 Sep 2023 23:31:25 +0000" + "sha": "f3daab445e2e3ee88f8b94c6b46d380777035051", + "description": "release-44-alpha3-4-gf3daab445e", + "date": "Wed, 20 Sep 2023 22:27:35 +0000" } diff --git a/resources/standards-data/ldml-keyboards/techpreview/dtd/ldmlKeyboard3.dtd b/resources/standards-data/ldml-keyboards/techpreview/dtd/ldmlKeyboard3.dtd index 668aa1740b..25d03368f8 100644 --- a/resources/standards-data/ldml-keyboards/techpreview/dtd/ldmlKeyboard3.dtd +++ b/resources/standards-data/ldml-keyboards/techpreview/dtd/ldmlKeyboard3.dtd @@ -93,8 +93,8 @@ Please view the subcommittee page for the most recent information. - - + + @@ -115,10 +115,10 @@ Please view the subcommittee page for the most recent information. - - + + - + @@ -139,7 +139,7 @@ Please view the subcommittee page for the most recent information. - + @@ -150,7 +150,7 @@ Please view the subcommittee page for the most recent information. - + @@ -185,7 +185,7 @@ Please view the subcommittee page for the most recent information. - + diff --git a/resources/standards-data/ldml-keyboards/techpreview/dtd/ldmlKeyboard3.xsd b/resources/standards-data/ldml-keyboards/techpreview/dtd/ldmlKeyboard3.xsd index 027abb8a14..f3a7b8bed8 100644 --- a/resources/standards-data/ldml-keyboards/techpreview/dtd/ldmlKeyboard3.xsd +++ b/resources/standards-data/ldml-keyboards/techpreview/dtd/ldmlKeyboard3.xsd @@ -181,7 +181,7 @@ Note: DTD @-annotations are not currently converted to .xsd. For full CLDR file - + @@ -217,7 +217,7 @@ Note: DTD @-annotations are not currently converted to .xsd. For full CLDR file - + diff --git a/resources/standards-data/ldml-keyboards/techpreview/dtd/ldmlKeyboardTest3.dtd b/resources/standards-data/ldml-keyboards/techpreview/dtd/ldmlKeyboardTest3.dtd index f08d3b8a2b..992e83a755 100644 --- a/resources/standards-data/ldml-keyboards/techpreview/dtd/ldmlKeyboardTest3.dtd +++ b/resources/standards-data/ldml-keyboards/techpreview/dtd/ldmlKeyboardTest3.dtd @@ -61,7 +61,7 @@ Please see CLDR-15034 for the latest information. --> - + From 9add2cb99ce3e50562c0812b4644e20c19e143c2 Mon Sep 17 00:00:00 2001 From: "Steven R. Loomis" Date: Wed, 20 Sep 2023 18:55:49 -0500 Subject: [PATCH 32/47] =?UTF-8?q?chore(core):=20ldml=20update=20keyboard?= =?UTF-8?q?=20->=20keyboard3=20=F0=9F=99=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit For: #9604 - yes, C++ changes also --- core/tests/unit/ldml/ldml_test_source.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/core/tests/unit/ldml/ldml_test_source.cpp b/core/tests/unit/ldml/ldml_test_source.cpp index 507468efaa..33a7e1a3d8 100644 --- a/core/tests/unit/ldml/ldml_test_source.cpp +++ b/core/tests/unit/ldml/ldml_test_source.cpp @@ -698,15 +698,15 @@ int LdmlJsonTestSourceFactory::load(const km::kbp::path &compiled, const km::kbp return __LINE__; } - auto conformsTo = data["/keyboardTest/conformsTo"_json_pointer].get(); + auto conformsTo = data["/keyboardTest3/conformsTo"_json_pointer].get(); assert_or_return(std::string(LDML_CLDR_VERSION_LATEST) == conformsTo); - auto info_keyboard = data["/keyboardTest/info/keyboard"_json_pointer].get(); - auto info_author = data["/keyboardTest/info/author"_json_pointer].get(); - auto info_name = data["/keyboardTest/info/name"_json_pointer].get(); + auto info_keyboard = data["/keyboardTest3/info/keyboard"_json_pointer].get(); + auto info_author = data["/keyboardTest3/info/author"_json_pointer].get(); + auto info_name = data["/keyboardTest3/info/name"_json_pointer].get(); // TODO-LDML: store these elsewhere? std::cout << "JSON: reading " << info_name << " test of " << info_keyboard << " by " << info_author << std::endl; - auto all_tests = data["/keyboardTest/tests"_json_pointer]; + auto all_tests = data["/keyboardTest3/tests"_json_pointer]; assert_or_return((!all_tests.empty()) && (all_tests.size() > 0)); // TODO-LDML: can be empty if repertoire only? for(auto tests : all_tests) { @@ -724,7 +724,7 @@ int LdmlJsonTestSourceFactory::load(const km::kbp::path &compiled, const km::kbp } #if defined(HAVE_ICU4C) - auto rep_tests = data["/keyboardTest/repertoire"_json_pointer]; + auto rep_tests = data["/keyboardTest3/repertoire"_json_pointer]; assert_or_return((!rep_tests.empty()) && (rep_tests.size() > 0)); // TODO-LDML: can be empty if tests only? for(auto rep : rep_tests) { From 60295cef702905eeb7a2a2996f49fbaa6e79f050 Mon Sep 17 00:00:00 2001 From: "Steven R. Loomis" Date: Wed, 20 Sep 2023 18:56:29 -0500 Subject: [PATCH 33/47] =?UTF-8?q?chore(core):=20ldml=20update=20keyboard?= =?UTF-8?q?=20->=20keyboard3=20=F0=9F=99=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit For: #9604 - DOCTYPE fixes (typos) to make the red squiggles go away --- common/web/types/test/fixtures/test-fr.xml | 2 +- core/tests/unit/ldml/keyboards/k_001_tiny-test.xml | 2 +- core/tests/unit/ldml/keyboards/k_007_transform_rgx-test.xml | 2 +- core/tests/unit/ldml/keyboards/k_020_fr-test.xml | 2 +- core/tests/unit/ldml/keyboards/k_200_reorder_nod_Lana-test.xml | 2 +- core/tests/unit/ldml/keyboards/k_210_marker-test.xml | 2 +- developer/src/kmc-ldml/test/fixtures/test-fr.xml | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/common/web/types/test/fixtures/test-fr.xml b/common/web/types/test/fixtures/test-fr.xml index e138a1b5d1..cfd63c4f75 100644 --- a/common/web/types/test/fixtures/test-fr.xml +++ b/common/web/types/test/fixtures/test-fr.xml @@ -1,5 +1,5 @@ - + diff --git a/core/tests/unit/ldml/keyboards/k_001_tiny-test.xml b/core/tests/unit/ldml/keyboards/k_001_tiny-test.xml index 231523458c..52ca6903c4 100644 --- a/core/tests/unit/ldml/keyboards/k_001_tiny-test.xml +++ b/core/tests/unit/ldml/keyboards/k_001_tiny-test.xml @@ -1,5 +1,5 @@ - + diff --git a/core/tests/unit/ldml/keyboards/k_007_transform_rgx-test.xml b/core/tests/unit/ldml/keyboards/k_007_transform_rgx-test.xml index e6cc5ce387..8d45146704 100644 --- a/core/tests/unit/ldml/keyboards/k_007_transform_rgx-test.xml +++ b/core/tests/unit/ldml/keyboards/k_007_transform_rgx-test.xml @@ -1,5 +1,5 @@ - + diff --git a/core/tests/unit/ldml/keyboards/k_020_fr-test.xml b/core/tests/unit/ldml/keyboards/k_020_fr-test.xml index 99cbe4bd6f..f4ac30aa9f 100644 --- a/core/tests/unit/ldml/keyboards/k_020_fr-test.xml +++ b/core/tests/unit/ldml/keyboards/k_020_fr-test.xml @@ -1,6 +1,6 @@ - + diff --git a/core/tests/unit/ldml/keyboards/k_200_reorder_nod_Lana-test.xml b/core/tests/unit/ldml/keyboards/k_200_reorder_nod_Lana-test.xml index d8fc776ac9..c5270ac868 100644 --- a/core/tests/unit/ldml/keyboards/k_200_reorder_nod_Lana-test.xml +++ b/core/tests/unit/ldml/keyboards/k_200_reorder_nod_Lana-test.xml @@ -1,5 +1,5 @@ - + diff --git a/core/tests/unit/ldml/keyboards/k_210_marker-test.xml b/core/tests/unit/ldml/keyboards/k_210_marker-test.xml index 5d7fdb51bd..3286ac1179 100644 --- a/core/tests/unit/ldml/keyboards/k_210_marker-test.xml +++ b/core/tests/unit/ldml/keyboards/k_210_marker-test.xml @@ -1,5 +1,5 @@ - + diff --git a/developer/src/kmc-ldml/test/fixtures/test-fr.xml b/developer/src/kmc-ldml/test/fixtures/test-fr.xml index e138a1b5d1..cfd63c4f75 100644 --- a/developer/src/kmc-ldml/test/fixtures/test-fr.xml +++ b/developer/src/kmc-ldml/test/fixtures/test-fr.xml @@ -1,5 +1,5 @@ - + From 89eab5e0ee098c379697050e50aa56f1115f34e8 Mon Sep 17 00:00:00 2001 From: Eberhard Beilharz Date: Wed, 20 Sep 2023 19:41:13 +0200 Subject: [PATCH 34/47] chore(linux): Don't crash if error is not set --- linux/ibus-keyman/src/KeymanSystemServiceClient.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/linux/ibus-keyman/src/KeymanSystemServiceClient.cpp b/linux/ibus-keyman/src/KeymanSystemServiceClient.cpp index 90f459d1a2..635c3ff22d 100644 --- a/linux/ibus-keyman/src/KeymanSystemServiceClient.cpp +++ b/linux/ibus-keyman/src/KeymanSystemServiceClient.cpp @@ -59,7 +59,7 @@ void KeymanSystemServiceClient::SetCapsLockIndicator(guint32 capsLock) { KEYMAN_INTERFACE_NAME, "SetCapsLockIndicator", error, &msg, "b", capsLock); if (result < 0) { g_error("%s: Failed to call method SetCapsLockIndicator: %s. %s. %s.", - __FUNCTION__, strerror(-result), error->name, error->message); + __FUNCTION__, strerror(-result), error ? error->name : "-", error ? error->message : "-"); return; } } @@ -78,7 +78,7 @@ gint32 KeymanSystemServiceClient::GetCapsLockIndicator() { KEYMAN_INTERFACE_NAME, "GetCapsLockIndicator", error, &msg, ""); if (result < 0) { g_error("%s: Failed to call method GetCapsLockIndicator: %s. %s. %s.", - __FUNCTION__, strerror(-result), error->name, error->message); + __FUNCTION__, strerror(-result), error ? error->name : "-", error ? error->message : "-"); return -1; } From c16b602865f3f8d711f583e26f7caba3c6884117 Mon Sep 17 00:00:00 2001 From: Eberhard Beilharz Date: Thu, 21 Sep 2023 10:24:51 +0200 Subject: [PATCH 35/47] chore(linux): Check existence of `services` directory When running the integration tests, we provide a test service that replaces `keyman-system-service`. DBus needs the updated `.service` files in the `services` directory so that it will use the test service. This change outputs an error and returns an non-zero exit code if it can't find the `services` directory, which usually means that `keyman-system-service` didn't get build. --- linux/ibus-keyman/tests/KmDbusTestServer.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/linux/ibus-keyman/tests/KmDbusTestServer.cpp b/linux/ibus-keyman/tests/KmDbusTestServer.cpp index 1d4746163d..e64a9354d8 100644 --- a/linux/ibus-keyman/tests/KmDbusTestServer.cpp +++ b/linux/ibus-keyman/tests/KmDbusTestServer.cpp @@ -139,6 +139,11 @@ void KmDbusTestServer::Loop() int main(int argc, char *argv[]) { + if (!g_file_test(KEYMAN_TEST_SERVICE_PATH, G_FILE_TEST_IS_DIR)) { + std::cerr << "ERROR: Directory " << KEYMAN_TEST_SERVICE_PATH << " doesn't exist! Exiting." << std::endl; + return 1; + } + KmDbusTestServer testServer; testServer.Loop(); From 447bc842ae20daa7f0eba0990b13c484994dc8ea Mon Sep 17 00:00:00 2001 From: Eberhard Beilharz Date: Thu, 21 Sep 2023 10:25:11 +0200 Subject: [PATCH 36/47] docs(linux): Update readme for ibus-keyman tests --- linux/ibus-keyman/tests/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/linux/ibus-keyman/tests/README.md b/linux/ibus-keyman/tests/README.md index 046333be9d..a97f85d443 100644 --- a/linux/ibus-keyman/tests/README.md +++ b/linux/ibus-keyman/tests/README.md @@ -6,7 +6,7 @@ are stored in `~/.config/glib-2.0/settings/keyfile`. ## Running tests -The tests get run as part of building `ibus-keyman`, more specifically when running `make check`. +The tests get run as part of building `ibus-keyman`, more specifically when running `build.sh test`. ### Run all tests From b2084930aff5fd89547344f15244bc9c0a43c64a Mon Sep 17 00:00:00 2001 From: Eberhard Beilharz Date: Thu, 21 Sep 2023 12:02:33 +0200 Subject: [PATCH 37/47] fix(linux): Fix detection of unit tests When running on Ubuntu 20.04 Focal, one of the Python dependencies loads the `unittest` module so that running `km-config` output the message that Sentry would be disabled because unit tests are running. This change now uses the callstack to check if we're running unit tests. Fixes #9577. --- linux/keyman-config/keyman_config/sentry_handling.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/linux/keyman-config/keyman_config/sentry_handling.py b/linux/keyman-config/keyman_config/sentry_handling.py index 6cff26b1a5..c3bc10e4f4 100644 --- a/linux/keyman-config/keyman_config/sentry_handling.py +++ b/linux/keyman-config/keyman_config/sentry_handling.py @@ -5,6 +5,7 @@ import logging import os import platform import sys +import traceback from keyman_config.version import ( __version__, __versionwithtag__, @@ -47,7 +48,7 @@ class SentryErrorHandling: return (True, '') def is_sentry_enabled(self): - if 'unittest' in sys.modules.keys(): + if self._is_unit_test(): return (False, 'Running unit tests, not reporting to Sentry') elif self._get_environ_nosentry(): return (False, 'Not reporting to Sentry because KEYMAN_NOSENTRY environment variable set') @@ -75,6 +76,14 @@ class SentryErrorHandling: keyman_nosentry = os.environ.get('KEYMAN_NOSENTRY') return keyman_nosentry and (int(keyman_nosentry) == 1) + def _is_unit_test(self): # sourcery skip: use-any, use-next + # The suggested refactorings (using any() or next()) don't work + # when testing on Ubuntu 20.04 + for line in traceback.format_stack(): + if '/unittest/' in line: + return True + return False + def _handle_enabled(self, enabled): if enabled: self.initialize_sentry() From 3d8cf1830bc412ec9cad92d4f7615e3d696467f2 Mon Sep 17 00:00:00 2001 From: Eberhard Beilharz Date: Wed, 20 Sep 2023 20:09:21 +0200 Subject: [PATCH 38/47] chore(linux): Add dependency to build.sh For integration tests ibus-keyman requires keyman-system-service to be built, so we add this as a dependency. --- linux/debian/rules | 12 ++++++------ linux/ibus-keyman/build.sh | 1 + linux/keyman-system-service/meson.build | 2 +- linux/scripts/reconf.sh | 5 +++-- 4 files changed, 11 insertions(+), 9 deletions(-) diff --git a/linux/debian/rules b/linux/debian/rules index 44d0cc6dbf..1abfbf004a 100755 --- a/linux/debian/rules +++ b/linux/debian/rules @@ -30,17 +30,17 @@ override_dh_auto_configure: --wrap-mode=nodownload --prefix=/usr --sysconfdir=/etc \ --localstatedir=/var --libdir=lib/$(DEB_TARGET_MULTIARCH) \ --libexecdir=lib/$(DEB_TARGET_MULTIARCH) - linux/ibus-keyman/build.sh configure -- \ - --wrap-mode=nodownload --prefix=/usr --sysconfdir=/etc --localstatedir=/var linux/keyman-system-service/build.sh configure -- \ --wrap-mode=nodownload --prefix=/usr --sysconfdir=/etc --localstatedir=/var + linux/ibus-keyman/build.sh configure -- \ + --wrap-mode=nodownload --prefix=/usr --sysconfdir=/etc --localstatedir=/var linux/keyman-config/build.sh configure override_dh_auto_build: cp linux/keyman-config/resources/keyman.sharedmimeinfo debian/ core/build.sh --no-tests build:arch - linux/ibus-keyman/build.sh build linux/keyman-system-service/build.sh build + linux/ibus-keyman/build.sh build linux/keyman-config/build.sh build cd linux/keyman-config && \ sed -i -e "s/^__pkgversion__ = \"[^\"]*\"/__pkgversion__ = \"$(DEB_VERSION)\"/g" keyman_config/version.py && \ @@ -49,16 +49,16 @@ override_dh_auto_build: override_dh_auto_test: ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS))) core/build.sh --no-tests test:arch - linux/ibus-keyman/build.sh test linux/keyman-system-service/build.sh test + linux/ibus-keyman/build.sh test linux/keyman-config/build.sh test endif override_dh_auto_install: install -d $(CURDIR)/debian/tmp DESTDIR=$(CURDIR)/debian/tmp core/build.sh --no-tests install:arch - DESTDIR=$(CURDIR)/debian/tmp linux/ibus-keyman/build.sh install DESTDIR=$(CURDIR)/debian/tmp linux/keyman-system-service/build.sh install + DESTDIR=$(CURDIR)/debian/tmp linux/ibus-keyman/build.sh install # keyman-config install -d $(CURDIR)/debian/keyman/usr/share/ cp -r linux/keyman-config/locale/ $(CURDIR)/debian/keyman/usr/share/ @@ -76,8 +76,8 @@ override_dh_missing: override_dh_auto_clean: core/build.sh clean - linux/ibus-keyman/build.sh clean linux/keyman-system-service/build.sh clean + linux/ibus-keyman/build.sh clean linux/keyman-config/build.sh clean rm -rf .pybuild/ dh_auto_clean $@ diff --git a/linux/ibus-keyman/build.sh b/linux/ibus-keyman/build.sh index bc136546d6..c2c45deec1 100755 --- a/linux/ibus-keyman/build.sh +++ b/linux/ibus-keyman/build.sh @@ -20,6 +20,7 @@ builder_describe \ "install install artifacts" \ "uninstall uninstall artifacts" \ "@/core:arch" \ + "@../keyman-system-service:service" \ "--no-integration don't run integration tests" \ "--report create coverage report" \ "--coverage capture test coverage" diff --git a/linux/keyman-system-service/meson.build b/linux/keyman-system-service/meson.build index 596ba48bcd..66da8f9891 100644 --- a/linux/keyman-system-service/meson.build +++ b/linux/keyman-system-service/meson.build @@ -1,7 +1,7 @@ project('keyman-system-service', 'c', 'cpp', version: run_command('cat', '../../VERSION.md', check: true).stdout().strip(), license: 'GPL-2+', - meson_version: '>=1.0') + meson_version: '>=0.61') evdev = dependency('libevdev', version: '>= 1.9') systemd = dependency('libsystemd') diff --git a/linux/scripts/reconf.sh b/linux/scripts/reconf.sh index 4e4f5c1b11..49dfe21b1d 100755 --- a/linux/scripts/reconf.sh +++ b/linux/scripts/reconf.sh @@ -1,6 +1,6 @@ #!/bin/bash -set -e +set -eu ## START STANDARD BUILD SCRIPT INCLUDE # adjust relative paths as necessary @@ -17,13 +17,14 @@ echo "Found tier ${TIER}, version ${VERSION}" cd ../core ./build.sh --no-tests clean:arch configure:arch build:arch +# Building ibus-keyman will also build dependency keyman-system-service cd "$BASEDIR/ibus-keyman" ./build.sh clean configure cd "$BASEDIR/keyman-config" ./build.sh clean -cd keyman_config +cd "$BASEDIR/keyman-config/keyman_config" sed \ -e "s/_VERSION_/${VERSION}/g" \ -e "s/_VERSIONWITHTAG_/${VERSION_WITH_TAG}/g" \ From 9a0160746bb70e15a2df2ff7ac2d57e75db416fb Mon Sep 17 00:00:00 2001 From: Eberhard Beilharz Date: Thu, 21 Sep 2023 16:35:33 +0200 Subject: [PATCH 39/47] chore(linux): Prevent warning during packaging This change updates gha-ubuntu-packaging to a version that creates a non-empty changelog entry. This prevents a warning during package build. --- .github/workflows/deb-packaging.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/deb-packaging.yml b/.github/workflows/deb-packaging.yml index 7106ed49b3..2d72e01764 100644 --- a/.github/workflows/deb-packaging.yml +++ b/.github/workflows/deb-packaging.yml @@ -119,7 +119,7 @@ jobs: path: artifacts - name: Build - uses: sillsdev/gha-ubuntu-packaging@4f3a013ec28f4defc2b3d6ecb04c98815cd9de25 # v0.9 + uses: sillsdev/gha-ubuntu-packaging@1f4b7e7eacb8c82a4d874ee2c371b9bfef7e16ea # v1.0 with: dist: "${{ matrix.dist }}" platform: "${{ matrix.arch }}" From 4e4a1215ce93fc554215866bfafb2a17d3bd60c4 Mon Sep 17 00:00:00 2001 From: Eberhard Beilharz Date: Thu, 21 Sep 2023 18:54:13 +0200 Subject: [PATCH 40/47] chore(linux): Fix bug in ibus-keyman `run-tests.sh` script --- linux/ibus-keyman/tests/scripts/run-tests.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/linux/ibus-keyman/tests/scripts/run-tests.sh b/linux/ibus-keyman/tests/scripts/run-tests.sh index ae58705f11..00f3647577 100755 --- a/linux/ibus-keyman/tests/scripts/run-tests.sh +++ b/linux/ibus-keyman/tests/scripts/run-tests.sh @@ -86,7 +86,7 @@ function run_tests() { #shellcheck disable=SC2086 "${G_TEST_BUILDDIR:-../../build/$(arch)/${CONFIG}/tests}/ibus-keyman-tests" ${ARG_K-} ${ARG_TAP-} \ ${ARG_VERBOSE-} ${ARG_DEBUG-} ${ARG_SURROUNDING_TEXT-} ${ARG_NO_SURROUNDING_TEXT-} \ - --directory "$TESTDIR" --"${DISPLAY_SERVER}" ${TESTFILES[@]} + --directory "$TESTDIR" "${DISPLAY_SERVER}" ${TESTFILES[@]} echo "# Finished tests." cleanup "$PID_FILE" @@ -136,9 +136,9 @@ echo > "$PID_FILE" trap local_cleanup EXIT SIGINT if [ "$USE_WAYLAND" == "1" ]; then - ( run_tests wayland "$@" ) + run_tests --wayland "$@" fi if [ "$USE_X11" == "1" ]; then - ( run_tests x11 "$@" ) + run_tests --x11 "$@" fi From 90627428c4e6772dd44fe5f3bca7b717f8537382 Mon Sep 17 00:00:00 2001 From: Eberhard Beilharz Date: Thu, 21 Sep 2023 18:55:01 +0200 Subject: [PATCH 41/47] chore(linux): Debug test failures This no longer suppresses the output of cleanup. --- linux/ibus-keyman/tests/scripts/test-helper.inc.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/linux/ibus-keyman/tests/scripts/test-helper.inc.sh b/linux/ibus-keyman/tests/scripts/test-helper.inc.sh index 9ea5ffe3fc..ef1baac878 100755 --- a/linux/ibus-keyman/tests/scripts/test-helper.inc.sh +++ b/linux/ibus-keyman/tests/scripts/test-helper.inc.sh @@ -278,7 +278,7 @@ function cleanup() { if [ -f "$PID_FILE" ]; then echo echo "# Shutting down processes..." - bash "$PID_FILE" > /dev/null 2>&1 + bash "$PID_FILE" # > /dev/null 2>&1 rm "$PID_FILE" echo "# Finished shutdown of processes." fi From 4b8564f9c68a8248c19c77dc6c87d34da610ae4a Mon Sep 17 00:00:00 2001 From: Keyman Build Agent Date: Thu, 21 Sep 2023 14:05:11 -0400 Subject: [PATCH 42/47] auto: increment master version to 17.0.179 --- HISTORY.md | 5 +++++ VERSION.md | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/HISTORY.md b/HISTORY.md index 8706ab6d89..57d9e067b1 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -1,5 +1,10 @@ # Keyman Version History +## 17.0.178 alpha 2023-09-21 + +* fix(linux): Correctly open files linked from help page (#9601) +* chore(linux): Fix bugs, add dependency and update documentation (#9602) + ## 17.0.177 alpha 2023-09-20 * chore(linux): Add coverage action to `ibus-keyman/build.sh` (#9583) diff --git a/VERSION.md b/VERSION.md index 981cad9c9f..bf6655df8c 100644 --- a/VERSION.md +++ b/VERSION.md @@ -1 +1 @@ -17.0.178 \ No newline at end of file +17.0.179 \ No newline at end of file From 9099b873560c155884f915d86a8f52adbb9c47b7 Mon Sep 17 00:00:00 2001 From: Keyman Build Agent Date: Fri, 22 Sep 2023 14:04:53 -0400 Subject: [PATCH 43/47] auto: increment master version to 17.0.180 --- HISTORY.md | 5 +++++ VERSION.md | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/HISTORY.md b/HISTORY.md index 57d9e067b1..f3d948ec0d 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -1,5 +1,10 @@ # Keyman Version History +## 17.0.179 alpha 2023-09-22 + +* chore(resources): ldml: update to keyboard3 (#9588) +* change(android,web) Use web-based popup key longpresses (#9591) + ## 17.0.178 alpha 2023-09-21 * fix(linux): Correctly open files linked from help page (#9601) diff --git a/VERSION.md b/VERSION.md index bf6655df8c..f323889514 100644 --- a/VERSION.md +++ b/VERSION.md @@ -1 +1 @@ -17.0.179 \ No newline at end of file +17.0.180 \ No newline at end of file From 9f07c5bc78e19f9a5421c624653d7778a6d9ba09 Mon Sep 17 00:00:00 2001 From: Keyman Build Agent Date: Mon, 25 Sep 2023 14:02:36 -0400 Subject: [PATCH 44/47] auto: increment master version to 17.0.181 --- HISTORY.md | 4 ++++ VERSION.md | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/HISTORY.md b/HISTORY.md index f3d948ec0d..542e9a1766 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -1,5 +1,9 @@ # Keyman Version History +## 17.0.180 alpha 2023-09-25 + +* fix(linux): Fix detection of unit tests (#9606) + ## 17.0.179 alpha 2023-09-22 * chore(resources): ldml: update to keyboard3 (#9588) diff --git a/VERSION.md b/VERSION.md index f323889514..1fb4f1df29 100644 --- a/VERSION.md +++ b/VERSION.md @@ -1 +1 @@ -17.0.180 \ No newline at end of file +17.0.181 \ No newline at end of file From 6a202c30c78d65924dcb47d3865d31f8e3f92f98 Mon Sep 17 00:00:00 2001 From: "Joshua A. Horton" Date: Tue, 26 Sep 2023 12:48:52 +0700 Subject: [PATCH 45/47] chore(web): addresses PR concerns --- .../headless/gestures/matchers/gestureMatcher.ts | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/common/web/gesture-recognizer/src/engine/headless/gestures/matchers/gestureMatcher.ts b/common/web/gesture-recognizer/src/engine/headless/gestures/matchers/gestureMatcher.ts index 0bfc0225ad..d1b86d0dbf 100644 --- a/common/web/gesture-recognizer/src/engine/headless/gestures/matchers/gestureMatcher.ts +++ b/common/web/gesture-recognizer/src/engine/headless/gestures/matchers/gestureMatcher.ts @@ -5,6 +5,19 @@ import { GestureModel, GestureResolution, GestureResolutionSpec, RejectionDefaul import { ManagedPromise, TimeoutPromise } from "@keymanapp/web-utils"; import { FulfillmentCause, PathMatcher } from "./pathMatcher.js"; +/** + * This interface specifies the minimal data necessary for setting up gesture-selection + * among a set of gesture models that will conceptually follow from the most + * recently-matched gesture-model. The most standard implementation of this is the + * `GestureMatcher` class. + * + * Up until very recently, KeymanWeb would delegate certain gestures to be handled by + * host apps when it was in an embedded state. While that pattern has been dropped, + * the abstraction gained from reaching compatibility with it is useful. Either way, + * for such scenarios, as long as fulfilled gestures can be linked to an implementation + * of this interface, they can be integrated into the gesture-sequence staging system - + * even if not matched directly by the recognizer itself. + */ export interface PredecessorMatch { readonly sources: GestureSource[]; readonly allSourceIds: string[]; @@ -19,7 +32,7 @@ export interface MatchResult { readonly action: GestureResolution } -export interface MatchResultSpec { +export interface MatchResultSpec { readonly matched: boolean, readonly action: GestureResolutionSpec } From 2a9aaa5364260108fafab80ab7e050e1085cfc2f Mon Sep 17 00:00:00 2001 From: "Joshua A. Horton" Date: Tue, 26 Sep 2023 13:09:02 +0700 Subject: [PATCH 46/47] chore(web): applies PR suggestions --- .../gesture-recognizer/src/engine/headless/gestureSource.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/common/web/gesture-recognizer/src/engine/headless/gestureSource.ts b/common/web/gesture-recognizer/src/engine/headless/gestureSource.ts index 0051369993..c95517c705 100644 --- a/common/web/gesture-recognizer/src/engine/headless/gestureSource.ts +++ b/common/web/gesture-recognizer/src/engine/headless/gestureSource.ts @@ -213,8 +213,8 @@ export class GestureSourceSubview extends GestureSource extends GestureSource(); for(let i=0; i < length; i++) { - const index = start + i; - subpath.extend(translateSample(baseSource.path.coords[index])); + subpath.extend(translateSample(baseSource.path.coords[start + i])); } this._path = subpath; From bed8699383780a5f6ffc870fa93cd63e373655eb Mon Sep 17 00:00:00 2001 From: "Joshua A. Horton" Date: Tue, 26 Sep 2023 13:12:27 +0700 Subject: [PATCH 47/47] chore(web): FIX ME was already fine!? --- .../src/test/resources/simulateMultiSourceInput.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/web/gesture-recognizer/src/test/resources/simulateMultiSourceInput.ts b/common/web/gesture-recognizer/src/test/resources/simulateMultiSourceInput.ts index 7620ab1bd4..88c9db95a6 100644 --- a/common/web/gesture-recognizer/src/test/resources/simulateMultiSourceInput.ts +++ b/common/web/gesture-recognizer/src/test/resources/simulateMultiSourceInput.ts @@ -33,7 +33,7 @@ interface MockedPredecessor { sample: InputSample, baseItem: Type }, - sources: GestureSource[], // FIX ME. + sources: GestureSource[], _result: { action: { item: Type