Commit graph

20 commits

Author SHA1 Message Date
Eberhard Beilharz
3dc3f040de
feat(core): implement loading KMX from blob
- split keyboard loading into loading KMX file into blob and then
  loading the keyboard processor from the blob.
- deprecate `km_core_keyboard_load`
- move file access next to deprecated method. This is now the only place
  that loads a file in Core; unit tests have some more places that
  load files.
- introduce GTest and add unit tests for loading from blob

Cherry-picked from `epic/web-core` branch.

Cherry-Pick-Commit: 1deaa323ad
Cherry-Pick-Commit: 59019cc8b7
Cherry-Pick-Commit: bc46458368
Cherry-Pick-Commit: d06aa29956
Cherry-Pick-Commit: 1c88166f6e
Cherry-Pick-Commit: 069cd21ecd
Cherry-Pick-Commit: 052ae2ec35
Cherry-Pick-Commit: 11a2a3ba3a

Part-of: #11293
Part-of: #8093
2024-11-27 15:30:05 +01:00
Marc Durdin
671973baab refactor(core): split context API from Core primary API
Relates to #9999.
Fixes #10384.

The context API endpoints should no longer be considered as part of the
standard Core API. The only consumers that have a need to access these
APIs are the IMX integration in Engine for Windows, and the Keyman
Developer Debugger.

These symbols are currently used by Developer:
* `km_core_context` struct
* `km_core_context_type` enum
* `km_core_context_item` struct
* `KM_CORE_CONTEXT_ITEM_END` macro
* `km_core_state_context()`
* `km_core_context_set()`
* `km_core_context_clear()`

These symbols are currently used by Windows IMX:
* `km_core_context` struct
* `km_core_context_type` enum
* `km_core_context_item` struct
* `KM_CORE_CONTEXT_ITEM_END` macro
* `km_core_context_items_dispose()`
* `km_core_context_item_list_size()`
* `km_core_state_get_intermediate_context()`

The following functions and symbols are moving to
keyman_core_api_context.h:
* `km_core_context` struct
* `km_core_context_type` enum
* `km_core_context_item` struct
* `KM_CORE_CONTEXT_ITEM_END` macro
* `km_core_state_context()` function
* `km_core_state_get_intermediate_context()` function
* `km_core_context_set()` function
* `km_core_context_clear()` function
* `km_core_context_get()` function
* `km_core_context_items_from_utf16()` function
* `km_core_context_items_from_utf8()` function
* `km_core_context_items_to_utf8()` function
* `km_core_context_items_to_utf16()` function
* `km_core_context_items_to_utf32()` function
* `km_core_context_items_dispose()` function
* `km_core_context_length()` function
* `km_core_context_append()` function
* `km_core_context_shrink()` function
* `km_core_context_item_list_size()` function
2024-01-17 14:44:25 +11:00
rc-swag
4a511bde1e fix(core): clear core context on invalidate cache 2023-12-12 23:49:04 +10:00
rc-swag
4480a05412 chore(windows): removed cached context windows engine
Removed the cached context from the windows engine
2023-11-23 16:58:41 +10:00
Marc Durdin
21e0254c95 chore(core): remove vkey output from kmx processor
Fixes #10049.

vkey output was never supported by Core, so this code effectively was a
no-op.
2023-11-23 11:51:22 +10:00
Eberhard Beilharz
604fbc1a75
chore(linux): Rename namespace kbp to core 2023-10-19 10:39:55 +02:00
Marc Durdin
db76e2541d chore: rename KM_KBP_ to KM_CORE_ 2023-10-09 14:53:22 +07:00
Marc Durdin
ba5f18defd chore: rename km_kbp_ to km_core_ 2023-10-09 14:53:13 +07:00
Marc Durdin
4ef18f5e29 chore(core): rename keyboardprocessor.h to keyman_core_api.h
Fixes #9721.

Also tweaks some documentation references to keyboardprocessor, but does
not touch those relating to debian/control.
2023-10-09 14:21:01 +07:00
rc-swag
3bcd919922
feat(windows): review suggestions
Co-authored-by: Marc Durdin <marc@durdin.net>
2023-08-07 12:08:09 +10:00
rc-swag
ba572f1f31
feat(windows): apply suggestions from code review 2023-08-03 13:08:11 +10:00
Ross
a8f2934406 feat(windows): add unit test for external event
Added a unit test for an external event. Also updated
the unit test utility print code for action items to include
KM_KBP_IT_CAPSLOCK.
2023-07-31 09:52:14 +10:00
Ross
9076bd1783 feat(windows): WIP add external event kmx_processor 2023-07-25 11:11:39 +10:00
Steven R. Loomis
bc14f18460 Merge remote-tracking branch 'origin/master' into chore/core/mergemaster4-epic-ldml 2022-12-15 17:55:13 -06:00
Eberhard Beilharz
108e849459
fix(linux): Fix lintian warnings 2022-11-16 18:45:34 +01:00
Marc Durdin
42a9f2ca72 fix(core): emit keystroke was writing to wrong queue
Fixes #7649.

emit_keystroke code path in kmx processor was writing directly to the
core queue instead of to the internal kmx processor queue. This caused
it to be out-of-order in the actions sent to the engine/debugger.

Engines didn't really care but it broke the debugger, for example if
only a deadkey was in the buffer and backspace was pressed, Developer
would assert as it would get unexpected context for the deletions.
2022-11-08 16:31:30 +11:00
Marc Durdin
a8c3854431 fix(core): save() should be on internal kmx action queue
Fixes #7643.

The kmn statement `save()` action was being written directly to the
state queue, bypassing the internal kmx action queue. This caused two
issues:

1. save() actions were out-of-order with other actions on the same key
   event.
2. The number of items in the internal action queue became out of sync
   with the debug item queue, which would cause the debugger to fail
   with an assertion.

The new test in debug_api.cpp validates this second issue as the number
of items in the action queue now matches the expected count in the
corresponding debug item.
2022-11-07 10:28:58 +11:00
Steven R. Loomis
90131728e8 chore(core): improve xstring macros 🙀
- move Utf32CharToUtf16 to inline
- remove Is_SMP and call sites, use Utf32CharToUtf16 instead.

For: #7134
2022-09-08 12:29:04 -05:00
Steven R. Loomis
21a783a6ca feat(core): add event_flags to process_event
- uint16_t
- defined km_kbp_event_flags to define the bitfield
- bitfield has value KM_KBP_EVENT_FLAG_TOUCH for touch events
- ignored everywhere, currently
2022-08-11 16:14:57 -05:00
Marc Durdin
a58680f89b chore(common): move common/core/desktop/ to core/ 2022-05-18 07:22:10 +10:00
Renamed from common/core/desktop/src/kmx/kmx_processor.cpp (Browse further)