diff --git a/.vscode/settings.json b/.vscode/settings.json index 11be70c0..9a04779c 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -32,14 +32,15 @@ "qcoreapplication": "cpp", "qmetaenum": "cpp", "random": "cpp", - "optional": "cpp" + "optional": "cpp", + "gtk.h": "c" }, "yaml.customTags": [ "!Mode scalar", "!Toggle sequence", "!Switch scalar", ], - "C_Cpp.errorSquiggles": "Disabled", + "C_Cpp.errorSquiggles": "disabled", "cmake.sourceDirectory": "${workspaceFolder}/src", "rust-analyzer.procMacro.enable": true, "cmake.configureOnOpen": true, diff --git a/.vscode/tasks.json b/.vscode/tasks.json index cddf2e06..167aa592 100644 --- a/.vscode/tasks.json +++ b/.vscode/tasks.json @@ -3,7 +3,7 @@ { "type": "shell", "command": [ - "nix develop -c scripts/build.sh -ad || scripts/build.sh -ad" + "scripts/build.sh -ad" ], "problemMatcher": [ "$rustc" diff --git a/Cargo.lock b/Cargo.lock index d5e64425..fe5a7f2e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2,16 +2,6 @@ # It is not intended for manual editing. version = 3 -[[package]] -name = "ab_glyph" -version = "0.2.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4dcdbc68024b653943864d436fe8a24b028095bc1cf91a8926f8241e4aaffe59" -dependencies = [ - "ab_glyph_rasterizer", - "owned_ttf_parser 0.17.1", -] - [[package]] name = "ab_glyph_rasterizer" version = "0.1.7" @@ -68,39 +58,28 @@ dependencies = [ ] [[package]] -name = "arboard" -version = "2.1.1" +name = "atk" +version = "0.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc120354d1b5ec6d7aaf4876b602def75595937b5e15d356eb554ab5177e08bb" +checksum = "39991bc421ddf72f70159011b323ff49b0f783cc676a7287c59453da2e2531cf" dependencies = [ - "clipboard-win", - "log", - "objc", - "objc-foundation", - "objc_id", - "parking_lot", - "thiserror", - "winapi", - "x11rb 0.9.0", + "atk-sys", + "bitflags", + "glib", + "libc", ] [[package]] -name = "arrayref" -version = "0.3.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4c527152e37cf757a3f78aae5a06fbeefdb07ccc535c980a3208ee3060dd544" - -[[package]] -name = "arrayvec" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23b62fc65de8e4e7f52534fb52b0f3ed04746ae267519eef2a83941e8085068b" - -[[package]] -name = "atomic_refcell" -version = "0.1.8" +name = "atk-sys" +version = "0.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73b5e5f48b927f04e952dedc932f31995a65a0bf65ec971c74436e51bf6e970d" +checksum = "11ad703eb64dc058024f0e57ccfa069e15a413b98dbd50a1a950e743b7f11148" +dependencies = [ + "glib-sys", + "gobject-sys", + "libc", + "system-deps", +] [[package]] name = "atty" @@ -151,12 +130,6 @@ version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" -[[package]] -name = "block" -version = "0.1.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d8c1fef690941d3e7788d328517591fecc684c084084702d6ff1641e993699a" - [[package]] name = "boxfnonce" version = "0.1.1" @@ -174,20 +147,6 @@ name = "bytemuck" version = "1.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "aaa3a8d9a1ca92e282c96a32d6511b695d7d994d1d102ba85d279f9b2756947f" -dependencies = [ - "bytemuck_derive", -] - -[[package]] -name = "bytemuck_derive" -version = "1.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5fe233b960f12f8007e3db2d136e3cb1c291bfd7396e384ee76025fc1a3932b4" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] [[package]] name = "byteorder" @@ -196,22 +155,28 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" [[package]] -name = "bytes" -version = "1.3.0" +name = "cairo-rs" +version = "0.16.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dfb24e866b15a1af2a1b663f10c6b6b8f397a84aadb828f12e5b289ec23a3a3c" +checksum = "247e1183fa769ac22121f92276dae52f89acaf297f24b1320019f439b6e3b46f" +dependencies = [ + "bitflags", + "cairo-sys-rs", + "glib", + "libc", + "once_cell", + "thiserror", +] [[package]] -name = "calloop" -version = "0.10.3" +name = "cairo-sys-rs" +version = "0.16.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5bcf530afb40e45e14440701e5e996d7fd139e84a912a4d83a8d6a0fb3e58663" +checksum = "7c48f4af05fabdcfa9658178e1326efa061853f040ce7d72e33af6885196f421" dependencies = [ - "log", - "nix 0.25.0", - "slotmap", - "thiserror", - "vec_map", + "glib-sys", + "libc", + "system-deps", ] [[package]] @@ -238,18 +203,6 @@ dependencies = [ "toml", ] -[[package]] -name = "cc" -version = "1.0.77" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e9f73505338f7d905b19d18738976aae232eb46b8efc15554ffc56deb5d9ebe4" - -[[package]] -name = "cesu8" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d43a04d8753f35258c91f8ec639f792891f748a1edbd759cf1dcea3382ad83c" - [[package]] name = "cexpr" version = "0.6.0" @@ -260,19 +213,19 @@ dependencies = [ ] [[package]] -name = "cfg-if" -version = "1.0.0" +name = "cfg-expr" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" +checksum = "b0357a6402b295ca3a86bc148e84df46c02e41f41fef186bda662557ef6328aa" +dependencies = [ + "smallvec", +] [[package]] -name = "cgl" -version = "0.3.2" +name = "cfg-if" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ced0551234e87afee12411d535648dd89d2e7f34c78b753395567aff3d447ff" -dependencies = [ - "libc", -] +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "ciborium" @@ -320,7 +273,7 @@ dependencies = [ "ansi_term", "atty", "bitflags", - "strsim 0.8.0", + "strsim", "textwrap 0.11.0", "unicode-width", "vec_map", @@ -347,73 +300,12 @@ dependencies = [ "os_str_bytes", ] -[[package]] -name = "clipboard-win" -version = "4.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4ab1b92798304eedc095b53942963240037c0516452cb11aeba709d420b2219" -dependencies = [ - "error-code", - "str-buf", - "winapi", -] - -[[package]] -name = "cmake" -version = "0.1.49" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db34956e100b30725f2eb215f90d4871051239535632f84fea3bc92722c66b7c" -dependencies = [ - "cc", -] - -[[package]] -name = "cocoa" -version = "0.24.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f425db7937052c684daec3bd6375c8abe2d146dca4b8b143d6db777c39138f3a" -dependencies = [ - "bitflags", - "block", - "cocoa-foundation", - "core-foundation", - "core-graphics", - "foreign-types 0.3.2", - "libc", - "objc", -] - -[[package]] -name = "cocoa-foundation" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ade49b65d560ca58c403a479bb396592b155c0185eada742ee323d1d68d6318" -dependencies = [ - "bitflags", - "block", - "core-foundation", - "core-graphics-types", - "foreign-types 0.3.2", - "libc", - "objc", -] - [[package]] name = "color_quant" version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3d7b894f5411737b7867f4827955924d7c254fc9f4d91a6aad6b097804b1018b" -[[package]] -name = "combine" -version = "4.6.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "35ed6e9d84f0b51a7f52daf1c7d71dd136fd7a3f41a8462b8cdb8c78d920fad4" -dependencies = [ - "bytes", - "memchr", -] - [[package]] name = "const-random" version = "0.1.15" @@ -445,59 +337,6 @@ dependencies = [ "custom_derive", ] -[[package]] -name = "core-foundation" -version = "0.9.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "194a7a9e6de53fa55116934067c844d9d749312f75c6f6d0980e8c252f8c2146" -dependencies = [ - "core-foundation-sys", - "libc", -] - -[[package]] -name = "core-foundation-sys" -version = "0.8.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5827cebf4670468b8772dd191856768aedcb1b0278a04f989f7766351917b9dc" - -[[package]] -name = "core-graphics" -version = "0.22.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2581bbab3b8ffc6fcbd550bf46c355135d16e9ff2a6ea032ad6b9bf1d7efe4fb" -dependencies = [ - "bitflags", - "core-foundation", - "core-graphics-types", - "foreign-types 0.3.2", - "libc", -] - -[[package]] -name = "core-graphics-types" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3a68b68b3446082644c91ac778bf50cd4104bfb002b5a6a7c44cca5a2c70788b" -dependencies = [ - "bitflags", - "core-foundation", - "foreign-types 0.3.2", - "libc", -] - -[[package]] -name = "core-text" -version = "19.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "99d74ada66e07c1cefa18f8abfba765b486f250de2e4a999e5727fc0dd4b4a25" -dependencies = [ - "core-foundation", - "core-graphics", - "foreign-types 0.3.2", - "libc", -] - [[package]] name = "crc32fast" version = "1.3.2" @@ -586,29 +425,6 @@ dependencies = [ "cfg-if", ] -[[package]] -name = "crossfont" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21fd3add36ea31aba1520aa5288714dd63be506106753226d0eb387a93bc9c45" -dependencies = [ - "cocoa", - "core-foundation", - "core-foundation-sys", - "core-graphics", - "core-text", - "dwrote", - "foreign-types 0.5.0", - "freetype-rs", - "libc", - "log", - "objc", - "once_cell", - "pkg-config", - "servo-fontconfig", - "winapi", -] - [[package]] name = "crunchy" version = "0.2.2" @@ -635,12 +451,6 @@ dependencies = [ "winapi", ] -[[package]] -name = "cty" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b365fabc795046672053e29c954733ec3b05e4be654ab130fe8f1f94d7051f35" - [[package]] name = "custom_derive" version = "0.1.7" @@ -657,38 +467,14 @@ dependencies = [ "libc", ] -[[package]] -name = "darling" -version = "0.13.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a01d95850c592940db9b8194bc39f4bc0e89dee5c4265e4b1807c34a9aba453c" -dependencies = [ - "darling_core 0.13.4", - "darling_macro 0.13.4", -] - [[package]] name = "darling" version = "0.14.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b0dd3cd20dc6b5a876612a6e5accfe7f3dd883db6d07acfbf14c128f61550dfa" dependencies = [ - "darling_core 0.14.2", - "darling_macro 0.14.2", -] - -[[package]] -name = "darling_core" -version = "0.13.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "859d65a907b6852c9361e3185c862aae7fafd2887876799fa55f5f99dc40d610" -dependencies = [ - "fnv", - "ident_case", - "proc-macro2", - "quote", - "strsim 0.10.0", - "syn", + "darling_core", + "darling_macro", ] [[package]] @@ -704,24 +490,13 @@ dependencies = [ "syn", ] -[[package]] -name = "darling_macro" -version = "0.13.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c972679f83bdf9c42bd905396b6c3588a843a17f0f16dfcfa3e2c5d57441835" -dependencies = [ - "darling_core 0.13.4", - "quote", - "syn", -] - [[package]] name = "darling_macro" version = "0.14.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7618812407e9402654622dd402b0a89dff9ba93badd6540781526117b92aab7e" dependencies = [ - "darling_core 0.14.2", + "darling_core", "quote", "syn", ] @@ -783,120 +558,18 @@ dependencies = [ "winapi", ] -[[package]] -name = "dispatch" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd0c93bb4b0c6d9b77f4435b0ae98c24d17f1c45b2ff844c6151a07256ca923b" - -[[package]] -name = "dlib" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac1b7517328c04c2aa68422fc60a41b92208182142ed04a25879c26c8f878794" -dependencies = [ - "libloading", -] - [[package]] name = "downcast-rs" version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9ea835d29036a4087793836fa931b08837ad5e957da9e23886b29586fb9b6650" -[[package]] -name = "dwrote" -version = "0.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "439a1c2ba5611ad3ed731280541d36d2e9c4ac5e7fb818a27b604bdc5a6aa65b" -dependencies = [ - "lazy_static", - "libc", - "serde", - "serde_derive", - "winapi", - "wio", -] - -[[package]] -name = "eframe" -version = "0.19.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0d49426c3e72a6728b0c790d22db8bf7bbcff10d83b8b6f3a01295be982302e" -dependencies = [ - "bytemuck", - "egui", - "egui-winit", - "egui_glow", - "getrandom 0.2.8", - "glow", - "glutin", - "js-sys", - "percent-encoding", - "tracing", - "wasm-bindgen", - "wasm-bindgen-futures", - "web-sys", - "winit", -] - -[[package]] -name = "egui" -version = "0.19.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc9fcd393c3daaaf5909008a1d948319d538b79c51871e4df0993260260a94e4" -dependencies = [ - "ahash", - "epaint", - "nohash-hasher", - "tracing", -] - -[[package]] -name = "egui-winit" -version = "0.19.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07ddc525334c416e11580123e147b970f738507f427c9fb1cd09ea2dd7416a3a" -dependencies = [ - "arboard", - "egui", - "instant", - "smithay-clipboard", - "tracing", - "webbrowser", - "winit", -] - -[[package]] -name = "egui_glow" -version = "0.19.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad77d4a00402bae9658ee64be148f4b2a0b38e4fc7874970575ca01ed1c5b75d" -dependencies = [ - "bytemuck", - "egui", - "glow", - "memoffset 0.6.5", - "tracing", - "wasm-bindgen", - "web-sys", -] - [[package]] name = "either" version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "90e5c1c8368803113bf0c9584fc495a58b86dc8a29edbf8fe877d21d9507e797" -[[package]] -name = "emath" -version = "0.19.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9542a40106fdba943a055f418d1746a050e1a903a049b030c2b097d4686a33cf" -dependencies = [ - "bytemuck", -] - [[package]] name = "encoding_rs" version = "0.8.31" @@ -942,47 +615,12 @@ version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "03e7b551eba279bf0fa88b83a46330168c1560a52a94f5126f892f0b364ab3e0" dependencies = [ - "darling 0.14.2", + "darling", "proc-macro2", "quote", "syn", ] -[[package]] -name = "epaint" -version = "0.19.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ba04741be7f6602b1a1b28f1082cce45948a7032961c52814f8946b28493300" -dependencies = [ - "ab_glyph", - "ahash", - "atomic_refcell", - "bytemuck", - "emath", - "nohash-hasher", - "parking_lot", -] - -[[package]] -name = "error-code" -version = "2.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64f18991e7bf11e7ffee451b5318b5c1a73c52d0d0ada6e5a3017c8c1ced6a21" -dependencies = [ - "libc", - "str-buf", -] - -[[package]] -name = "expat-sys" -version = "2.1.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "658f19728920138342f68408b7cf7644d90d4784353d8ebc32e7e8663dbe45fa" -dependencies = [ - "cmake", - "pkg-config", -] - [[package]] name = "exr" version = "1.5.2" @@ -1007,6 +645,16 @@ dependencies = [ "instant", ] +[[package]] +name = "field-offset" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e1c54951450cbd39f3dbcf1005ac413b49487dabf18a720ad2383eccfeffb92" +dependencies = [ + "memoffset 0.6.5", + "rustc_version", +] + [[package]] name = "flate2" version = "1.0.25" @@ -1058,29 +706,42 @@ dependencies = [ ] [[package]] -name = "foreign-types" -version = "0.3.2" +name = "futures-channel" +version = "0.3.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" +checksum = "52ba265a92256105f45b719605a571ffe2d1f0fea3807304b522c1d778f79eed" dependencies = [ - "foreign-types-shared 0.1.1", + "futures-core", ] [[package]] -name = "foreign-types" -version = "0.5.0" +name = "futures-core" +version = "0.3.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "04909a7a7e4633ae6c4a9ab280aeb86da1236243a77b694a49eacd659a4bd3ac" + +[[package]] +name = "futures-executor" +version = "0.3.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d737d9aa519fb7b749cbc3b962edcf310a8dd1f4b67c91c4f83975dbdd17d965" +checksum = "7acc85df6714c176ab5edf386123fafe217be88c0840ec11f199441134a074e2" dependencies = [ - "foreign-types-macros", - "foreign-types-shared 0.3.1", + "futures-core", + "futures-task", + "futures-util", ] [[package]] -name = "foreign-types-macros" -version = "0.2.2" +name = "futures-io" +version = "0.3.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8469d0d40519bc608ec6863f1cc88f3f1deee15913f2f3b3e573d81ed38cccc" +checksum = "00f5fb52a06bdcadeb54e8d3671f8888a39697dcb0b81b23b55174030427f4eb" + +[[package]] +name = "futures-macro" +version = "0.3.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bdfb8ce053d86b91919aad980c220b1fb8401a9394410e1c289ed7e66b61835d" dependencies = [ "proc-macro2", "quote", @@ -1088,59 +749,89 @@ dependencies = [ ] [[package]] -name = "foreign-types-shared" -version = "0.1.1" +name = "futures-sink" +version = "0.3.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" +checksum = "39c15cf1a4aa79df40f1bb462fb39676d0ad9e366c2a33b590d7c66f4f81fcf9" [[package]] -name = "foreign-types-shared" -version = "0.3.1" +name = "futures-task" +version = "0.3.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aa9a19cbb55df58761df49b23516a86d432839add4af60fc256da840f66ed35b" +checksum = "2ffb393ac5d9a6eaa9d3fdf37ae2776656b706e200c8e16b1bdb227f5198e6ea" [[package]] -name = "form_urlencoded" -version = "1.1.0" +name = "futures-util" +version = "0.3.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a9c384f161156f5260c24a097c56119f9be8c798586aecc13afbcbe7b7e26bf8" +checksum = "197676987abd2f9cadff84926f410af1c183608d36641465df73ae8211dc65d6" dependencies = [ - "percent-encoding", + "futures-core", + "futures-macro", + "futures-task", + "pin-project-lite", + "pin-utils", + "slab", ] [[package]] -name = "freetype-rs" -version = "0.26.0" +name = "gdk" +version = "0.16.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74eadec9d0a5c28c54bb9882e54787275152a4e36ce206b45d7451384e5bf5fb" +checksum = "aa9cb33da481c6c040404a11f8212d193889e9b435db2c14fd86987f630d3ce1" dependencies = [ "bitflags", - "freetype-sys", + "cairo-rs", + "gdk-pixbuf", + "gdk-sys", + "gio", + "glib", "libc", + "pango", ] [[package]] -name = "freetype-sys" -version = "0.13.1" +name = "gdk-pixbuf" +version = "0.16.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a37d4011c0cc628dfa766fcc195454f4b068d7afdc2adfd28861191d866e731a" +checksum = "d3094f2b8578136d1929cade4e0fff82f573521b579e96cfc24af2458431f176" dependencies = [ - "cmake", + "bitflags", + "gdk-pixbuf-sys", + "gio", + "glib", "libc", - "pkg-config", ] [[package]] -name = "futures-core" -version = "0.3.25" +name = "gdk-pixbuf-sys" +version = "0.16.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04909a7a7e4633ae6c4a9ab280aeb86da1236243a77b694a49eacd659a4bd3ac" +checksum = "3092cf797a5f1210479ea38070d9ae8a5b8e9f8f1be9f32f4643c529c7d70016" +dependencies = [ + "gio-sys", + "glib-sys", + "gobject-sys", + "libc", + "system-deps", +] [[package]] -name = "futures-sink" -version = "0.3.25" +name = "gdk-sys" +version = "0.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39c15cf1a4aa79df40f1bb462fb39676d0ad9e366c2a33b590d7c66f4f81fcf9" +checksum = "d76354f97a913e55b984759a997b693aa7dc71068c9e98bcce51aa167a0a5c5a" +dependencies = [ + "cairo-sys-rs", + "gdk-pixbuf-sys", + "gio-sys", + "glib-sys", + "gobject-sys", + "libc", + "pango-sys", + "pkg-config", + "system-deps", +] [[package]] name = "gethostname" @@ -1180,21 +871,90 @@ dependencies = [ name = "gif" version = "0.11.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3edd93c6756b4dfaf2709eafcc345ba2636565295c198a9cfbf75fa5e3e00b06" +checksum = "3edd93c6756b4dfaf2709eafcc345ba2636565295c198a9cfbf75fa5e3e00b06" +dependencies = [ + "color_quant", + "weezl", +] + +[[package]] +name = "gio" +version = "0.16.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e8fac6c15256cdf84beb9a4948f786f9605799ad69675ea1b8932753f3aa94cf" +dependencies = [ + "bitflags", + "futures-channel", + "futures-core", + "futures-io", + "futures-util", + "gio-sys", + "glib", + "libc", + "once_cell", + "pin-project-lite", + "smallvec", + "thiserror", +] + +[[package]] +name = "gio-sys" +version = "0.16.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e9b693b8e39d042a95547fc258a7b07349b1f0b48f4b2fa3108ba3c51c0b5229" +dependencies = [ + "glib-sys", + "gobject-sys", + "libc", + "system-deps", + "winapi", +] + +[[package]] +name = "glib" +version = "0.16.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "89359c8c338310b46300502814fc5a0350bb731ddfea03d0ec725d32163244b7" +dependencies = [ + "bitflags", + "futures-channel", + "futures-core", + "futures-executor", + "futures-task", + "futures-util", + "gio-sys", + "glib-macros", + "glib-sys", + "gobject-sys", + "libc", + "once_cell", + "smallvec", + "thiserror", +] + +[[package]] +name = "glib-macros" +version = "0.16.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e084807350b01348b6d9dbabb724d1a0bb987f47a2c85de200e98e12e30733bf" dependencies = [ - "color_quant", - "weezl", + "anyhow", + "heck", + "proc-macro-crate", + "proc-macro-error", + "proc-macro2", + "quote", + "syn", ] [[package]] -name = "gl_generator" -version = "0.14.0" +name = "glib-sys" +version = "0.16.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a95dfc23a2b4a9a2f5ab41d194f8bfda3cabec42af4e39f08c339eb2a0c124d" +checksum = "c61a4f46316d06bfa33a7ac22df6f0524c8be58e3db2d9ca99ccb1f357b62a65" dependencies = [ - "khronos_api", - "log", - "xml-rs", + "libc", + "system-deps", ] [[package]] @@ -1204,80 +964,97 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9b919933a397b79c37e33b77bb2aa3dc8eb6e165ad809e58ff75bc7db2e34574" [[package]] -name = "glow" -version = "0.11.2" +name = "gobject-sys" +version = "0.16.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d8bd5877156a19b8ac83a29b2306fe20537429d318f3ff0a1a2119f8d9c61919" +checksum = "3520bb9c07ae2a12c7f2fbb24d4efc11231c8146a86956413fb1a79bb760a0f1" dependencies = [ - "js-sys", - "slotmap", - "wasm-bindgen", - "web-sys", + "glib-sys", + "libc", + "system-deps", ] [[package]] -name = "glutin" -version = "0.29.1" +name = "gtk" +version = "0.16.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "444c9ad294fdcaf20ccf6726b78f380b5450275540c9b68ab62f49726ad1c713" +checksum = "e4d3507d43908c866c805f74c9dd593c0ce7ba5c38e576e41846639cdcd4bee6" dependencies = [ - "cgl", - "cocoa", - "core-foundation", - "glutin_egl_sys", - "glutin_gles2_sys", - "glutin_glx_sys", - "glutin_wgl_sys", - "libloading", - "log", - "objc", + "atk", + "bitflags", + "cairo-rs", + "field-offset", + "futures-channel", + "gdk", + "gdk-pixbuf", + "gio", + "glib", + "gtk-sys", + "gtk3-macros", + "libc", "once_cell", - "osmesa-sys", - "parking_lot", - "raw-window-handle 0.5.0", - "wayland-client", - "wayland-egl", - "winapi", - "winit", + "pango", + "pkg-config", ] [[package]] -name = "glutin_egl_sys" -version = "0.1.6" +name = "gtk-layer-shell" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68900f84b471f31ea1d1355567eb865a2cf446294f06cef8d653ed7bcf5f013d" +checksum = "9f0ef12cc0d52f9226cbfc83f766a52fc667002ed15ddd1c37a388abe7d03f8c" dependencies = [ - "gl_generator", - "winapi", + "bitflags", + "gdk", + "glib", + "glib-sys", + "gtk", + "gtk-layer-shell-sys", + "libc", ] [[package]] -name = "glutin_gles2_sys" -version = "0.1.5" +name = "gtk-layer-shell-sys" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8094e708b730a7c8a1954f4f8a31880af00eb8a1c5b5bf85d28a0a3c6d69103" +checksum = "7095dbaf56028d8a238e8b8f3039a537587cb7a6efbdba2b539375fe5689295d" dependencies = [ - "gl_generator", - "objc", + "gdk-sys", + "glib-sys", + "gtk-sys", + "libc", + "system-deps", ] [[package]] -name = "glutin_glx_sys" -version = "0.1.8" +name = "gtk-sys" +version = "0.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d93d0575865098580c5b3a423188cd959419912ea60b1e48e8b3b526f6d02468" +checksum = "89b5f8946685d5fe44497007786600c2f368ff6b1e61a16251c89f72a97520a3" dependencies = [ - "gl_generator", - "x11-dl", + "atk-sys", + "cairo-sys-rs", + "gdk-pixbuf-sys", + "gdk-sys", + "gio-sys", + "glib-sys", + "gobject-sys", + "libc", + "pango-sys", + "system-deps", ] [[package]] -name = "glutin_wgl_sys" -version = "0.1.5" +name = "gtk3-macros" +version = "0.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3da5951a1569dbab865c6f2a863efafff193a93caf05538d193e9e3816d21696" +checksum = "8cfd6557b1018b773e43c8de9d0d13581d6b36190d0501916cbec4731db5ccff" dependencies = [ - "gl_generator", + "anyhow", + "proc-macro-crate", + "proc-macro-error", + "proc-macro2", + "quote", + "syn", ] [[package]] @@ -1328,16 +1105,6 @@ version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" -[[package]] -name = "idna" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e14ddfc70884202db2244c223200c204c2bda1bc6e0998d11b5e024d657209e6" -dependencies = [ - "unicode-bidi", - "unicode-normalization", -] - [[package]] name = "image" version = "0.24.5" @@ -1392,9 +1159,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" dependencies = [ "cfg-if", - "js-sys", - "wasm-bindgen", - "web-sys", ] [[package]] @@ -1412,26 +1176,6 @@ version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4217ad341ebadf8d8e724e264f13e593e0648f5b3e94b3896a5df283be015ecc" -[[package]] -name = "jni" -version = "0.19.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c6df18c2e3db7e453d3c6ac5b3e9d5182664d28788126d39b91f2d1e22b017ec" -dependencies = [ - "cesu8", - "combine", - "jni-sys", - "log", - "thiserror", - "walkdir", -] - -[[package]] -name = "jni-sys" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8eaf4bc02d17cbdd7ff4c7438cafcdf7fb9a4613313ad11b4f8fefe7d3fa0130" - [[package]] name = "jpeg-decoder" version = "0.3.0" @@ -1450,12 +1194,6 @@ dependencies = [ "wasm-bindgen", ] -[[package]] -name = "khronos_api" -version = "3.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2db585e1d738fc771bf08a151420d3ed193d9d895a36df7f6f8a9456b911ddc" - [[package]] name = "kime" version = "0.1.0" @@ -1473,9 +1211,10 @@ dependencies = [ name = "kime-candidate-window" version = "0.1.0" dependencies = [ - "eframe", - "egui", - "kime-engine-cffi", + "gdk", + "glib", + "gtk", + "gtk-layer-shell", ] [[package]] @@ -1660,7 +1399,7 @@ dependencies = [ "kime-version", "libc", "log", - "mio 0.7.14", + "mio", "mio-timerfd", "pico-args", "wayland-client", @@ -1680,7 +1419,7 @@ dependencies = [ "log", "pico-args", "rusttype", - "x11rb 0.11.0", + "x11rb", "xim", ] @@ -1729,16 +1468,6 @@ dependencies = [ "pkg-config", ] -[[package]] -name = "libloading" -version = "0.7.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b67380fd3b2fbe7527a606e18729d21c6f3951633d0500574c4dc22d2d638b9f" -dependencies = [ - "cfg-if", - "winapi", -] - [[package]] name = "lock_api" version = "0.4.9" @@ -1759,15 +1488,6 @@ dependencies = [ "serde", ] -[[package]] -name = "malloc_buf" -version = "0.0.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62bb907fe88d54d8d9ce32a3cceab4218ed2f6b7d35617cafe9adf84e43919cb" -dependencies = [ - "libc", -] - [[package]] name = "maplit" version = "1.0.2" @@ -1844,18 +1564,6 @@ dependencies = [ "winapi", ] -[[package]] -name = "mio" -version = "0.8.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5d732bc30207a6423068df043e3d02e0735b155ad7ce1a6f76fe2baa5b158de" -dependencies = [ - "libc", - "log", - "wasi 0.11.0+wasi-snapshot-preview1", - "windows-sys 0.42.0", -] - [[package]] name = "mio-timerfd" version = "0.2.0" @@ -1863,7 +1571,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "61840339b339e86a6f728531091b7626d16da3256037152ac92c66b8801c365c" dependencies = [ "libc", - "mio 0.7.14", + "mio", ] [[package]] @@ -1899,114 +1607,6 @@ dependencies = [ "getrandom 0.2.8", ] -[[package]] -name = "ndk" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2032c77e030ddee34a6787a64166008da93f6a352b629261d0fee232b8742dd4" -dependencies = [ - "bitflags", - "jni-sys", - "ndk-sys 0.3.0", - "num_enum", - "thiserror", -] - -[[package]] -name = "ndk" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "451422b7e4718271c8b5b3aadf5adedba43dc76312454b387e98fae0fc951aa0" -dependencies = [ - "bitflags", - "jni-sys", - "ndk-sys 0.4.1+23.1.7779620", - "num_enum", - "raw-window-handle 0.5.0", - "thiserror", -] - -[[package]] -name = "ndk-context" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "27b02d87554356db9e9a873add8782d4ea6e3e58ea071a9adb9a2e8ddb884a8b" - -[[package]] -name = "ndk-glue" -version = "0.6.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d0c4a7b83860226e6b4183edac21851f05d5a51756e97a1144b7f5a6b63e65f" -dependencies = [ - "lazy_static", - "libc", - "log", - "ndk 0.6.0", - "ndk-context", - "ndk-macro", - "ndk-sys 0.3.0", -] - -[[package]] -name = "ndk-glue" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0434fabdd2c15e0aab768ca31d5b7b333717f03cf02037d5a0a3ff3c278ed67f" -dependencies = [ - "libc", - "log", - "ndk 0.7.0", - "ndk-context", - "ndk-macro", - "ndk-sys 0.4.1+23.1.7779620", - "once_cell", - "parking_lot", -] - -[[package]] -name = "ndk-macro" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0df7ac00c4672f9d5aece54ee3347520b7e20f158656c7db2e6de01902eb7a6c" -dependencies = [ - "darling 0.13.4", - "proc-macro-crate", - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "ndk-sys" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e5a6ae77c8ee183dcbbba6150e2e6b9f3f4196a7666c02a715a95692ec1fa97" -dependencies = [ - "jni-sys", -] - -[[package]] -name = "ndk-sys" -version = "0.4.1+23.1.7779620" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3cf2aae958bd232cac5069850591667ad422d263686d75b52a065f9badeee5a3" -dependencies = [ - "jni-sys", -] - -[[package]] -name = "nix" -version = "0.22.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e4916f159ed8e5de0082076562152a76b7a1f64a01fd9d1e0fea002c37624faf" -dependencies = [ - "bitflags", - "cc", - "cfg-if", - "libc", - "memoffset 0.6.5", -] - [[package]] name = "nix" version = "0.24.2" @@ -2033,12 +1633,6 @@ dependencies = [ "pin-utils", ] -[[package]] -name = "nohash-hasher" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2bf50223579dc7cdcfb3bfcacf7069ff68243f8c363f62ffa99cf000a6b9c451" - [[package]] name = "nom" version = "7.1.1" @@ -2155,27 +1749,6 @@ dependencies = [ "libc", ] -[[package]] -name = "num_enum" -version = "0.5.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf5395665662ef45796a4ff5486c5d41d29e0c09640af4c5f17fd94ee2c119c9" -dependencies = [ - "num_enum_derive", -] - -[[package]] -name = "num_enum_derive" -version = "0.5.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b0498641e53dd6ac1a4f22547548caa6864cc4933784319cd1775271c5a46ce" -dependencies = [ - "proc-macro-crate", - "proc-macro2", - "quote", - "syn", -] - [[package]] name = "num_threads" version = "0.1.6" @@ -2185,35 +1758,6 @@ dependencies = [ "libc", ] -[[package]] -name = "objc" -version = "0.2.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "915b1b472bc21c53464d6c8461c9d3af805ba1ef837e1cac254428f4a77177b1" -dependencies = [ - "malloc_buf", -] - -[[package]] -name = "objc-foundation" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1add1b659e36c9607c7aab864a76c7a4c2760cd0cd2e120f3fb8b952c7e22bf9" -dependencies = [ - "block", - "objc", - "objc_id", -] - -[[package]] -name = "objc_id" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c92d4ddb4bd7b50d730c215ff871754d0da6b2178849f8a2a2ab69712d0c073b" -dependencies = [ - "objc", -] - [[package]] name = "once_cell" version = "1.16.0" @@ -2232,15 +1776,6 @@ version = "6.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9b7820b9daea5457c9f21c69448905d723fbd21136ccf521748f23fd49e723ee" -[[package]] -name = "osmesa-sys" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "88cfece6e95d2e717e0872a7f53a8684712ad13822a7979bc760b9c77ec0013b" -dependencies = [ - "shared_library", -] - [[package]] name = "output_vt100" version = "0.1.3" @@ -2260,21 +1795,38 @@ dependencies = [ ] [[package]] -name = "owned_ttf_parser" -version = "0.17.1" +name = "pad" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "18904d3c65493a9f0d7542293d1a7f69bfdc309a6b9ef4f46dc3e58b0577edc5" +checksum = "d2ad9b889f1b12e0b9ee24db044b5129150d5eada288edc800f789928dc8c0e3" dependencies = [ - "ttf-parser 0.17.1", + "unicode-width", ] [[package]] -name = "pad" -version = "0.1.6" +name = "pango" +version = "0.16.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2ad9b889f1b12e0b9ee24db044b5129150d5eada288edc800f789928dc8c0e3" +checksum = "cdff66b271861037b89d028656184059e03b0b6ccb36003820be19f7200b1e94" dependencies = [ - "unicode-width", + "bitflags", + "gio", + "glib", + "libc", + "once_cell", + "pango-sys", +] + +[[package]] +name = "pango-sys" +version = "0.16.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9e134909a9a293e04d2cc31928aa95679c5e4df954d0b85483159bd20d8f047f" +dependencies = [ + "glib-sys", + "gobject-sys", + "libc", + "system-deps", ] [[package]] @@ -2297,7 +1849,7 @@ dependencies = [ "libc", "redox_syscall", "smallvec", - "windows-sys 0.42.0", + "windows-sys", ] [[package]] @@ -2313,10 +1865,14 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "19b17cddbe7ec3f8bc800887bab5e717348c95ea2ca0b1bf0837fb964dc67099" [[package]] -name = "percent-encoding" -version = "2.2.0" +name = "pest" +version = "2.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "478c572c3d73181ff3c2539045f6eb99e5491218eae919370993b890cdbdd98e" +checksum = "cc8bed3549e0f9b0a2a78bf7c0018237a2cdf085eecbbc048e52612438e4e9d0" +dependencies = [ + "thiserror", + "ucd-trie", +] [[package]] name = "pico-args" @@ -2431,6 +1987,30 @@ dependencies = [ "toml", ] +[[package]] +name = "proc-macro-error" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" +dependencies = [ + "proc-macro-error-attr", + "proc-macro2", + "quote", + "syn", + "version_check", +] + +[[package]] +name = "proc-macro-error-attr" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" +dependencies = [ + "proc-macro2", + "quote", + "version_check", +] + [[package]] name = "proc-macro-hack" version = "0.5.19" @@ -2515,30 +2095,12 @@ dependencies = [ ] [[package]] -name = "rand_hc" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca3129af7b92a17112d59ad498c6f81eaf463253766b90396d39ea7a39d6613c" -dependencies = [ - "rand_core", -] - -[[package]] -name = "raw-window-handle" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b800beb9b6e7d2df1fe337c9e3d04e3af22a124460fb4c30fcc22c9117cefb41" -dependencies = [ - "cty", -] - -[[package]] -name = "raw-window-handle" -version = "0.5.0" +name = "rand_hc" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed7e3d950b66e19e0c372f3fa3fbbcf85b1746b571f74e0c2af6042a5c93420a" +checksum = "ca3129af7b92a17112d59ad498c6f81eaf463253766b90396d39ea7a39d6613c" dependencies = [ - "cty", + "rand_core", ] [[package]] @@ -2629,6 +2191,15 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" +[[package]] +name = "rustc_version" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0dfe2087c51c460008730de8b57e6a320782fbfb312e1f4d520e6c6fae155ee" +dependencies = [ + "semver", +] + [[package]] name = "rusttype" version = "0.9.3" @@ -2636,7 +2207,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3ff8374aa04134254b7995b63ad3dc41c7f7236f69528b28553da7d72efaa967" dependencies = [ "ab_glyph_rasterizer", - "owned_ttf_parser 0.15.2", + "owned_ttf_parser", ] [[package]] @@ -2651,15 +2222,6 @@ version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4501abdff3ae82a1c1b477a17252eb69cee9e66eb915c1abaa4f44d873df9f09" -[[package]] -name = "safe_arch" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1ff3d6d9696af502cc3110dacce942840fb06ff4514cad92236ecc455f2ce05" -dependencies = [ - "bytemuck", -] - [[package]] name = "safe_arch" version = "0.6.0" @@ -2678,12 +2240,6 @@ dependencies = [ "winapi-util", ] -[[package]] -name = "scoped-tls" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e1cf6437eb19a8f4a6cc0f7dca544973b0b78843adbfeb3683d1a94a0024a294" - [[package]] name = "scoped_threadpool" version = "0.1.9" @@ -2697,15 +2253,21 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" [[package]] -name = "sctk-adwaita" -version = "0.4.3" +name = "semver" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61270629cc6b4d77ec1907db1033d5c2e1a404c412743621981a871dc9c12339" +checksum = "f301af10236f6df4160f7c3f04eec6dbc70ace82d23326abad5edee88801c6b6" dependencies = [ - "crossfont", - "log", - "smithay-client-toolkit", - "tiny-skia", + "semver-parser", +] + +[[package]] +name = "semver-parser" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "00b0bef5b7f9e0df16536d3961cfb6e84331c065b4066afb39768d0e319411f7" +dependencies = [ + "pest", ] [[package]] @@ -2752,37 +2314,6 @@ dependencies = [ "unsafe-libyaml", ] -[[package]] -name = "servo-fontconfig" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c7e3e22fe5fd73d04ebf0daa049d3efe3eae55369ce38ab16d07ddd9ac5c217c" -dependencies = [ - "libc", - "servo-fontconfig-sys", -] - -[[package]] -name = "servo-fontconfig-sys" -version = "5.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e36b879db9892dfa40f95da1c38a835d41634b825fbd8c4c418093d53c24b388" -dependencies = [ - "expat-sys", - "freetype-sys", - "pkg-config", -] - -[[package]] -name = "shared_library" -version = "0.1.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a9e7e0f2bfae24d8a5b5a66c5b257a83c7412304311512a0c054cd5e619da11" -dependencies = [ - "lazy_static", - "libc", -] - [[package]] name = "shlex" version = "1.1.0" @@ -2814,12 +2345,12 @@ dependencies = [ ] [[package]] -name = "slotmap" -version = "1.0.6" +name = "slab" +version = "0.4.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e1e08e261d0e8f5c43123b7adf3e4ca1690d655377ac93a03b2c9d3e98de1342" +checksum = "4614a76b2a8be0058caa9dbbaf66d988527d86d003c11a94fbd335d7661edcef" dependencies = [ - "version_check", + "autocfg", ] [[package]] @@ -2828,35 +2359,6 @@ version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a507befe795404456341dfab10cef66ead4c041f62b8b11bbb92bffe5d0953e0" -[[package]] -name = "smithay-client-toolkit" -version = "0.16.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f307c47d32d2715eb2e0ece5589057820e0e5e70d07c247d1063e844e107f454" -dependencies = [ - "bitflags", - "calloop", - "dlib", - "lazy_static", - "log", - "memmap2", - "nix 0.24.2", - "pkg-config", - "wayland-client", - "wayland-cursor", - "wayland-protocols", -] - -[[package]] -name = "smithay-clipboard" -version = "0.6.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0a345c870a1fae0b1b779085e81b51e614767c239e93503588e54c5b17f4b0e8" -dependencies = [ - "smithay-client-toolkit", - "wayland-client", -] - [[package]] name = "spin" version = "0.9.4" @@ -2866,24 +2368,12 @@ dependencies = [ "lock_api", ] -[[package]] -name = "str-buf" -version = "1.0.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e08d8363704e6c71fc928674353e6b7c23dcea9d82d7012c8faf2a3a025f8d0" - [[package]] name = "strsim" version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8ea5119cdb4c55b55d432abb513a0429384878c15dde60cc77b1c99de1a95a6a" -[[package]] -name = "strsim" -version = "0.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" - [[package]] name = "strum" version = "0.24.1" @@ -2917,6 +2407,19 @@ dependencies = [ "unicode-ident", ] +[[package]] +name = "system-deps" +version = "6.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2955b1fe31e1fa2fbd1976b71cc69a606d7d4da16f6de3333d0c92d51419aeff" +dependencies = [ + "cfg-expr", + "heck", + "pkg-config", + "toml", + "version-compare", +] + [[package]] name = "tempfile" version = "3.3.0" @@ -3033,31 +2536,6 @@ dependencies = [ "crunchy", ] -[[package]] -name = "tiny-skia" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "642680569bb895b16e4b9d181c60be1ed136fa0c9c7f11d004daf053ba89bf82" -dependencies = [ - "arrayref", - "arrayvec", - "bytemuck", - "cfg-if", - "png", - "safe_arch 0.5.2", - "tiny-skia-path", -] - -[[package]] -name = "tiny-skia-path" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c114d32f0c2ee43d585367cb013dfaba967ab9f62b90d9af0d696e955e70fa6c" -dependencies = [ - "arrayref", - "bytemuck", -] - [[package]] name = "tinytemplate" version = "1.2.1" @@ -3068,21 +2546,6 @@ dependencies = [ "serde_json", ] -[[package]] -name = "tinyvec" -version = "1.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87cc5ceb3875bb20c2890005a4e226a4651264a5c75edb2421b52861a0a0cb50" -dependencies = [ - "tinyvec_macros", -] - -[[package]] -name = "tinyvec_macros" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cda74da7e1a664f795bb1f8a87ec406fb89a02522cf6e50620d016add6dbbf5c" - [[package]] name = "toml" version = "0.5.9" @@ -3092,26 +2555,6 @@ dependencies = [ "serde", ] -[[package]] -name = "tracing" -version = "0.1.37" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ce8c33a8d48bd45d624a6e523445fd21ec13d3653cd51f681abf67418f54eb8" -dependencies = [ - "cfg-if", - "pin-project-lite", - "tracing-core", -] - -[[package]] -name = "tracing-core" -version = "0.1.30" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "24eb03ba0eab1fd845050058ce5e616558e8f8d8fca633e6b163fe25c797213a" -dependencies = [ - "once_cell", -] - [[package]] name = "ttf-parser" version = "0.15.2" @@ -3131,10 +2574,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dcf81ac59edc17cc8697ff311e8f5ef2d99fcbd9817b34cec66f90b6c3dfd987" [[package]] -name = "unicode-bidi" -version = "0.3.8" +name = "ucd-trie" +version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "099b7128301d285f79ddd55b9a83d5e6b9e97c92e0ea0daebee7263e932de992" +checksum = "9e79c4d996edb816c91e4308506774452e55e95c3c9de07b6729e17e15a5ef81" [[package]] name = "unicode-ident" @@ -3142,15 +2585,6 @@ version = "1.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6ceab39d59e4c9499d4e5a8ee0e2735b891bb7308ac83dfb4e80cad195c9f6f3" -[[package]] -name = "unicode-normalization" -version = "0.1.22" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c5713f0fc4b5db668a2ac63cdb7bb4469d8c9fed047b1d0292cc7b0ce2ba921" -dependencies = [ - "tinyvec", -] - [[package]] name = "unicode-width" version = "0.1.10" @@ -3163,23 +2597,18 @@ version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c1e5fa573d8ac5f1a856f8d7be41d390ee973daf97c806b2c1a465e4e1406e68" -[[package]] -name = "url" -version = "2.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d68c799ae75762b8c3fe375feb6600ef5602c883c5d21eb51c09f22b83c4643" -dependencies = [ - "form_urlencoded", - "idna", - "percent-encoding", -] - [[package]] name = "vec_map" version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f1bddf1187be692e79c5ffeab891132dfb0f236ed36a43c7ed39f1165ee20191" +[[package]] +name = "version-compare" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "579a42fc0b8e0c63b76519a339be31bed574929511fa53c1a3acae26eb258f29" + [[package]] name = "version_check" version = "0.9.4" @@ -3234,18 +2663,6 @@ dependencies = [ "wasm-bindgen-shared", ] -[[package]] -name = "wasm-bindgen-futures" -version = "0.4.33" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23639446165ca5a5de86ae1d8896b737ae80319560fbaa4c2887b7da6e7ebd7d" -dependencies = [ - "cfg-if", - "js-sys", - "wasm-bindgen", - "web-sys", -] - [[package]] name = "wasm-bindgen-macro" version = "0.2.83" @@ -3285,7 +2702,6 @@ dependencies = [ "downcast-rs", "libc", "nix 0.24.2", - "scoped-tls", "wayland-commons", "wayland-scanner", "wayland-sys", @@ -3303,27 +2719,6 @@ dependencies = [ "wayland-sys", ] -[[package]] -name = "wayland-cursor" -version = "0.29.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6865c6b66f13d6257bef1cd40cbfe8ef2f150fb8ebbdb1e8e873455931377661" -dependencies = [ - "nix 0.24.2", - "wayland-client", - "xcursor", -] - -[[package]] -name = "wayland-egl" -version = "0.29.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "402de949f81a012926d821a2d659f930694257e76dd92b6e0042ceb27be4107d" -dependencies = [ - "wayland-client", - "wayland-sys", -] - [[package]] name = "wayland-protocols" version = "0.29.5" @@ -3353,8 +2748,6 @@ version = "0.29.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "be12ce1a3c39ec7dba25594b97b42cb3195d54953ddb9d3d95a7c3902bc6e9d4" dependencies = [ - "dlib", - "lazy_static", "pkg-config", ] @@ -3368,20 +2761,6 @@ dependencies = [ "wasm-bindgen", ] -[[package]] -name = "webbrowser" -version = "0.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc6a3cffdb686fbb24d9fb8f03a213803277ed2300f11026a3afe1f108dc021b" -dependencies = [ - "jni", - "ndk-glue 0.6.2", - "url", - "web-sys", - "widestring", - "winapi", -] - [[package]] name = "weezl" version = "0.1.7" @@ -3395,15 +2774,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ae41ecad2489a1655c8ef8489444b0b113c0a0c795944a3572a0931cf7d2525c" dependencies = [ "bytemuck", - "safe_arch 0.6.0", + "safe_arch", ] -[[package]] -name = "widestring" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "17882f045410753661207383517a6f62ec3dbeb6a4ed2acce01f0728238d1983" - [[package]] name = "winapi" version = "0.3.9" @@ -3444,19 +2817,6 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" -[[package]] -name = "windows-sys" -version = "0.36.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea04155a16a59f9eab786fe12a4a450e75cdb175f9e0d80da1e17db09f55b8d2" -dependencies = [ - "windows_aarch64_msvc 0.36.1", - "windows_i686_gnu 0.36.1", - "windows_i686_msvc 0.36.1", - "windows_x86_64_gnu 0.36.1", - "windows_x86_64_msvc 0.36.1", -] - [[package]] name = "windows-sys" version = "0.42.0" @@ -3464,12 +2824,12 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5a3e1820f08b8513f676f7ab6c1f99ff312fb97b553d30ff4dd86f9f15728aa7" dependencies = [ "windows_aarch64_gnullvm", - "windows_aarch64_msvc 0.42.0", - "windows_i686_gnu 0.42.0", - "windows_i686_msvc 0.42.0", - "windows_x86_64_gnu 0.42.0", + "windows_aarch64_msvc", + "windows_i686_gnu", + "windows_i686_msvc", + "windows_x86_64_gnu", "windows_x86_64_gnullvm", - "windows_x86_64_msvc 0.42.0", + "windows_x86_64_msvc", ] [[package]] @@ -3478,48 +2838,24 @@ version = "0.42.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "41d2aa71f6f0cbe00ae5167d90ef3cfe66527d6f613ca78ac8024c3ccab9a19e" -[[package]] -name = "windows_aarch64_msvc" -version = "0.36.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9bb8c3fd39ade2d67e9874ac4f3db21f0d710bee00fe7cab16949ec184eeaa47" - [[package]] name = "windows_aarch64_msvc" version = "0.42.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dd0f252f5a35cac83d6311b2e795981f5ee6e67eb1f9a7f64eb4500fbc4dcdb4" -[[package]] -name = "windows_i686_gnu" -version = "0.36.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "180e6ccf01daf4c426b846dfc66db1fc518f074baa793aa7d9b9aaeffad6a3b6" - [[package]] name = "windows_i686_gnu" version = "0.42.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fbeae19f6716841636c28d695375df17562ca208b2b7d0dc47635a50ae6c5de7" -[[package]] -name = "windows_i686_msvc" -version = "0.36.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2e7917148b2812d1eeafaeb22a97e4813dfa60a3f8f78ebe204bcc88f12f024" - [[package]] name = "windows_i686_msvc" version = "0.42.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "84c12f65daa39dd2babe6e442988fc329d6243fdce47d7d2d155b8d874862246" -[[package]] -name = "windows_x86_64_gnu" -version = "0.36.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4dcd171b8776c41b97521e5da127a2d86ad280114807d0b2ab1e462bc764d9e1" - [[package]] name = "windows_x86_64_gnu" version = "0.42.0" @@ -3532,83 +2868,12 @@ version = "0.42.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "09d525d2ba30eeb3297665bd434a54297e4170c7f1a44cad4ef58095b4cd2028" -[[package]] -name = "windows_x86_64_msvc" -version = "0.36.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c811ca4a8c853ef420abd8592ba53ddbbac90410fab6903b3e79972a631f7680" - [[package]] name = "windows_x86_64_msvc" version = "0.42.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f40009d85759725a34da6d89a94e63d7bdc50a862acf0dbc7c8e488f1edcb6f5" -[[package]] -name = "winit" -version = "0.27.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb796d6fbd86b2fd896c9471e6f04d39d750076ebe5680a3958f00f5ab97657c" -dependencies = [ - "bitflags", - "cocoa", - "core-foundation", - "core-graphics", - "dispatch", - "instant", - "libc", - "log", - "mio 0.8.5", - "ndk 0.7.0", - "ndk-glue 0.7.0", - "objc", - "once_cell", - "parking_lot", - "percent-encoding", - "raw-window-handle 0.4.3", - "raw-window-handle 0.5.0", - "sctk-adwaita", - "smithay-client-toolkit", - "wasm-bindgen", - "wayland-client", - "wayland-protocols", - "web-sys", - "windows-sys 0.36.1", - "x11-dl", -] - -[[package]] -name = "wio" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d129932f4644ac2396cb456385cbf9e63b5b30c6e8dc4820bdca4eb082037a5" -dependencies = [ - "winapi", -] - -[[package]] -name = "x11-dl" -version = "2.20.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1536d6965a5d4e573c7ef73a2c15ebcd0b2de3347bdf526c34c297c00ac40f0" -dependencies = [ - "lazy_static", - "libc", - "pkg-config", -] - -[[package]] -name = "x11rb" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e99be55648b3ae2a52342f9a870c0e138709a3493261ce9b469afe6e4df6d8a" -dependencies = [ - "gethostname", - "nix 0.22.3", - "winapi", - "winapi-wsapoll", -] - [[package]] name = "x11rb" version = "0.11.0" @@ -3631,15 +2896,6 @@ dependencies = [ "nix 0.25.0", ] -[[package]] -name = "xcursor" -version = "0.3.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "463705a63313cd4301184381c5e8042f0a7e9b4bb63653f216311d4ae74690b7" -dependencies = [ - "nom", -] - [[package]] name = "xdg" version = "2.4.1" @@ -3658,7 +2914,7 @@ dependencies = [ "ahash", "hashbrown 0.13.1", "log", - "x11rb 0.11.0", + "x11rb", "xim-ctext", "xim-parser", ] diff --git a/flake.lock b/flake.lock index 0d1ebe70..cce1641c 100644 --- a/flake.lock +++ b/flake.lock @@ -1,12 +1,15 @@ { "nodes": { "flake-utils": { + "inputs": { + "systems": "systems" + }, "locked": { - "lastModified": 1667395993, - "narHash": "sha256-nuEHfE/LcWyuSWnS8t12N1wc105Qtau+/OdUAjtQ0rA=", + "lastModified": 1687709756, + "narHash": "sha256-Y5wKlQSkgEK2weWdOu4J3riRd+kV/VCgHsqLNTTWQ/0=", "owner": "numtide", "repo": "flake-utils", - "rev": "5aed5285a952e0b949eb3ba02c12fa4fcfef535f", + "rev": "dbabf0ca0c0c4bce6ea5eaf65af5cb694d2082c7", "type": "github" }, "original": { @@ -17,15 +20,16 @@ }, "nixpkgs": { "locked": { - "lastModified": 1668913844, - "narHash": "sha256-Bd4TBT3kcEYUjJ1e8GGytqo0cB6yA8awBy/JPDyLbww=", + "lastModified": 1688049487, + "narHash": "sha256-100g4iaKC9MalDjUW9iN6Jl/OocTDtXdeAj7pEGIRh4=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "1f9973a1a2d56399f6984497987ebf25b880928a", + "rev": "4bc72cae107788bf3f24f30db2e2f685c9298dc9", "type": "github" }, "original": { "owner": "NixOS", + "ref": "nixos-unstable", "repo": "nixpkgs", "type": "github" } @@ -35,6 +39,21 @@ "flake-utils": "flake-utils", "nixpkgs": "nixpkgs" } + }, + "systems": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } } }, "root": "root", diff --git a/flake.nix b/flake.nix index cdd0ba93..49136859 100644 --- a/flake.nix +++ b/flake.nix @@ -2,7 +2,7 @@ description = "A very basic flake"; inputs = { - nixpkgs.url = github:NixOS/nixpkgs; + nixpkgs.url = github:NixOS/nixpkgs/nixos-unstable; flake-utils.url = github:numtide/flake-utils; }; diff --git a/nix/deps.nix b/nix/deps.nix index 27fd99cf..435d58a9 100644 --- a/nix/deps.nix +++ b/nix/deps.nix @@ -13,6 +13,8 @@ with pkgs; gtk3 gtk4 + gtk-layer-shell + qt5.qtbase # qt6.qtbase ]; diff --git a/src/engine/candidate/examples/client.rs b/src/engine/candidate/examples/client.rs index 28f183a0..8b3f8dfc 100644 --- a/src/engine/candidate/examples/client.rs +++ b/src/engine/candidate/examples/client.rs @@ -2,7 +2,8 @@ use kime_engine_candidate::client::Client; fn main() { let candidate_list = kime_engine_dict::lookup("가").unwrap(); - let client = Client::new(candidate_list).unwrap(); + let client = + Client::with_exe_path("./target/debug/kime-candidate-window", candidate_list).unwrap(); while !client.is_ready() {} diff --git a/src/engine/candidate/src/client.rs b/src/engine/candidate/src/client.rs index c72e931f..9d26e750 100644 --- a/src/engine/candidate/src/client.rs +++ b/src/engine/candidate/src/client.rs @@ -13,7 +13,11 @@ pub struct Client { impl Client { pub fn new(candidate_list: &[(&str, &str)]) -> io::Result { - let mut child = std::process::Command::new(CANDIDATE_PROCESS_NAME) + Self::with_exe_path(CANDIDATE_PROCESS_NAME, candidate_list) + } + + pub fn with_exe_path(path: &str, candidate_list: &[(&str, &str)]) -> io::Result { + let mut child = std::process::Command::new(path) .stdin(Stdio::piped()) .stdout(Stdio::piped()) .stderr(Stdio::inherit()) diff --git a/src/tools/candidate-window/Cargo.toml b/src/tools/candidate-window/Cargo.toml index 7b20adbc..a57b799c 100644 --- a/src/tools/candidate-window/Cargo.toml +++ b/src/tools/candidate-window/Cargo.toml @@ -8,6 +8,7 @@ license = "GPL-3.0-or-later" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -kime-engine-cffi = { path = "../../engine/cffi" } -eframe = "0.19" -egui = "0.19" +gtk = "0.16.2" +gdk = "0.16.2" +gtk-layer-shell = { version = "0.5.0", features = ["v0_6", "v0_4", "v0_5"] } +glib = "0.16.6" diff --git a/src/tools/candidate-window/src/main.rs b/src/tools/candidate-window/src/main.rs index 8e25b688..efe41ab8 100644 --- a/src/tools/candidate-window/src/main.rs +++ b/src/tools/candidate-window/src/main.rs @@ -1,129 +1,133 @@ +use gtk::prelude::*; + use std::{ - collections::BTreeMap, - io::{self, BufRead, Stdout, Write}, + cell::Cell, + io::{self, BufRead}, + rc::Rc, }; -use egui::Widget; - -const PAGE_SIZE: usize = 10; +fn activate(window: >k::ApplicationWindow) { + if !window.display().backend().is_wayland() { + eprintln!("Should be run on wayland backend.") + } -#[derive(Default)] -struct KeyState { - left: bool, - right: bool, + gtk_layer_shell::init_for_window(window); + gtk_layer_shell::set_layer(window, gtk_layer_shell::Layer::Overlay); + gtk_layer_shell::set_keyboard_mode(window, gtk_layer_shell::KeyboardMode::Exclusive); + gtk_layer_shell::set_margin(window, gtk_layer_shell::Edge::Left, 400); + gtk_layer_shell::set_margin(window, gtk_layer_shell::Edge::Top, 200); + + let anchors = [ + (gtk_layer_shell::Edge::Left, true), + (gtk_layer_shell::Edge::Right, false), + (gtk_layer_shell::Edge::Top, true), + (gtk_layer_shell::Edge::Bottom, false), + ]; + + for (anchor, state) in anchors { + gtk_layer_shell::set_anchor(window, anchor, state); + } } +const PAGE_SIZE: usize = 9; + struct CandidateApp { - stdout: Stdout, - key_state: KeyState, - page_index: usize, - max_page_index: usize, - candidate_list: Vec<(String, String)>, + candidate_list: Rc>, } -impl eframe::App for CandidateApp { - fn update(&mut self, ctx: &egui::Context, frame: &mut eframe::Frame) { - if ctx.input().key_down(egui::Key::Escape) || ctx.input().key_down(egui::Key::Q) { - frame.close(); - return; - } +impl CandidateApp { + pub fn run_candidate(&self, window: >k::ApplicationWindow) { + let candidate_list = Rc::clone(&self.candidate_list); + let list = gtk::ButtonBox::new(gtk::Orientation::Vertical); + list.set_margin(0); + list.set_layout(gtk::ButtonBoxStyle::Expand); - macro_rules! num_hotkey { - ($k:expr, $n:expr) => { - if ctx.input().key_down($k) { - self.page_index = $n; - } - }; - } - - num_hotkey!(egui::Key::Num1, 0); - num_hotkey!(egui::Key::Num2, 1); - num_hotkey!(egui::Key::Num3, 2); - num_hotkey!(egui::Key::Num4, 3); - num_hotkey!(egui::Key::Num5, 4); - num_hotkey!(egui::Key::Num6, 5); - num_hotkey!(egui::Key::Num7, 6); - num_hotkey!(egui::Key::Num8, 7); - num_hotkey!(egui::Key::Num9, 8); - num_hotkey!(egui::Key::Num0, 9); - - if ctx.input().key_down(egui::Key::ArrowLeft) || ctx.input().key_down(egui::Key::H) { - if !self.key_state.left { - self.page_index = self.page_index.saturating_sub(1); - self.key_state.left = true; - } - } - - if ctx.input().key_released(egui::Key::ArrowLeft) || ctx.input().key_released(egui::Key::H) - { - self.key_state.left = false; - } - - if ctx.input().key_down(egui::Key::ArrowRight) || ctx.input().key_down(egui::Key::L) { - if !self.key_state.right { - self.page_index = self.page_index.saturating_add(1).min(self.max_page_index); - self.key_state.right = true; - } + for (_, _, label) in &self.candidate_list[..PAGE_SIZE] { + list.add(label); } + let max_page_index = if candidate_list.len() % PAGE_SIZE == 0 { + (candidate_list.len() / PAGE_SIZE) - 1 + } else { + candidate_list.len() / PAGE_SIZE + }; + let page_index = Cell::new(0usize); - if ctx.input().key_released(egui::Key::ArrowRight) || ctx.input().key_released(egui::Key::L) - { - self.key_state.right = false; - } + window.add(&list); + window.show_all(); - egui::CentralPanel::default().show(ctx, |ui| { - ui.vertical_centered(|ui| { - let from = self.page_index * PAGE_SIZE; - let to = (from + PAGE_SIZE).min(self.candidate_list.len()); - - for (key, value) in self.candidate_list[from..to].iter() { - let quitted = ui - .horizontal(|ui| { - ui.colored_label(egui::Color32::LIGHT_BLUE, key); - ui.separator(); - if ui.button(value).clicked() { - true - } else { - false - } - }) - .inner; - - if quitted { - self.stdout.write_all(key.as_bytes()).unwrap(); - frame.close(); - return; + window.connect_key_press_event(move |window, e| { + match e.keyval() { + gdk::keys::constants::Escape => { + window.close(); + return gtk::Inhibit(true); + } + gdk::keys::constants::Return => { + if let Some(child) = list.children().first() { + child.emit_by_name::<()>("clicked", &[]); + return gtk::Inhibit(true); } } - }); - }); - - egui::TopBottomPanel::bottom("candidate-footer").show(ctx, |ui| { - ui.horizontal(|ui| { - for i in 0..self.max_page_index + 1 { - if i == self.page_index { - egui::Button::new( - egui::RichText::new(format!("[{}]", i + 1)) - .color(egui::Color32::YELLOW), - ) - .ui(ui); - } else { - if ui.button(format!("{}", i + 1)).clicked() { - self.page_index = i; + gdk::keys::constants::uparrow | gdk::keys::constants::Up => { + if let Some(new_page_index) = page_index.get().checked_sub(1) { + for child in list.children() { + list.remove(&child); + } + page_index.set(new_page_index); + for (_, _, btn) in &candidate_list + [page_index.get() * PAGE_SIZE..(page_index.get() + 1) * PAGE_SIZE] + { + list.add(btn); } - }; + list.show_all(); + return gtk::Inhibit(true); + } } - }); + gdk::keys::constants::downarrow | gdk::keys::constants::Down => { + if page_index.get() != max_page_index { + let new_page_index = page_index.get() + 1; + for child in list.children() { + list.remove(&child); + } + page_index.set(new_page_index); + for (_, _, btn) in &candidate_list[page_index.get() * PAGE_SIZE + ..((page_index.get() + 1) * PAGE_SIZE).min(candidate_list.len())] + { + list.add(btn); + } + list.show_all(); + return gtk::Inhibit(true); + } + } + gdk::keys::constants::_1 + | gdk::keys::constants::_2 + | gdk::keys::constants::_3 + | gdk::keys::constants::_4 + | gdk::keys::constants::_5 + | gdk::keys::constants::_6 + | gdk::keys::constants::_7 + | gdk::keys::constants::_8 + | gdk::keys::constants::_9 => { + let index = *e.keyval() - *gdk::keys::constants::_1; + if let Some(child) = list.children().get(index as usize) { + child.emit_by_name::<()>("clicked", &[]); + } + return gtk::Inhibit(true); + } + _ => {} + } + gtk::Inhibit(false) }); } } fn main() -> io::Result<()> { - assert!(kime_engine_cffi::check_api_version()); + if std::env::var("XDG_SESSION_TYPE").as_deref() == Ok("wayland") { + std::env::set_var("GDK_BACKEND", "wayland"); + } + gtk::init().ok(); let mut buf = String::with_capacity(4096); let stdin = io::stdin(); - let stdout = io::stdout(); let mut candidate_list = Vec::new(); let mut stdin_lock = stdin.lock(); @@ -142,50 +146,39 @@ fn main() -> io::Result<()> { loop { read!(key); read!(value); - candidate_list.push((key, value)); + let button = gtk::Button::new(); + let label = gtk::Label::new(Some(&format!("{key}\n{value}"))); + label.set_justify(gtk::Justification::Center); + button.add(&label); + candidate_list.push((key, value, button)); } - eframe::run_native( - "kime-candidate", - eframe::NativeOptions { - always_on_top: true, - decorated: false, - icon_data: None, - initial_window_size: Some(egui::vec2(400.0, 400.0)), - ..Default::default() - }, - Box::new(|cc| { - let config = kime_engine_cffi::Config::load(); - let (font_bytes, _index) = config.candidate_font(); - let mut font_data = BTreeMap::<_, egui::FontData>::new(); - let mut families = BTreeMap::new(); - - font_data.insert( - "Font".to_string(), - egui::FontData::from_owned(font_bytes.to_vec()), - ); - - families.insert(egui::FontFamily::Proportional, vec!["Font".to_string()]); - families.insert(egui::FontFamily::Monospace, vec!["Font".to_string()]); - - cc.egui_ctx.set_fonts(egui::FontDefinitions { - font_data, - families, + let candidate = CandidateApp { + candidate_list: Rc::new(candidate_list), + }; + + let application = gtk::Application::new(None, Default::default()); + + application.connect_activate(move |app| { + let window = gtk::ApplicationWindow::new(app); + window.set_decorated(false); + window.set_default_size(500, 600); + + for (key, _, button) in candidate.candidate_list.iter() { + let window_weak = window.downgrade(); + let key_in = key.clone(); + button.connect_clicked(move |_| { + let window = window_weak.upgrade().unwrap(); + print!("{key_in}"); + window.close(); }); + } + activate(&window); + + candidate.run_candidate(&window); + }); - Box::new(CandidateApp { - stdout, - page_index: 0, - key_state: KeyState::default(), - max_page_index: if candidate_list.len() % PAGE_SIZE == 0 { - (candidate_list.len() / PAGE_SIZE) - 1 - } else { - candidate_list.len() / PAGE_SIZE - }, - candidate_list, - }) - }), - ); + application.run(); Ok(()) }