A redesign of popover was needed: it can no longer query the application state directly due to current state being its own actor, so instead the popover gets a dedicated copy of the relevant state.
I'm not entirely happy with the extra complexity of having an extra actor just for 1 string, but at least the duplication between C and Rust and mutual calls have been reduced.
This ensures that the new state machine is fed events, as well as that its results are applied.
The old ad-hoc system is removed.
There is one regression where the last layout will be used when the panel is brought up manually.
Handling visibility state ad-hoc has shortcomings in testability and locality, and this module attmepts to rectify that by creating an explicit state machine, along with a loop to drive it.
Actually applying state is not implemented here.
The manager is used for sizing the layer surface. It promises never to exceed half the output height.
The selection of the current layout is not being done here, leading to worse behaviour in 1:1 scaling.
In the future, it could be used for sizing the keyboard itself and the suggestion box, as well as decide which layout to use, because layouts should have some sizing hints.
In order to do that, an additional piece of state (layout switcher) was exposed to the event handlers, a separation between squeekboard-only and system layouts was introduced, along with a Translation structure to prevent mixing up strings.
Moved Cairo context usage to Rust, and rearranged ctx setup (position) to happen in one place.
Removed render calls that were overwritten on each draw call anyway.
Dedicated styling is now possible for themes which have a corresponding style-theme.css file. Adwaita:dark gets one, whereas other themes use the new generic fallback theme.
Pulled in some Unix-specific code from https://github.com/rust-locale/locale_config to reduce dependencies.
First reason to reduce dependencies: gettext-rs is not in Debian. Copying gettext-sys might have made sense, but the interface is somewhat confusing.
For translating a couple identifiers, detection and some hand-rolled hash map is all that is needed, and the option to move to gettext later remains.
locale_config has been stripped of the lazy_static dependency, which, messing with the strtup sequence, might be a source of debugging woes. Plus setting language once in the beginning is somewhat inflexible regarding runtime changes.
This fixes some rendering things which would happen with multiple state-sharing buttons. It also removes some interfaces exposing rows, views, layouts, and buttons, bringing the code closer to removing them from the FFI entirely.
WIP
WIP: keymap generation test passes
meta: Update features and version
WiP: cargo.lock
WIP: don't crash
WIP: no outlines
parsing: New tests
WIP: base level works
WIP: remove old keyboard
symbols correctly input
WIP: lodaing files
WIP: fallback works
Valid fallback
Each Button has a KeyState, which may be shared with other buttons. The list of pressed and locked buttons is used as a list of keys, causing a search for the button in the current view.
The new `lib.rs` file is created to refer to all modules written in Rust. This way, only one `rustc` call is needed to compile an arbitrary amount of modules. It also converges with the way crates are structured.