Commit graph

58 commits

Author SHA1 Message Date
Steven R. Loomis
6706ae0957 chore(core): km_core_cp -> km_core_cu
- km_core_cp represents a 16 bit code unit, not a code point.

Fixes: #11033
2024-05-02 17:39:15 -05:00
Marc Durdin
f9bb4ba818 fix(windows): wstrtostr should use WideCharToMultiByte
Relates to #10604: "Note also wstrtostr crashes if you pass it surrogate
pairs because they won't convert ... ouch."
2024-02-07 10:39:07 +07:00
Marc Durdin
7cd7ab3346 refactor(windows): use km_core_state_context_debug
Relates to #10365.
2024-01-15 08:29:27 +07:00
rc-swag
63e4371513 chore(windows): fix argument passed into to km_core_state_context_set_if_needed 2023-11-30 12:51:52 +10:00
rc-swag
08b3764496
chore(windows): review comments
Co-authored-by: Marc Durdin <marc@durdin.net>
2023-11-24 07:48:23 +10:00
rc-swag
2dbad870ca chore(windows): add comments ReadContext 2023-11-23 22:01:26 +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
ee1f972b13 chore(windows): remove wm_keymandebug messages and functions
Fixes #10050.

Removes the following unused identifiers:
* ::wm_kmdebug
* ::wm_keymandebug
* AppInt::DebugControlled()
* AITIP::WM_KEYMANDEBUG_CANDEBUG
* AITIP::WM_KEYMANDEBUG_GETUNICODESTATUS
* AITIP::WM_KEYMANDEBUG_GETCONTEXT
* AITIP::WM_KEYMANDEBUG_ACTION
* AITIP::WM_KEYMANDEBUG_RULEMATCH
* AITIP::DebugControlled()
* AITIP::IsDebugControlWindow()
* AITIP::GetDebugControlWindow()
* AITIP::Debug_FillContextBuffer()
* AIDEBUGINFO struct
* ::FillStoreOffsets()
* AIDEBUGKEYINFO struct

Removes overloads which are now no-ops:
* AITIP::HandleWindow()
* AITIP::IsWindowHandled()
* AITIP::QueueAction()
2023-11-23 10:49:58 +10: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
Ross
65ef3d0982 chore(windows): remove QueDebugInformation method 2023-05-12 18:21:44 +10:00
Ross
ec8539543b chore(windows): remove dead code 2023-04-19 14:27:03 +10:00
Ross
8f20507a82 chore(windows): remove legacy core and flag
Removing the legacy code that was replaced by the core.
Also removing the feature flag for core integeration.
2023-04-14 13:59:49 +10:00
Marc Durdin
bd8f89b3b2 chore: Merge branch 'master' into feature-ldml 2022-08-24 14:22:55 +10:00
Ross
ecad0209cb 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
2022-08-22 11:51:01 +10:00
Steven R. Loomis
b23c1e75f3
Update kmprocess.cpp 2022-08-15 17:51:45 -05:00
Steven R. Loomis
e8dff5cf4e feat(core): add event_flags to process_event #7046
- use a constant, KM_KBP_EVENT_FLAG_DEFAULT for 0
- update pascal and python
- update linux and windows
2022-08-12 09:58:58 -05:00
Ross
08d676c3f0 fix: add caps to process event bit mask 2022-02-11 17:13:16 +10:00
Ross
d5e228d6cc fix(windows): update comment remove casts 2022-02-10 11:48:06 +10:00
Ross
09d572b8fd fix(windows): remove extra blank line 2022-02-08 14:48:41 +10:00
Ross
c3a30d184c fix(windows): add flag to track core process event
For the TSF applications in most cases there is no test parse
with updatable=false. In these cases we need to call the
core process event function and process the actions in the
one call. A bool flag has been added to track if the core process
event has been called for the current keystroke
2022-02-08 12:19:28 +10:00
Ross
1c3cd0ae1f feat(windows): Bit wise and modifier flags for core process event
The windows engine shift modifier flag needs to only pass
the K_MODIFIERFLAGS so do a bit wise and to clear the other flags
2022-01-25 14:59:19 +10:00
Ross
9dd342eace feat(windows): Turn imx synthesised actions to emti keystroke action 2022-01-21 14:12:00 +10:00
Ross
ca8108c642 feat(windows): remove extra logging add comments 2022-01-13 14:00:13 +10:00
Ross
7efb4b1756 feat(windows): add wm_kewm_keymanim_close for core
This commit adds call to the core keyboard processor
on wm_keymanim_close event. To get the latest actions.
It also changes the core to allow QIT BACK even when
the context is empty.
2022-01-13 13:59:43 +10:00
Ross
a72697423a feat(windows): add logging to be removed later 2022-01-13 13:59:39 +10:00
Ross
490e6601bc feat(windows): Initial Commit 2022-01-13 13:54:30 +10:00
Ross
96697e89ba feat(windows): Change caps to work with common core processor 2021-10-06 15:35:23 +10:00
Ross
d450543253 feat(windows): address review comments
Add test fixture to allow Setup and Teardown methods to be used
for all km process action tests.
Modified the DebugAssert macro to not do the early return on its own.
2021-09-21 09:59:17 +10:00
Ross
e125736e0e feat(windows): Update all TODOs with Issue numbers 2021-08-30 10:18:57 +10:00
Ross
a4801373db feat(windows): err logs, DEBUG_ASSERT macro
Added some more error logs
Added a DEBUG_ASSERT macro
Update variable names
2021-08-24 17:17:26 +10:00
Ross
937bf8a485 feat(windows): review comments 2021-08-19 14:17:34 +10:00
Ross
0f4e3d1768 feat(windows): core saving context null pointer check 2021-08-17 14:10:44 +10:00
Ross
c0826e9930 feat(windows): use static library for keyboard core 2021-08-04 09:36:42 +10:00
Ross
40b96f2a82 feat(windows): update kmprocess_event call with new arg 2021-08-02 15:07:22 +10:00
Ross
09611b600d feat(windows): address review comments 2021-08-02 13:23:48 +10:00
Ross
7d5187ae64 feat(windows): add correct memory free calls for core 2021-08-02 13:17:22 +10:00
Ross
7a9ee207a8 feat(windows): update project include paths for core 2021-08-02 13:13:03 +10:00
Ross
99b4bc73b8 feat(windows): appcontext to core kb_kmn_context 2021-08-02 13:13:02 +10:00
Ross
fb2a246f53 feat(windows): update update windows engine action que from core processor 2021-08-02 13:13:00 +10:00
Ross
f0f1e966a2 feat(windows): update project include files 2021-08-02 13:12:16 +10:00
Ross Cruickshank
5d2df77e7d feat(windows): work in progress 2021-08-02 13:09:39 +10:00
Ross Cruickshank
ece7addfed feat(windows): mark out changes with 5011 feature TODOs 2021-08-02 13:02:26 +10:00
Ross Cruickshank
18a72a1dd5 feat(windows): initial skeleton for integeration 2021-08-02 13:02:04 +10:00
Marc Durdin
193478a492 fix(windows): Reverse order of backspaces
In order for the BK_SURROGATE and BK_DEADKEY flags to be matched with
the correct xstring elements in the context, we need to delete the
elements from the buffer in reverse order.

decxstr would previously assert if attempting to move before start of
string. This is undesirable behaviour as it should instead return NULL
to indicate that we've finished the string.

I also corretected a buffer underrun which would be possible if
malformed data was in the xstring.

I checked all uses of decxstr to ensure that the NULL return value is
being tested correctly.
2021-01-28 08:16:33 +11:00
Marc Durdin
098de3af78 fix(windows): SMP-aware deletion in TSF-aware apps
Fixes #4196.

When deleting characters in a TSF-aware app, we must delete both halves
of a surrogate pair. This behaviour differs from legacy apps, where a
single backspace is usually sufficient to delete both characters.

Truly ancient apps that do not know about Unicode surrogate pairs are
not going to delete both halves with a single backspace event.
Fortunately, these are few and far between; we would handle them on a
case-by-case basis if support questions for them arise.

When we come to integrating Keyman Core into Keyman for Windows, there
will need to be some careful checking of surrogate pair support, as it
is likely that the handling will need to change.
2021-01-28 07:37:05 +11:00
Marc Durdin
b4fdc0920a fix(windows): context mismatch with if and dk
Fixes #4275.
2021-01-18 10:23:44 +11:00
Marc Durdin
dce865ed4e fix(developer): Allow unhandled keys to go through to debugger memo
Fixes #2690.
Fixes #3082.

In the debugger, key events such as Enter, Ctrl+C, Ctrl+V were being
swallowed by the debug engine if they did not have rules within the
keyboard. This change emits the key events so the debug memo can
process them normally.
2020-12-23 15:30:56 +11:00
Marc Durdin
0406cb1381 fix(windows): coverity reports for keyman32 2020-10-02 14:54:43 +10:00
Marc Durdin
d5790ca9b6 fix(windows): cleanup pointer to int typecasts
Fixes #3084.

This does two things:

1. Cleans up a bunch of places where we used to use `(int)` typecasts
   for pointer math, which was problematic. We now use `(INT_PTR)` per
   MSDN https://docs.microsoft.com/en-us/windows/win32/winprog64/rules-for-using-pointers
   and then cast that down to `(int)` where necessary, e.g. when storing
   string lengths which are never going to be more than a few hundred
   characters! Doing this explicitly helps to clarify that we are aware
   of the typecast and believe it to be safe.

2. Adds in some build infrastructure for future use of Coverity Scan
   https://scan.coverity.com/ which we plan to use for further code
   quality updates. I have submitted the project to Coverity and are
   now waiting for approval so we can check results. Once we have
   approval, I do plan to add this to the nightly build (we need to
   keep submissions under 3 builds/day).

   Note: I have not yet added Keyman Core (Windows) to this project,
   nor are we currently building Keyman Core (macOS) or Keyman for
   Linux, but we should consider adding those in future.
2020-09-24 14:39:59 +10:00