Compare commits

..

No commits in common. "769d7e84e924d068ac301866be8402d758babe45" and "2e91b3a9eefefc228453ebaa3ec20a0c781a8fd7" have entirely different histories.

15 changed files with 76 additions and 222 deletions

179
Cargo.lock generated
View file

@ -496,12 +496,12 @@ checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5"
[[package]] [[package]]
name = "errno" name = "errno"
version = "0.3.8" version = "0.3.7"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a258e46cdc063eb8519c00b9fc845fc47bcfca4130e2f08e88665ceda8474245" checksum = "f258a7194e7f7c2a7837a8913aeab7fd8c383457034fa20ce4dd3dcb813e8eb8"
dependencies = [ dependencies = [
"libc", "libc",
"windows-sys 0.52.0", "windows-sys 0.48.0",
] ]
[[package]] [[package]]
@ -543,12 +543,12 @@ checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1"
[[package]] [[package]]
name = "fontdue" name = "fontdue"
version = "0.8.0" version = "0.7.3"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9099a2f86b8e674b75d03ff154b3fe4c5208ed249ced8d69cc313a9fa40bb488" checksum = "0793f5137567643cf65ea42043a538804ff0fbf288649e2141442b602d81f9bc"
dependencies = [ dependencies = [
"hashbrown", "hashbrown 0.13.2",
"ttf-parser", "ttf-parser 0.15.2",
] ]
[[package]] [[package]]
@ -650,9 +650,9 @@ dependencies = [
[[package]] [[package]]
name = "gimli" name = "gimli"
version = "0.28.1" version = "0.28.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253" checksum = "6fb8d784f27acf97159b40fc4db5ecd8aa23b9ad5ef69cdd136d3bc80665f0c0"
[[package]] [[package]]
name = "gl_generator" name = "gl_generator"
@ -768,9 +768,18 @@ dependencies = [
[[package]] [[package]]
name = "hashbrown" name = "hashbrown"
version = "0.14.3" version = "0.13.2"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" checksum = "43a3c133739dddd0d2990f9a4bdf8eb4b21ef50e4851ca85ab661199821d510e"
dependencies = [
"ahash",
]
[[package]]
name = "hashbrown"
version = "0.14.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f93e7192158dbcda357bdec5fb5788eebf8bbac027f3f33e719d29135ae84156"
dependencies = [ dependencies = [
"ahash", "ahash",
"allocator-api2", "allocator-api2",
@ -841,7 +850,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d530e1a18b1cb4c484e6e34556a0d948706958449fca0cab753d649f2bce3d1f" checksum = "d530e1a18b1cb4c484e6e34556a0d948706958449fca0cab753d649f2bce3d1f"
dependencies = [ dependencies = [
"equivalent", "equivalent",
"hashbrown", "hashbrown 0.14.2",
] ]
[[package]] [[package]]
@ -924,9 +933,9 @@ dependencies = [
[[package]] [[package]]
name = "js-sys" name = "js-sys"
version = "0.3.66" version = "0.3.65"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cee9c64da59eae3b50095c18d3e74f8b73c0b86d2792824ff01bbce68ba229ca" checksum = "54c0c35952f67de54bb584e9fd912b3023117cbafc0a77d8f3dee1fb5f572fe8"
dependencies = [ dependencies = [
"wasm-bindgen", "wasm-bindgen",
] ]
@ -949,12 +958,11 @@ dependencies = [
"glium", "glium",
"glutin", "glutin",
"glutin-winit", "glutin-winit",
"hashbrown", "hashbrown 0.14.2",
"image", "image",
"kubi-logging", "kubi-logging",
"kubi-shared", "kubi-shared",
"kubi-ui", "kubi-ui",
"kubi-ui-glium",
"log", "log",
"lz4_flex", "lz4_flex",
"ndk", "ndk",
@ -992,7 +1000,7 @@ dependencies = [
"anyhow", "anyhow",
"flume", "flume",
"glam", "glam",
"hashbrown", "hashbrown 0.14.2",
"kubi-logging", "kubi-logging",
"kubi-shared", "kubi-shared",
"log", "log",
@ -1015,7 +1023,7 @@ dependencies = [
"bincode", "bincode",
"bracket-noise", "bracket-noise",
"glam", "glam",
"hashbrown", "hashbrown 0.14.2",
"nohash-hasher", "nohash-hasher",
"num_enum", "num_enum",
"nz", "nz",
@ -1035,25 +1043,14 @@ dependencies = [
"fontdue", "fontdue",
"glam", "glam",
"glium", "glium",
"hashbrown", "hashbrown 0.14.2",
"kubi-logging", "kubi-logging",
"kubi-ui-glium",
"log", "log",
"nohash-hasher", "nohash-hasher",
"rect_packer", "rect_packer",
"winit", "winit",
] ]
[[package]]
name = "kubi-ui-glium"
version = "0.1.0"
dependencies = [
"glam",
"glium",
"kubi-ui",
"log",
]
[[package]] [[package]]
name = "lazy_static" name = "lazy_static"
version = "1.4.0" version = "1.4.0"
@ -1387,7 +1384,7 @@ version = "0.20.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d4586edfe4c648c71797a74c84bacb32b52b212eff5dfe2bb9f2c599844023e7" checksum = "d4586edfe4c648c71797a74c84bacb32b52b212eff5dfe2bb9f2c599844023e7"
dependencies = [ dependencies = [
"ttf-parser", "ttf-parser 0.20.0",
] ]
[[package]] [[package]]
@ -1402,9 +1399,9 @@ dependencies = [
[[package]] [[package]]
name = "percent-encoding" name = "percent-encoding"
version = "2.3.1" version = "2.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" checksum = "9b2a4787296e9989611394c33f193f676704af1686e70b8f8033ab5ba9a35a94"
[[package]] [[package]]
name = "pin-project-lite" name = "pin-project-lite"
@ -1433,16 +1430,16 @@ dependencies = [
[[package]] [[package]]
name = "polling" name = "polling"
version = "3.3.1" version = "3.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cf63fa624ab313c11656b4cda960bfc46c410187ad493c41f6ba2d8c1e991c9e" checksum = "e53b6af1f60f36f8c2ac2aad5459d75a5a9b4be1e8cdd40264f315d78193e531"
dependencies = [ dependencies = [
"cfg-if", "cfg-if",
"concurrent-queue", "concurrent-queue",
"pin-project-lite", "pin-project-lite",
"rustix", "rustix",
"tracing", "tracing",
"windows-sys 0.52.0", "windows-sys 0.48.0",
] ]
[[package]] [[package]]
@ -1474,9 +1471,9 @@ dependencies = [
[[package]] [[package]]
name = "proc-macro2" name = "proc-macro2"
version = "1.0.70" version = "1.0.69"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "39278fbbf5fb4f646ce651690877f89d1c5811a3d4acb27700c1cb3cdb78fd3b" checksum = "134c189feb4956b20f6f547d2cf727d4c0fe06722b20a0eec87ed445a97f92da"
dependencies = [ dependencies = [
"unicode-ident", "unicode-ident",
] ]
@ -1769,7 +1766,7 @@ name = "shipyard"
version = "0.6.0" version = "0.6.0"
source = "git+https://github.com/leudz/shipyard?rev=8ef90ea6c4d1eb6c9cb0988f0d2f873f75044d49#8ef90ea6c4d1eb6c9cb0988f0d2f873f75044d49" source = "git+https://github.com/leudz/shipyard?rev=8ef90ea6c4d1eb6c9cb0988f0d2f873f75044d49#8ef90ea6c4d1eb6c9cb0988f0d2f873f75044d49"
dependencies = [ dependencies = [
"hashbrown", "hashbrown 0.14.2",
"lock_api", "lock_api",
"rayon", "rayon",
"serde", "serde",
@ -2038,6 +2035,12 @@ version = "0.1.32"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54"
[[package]]
name = "ttf-parser"
version = "0.15.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7b3e06c9b9d80ed6b745c7159c40b311ad2916abb34a49e9be2653b90db0d8dd"
[[package]] [[package]]
name = "ttf-parser" name = "ttf-parser"
version = "0.20.0" version = "0.20.0"
@ -2101,9 +2104,9 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423"
[[package]] [[package]]
name = "wasm-bindgen" name = "wasm-bindgen"
version = "0.2.89" version = "0.2.88"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0ed0d4f68a3015cc185aff4db9506a015f4b96f95303897bfa23f846db54064e" checksum = "7daec296f25a1bae309c0cd5c29c4b260e510e6d813c286b19eaadf409d40fce"
dependencies = [ dependencies = [
"cfg-if", "cfg-if",
"wasm-bindgen-macro", "wasm-bindgen-macro",
@ -2111,9 +2114,9 @@ dependencies = [
[[package]] [[package]]
name = "wasm-bindgen-backend" name = "wasm-bindgen-backend"
version = "0.2.89" version = "0.2.88"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1b56f625e64f3a1084ded111c4d5f477df9f8c92df113852fa5a374dbda78826" checksum = "e397f4664c0e4e428e8313a469aaa58310d302159845980fd23b0f22a847f217"
dependencies = [ dependencies = [
"bumpalo", "bumpalo",
"log", "log",
@ -2126,9 +2129,9 @@ dependencies = [
[[package]] [[package]]
name = "wasm-bindgen-futures" name = "wasm-bindgen-futures"
version = "0.4.39" version = "0.4.38"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ac36a15a220124ac510204aec1c3e5db8a22ab06fd6706d881dc6149f8ed9a12" checksum = "9afec9963e3d0994cac82455b2b3502b81a7f40f9a0d32181f7528d9f4b43e02"
dependencies = [ dependencies = [
"cfg-if", "cfg-if",
"js-sys", "js-sys",
@ -2138,9 +2141,9 @@ dependencies = [
[[package]] [[package]]
name = "wasm-bindgen-macro" name = "wasm-bindgen-macro"
version = "0.2.89" version = "0.2.88"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0162dbf37223cd2afce98f3d0785506dcb8d266223983e4b5b525859e6e182b2" checksum = "5961017b3b08ad5f3fe39f1e79877f8ee7c23c5e5fd5eb80de95abc41f1f16b2"
dependencies = [ dependencies = [
"quote", "quote",
"wasm-bindgen-macro-support", "wasm-bindgen-macro-support",
@ -2148,9 +2151,9 @@ dependencies = [
[[package]] [[package]]
name = "wasm-bindgen-macro-support" name = "wasm-bindgen-macro-support"
version = "0.2.89" version = "0.2.88"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f0eb82fcb7930ae6219a7ecfd55b217f5f0893484b7a13022ebb2b2bf20b5283" checksum = "c5353b8dab669f5e10f5bd76df26a9360c748f054f862ff5f3f8aae0c7fb3907"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
@ -2161,9 +2164,9 @@ dependencies = [
[[package]] [[package]]
name = "wasm-bindgen-shared" name = "wasm-bindgen-shared"
version = "0.2.89" version = "0.2.88"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7ab9b36309365056cd639da3134bf87fa8f3d86008abf99e612384a6eecd459f" checksum = "0d046c5d029ba91a1ed14da14dca44b68bf2f124cfbaf741c54151fdb3e0750b"
[[package]] [[package]]
name = "wayland-backend" name = "wayland-backend"
@ -2276,9 +2279,9 @@ dependencies = [
[[package]] [[package]]
name = "web-sys" name = "web-sys"
version = "0.3.66" version = "0.3.65"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "50c24a44ec86bb68fbecd1b3efed7e85ea5621b39b35ef2766b66cd984f8010f" checksum = "5db499c5f66323272151db0e666cd34f78617522fb0c1604d31a27c50c206a85"
dependencies = [ dependencies = [
"js-sys", "js-sys",
"wasm-bindgen", "wasm-bindgen",
@ -2352,15 +2355,6 @@ dependencies = [
"windows-targets 0.48.5", "windows-targets 0.48.5",
] ]
[[package]]
name = "windows-sys"
version = "0.52.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d"
dependencies = [
"windows-targets 0.52.0",
]
[[package]] [[package]]
name = "windows-targets" name = "windows-targets"
version = "0.42.2" version = "0.42.2"
@ -2391,21 +2385,6 @@ dependencies = [
"windows_x86_64_msvc 0.48.5", "windows_x86_64_msvc 0.48.5",
] ]
[[package]]
name = "windows-targets"
version = "0.52.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8a18201040b24831fbb9e4eb208f8892e1f50a37feb53cc7ff887feb8f50e7cd"
dependencies = [
"windows_aarch64_gnullvm 0.52.0",
"windows_aarch64_msvc 0.52.0",
"windows_i686_gnu 0.52.0",
"windows_i686_msvc 0.52.0",
"windows_x86_64_gnu 0.52.0",
"windows_x86_64_gnullvm 0.52.0",
"windows_x86_64_msvc 0.52.0",
]
[[package]] [[package]]
name = "windows_aarch64_gnullvm" name = "windows_aarch64_gnullvm"
version = "0.42.2" version = "0.42.2"
@ -2418,12 +2397,6 @@ version = "0.48.5"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8"
[[package]]
name = "windows_aarch64_gnullvm"
version = "0.52.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cb7764e35d4db8a7921e09562a0304bf2f93e0a51bfccee0bd0bb0b666b015ea"
[[package]] [[package]]
name = "windows_aarch64_msvc" name = "windows_aarch64_msvc"
version = "0.42.2" version = "0.42.2"
@ -2436,12 +2409,6 @@ version = "0.48.5"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc"
[[package]]
name = "windows_aarch64_msvc"
version = "0.52.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bbaa0368d4f1d2aaefc55b6fcfee13f41544ddf36801e793edbbfd7d7df075ef"
[[package]] [[package]]
name = "windows_i686_gnu" name = "windows_i686_gnu"
version = "0.42.2" version = "0.42.2"
@ -2454,12 +2421,6 @@ version = "0.48.5"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e"
[[package]]
name = "windows_i686_gnu"
version = "0.52.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a28637cb1fa3560a16915793afb20081aba2c92ee8af57b4d5f28e4b3e7df313"
[[package]] [[package]]
name = "windows_i686_msvc" name = "windows_i686_msvc"
version = "0.42.2" version = "0.42.2"
@ -2472,12 +2433,6 @@ version = "0.48.5"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406"
[[package]]
name = "windows_i686_msvc"
version = "0.52.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ffe5e8e31046ce6230cc7215707b816e339ff4d4d67c65dffa206fd0f7aa7b9a"
[[package]] [[package]]
name = "windows_x86_64_gnu" name = "windows_x86_64_gnu"
version = "0.42.2" version = "0.42.2"
@ -2490,12 +2445,6 @@ version = "0.48.5"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e"
[[package]]
name = "windows_x86_64_gnu"
version = "0.52.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3d6fa32db2bc4a2f5abeacf2b69f7992cd09dca97498da74a151a3132c26befd"
[[package]] [[package]]
name = "windows_x86_64_gnullvm" name = "windows_x86_64_gnullvm"
version = "0.42.2" version = "0.42.2"
@ -2508,12 +2457,6 @@ version = "0.48.5"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc"
[[package]]
name = "windows_x86_64_gnullvm"
version = "0.52.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1a657e1e9d3f514745a572a6846d3c7aa7dbe1658c056ed9c3344c4109a6949e"
[[package]] [[package]]
name = "windows_x86_64_msvc" name = "windows_x86_64_msvc"
version = "0.42.2" version = "0.42.2"
@ -2526,17 +2469,11 @@ version = "0.48.5"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538"
[[package]]
name = "windows_x86_64_msvc"
version = "0.52.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "dff9641d1cd4be8d1a070daf9e3773c5f67e78b4d9d42263020c057706765c04"
[[package]] [[package]]
name = "winit" name = "winit"
version = "0.29.4" version = "0.29.3"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d25d662bb83b511acd839534bb2d88521b0bbc81440969cb077d23c4db9e62c7" checksum = "161598019a9da35ab6c34dc46cd13546cba9dbf9816475d4dd9a639455016563"
dependencies = [ dependencies = [
"ahash", "ahash",
"android-activity", "android-activity",

View file

@ -1,5 +1,5 @@
[workspace] [workspace]
members = ["kubi", "kubi-server", "kubi-shared", "kubi-logging", "kubi-pool", "kubi-ui", "kubi-ui-glium"] members = ["kubi", "kubi-server", "kubi-shared", "kubi-logging", "kubi-pool", "kubi-ui"]
default-members = ["kubi"] default-members = ["kubi"]
resolver = "2" resolver = "2"

View file

@ -124,7 +124,6 @@ name = "Kubi Server" # server name
- [`kubi-ui`](kubi-ui): semi-imm.mode backend-agnostic ui system\ - [`kubi-ui`](kubi-ui): semi-imm.mode backend-agnostic ui system\
mostly ready to use, it has already replaced the Kubi legacy ui mostly ready to use, it has already replaced the Kubi legacy ui
- [`kubi-ui-glium`](kubi-ui-glium) Glium-based backend for `kubi-ui`
- [`kubi-pool`](kubi-pool): very early work-in-progress work-stealing threadpool system\ - [`kubi-pool`](kubi-pool): very early work-in-progress work-stealing threadpool system\
aiming to replace `rayon` threadpool that's currently used inside the kubi client (for more control over task priority) aiming to replace `rayon` threadpool that's currently used inside the kubi client (for more control over task priority)
- [`kubi-logging`](kubi-logging) fancy-ass custom formatter for `env-logger` - [`kubi-logging`](kubi-logging) fancy-ass custom formatter for `env-logger`

View file

@ -1,11 +0,0 @@
[package]
name = "kubi-ui-glium"
version = "0.1.0"
edition = "2021"
publish = false
[dependencies]
glium = { git = "https://github.com/glium/glium", rev = "968fc92378caf" }
kubi-ui = { path = "../kubi-ui", default-features = false }
glam = "0.24"
log = "0.4"

View file

@ -8,18 +8,19 @@ publish = false
hashbrown = "0.14" hashbrown = "0.14"
nohash-hasher = "0.2" nohash-hasher = "0.2"
glam = "0.24" glam = "0.24"
fontdue = "0.8" glium = { git = "https://github.com/glium/glium", rev = "968fc92378caf", optional = true }
fontdue = "0.7"
rect_packer = "0.2" rect_packer = "0.2"
log = "0.4" log = "0.4"
[dev-dependencies] [dev-dependencies]
kubi-logging = { path = "../kubi-logging" } kubi-logging = { path = "../kubi-logging" }
kubi-ui-glium = { path = "../kubi-ui-glium" }
glium = { git = "https://github.com/glium/glium", rev = "968fc92378caf" } glium = { git = "https://github.com/glium/glium", rev = "968fc92378caf" }
winit = "0.29" winit = "0.29"
[features] [features]
default = ["builtin_elements", "builtin_font"] default = ["builtin_elements", "builtin_font", "backend_glium"]
backend_glium = ["dep:glium"]
builtin_font = [] builtin_font = []
builtin_elements = [] builtin_elements = []
#parallel = ["dep:rayon", "fontdue/parallel"] #parallel = ["dep:rayon", "fontdue/parallel"]

View file

@ -7,14 +7,8 @@ use winit::{
}; };
use kubi_ui::{ use kubi_ui::{
KubiUi, KubiUi,
element::{ backend::glium::GliumUiRenderer, element::{progress_bar::ProgressBar, container::{Container, Sides}, UiElement}, UiSize
UiElement,
progress_bar::ProgressBar,
container::{Container, Sides}
},
UiSize
}; };
use kubi_ui_glium::GliumUiRenderer;
fn main() { fn main() {
kubi_logging::init(); kubi_logging::init();

View file

@ -1,5 +1,5 @@
use std::time::Instant; use std::time::Instant;
use glam::{UVec2, vec4}; use glam::{Vec2, IVec2, UVec2, vec4};
use glium::{backend::glutin::SimpleWindowBuilder, Surface}; use glium::{backend::glutin::SimpleWindowBuilder, Surface};
use winit::{ use winit::{
event::{Event, WindowEvent}, event::{Event, WindowEvent},
@ -7,17 +7,8 @@ use winit::{
}; };
use kubi_ui::{ use kubi_ui::{
KubiUi, KubiUi,
element::{ backend::glium::GliumUiRenderer, element::{progress_bar::ProgressBar, container::{Container, Sides, Alignment}, UiElement, rect::Rect}, UiSize, UiDirection
UiElement,
progress_bar::ProgressBar,
container::{Container, Sides, Alignment},
rect::Rect
},
interaction::IntoInteractable,
UiSize,
UiDirection,
}; };
use kubi_ui_glium::GliumUiRenderer;
fn main() { fn main() {
kubi_logging::init(); kubi_logging::init();
@ -113,19 +104,12 @@ fn main() {
}), }),
Box::new(Container { Box::new(Container {
background: Some(vec4(1., 0., 0., 1.)), background: Some(vec4(1., 0., 0., 1.)),
padding: Sides { padding: Sides::horizontal_vertical(30., 5.),
top: 10.,
bottom: 20.,
left: 30.,
right: 40.,
},
elements: vec![ elements: vec![
Box::new(Rect { Box::new(Rect {
size: (UiSize::Pixels(50.), UiSize::Pixels(50.)), size: (UiSize::Pixels(50.), UiSize::Pixels(50.)),
color: Some(vec4(1., 1., 1., 0.75)) color: Some(vec4(1., 1., 1., 0.75))
}.into_interactable().on_click(|| { })
println!("clicked");
}))
], ],
..Default::default() ..Default::default()
}) })

2
kubi-ui/src/backend.rs Normal file
View file

@ -0,0 +1,2 @@
#[cfg(feature = "backend_glium")]
pub mod glium;

View file

@ -6,10 +6,11 @@ use glium::{
index::PrimitiveType, index::PrimitiveType,
implement_vertex, uniform, implement_vertex, uniform,
}; };
use kubi_ui::draw::{UiDrawPlan, UiVertex};
const VERTEX_SHADER: &str = include_str!("../shaders/vertex.vert"); use crate::draw::{UiDrawPlan, UiVertex};
const FRAGMENT_SHADER: &str = include_str!("../shaders/fragment.frag");
const VERTEX_SHADER: &str = include_str!("../../shaders/vertex.vert");
const FRAGMENT_SHADER: &str = include_str!("../../shaders/fragment.frag");
#[derive(Clone, Copy)] #[derive(Clone, Copy)]
#[repr(C)] #[repr(C)]

View file

@ -1,51 +0,0 @@
use crate::element::UiElement;
pub struct Interactable<T: UiElement> {
pub element: T,
pub hovered: Option<Box<dyn FnOnce()>>,
pub clicked: Option<Box<dyn FnOnce()>>,
}
impl<T: UiElement> Interactable<T> {
pub fn new(element: T) -> Self {
Self {
element,
hovered: None,
clicked: None,
}
}
pub fn on_click(self, clicked: impl FnOnce() + 'static) -> Self {
Self {
clicked: Some(Box::new(clicked)),
..self
}
}
pub fn on_hover(self, clicked: impl FnOnce() + 'static) -> Self {
Self {
clicked: Some(Box::new(clicked)),
..self
}
}
}
impl<T: UiElement> UiElement for Interactable<T> {
fn measure(&self, state: &crate::state::StateRepo, layout: &crate::LayoutInfo) -> crate::measure::Response {
self.element.measure(state, layout)
}
fn process(&self, measure: &crate::measure::Response, state: &mut crate::state::StateRepo, layout: &crate::LayoutInfo, draw: &mut Vec<crate::draw::UiDrawCommand>) {
self.element.process(measure, state, layout, draw)
}
}
pub trait IntoInteractable<T: UiElement>: UiElement {
fn into_interactable(self) -> Interactable<T>;
}
impl<T: UiElement> IntoInteractable<T> for T {
fn into_interactable(self) -> Interactable<Self> {
Interactable::new(self)
}
}

View file

@ -4,10 +4,10 @@ use glam::Vec2;
pub mod element; pub mod element;
pub mod event; pub mod event;
pub mod draw; pub mod draw;
pub mod backend;
pub mod measure; pub mod measure;
pub mod state; pub mod state;
pub mod text; pub mod text;
pub mod interaction;
use element::UiElement; use element::UiElement;
use state::StateRepo; use state::StateRepo;

View file

@ -12,7 +12,6 @@ crate-type = ["lib", "cdylib"]
kubi-shared = { path = "../kubi-shared" } kubi-shared = { path = "../kubi-shared" }
kubi-logging = { path = "../kubi-logging" } kubi-logging = { path = "../kubi-logging" }
kubi-ui = { path = "../kubi-ui" } kubi-ui = { path = "../kubi-ui" }
kubi-ui-glium = { path = "../kubi-ui-glium" }
log = "0.4" log = "0.4"
glium = { git = "https://github.com/glium/glium", rev = "968fc92378caf" } glium = { git = "https://github.com/glium/glium", rev = "968fc92378caf" }
glutin = "0.31" glutin = "0.31"

View file

@ -1,5 +1,4 @@
use kubi_ui::KubiUi; use kubi_ui::{KubiUi, backend::glium::GliumUiRenderer};
use kubi_ui_glium::GliumUiRenderer;
use shipyard::{AllStoragesView, Unique, UniqueView, NonSendSync, UniqueViewMut}; use shipyard::{AllStoragesView, Unique, UniqueView, NonSendSync, UniqueViewMut};
use crate::rendering::{Renderer, RenderTarget, WindowSize}; use crate::rendering::{Renderer, RenderTarget, WindowSize};