Commit graph

3 commits

Author SHA1 Message Date
Marc Durdin
a160a5c709 chore(developer): move source files to /developer/src 2022-05-18 10:34:48 +10:00
Marc Durdin
3d488c4ead feat(developer): Debugger keyboard options
Fixes #5642.
Relates to #5013.

This adds support for viewing and setting keyboard options in the
debugger. This initial implementation does not have 100% coverage of
keyboard options; specifically:

1. keyboard options are not saved between debug sessions.
2. in single-step debugging, the keyboard options will be shown as
   updated at the start of a keystroke batch, not when the rule which
   calls `set()` is fired. This level of granularity is not currently
   visible from the engine. It does not impact the correctness of the
   rule processing, only the view of the current state of the keyboard
   option.

I do not anticipate supporting either of those functions in 15.0.

This commit renames the existing `TfrmDebugStatus_Options` to
`TfrmDebugStatus_Platform`. I had originally planned to show both the
platform and keyboard options in the same debug status window, but for
space reasons I have split them. (I'm sorry if this makes reading the
PR a little more challenging.)

There is a significant amount of rewriting of kmxfileutils.pas and
debugkeyboard.pas. This extends support for working with kmx files and
modernises the code (e.g. using generics for list types).

Note in particular the `ExpandSentinel` function in kmxfileutils.pas.
This is copied from CompileKeymanWeb.pas but has different internal
references, so cannot be used as-is -- CompileKeymanWeb works with
intermediate object 'files' from the kmx compiler, whereas the debugger
works with final binary .kmx files which have a different in-memory
layout. It may be possible to unify this in future but that would
involve additional risk. (Seriously, I would probably prefer to rewrite
CompileKeymanWeb.pas in C++, Rust or TypeScript than to invest in
merging these two use cases.)
2021-08-27 11:07:00 +10:00
Marc Durdin
63f8137005 refactor(developer): rename and move debugging.pas
Removes a lot of unused functions and one unit. Cleanup for debugging.
2021-08-04 09:44:56 +10:00