From bdb7b5e45a6b383a0da1285f8aec22a80d5d8bb3 Mon Sep 17 00:00:00 2001 From: Marc Durdin Date: Wed, 27 Jul 2022 15:16:02 +1000 Subject: [PATCH 01/22] fix(android): verify browser before starting activity Fixes #6899. --- .../java/com/tavultesoft/kmapro/KMPBrowserActivity.java | 4 +++- .../com/tavultesoft/kmapro/KeyboardSettingsActivity.java | 4 +++- .../main/java/com/tavultesoft/kmapro/MainActivity.java | 9 +++++++-- .../java/com/tavultesoft/kmea/KeyboardInfoActivity.java | 4 +++- .../main/java/com/firstvoices/keyboards/FVShared.java | 4 +++- .../java/com/firstvoices/keyboards/MainActivity.java | 4 +++- 6 files changed, 22 insertions(+), 7 deletions(-) diff --git a/android/KMAPro/kMAPro/src/main/java/com/tavultesoft/kmapro/KMPBrowserActivity.java b/android/KMAPro/kMAPro/src/main/java/com/tavultesoft/kmapro/KMPBrowserActivity.java index 7cff5b5e80..ff74db201f 100644 --- a/android/KMAPro/kMAPro/src/main/java/com/tavultesoft/kmapro/KMPBrowserActivity.java +++ b/android/KMAPro/kMAPro/src/main/java/com/tavultesoft/kmapro/KMPBrowserActivity.java @@ -113,7 +113,9 @@ public class KMPBrowserActivity extends BaseActivity { // All links that aren't internal Keyman keyboard links open in user's browser Intent intent = new Intent(Intent.ACTION_VIEW, uri); - startActivity(intent); + if (intent.resolveActivity(getPackageManager()) != null) { + startActivity(intent); + } return true; } if (lowerURL.startsWith("keyman:")) { diff --git a/android/KMAPro/kMAPro/src/main/java/com/tavultesoft/kmapro/KeyboardSettingsActivity.java b/android/KMAPro/kMAPro/src/main/java/com/tavultesoft/kmapro/KeyboardSettingsActivity.java index 8aee2a6acb..b471fc1cee 100644 --- a/android/KMAPro/kMAPro/src/main/java/com/tavultesoft/kmapro/KeyboardSettingsActivity.java +++ b/android/KMAPro/kMAPro/src/main/java/com/tavultesoft/kmapro/KeyboardSettingsActivity.java @@ -160,7 +160,9 @@ public final class KeyboardSettingsActivity extends AppCompatActivity { Bundle args = kbd.buildDownloadBundle(); Intent i = new Intent(getApplicationContext(), KMKeyboardDownloaderActivity.class); i.putExtras(args); - startActivity(i); + if (i.resolveActivity(getPackageManager()) != null) { + startActivity(i); + } finish(); // "Help" link clicked diff --git a/android/KMAPro/kMAPro/src/main/java/com/tavultesoft/kmapro/MainActivity.java b/android/KMAPro/kMAPro/src/main/java/com/tavultesoft/kmapro/MainActivity.java index 6f3affe4fb..af9b16fbc1 100644 --- a/android/KMAPro/kMAPro/src/main/java/com/tavultesoft/kmapro/MainActivity.java +++ b/android/KMAPro/kMAPro/src/main/java/com/tavultesoft/kmapro/MainActivity.java @@ -762,10 +762,15 @@ public class MainActivity extends BaseActivity implements OnKeyboardEventListene // Launch PlayStore to update Chrome try { Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse("market://details?id=com.android.chrome")); - startActivity(intent); + if (intent.resolveActivity(getPackageManager()) != null) { + startActivity(intent); + } } catch (android.content.ActivityNotFoundException e) { // Link to Chrome if user is not signed in to Play Store - startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("https://play.google.com/store/apps/details?id=com.android.chrome"))); + Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse("https://play.google.com/store/apps/details?id=com.android.chrome")); + if (intent.resolveActivity(getPackageManager()) != null) { + startActivity(intent); + } } } }); diff --git a/android/KMEA/app/src/main/java/com/tavultesoft/kmea/KeyboardInfoActivity.java b/android/KMEA/app/src/main/java/com/tavultesoft/kmea/KeyboardInfoActivity.java index d9b15f0ea8..89bab42c66 100644 --- a/android/KMEA/app/src/main/java/com/tavultesoft/kmea/KeyboardInfoActivity.java +++ b/android/KMEA/app/src/main/java/com/tavultesoft/kmea/KeyboardInfoActivity.java @@ -136,7 +136,9 @@ public final class KeyboardInfoActivity extends BaseActivity { } else { Intent i = new Intent(Intent.ACTION_VIEW); i.setData(Uri.parse(customHelpLink)); - startActivity(i); + if (i.resolveActivity(getPackageManager()) != null) { + startActivity(i); + } } } } diff --git a/oem/firstvoices/android/app/src/main/java/com/firstvoices/keyboards/FVShared.java b/oem/firstvoices/android/app/src/main/java/com/firstvoices/keyboards/FVShared.java index 854175e4cc..71ace943b5 100644 --- a/oem/firstvoices/android/app/src/main/java/com/firstvoices/keyboards/FVShared.java +++ b/oem/firstvoices/android/app/src/main/java/com/firstvoices/keyboards/FVShared.java @@ -252,7 +252,9 @@ final class FVShared { String helpUrl = String.format("%s%s", FVKeyboardHelpLink, id); Intent i = new Intent(Intent.ACTION_VIEW); i.setData(Uri.parse(helpUrl)); - localContext.startActivity(i); + if (i.resolveActivity(getPackageManager()) != null) { + localContext.startActivity(i); + } } private void updateActiveKeyboardsList() { diff --git a/oem/firstvoices/android/app/src/main/java/com/firstvoices/keyboards/MainActivity.java b/oem/firstvoices/android/app/src/main/java/com/firstvoices/keyboards/MainActivity.java index 5d3e5c5939..897145ec5f 100644 --- a/oem/firstvoices/android/app/src/main/java/com/firstvoices/keyboards/MainActivity.java +++ b/oem/firstvoices/android/app/src/main/java/com/firstvoices/keyboards/MainActivity.java @@ -105,7 +105,9 @@ public class MainActivity extends AppCompatActivity implements OnKeyboardDownloa } else { Intent i = new Intent(Intent.ACTION_VIEW, Uri.parse(url)); - startActivity(i); + if (i.resolveActivity(getPackageManager()) != null) { + startActivity(i); + } } return true; From 127fb3b4e0a877a7b6ae526b88163ca96c923a90 Mon Sep 17 00:00:00 2001 From: Marc Durdin Date: Wed, 27 Jul 2022 15:59:50 +1000 Subject: [PATCH 02/22] chore(android): fixup getPackageManager ref --- .../app/src/main/java/com/firstvoices/keyboards/FVShared.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/oem/firstvoices/android/app/src/main/java/com/firstvoices/keyboards/FVShared.java b/oem/firstvoices/android/app/src/main/java/com/firstvoices/keyboards/FVShared.java index 71ace943b5..9e8790acda 100644 --- a/oem/firstvoices/android/app/src/main/java/com/firstvoices/keyboards/FVShared.java +++ b/oem/firstvoices/android/app/src/main/java/com/firstvoices/keyboards/FVShared.java @@ -252,7 +252,7 @@ final class FVShared { String helpUrl = String.format("%s%s", FVKeyboardHelpLink, id); Intent i = new Intent(Intent.ACTION_VIEW); i.setData(Uri.parse(helpUrl)); - if (i.resolveActivity(getPackageManager()) != null) { + if (i.resolveActivity(localContext.getPackageManager()) != null) { localContext.startActivity(i); } } From ecad0209cb0a33d7d2be952b182ce7610a029912 Mon Sep 17 00:00:00 2001 From: Ross Date: Mon, 22 Aug 2022 11:51:01 +1000 Subject: [PATCH 03/22] fix: Add invalidate context action to non-updatable parse Rename ProcessActionsTestParse to NonUpdatable parse. It does more then just test. Add handling for the invalidate context action to this parse, so that if we emit a keystroke we invalidate the context --- windows/src/engine/keyman32/kmprocess.cpp | 2 +- windows/src/engine/keyman32/kmprocessactions.cpp | 7 +++++-- windows/src/engine/keyman32/kmprocessactions.h | 6 +++--- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/windows/src/engine/keyman32/kmprocess.cpp b/windows/src/engine/keyman32/kmprocess.cpp index 8b7286afbc..35e30c6857 100644 --- a/windows/src/engine/keyman32/kmprocess.cpp +++ b/windows/src/engine/keyman32/kmprocess.cpp @@ -190,7 +190,7 @@ BOOL ProcessHook() } if (!_td->TIPFUpdateable) { - ProcessActionsTestParse(&fOutputKeystroke); + ProcessActionsNonUpdatableParse(&fOutputKeystroke); } else { ProcessActions(&fOutputKeystroke); } diff --git a/windows/src/engine/keyman32/kmprocessactions.cpp b/windows/src/engine/keyman32/kmprocessactions.cpp index f0aa36256d..6a5e03c123 100644 --- a/windows/src/engine/keyman32/kmprocessactions.cpp +++ b/windows/src/engine/keyman32/kmprocessactions.cpp @@ -167,7 +167,7 @@ BOOL ProcessActions(BOOL* emitKeyStroke) } BOOL -ProcessActionsTestParse(BOOL* emitKeyStroke) { +ProcessActionsNonUpdatableParse(BOOL* emitKeyStroke) { PKEYMAN64THREADDATA _td = ThreadGlobals(); if (!_td) { return FALSE; @@ -184,13 +184,16 @@ ProcessActionsTestParse(BOOL* emitKeyStroke) { switch (act->type) { case KM_KBP_IT_EMIT_KEYSTROKE: *emitKeyStroke = TRUE; - SendDebugMessageFormat(0, sdmGlobal, 0, "ProcessActionsTestParse EMIT_KEYSTROKE: act->type=%d", act->type); + SendDebugMessageFormat(0, sdmGlobal, 0, "ProcessActionsNonUpdatableParse EMIT_KEYSTROKE: act->type=[%d]", act->type); continueProcessingActions = TRUE; _td->CoreProcessEventRun = FALSE; // If we emit the key stroke on this parse we don't need the second parse break; case KM_KBP_IT_CAPSLOCK: continueProcessingActions = processCapsLock(act, !_td->state.isDown, _td->TIPFUpdateable); break; + case KM_KBP_IT_INVALIDATE_CONTEXT: + continueProcessingActions = processInvalidateContext(_td->app, _td->lpActiveKeyboard->lpCoreKeyboardState); + break; } if (!continueProcessingActions) { return FALSE; diff --git a/windows/src/engine/keyman32/kmprocessactions.h b/windows/src/engine/keyman32/kmprocessactions.h index e96f2226d1..6d269493b2 100644 --- a/windows/src/engine/keyman32/kmprocessactions.h +++ b/windows/src/engine/keyman32/kmprocessactions.h @@ -18,12 +18,12 @@ BOOL ProcessActions(BOOL* emitKeyStroke); /** * This function process the actions queued in the core processor in - * the non updateable parse of a keystroke. - * Emit keystroke and capslock are required to be processed in this phase. + * the non-updateable parse of a keystroke. + * Emit keystroke , capslock, and possibly invalidate key stroke are required to be processed in this phase. * * @param [in, out] emitKeyStroke is set to true if requested by the core action queue * @return BOOL True if actions were successfully processed */ -BOOL ProcessActionsTestParse(BOOL* emitKeyStroke); +BOOL ProcessActionsNonUpdatableParse(BOOL* emitKeyStroke); #endif From 04a0f5a32fc461d17a4961ba3f1aeee056ca97ef Mon Sep 17 00:00:00 2001 From: Ross Date: Mon, 22 Aug 2022 13:42:31 +1000 Subject: [PATCH 04/22] fix: grammar and typos --- windows/src/engine/keyman32/kmprocessactions.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/windows/src/engine/keyman32/kmprocessactions.h b/windows/src/engine/keyman32/kmprocessactions.h index 6d269493b2..80827ea623 100644 --- a/windows/src/engine/keyman32/kmprocessactions.h +++ b/windows/src/engine/keyman32/kmprocessactions.h @@ -19,7 +19,7 @@ BOOL ProcessActions(BOOL* emitKeyStroke); /** * This function process the actions queued in the core processor in * the non-updateable parse of a keystroke. - * Emit keystroke , capslock, and possibly invalidate key stroke are required to be processed in this phase. + * Emit keystroke, capslock and possibly invalidate key stroke are required to be processed in this parse. * * @param [in, out] emitKeyStroke is set to true if requested by the core action queue * @return BOOL True if actions were successfully processed From 9bff83fa00df2be69e28e1833a1c29cebdcc90e3 Mon Sep 17 00:00:00 2001 From: Marc Durdin Date: Tue, 23 Aug 2022 06:43:46 +1000 Subject: [PATCH 05/22] chore: Change platform advocates per discussion As discussed, we are changing some of the platform advocates for (a) geographical, and (b) platform familiarity reasons. This will be reflected in the automatic assignment of reviewers on PRs. We are pretty much all affected in this shuffle! @keymanapp-test-bot skip --- docs/CODEOWNERS | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/docs/CODEOWNERS b/docs/CODEOWNERS index eff7811f5e..021a6fc8bc 100644 --- a/docs/CODEOWNERS +++ b/docs/CODEOWNERS @@ -3,32 +3,31 @@ # # @darcywong00 @mcdurdin @ermshiperete @rc-swag @SabineSIL @sgschantz -/android/ @darcywong00 @rc-swag +/android/ @darcywong00 @mcdurdin -/common/ @mcdurdin @jahorton -/core/ @mcdurdin @jahorton +/common/ @mcdurdin @rc-swag +/core/ @mcdurdin @rc-swag /common/lexical-model-types/ @jahorton @mcdurdin /common/models/ @jahorton @mcdurdin /common/predictive-text/ @jahorton @mcdurdin /common/schemas/ @mcdurdin @jahorton /common/test/ @mcdurdin @ermshiperete -/common/web/ @jahorton @ermshiperete @mcdurdin +/common/web/ @jahorton @sgschantz @mcdurdin /developer/ @mcdurdin @darcywong00 /docs/ @mcdurdin @jahorton -/ios/ @sgschantz @mcdurdin +/ios/ @sgschantz @jahorton /linux/ @ermshiperete @darcywong00 /mac/ @sgschantz @SabineSIL -/oem/firstvoices/android/ @darcywong00 @rc-swag -/oem/firstvoices/common/ @mcdurdin @jahorton -/oem/firstvoices/ios/ @sgschantz @mcdurdin -/oem/firstvoices/windows/ @rc-swag @sgschantz +/oem/firstvoices/android/ @darcywong00 @mcdurdin +/oem/firstvoices/common/ @mcdurdin @rc-swag +/oem/firstvoices/ios/ @sgschantz @jahorton +/oem/firstvoices/windows/ @rc-swag @ermshiperete /resources/ @mcdurdin @jahorton # Web is currently shared between Marc and Joshua: -/web/ @jahorton @ermshiperete @mcdurdin +/web/ @jahorton @sgschantz @mcdurdin + +/windows/ @rc-swag @ermshiperete -/windows/ @rc-swag @sgschantz -# Override for windows/src: -/windows/src/developer/ @mcdurdin @darcywong00 From f90eaee6ddbbbdeb372b3a21351f56de4e1aace6 Mon Sep 17 00:00:00 2001 From: Marc Durdin Date: Tue, 23 Aug 2022 07:41:56 +1000 Subject: [PATCH 06/22] fix(android): add toast when browser fails to open --- .../java/com/tavultesoft/kmapro/KMPBrowserActivity.java | 3 +++ .../com/tavultesoft/kmapro/KeyboardSettingsActivity.java | 3 +++ .../main/java/com/tavultesoft/kmapro/MainActivity.java | 9 +++++++++ android/KMAPro/kMAPro/src/main/res/values/strings.xml | 3 +++ .../java/com/tavultesoft/kmea/KeyboardInfoActivity.java | 2 ++ android/KMEA/app/src/main/res/values/strings.xml | 6 ++++-- .../main/java/com/firstvoices/keyboards/FVShared.java | 3 +++ .../java/com/firstvoices/keyboards/MainActivity.java | 2 ++ .../android/app/src/main/res/values/strings.xml | 2 ++ 9 files changed, 31 insertions(+), 2 deletions(-) diff --git a/android/KMAPro/kMAPro/src/main/java/com/tavultesoft/kmapro/KMPBrowserActivity.java b/android/KMAPro/kMAPro/src/main/java/com/tavultesoft/kmapro/KMPBrowserActivity.java index ff74db201f..fe217c57e4 100644 --- a/android/KMAPro/kMAPro/src/main/java/com/tavultesoft/kmapro/KMPBrowserActivity.java +++ b/android/KMAPro/kMAPro/src/main/java/com/tavultesoft/kmapro/KMPBrowserActivity.java @@ -18,6 +18,7 @@ import android.webkit.WebChromeClient; import android.webkit.WebSettings; import android.webkit.WebView; import android.webkit.WebViewClient; +import android.widget.Toast; import androidx.appcompat.app.AppCompatActivity; import com.tavultesoft.kmea.BaseActivity; @@ -115,6 +116,8 @@ public class KMPBrowserActivity extends BaseActivity { Intent intent = new Intent(Intent.ACTION_VIEW, uri); if (intent.resolveActivity(getPackageManager()) != null) { startActivity(intent); + } else { + Toast.makeText(context, getString(R.string.unable_to_open_browser), Toast.LENGTH_SHORT).show(); } return true; } diff --git a/android/KMAPro/kMAPro/src/main/java/com/tavultesoft/kmapro/KeyboardSettingsActivity.java b/android/KMAPro/kMAPro/src/main/java/com/tavultesoft/kmapro/KeyboardSettingsActivity.java index b471fc1cee..dc5519095a 100644 --- a/android/KMAPro/kMAPro/src/main/java/com/tavultesoft/kmapro/KeyboardSettingsActivity.java +++ b/android/KMAPro/kMAPro/src/main/java/com/tavultesoft/kmapro/KeyboardSettingsActivity.java @@ -26,6 +26,7 @@ import android.widget.ListAdapter; import android.widget.ListView; import android.widget.SimpleAdapter; import android.widget.TextView; +import android.widget.Toast; import com.tavultesoft.kmea.ConfirmDialogFragment; import com.tavultesoft.kmea.KMHelpFileActivity; @@ -162,6 +163,8 @@ public final class KeyboardSettingsActivity extends AppCompatActivity { i.putExtras(args); if (i.resolveActivity(getPackageManager()) != null) { startActivity(i); + } else { + Toast.makeText(getApplicationContext(), getString(R.string.unable_to_open_browser), Toast.LENGTH_SHORT).show(); } finish(); diff --git a/android/KMAPro/kMAPro/src/main/java/com/tavultesoft/kmapro/MainActivity.java b/android/KMAPro/kMAPro/src/main/java/com/tavultesoft/kmapro/MainActivity.java index af9b16fbc1..2a9626984a 100644 --- a/android/KMAPro/kMAPro/src/main/java/com/tavultesoft/kmapro/MainActivity.java +++ b/android/KMAPro/kMAPro/src/main/java/com/tavultesoft/kmapro/MainActivity.java @@ -764,12 +764,21 @@ public class MainActivity extends BaseActivity implements OnKeyboardEventListene Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse("market://details?id=com.android.chrome")); if (intent.resolveActivity(getPackageManager()) != null) { startActivity(intent); + } else { + intent = new Intent(Intent.ACTION_VIEW, Uri.parse("https://play.google.com/store/apps/details?id=com.android.chrome")); + if (intent.resolveActivity(getPackageManager()) != null) { + startActivity(intent); + } else { + Toast.makeText(getApplicationContext(), getString(R.string.unable_to_open_browser), Toast.LENGTH_SHORT).show(); + } } } catch (android.content.ActivityNotFoundException e) { // Link to Chrome if user is not signed in to Play Store Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse("https://play.google.com/store/apps/details?id=com.android.chrome")); if (intent.resolveActivity(getPackageManager()) != null) { startActivity(intent); + } else { + Toast.makeText(getApplicationContext(), getString(R.string.unable_to_open_browser), Toast.LENGTH_SHORT).show(); } } } diff --git a/android/KMAPro/kMAPro/src/main/res/values/strings.xml b/android/KMAPro/kMAPro/src/main/res/values/strings.xml index 09a91b5f60..ed4e5b85a1 100644 --- a/android/KMAPro/kMAPro/src/main/res/values/strings.xml +++ b/android/KMAPro/kMAPro/src/main/res/values/strings.xml @@ -247,4 +247,7 @@ Keyboard requires a newer version of Keyman + + + Unable to launch web browser diff --git a/android/KMEA/app/src/main/java/com/tavultesoft/kmea/KeyboardInfoActivity.java b/android/KMEA/app/src/main/java/com/tavultesoft/kmea/KeyboardInfoActivity.java index 89bab42c66..4b818acf7c 100644 --- a/android/KMEA/app/src/main/java/com/tavultesoft/kmea/KeyboardInfoActivity.java +++ b/android/KMEA/app/src/main/java/com/tavultesoft/kmea/KeyboardInfoActivity.java @@ -138,6 +138,8 @@ public final class KeyboardInfoActivity extends BaseActivity { i.setData(Uri.parse(customHelpLink)); if (i.resolveActivity(getPackageManager()) != null) { startActivity(i); + } else { + Toast.makeText(context, getString(R.string.unable_to_open_browser), Toast.LENGTH_SHORT).show(); } } } diff --git a/android/KMEA/app/src/main/res/values/strings.xml b/android/KMEA/app/src/main/res/values/strings.xml index 8f7d20150d..50f52c5ef3 100644 --- a/android/KMEA/app/src/main/res/values/strings.xml +++ b/android/KMEA/app/src/main/res/values/strings.xml @@ -3,10 +3,10 @@ AndroidMobile - + KMEA - + Keyboard @@ -267,4 +267,6 @@ Tap here to change keyboard + + Unable to launch web browser diff --git a/oem/firstvoices/android/app/src/main/java/com/firstvoices/keyboards/FVShared.java b/oem/firstvoices/android/app/src/main/java/com/firstvoices/keyboards/FVShared.java index 9e8790acda..d308049417 100644 --- a/oem/firstvoices/android/app/src/main/java/com/firstvoices/keyboards/FVShared.java +++ b/oem/firstvoices/android/app/src/main/java/com/firstvoices/keyboards/FVShared.java @@ -6,6 +6,7 @@ import android.content.SharedPreferences; import android.content.res.AssetManager; import android.net.Uri; import android.util.Log; +import android.widget.Toast; import com.tavultesoft.kmea.KMManager; import com.tavultesoft.kmea.data.Keyboard; import com.tavultesoft.kmea.packages.PackageProcessor; @@ -254,6 +255,8 @@ final class FVShared { i.setData(Uri.parse(helpUrl)); if (i.resolveActivity(localContext.getPackageManager()) != null) { localContext.startActivity(i); + } else { + Toast.makeText(localContext, localContext.getString(R.string.unable_to_open_browser), Toast.LENGTH_SHORT).show(); } } diff --git a/oem/firstvoices/android/app/src/main/java/com/firstvoices/keyboards/MainActivity.java b/oem/firstvoices/android/app/src/main/java/com/firstvoices/keyboards/MainActivity.java index 897145ec5f..95309efe48 100644 --- a/oem/firstvoices/android/app/src/main/java/com/firstvoices/keyboards/MainActivity.java +++ b/oem/firstvoices/android/app/src/main/java/com/firstvoices/keyboards/MainActivity.java @@ -107,6 +107,8 @@ public class MainActivity extends AppCompatActivity implements OnKeyboardDownloa Intent i = new Intent(Intent.ACTION_VIEW, Uri.parse(url)); if (i.resolveActivity(getPackageManager()) != null) { startActivity(i); + } else { + Toast.makeText(context, getString(R.string.unable_to_open_browser), Toast.LENGTH_SHORT).show(); } } diff --git a/oem/firstvoices/android/app/src/main/res/values/strings.xml b/oem/firstvoices/android/app/src/main/res/values/strings.xml index 83edf8f86b..e443e0f717 100644 --- a/oem/firstvoices/android/app/src/main/res/values/strings.xml +++ b/oem/firstvoices/android/app/src/main/res/values/strings.xml @@ -42,4 +42,6 @@ Invalid/Missing metadata in package + + Unable to launch web browser From 45cac0da6c2dfca6d53fce7cc14896c1855c3c4e Mon Sep 17 00:00:00 2001 From: "Steven R. Loomis" Date: Tue, 23 Aug 2022 10:57:36 -0500 Subject: [PATCH 07/22] =?UTF-8?q?fix(core):=20ldml:=20remove=200-length=20?= =?UTF-8?q?arrays=20=F0=9F=99=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - use C99 flexible array member instead #7098 --- core/src/kmx/kmx_plus.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/core/src/kmx/kmx_plus.h b/core/src/kmx/kmx_plus.h index 89c3421d7f..f9d5cadc5e 100644 --- a/core/src/kmx/kmx_plus.h +++ b/core/src/kmx/kmx_plus.h @@ -31,7 +31,7 @@ struct COMP_KMXPLUS_SECT { COMP_KMXPLUS_HEADER header; KMX_DWORD total; // 0008 KMXPlus entire length KMX_DWORD count; // 000B number of section headers - COMP_KMXPLUS_SECT_ENTRY entries[0]; // 0010 section entries + COMP_KMXPLUS_SECT_ENTRY entries[]; // 0010 section entries /** * @brief Get the offset of a section, or 0 * @@ -53,7 +53,7 @@ struct COMP_KMXPLUS_STRS { COMP_KMXPLUS_HEADER header; KMX_DWORD count; // 0008 count of str entries KMX_DWORD reserved; // 000C padding - COMP_KMXPLUS_STRS_ENTRY entries[0]; // 0010+ entries + COMP_KMXPLUS_STRS_ENTRY entries[]; // 0010+ entries /** * @brief Get a string entry @@ -88,7 +88,7 @@ struct COMP_KMXPLUS_LOCA_ENTRY { struct COMP_KMXPLUS_LOCA { COMP_KMXPLUS_HEADER header; KMX_DWORD count; // 0008 number of locales - COMP_KMXPLUS_LOCA_ENTRY entries[0]; + COMP_KMXPLUS_LOCA_ENTRY entries[]; }; static_assert(sizeof(struct COMP_KMXPLUS_LOCA) == LDML_LENGTH_LOCA, "mismatched size of section loca"); @@ -104,7 +104,7 @@ struct COMP_KMXPLUS_KEYS { COMP_KMXPLUS_HEADER header; KMX_DWORD count; // number of keys KMX_DWORD reserved; // padding - COMP_KMXPLUS_KEYS_ENTRY entries[0]; + COMP_KMXPLUS_KEYS_ENTRY entries[]; const COMP_KMXPLUS_KEYS_ENTRY *find(KMX_DWORD vkey, KMX_DWORD mod) const; }; @@ -118,7 +118,7 @@ struct COMP_KMXPLUS_VKEY_ENTRY { struct COMP_KMXPLUS_VKEY { COMP_KMXPLUS_HEADER header; KMX_DWORD count; - COMP_KMXPLUS_VKEY_ENTRY entries[0]; + COMP_KMXPLUS_VKEY_ENTRY entries[]; }; static_assert(sizeof(struct COMP_KMXPLUS_VKEY) == LDML_LENGTH_VKEY, "mismatched size of section vkey"); From fd4945c5eef31354978e5220aa68529f7595d7a4 Mon Sep 17 00:00:00 2001 From: "Steven R. Loomis" Date: Tue, 23 Aug 2022 11:27:59 -0500 Subject: [PATCH 08/22] =?UTF-8?q?fix(core):=20ldml:=20goodbye=20multichar?= =?UTF-8?q?=20strings=20=F0=9F=99=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - use 32 bit hex constants instead #7098 --- core/include/ldml/keyboardprocessor_ldml.h | 41 +++++++++----------- core/include/ldml/keyboardprocessor_ldml.ts | 17 ++++---- core/include/ldml/ldml-const-builder.ts | 11 ++---- core/tests/unit/ldml/001_tiny.kmx | Bin 768 -> 768 bytes 4 files changed, 32 insertions(+), 37 deletions(-) diff --git a/core/include/ldml/keyboardprocessor_ldml.h b/core/include/ldml/keyboardprocessor_ldml.h index a6e623debb..8716874a94 100644 --- a/core/include/ldml/keyboardprocessor_ldml.h +++ b/core/include/ldml/keyboardprocessor_ldml.h @@ -14,27 +14,22 @@ // #pragma once -#define LDML_KEYS_FLAGS_EXTEND 1 -#define LDML_LENGTH_HEADER 8 -#define LDML_LENGTH_KEYS 16 -#define LDML_LENGTH_LOCA 12 -#define LDML_LENGTH_META 36 -#define LDML_LENGTH_SECT 16 -#define LDML_LENGTH_STRS 16 -#define LDML_LENGTH_VKEY 12 -#define LDML_META_SETTINGS_FALLBACK_OMIT 1 -#define LDML_META_SETTINGS_TRANSFORMFAILURE_OMIT 2 -#define LDML_META_SETTINGS_TRANSFORMPARTIAL_HIDE 4 -// Section ID -#define LDML_SECTION_KEYS ((uint32_t)'keys') -// Section ID -#define LDML_SECTION_LOCA ((uint32_t)'loca') -// Section ID -#define LDML_SECTION_META ((uint32_t)'meta') -// Section ID -#define LDML_SECTION_SECT ((uint32_t)'sect') -// Section ID -#define LDML_SECTION_STRS ((uint32_t)'strs') -// Section ID -#define LDML_SECTION_VKEY ((uint32_t)'vkey') + +#define LDML_KEYS_FLAGS_EXTEND 0x1 +#define LDML_LENGTH_HEADER 0x8 +#define LDML_LENGTH_KEYS 0x10 +#define LDML_LENGTH_LOCA 0xC +#define LDML_LENGTH_META 0x24 +#define LDML_LENGTH_SECT 0x10 +#define LDML_LENGTH_STRS 0x10 +#define LDML_LENGTH_VKEY 0xC +#define LDML_META_SETTINGS_FALLBACK_OMIT 0x1 +#define LDML_META_SETTINGS_TRANSFORMFAILURE_OMIT 0x2 +#define LDML_META_SETTINGS_TRANSFORMPARTIAL_HIDE 0x4 +#define LDML_SECTION_KEYS 0x7379656B +#define LDML_SECTION_LOCA 0x61636F6C +#define LDML_SECTION_META 0x6174656D +#define LDML_SECTION_SECT 0x74636573 +#define LDML_SECTION_STRS 0x73727473 +#define LDML_SECTION_VKEY 0x79656B76 #define LDML_VERSION "1.0" diff --git a/core/include/ldml/keyboardprocessor_ldml.ts b/core/include/ldml/keyboardprocessor_ldml.ts index e4a5a78346..9fa6161bd3 100644 --- a/core/include/ldml/keyboardprocessor_ldml.ts +++ b/core/include/ldml/keyboardprocessor_ldml.ts @@ -19,7 +19,10 @@ // TODO-LDML: namespace com.keyman.core.ldml { /** * Constants for the KMXPlus data format - * These are shared between the data access layer and the compiler + * These are shared between the data access layer and the compiler. + * Note that the section IDs (section_keys etc.) are 32 bit hex + * values that are designed to appear as text when written in little endian + * format, so 0x7379656b = 'keys' */ export const constants = { /** @@ -33,7 +36,7 @@ export const constants = { /** * Section ID for the keybag */ - section_keys: 'keys', + section_keys: 0x7379656B, /** * Minimum length of the 'keys' section * not including variable parts @@ -42,7 +45,7 @@ export const constants = { /** * Section ID for the locale list */ - section_loca: 'loca', + section_loca: 0x61636F6C, /** * Minimum length of the 'loca' section * not including variable parts @@ -51,7 +54,7 @@ export const constants = { /** * Section ID for the metadata */ - section_meta: 'meta', + section_meta: 0x6174656D, /** * length of the 'meta' section */ @@ -71,7 +74,7 @@ export const constants = { /** * Section ID for the section header */ - section_sect: 'sect', + section_sect: 0x74636573, /** * Minimum length of the 'sect' section, not including entries */ @@ -79,7 +82,7 @@ export const constants = { /** * Section ID for the string table */ - section_strs: 'strs', + section_strs: 0x73727473, /** * Minimum length of the 'strs' section * not including variable parts @@ -96,7 +99,7 @@ export const constants = { /** * Section ID for the vkeys map */ - section_vkey: 'vkey', + section_vkey: 0x79656b76, /** * Minimum length of the 'vkey' section * not including variable parts diff --git a/core/include/ldml/ldml-const-builder.ts b/core/include/ldml/ldml-const-builder.ts index d8a398b72e..d9ba21a350 100644 --- a/core/include/ldml/ldml-const-builder.ts +++ b/core/include/ldml/ldml-const-builder.ts @@ -23,18 +23,15 @@ console.log(` // based on core/include/ldml/keyboardprocessor_ldml.ts // -#pragma once`); +#pragma once +`); for (const key of keys) { const value = constants[key]; const upkey = key.toUpperCase(); const type = typeof value; - if ((key.indexOf('section_') === 0) && type === 'string' && value.length === 4) { - // the 4-char section ID strings get handled specially - console.log('// Section ID'); - console.log(`#define LDML_${upkey} ((uint32_t)'${value}')`); - } else if (type === 'number') { - console.log(`#define LDML_${upkey} ${value}`); + if (type === 'number') { + console.log(`#define LDML_${upkey} 0x${value.toString(16).toUpperCase()}`); } else if (type === 'string') { console.log(`#define LDML_${upkey} "${value}"`); } diff --git a/core/tests/unit/ldml/001_tiny.kmx b/core/tests/unit/ldml/001_tiny.kmx index b25c094fedfdf2764b7fff759a757467e083ca6b..c42713014b6ad0683e366d39cc1145d453a08c2f 100644 GIT binary patch delta 96 zcmZo*YhYWz=u(`TT%y1L1dI#}EI_Kbq^NiSkj_mlNpt|xIr+(n20%JHwX(PX$`=4C e1}X;wkh;k(j5;hJ1(Qn{b(u$NnTkp_FJ_Eo1OW7E76JeO From da3bd0a619dded3302489110efacdb3458784def Mon Sep 17 00:00:00 2001 From: "Steven R. Loomis" Date: Tue, 23 Aug 2022 11:56:36 -0500 Subject: [PATCH 09/22] =?UTF-8?q?fix(core):=20ldml:=20fix=20a=20bad=20unsi?= =?UTF-8?q?gned=20assert=20=F0=9F=99=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes: #7098 --- core/src/ldml/ldml_processor.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/src/ldml/ldml_processor.cpp b/core/src/ldml/ldml_processor.cpp index d20caf44a3..39c732e428 100644 --- a/core/src/ldml/ldml_processor.cpp +++ b/core/src/ldml/ldml_processor.cpp @@ -211,7 +211,7 @@ ldml_processor::process_event( // len = (targetStart - out); assert(len>=1 && len <= 2); } - assert(len>=0); + assert(len>0); assert(len Date: Tue, 23 Aug 2022 12:04:57 -0500 Subject: [PATCH 10/22] =?UTF-8?q?fix(core):=20ldml:=20use=20nullptr=20and?= =?UTF-8?q?=20some=20other=20cleanups=20=F0=9F=99=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - per review comments Fixes: #7098 --- core/src/kmx/kmx_plus.cpp | 29 ++++++++++++++++++----------- core/src/kmx/kmx_plus.h | 6 +++--- core/src/ldml/ldml_processor.cpp | 10 +++++++--- 3 files changed, 28 insertions(+), 17 deletions(-) diff --git a/core/src/kmx/kmx_plus.cpp b/core/src/kmx/kmx_plus.cpp index 7949cb030f..193076251b 100644 --- a/core/src/kmx/kmx_plus.cpp +++ b/core/src/kmx/kmx_plus.cpp @@ -32,8 +32,9 @@ dump_section_name(KMX_DWORD ident) { static void dump_kmxplus_header(const COMP_KMXPLUS_HEADER* hdr) { - if (hdr == NULL) { + if (hdr == nullptr) { printf("! dump_kmxplus_header: NULL header\n"); + return; } dump_section_name(hdr->ident); printf(": (%X) size 0x%X\n", hdr->ident, hdr->size); @@ -41,7 +42,7 @@ dump_kmxplus_header(const COMP_KMXPLUS_HEADER* hdr) { static void dump_kmxplus_keys(const uint8_t* /*data*/, const COMP_KMXPLUS_KEYS* keys) { - if(keys == NULL) { + if(keys == nullptr) { printf("! could not load 'keys' section\n"); return; } @@ -63,7 +64,7 @@ dump_kmxplus_keys(const uint8_t* /*data*/, const COMP_KMXPLUS_KEYS* keys) { static void dump_kmxplus_loca(const uint8_t* /*data*/, const COMP_KMXPLUS_LOCA* loca) { - if(loca == NULL) { + if(loca == nullptr) { printf("! could not load 'loca' section\n"); return; } @@ -76,7 +77,7 @@ dump_kmxplus_loca(const uint8_t* /*data*/, const COMP_KMXPLUS_LOCA* loca) { static void dump_kmxplus_meta(const uint8_t* /*data*/, const COMP_KMXPLUS_META* meta) { - if(meta == NULL) { + if(meta == nullptr) { printf("! could not load 'meta' section\n"); return; } @@ -92,7 +93,7 @@ dump_kmxplus_meta(const uint8_t* /*data*/, const COMP_KMXPLUS_META* meta) { static void dump_kmxplus_vkey(const uint8_t* /*data*/, const COMP_KMXPLUS_VKEY* vkey) { - if(vkey == NULL) { + if (vkey == nullptr) { printf("! could not load 'vkey' section\n"); return; } @@ -102,6 +103,9 @@ dump_kmxplus_vkey(const uint8_t* /*data*/, const COMP_KMXPLUS_VKEY* vkey) { static void dump_kmxplus_strs(const uint8_t* /*data*/, const COMP_KMXPLUS_STRS* strs) { + if (strs == nullptr) { + printf("! could not load 'strs' section\n"); + } dump_kmxplus_header((const COMP_KMXPLUS_HEADER*)strs); printf("strs: count 0x%X\n", strs->count); for (KMX_DWORD i=0; icount; i++) { @@ -113,10 +117,10 @@ dump_kmxplus_strs(const uint8_t* /*data*/, const COMP_KMXPLUS_STRS* strs) { continue; } for(int j=0; str[j] && j<0x30; j++) { - if (str[j] < 0x7F && str[j] != 0x0020 && str[j] > 0x20) { + if (str[j] < 0x7F && str[j] > 0x20) { putchar(str[j]); } else { - printf("U+%04X ", str[j]); + printf(" U+%04X ", str[j]); } } printf("\n"); @@ -125,6 +129,9 @@ dump_kmxplus_strs(const uint8_t* /*data*/, const COMP_KMXPLUS_STRS* strs) { static void dump_kmxplus_sect(const uint8_t* data, const COMP_KMXPLUS_SECT* sect) { + if (sect == nullptr) { + printf("! could not load 'sect' section\n"); + } dump_kmxplus_header((const COMP_KMXPLUS_HEADER*)sect); printf("sect: total 0x%X\n", sect->total); printf("sect: count 0x%X\n", sect->count); @@ -164,8 +171,8 @@ void dump_kmxplus_data(const uint8_t* data) { #if KMXPLUS_DEBUG const COMP_KMXPLUS_SECT* sect = as_kmxplus_sect(data); - if (sect == NULL) { - printf("Err: 'sect' null from %p\n", data); + if (sect == nullptr) { + printf("Err: 'sect' NULL from %p\n", data); return; } dump_kmxplus_sect(data, sect); @@ -195,7 +202,7 @@ const COMP_KMXPLUS_KEYS_ENTRY *COMP_KMXPLUS_KEYS::find(KMX_DWORD vkey, KMX_DWORD return &entries[i]; } } - return NULL; + return nullptr; } KMX_DWORD COMP_KMXPLUS_SECT::find(KMX_DWORD ident) const { @@ -211,7 +218,7 @@ PKMX_WCHAR COMP_KMXPLUS_STRS::get(KMX_DWORD entry, PKMX_WCHAR buf, KMX_DWORD bufsiz) const { assert(entry < count); if (entry >= count) { - return NULL; + return nullptr; } KMX_DWORD offset = entries[entry].offset; KMX_DWORD length = entries[entry].length; diff --git a/core/src/kmx/kmx_plus.h b/core/src/kmx/kmx_plus.h index f9d5cadc5e..c095a259f7 100644 --- a/core/src/kmx/kmx_plus.h +++ b/core/src/kmx/kmx_plus.h @@ -61,7 +61,7 @@ struct COMP_KMXPLUS_STRS { * @param entry entry number * @param buf output buffer * @param bufsiz buffer size in bytes - * @return NULL or a pointer to the output buffer + * @return nullptr or a pointer to the output buffer */ PKMX_WCHAR get(KMX_DWORD entry, PKMX_WCHAR buf, KMX_DWORD bufsiz) const; }; @@ -133,14 +133,14 @@ static_assert(sizeof(struct COMP_KMXPLUS_VKEY) == LDML_LENGTH_VKEY, "mismatched static inline const COMP_KMXPLUS_HEADER * validate_as_section(const uint8_t *data, uint32_t ident) { if (!data) { - return NULL; + return nullptr; } const COMP_KMXPLUS_HEADER *all = reinterpret_cast(data); // TODO-LDML these fail on 000null .. assert(all->size >= LDML_LENGTH_HEADER); assert(ident == all->ident); if (ident != all->ident || (all->size < LDML_LENGTH_HEADER)) { - return NULL; // invalid header or wrong section + return nullptr; // invalid header or wrong section } return all; } diff --git a/core/src/ldml/ldml_processor.cpp b/core/src/ldml/ldml_processor.cpp index 39c732e428..2ba6677139 100644 --- a/core/src/ldml/ldml_processor.cpp +++ b/core/src/ldml/ldml_processor.cpp @@ -28,6 +28,10 @@ enum ConversionFlags { typedef KMX_WCHAR UTF16; typedef KMX_DWORD UTF32; +/** + * This is a temporary patch for now. + * API surface somewhat modelled after ConvertUTF.h + */ ConversionResult ConvertUTF32toUTF16( UTF32** sourceStart, const UTF32* sourceEnd, UTF16** targetStart, const UTF16* targetEnd, const ConversionFlags /*flags*/) { @@ -170,7 +174,7 @@ ldml_processor::process_event( const uint8_t* kmxplusdata = rawdata.data() + ex->kmxplus.dpKMXPlus; // Get out the SECT header const kmx::COMP_KMXPLUS_SECT *sect = kmx::as_kmxplus_sect(kmxplusdata); - assert(sect != NULL); + assert(sect != nullptr); assert(sect->header.ident == LDML_SECTION_SECT); KMX_DWORD offset; // Fill out the other sections we need. @@ -184,7 +188,7 @@ ldml_processor::process_event( assert(keys->header.ident == LDML_SECTION_KEYS); // Look up the key const kmx::COMP_KMXPLUS_KEYS_ENTRY *key = keys->find(vk, modifier_state); - assert(key != NULL); + assert(key != nullptr); if (!key) { return KM_KBP_STATUS_KEY_ERROR; } @@ -193,7 +197,7 @@ ldml_processor::process_event( KMX_WCHAR out[BUFSIZ]; if (key->flags && LDML_KEYS_FLAGS_EXTEND) { // It's a string. - assert(NULL != strs->get(key->to, out, BUFSIZ)); + assert(nullptr != strs->get(key->to, out, BUFSIZ)); // u_strlen() for(len=0; len Date: Tue, 23 Aug 2022 12:40:28 -0500 Subject: [PATCH 11/22] =?UTF-8?q?fix(core):=20ldml:=20remove=200-length=20?= =?UTF-8?q?arrays=20=F0=9F=99=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - need a pragma to suppress this on MSVC #7098 --- core/src/kmx/kmx_plus.h | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/core/src/kmx/kmx_plus.h b/core/src/kmx/kmx_plus.h index c095a259f7..3d538fd43b 100644 --- a/core/src/kmx/kmx_plus.h +++ b/core/src/kmx/kmx_plus.h @@ -14,6 +14,14 @@ namespace km { namespace kbp { namespace kmx { +/** + * Using C99 flexible array initializers: entries[] + * https://docs.microsoft.com/en-us/cpp/error-messages/compiler-warnings/compiler-warning-levels-2-and-4-c4200 + */ +#if defined(_WIN32) +#pragma warning ( disable : 4200 ) +#endif + struct COMP_KMXPLUS_HEADER { KMX_DWORD ident; // 0000 Section name KMX_DWORD size; // 0004 Section length @@ -123,6 +131,14 @@ struct COMP_KMXPLUS_VKEY { static_assert(sizeof(struct COMP_KMXPLUS_VKEY) == LDML_LENGTH_VKEY, "mismatched size of section vkey"); +/** + * See above + */ +#if defined(_WIN32) +#pragma warning ( default : 4200 ) +#endif + + /** * @brief Validate that this data is the named section. * From 8ab42029d089d389807db3bea1bbd7f432f461e4 Mon Sep 17 00:00:00 2001 From: Marc Durdin Date: Tue, 23 Aug 2022 11:20:44 +1000 Subject: [PATCH 12/22] chore(common): add variable support for --options in builder script --- resources/build/build-utils.sh | 33 +++++++++++++++++++++++++++++++-- 1 file changed, 31 insertions(+), 2 deletions(-) diff --git a/resources/build/build-utils.sh b/resources/build/build-utils.sh index ab9c2a469c..968204c64f 100755 --- a/resources/build/build-utils.sh +++ b/resources/build/build-utils.sh @@ -410,12 +410,16 @@ _builder_trim() { # # There are three types of parameters that may be specified: # -# * Option, param_desc format: "--option[,-o] [One line description]" +# * Option, param_desc format: "--option[,-o][=var] [One line description]" # All options must have a longhand form with two prefix hyphens, # e.g. --option. The ",-o" shorthand form is optional. When testing if # the option is set with `builder_has_option``, always use the longhand # form. # +# if =var is specified, then the next parameter will be a variable stored +# in $var for that option. e.g. --option=opt means $opt will have the value +# 'foo' when the script is called for --option foo. +# # * Action, param_desc format: "action [One line description]" # Actions must be a single word, lower case. To specify an action # as the default, append a '+' to the action name, e.g. @@ -433,6 +437,7 @@ builder_describe() { _builder_default_action=build declare -A -g _builder_params declare -A -g _builder_options_short + declare -A -g _builder_options_var shift # describe each target, action, and option possibility while [[ $# -gt 0 ]]; do @@ -449,14 +454,26 @@ builder_describe() { elif [[ $value =~ ^-- ]]; then # Parameter is an option # Look for a shorthand version of the option + local option_var= + if [[ $value =~ = ]]; then + option_var="$(echo "$value" | cut -d= -f 2 -)" + value="$(echo "$value" | cut -d= -f 1 -)" + fi + if [[ $value =~ , ]]; then local option_long="$(echo "$value" | cut -d, -f 1 -)" local option_short="$(echo "$value" | cut -d, -f 2 -)" _builder_options+=($option_long) _builder_options_short[$option_short]="$option_long" + _builder_options_var[$option_long]="$option_var" value="$option_long, $option_short" else _builder_options+=($value) + _builder_options_var[$value]="$option_var" + fi + + if [[ ! -z $option_var ]]; then + value="$value $option_var" fi else # Parameter is an action @@ -574,6 +591,15 @@ builder_parse() { _builder_chosen_action_targets+=("$_builder_default_action$target") elif (( has_option )); then _builder_chosen_options+=("$key") + if [[ ! -z ${_builder_options_var[$key]+x} ]]; then + shift + if [[ $# -eq 0 ]]; then + _builder_parameter_error "$0" parameter "$key" + fi + # Set the variable associated with this option to the next parameter value + eval ${_builder_options_var[$key]}="$1" + fi + else case "$key" in --help|-h) @@ -632,7 +658,10 @@ builder_display_usage() { local width=12 for e in "${!_builder_params[@]}"; do - if (( ${#e} > $width )); then width = ${#e}; fi + if (( ${#e} > $width )); then + echo ${#e} + width=${#e} + fi done width=$((width + 6)) From e27bf34c7dc3e6df654ca9d1d4baacbd78068056 Mon Sep 17 00:00:00 2001 From: Marc Durdin Date: Wed, 24 Aug 2022 03:40:57 +1000 Subject: [PATCH 13/22] chore(common): tweak variable parameter support --- resources/build/build-utils.sh | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/resources/build/build-utils.sh b/resources/build/build-utils.sh index 968204c64f..7cff578625 100755 --- a/resources/build/build-utils.sh +++ b/resources/build/build-utils.sh @@ -27,6 +27,11 @@ # Note: keep changes to version, tier and tag determination in sync with mkver (windows/src/buildutils/mkver) # +# +# Prevents 'clear' on exit of mingw64 bash shell +# +SHLVL=0 + # Setup variable for calling script's path and name if [ ! -z ${THIS_SCRIPT+x} ]; then THIS_SCRIPT_PATH="$(dirname "$THIS_SCRIPT")" @@ -597,7 +602,10 @@ builder_parse() { _builder_parameter_error "$0" parameter "$key" fi # Set the variable associated with this option to the next parameter value - eval ${_builder_options_var[$key]}="$1" + # A little bit of hoop jumping here to avoid issues with cygwin paths being + # corrupted too early in the game + local varname=${_builder_options_var[$key]} + declare -g $varname="$1" fi else From 026809f9adf0707d8dcb91673fd6de7a9674ba90 Mon Sep 17 00:00:00 2001 From: Marc Durdin Date: Wed, 24 Aug 2022 03:54:39 +1000 Subject: [PATCH 14/22] chore(common): remove debug code --- resources/build/build-utils.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/resources/build/build-utils.sh b/resources/build/build-utils.sh index 7cff578625..3268cbd55e 100755 --- a/resources/build/build-utils.sh +++ b/resources/build/build-utils.sh @@ -667,7 +667,6 @@ builder_display_usage() { for e in "${!_builder_params[@]}"; do if (( ${#e} > $width )); then - echo ${#e} width=${#e} fi done From e0366f1eb44f5943995bea0d17fcf9643fc04d04 Mon Sep 17 00:00:00 2001 From: Keyman Build Agent Date: Tue, 23 Aug 2022 15:04:57 -0400 Subject: [PATCH 15/22] auto: increment master version to 16.0.51 --- HISTORY.md | 4 ++++ VERSION.md | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/HISTORY.md b/HISTORY.md index 0c1646e28e..f3ba952cd4 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -1,5 +1,9 @@ # Keyman Version History +## 16.0.50 alpha 2022-08-23 + +* chore(core): Remove obsolete python keyboardprocessor (#7094) + ## 16.0.49 alpha 2022-08-22 * fix: remove saving and restoring context kbd options (#7077) diff --git a/VERSION.md b/VERSION.md index 245e8fdca3..251a25b345 100644 --- a/VERSION.md +++ b/VERSION.md @@ -1 +1 @@ -16.0.50 \ No newline at end of file +16.0.51 \ No newline at end of file From b08f101f375c2701657427079765db2ae6864776 Mon Sep 17 00:00:00 2001 From: "Steven R. Loomis" Date: Tue, 23 Aug 2022 16:34:08 -0500 Subject: [PATCH 16/22] =?UTF-8?q?fix(core):=20ldml:=20goodbye=20multichar?= =?UTF-8?q?=20strings=20=F0=9F=99=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - update builder to print out string as well as hex - change to symbol name --- core/include/ldml/keyboardprocessor_ldml.h | 18 ++++--- core/include/ldml/keyboardprocessor_ldml.ts | 53 +++++++++++---------- core/include/ldml/ldml-const-builder.ts | 13 +++++ core/src/kmx/kmx_plus.cpp | 14 +++--- core/src/kmx/kmx_plus.h | 12 ++--- core/src/ldml/ldml_processor.cpp | 10 ++-- 6 files changed, 72 insertions(+), 48 deletions(-) diff --git a/core/include/ldml/keyboardprocessor_ldml.h b/core/include/ldml/keyboardprocessor_ldml.h index 8716874a94..5d2cab3050 100644 --- a/core/include/ldml/keyboardprocessor_ldml.h +++ b/core/include/ldml/keyboardprocessor_ldml.h @@ -26,10 +26,16 @@ #define LDML_META_SETTINGS_FALLBACK_OMIT 0x1 #define LDML_META_SETTINGS_TRANSFORMFAILURE_OMIT 0x2 #define LDML_META_SETTINGS_TRANSFORMPARTIAL_HIDE 0x4 -#define LDML_SECTION_KEYS 0x7379656B -#define LDML_SECTION_LOCA 0x61636F6C -#define LDML_SECTION_META 0x6174656D -#define LDML_SECTION_SECT 0x74636573 -#define LDML_SECTION_STRS 0x73727473 -#define LDML_SECTION_VKEY 0x79656B76 +#define LDML_SECTIONID_KEYS 0x7379656B /* "keys" */ +#define LDML_SECTIONNAME_KEYS "keys" +#define LDML_SECTIONID_LOCA 0x61636F6C /* "loca" */ +#define LDML_SECTIONNAME_LOCA "loca" +#define LDML_SECTIONID_META 0x6174656D /* "meta" */ +#define LDML_SECTIONNAME_META "meta" +#define LDML_SECTIONID_SECT 0x74636573 /* "sect" */ +#define LDML_SECTIONNAME_SECT "sect" +#define LDML_SECTIONID_STRS 0x73727473 /* "strs" */ +#define LDML_SECTIONNAME_STRS "strs" +#define LDML_SECTIONID_VKEY 0x79656B76 /* "vkey" */ +#define LDML_SECTIONNAME_VKEY "vkey" #define LDML_VERSION "1.0" diff --git a/core/include/ldml/keyboardprocessor_ldml.ts b/core/include/ldml/keyboardprocessor_ldml.ts index 9fa6161bd3..35a0e01731 100644 --- a/core/include/ldml/keyboardprocessor_ldml.ts +++ b/core/include/ldml/keyboardprocessor_ldml.ts @@ -33,28 +33,16 @@ export const constants = { * Length of a raw section header, in bytes */ length_header: 8, - /** - * Section ID for the keybag - */ - section_keys: 0x7379656B, /** * Minimum length of the 'keys' section * not including variable parts */ length_keys: 16, - /** - * Section ID for the locale list - */ - section_loca: 0x61636F6C, /** * Minimum length of the 'loca' section * not including variable parts */ length_loca: 12, - /** - * Section ID for the metadata - */ - section_meta: 0x6174656D, /** * length of the 'meta' section */ @@ -71,18 +59,10 @@ export const constants = { * bitwise or value for transformPartial=hide in meta.settings */ meta_settings_transformPartial_hide: 4, - /** - * Section ID for the section header - */ - section_sect: 0x74636573, /** * Minimum length of the 'sect' section, not including entries */ length_sect: 16, - /** - * Section ID for the string table - */ - section_strs: 0x73727473, /** * Minimum length of the 'strs' section * not including variable parts @@ -96,14 +76,39 @@ export const constants = { * `extend = flags & keys_flags_extend` */ keys_flags_extend: 1, - /** - * Section ID for the vkeys map - */ - section_vkey: 0x79656b76, /** * Minimum length of the 'vkey' section * not including variable parts */ length_vkey: 12, + + /** + * All section IDs. + */ + section: { + keys: 'keys', + loca: 'loca', + meta: 'meta', + sect: 'sect', + strs: 'strs', + vkey: 'vkey', + }, + + /** + * Use to convert 4-char string into hex + * @param id section id such as 'sect' + * @returns hex ID such as 0x74636573 + */ + hex_section_id: function(id:string) { + if(!id || typeof id !== 'string' || !id.match(/[a-z][a-z][a-z][a-z]/)) { + throw Error(`hex_section_id(${id}) - need a 4-character string`); + } + let r = 0; + for (let i = 3; i>=0; i--) { + r = (r << 8 | id.charCodeAt(i)); + } + return r; + }, + }; // } diff --git a/core/include/ldml/ldml-const-builder.ts b/core/include/ldml/ldml-const-builder.ts index d9ba21a350..e028dc4b70 100644 --- a/core/include/ldml/ldml-const-builder.ts +++ b/core/include/ldml/ldml-const-builder.ts @@ -34,5 +34,18 @@ for (const key of keys) { console.log(`#define LDML_${upkey} 0x${value.toString(16).toUpperCase()}`); } else if (type === 'string') { console.log(`#define LDML_${upkey} "${value}"`); + } else if (key === 'section') { + // handle section table + const subkeys = Object.keys(value); + subkeys.sort(); + for (const subkey of subkeys) { + const upsubkey = subkey.toUpperCase(); + const subvalue = subkeys[subkey]; + const asnum = constants.hex_section_id(subkey); + console.log(`#define LDML_${upkey}ID_${upsubkey} 0x${asnum.toString(16).toUpperCase()} /* "${subkey}" */`); + console.log(`#define LDML_${upkey}NAME_${upsubkey} "${subkey}"`); + } + } else if (type !== 'function') { + console.error(`Unrecognized key ${key}`); } } diff --git a/core/src/kmx/kmx_plus.cpp b/core/src/kmx/kmx_plus.cpp index 193076251b..4e5877e612 100644 --- a/core/src/kmx/kmx_plus.cpp +++ b/core/src/kmx/kmx_plus.cpp @@ -142,22 +142,22 @@ dump_kmxplus_sect(const uint8_t* data, const COMP_KMXPLUS_SECT* sect) { printf(" sect#%d: %X @ %X\n", i, entry.sect, entry.offset); const uint8_t* entrydata = (data+entry.offset); switch(entry.sect) { - case LDML_SECTION_KEYS: + case LDML_SECTIONID_KEYS: dump_kmxplus_keys(data, as_kmxplus_keys(entrydata)); break; - case LDML_SECTION_LOCA: + case LDML_SECTIONID_LOCA: dump_kmxplus_loca(data, as_kmxplus_loca(entrydata)); break; - case LDML_SECTION_META: + case LDML_SECTIONID_META: dump_kmxplus_meta(data, as_kmxplus_meta(entrydata)); break; - case LDML_SECTION_SECT: - printf("! Cowardly refusing to dump nested 'sect' section.\n"); + case LDML_SECTIONID_SECT: + printf("! Cowardly refusing to dump invalid nested 'sect' section.\n"); break; - case LDML_SECTION_STRS: + case LDML_SECTIONID_STRS: dump_kmxplus_strs(data, as_kmxplus_strs(entrydata)); break; - case LDML_SECTION_VKEY: + case LDML_SECTIONID_VKEY: dump_kmxplus_vkey(data, as_kmxplus_vkey(entrydata)); break; default: diff --git a/core/src/kmx/kmx_plus.h b/core/src/kmx/kmx_plus.h index 3d538fd43b..fc4c3c6b30 100644 --- a/core/src/kmx/kmx_plus.h +++ b/core/src/kmx/kmx_plus.h @@ -167,7 +167,7 @@ validate_as_section(const uint8_t *data, uint32_t ident) { */ static inline const COMP_KMXPLUS_SECT * as_kmxplus_sect(const uint8_t *data) { - const COMP_KMXPLUS_HEADER *all = validate_as_section(data, LDML_SECTION_SECT); + const COMP_KMXPLUS_HEADER *all = validate_as_section(data, LDML_SECTIONID_SECT); return reinterpret_cast(all); } @@ -177,7 +177,7 @@ as_kmxplus_sect(const uint8_t *data) { */ static inline const COMP_KMXPLUS_STRS * as_kmxplus_strs(const uint8_t *data) { - const COMP_KMXPLUS_HEADER *all = validate_as_section(data, LDML_SECTION_STRS); + const COMP_KMXPLUS_HEADER *all = validate_as_section(data, LDML_SECTIONID_STRS); return reinterpret_cast(all); } @@ -187,7 +187,7 @@ as_kmxplus_strs(const uint8_t *data) { */ static inline const COMP_KMXPLUS_KEYS * as_kmxplus_keys(const uint8_t *data) { - const COMP_KMXPLUS_HEADER *all = validate_as_section(data, LDML_SECTION_KEYS); + const COMP_KMXPLUS_HEADER *all = validate_as_section(data, LDML_SECTIONID_KEYS); return reinterpret_cast(all); } /** @@ -196,7 +196,7 @@ as_kmxplus_keys(const uint8_t *data) { */ static inline const COMP_KMXPLUS_LOCA * as_kmxplus_loca(const uint8_t *data) { - const COMP_KMXPLUS_HEADER *all = validate_as_section(data, LDML_SECTION_LOCA); + const COMP_KMXPLUS_HEADER *all = validate_as_section(data, LDML_SECTIONID_LOCA); return reinterpret_cast(all); } /** @@ -205,7 +205,7 @@ as_kmxplus_loca(const uint8_t *data) { */ static inline const COMP_KMXPLUS_META * as_kmxplus_meta(const uint8_t *data) { - const COMP_KMXPLUS_HEADER *all = validate_as_section(data, LDML_SECTION_META); + const COMP_KMXPLUS_HEADER *all = validate_as_section(data, LDML_SECTIONID_META); return reinterpret_cast(all); } /** @@ -214,7 +214,7 @@ as_kmxplus_meta(const uint8_t *data) { */ static inline const COMP_KMXPLUS_VKEY * as_kmxplus_vkey(const uint8_t *data) { - const COMP_KMXPLUS_HEADER *all = validate_as_section(data, LDML_SECTION_VKEY); + const COMP_KMXPLUS_HEADER *all = validate_as_section(data, LDML_SECTIONID_VKEY); return reinterpret_cast(all); } diff --git a/core/src/ldml/ldml_processor.cpp b/core/src/ldml/ldml_processor.cpp index 2ba6677139..66fd543adc 100644 --- a/core/src/ldml/ldml_processor.cpp +++ b/core/src/ldml/ldml_processor.cpp @@ -175,17 +175,17 @@ ldml_processor::process_event( // Get out the SECT header const kmx::COMP_KMXPLUS_SECT *sect = kmx::as_kmxplus_sect(kmxplusdata); assert(sect != nullptr); - assert(sect->header.ident == LDML_SECTION_SECT); + assert(sect->header.ident == LDML_SECTIONID_SECT); KMX_DWORD offset; // Fill out the other sections we need. - offset = sect->find(LDML_SECTION_STRS); + offset = sect->find(LDML_SECTIONID_STRS); assert(offset != 0); // or else section not found const kmx::COMP_KMXPLUS_STRS *strs = kmx::as_kmxplus_strs(kmxplusdata+offset); - assert(strs->header.ident == LDML_SECTION_STRS); - offset = sect->find(LDML_SECTION_KEYS); + assert(strs->header.ident == LDML_SECTIONID_STRS); + offset = sect->find(LDML_SECTIONID_KEYS); assert(offset != 0); // or else section not found const kmx::COMP_KMXPLUS_KEYS *keys = kmx::as_kmxplus_keys(kmxplusdata+offset); - assert(keys->header.ident == LDML_SECTION_KEYS); + assert(keys->header.ident == LDML_SECTIONID_KEYS); // Look up the key const kmx::COMP_KMXPLUS_KEYS_ENTRY *key = keys->find(vk, modifier_state); assert(key != nullptr); From f8e0abd810fbe180cfc1476426981616c49639bb Mon Sep 17 00:00:00 2001 From: "Steven R. Loomis" Date: Tue, 23 Aug 2022 16:37:02 -0500 Subject: [PATCH 17/22] =?UTF-8?q?fix(core):=20ldml:=20turn=20off=20problem?= =?UTF-8?q?atic=20debug=20=F0=9F=99=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit #7098 --- core/src/kmx/kmx_plus.cpp | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/core/src/kmx/kmx_plus.cpp b/core/src/kmx/kmx_plus.cpp index 4e5877e612..0d4ca2f3e1 100644 --- a/core/src/kmx/kmx_plus.cpp +++ b/core/src/kmx/kmx_plus.cpp @@ -9,7 +9,7 @@ /** * @def KMXPLUS_DEBUG Set to 1 to enable debug output */ -#define KMXPLUS_DEBUG 1 +#define KMXPLUS_DEBUG 0 #if KMXPLUS_DEBUG #include @@ -167,21 +167,31 @@ dump_kmxplus_sect(const uint8_t* data, const COMP_KMXPLUS_SECT* sect) { } #endif +#if !KMXPLUS_DEBUG +void +dump_kmxplus_data(const uint8_t* ) { + // no op +} + +void +dump_kmxplus_data(kmx::PCOMP_KEYBOARD) { + // no op +} + +#else + void dump_kmxplus_data(const uint8_t* data) { -#if KMXPLUS_DEBUG const COMP_KMXPLUS_SECT* sect = as_kmxplus_sect(data); if (sect == nullptr) { printf("Err: 'sect' NULL from %p\n", data); return; } dump_kmxplus_sect(data, sect); -#endif } void dump_kmxplus_data(kmx::PCOMP_KEYBOARD keyboard) { -#if KMXPLUS_DEBUG printf("dump_kmxplus_data(): Got a PCOMP_KEYBOARD at %p\n", keyboard); if (!(keyboard->dwFlags & KF_KMXPLUS)) { printf("Err: flags KF_KMXPLUS not set\n"); @@ -192,8 +202,8 @@ dump_kmxplus_data(kmx::PCOMP_KEYBOARD keyboard) { printf("KMXPlus offset 0x%X, KMXPlus size 0x%X\n", ex->kmxplus.dpKMXPlus, ex->kmxplus.dwKMXPlusSize); const uint8_t* rawdata = reinterpret_cast(keyboard); dump_kmxplus_data(rawdata + ex->kmxplus.dpKMXPlus); -#endif } +#endif const COMP_KMXPLUS_KEYS_ENTRY *COMP_KMXPLUS_KEYS::find(KMX_DWORD vkey, KMX_DWORD mod) const { // TODO-LDML: eventually, assume sorted order & binary search From 748a4ca63f263e3ed2a14de96a4e07f0740297de Mon Sep 17 00:00:00 2001 From: Marc Durdin Date: Wed, 24 Aug 2022 09:55:26 +1000 Subject: [PATCH 18/22] chore(common): fixup support for options which have no variable param --- resources/build/build-utils.sh | 8 ++++++-- resources/build/build-utils.test.sh | 20 ++++++++++++++++++-- 2 files changed, 24 insertions(+), 4 deletions(-) diff --git a/resources/build/build-utils.sh b/resources/build/build-utils.sh index 3268cbd55e..9a26531bf7 100755 --- a/resources/build/build-utils.sh +++ b/resources/build/build-utils.sh @@ -470,11 +470,15 @@ builder_describe() { local option_short="$(echo "$value" | cut -d, -f 2 -)" _builder_options+=($option_long) _builder_options_short[$option_short]="$option_long" - _builder_options_var[$option_long]="$option_var" + if [[ ! -z "$option_var" ]]; then + _builder_options_var[$option_long]="$option_var" + fi value="$option_long, $option_short" else _builder_options+=($value) - _builder_options_var[$value]="$option_var" + if [[ ! -z "$option_var" ]]; then + _builder_options_var[$value]="$option_var" + fi fi if [[ ! -z $option_var ]]; then diff --git a/resources/build/build-utils.test.sh b/resources/build/build-utils.test.sh index 3fa7902940..efc06ae483 100755 --- a/resources/build/build-utils.test.sh +++ b/resources/build/build-utils.test.sh @@ -94,7 +94,7 @@ builder_parse_test() { shift shift local parameters="$@" - echo "Testing: builder_parse $parameters" + echo "${COLOR_BLUE}## Testing: builder_parse $parameters${COLOR_RESET}" builder_parse $parameters || fail "builder_parse died under curious circumstances" if [[ "$expected" != "${_builder_chosen_action_targets[@]}" ]]; then fail " Test: builder_parse $parameters action:target != \"$expected\"" @@ -112,7 +112,8 @@ builder_describe \ ":app" \ ":engine Thomas, y'know" \ "--power,-p Use powerful mode" \ - "--zoom,-z Use zoom mode" + "--zoom,-z Use zoom mode" \ + "--feature=FOO Enable feature foo" # Test --options @@ -132,6 +133,21 @@ else fail "FAIL: --zoom option not found" fi +# Test --feature + +echo "${COLOR_BLUE}## Testing: builder_parse --feature xyzzy${COLOR_RESET}" +builder_parse --feature xyzzy + +if builder_has_option --feature; then + if [[ $FOO == xyzzy ]]; then + echo "PASS: --feature option variable \$FOO has expected value 'xyzzy'" + else + echo "FAIL: --feature option variable \$FOO had value '$FOO' but should have had 'xyzzy'" + fi +else + echo "FAIL: --feature option not found" +fi + # Finally, run with --help so we can see what it looks like echo "${COLOR_BLUE}## Testing --help${COLOR_RESET}" From 16b8d725fd0527ac21c67c0f70d1837c7e8b0b7b Mon Sep 17 00:00:00 2001 From: "Steven R. Loomis" Date: Tue, 23 Aug 2022 19:15:20 -0500 Subject: [PATCH 19/22] =?UTF-8?q?fix(core):=20ldml:=20include=20path=20fix?= =?UTF-8?q?=20=F0=9F=99=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit #7098 --- core/src/ldml/ldml_processor.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/src/ldml/ldml_processor.cpp b/core/src/ldml/ldml_processor.cpp index 66fd543adc..ed56c0f88b 100644 --- a/core/src/ldml/ldml_processor.cpp +++ b/core/src/ldml/ldml_processor.cpp @@ -8,8 +8,8 @@ #include #include "ldml/ldml_processor.hpp" #include "state.hpp" -#include "../kmx/kmx_file.h" -#include "../kmx/kmx_plus.h" +#include "kmx/kmx_file.h" +#include "kmx/kmx_plus.h" #include "ldml/keyboardprocessor_ldml.h" // extern "C" { From eb48fb76f91931440a15188298455548f2a12e83 Mon Sep 17 00:00:00 2001 From: Marc Durdin Date: Wed, 24 Aug 2022 14:20:08 +1000 Subject: [PATCH 20/22] Update core/src/kmx/kmx_plus.cpp --- core/src/kmx/kmx_plus.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/core/src/kmx/kmx_plus.cpp b/core/src/kmx/kmx_plus.cpp index 0d4ca2f3e1..1ea44610cb 100644 --- a/core/src/kmx/kmx_plus.cpp +++ b/core/src/kmx/kmx_plus.cpp @@ -105,6 +105,7 @@ static void dump_kmxplus_strs(const uint8_t* /*data*/, const COMP_KMXPLUS_STRS* strs) { if (strs == nullptr) { printf("! could not load 'strs' section\n"); + return; } dump_kmxplus_header((const COMP_KMXPLUS_HEADER*)strs); printf("strs: count 0x%X\n", strs->count); From b180ca844d0321eb30acf2a982f82bf97cf05122 Mon Sep 17 00:00:00 2001 From: "Steven R. Loomis" Date: Wed, 24 Aug 2022 13:49:55 -0500 Subject: [PATCH 21/22] =?UTF-8?q?fix(core):=20fixes=20for=20kmx=5Ffile=20r?= =?UTF-8?q?earrangement=20=F0=9F=99=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit fix breaks in #7111 and prior #7098 --- common/include/km_types.h | 2 ++ core/src/kmx/kmx_plus.cpp | 2 ++ core/src/kmx/kmx_plus.h | 4 +++- core/src/ldml/ldml_processor.cpp | 2 +- core/tests/unit/ldml/test_kmx_plus.cpp | 2 +- 5 files changed, 9 insertions(+), 3 deletions(-) diff --git a/common/include/km_types.h b/common/include/km_types.h index 113647d3a0..db7cc213f6 100644 --- a/common/include/km_types.h +++ b/common/include/km_types.h @@ -1,5 +1,7 @@ #pragma once +#include + /* #if defined(_WIN32) || defined(_WIN64) #define snprintf _snprintf diff --git a/core/src/kmx/kmx_plus.cpp b/core/src/kmx/kmx_plus.cpp index 1ea44610cb..fa47279364 100644 --- a/core/src/kmx/kmx_plus.cpp +++ b/core/src/kmx/kmx_plus.cpp @@ -4,6 +4,8 @@ Implementation for the KMX Plus utilities */ +#include +#include #include /** diff --git a/core/src/kmx/kmx_plus.h b/core/src/kmx/kmx_plus.h index fc4c3c6b30..98d091036b 100644 --- a/core/src/kmx/kmx_plus.h +++ b/core/src/kmx/kmx_plus.h @@ -7,7 +7,9 @@ #pragma once #include -#include +#include +#include +#include #include namespace km { diff --git a/core/src/ldml/ldml_processor.cpp b/core/src/ldml/ldml_processor.cpp index ed56c0f88b..595dc6abf6 100644 --- a/core/src/ldml/ldml_processor.cpp +++ b/core/src/ldml/ldml_processor.cpp @@ -8,7 +8,7 @@ #include #include "ldml/ldml_processor.hpp" #include "state.hpp" -#include "kmx/kmx_file.h" +#include "kmx_file.h" #include "kmx/kmx_plus.h" #include "ldml/keyboardprocessor_ldml.h" diff --git a/core/tests/unit/ldml/test_kmx_plus.cpp b/core/tests/unit/ldml/test_kmx_plus.cpp index 1d32184a57..db7dbc8daf 100644 --- a/core/tests/unit/ldml/test_kmx_plus.cpp +++ b/core/tests/unit/ldml/test_kmx_plus.cpp @@ -1,6 +1,6 @@ #include #include -#include +#include "kmx/kmx_plus.h" using namespace km::kbp::kmx; From eb5f1ad63cd85e38a8f50d725ec023ede2bf34ca Mon Sep 17 00:00:00 2001 From: "Steven R. Loomis" Date: Wed, 24 Aug 2022 13:56:42 -0500 Subject: [PATCH 22/22] =?UTF-8?q?fix(core):=20fixes=20for=20kmx=5Ffile=20r?= =?UTF-8?q?earrangement=20=F0=9F=99=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit fix breaks in #7111 and prior - try stdint.h instead of cstdint #7098 --- common/include/km_types.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/include/km_types.h b/common/include/km_types.h index db7cc213f6..bf25b354b5 100644 --- a/common/include/km_types.h +++ b/common/include/km_types.h @@ -1,6 +1,6 @@ #pragma once -#include +#include /* #if defined(_WIN32) || defined(_WIN64)