- 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
Part-of: #11293
Fixes#10615 (surrogate handling, km_core_state_context_set_if_needed).
Fixes#10616 (markers in app context, in unit tests)
Fixes#10617 (memory leak in replace_context).
The surrogate handling and markers in app context bugs were quite
tangled, so opted to fix those both together in one commit. The memory
leak was spotted while verifying the changes for surrogate handling.
Surrogates were not handled in is_context_unchanged, and opted to
refactor to work directly with km_core_context_item arrays rather than
continue with the string-based comparison, for simplicity.
While writing the corresponding unit tests, realised that the
app_context checks were incorrect in a number of existing tests, and so
fixed up the existing tests at the same time as writing up the new
tests. The only changes to core for this were to add assertions for the
app_context to ensure that markers are not inadvertently added.
Fixes#10431.
The `km_core_` prefix has been removed from internal-only functions, and
these function declarations moved to context.hpp.
The functions have not been moved from km_core_context_api.cpp at this
stage.
Rewrote the function documentation in Javadoc style comments for the
internal use functions.
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
Removes the Windows-only kmcomp.exe dependency, and instead now uses
kmc to always build .kmx files for unit tests.
debug_api.cpp was using an outdated .kmx file, which is why the line
number offsets have changed. (The perils of binary fixtures!)
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.
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.
- 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