-
-
Notifications
You must be signed in to change notification settings - Fork 112
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(core): implement loading KMX from blob 🎼 #12459
Conversation
User Test ResultsTest specification and instructions User tests are not required Test Artifacts
|
95c1b43
to
d2494d5
Compare
e7987ac
to
2cc932d
Compare
- 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
2cc932d
to
d06aa29
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is definitely heading in the right direction, getting close to the abstraction we need for web. I'd like to request that we keep the processor factory responsible for determining which processor is required on the basis of the file type. As Mock and Null processors are used only for test purposes, we are free to do what we want with them, and I suggest we use an empty vector for Null processor, and 'MOCK' at start of vector for a Mock processor.
The question is: do we need this? Is this used anywhere? The only places I could find we directly constructed a Mock processor. Anyways, done. |
This moves instantiating the different processor types back to the `processor_factory` by adding a new `is_handled` static method on the different processors. Also addresses other code review comments. Also add some more unit tests.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! This is a great refactor. Looking forward to seeing the remaining filesystem access disappear soon 😁
core/src/km_core_keyboard_api.cpp
Outdated
} // namespace | ||
|
||
km_core_status | ||
km_core_keyboard_load_from_blob_internal( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This shouldn't have the km_core_
prefix if it is not a public API.
km_core_keyboard_load_from_blob_internal( | |
keyboard_load_from_blob_internal( |
- rename `km_core_keyboard_load_from_blob_internal` to `keyboard_load_from_blob_internal` since it's not part of the API - use size of struct instead of hard-coding minimum KMX file size
7931a4b
to
08d06c3
Compare
08d06c3
to
09f89b6
Compare
09f89b6
to
2f3edd3
Compare
km_core_keyboard_load
Part-of: #11293
@keymanapp-test-bot skip