Commit graph

634 commits

Author SHA1 Message Date
Marc Durdin
ca098628a2 chore(core): verify StartGroup in kmx load
This is the first baby step in good verification of a .kmx file. A place
to add more tests.

@keymanapp-test-bot skip
2022-09-12 10:31:40 +10:00
Marc Durdin
89ccc393ab chore: make checksum optional
Fixes #7222.
2022-09-09 17:23:07 +10:00
Marc Durdin
b6c4e21c1d chore(developer): remove name from meta section
Fixes #7214.
2022-09-09 08:57:52 +10: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
82443a610d
fix(core): ldml Update core/src/kmx/kmx_plus.h
Co-authored-by: Marc Durdin <marc@durdin.net>
2022-09-08 12:04:04 -05:00
Steven R. Loomis
029a2737bf fix(core): ldml: improve utf-32 handling++ 🙀
- review comments
- kmx_xstring: add and document macros, add Utf32CharToUtf16
- unit tests for kmx_xstring macros

Fixes: #7134
2022-09-08 11:45:23 -05:00
Steven R. Loomis
7a71ed84cc fix(core): ldml: improve utf-32 handling 🙀
- remove hacky utf-32 processing
- add utf-32 test case to test_kmx_plus.cpp
- change kmx_plus to return std::u16string
- kmx_xstring: add Uni_IsBMP() macro

Fixes: #7134
2022-09-07 18:08:26 -05:00
Marc Durdin
ec5a83a3fa
Merge pull request #7204 from keymanapp/feat/core/ldml-transform-table-specs-and-constants
feat(core): ldml keyboard transform elements 🙀
2022-09-07 11:28:42 +10:00
Marc Durdin
2e7aef39e7
Merge pull request #7197 from keymanapp/chore/core/section-order
chore(core): order sections according to binary format 🙀
2022-09-07 11:27:54 +10:00
Marc Durdin
5e1d898527
Merge pull request #7196 from keymanapp/feat/core/ldml-name-section
feat(core): add 'name' section 🙀
2022-09-07 11:27:46 +10:00
Marc Durdin
f1b2be168f
Merge pull request #7193 from keymanapp/chore/core/kmxplus-zero-length-string
chore(core): define zero length string vs null string for kmxplus 🙀
2022-09-07 11:27:30 +10:00
Marc Durdin
8678a0d35b chore(core): mark unused parameters 2022-09-07 10:36:35 +10:00
Marc Durdin
5104914672 feat(core): add km_kbp_event API endpoint
Adds infrastructure required to support caps lock control on keyboard
activation per #5822.

Keyboardprocessor implementation is currently a stub, and engines will
need corresponding updates to support the new API.
2022-09-07 10:24:01 +10:00
Marc Durdin
690290bdfe
chore(core): add comment for KMXPLUS_STR
Co-authored-by: Steven R. Loomis <srl295@gmail.com>
2022-09-07 08:14:23 +10:00
Marc Durdin
9f5f8e976e feat(core): ldml keyboard transform elements
Adds definitions for LDML keyboard transform elements `transforms`,
`backspaces`, and `reorders`, and the binary format sections `bksp`,
`elem`, `finl`, `ordr`, and `tran`.

Minimally updates the compiler so that it will build, but no other
changes to the compiler.

Compiler and Typescript updates to support building these sections will
come in the next PR.
2022-09-05 13:11:51 +10:00
Marc Durdin
ea6bd8f09f chore(core): order sections according to binary format
Just reorders all work around the various sections to match the binary
format order -- that is, 'sect' first, then all other sections
alphabetically.

This also means the compiler now emits the sections in the expected
order.

No other changes to functionality.
2022-09-04 06:10:34 +10:00
Marc Durdin
b17805df3a feat(core): add 'name' section
Updates compiler, headers and documentation for the 'name' section,
which will always be present as the LDML keyboard spec requires at least
one name in the `<names>` element.
2022-09-04 05:45:43 +10:00
Marc Durdin
a274a44979 chore(core): wrap text on C7043_ldml.md 2022-09-03 06:12:36 +10:00
Marc Durdin
aef38f12df chore(core): define zero length string vs null string for kmxplus 2022-09-03 06:11:24 +10:00
Marc Durdin
702db90a71 feat(core): add version field to meta
Also adds semver package for validating the version field.
2022-09-02 14:13:10 +10:00
Steven R. Loomis
f3f498e923 fix(core): fix validators 🙀
- copy over asserts from 'old' code

#7136
2022-08-31 17:37:55 -05:00
Steven R. Loomis
3684cc43d0 fix(core): fix validators 🙀
yes, a kmxplus file does not start with a 'sect' !

#7136
2022-08-31 17:37:55 -05:00
Steven R. Loomis
90be01385b chore(core): split out validators 🙀
#7136
2022-08-31 17:37:55 -05:00
Steven R. Loomis
bef0013bf8 feat(core): set -DDEBUG for debug 🙀
- set -DDEBUG for 'debug' meson builds
- default KXPLUS_DEBUG  to 1 for -DDEBUG

#7136
2022-08-30 11:49:22 -05:00
Marc Durdin
91283464ca
Merge pull request #7150 from keymanapp/chore/merge-master-feature-ldml
chore: merge master into feature-ldml 🙀
2022-08-29 20:52:44 -05:00
Steven R. Loomis
f03abf2ea5
Update core/src/ldml/ldml_processor.cpp
Co-authored-by: Marc Durdin <marc@durdin.net>
2022-08-29 17:23:17 -05:00
Steven R. Loomis
46d7c96823 fix(core): ldml: fix validator 🙀
- allow keys section to exactly fit in data size, as in #7140
2022-08-29 17:16:45 -05:00
Steven R. Loomis
8c65dea9b3
Merge pull request #7132 from keymanapp/feat/core/5015-fileread
feat(core): ldml: improve file reading/validation 🙀
2022-08-29 16:45:56 -05:00
Steven R. Loomis
c03ab40d5d feat(core): ldml: update spec per code review
#7043
2022-08-29 16:41:39 -05:00
Steven R. Loomis
1c7188f9fd
Apply suggestions from code review
Co-authored-by: Marc Durdin <marc@durdin.net>
2022-08-29 16:41:12 -05:00
Marc Durdin
655c872dc8 chore: Merge branch 'master' into chore/merge-master-feature-ldml 2022-08-30 06:31:04 +10:00
Marc Durdin
895ce930a0
Merge pull request #6993 from keymanapp/chore/core/rename-json-source
chore(core): rename json.hpp to jsonpp.hpp 🛩
2022-08-29 14:48:32 -05:00
Marc Durdin
a72146e42d feat(developer): unit test framework for kmldmlc 2022-08-29 17:21:05 +10:00
Steven R. Loomis
791d253528 feat(core): ldml: improve reading 🙀
- read keys into a std::map instead of on the fly
- remove retention of entire kmx file
- remove some functions from kmx_plus.h

#5015
2022-08-26 16:47:20 -05:00
Steven R. Loomis
3de77cda92 feat(core): ldml: improve reading 🙀
- read keys into a std::map instead of on the fly
- no longer retain copy of entire KMX file in read
2022-08-26 16:43:27 -05:00
Steven R. Loomis
892492a634 feat(core): ldml: improve validation 🙀
- clearer asserts
- validate length of data

#5015
2022-08-26 15:45:48 -05:00
Steven R. Loomis
aeeae1c4f4 feat(core): ldml: improve read side 🙀
- don't reparse structs each time
- move validation into constructor
2022-08-26 13:15:05 -05:00
Steven R. Loomis
af3bcd2a15 feat(core): ldml: padding for vkey and loca 🙀
- vkey and loca needed padding before the variable part
- add static asserts to validate this padding
- update sample files (null and tiny)

#7043
2022-08-25 12:54:52 -05:00
Steven R. Loomis
f7aeba5f01 feat(core): ldml: validator for kmxplus 🙀
- also update test case, 002_null_invalid is expected to not validate

#7097
2022-08-25 12:54:08 -05:00
Steven R. Loomis
43b3e3243e fix(core): ldml: emit nothing (no err) on unassigned keys 🙀
- also update test case

#7097
2022-08-25 11:22:19 -05:00
Steven R. Loomis
7aac6a1747 chore(core): update 000_null_keyboard to be a proper null keyboard 🙀
- rewrite 000_null_keyboard.kmx to be valid, but with no keys
- remove outdated comment in kmx_plus.h
- update kmx_plus.cpp to not reverse the order of section ids (#7098)
- add a new test option for expected-error
2022-08-24 17:04:55 -05:00
Steven R. Loomis
b180ca844d fix(core): fixes for kmx_file rearrangement 🙀
fix breaks in #7111 and prior

#7098
2022-08-24 13:49:55 -05:00
Marc Durdin
fa28040643
Merge pull request #7100 from keymanapp/fix/core/7098-cxxfun
fix(core): ldml: remove 0-length arrays 🙀
2022-08-23 23:20:14 -05:00
Marc Durdin
eb48fb76f9
Update core/src/kmx/kmx_plus.cpp 2022-08-24 14:20:08 +10:00
Steven R. Loomis
16b8d725fd fix(core): ldml: include path fix 🙀
#7098
2022-08-23 19:15:20 -05:00
Steven R. Loomis
f8e0abd810 fix(core): ldml: turn off problematic debug 🙀
#7098
2022-08-23 16:37:02 -05:00
Steven R. Loomis
b08f101f37 fix(core): ldml: goodbye multichar strings 🙀
- update builder to print out string as well as hex
- change to symbol name
2022-08-23 16:34:08 -05:00
Marc Durdin
e6ff47f2b3 chore: Merge branch 'master' into feature-ldml 2022-08-24 04:21:21 +10:00
Steven R. Loomis
a31cbc91bf fix(core): ldml: remove 0-length arrays 🙀
- need a pragma to suppress this on MSVC

#7098
2022-08-23 12:40:28 -05:00
Steven R. Loomis
59fc1521dd fix(core): ldml: use nullptr and some other cleanups 🙀
- per review comments

Fixes: #7098
2022-08-23 12:04:57 -05:00