Compare commits
30 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 1a2df96c02 | |||
| 75ecf9059a | |||
| 5715458d33 | |||
| 8196117269 | |||
| 7fed1339ed | |||
| 0339d13ce4 | |||
| 9f1e49da5d | |||
| c1737c763f | |||
| fe22fc2271 | |||
| f473a47eb8 | |||
| 76bd87686a | |||
| ef85823528 | |||
| 54ac7511cd | |||
| 080bbb4d4e | |||
| 7c35307011 | |||
| cd3255b301 | |||
| f8b6b98633 | |||
| 6414b57e57 | |||
| 2a20bbbf2a | |||
| 13ebf9449f | |||
| fa8449eb1e | |||
| 0bdb5f1f33 | |||
| b631817896 | |||
| 09c78da7a7 | |||
| 7de7dc1b33 | |||
| 323d89e4cb | |||
| 184bdaa0b6 | |||
| 0459d33c4c | |||
| 334898c5a5 | |||
| 67a5f1bb0b |
118
Cargo.lock
generated
118
Cargo.lock
generated
@ -2,10 +2,10 @@
|
||||
# It is not intended for manual editing.
|
||||
[[package]]
|
||||
name = "aho-corasick"
|
||||
version = "0.7.8"
|
||||
version = "0.7.10"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
dependencies = [
|
||||
"memchr 2.3.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"memchr 2.3.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@ -15,7 +15,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
dependencies = [
|
||||
"glib-sys 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"gobject-sys 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"libc 0.2.66 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"libc 0.2.71 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"pkg-config 0.3.17 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
@ -33,7 +33,7 @@ dependencies = [
|
||||
"glib 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"glib-sys 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"gobject-sys 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"libc 0.2.66 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"libc 0.2.71 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@ -44,14 +44,14 @@ dependencies = [
|
||||
"glib 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"glib-sys 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"gobject-sys 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"libc 0.2.66 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"libc 0.2.71 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"pkg-config 0.3.17 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "cc"
|
||||
version = "1.0.50"
|
||||
version = "1.0.54"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
|
||||
[[package]]
|
||||
@ -89,7 +89,7 @@ dependencies = [
|
||||
"glib 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"glib-sys 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"gobject-sys 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"libc 0.2.66 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"libc 0.2.71 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"pango 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
@ -104,7 +104,7 @@ dependencies = [
|
||||
"glib 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"glib-sys 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"gobject-sys 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"libc 0.2.66 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"libc 0.2.71 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@ -115,7 +115,7 @@ dependencies = [
|
||||
"gio-sys 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"glib-sys 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"gobject-sys 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"libc 0.2.66 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"libc 0.2.71 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"pkg-config 0.3.17 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
@ -129,7 +129,7 @@ dependencies = [
|
||||
"gio-sys 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"glib-sys 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"gobject-sys 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"libc 0.2.66 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"libc 0.2.71 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"pango-sys 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"pkg-config 0.3.17 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
@ -146,7 +146,7 @@ dependencies = [
|
||||
"glib-sys 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"gobject-sys 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"libc 0.2.66 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"libc 0.2.71 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@ -156,7 +156,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
dependencies = [
|
||||
"glib-sys 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"gobject-sys 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"libc 0.2.66 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"libc 0.2.71 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"pkg-config 0.3.17 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
@ -169,7 +169,7 @@ dependencies = [
|
||||
"glib-sys 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"gobject-sys 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"libc 0.2.66 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"libc 0.2.71 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@ -177,7 +177,7 @@ name = "glib-sys"
|
||||
version = "0.7.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
dependencies = [
|
||||
"libc 0.2.66 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"libc 0.2.71 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"pkg-config 0.3.17 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
@ -187,7 +187,7 @@ version = "0.7.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
dependencies = [
|
||||
"glib-sys 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"libc 0.2.66 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"libc 0.2.71 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"pkg-config 0.3.17 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
@ -199,7 +199,7 @@ dependencies = [
|
||||
"bitflags 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"cairo-rs 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"cairo-sys-rs 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"cc 1.0.50 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"cc 1.0.54 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"gdk 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"gdk-pixbuf 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"gdk-pixbuf-sys 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
@ -211,7 +211,7 @@ dependencies = [
|
||||
"gobject-sys 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"gtk-sys 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"libc 0.2.66 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"libc 0.2.71 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"pango 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
@ -227,7 +227,7 @@ dependencies = [
|
||||
"gio-sys 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"glib-sys 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"gobject-sys 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"libc 0.2.66 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"libc 0.2.71 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"pango-sys 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"pkg-config 0.3.17 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
@ -239,12 +239,12 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
|
||||
[[package]]
|
||||
name = "libc"
|
||||
version = "0.2.66"
|
||||
version = "0.2.71"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
|
||||
[[package]]
|
||||
name = "linked-hash-map"
|
||||
version = "0.5.2"
|
||||
version = "0.5.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
|
||||
[[package]]
|
||||
@ -254,7 +254,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
|
||||
[[package]]
|
||||
name = "memchr"
|
||||
version = "2.3.2"
|
||||
version = "2.3.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
|
||||
[[package]]
|
||||
@ -262,7 +262,7 @@ name = "memmap"
|
||||
version = "0.7.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
dependencies = [
|
||||
"libc 0.2.66 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"libc 0.2.71 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
@ -276,7 +276,7 @@ dependencies = [
|
||||
"glib-sys 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"gobject-sys 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"libc 0.2.66 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"libc 0.2.71 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"pango-sys 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
@ -287,7 +287,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
dependencies = [
|
||||
"glib-sys 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"gobject-sys 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"libc 0.2.66 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"libc 0.2.71 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"pkg-config 0.3.17 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
@ -298,7 +298,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
|
||||
[[package]]
|
||||
name = "proc-macro2"
|
||||
version = "1.0.8"
|
||||
version = "1.0.18"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
dependencies = [
|
||||
"unicode-xid 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
@ -306,10 +306,10 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "quote"
|
||||
version = "1.0.2"
|
||||
version = "1.0.6"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
dependencies = [
|
||||
"proc-macro2 1.0.8 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"proc-macro2 1.0.18 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@ -317,16 +317,16 @@ name = "regex"
|
||||
version = "1.1.9"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
dependencies = [
|
||||
"aho-corasick 0.7.8 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"memchr 2.3.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"regex-syntax 0.6.14 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"aho-corasick 0.7.10 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"memchr 2.3.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"regex-syntax 0.6.18 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"thread_local 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"utf8-ranges 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "regex-syntax"
|
||||
version = "0.6.14"
|
||||
version = "0.6.18"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
|
||||
[[package]]
|
||||
@ -345,47 +345,47 @@ dependencies = [
|
||||
"gtk-sys 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"maplit 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"regex 1.1.9 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"serde_yaml 0.8.11 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"serde 1.0.111 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"serde_yaml 0.8.12 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"xkbcommon 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "serde"
|
||||
version = "1.0.104"
|
||||
version = "1.0.111"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
dependencies = [
|
||||
"serde_derive 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"serde_derive 1.0.111 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "serde_derive"
|
||||
version = "1.0.104"
|
||||
version = "1.0.111"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
dependencies = [
|
||||
"proc-macro2 1.0.8 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"syn 1.0.14 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"proc-macro2 1.0.18 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"quote 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"syn 1.0.30 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "serde_yaml"
|
||||
version = "0.8.11"
|
||||
version = "0.8.12"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
dependencies = [
|
||||
"dtoa 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"linked-hash-map 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"linked-hash-map 0.5.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"serde 1.0.111 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"yaml-rust 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "syn"
|
||||
version = "1.0.14"
|
||||
version = "1.0.30"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
dependencies = [
|
||||
"proc-macro2 1.0.8 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"proc-macro2 1.0.18 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"quote 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"unicode-xid 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
@ -444,7 +444,7 @@ name = "xkbcommon"
|
||||
version = "0.4.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
dependencies = [
|
||||
"libc 0.2.66 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"libc 0.2.71 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"memmap 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
@ -453,16 +453,16 @@ name = "yaml-rust"
|
||||
version = "0.4.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
dependencies = [
|
||||
"linked-hash-map 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"linked-hash-map 0.5.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[metadata]
|
||||
"checksum aho-corasick 0.7.8 (registry+https://github.com/rust-lang/crates.io-index)" = "743ad5a418686aad3b87fd14c43badd828cf26e214a00f92a384291cf22e1811"
|
||||
"checksum aho-corasick 0.7.10 (registry+https://github.com/rust-lang/crates.io-index)" = "8716408b8bc624ed7f65d223ddb9ac2d044c0547b6fa4b0d554f3a9540496ada"
|
||||
"checksum atk-sys 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "c7017e53393e713212aed7aea336b6553be4927f58c37070a56c2fe3d107e489"
|
||||
"checksum bitflags 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)" = "228047a76f468627ca71776ecdebd732a3423081fcf5125585bcd7c49886ce12"
|
||||
"checksum cairo-rs 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "dd940f0d609699e343ef71c4af5f66423afbf30d666f796dabd8fd15229cf5b6"
|
||||
"checksum cairo-sys-rs 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d25596627380be4381247dba06c69ad05ca21b3b065bd9827e416882ac41dcd2"
|
||||
"checksum cc 1.0.50 (registry+https://github.com/rust-lang/crates.io-index)" = "95e28fa049fda1c330bcf9d723be7663a899c4679724b34c81e9f5a326aab8cd"
|
||||
"checksum cc 1.0.54 (registry+https://github.com/rust-lang/crates.io-index)" = "7bbb73db36c1246e9034e307d0fba23f9a2e251faa47ade70c1bd252220c8311"
|
||||
"checksum clap 2.32.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b957d88f4b6a63b9d70d5f454ac8011819c6efa7727858f458ab71c756ce2d3e"
|
||||
"checksum dtoa 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)" = "4358a9e11b9a09cf52383b451b49a169e8d797b68aa02301ff586d70d9661ea3"
|
||||
"checksum fragile 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "05f8140122fa0d5dcb9fc8627cfce2b37cc1500f752636d46ea28bc26785c2f9"
|
||||
@ -478,22 +478,22 @@ dependencies = [
|
||||
"checksum gtk 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "56a6b30f194f09a17bb7ffa95c3ecdb405abd3b75ff981f831b1f6d18fe115ff"
|
||||
"checksum gtk-sys 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d487d333a4b87072e6bf9f2e55befa0ebef01b9496c2e263c0f4a1ff3d6c04b1"
|
||||
"checksum lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646"
|
||||
"checksum libc 0.2.66 (registry+https://github.com/rust-lang/crates.io-index)" = "d515b1f41455adea1313a4a2ac8a8a477634fbae63cc6100e3aebb207ce61558"
|
||||
"checksum linked-hash-map 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)" = "ae91b68aebc4ddb91978b11a1b02ddd8602a05ec19002801c5666000e05e0f83"
|
||||
"checksum libc 0.2.71 (registry+https://github.com/rust-lang/crates.io-index)" = "9457b06509d27052635f90d6466700c65095fdf75409b3fbdd903e988b886f49"
|
||||
"checksum linked-hash-map 0.5.3 (registry+https://github.com/rust-lang/crates.io-index)" = "8dd5a6d5999d9907cda8ed67bbd137d3af8085216c2ac62de5be860bd41f304a"
|
||||
"checksum maplit 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "3e2e65a1a2e43cfcb47a895c4c8b10d1f4a61097f9f254f183aee60cad9c651d"
|
||||
"checksum memchr 2.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "53445de381a1f436797497c61d851644d0e8e88e6140f22872ad33a704933978"
|
||||
"checksum memchr 2.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "3728d817d99e5ac407411fa471ff9800a778d88a24685968b36824eaf4bee400"
|
||||
"checksum memmap 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "6585fd95e7bb50d6cc31e20d4cf9afb4e2ba16c5846fc76793f11218da9c475b"
|
||||
"checksum pango 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "4c2cb169402a3eb1ba034a7cc7d95b8b1c106e9be5ba4be79a5a93dc1a2795f4"
|
||||
"checksum pango-sys 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d6eb49268e69dd0c1da5d3001a61aac08e2e9d2bfbe4ae4b19b9963c998f6453"
|
||||
"checksum pkg-config 0.3.17 (registry+https://github.com/rust-lang/crates.io-index)" = "05da548ad6865900e60eaba7f589cc0783590a92e940c26953ff81ddbab2d677"
|
||||
"checksum proc-macro2 1.0.8 (registry+https://github.com/rust-lang/crates.io-index)" = "3acb317c6ff86a4e579dfa00fc5e6cca91ecbb4e7eb2df0468805b674eb88548"
|
||||
"checksum quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "053a8c8bcc71fcce321828dc897a98ab9760bef03a4fc36693c231e5b3216cfe"
|
||||
"checksum proc-macro2 1.0.18 (registry+https://github.com/rust-lang/crates.io-index)" = "beae6331a816b1f65d04c45b078fd8e6c93e8071771f41b8163255bbd8d7c8fa"
|
||||
"checksum quote 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)" = "54a21852a652ad6f610c9510194f398ff6f8692e334fd1145fed931f7fbe44ea"
|
||||
"checksum regex 1.1.9 (registry+https://github.com/rust-lang/crates.io-index)" = "d9d8297cc20bbb6184f8b45ff61c8ee6a9ac56c156cec8e38c3e5084773c44ad"
|
||||
"checksum regex-syntax 0.6.14 (registry+https://github.com/rust-lang/crates.io-index)" = "b28dfe3fe9badec5dbf0a79a9cccad2cfc2ab5484bdb3e44cbd1ae8b3ba2be06"
|
||||
"checksum serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)" = "414115f25f818d7dfccec8ee535d76949ae78584fc4f79a6f45a904bf8ab4449"
|
||||
"checksum serde_derive 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)" = "128f9e303a5a29922045a830221b8f78ec74a5f544944f3d5984f8ec3895ef64"
|
||||
"checksum serde_yaml 0.8.11 (registry+https://github.com/rust-lang/crates.io-index)" = "691b17f19fc1ec9d94ec0b5864859290dff279dbd7b03f017afda54eb36c3c35"
|
||||
"checksum syn 1.0.14 (registry+https://github.com/rust-lang/crates.io-index)" = "af6f3550d8dff9ef7dc34d384ac6f107e5d31c8f57d9f28e0081503f547ac8f5"
|
||||
"checksum regex-syntax 0.6.18 (registry+https://github.com/rust-lang/crates.io-index)" = "26412eb97c6b088a6997e05f69403a802a92d520de2f8e63c2b65f9e0f47c4e8"
|
||||
"checksum serde 1.0.111 (registry+https://github.com/rust-lang/crates.io-index)" = "c9124df5b40cbd380080b2cc6ab894c040a3070d995f5c9dc77e18c34a8ae37d"
|
||||
"checksum serde_derive 1.0.111 (registry+https://github.com/rust-lang/crates.io-index)" = "3f2c3ac8e6ca1e9c80b8be1023940162bf81ae3cffbb1809474152f2ce1eb250"
|
||||
"checksum serde_yaml 0.8.12 (registry+https://github.com/rust-lang/crates.io-index)" = "16c7a592a1ec97c9c1c68d75b6e537dcbf60c7618e038e7841e00af1d9ccf0c4"
|
||||
"checksum syn 1.0.30 (registry+https://github.com/rust-lang/crates.io-index)" = "93a56fabc59dce20fe48b6c832cc249c713e7ed88fa28b0ee0a3bfcaae5fe4e2"
|
||||
"checksum textwrap 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)" = "307686869c93e71f94da64286f9a9524c0f308a9e1c87a583de8e9c9039ad3f6"
|
||||
"checksum thread_local 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)" = "c6b53e329000edc2b34dbe8545fd20e55a333362d0a321909685a19bd28c3f1b"
|
||||
"checksum unicode-width 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)" = "caaa9d531767d1ff2150b9332433f32a24622147e5ebb1f26409d5da67afd479"
|
||||
|
||||
@ -56,4 +56,4 @@ $ src/squeekboard
|
||||
Developing
|
||||
----------
|
||||
|
||||
See [`docs/hacking.md`](docs/hacking.md) for this copy, or the [official documentation](https://developer.puri.sm/projects/squeekboard/) for the current release.
|
||||
See [`doc/hacking.md`](doc/hacking.md) for this copy, or the [official documentation](https://developer.puri.sm/projects/squeekboard/) for the current release.
|
||||
|
||||
98
data/keyboards/dk.yaml
Normal file
98
data/keyboards/dk.yaml
Normal file
@ -0,0 +1,98 @@
|
||||
---
|
||||
outlines:
|
||||
default: { width: 32, height: 52 }
|
||||
altline: { width: 48.39024, height: 52 }
|
||||
wide: { width: 62, height: 52 }
|
||||
outline7: { width: 88.97561, height: 52 }
|
||||
spaceline: { width: 150.5853, height: 52 }
|
||||
|
||||
views:
|
||||
base:
|
||||
- "q w e r t y u i o p å"
|
||||
- "a s d f g h j k l ø æ"
|
||||
- "Shift_L z x c v b n m BackSpace"
|
||||
- "show_numbers preferences space . Return"
|
||||
upper:
|
||||
- "Q W E R T Y U I O P Å"
|
||||
- "A S D F G H J K L Ø Æ"
|
||||
- "Shift_L Z X C V B N M BackSpace"
|
||||
- "show_numbers preferences space . Return"
|
||||
numbers:
|
||||
- "1 2 3 4 5 6 7 8 9 0"
|
||||
- "@ # $ % & - _ + ( )"
|
||||
- "show_symbols , \" ' : ; ! ? BackSpace"
|
||||
- "show_letters preferences space . Return"
|
||||
symbols:
|
||||
- "~ ` | U00B7 squareroot Greek_pi Greek_tau division multiply paragraph"
|
||||
- "copyright U00AE U00A3 EuroSign U00A5 asciicircum degree * { }"
|
||||
- "show_numbers \\ / < > = [ ] BackSpace"
|
||||
- "show_letters preferences space . Return"
|
||||
|
||||
buttons:
|
||||
Shift_L:
|
||||
action:
|
||||
locking:
|
||||
lock_view: "upper"
|
||||
unlock_view: "base"
|
||||
outline: "altline"
|
||||
icon: "key-shift"
|
||||
BackSpace:
|
||||
outline: "altline"
|
||||
icon: "edit-clear-symbolic"
|
||||
action: erase
|
||||
preferences:
|
||||
action: "show_prefs"
|
||||
outline: "altline"
|
||||
icon: "keyboard-mode-symbolic"
|
||||
show_numbers:
|
||||
action:
|
||||
set_view: "numbers"
|
||||
outline: "altline"
|
||||
label: "123"
|
||||
show_letters:
|
||||
action:
|
||||
set_view: "base"
|
||||
outline: "altline"
|
||||
label: "ABC"
|
||||
show_symbols:
|
||||
action:
|
||||
set_view: "symbols"
|
||||
outline: "altline"
|
||||
label: "*/="
|
||||
".":
|
||||
outline: altline
|
||||
space:
|
||||
outline: spaceline
|
||||
text: " "
|
||||
Return:
|
||||
outline: "wide"
|
||||
icon: "key-enter"
|
||||
keysym: "Return"
|
||||
U00B7:
|
||||
text: "·"
|
||||
squareroot:
|
||||
text: "√"
|
||||
Greek_pi:
|
||||
text: "π"
|
||||
division:
|
||||
text: "÷"
|
||||
multiply:
|
||||
text: "×"
|
||||
paragraph:
|
||||
text: "¶"
|
||||
Greek_tau:
|
||||
text: "τ"
|
||||
copyright:
|
||||
text: "©"
|
||||
U00AE:
|
||||
text: "®"
|
||||
U00A3:
|
||||
text: "£"
|
||||
EuroSign:
|
||||
text: "€"
|
||||
U00A5:
|
||||
text: "¥"
|
||||
asciicircum:
|
||||
text: "^"
|
||||
degree:
|
||||
text: "°"
|
||||
89
data/keyboards/fr.yaml
Normal file
89
data/keyboards/fr.yaml
Normal file
@ -0,0 +1,89 @@
|
||||
---
|
||||
outlines:
|
||||
default: { width: 35.33, height: 52 }
|
||||
altline: { width: 52.67, height: 52 }
|
||||
wide: { width: 59, height: 52 }
|
||||
spaceline: { width: 140, height: 52 }
|
||||
special: { width: 44, height: 52 }
|
||||
|
||||
views:
|
||||
base:
|
||||
- "a z e r t y u i o p"
|
||||
- "q s d f g h j k l m"
|
||||
- "Shift_L w x c v b n . BackSpace"
|
||||
- "show_numbers preferences space show_eschars Return"
|
||||
upper:
|
||||
- "A Z E R T Y U I O P"
|
||||
- "Q S D F G H J K L M"
|
||||
- "Shift_L W X C V B N , BackSpace"
|
||||
- "show_numbers preferences space show_eschars Return"
|
||||
numbers:
|
||||
- "1 2 3 4 5 6 7 8 9 0"
|
||||
- "@ # € % & - _ + ( )"
|
||||
- "show_symbols , \" ' colon ; ! ? BackSpace"
|
||||
- "show_letters preferences space show_eschars Return"
|
||||
symbols:
|
||||
- "~ ` | · √ π τ ÷ × ¶"
|
||||
- "© ® £ $ ¥ ^ ° * { }"
|
||||
- "show_numbers_from_symbols \\ / < > = [ ] BackSpace"
|
||||
- "show_letters preferences space show_eschars Return"
|
||||
eschars:
|
||||
- "à â ç é è ê î ô ù û"
|
||||
- "À Â Ç É È Ê Î Ô Ù Û"
|
||||
- "show_numbers_from_symbols æ œ ä ë ï ö ü BackSpace"
|
||||
- "show_letters preferences space show_eschars Return"
|
||||
|
||||
buttons:
|
||||
Shift_L:
|
||||
action:
|
||||
locking:
|
||||
lock_view: "upper"
|
||||
unlock_view: "base"
|
||||
outline: "altline"
|
||||
icon: "key-shift"
|
||||
BackSpace:
|
||||
outline: "altline"
|
||||
icon: "edit-clear-symbolic"
|
||||
action: erase
|
||||
preferences:
|
||||
action: "show_prefs"
|
||||
outline: "special"
|
||||
icon: "keyboard-mode-symbolic"
|
||||
show_numbers:
|
||||
action:
|
||||
set_view: "numbers"
|
||||
outline: "wide"
|
||||
label: "123"
|
||||
show_numbers_from_symbols:
|
||||
action:
|
||||
set_view: "numbers"
|
||||
outline: "altline"
|
||||
label: "123"
|
||||
show_letters:
|
||||
action:
|
||||
set_view: "base"
|
||||
outline: "wide"
|
||||
label: "abc"
|
||||
show_symbols:
|
||||
action:
|
||||
set_view: "symbols"
|
||||
outline: "altline"
|
||||
label: "*/="
|
||||
show_eschars:
|
||||
action:
|
||||
locking:
|
||||
lock_view: "eschars"
|
||||
unlock_view: "base"
|
||||
outline: "altline"
|
||||
label: "âÂ"
|
||||
space:
|
||||
outline: "spaceline"
|
||||
text: " "
|
||||
Return:
|
||||
outline: "wide"
|
||||
icon: "key-enter"
|
||||
keysym: "Return"
|
||||
colon:
|
||||
text: ":"
|
||||
"\"":
|
||||
keysym: "quotedbl"
|
||||
94
data/keyboards/ru.yaml
Normal file
94
data/keyboards/ru.yaml
Normal file
@ -0,0 +1,94 @@
|
||||
---
|
||||
outlines:
|
||||
default: { width: 32, height: 52 }
|
||||
altline: { width: 32, height: 52 }
|
||||
wide: { width: 57, height: 52 }
|
||||
narrow: { width: 26, height: 52 }
|
||||
spaceline: { width: 107, height: 52 }
|
||||
fill: { width: 159, height: 52 }
|
||||
special: { width: 42, height: 52 }
|
||||
|
||||
views:
|
||||
base:
|
||||
- "й ц у к е н г ш щ з х"
|
||||
- "ф ы в а п р о л д ж э"
|
||||
- "Shift_L я ч с м и т ь б ю BackSpace"
|
||||
- "show_numbers preferences ё space ъ period Return"
|
||||
upper:
|
||||
- "Й Ц У К Е Н Г Ш Щ З Х"
|
||||
- "Ф Ы В А П Р О Л Д Ж Э"
|
||||
- "Shift_L Я Ч С М И Т Ь Б Ю BackSpace"
|
||||
- "show_numbers preferences Ё space Ъ comma Return"
|
||||
numbers:
|
||||
- "1 2 3 4 5 6 7 8 9 0"
|
||||
- "@ # $ % & - _ + ( )"
|
||||
- "show_symbols , \" ' colon ; ! ? BackSpace"
|
||||
- "show_letters preferences space_fill period Return"
|
||||
symbols:
|
||||
- "~ ` | · √ π τ ÷ × ¶"
|
||||
- "© ® £ € ¥ ^ ° * { }"
|
||||
- "show_numbers_from_symbols \\ / < > = [ ] BackSpace"
|
||||
- "show_letters preferences space_fill period Return"
|
||||
|
||||
buttons:
|
||||
Shift_L:
|
||||
action:
|
||||
locking:
|
||||
lock_view: "upper"
|
||||
unlock_view: "base"
|
||||
outline: "altline"
|
||||
icon: "key-shift"
|
||||
BackSpace:
|
||||
outline: "altline"
|
||||
icon: "edit-clear-symbolic"
|
||||
action: erase
|
||||
preferences:
|
||||
action: show_prefs
|
||||
outline: "special"
|
||||
icon: "keyboard-mode-symbolic"
|
||||
show_numbers:
|
||||
action:
|
||||
set_view: "numbers"
|
||||
outline: "wide"
|
||||
label: "123"
|
||||
show_numbers_from_symbols:
|
||||
action:
|
||||
set_view: "numbers"
|
||||
outline: "wide"
|
||||
label: "123"
|
||||
show_letters:
|
||||
action:
|
||||
set_view: "base"
|
||||
outline: "wide"
|
||||
label: "АБВ"
|
||||
show_symbols:
|
||||
action:
|
||||
set_view: "symbols"
|
||||
outline: "wide"
|
||||
label: "*/="
|
||||
period:
|
||||
outline: "special"
|
||||
text: "."
|
||||
comma:
|
||||
outline: "special"
|
||||
text: ","
|
||||
space:
|
||||
outline: "spaceline"
|
||||
text: " "
|
||||
space_fill:
|
||||
outline: "fill"
|
||||
text: " "
|
||||
Return:
|
||||
outline: "wide"
|
||||
icon: "key-enter"
|
||||
keysym: "Return"
|
||||
colon:
|
||||
text: ":"
|
||||
ё:
|
||||
outline: "narrow"
|
||||
Ё:
|
||||
outline: "narrow"
|
||||
ъ:
|
||||
outline: "narrow"
|
||||
Ъ:
|
||||
outline: "narrow"
|
||||
@ -2,9 +2,10 @@
|
||||
outlines:
|
||||
default: { width: 32, height: 52 }
|
||||
altline: { width: 48.39024, height: 52 }
|
||||
wide: { width: 62, height: 52 }
|
||||
outline7: { width: 88.97561, height: 52 }
|
||||
spaceline: { width: 150.5853, height: 52 }
|
||||
wide: { width: 64, height: 52 }
|
||||
spaceline: { width: 142, height: 52 }
|
||||
special: { width: 44, height: 52 }
|
||||
|
||||
|
||||
views:
|
||||
base:
|
||||
@ -25,7 +26,7 @@ views:
|
||||
symbols:
|
||||
- "asciitilde quoteleft bar U00B7 squareroot Greek_pi Greek_tau division multiply paragraph"
|
||||
- "copyright U00AE U00A3 EuroSign U00A5 asciicircum degree asterisk braceleft braceright"
|
||||
- "show_numbers backslash slash less greater equal bracketleft bracketright BackSpace"
|
||||
- "show_numbers_from_symbols backslash slash less greater equal bracketleft bracketright BackSpace"
|
||||
- "show_letters preferences space . Return"
|
||||
|
||||
buttons:
|
||||
@ -37,22 +38,27 @@ buttons:
|
||||
outline: "altline"
|
||||
icon: "key-shift"
|
||||
BackSpace:
|
||||
outline: "altline"
|
||||
outline: altline
|
||||
icon: "edit-clear-symbolic"
|
||||
action: erase
|
||||
preferences:
|
||||
action: "show_prefs"
|
||||
outline: "altline"
|
||||
outline: "special"
|
||||
icon: "keyboard-mode-symbolic"
|
||||
show_numbers:
|
||||
outline: "wide"
|
||||
action:
|
||||
set_view: "numbers"
|
||||
outline: "altline"
|
||||
label: "123"
|
||||
show_numbers_from_symbols:
|
||||
action:
|
||||
set_view: "numbers"
|
||||
outline: altline
|
||||
label: "123"
|
||||
show_letters:
|
||||
outline: "wide"
|
||||
action:
|
||||
set_view: "base"
|
||||
outline: "altline"
|
||||
label: "ABC"
|
||||
show_symbols:
|
||||
action:
|
||||
@ -60,7 +66,7 @@ buttons:
|
||||
outline: "altline"
|
||||
label: "*/="
|
||||
".":
|
||||
outline: altline
|
||||
outline: "special"
|
||||
space:
|
||||
outline: spaceline
|
||||
text: " "
|
||||
@ -156,4 +162,3 @@ buttons:
|
||||
text: "["
|
||||
bracketright:
|
||||
text: "]"
|
||||
|
||||
|
||||
11
data/langs/ru-RU.txt
Normal file
11
data/langs/ru-RU.txt
Normal file
@ -0,0 +1,11 @@
|
||||
de Немецкий
|
||||
es Испанский
|
||||
fi Финский
|
||||
gr Греческий
|
||||
it Итальянский
|
||||
no Норвежский
|
||||
pl Польский
|
||||
ru Русский
|
||||
se Шведский
|
||||
terminal Терминал
|
||||
us Английский (США)
|
||||
@ -7,13 +7,20 @@ squeekboard_resources = gnome.compile_resources(
|
||||
c_name: 'squeekboard',
|
||||
)
|
||||
|
||||
desktopconf = configuration_data()
|
||||
desktopconf.set('bindir', bindir)
|
||||
|
||||
desktop_file = 'sm.puri.Squeekboard.desktop'
|
||||
|
||||
i18n.merge_file('desktop',
|
||||
input: desktop_file + '.in',
|
||||
input: configure_file(
|
||||
input: desktop_file + '.in.in',
|
||||
output: desktop_file + '.in',
|
||||
configuration: desktopconf
|
||||
),
|
||||
output: desktop_file,
|
||||
po_dir: '../po',
|
||||
install: true,
|
||||
install_dir: join_paths(datadir, 'applications'),
|
||||
install_dir: desktopdir,
|
||||
type: 'desktop'
|
||||
)
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
Name=Squeekboard
|
||||
GenericName=Squeekboard Virtual Keyboard
|
||||
Comment=Virtual Keyboard
|
||||
Exec=squeekboard
|
||||
Exec=@bindir@/squeekboard
|
||||
Terminal=false
|
||||
Type=Application
|
||||
NoDisplay=true
|
||||
70
debian/changelog
vendored
70
debian/changelog
vendored
@ -1,3 +1,73 @@
|
||||
squeekboard (1.9.2) amber-phone; urgency=medium
|
||||
|
||||
[ Dorota Czaplejewicz ]
|
||||
* keyboard: Remove unused code
|
||||
* gsettings: Don't crash when unavailable
|
||||
* dbus: Don't crash if can't make a connection
|
||||
* gsettings: Don't crash on switching when unavailable
|
||||
* layout: Split out choice to a struct on its own
|
||||
* renderer: Simplify by dropping gobjectness
|
||||
* levelkeyboard: Rearrange to make future conversion easier
|
||||
* layout: Minor generalizations
|
||||
* Remove unused code
|
||||
* sizing: Create a standalone UI shape manager
|
||||
* sizing: Ignore scaling factor for layout selection
|
||||
* CI: Fix typo
|
||||
* Update rust deps for release
|
||||
|
||||
[ Andreas Rönnquist ]
|
||||
* Swedish keyboard, wide button switching between numbers, symbols and base
|
||||
* More fixes of button sizes
|
||||
* Folder is doc, not docs
|
||||
|
||||
[ uzanto ]
|
||||
* Add new file
|
||||
* Replace duplicated show_symbols by show_eschars and removed "Delete" button that it's doing nothing
|
||||
|
||||
[ Arnaud Ferraris ]
|
||||
* keyboards: fr: fix keyboard layout
|
||||
* keyboards: fr: make sure the layout fits the screen
|
||||
* resources: include French keyboard layout
|
||||
* keyboards: fr: improve consistency with other layouts
|
||||
* keyboards: fr: improve diacritics layout
|
||||
* tests: add french layout
|
||||
|
||||
[ Vlad ]
|
||||
* Fresh Russian layout
|
||||
|
||||
[ Jordi Masip ]
|
||||
* Removed unused dependency 'libcroco'
|
||||
|
||||
[ Florian Klink ]
|
||||
* sm.puri.Squeekboard.desktop: make path to Exec= absolute
|
||||
|
||||
[ Ole Guldberg ]
|
||||
* Danish keyboard layout
|
||||
* Danish keyboard layout
|
||||
* add test for danish layout
|
||||
|
||||
-- Dorota Czaplejewicz <dorota.czaplejewicz@puri.sm> Mon, 01 Jun 2020 09:39:12 +0000
|
||||
|
||||
squeekboard (1.9.1) amber-phone; urgency=medium
|
||||
|
||||
[ Dorota Czaplejewicz ]
|
||||
* layout: Improve press handling
|
||||
* settings: Handle empty settings
|
||||
* Variant: Use proper pointer conversion between C and Rust
|
||||
* meta: Add doap file
|
||||
* modifiers: Support Control and Alt
|
||||
* CI: Test that any bump to changelog has a corresponding tag
|
||||
* docs: Add the guiding principle
|
||||
* hacking: Move into docs/
|
||||
|
||||
[ &t ]
|
||||
* Fix minor comment typos
|
||||
|
||||
[ Dorota Czaplejewicz ]
|
||||
* cargo: Bump package versions before release
|
||||
|
||||
-- Dorota Czaplejewicz <dorota.czaplejewicz@puri.sm> Sun, 08 Mar 2020 10:04:29 +0000
|
||||
|
||||
squeekboard (1.9.0) amber-phone; urgency=medium
|
||||
|
||||
[ Dorota Czaplejewicz ]
|
||||
|
||||
1
debian/control
vendored
1
debian/control
vendored
@ -11,7 +11,6 @@ Build-Depends:
|
||||
libglib2.0-dev,
|
||||
libgnome-desktop-3-dev,
|
||||
libgtk-3-dev,
|
||||
libcroco3-dev,
|
||||
librust-bitflags-1-dev (>= 1.0),
|
||||
librust-clap-2+default-dev (>= 2.32),
|
||||
librust-gio+v2-44-dev,
|
||||
|
||||
@ -45,7 +45,7 @@
|
||||
typedef struct _EekGtkKeyboardPrivate
|
||||
{
|
||||
EekRenderer *renderer; // owned, nullable
|
||||
LayoutHolder *eekboard_context; // unowned reference
|
||||
EekboardContextService *eekboard_context; // unowned reference
|
||||
struct submission *submission; // unowned reference
|
||||
|
||||
struct squeek_layout_state *layout; // unowned
|
||||
@ -124,10 +124,9 @@ eek_gtk_keyboard_real_size_allocate (GtkWidget *self,
|
||||
(uint32_t)(allocation->width - allocation->x) * scale,
|
||||
(uint32_t)(allocation->height - allocation->y) * scale);
|
||||
if (priv->layout->arrangement != new_type) {
|
||||
struct squeek_layout_state layout = *priv->layout;
|
||||
layout.arrangement = new_type;
|
||||
priv->layout->arrangement = new_type;
|
||||
|
||||
eek_layout_holder_use_layout(priv->eekboard_context, &layout);
|
||||
eekboard_context_service_use_layout(priv->eekboard_context, priv->layout);
|
||||
}
|
||||
|
||||
if (priv->renderer)
|
||||
@ -159,7 +158,7 @@ static void drag(EekGtkKeyboard *self,
|
||||
if (!priv->keyboard) {
|
||||
return;
|
||||
}
|
||||
squeek_layout_drag(eek_layout_holder_get_keyboard(priv->eekboard_context)->layout,
|
||||
squeek_layout_drag(eekboard_context_service_get_keyboard(priv->eekboard_context)->layout,
|
||||
priv->submission,
|
||||
x, y, eek_renderer_get_transformation(priv->renderer), time,
|
||||
priv->eekboard_context, self);
|
||||
@ -171,7 +170,7 @@ static void release(EekGtkKeyboard *self, guint32 time)
|
||||
if (!priv->keyboard) {
|
||||
return;
|
||||
}
|
||||
squeek_layout_release(eek_layout_holder_get_keyboard(priv->eekboard_context)->layout,
|
||||
squeek_layout_release(eekboard_context_service_get_keyboard(priv->eekboard_context)->layout,
|
||||
priv->submission,
|
||||
eek_renderer_get_transformation(priv->renderer), time,
|
||||
priv->eekboard_context, self);
|
||||
@ -344,7 +343,7 @@ on_notify_keyboard (GObject *object,
|
||||
EekGtkKeyboard *self) {
|
||||
(void)spec;
|
||||
EekGtkKeyboardPrivate *priv = (EekGtkKeyboardPrivate*)eek_gtk_keyboard_get_instance_private (self);
|
||||
priv->keyboard = eek_layout_holder_get_keyboard(LAYOUT_HOLDER(object));
|
||||
priv->keyboard = eekboard_context_service_get_keyboard(EEKBOARD_CONTEXT_SERVICE(object));
|
||||
if (priv->renderer) {
|
||||
eek_renderer_free(priv->renderer);
|
||||
}
|
||||
@ -357,7 +356,7 @@ on_notify_keyboard (GObject *object,
|
||||
* Returns: a #GtkWidget
|
||||
*/
|
||||
GtkWidget *
|
||||
eek_gtk_keyboard_new (LayoutHolder *eekservice,
|
||||
eek_gtk_keyboard_new (EekboardContextService *eekservice,
|
||||
struct submission *submission,
|
||||
struct squeek_layout_state *layout)
|
||||
{
|
||||
|
||||
@ -48,7 +48,7 @@ struct _EekGtkKeyboardClass
|
||||
};
|
||||
|
||||
GType eek_gtk_keyboard_get_type (void) G_GNUC_CONST;
|
||||
GtkWidget *eek_gtk_keyboard_new (LayoutHolder *eekservice, struct submission *submission, struct squeek_layout_state *layout);
|
||||
GtkWidget *eek_gtk_keyboard_new (EekboardContextService *eekservice, struct submission *submission, struct squeek_layout_state *layout);
|
||||
|
||||
G_END_DECLS
|
||||
#endif /* EEK_GTK_KEYBOARD_H */
|
||||
|
||||
@ -37,7 +37,7 @@ G_BEGIN_DECLS
|
||||
|
||||
typedef struct _EekBounds EekBounds;
|
||||
|
||||
typedef struct _LayoutHolder LayoutHolder;
|
||||
typedef struct _EekboardContextService EekboardContextService;
|
||||
typedef struct _ServerContextService ServerContextService;
|
||||
typedef struct _LevelKeyboard LevelKeyboard;
|
||||
|
||||
|
||||
@ -35,17 +35,28 @@ enum {
|
||||
PROP_LAST
|
||||
};
|
||||
|
||||
#define LAYOUT_HOLDER_GET_PRIVATE(obj) \
|
||||
(G_TYPE_INSTANCE_GET_PRIVATE ((obj), EEKBOARD_TYPE_LAYOUT_HOLDER, LayoutHolderPrivate))
|
||||
enum {
|
||||
DESTROYED,
|
||||
LAST_SIGNAL
|
||||
};
|
||||
|
||||
struct _LayoutHolderPrivate {
|
||||
static guint signals[LAST_SIGNAL] = { 0, };
|
||||
|
||||
#define EEKBOARD_CONTEXT_SERVICE_GET_PRIVATE(obj) \
|
||||
(G_TYPE_INSTANCE_GET_PRIVATE ((obj), EEKBOARD_TYPE_CONTEXT_SERVICE, EekboardContextServicePrivate))
|
||||
|
||||
struct _EekboardContextServicePrivate {
|
||||
LevelKeyboard *keyboard; // currently used keyboard
|
||||
GSettings *settings; // Owned reference
|
||||
|
||||
// Maybe TODO: it's used only for fetching layout type.
|
||||
// Maybe let UI push the type to this structure?
|
||||
ServerContextService *ui; // unowned reference
|
||||
/// Needed for keymap changes after keyboard updates
|
||||
struct submission *submission; // unowned
|
||||
};
|
||||
|
||||
G_DEFINE_TYPE_WITH_PRIVATE (LayoutHolder, layout_holder, G_TYPE_OBJECT);
|
||||
G_DEFINE_TYPE_WITH_PRIVATE (EekboardContextService, eekboard_context_service, G_TYPE_OBJECT);
|
||||
|
||||
static void
|
||||
eekboard_context_service_set_property (GObject *object,
|
||||
@ -62,12 +73,12 @@ eekboard_context_service_set_property (GObject *object,
|
||||
}
|
||||
|
||||
static void
|
||||
layout_holder_get_property (GObject *object,
|
||||
eekboard_context_service_get_property (GObject *object,
|
||||
guint prop_id,
|
||||
GValue *value,
|
||||
GParamSpec *pspec)
|
||||
{
|
||||
LayoutHolder *context = LAYOUT_HOLDER(object);
|
||||
EekboardContextService *context = EEKBOARD_CONTEXT_SERVICE(object);
|
||||
|
||||
switch (prop_id) {
|
||||
case PROP_KEYBOARD:
|
||||
@ -79,6 +90,13 @@ layout_holder_get_property (GObject *object,
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
eekboard_context_service_dispose (GObject *object)
|
||||
{
|
||||
G_OBJECT_CLASS (eekboard_context_service_parent_class)->
|
||||
dispose (object);
|
||||
}
|
||||
|
||||
static void
|
||||
settings_get_layout(GSettings *settings, char **type, char **layout)
|
||||
{
|
||||
@ -98,8 +116,7 @@ settings_get_layout(GSettings *settings, char **type, char **layout)
|
||||
}
|
||||
|
||||
void
|
||||
eek_layout_holder_use_layout(LayoutHolder *context, struct squeek_layout_state *state) {
|
||||
*context->layout = *state;
|
||||
eekboard_context_service_use_layout(EekboardContextService *context, struct squeek_layout_state *state) {
|
||||
gchar *layout_name = state->overlay_name;
|
||||
|
||||
if (layout_name == NULL) {
|
||||
@ -143,22 +160,73 @@ eek_layout_holder_use_layout(LayoutHolder *context, struct squeek_layout_state *
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
layout_holder_init (LayoutHolder *self) {
|
||||
self->priv = LAYOUT_HOLDER_GET_PRIVATE(self);
|
||||
static void eekboard_context_service_update_settings_layout(EekboardContextService *context) {
|
||||
g_autofree gchar *keyboard_layout = NULL;
|
||||
g_autofree gchar *keyboard_type = NULL;
|
||||
settings_get_layout(context->priv->settings,
|
||||
&keyboard_type, &keyboard_layout);
|
||||
|
||||
if (g_strcmp0(context->layout->layout_name, keyboard_layout) != 0 || context->layout->overlay_name) {
|
||||
g_free(context->layout->overlay_name);
|
||||
context->layout->overlay_name = NULL;
|
||||
if (keyboard_layout) {
|
||||
g_free(context->layout->layout_name);
|
||||
context->layout->layout_name = g_strdup(keyboard_layout);
|
||||
}
|
||||
// This must actually update the UI.
|
||||
eekboard_context_service_use_layout(context, context->layout);
|
||||
}
|
||||
}
|
||||
|
||||
static gboolean
|
||||
settings_handle_layout_changed(GSettings *s,
|
||||
gpointer keys, gint n_keys,
|
||||
gpointer user_data) {
|
||||
(void)s;
|
||||
(void)keys;
|
||||
(void)n_keys;
|
||||
EekboardContextService *context = user_data;
|
||||
eekboard_context_service_update_settings_layout(context);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static void
|
||||
layout_holder_class_init (LayoutHolderClass *klass)
|
||||
eekboard_context_service_constructed (GObject *object)
|
||||
{
|
||||
(void)object;
|
||||
}
|
||||
|
||||
static void
|
||||
eekboard_context_service_class_init (EekboardContextServiceClass *klass)
|
||||
{
|
||||
GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
|
||||
GParamSpec *pspec;
|
||||
|
||||
gobject_class->constructed = eekboard_context_service_constructed;
|
||||
gobject_class->set_property = eekboard_context_service_set_property;
|
||||
gobject_class->get_property = layout_holder_get_property;
|
||||
gobject_class->get_property = eekboard_context_service_get_property;
|
||||
gobject_class->dispose = eekboard_context_service_dispose;
|
||||
/**
|
||||
* EekboardContextService::destroyed:
|
||||
* @context: an #EekboardContextService
|
||||
*
|
||||
* Emitted when @context is destroyed.
|
||||
*/
|
||||
signals[DESTROYED] =
|
||||
g_signal_new (I_("destroyed"),
|
||||
G_TYPE_FROM_CLASS(gobject_class),
|
||||
G_SIGNAL_RUN_LAST,
|
||||
G_STRUCT_OFFSET(EekboardContextServiceClass, destroyed),
|
||||
NULL,
|
||||
NULL,
|
||||
g_cclosure_marshal_VOID__VOID,
|
||||
G_TYPE_NONE,
|
||||
0);
|
||||
|
||||
/**
|
||||
* An #LevelKeyboard currently active in this context.
|
||||
* EekboardContextService:keyboard:
|
||||
*
|
||||
* An #EekKeyboard currently active in this context.
|
||||
*/
|
||||
pspec = g_param_spec_pointer("keyboard",
|
||||
"Keyboard",
|
||||
@ -169,91 +237,10 @@ layout_holder_class_init (LayoutHolderClass *klass)
|
||||
pspec);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get keyboard currently active in @context.
|
||||
* Returns: (transfer none): a LevelKeyboard
|
||||
*/
|
||||
LevelKeyboard *
|
||||
eek_layout_holder_get_keyboard (LayoutHolder *context)
|
||||
static void
|
||||
eekboard_context_service_init (EekboardContextService *self)
|
||||
{
|
||||
return context->priv->keyboard;
|
||||
}
|
||||
|
||||
void eekboard_context_service_set_hint_purpose(LayoutHolder *context,
|
||||
uint32_t hint, uint32_t purpose)
|
||||
{
|
||||
if (context->layout->hint != hint || context->layout->purpose != purpose) {
|
||||
context->layout->hint = hint;
|
||||
context->layout->purpose = purpose;
|
||||
eek_layout_holder_use_layout(context, context->layout);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
eekboard_context_service_set_overlay(LayoutHolder *context, const char* name) {
|
||||
if (g_strcmp0(context->layout->overlay_name, name)) {
|
||||
g_free(context->layout->overlay_name);
|
||||
context->layout->overlay_name = g_strdup(name);
|
||||
eek_layout_holder_use_layout(context, context->layout);
|
||||
}
|
||||
}
|
||||
|
||||
const char*
|
||||
eekboard_context_service_get_overlay(LayoutHolder *context) {
|
||||
return context->layout->overlay_name;
|
||||
}
|
||||
|
||||
LayoutHolder *eek_layout_holder_new(struct squeek_layout_state *state)
|
||||
{
|
||||
LayoutHolder *context = g_object_new (EEKBOARD_TYPE_LAYOUT_HOLDER, NULL);
|
||||
context->layout = state;
|
||||
eek_layout_holder_use_layout(context, context->layout);
|
||||
return context;
|
||||
}
|
||||
|
||||
void eek_layout_holder_set_submission(LayoutHolder *context, struct submission *submission) {
|
||||
context->priv->submission = submission;
|
||||
if (context->priv->submission) {
|
||||
submission_set_keyboard(context->priv->submission, context->priv->keyboard);
|
||||
}
|
||||
}
|
||||
|
||||
static void settings_update_layout(struct gsettings_tracker *self) {
|
||||
// The layout in the param must be the same layout as held by context.
|
||||
g_autofree gchar *keyboard_layout = NULL;
|
||||
g_autofree gchar *keyboard_type = NULL;
|
||||
settings_get_layout(self->gsettings,
|
||||
&keyboard_type, &keyboard_layout);
|
||||
|
||||
if (g_strcmp0(self->layout->layout_name, keyboard_layout) != 0 || self->layout->overlay_name) {
|
||||
g_free(self->layout->overlay_name);
|
||||
self->layout->overlay_name = NULL;
|
||||
if (keyboard_layout) {
|
||||
g_free(self->layout->layout_name);
|
||||
self->layout->layout_name = g_strdup(keyboard_layout);
|
||||
}
|
||||
// This must actually update the UI.
|
||||
eek_layout_holder_use_layout(self->context, self->layout);
|
||||
}
|
||||
}
|
||||
|
||||
static gboolean
|
||||
handle_layout_changed(GSettings *s,
|
||||
gpointer keys, gint n_keys,
|
||||
gpointer user_data) {
|
||||
(void)s;
|
||||
(void)keys;
|
||||
(void)n_keys;
|
||||
struct gsettings_tracker *self = user_data;
|
||||
settings_update_layout(self);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void eek_gsettings_tracker_init(struct gsettings_tracker *tracker, LayoutHolder *context, struct squeek_layout_state *layout)
|
||||
{
|
||||
tracker->layout = layout;
|
||||
tracker->context = context;
|
||||
|
||||
self->priv = EEKBOARD_CONTEXT_SERVICE_GET_PRIVATE(self);
|
||||
const char *schema_name = "org.gnome.desktop.input-sources";
|
||||
GSettingsSchemaSource *ssrc = g_settings_schema_source_get_default();
|
||||
if (ssrc) {
|
||||
@ -263,10 +250,10 @@ void eek_gsettings_tracker_init(struct gsettings_tracker *tracker, LayoutHolder
|
||||
if (schema) {
|
||||
// Not referencing the found schema directly,
|
||||
// because it's not clear how...
|
||||
tracker->gsettings = g_settings_new (schema_name);
|
||||
gulong conn_id = g_signal_connect(tracker->gsettings, "change-event",
|
||||
G_CALLBACK(handle_layout_changed),
|
||||
tracker);
|
||||
self->priv->settings = g_settings_new (schema_name);
|
||||
gulong conn_id = g_signal_connect(self->priv->settings, "change-event",
|
||||
G_CALLBACK(settings_handle_layout_changed),
|
||||
self);
|
||||
if (conn_id == 0) {
|
||||
g_warning ("Could not connect to gsettings updates, "
|
||||
"automatic layout changing unavailable");
|
||||
@ -278,6 +265,74 @@ void eek_gsettings_tracker_init(struct gsettings_tracker *tracker, LayoutHolder
|
||||
} else {
|
||||
g_warning("No gsettings schemas installed. Layout switching unavailable.");
|
||||
}
|
||||
|
||||
settings_update_layout(tracker);
|
||||
}
|
||||
|
||||
/**
|
||||
* eekboard_context_service_destroy:
|
||||
* @context: an #EekboardContextService
|
||||
*
|
||||
* Destroy @context.
|
||||
*/
|
||||
void
|
||||
eekboard_context_service_destroy (EekboardContextService *context)
|
||||
{
|
||||
g_return_if_fail (EEKBOARD_IS_CONTEXT_SERVICE(context));
|
||||
g_signal_emit (context, signals[DESTROYED], 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* eekboard_context_service_get_keyboard:
|
||||
* @context: an #EekboardContextService
|
||||
*
|
||||
* Get keyboard currently active in @context.
|
||||
* Returns: (transfer none): an #EekKeyboard
|
||||
*/
|
||||
LevelKeyboard *
|
||||
eekboard_context_service_get_keyboard (EekboardContextService *context)
|
||||
{
|
||||
return context->priv->keyboard;
|
||||
}
|
||||
|
||||
void eekboard_context_service_set_hint_purpose(EekboardContextService *context,
|
||||
uint32_t hint, uint32_t purpose)
|
||||
{
|
||||
if (context->layout->hint != hint || context->layout->purpose != purpose) {
|
||||
context->layout->hint = hint;
|
||||
context->layout->purpose = purpose;
|
||||
eekboard_context_service_use_layout(context, context->layout);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
eekboard_context_service_set_overlay(EekboardContextService *context, const char* name) {
|
||||
if (g_strcmp0(context->layout->overlay_name, name)) {
|
||||
g_free(context->layout->overlay_name);
|
||||
context->layout->overlay_name = g_strdup(name);
|
||||
eekboard_context_service_use_layout(context, context->layout);
|
||||
}
|
||||
}
|
||||
|
||||
const char*
|
||||
eekboard_context_service_get_overlay(EekboardContextService *context) {
|
||||
return context->layout->overlay_name;
|
||||
}
|
||||
|
||||
EekboardContextService *eekboard_context_service_new(struct squeek_layout_state *state)
|
||||
{
|
||||
EekboardContextService *context = g_object_new (EEKBOARD_TYPE_CONTEXT_SERVICE, NULL);
|
||||
context->layout = state;
|
||||
eekboard_context_service_update_settings_layout(context);
|
||||
eekboard_context_service_use_layout(context, context->layout);
|
||||
return context;
|
||||
}
|
||||
|
||||
void eekboard_context_service_set_submission(EekboardContextService *context, struct submission *submission) {
|
||||
context->priv->submission = submission;
|
||||
if (context->priv->submission) {
|
||||
submission_set_keyboard(context->priv->submission, context->priv->keyboard);
|
||||
}
|
||||
}
|
||||
|
||||
void eekboard_context_service_set_ui(EekboardContextService *context, ServerContextService *ui) {
|
||||
context->priv->ui = ui;
|
||||
}
|
||||
|
||||
@ -30,60 +30,71 @@
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
#define EEKBOARD_TYPE_LAYOUT_HOLDER (layout_holder_get_type())
|
||||
#define LAYOUT_HOLDER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), EEKBOARD_TYPE_LAYOUT_HOLDER, LayoutHolder))
|
||||
#define EEKBOARD_CONTEXT_SERVICE_PATH "/org/fedorahosted/Eekboard/Context_%d"
|
||||
#define EEKBOARD_CONTEXT_SERVICE_INTERFACE "org.fedorahosted.Eekboard.Context"
|
||||
|
||||
#define EEKBOARD_TYPE_CONTEXT_SERVICE (eekboard_context_service_get_type())
|
||||
#define EEKBOARD_CONTEXT_SERVICE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), EEKBOARD_TYPE_CONTEXT_SERVICE, EekboardContextService))
|
||||
#define EEKBOARD_CONTEXT_SERVICE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), EEKBOARD_TYPE_CONTEXT_SERVICE, EekboardContextServiceClass))
|
||||
#define EEKBOARD_IS_CONTEXT_SERVICE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), EEKBOARD_TYPE_CONTEXT_SERVICE))
|
||||
#define EEKBOARD_IS_CONTEXT_SERVICE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), EEKBOARD_TYPE_CONTEXT_SERVICE))
|
||||
#define EEKBOARD_CONTEXT_SERVICE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), EEKBOARD_TYPE_CONTEXT_SERVICE, EekboardContextServiceClass))
|
||||
|
||||
|
||||
typedef struct _LayoutHolderClass LayoutHolderClass;
|
||||
typedef struct _LayoutHolderPrivate LayoutHolderPrivate;
|
||||
typedef struct _EekboardContextServiceClass EekboardContextServiceClass;
|
||||
typedef struct _EekboardContextServicePrivate EekboardContextServicePrivate;
|
||||
|
||||
/**
|
||||
* Handles layout state, and virtual-keyboard.
|
||||
* EekboardContextService:
|
||||
*
|
||||
* Handles layout state, gsettings, and virtual-keyboard.
|
||||
*
|
||||
* TODO: Restrict to managing keyboard layouts, and maybe button repeats,
|
||||
* and the virtual keyboard protocol.
|
||||
*
|
||||
* The #EekboardContextService structure contains only private data
|
||||
* and should only be accessed using the provided API.
|
||||
*/
|
||||
struct _LayoutHolder {
|
||||
struct _EekboardContextService {
|
||||
GObject parent;
|
||||
LayoutHolderPrivate *priv;
|
||||
EekboardContextServicePrivate *priv;
|
||||
struct squeek_layout_state *layout; // Unowned
|
||||
};
|
||||
|
||||
struct _LayoutHolderClass {
|
||||
/**
|
||||
* EekboardContextServiceClass:
|
||||
* @create_keyboard: virtual function for create a keyboard from string
|
||||
* @enabled: class handler for #EekboardContextService::enabled signal
|
||||
* @disabled: class handler for #EekboardContextService::disabled signal
|
||||
*/
|
||||
struct _EekboardContextServiceClass {
|
||||
/*< private >*/
|
||||
GObjectClass parent_class;
|
||||
|
||||
/*< public >*/
|
||||
/* signals */
|
||||
void (*destroyed) (EekboardContextService *self);
|
||||
|
||||
/*< private >*/
|
||||
/* padding */
|
||||
gpointer pdummy[24];
|
||||
};
|
||||
|
||||
GType layout_holder_get_type(void) G_GNUC_CONST;
|
||||
GType eekboard_context_service_get_type
|
||||
(void) G_GNUC_CONST;
|
||||
EekboardContextService *eekboard_context_service_new(struct squeek_layout_state *state);
|
||||
void eekboard_context_service_set_submission(EekboardContextService *context, struct submission *submission);
|
||||
void eekboard_context_service_set_ui(EekboardContextService *context, ServerContextService *ui);
|
||||
void eekboard_context_service_destroy (EekboardContextService *context);
|
||||
LevelKeyboard *eekboard_context_service_get_keyboard(EekboardContextService *context);
|
||||
|
||||
/// Handles gsettings os-level keyboard layout switches.
|
||||
struct gsettings_tracker {
|
||||
GSettings *gsettings; // Owned reference
|
||||
LayoutHolder *context; // Unowned
|
||||
struct squeek_layout_state *layout; // Unowned
|
||||
};
|
||||
|
||||
void eek_gsettings_tracker_init(struct gsettings_tracker* tracker, LayoutHolder *context, struct squeek_layout_state *layout);
|
||||
|
||||
LayoutHolder *eek_layout_holder_new(struct squeek_layout_state *state);
|
||||
void eek_layout_holder_set_submission(LayoutHolder *context, struct submission *submission);
|
||||
LevelKeyboard *eek_layout_holder_get_keyboard(LayoutHolder *context);
|
||||
|
||||
void eekboard_context_service_set_keymap(LayoutHolder *context,
|
||||
void eekboard_context_service_set_keymap(EekboardContextService *context,
|
||||
const LevelKeyboard *keyboard);
|
||||
|
||||
void eekboard_context_service_set_hint_purpose(LayoutHolder *context,
|
||||
void eekboard_context_service_set_hint_purpose(EekboardContextService *context,
|
||||
uint32_t hint,
|
||||
uint32_t purpose);
|
||||
void
|
||||
eek_layout_holder_use_layout(LayoutHolder *context, struct squeek_layout_state *layout);
|
||||
eekboard_context_service_use_layout(EekboardContextService *context, struct squeek_layout_state *layout);
|
||||
G_END_DECLS
|
||||
#endif /* EEKBOARD_CONTEXT_SERVICE_H */
|
||||
|
||||
@ -42,6 +42,7 @@ endif
|
||||
prefix = get_option('prefix')
|
||||
bindir = join_paths(prefix, get_option('bindir'))
|
||||
datadir = join_paths(prefix, get_option('datadir'))
|
||||
desktopdir = join_paths(datadir, 'applications')
|
||||
pkgdatadir = join_paths(datadir, meson.project_name())
|
||||
if get_option('depdatadir') == ''
|
||||
depdatadir = datadir
|
||||
|
||||
@ -26,7 +26,7 @@ static const struct zwp_input_method_v2_listener input_method_listener = {
|
||||
struct submission* get_submission(struct zwp_input_method_manager_v2 *immanager,
|
||||
struct zwp_virtual_keyboard_manager_v1 *vkmanager,
|
||||
struct wl_seat *seat,
|
||||
LayoutHolder *state) {
|
||||
EekboardContextService *state) {
|
||||
struct zwp_input_method_v2 *im = NULL;
|
||||
if (immanager) {
|
||||
im = zwp_input_method_manager_v2_get_input_method(immanager, seat);
|
||||
|
||||
@ -47,7 +47,7 @@ void squeek_layout_release(struct squeek_layout *layout,
|
||||
struct submission *submission,
|
||||
struct transformation widget_to_layout,
|
||||
uint32_t timestamp,
|
||||
LayoutHolder *manager,
|
||||
EekboardContextService *manager,
|
||||
EekGtkKeyboard *ui_keyboard);
|
||||
void squeek_layout_release_all_only(struct squeek_layout *layout,
|
||||
struct submission *submission,
|
||||
@ -61,7 +61,7 @@ void squeek_layout_drag(struct squeek_layout *layout,
|
||||
struct submission *submission,
|
||||
double x_widget, double y_widget,
|
||||
struct transformation widget_to_layout,
|
||||
uint32_t timestamp, LayoutHolder *manager,
|
||||
uint32_t timestamp, EekboardContextService *manager,
|
||||
EekGtkKeyboard *ui_keyboard);
|
||||
void squeek_layout_draw_all_changed(struct squeek_layout *layout, EekRenderer* renderer, cairo_t *cr, struct submission *submission);
|
||||
void squeek_draw_layout_base_view(struct squeek_layout *layout, EekRenderer* renderer, cairo_t *cr);
|
||||
|
||||
@ -15,7 +15,6 @@ sources = [
|
||||
'dbus.c',
|
||||
'imservice.c',
|
||||
'server-context-service.c',
|
||||
'ui_manager.c',
|
||||
'wayland.c',
|
||||
'../eek/eek.c',
|
||||
'../eek/eek-element.c',
|
||||
@ -39,7 +38,6 @@ deps = [
|
||||
dependency('gio-2.0', version: '>=2.26.0'),
|
||||
dependency('gnome-desktop-3.0', version: '>=3.0'),
|
||||
dependency('gtk+-3.0', version: '>=3.0'),
|
||||
dependency('libcroco-0.6'),
|
||||
dependency('wayland-client', version: '>=1.14'),
|
||||
dependency('xkbcommon'),
|
||||
cc.find_library('m'),
|
||||
|
||||
152
src/outputs.rs
152
src/outputs.rs
@ -1,10 +1,5 @@
|
||||
/* Copyright (C) 2019-2020 Purism SPC
|
||||
* SPDX-License-Identifier: GPL-3.0+
|
||||
*/
|
||||
|
||||
/*! Managing Wayland outputs */
|
||||
|
||||
use std::cell::RefCell;
|
||||
use std::vec::Vec;
|
||||
use ::logging;
|
||||
|
||||
@ -22,7 +17,7 @@ pub mod c {
|
||||
// Defined in C
|
||||
|
||||
#[repr(transparent)]
|
||||
#[derive(Clone, PartialEq, Copy, Hash)]
|
||||
#[derive(Clone, PartialEq, Copy)]
|
||||
pub struct WlOutput(*const c_void);
|
||||
|
||||
#[repr(C)]
|
||||
@ -68,7 +63,7 @@ pub mod c {
|
||||
}
|
||||
|
||||
/// Map to `wl_output.transform` values
|
||||
#[derive(Clone, PartialEq)]
|
||||
#[derive(Clone)]
|
||||
pub enum Transform {
|
||||
Normal = 0,
|
||||
Rotated90 = 1,
|
||||
@ -108,7 +103,7 @@ pub mod c {
|
||||
) -> i32;
|
||||
}
|
||||
|
||||
pub type COutputs = ::util::c::Wrapped<Outputs>;
|
||||
type COutputs = ::util::c::Wrapped<Outputs>;
|
||||
|
||||
/// A stable reference to an output.
|
||||
#[derive(Clone)]
|
||||
@ -126,10 +121,6 @@ pub mod c {
|
||||
let outputs = outputs.borrow();
|
||||
find_output(&outputs, self.wl_output.clone()).map(|o| o.current.clone())
|
||||
}
|
||||
|
||||
pub fn get_id(&self) -> OutputId {
|
||||
OutputId { wl_output: self.wl_output }
|
||||
}
|
||||
}
|
||||
|
||||
// Defined in Rust
|
||||
@ -138,7 +129,7 @@ pub mod c {
|
||||
outputs: COutputs,
|
||||
wl_output: WlOutput,
|
||||
_x: i32, _y: i32,
|
||||
phys_width: i32, phys_height: i32,
|
||||
_phys_width: i32, _phys_height: i32,
|
||||
_subpixel: i32,
|
||||
_make: *const c_char, _model: *const c_char,
|
||||
transform: i32,
|
||||
@ -154,23 +145,8 @@ pub mod c {
|
||||
let output_state: Option<&mut OutputState>
|
||||
= find_output_mut(&mut collection, wl_output)
|
||||
.map(|o| &mut o.pending);
|
||||
|
||||
match output_state {
|
||||
Some(state) => {
|
||||
state.transform = Some(transform);
|
||||
state.phys_size = {
|
||||
if (phys_width > 0) & (phys_height > 0) {
|
||||
Some(SizeMM { width: phys_width, height: phys_height })
|
||||
} else {
|
||||
log_print!(
|
||||
logging::Level::Surprise,
|
||||
"Impossible physical dimensions: {}mm × {}mm",
|
||||
phys_width, phys_height,
|
||||
);
|
||||
None
|
||||
}
|
||||
}
|
||||
},
|
||||
Some(state) => { state.transform = Some(transform) },
|
||||
None => log_print!(
|
||||
logging::Level::Warning,
|
||||
"Got geometry on unknown output",
|
||||
@ -211,27 +187,19 @@ pub mod c {
|
||||
}
|
||||
|
||||
extern fn outputs_handle_done(
|
||||
outputs_raw: COutputs,
|
||||
outputs: COutputs,
|
||||
wl_output: WlOutput,
|
||||
) {
|
||||
let outputs = outputs_raw.clone_ref();
|
||||
{
|
||||
let mut collection = RefCell::borrow_mut(&outputs);
|
||||
let output = find_output_mut(&mut collection, wl_output);
|
||||
match output {
|
||||
Some(output) => { output.current = output.pending.clone(); }
|
||||
None => log_print!(
|
||||
logging::Level::Warning,
|
||||
"Got done on unknown output",
|
||||
),
|
||||
};
|
||||
}
|
||||
let collection = RefCell::borrow(&outputs);
|
||||
if let Some(ref cb) = &collection.update_cb {
|
||||
let mut cb = RefCell::borrow_mut(cb);
|
||||
let cb = Box::as_mut(&mut cb);
|
||||
cb(OutputHandle { wl_output, outputs: outputs_raw });
|
||||
}
|
||||
let outputs = outputs.clone_ref();
|
||||
let mut collection = outputs.borrow_mut();
|
||||
let output = find_output_mut(&mut collection, wl_output);
|
||||
match output {
|
||||
Some(output) => { output.current = output.pending.clone(); }
|
||||
None => log_print!(
|
||||
logging::Level::Warning,
|
||||
"Got done on unknown output",
|
||||
),
|
||||
};
|
||||
}
|
||||
|
||||
extern fn outputs_handle_scale(
|
||||
@ -256,10 +224,7 @@ pub mod c {
|
||||
#[no_mangle]
|
||||
pub extern "C"
|
||||
fn squeek_outputs_new() -> COutputs {
|
||||
COutputs::new(Outputs {
|
||||
outputs: Vec::new(),
|
||||
update_cb: None,
|
||||
})
|
||||
COutputs::new(Outputs { outputs: Vec::new() })
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
@ -328,29 +293,22 @@ pub mod c {
|
||||
}
|
||||
|
||||
/// Generic size
|
||||
#[derive(Clone, Debug)]
|
||||
#[derive(Clone)]
|
||||
pub struct Size {
|
||||
pub width: u32,
|
||||
pub height: u32,
|
||||
}
|
||||
|
||||
#[derive(Clone, PartialEq)]
|
||||
pub struct SizeMM {
|
||||
pub width: i32,
|
||||
pub height: i32,
|
||||
}
|
||||
|
||||
/// wl_output mode
|
||||
#[derive(Clone, PartialEq)]
|
||||
#[derive(Clone)]
|
||||
struct Mode {
|
||||
width: i32,
|
||||
height: i32,
|
||||
}
|
||||
|
||||
#[derive(Clone, PartialEq)]
|
||||
#[derive(Clone)]
|
||||
pub struct OutputState {
|
||||
current_mode: Option<Mode>,
|
||||
phys_size: Option<SizeMM>,
|
||||
transform: Option<c::Transform>,
|
||||
pub scale: i32,
|
||||
}
|
||||
@ -365,7 +323,6 @@ impl OutputState {
|
||||
fn uninitialized() -> OutputState {
|
||||
OutputState {
|
||||
current_mode: None,
|
||||
phys_size: None,
|
||||
transform: None,
|
||||
scale: 1,
|
||||
}
|
||||
@ -377,7 +334,6 @@ impl OutputState {
|
||||
OutputState {
|
||||
current_mode: Some(Mode { width, height } ),
|
||||
transform: Some(transform),
|
||||
phys_size: _,
|
||||
scale: _,
|
||||
} => Some(
|
||||
match transform {
|
||||
@ -397,42 +353,6 @@ impl OutputState {
|
||||
_ => None,
|
||||
}
|
||||
}
|
||||
|
||||
/// Returns transformed dimensions
|
||||
pub fn get_phys_size(&self) -> Option<Size> {
|
||||
use self::c::Transform;
|
||||
match self {
|
||||
OutputState {
|
||||
current_mode: _,
|
||||
transform: Some(transform),
|
||||
phys_size: Some(SizeMM { width, height }),
|
||||
scale: _,
|
||||
} => Some(
|
||||
match transform {
|
||||
Transform::Normal
|
||||
| Transform::Rotated180
|
||||
| Transform::Flipped
|
||||
| Transform::FlippedRotated180 => Size {
|
||||
width: *width as u32,
|
||||
height: *height as u32,
|
||||
},
|
||||
_ => Size {
|
||||
width: *height as u32,
|
||||
height: *width as u32,
|
||||
},
|
||||
}
|
||||
),
|
||||
_ => None,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// A comparable ID of an output
|
||||
#[derive(Clone, PartialEq, Hash)]
|
||||
pub struct OutputId {
|
||||
// WlOutput is a unique pointer, so it will not repeat
|
||||
// even if there are multiple output managers.
|
||||
wl_output: c::WlOutput,
|
||||
}
|
||||
|
||||
pub struct Output {
|
||||
@ -441,38 +361,6 @@ pub struct Output {
|
||||
current: OutputState,
|
||||
}
|
||||
|
||||
/// The manager of all outputs.
|
||||
// This is the target of several callbacks,
|
||||
// so it should only be used with a stable place in memory, like `Rc<RefCell>`.
|
||||
// It should not be instantiated externally or copied,
|
||||
// or it will not receive those callbacks and be somewhat of an empty shell.
|
||||
// It should be safe to use as long as the fields are not `pub`,
|
||||
// and there's no `Clone`, and this module's API only ever gives out
|
||||
// references wrapped in `Rc<RefCell>`.
|
||||
// For perfectness, it would only ever give out immutable opaque references,
|
||||
// but that's not practical at the moment.
|
||||
// `mem::swap` could replace the value inside,
|
||||
// but as long as the swap is atomic,
|
||||
// that should not cause an inconsistent state.
|
||||
pub struct Outputs {
|
||||
outputs: Vec<Output>,
|
||||
// The RefCell is here to let the function be called
|
||||
// while holding only a read-reference to `Outputs`.
|
||||
// Otherwise anything trying to get useful data from OutputHandle
|
||||
// will fail to acquire reference to Outputs.
|
||||
// TODO: Maybe pass only current state along with Outputs and Output hash.
|
||||
// The only reason a full OutputHandle is here
|
||||
// is to be able to track the right Output.
|
||||
update_cb: Option<RefCell<Box<dyn FnMut(c::OutputHandle)>>>,
|
||||
}
|
||||
|
||||
impl Outputs {
|
||||
/// The function will get called whenever
|
||||
/// any output changes or is removed or created.
|
||||
/// If output handle doesn't return state, the output just went down.
|
||||
/// It cannot modify anything in Outputs.
|
||||
// FIXME: handle output destruction
|
||||
pub fn set_update_cb(&mut self, callback: Box<dyn FnMut(c::OutputHandle)>) {
|
||||
self.update_cb = Some(RefCell::new(callback));
|
||||
}
|
||||
}
|
||||
|
||||
@ -16,8 +16,10 @@ const KEYBOARDS: &[(*const str, *const str)] = &[
|
||||
("us_wide", include_str!("../data/keyboards/us_wide.yaml")),
|
||||
("de", include_str!("../data/keyboards/de.yaml")),
|
||||
("de_wide", include_str!("../data/keyboards/de_wide.yaml")),
|
||||
("dk", include_str!("../data/keyboards/dk.yaml")),
|
||||
("es", include_str!("../data/keyboards/es.yaml")),
|
||||
("fi", include_str!("../data/keyboards/fi.yaml")),
|
||||
("fr", include_str!("../data/keyboards/fr.yaml")),
|
||||
("gr", include_str!("../data/keyboards/gr.yaml")),
|
||||
("it", include_str!("../data/keyboards/it.yaml")),
|
||||
("jp+kana", include_str!("../data/keyboards/jp+kana.yaml")),
|
||||
@ -26,6 +28,7 @@ const KEYBOARDS: &[(*const str, *const str)] = &[
|
||||
("number", include_str!("../data/keyboards/number.yaml")),
|
||||
("pl", include_str!("../data/keyboards/pl.yaml")),
|
||||
("pl_wide", include_str!("../data/keyboards/pl_wide.yaml")),
|
||||
("ru", include_str!("../data/keyboards/ru.yaml")),
|
||||
("se", include_str!("../data/keyboards/se.yaml")),
|
||||
// layout+overlay
|
||||
("terminal", include_str!("../data/keyboards/terminal.yaml")),
|
||||
@ -67,6 +70,7 @@ const LAYOUT_NAMES: &[(*const str, *const str)] = &[
|
||||
("es-ES", include_str!("../data/langs/es-ES.txt")),
|
||||
("ja-JP", include_str!("../data/langs/ja-JP.txt")),
|
||||
("pl-PL", include_str!("../data/langs/pl-PL.txt")),
|
||||
("ru-RU", include_str!("../data/langs/ru-RU.txt")),
|
||||
];
|
||||
|
||||
pub fn get_layout_names(lang: &str)
|
||||
|
||||
@ -39,7 +39,7 @@ typedef struct _ServerContextServiceClass ServerContextServiceClass;
|
||||
struct _ServerContextService {
|
||||
GObject parent;
|
||||
|
||||
LayoutHolder *state; // unowned
|
||||
EekboardContextService *state; // unowned
|
||||
/// Needed for instantiating the widget
|
||||
struct submission *submission; // unowned
|
||||
struct squeek_layout_state *layout;
|
||||
@ -139,7 +139,6 @@ make_window (ServerContextService *context)
|
||||
NULL
|
||||
);
|
||||
|
||||
squeek_uiman_set_surface(context->manager, context->window);
|
||||
g_object_connect (context->window,
|
||||
"signal::destroy", G_CALLBACK(on_destroy), context,
|
||||
"signal::map", G_CALLBACK(on_notify_map), context,
|
||||
@ -312,7 +311,7 @@ server_context_service_init (ServerContextService *state) {
|
||||
}
|
||||
|
||||
ServerContextService *
|
||||
server_context_service_new (LayoutHolder *state, struct submission *submission, struct squeek_layout_state *layout, struct ui_manager *uiman)
|
||||
server_context_service_new (EekboardContextService *state, struct submission *submission, struct squeek_layout_state *layout, struct ui_manager *uiman)
|
||||
{
|
||||
ServerContextService *ui = g_object_new (SERVER_TYPE_CONTEXT_SERVICE, NULL);
|
||||
ui->submission = submission;
|
||||
|
||||
@ -37,7 +37,7 @@ typedef struct _ServerContextService ServerContextService;
|
||||
GType server_context_service_get_type
|
||||
(void) G_GNUC_CONST;
|
||||
|
||||
ServerContextService *server_context_service_new(LayoutHolder *state, struct submission *submission, struct squeek_layout_state *layout, struct ui_manager *uiman);
|
||||
ServerContextService *server_context_service_new(EekboardContextService *state, struct submission *submission, struct squeek_layout_state *layout, struct ui_manager *uiman);
|
||||
enum squeek_arrangement_kind server_context_service_get_layout_type(ServerContextService *);
|
||||
void server_context_service_show_keyboard (ServerContextService *context);
|
||||
void server_context_service_hide_keyboard (ServerContextService *context);
|
||||
|
||||
@ -42,12 +42,11 @@
|
||||
struct squeekboard {
|
||||
struct squeek_wayland wayland; // Just hooks.
|
||||
DBusHandler *dbus_handler; // Controls visibility of the OSK.
|
||||
LayoutHolder *layout_holder; // Currently used layout & keyboard.
|
||||
EekboardContextService *settings_context; // Gsettings hooks.
|
||||
ServerContextService *ui_context; // mess, includes the entire UI
|
||||
struct submission *submission; // Wayland text input handling.
|
||||
struct squeek_layout_state layout_choice; // Currently wanted layout.
|
||||
struct ui_manager *ui_manager; // UI shape tracker/chooser. TODO: merge with layuot choice
|
||||
struct gsettings_tracker gsettings_tracker; // Gsettings handling.
|
||||
};
|
||||
|
||||
|
||||
@ -204,10 +203,10 @@ main (int argc, char **argv)
|
||||
g_warning("Wayland input method interface not available");
|
||||
}
|
||||
|
||||
instance.ui_manager = squeek_uiman_new(instance.wayland.outputs);
|
||||
instance.ui_manager = squeek_uiman_new();
|
||||
|
||||
instance.settings_context = eekboard_context_service_new(&instance.layout_choice);
|
||||
|
||||
instance.layout_holder = eek_layout_holder_new(&instance.layout_choice);
|
||||
eek_gsettings_tracker_init(&instance.gsettings_tracker, instance.layout_holder, &instance.layout_choice);
|
||||
// set up dbus
|
||||
|
||||
// TODO: make dbus errors non-always-fatal
|
||||
@ -280,12 +279,12 @@ main (int argc, char **argv)
|
||||
instance.submission = get_submission(instance.wayland.input_method_manager,
|
||||
instance.wayland.virtual_keyboard_manager,
|
||||
instance.wayland.seat,
|
||||
instance.layout_holder);
|
||||
instance.settings_context);
|
||||
|
||||
eek_layout_holder_set_submission(instance.layout_holder, instance.submission);
|
||||
eekboard_context_service_set_submission(instance.settings_context, instance.submission);
|
||||
|
||||
ServerContextService *ui_context = server_context_service_new(
|
||||
instance.layout_holder,
|
||||
instance.settings_context,
|
||||
instance.submission,
|
||||
&instance.layout_choice,
|
||||
instance.ui_manager);
|
||||
@ -300,6 +299,7 @@ main (int argc, char **argv)
|
||||
if (instance.dbus_handler) {
|
||||
dbus_handler_set_ui_context(instance.dbus_handler, instance.ui_context);
|
||||
}
|
||||
eekboard_context_service_set_ui(instance.settings_context, instance.ui_context);
|
||||
|
||||
session_register();
|
||||
|
||||
|
||||
@ -10,10 +10,10 @@ struct submission;
|
||||
struct submission* get_submission(struct zwp_input_method_manager_v2 *immanager,
|
||||
struct zwp_virtual_keyboard_manager_v1 *vkmanager,
|
||||
struct wl_seat *seat,
|
||||
LayoutHolder *state);
|
||||
EekboardContextService *state);
|
||||
|
||||
// Defined in Rust
|
||||
struct submission* submission_new(struct zwp_input_method_v2 *im, struct zwp_virtual_keyboard_v1 *vk, LayoutHolder *state);
|
||||
struct submission* submission_new(struct zwp_input_method_v2 *im, struct zwp_virtual_keyboard_v1 *vk, EekboardContextService *state);
|
||||
void submission_set_ui(struct submission *self, ServerContextService *ui_context);
|
||||
void submission_set_keyboard(struct submission *self, LevelKeyboard *keyboard);
|
||||
#endif
|
||||
|
||||
@ -1,8 +0,0 @@
|
||||
#include "eek/layersurface.h"
|
||||
|
||||
void squeek_manager_set_surface_height(PhoshLayerSurface *surface, uint32_t desired_height) {
|
||||
phosh_layer_surface_set_size(surface, 0,
|
||||
(gint)desired_height);
|
||||
phosh_layer_surface_set_exclusive_zone(surface, (gint)desired_height);
|
||||
phosh_layer_surface_wl_surface_commit (surface);
|
||||
}
|
||||
@ -2,14 +2,13 @@
|
||||
#define UI_MANAGER__
|
||||
|
||||
#include <inttypes.h>
|
||||
#include "eek/layersurface.h"
|
||||
|
||||
#include "outputs.h"
|
||||
|
||||
struct ui_manager;
|
||||
|
||||
struct ui_manager *squeek_uiman_new(struct squeek_outputs *outputs);
|
||||
struct ui_manager *squeek_uiman_new();
|
||||
void squeek_uiman_set_output(struct ui_manager *uiman, struct squeek_output_handle output);
|
||||
void squeek_uiman_set_surface(struct ui_manager *uiman, PhoshLayerSurface *surface);
|
||||
uint32_t squeek_uiman_get_perceptual_height(struct ui_manager *uiman);
|
||||
|
||||
#endif
|
||||
|
||||
@ -7,48 +7,17 @@
|
||||
* Coordinates this based on information collated from all possible sources.
|
||||
*/
|
||||
|
||||
use std::cell::RefCell;
|
||||
use std::cmp::min;
|
||||
use std::rc::Rc;
|
||||
|
||||
use ::logging;
|
||||
use ::outputs::{ OutputId, Outputs, OutputState};
|
||||
use ::outputs::c::OutputHandle;
|
||||
|
||||
// Traits
|
||||
use ::logging::Warn;
|
||||
|
||||
mod c {
|
||||
use super::*;
|
||||
use std::os::raw::c_void;
|
||||
use ::outputs::c::COutputs;
|
||||
use ::util::c::Wrapped;
|
||||
|
||||
#[derive(Clone, Copy)]
|
||||
#[repr(C)]
|
||||
pub struct PhoshLayerSurface(*const c_void);
|
||||
|
||||
extern "C" {
|
||||
// Rustc wrongly assumes
|
||||
// that COutputs allows C direct access to the underlying RefCell.
|
||||
#[allow(improper_ctypes)]
|
||||
pub fn squeek_manager_set_surface_height(
|
||||
surface: PhoshLayerSurface,
|
||||
height: u32,
|
||||
);
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub extern "C"
|
||||
fn squeek_uiman_new(outputs: COutputs) -> Wrapped<Manager> {
|
||||
let uiman_raw = Wrapped::new(Manager::new());
|
||||
if !outputs.is_null() {
|
||||
let uiman = uiman_raw.clone_ref();
|
||||
let outputs = outputs.clone_ref();
|
||||
let mut outputs = outputs.borrow_mut();
|
||||
register_output_man(uiman, &mut outputs);
|
||||
}
|
||||
uiman_raw
|
||||
fn squeek_uiman_new() -> Wrapped<Manager> {
|
||||
Wrapped::new(Manager { output: None })
|
||||
}
|
||||
|
||||
/// Used to size the layer surface containing all the OSK widgets.
|
||||
@ -60,7 +29,7 @@ mod c {
|
||||
let uiman = uiman.clone_ref();
|
||||
let uiman = uiman.borrow();
|
||||
// TODO: what to do when there's no output?
|
||||
uiman.state.get_perceptual_height().unwrap_or(0)
|
||||
uiman.get_perceptual_height().unwrap_or(0)
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
@ -71,75 +40,29 @@ mod c {
|
||||
) {
|
||||
let uiman = uiman.clone_ref();
|
||||
let mut uiman = uiman.borrow_mut();
|
||||
uiman.set_output(output)
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub extern "C"
|
||||
fn squeek_uiman_set_surface(
|
||||
uiman: Wrapped<Manager>,
|
||||
surface: PhoshLayerSurface,
|
||||
) {
|
||||
let uiman = uiman.clone_ref();
|
||||
let mut uiman = uiman.borrow_mut();
|
||||
// Surface is not state, so doesn't need to propagate updates.
|
||||
uiman.surface = Some(surface);
|
||||
uiman.output = Some(output);
|
||||
}
|
||||
}
|
||||
|
||||
/// Stores current state of all things influencing what the UI should look like.
|
||||
#[derive(Clone, PartialEq)]
|
||||
pub struct ManagerState {
|
||||
current_output: Option<(OutputId, OutputState)>,
|
||||
pub struct Manager {
|
||||
/// Shared output handle, current state updated whenever it's needed.
|
||||
// TODO: Stop assuming that the output never changes.
|
||||
// (There's no way for the output manager to update the ui manager.)
|
||||
// FIXME: Turn into an OutputState and apply relevant connections elsewhere.
|
||||
// Otherwise testability and predictablity is low.
|
||||
output: Option<OutputHandle>,
|
||||
//// Pixel size of the surface. Needs explicit updating.
|
||||
//surface_size: Option<Size>,
|
||||
}
|
||||
|
||||
impl ManagerState {
|
||||
/// The largest ideal heigth for the keyboard as a whole
|
||||
/// judged by the ease of hitting targets within.
|
||||
/// Ideally related to finger size, the crammedness of the layout,
|
||||
/// distance from display, and motor skills of the user.
|
||||
// FIXME: Start by making this aware of display's dpi,
|
||||
// then layout number of rows.
|
||||
fn get_max_target_height(output: &OutputState) -> u32 {
|
||||
let layout_rows = 4; // FIXME: use number from layout.
|
||||
let px_size = output.get_pixel_size();
|
||||
let phys_size = output.get_phys_size();
|
||||
|
||||
let finger_height_px = match (px_size, phys_size) {
|
||||
(Some(px_size), Some(phys_size)) => {
|
||||
// Fudged to result in 420px from the original design.
|
||||
// That gives about 9.5mm per finger height.
|
||||
// Maybe floats are not the best choice here,
|
||||
// but it gets rounded ASAP. Consider rationals.
|
||||
let keyboard_fraction_of_display: f64 = 420. / 1440.;
|
||||
let keyboard_mm = keyboard_fraction_of_display * 130.;
|
||||
let finger_height_mm = keyboard_mm / 4.;
|
||||
// TODO: Take into account target shape/area, not just height.
|
||||
finger_height_mm * px_size.height as f64 / phys_size.height as f64
|
||||
},
|
||||
(_, None) => output.scale as f64 * 52.5, // match total 420px at scale 2 from original design
|
||||
(None, Some(_)) => {
|
||||
log_print!(
|
||||
logging::Level::Surprise,
|
||||
"Output has physical size data but no pixel info",
|
||||
);
|
||||
output.scale as f64 * 52.5
|
||||
},
|
||||
};
|
||||
(layout_rows as f64 * finger_height_px) as u32
|
||||
}
|
||||
|
||||
impl Manager {
|
||||
fn get_perceptual_height(&self) -> Option<u32> {
|
||||
let output_info = (&self.current_output).as_ref()
|
||||
.map(|(_id, os)| (
|
||||
os.scale as u32,
|
||||
os.get_pixel_size(),
|
||||
ManagerState::get_max_target_height(&os),
|
||||
));
|
||||
let output_info = (&self.output).as_ref()
|
||||
.and_then(|o| o.get_state())
|
||||
.map(|os| (os.scale as u32, os.get_pixel_size()));
|
||||
match output_info {
|
||||
Some((scale, Some(px_size), target_height)) => Some({
|
||||
Some((scale, Some(px_size))) => Some({
|
||||
let height = if (px_size.width < 720) & (px_size.width > 0) {
|
||||
px_size.width * 7 / 12 // to match 360×210
|
||||
} else if px_size.width < 1080 {
|
||||
@ -148,94 +71,11 @@ impl ManagerState {
|
||||
360
|
||||
};
|
||||
|
||||
// Don't exceed half the display size.
|
||||
let height = min(height, px_size.height / 2);
|
||||
// Don't waste screen space by exceeding best target height.
|
||||
let height = min(height, target_height);
|
||||
height / scale
|
||||
// Don't exceed half the display size
|
||||
min(height, px_size.height / 2) / scale
|
||||
}),
|
||||
Some((scale, None, _)) => Some(360 / scale),
|
||||
Some((scale, None)) => Some(360 / scale),
|
||||
None => None,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pub struct Manager {
|
||||
state: ManagerState,
|
||||
surface: Option<c::PhoshLayerSurface>,
|
||||
}
|
||||
|
||||
impl Manager {
|
||||
fn new() -> Manager {
|
||||
Manager {
|
||||
state: ManagerState { current_output: None, },
|
||||
surface: None,
|
||||
}
|
||||
}
|
||||
fn set_output(&mut self, output: OutputHandle) {
|
||||
let output_state = output.get_state()
|
||||
.or_warn(
|
||||
&mut logging::Print,
|
||||
logging::Problem::Bug,
|
||||
// This is really bad. It only happens when the layer surface
|
||||
// is placed, and it happens once.
|
||||
// The layer surface is on an output that can't be tracked.
|
||||
"Tried to set output that's not known to exist. Ignoring.",
|
||||
);
|
||||
self.state.current_output = output_state.map(
|
||||
|state| (output.get_id(), state)
|
||||
);
|
||||
// TODO: At the time of writing, this function is only used once,
|
||||
// before the layer surface is initialized.
|
||||
// Therefore it doesn't update anything. Maybe it should in the future,
|
||||
// if it sees more use.
|
||||
}
|
||||
|
||||
fn handle_output_change(&mut self, output: OutputHandle) {
|
||||
let (id, output_state) = match &self.state.current_output {
|
||||
Some((id, state)) => {
|
||||
if *id != output.get_id() { return } // Not the current output.
|
||||
else { (id.clone(), state.clone()) }
|
||||
},
|
||||
None => return, // Keyboard isn't on any output.
|
||||
};
|
||||
if let Some(new_output_state) = output.get_state() {
|
||||
if new_output_state != output_state {
|
||||
let new_state = ManagerState {
|
||||
current_output: Some((id.clone(), new_output_state)),
|
||||
..self.state.clone()
|
||||
};
|
||||
if let Some(surface) = &self.surface {
|
||||
let new_height = new_state.get_perceptual_height();
|
||||
if new_height != self.state.get_perceptual_height() {
|
||||
// TODO: here hard-size the keyboard and suggestion box too.
|
||||
match new_height {
|
||||
Some(new_height) => unsafe {
|
||||
c::squeek_manager_set_surface_height(
|
||||
*surface,
|
||||
new_height,
|
||||
)
|
||||
}
|
||||
None => log_print!(
|
||||
logging::Level::Bug,
|
||||
"Can't calculate new size",
|
||||
),
|
||||
}
|
||||
}
|
||||
}
|
||||
self.state = new_state;
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
fn register_output_man(
|
||||
ui_man: Rc<RefCell<Manager>>,
|
||||
output_man: &mut Outputs,
|
||||
) {
|
||||
let ui_man = ui_man.clone();
|
||||
output_man.set_update_cb(Box::new(move |output: OutputHandle| {
|
||||
let mut ui_man = ui_man.borrow_mut();
|
||||
ui_man.handle_output_change(output)
|
||||
}))
|
||||
}
|
||||
|
||||
@ -94,7 +94,6 @@ pub mod c {
|
||||
}
|
||||
/// Extracts the reference to the data.
|
||||
/// It may cause problems if attempted in more than one place
|
||||
// FIXME: check for null
|
||||
pub unsafe fn unwrap(self) -> Rc<RefCell<T>> {
|
||||
Rc::from_raw(self.0)
|
||||
}
|
||||
@ -108,10 +107,6 @@ pub mod c {
|
||||
Rc::into_raw(used_rc); // prevent dropping the original reference
|
||||
rc
|
||||
}
|
||||
|
||||
pub fn is_null(&self) -> bool {
|
||||
self.0.is_null()
|
||||
}
|
||||
}
|
||||
|
||||
impl<T> Clone for Wrapped<T> {
|
||||
|
||||
@ -50,14 +50,17 @@ endforeach
|
||||
foreach layout : [
|
||||
'us', 'us_wide',
|
||||
'de', 'de_wide',
|
||||
'dk',
|
||||
'es',
|
||||
'fi',
|
||||
'fr',
|
||||
'gr',
|
||||
'it',
|
||||
'jp+kana','jp+kana_wide',
|
||||
'no',
|
||||
'number',
|
||||
'pl', 'pl_wide',
|
||||
'ru',
|
||||
'se',
|
||||
'terminal',
|
||||
|
||||
|
||||
Reference in New Issue
Block a user