From a072171ec881e4bee4cb3e41a055838a93cf40b2 Mon Sep 17 00:00:00 2001 From: Eberhard Beilharz Date: Sun, 17 Nov 2024 22:09:57 +0700 Subject: [PATCH] feat(web): load .kmx keyboard from blob This change adds the web side of loading a .kmx keyboard from a blob. It also replaces the `CoreProcessor` class with `CoreFactory` that allows to directly use the methods defined in WASM without having to add another wrapper for each method. --- core/include/keyman/keyman_core_api.h | 5 ++- web/build.sh | 3 ++ .../engine/core-processor/src/core-factory.ts | 38 +++++++++++++++++++ .../core-processor/src/core-processor.ts | 30 --------------- web/src/engine/core-processor/src/index.ts | 4 +- .../main/src/headless/inputProcessor.ts | 12 ++++-- .../dom/cases/core-processor/basic.tests.ts | 31 +++++++++++---- .../test/auto/dom/web-test-runner.config.mjs | 2 + 8 files changed, 82 insertions(+), 43 deletions(-) create mode 100644 web/src/engine/core-processor/src/core-factory.ts delete mode 100644 web/src/engine/core-processor/src/core-processor.ts diff --git a/core/include/keyman/keyman_core_api.h b/core/include/keyman/keyman_core_api.h index 7863689296d..af77ddfb2ca 100644 --- a/core/include/keyman/keyman_core_api.h +++ b/core/include/keyman/keyman_core_api.h @@ -302,11 +302,14 @@ typedef uint8_t (*km_core_keyboard_imx_platform)(km_core_state*, uint32_t, void* ## Description -An error code mechanism similar to COM’s `HRESULT` scheme (unlike COM, any +An error code mechanism similar to COM's `HRESULT` scheme (unlike COM, any non-zero value is an error). ## Specification +--> +// keep in sync with web/src/engine/core-processor/src/core-factory.ts +