sizing: Create a standalone UI shape manager

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.
This commit is contained in:
Dorota Czaplejewicz
2020-02-29 14:54:40 +00:00
parent 24f709ab13
commit 3cd170acc3
9 changed files with 185 additions and 60 deletions

View File

@ -98,7 +98,8 @@ pub mod c {
Rc::from_raw(self.0)
}
/// Creates a new Rc reference to the same data
/// Creates a new Rc reference to the same data.
/// Use for accessing the underlying data as a reference.
pub fn clone_ref(&self) -> Rc<RefCell<T>> {
// A bit dangerous: the Rc may be in use elsewhere
let used_rc = unsafe { Rc::from_raw(self.0) };
@ -130,6 +131,7 @@ pub mod c {
impl<T> COpaquePtr for Wrapped<T> {}
}
/// Clones the underlying data structure, like ToOwned.
pub trait CloneOwned {
type Owned;
fn clone_owned(&self) -> Self::Owned;