diff --git a/Cargo.lock b/Cargo.lock index 43f3689cd..c7c6de087 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1,2274 +1,13 @@ # This file is automatically @generated by Cargo. # It is not intended for manual editing. [[package]] -name = "addr2line" -version = "0.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b6a2d3371669ab3ca9797670853d61402b03d0b4b9ebf33d677dfa720203072" -dependencies = [ - "gimli", -] - -[[package]] -name = "adler" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee2a4ec343196209d6594e19543ae87a39f96d5534d7174822a3ad825dd6ed7e" - -[[package]] -name = "adler32" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "567b077b825e468cc974f0020d4082ee6e03132512f207ef1a02fd5d00d1f32d" - -[[package]] -name = "aho-corasick" -version = "0.7.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "043164d8ba5c4c3035fec9bbee8647c0261d788f3474306f93bb65901cae0e86" -dependencies = [ - "memchr", -] - -[[package]] -name = "andrew" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b7f09f89872c2b6b29e319377b1fbe91c6f5947df19a25596e121cf19a7b35e" -dependencies = [ - "bitflags", - "line_drawing", - "rusttype 0.7.9", - "walkdir", - "xdg", - "xml-rs", -] - -[[package]] -name = "android_glue" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "000444226fcff248f2bc4c7625be32c63caccfecc2723a2b9f78a7487a49c407" - -[[package]] -name = "approx" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0e60b75072ecd4168020818c0107f2857bb6c4e64252d8d3983f6263b40a5c3" -dependencies = [ - "num-traits", -] - -[[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.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cff77d8686867eceff3105329d4698d96c2391c176d5d03adc90c7389162b5b8" - -[[package]] -name = "ash" -version = "0.31.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c69a8137596e84c22d57f3da1b5de1d4230b1742a710091c85f4d7ce50f00f38" -dependencies = [ - "libloading 0.6.2", -] - -[[package]] -name = "atom" -version = "0.3.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c86699c3f02778ec07158376991c8f783dd1f2f95c579ffaf0738dc984b2fe2" - -[[package]] -name = "atty" -version = "0.2.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" -dependencies = [ - "hermit-abi", - "libc", - "winapi 0.3.9", -] - -[[package]] -name = "autocfg" -version = "0.1.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d49d90015b3c36167a20fe2810c5cd875ad504b39cff3d4eae7977e6b7c1cb2" - -[[package]] -name = "autocfg" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8aac770f1885fd7e387acedd76065302551364496e46b3dd00860b2f8359b9d" - -[[package]] -name = "backtrace" -version = "0.3.50" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46254cf2fdcdf1badb5934448c1bcbe046a56537b3987d96c51a7afc5d03f293" -dependencies = [ - "addr2line", - "cfg-if", - "libc", - "miniz_oxide", - "object", - "rustc-demangle", -] - -[[package]] -name = "bitflags" -version = "1.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf1de2fe8c75bc145a2f577add951f8134889b4795d47466a54a5c846d691693" - -[[package]] -name = "block" -version = "0.1.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d8c1fef690941d3e7788d328517591fecc684c084084702d6ff1641e993699a" - -[[package]] -name = "block-buffer" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a076c298b9ecdb530ed9d967e74a6027d6a7478924520acddcddc24c1c8ab3ab" -dependencies = [ - "arrayref", - "byte-tools", -] - -[[package]] -name = "bumpalo" -version = "3.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e8c087f005730276d1096a652e92a8bacee2e2472bcc9715a74d2bec38b5820" - -[[package]] -name = "byte-tools" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "560c32574a12a89ecd91f5e742165893f86e3ab98d21f8ea548658eb9eef5f40" - -[[package]] -name = "bytemuck" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37fa13df2292ecb479ec23aa06f4507928bef07839be9ef15281411076629431" - -[[package]] -name = "byteorder" -version = "1.3.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08c48aae112d48ed9f069b33538ea9e3e90aa263cfa3d1c24309612b1f7472de" - -[[package]] -name = "calloop" -version = "0.4.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7aa2097be53a00de9e8fc349fea6d76221f398f5c4fa550d420669906962d160" -dependencies = [ - "mio", - "mio-extras", - "nix", -] - -[[package]] -name = "cc" -version = "1.0.58" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f9a06fb2e53271d7c279ec1efea6ab691c35a2ae67ec0d91d7acec0caf13b518" - -[[package]] -name = "cfg-if" -version = "0.1.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" - -[[package]] -name = "cgmath" -version = "0.17.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "283944cdecc44bf0b8dd010ec9af888d3b4f142844fdbe026c20ef68148d6fe7" -dependencies = [ - "approx", - "num-traits", - "rand 0.6.5", -] - -[[package]] -name = "cloudabi" -version = "0.0.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ddfc5b9aa5d4507acaf872de71051dfd0e309860e88966e1051e462a077aac4f" -dependencies = [ - "bitflags", -] - -[[package]] -name = "cmake" -version = "0.1.44" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e56268c17a6248366d66d4a47a3381369d068cce8409bb1716ed77ea32163bb" -dependencies = [ - "cc", -] - -[[package]] -name = "cocoa" -version = "0.19.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f29f7768b2d1be17b96158e3285951d366b40211320fb30826a76cb7a0da6400" -dependencies = [ - "bitflags", - "block", - "core-foundation 0.6.4", - "core-graphics 0.17.3", - "foreign-types", - "libc", - "objc", -] - -[[package]] -name = "cocoa" -version = "0.20.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c49e86fc36d5704151f5996b7b3795385f50ce09e3be0f47a0cfde869681cf8" -dependencies = [ - "bitflags", - "block", - "core-foundation 0.7.0", - "core-graphics 0.19.2", - "foreign-types", - "libc", - "objc", -] - -[[package]] -name = "color_quant" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0dbbb57365263e881e805dc77d94697c9118fd94d8da011240555aa7b23445bd" - -[[package]] -name = "copyless" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2df960f5d869b2dd8532793fde43eb5427cceb126c929747a26823ab0eeb536" - -[[package]] -name = "core-foundation" -version = "0.6.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25b9e03f145fd4f2bf705e07b900cd41fc636598fe5dc452fd0db1441c3f496d" -dependencies = [ - "core-foundation-sys 0.6.2", - "libc", -] - -[[package]] -name = "core-foundation" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57d24c7a13c43e870e37c1556b74555437870a04514f7685f5b354e090567171" -dependencies = [ - "core-foundation-sys 0.7.0", - "libc", -] - -[[package]] -name = "core-foundation-sys" -version = "0.6.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7ca8a5221364ef15ce201e8ed2f609fc312682a8f4e0e3d4aa5879764e0fa3b" - -[[package]] -name = "core-foundation-sys" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b3a71ab494c0b5b860bdc8407ae08978052417070c2ced38573a9157ad75b8ac" - -[[package]] -name = "core-graphics" -version = "0.17.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56790968ab1c8a1202a102e6de05fc6e1ec87da99e4e93e9a7d13efbfc1e95a9" -dependencies = [ - "bitflags", - "core-foundation 0.6.4", - "foreign-types", - "libc", -] - -[[package]] -name = "core-graphics" -version = "0.19.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b3889374e6ea6ab25dba90bb5d96202f61108058361f6dc72e8b03e6f8bbe923" -dependencies = [ - "bitflags", - "core-foundation 0.7.0", - "foreign-types", - "libc", -] - -[[package]] -name = "core-video-sys" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34ecad23610ad9757664d644e369246edde1803fcb43ed72876565098a5d3828" -dependencies = [ - "cfg-if", - "core-foundation-sys 0.7.0", - "core-graphics 0.19.2", - "libc", - "objc", -] - -[[package]] -name = "crc32fast" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba125de2af0df55319f41944744ad91c71113bf74a4646efff39afe1f6842db1" -dependencies = [ - "cfg-if", -] - -[[package]] -name = "crossbeam-deque" -version = "0.7.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f02af974daeee82218205558e51ec8768b48cf524bd01d550abe5573a608285" -dependencies = [ - "crossbeam-epoch", - "crossbeam-utils", - "maybe-uninit", -] - -[[package]] -name = "crossbeam-epoch" -version = "0.8.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "058ed274caafc1f60c4997b5fc07bf7dc7cca454af7c6e81edffe5f33f70dace" -dependencies = [ - "autocfg 1.0.0", - "cfg-if", - "crossbeam-utils", - "lazy_static 1.4.0", - "maybe-uninit", - "memoffset", - "scopeguard", -] - -[[package]] -name = "crossbeam-queue" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "774ba60a54c213d409d5353bda12d49cd68d14e45036a285234c8d6f91f92570" -dependencies = [ - "cfg-if", - "crossbeam-utils", - "maybe-uninit", -] - -[[package]] -name = "crossbeam-utils" -version = "0.7.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3c7c73a2d1e9fc0886a08b93e98eb643461230d5f1925e4036204d5f2e261a8" -dependencies = [ - "autocfg 1.0.0", - "cfg-if", - "lazy_static 1.4.0", -] - -[[package]] -name = "css-color-parser" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ccb6ce7ef97e6dc6e575e51b596c9889a5cc88a307b5ef177d215c61fd7581d" -dependencies = [ - "lazy_static 0.1.16", -] - -[[package]] -name = "d3d12" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1324bc4eae34f03b0ced586da5ae2b1ab46acfdae68b5b26d2e23dadae376a2" -dependencies = [ - "bitflags", - "libloading 0.6.2", - "winapi 0.3.9", -] - -[[package]] -name = "deflate" -version = "0.7.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "707b6a7b384888a70c8d2e8650b3e60170dfc6a67bb4aa67b6dfca57af4bedb4" -dependencies = [ - "adler32", - "byteorder", -] - -[[package]] -name = "digest" -version = "0.7.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03b072242a8cbaf9c145665af9d250c59af3b958f83ed6824e13533cf76d5b90" -dependencies = [ - "generic-array", -] - -[[package]] -name = "dispatch" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04e93ca78226c51902d7aa8c12c988338aadd9e85ed9c6be8aaac39192ff3605" - -[[package]] -name = "dlib" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b11f15d1e3268f140f68d390637d5e76d849782d971ae7063e0da69fe9709a76" -dependencies = [ - "libloading 0.6.2", -] - -[[package]] -name = "downcast-rs" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ea835d29036a4087793836fa931b08837ad5e957da9e23886b29586fb9b6650" - -[[package]] -name = "either" -version = "1.5.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb1f6b1ce1c140482ea30ddd3335fc0024ac7ee112895426e0a629a6c20adfe3" - -[[package]] -name = "env_logger" -version = "0.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44533bbbb3bb3c1fa17d9f2e4e38bbbaf8396ba82193c4cb1b6445d711445d36" -dependencies = [ - "atty", - "humantime", - "log", - "regex", - "termcolor", -] - -[[package]] -name = "failure" -version = "0.1.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d32e9bd16cc02eae7db7ef620b392808b89f6a5e16bb3497d159c6b92a0f4f86" -dependencies = [ - "backtrace", - "failure_derive", -] - -[[package]] -name = "failure_derive" -version = "0.1.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aa4da3c766cd7a0db8242e326e9e4e081edd567072893ed320008189715366a4" -dependencies = [ - "proc-macro2 1.0.18", - "quote 1.0.7", - "syn 1.0.34", - "synstructure", -] - -[[package]] -name = "fake-simd" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e88a8acf291dafb59c2d96e8f59828f3838bb1a70398823ade51a84de6a6deed" - -[[package]] -name = "foreign-types" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" -dependencies = [ - "foreign-types-shared", -] - -[[package]] -name = "foreign-types-shared" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" - -[[package]] -name = "fuchsia-cprng" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a06f77d526c1a601b7c4cdd98f54b5eaabffc14d5f2f0296febdc7f357c6d3ba" - -[[package]] -name = "fuchsia-zircon" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e9763c69ebaae630ba35f74888db465e49e259ba1bc0eda7d06f4a067615d82" -dependencies = [ - "bitflags", - "fuchsia-zircon-sys", -] - -[[package]] -name = "fuchsia-zircon-sys" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3dcaa9ae7725d12cdb85b3ad99a434db70b468c09ded17e012d86b5c1010f7a7" - -[[package]] -name = "futures" -version = "0.3.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e05b85ec287aac0dc34db7d4a569323df697f9c55b99b15d6b4ef8cde49f613" -dependencies = [ - "futures-channel", - "futures-core", - "futures-executor", - "futures-io", - "futures-sink", - "futures-task", - "futures-util", -] - -[[package]] -name = "futures-channel" -version = "0.3.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f366ad74c28cca6ba456d95e6422883cfb4b252a83bed929c83abfdbbf2967d5" -dependencies = [ - "futures-core", - "futures-sink", -] - -[[package]] -name = "futures-core" -version = "0.3.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59f5fff90fd5d971f936ad674802482ba441b6f09ba5e15fd8b39145582ca399" - -[[package]] -name = "futures-executor" -version = "0.3.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "10d6bb888be1153d3abeb9006b11b02cf5e9b209fda28693c31ae1e4e012e314" -dependencies = [ - "futures-core", - "futures-task", - "futures-util", -] - -[[package]] -name = "futures-io" -version = "0.3.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "de27142b013a8e869c14957e6d2edeef89e97c289e69d042ee3a49acd8b51789" - -[[package]] -name = "futures-macro" -version = "0.3.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d0b5a30a4328ab5473878237c447333c093297bded83a4983d10f4deea240d39" -dependencies = [ - "proc-macro-hack", - "proc-macro2 1.0.18", - "quote 1.0.7", - "syn 1.0.34", -] - -[[package]] -name = "futures-sink" -version = "0.3.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f2032893cb734c7a05d85ce0cc8b8c4075278e93b24b66f9de99d6eb0fa8acc" - -[[package]] -name = "futures-task" -version = "0.3.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bdb66b5f09e22019b1ab0830f7785bcea8e7a42148683f99214f73f8ec21a626" -dependencies = [ - "once_cell", -] - -[[package]] -name = "futures-util" -version = "0.3.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8764574ff08b701a084482c3c7031349104b07ac897393010494beaa18ce32c6" -dependencies = [ - "futures-channel", - "futures-core", - "futures-io", - "futures-macro", - "futures-sink", - "futures-task", - "memchr", - "pin-project", - "pin-utils", - "proc-macro-hack", - "proc-macro-nested", - "slab", -] - -[[package]] -name = "fxhash" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c31b6d751ae2c7f11320402d34e41349dd1016f8d5d45e48c4312bc8625af50c" -dependencies = [ - "byteorder", -] - -[[package]] -name = "generic-array" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef25c5683767570c2bbd7deba372926a55eaae9982d7726ee2a1050239d45b9d" -dependencies = [ - "typenum", -] - -[[package]] -name = "getrandom" -version = "0.1.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7abc8dd8451921606d809ba32e95b6111925cd2906060d2dcc29c070220503eb" -dependencies = [ - "cfg-if", - "libc", - "wasi", -] - -[[package]] -name = "gfx-auxil" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67bdbf8e8d6883c70e5a0d7379ad8ab3ac95127a3761306b36122d8f1c177a8e" -dependencies = [ - "fxhash", - "gfx-hal", - "spirv_cross", -] - -[[package]] -name = "gfx-backend-dx11" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "92de0ddc0fde1a89b2a0e92dcc6bbb554bd34af0135e53a28d5ef064611094a4" -dependencies = [ - "bitflags", - "gfx-auxil", - "gfx-hal", - "libloading 0.5.2", - "log", - "parking_lot", - "range-alloc", - "raw-window-handle", - "smallvec", - "spirv_cross", - "winapi 0.3.9", - "wio", -] - -[[package]] -name = "gfx-backend-dx12" -version = "0.5.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05218b5c94539f22ac7d6feb4b2482431b89f6cc897132494701ac48619218d7" -dependencies = [ - "bitflags", - "d3d12", - "gfx-auxil", - "gfx-hal", - "log", - "range-alloc", - "raw-window-handle", - "smallvec", - "spirv_cross", - "winapi 0.3.9", -] - -[[package]] -name = "gfx-backend-empty" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e0f922b263916801583b7a1d58213f51c46a225c1cdf29f6d10135a23945f07" -dependencies = [ - "gfx-hal", - "log", - "raw-window-handle", -] - -[[package]] -name = "gfx-backend-metal" -version = "0.5.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "412a1e0e53e9e325a7c2e0316f1a4e8a14cbe8d8bfb5f030bc3895692f8a8254" -dependencies = [ - "arrayvec", - "bitflags", - "block", - "cocoa 0.20.2", - "copyless", - "core-graphics 0.19.2", - "foreign-types", - "gfx-auxil", - "gfx-hal", - "lazy_static 1.4.0", - "log", - "metal", - "objc", - "parking_lot", - "range-alloc", - "raw-window-handle", - "smallvec", - "spirv_cross", - "storage-map", -] - -[[package]] -name = "gfx-backend-vulkan" -version = "0.5.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "84ab530c440abee3e8bb31c3920a9e7047a3a676f8fe9f2541416dd407cf956a" -dependencies = [ - "arrayvec", - "ash", - "byteorder", - "core-graphics 0.19.2", - "gfx-hal", - "lazy_static 1.4.0", - "log", - "objc", - "raw-window-handle", - "smallvec", - "winapi 0.3.9", - "x11", -] - -[[package]] -name = "gfx-descriptor" +name = "cli" version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1bf35f5d66d1bc56e63e68d7528441453f25992bd954b84309d23c659df2c5da" -dependencies = [ - "fxhash", - "gfx-hal", - "log", -] [[package]] -name = "gfx-hal" -version = "0.5.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a18534b23d4c262916231511309bc1f307c74cda8dcb68b93a10ca213a22814b" -dependencies = [ - "bitflags", - "raw-window-handle", -] - -[[package]] -name = "gfx-memory" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c2eed6cda674d9cd4d92229102dbd544292124533d236904f987e9afab456137" -dependencies = [ - "fxhash", - "gfx-hal", - "hibitset", - "log", - "slab", -] - -[[package]] -name = "gif" -version = "0.10.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "471d90201b3b223f3451cd4ad53e34295f16a1df17b1edf3736d47761c3981af" -dependencies = [ - "color_quant", - "lzw", -] - -[[package]] -name = "gimli" -version = "0.22.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aaf91faf136cb47367fa430cd46e37a788775e7fa104f8b4bcb3861dc389b724" - -[[package]] -name = "glsl-to-spirv" -version = "0.1.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28caebc98746d507603a2d3df66dcbe04e41d4febad0320f3eec1ef72b6bbef1" -dependencies = [ - "cmake", - "sha2", - "tempfile", -] - -[[package]] -name = "graphite" +name = "render-engine" version = "0.1.0" -dependencies = [ - "bytemuck", - "cgmath", - "css-color-parser", - "env_logger", - "failure", - "futures", - "glsl-to-spirv", - "image", - "palette", - "rctree", - "regex", - "wgpu", - "winit", - "xmlparser", -] [[package]] -name = "hermit-abi" -version = "0.1.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3deed196b6e7f9e44a2ae8d94225d80302d81208b1bb673fd21fe634645c85a9" -dependencies = [ - "libc", -] - -[[package]] -name = "hibitset" -version = "0.6.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93a1bb8316a44459a7d14253c4d28dd7395cbd23cc04a68c46e851b8e46d64b1" -dependencies = [ - "atom", -] - -[[package]] -name = "humantime" -version = "1.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df004cfca50ef23c36850aaaa59ad52cc70d0e90243c3c7737a4dd32dc7a3c4f" -dependencies = [ - "quick-error", -] - -[[package]] -name = "image" -version = "0.22.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08ed2ada878397b045454ac7cfb011d73132c59f31a955d230bd1f1c2e68eb4a" -dependencies = [ - "byteorder", - "gif", - "jpeg-decoder", - "num-iter", - "num-rational", - "num-traits", - "png", - "scoped_threadpool", - "tiff", -] - -[[package]] -name = "inflate" -version = "0.4.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1cdb29978cc5797bd8dcc8e5bf7de604891df2a8dc576973d71a281e916db2ff" -dependencies = [ - "adler32", -] - -[[package]] -name = "instant" -version = "0.1.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b141fdc7836c525d4d594027d318c84161ca17aaf8113ab1f81ab93ae897485" - -[[package]] -name = "iovec" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2b3ea6ff95e175473f8ffe6a7eb7c00d054240321b84c57051175fe3c1e075e" -dependencies = [ - "libc", -] - -[[package]] -name = "jpeg-decoder" -version = "0.1.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc797adac5f083b8ff0ca6f6294a999393d76e197c36488e2ef732c4715f6fa3" -dependencies = [ - "byteorder", - "rayon", -] - -[[package]] -name = "js-sys" -version = "0.3.41" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4b9172132a62451e56142bff9afc91c8e4a4500aa5b847da36815b63bfda916" -dependencies = [ - "wasm-bindgen", -] - -[[package]] -name = "kernel32-sys" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7507624b29483431c0ba2d82aece8ca6cdba9382bff4ddd0f7490560c056098d" -dependencies = [ - "winapi 0.2.8", - "winapi-build", -] - -[[package]] -name = "lazy_static" -version = "0.1.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf186d1a8aa5f5bee5fd662bc9c1b949e0259e1bcc379d1f006847b0080c7417" - -[[package]] -name = "lazy_static" -version = "1.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" - -[[package]] -name = "lazycell" -version = "1.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b294d6fa9ee409a054354afc4352b0b9ef7ca222c69b8812cbea9e7d2bf3783f" - -[[package]] -name = "libc" -version = "0.2.72" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a9f8082297d534141b30c8d39e9b1773713ab50fdbe4ff30f750d063b3bfd701" - -[[package]] -name = "libloading" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2b111a074963af1d37a139918ac6d49ad1d0d5e47f72fd55388619691a7d753" -dependencies = [ - "cc", - "winapi 0.3.9", -] - -[[package]] -name = "libloading" -version = "0.6.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2cadb8e769f070c45df05c78c7520eb4cd17061d4ab262e43cfc68b4d00ac71c" -dependencies = [ - "winapi 0.3.9", -] - -[[package]] -name = "line_drawing" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5cc7ad3d82c845bdb5dde34ffdcc7a5fb4d2996e1e1ee0f19c33bc80e15196b9" -dependencies = [ - "num-traits", -] - -[[package]] -name = "lock_api" -version = "0.3.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4da24a77a3d8a6d4862d95f72e6fdb9c09a643ecdb402d754004a557f2bec75" -dependencies = [ - "scopeguard", -] - -[[package]] -name = "log" -version = "0.4.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14b6052be84e6b71ab17edffc2eeabf5c2c3ae1fdb464aae35ac50c67a44e1f7" -dependencies = [ - "cfg-if", -] - -[[package]] -name = "lzw" -version = "0.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d947cbb889ed21c2a84be6ffbaebf5b4e0f4340638cba0444907e38b56be084" - -[[package]] -name = "malloc_buf" -version = "0.0.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62bb907fe88d54d8d9ce32a3cceab4218ed2f6b7d35617cafe9adf84e43919cb" -dependencies = [ - "libc", -] - -[[package]] -name = "maybe-uninit" -version = "2.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60302e4db3a61da70c0cb7991976248362f30319e88850c487b9b95bbf059e00" - -[[package]] -name = "memchr" -version = "2.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3728d817d99e5ac407411fa471ff9800a778d88a24685968b36824eaf4bee400" - -[[package]] -name = "memmap" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6585fd95e7bb50d6cc31e20d4cf9afb4e2ba16c5846fc76793f11218da9c475b" -dependencies = [ - "libc", - "winapi 0.3.9", -] - -[[package]] -name = "memoffset" -version = "0.5.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c198b026e1bbf08a937e94c6c60f9ec4a2267f5b0d2eec9c1b21b061ce2be55f" -dependencies = [ - "autocfg 1.0.0", -] - -[[package]] -name = "metal" -version = "0.18.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e198a0ee42bdbe9ef2c09d0b9426f3b2b47d90d93a4a9b0395c4cea605e92dc0" -dependencies = [ - "bitflags", - "block", - "cocoa 0.20.2", - "core-graphics 0.19.2", - "foreign-types", - "log", - "objc", -] - -[[package]] -name = "miniz_oxide" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be0f75932c1f6cfae3c04000e40114adf955636e19040f9c0a2c380702aa1c7f" -dependencies = [ - "adler", -] - -[[package]] -name = "mio" -version = "0.6.22" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fce347092656428bc8eaf6201042cb551b8d67855af7374542a92a0fbfcac430" -dependencies = [ - "cfg-if", - "fuchsia-zircon", - "fuchsia-zircon-sys", - "iovec", - "kernel32-sys", - "libc", - "log", - "miow", - "net2", - "slab", - "winapi 0.2.8", -] - -[[package]] -name = "mio-extras" -version = "2.0.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "52403fe290012ce777c4626790c8951324a2b9e3316b3143779c72b029742f19" -dependencies = [ - "lazycell", - "log", - "mio", - "slab", -] - -[[package]] -name = "miow" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c1f2f3b1cf331de6896aabf6e9d55dca90356cc9960cca7eaaf408a355ae919" -dependencies = [ - "kernel32-sys", - "net2", - "winapi 0.2.8", - "ws2_32-sys", -] - -[[package]] -name = "net2" -version = "0.2.34" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2ba7c918ac76704fb42afcbbb43891e72731f3dcca3bef2a19786297baf14af7" -dependencies = [ - "cfg-if", - "libc", - "winapi 0.3.9", -] - -[[package]] -name = "nix" -version = "0.14.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c722bee1037d430d0f8e687bbdbf222f27cc6e4e68d5caf630857bb2b6dbdce" -dependencies = [ - "bitflags", - "cc", - "cfg-if", - "libc", - "void", -] - -[[package]] -name = "num-derive" -version = "0.2.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eafd0b45c5537c3ba526f79d3e75120036502bebacbb3f3220914067ce39dbf2" -dependencies = [ - "proc-macro2 0.4.30", - "quote 0.6.13", - "syn 0.15.44", -] - -[[package]] -name = "num-integer" -version = "0.1.43" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d59457e662d541ba17869cf51cf177c0b5f0cbf476c66bdc90bf1edac4f875b" -dependencies = [ - "autocfg 1.0.0", - "num-traits", -] - -[[package]] -name = "num-iter" -version = "0.1.41" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a6e6b7c748f995c4c29c5f5ae0248536e04a5739927c74ec0fa564805094b9f" -dependencies = [ - "autocfg 1.0.0", - "num-integer", - "num-traits", -] - -[[package]] -name = "num-rational" -version = "0.2.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c000134b5dbf44adc5cb772486d335293351644b801551abe8f75c84cfa4aef" -dependencies = [ - "autocfg 1.0.0", - "num-integer", - "num-traits", -] - -[[package]] -name = "num-traits" -version = "0.2.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac267bcc07f48ee5f8935ab0d24f316fb722d7a1292e2913f0cc196b29ffd611" -dependencies = [ - "autocfg 1.0.0", -] - -[[package]] -name = "num_cpus" -version = "1.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05499f3756671c15885fee9034446956fff3f243d6077b91e5767df161f766b3" -dependencies = [ - "hermit-abi", - "libc", -] - -[[package]] -name = "objc" -version = "0.2.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "915b1b472bc21c53464d6c8461c9d3af805ba1ef837e1cac254428f4a77177b1" -dependencies = [ - "malloc_buf", - "objc_exception", -] - -[[package]] -name = "objc_exception" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad970fb455818ad6cba4c122ad012fae53ae8b4795f86378bce65e4f6bab2ca4" -dependencies = [ - "cc", -] - -[[package]] -name = "object" -version = "0.20.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ab52be62400ca80aa00285d25253d7f7c437b7375c4de678f5405d3afe82ca5" - -[[package]] -name = "once_cell" -version = "1.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b631f7e854af39a1739f401cf34a8a013dfe09eac4fa4dba91e9768bd28168d" - -[[package]] -name = "ordered-float" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3741934be594d77de1c8461ebcbbe866f585ea616a9753aa78f2bdc69f0e4579" -dependencies = [ - "num-traits", -] - -[[package]] -name = "palette" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a05c0334468e62a4dfbda34b29110aa7d70d58c7fdb2c9857b5874dd9827cc59" -dependencies = [ - "approx", - "num-traits", - "palette_derive", - "phf", - "phf_codegen", -] - -[[package]] -name = "palette_derive" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b4b5f600e60dd3a147fb57b4547033d382d1979eb087af310e91cb45a63b1f4" -dependencies = [ - "proc-macro2 1.0.18", - "quote 1.0.7", - "syn 1.0.34", -] - -[[package]] -name = "parking_lot" -version = "0.10.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3a704eb390aafdc107b0e392f56a82b668e3a71366993b5340f5833fd62505e" -dependencies = [ - "lock_api", - "parking_lot_core", -] - -[[package]] -name = "parking_lot_core" -version = "0.7.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d58c7c768d4ba344e3e8d72518ac13e259d7c7ade24167003b8488e10b6740a3" -dependencies = [ - "cfg-if", - "cloudabi", - "libc", - "redox_syscall", - "smallvec", - "winapi 0.3.9", -] - -[[package]] -name = "peek-poke" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d93fd6a575ebf1ac2668d08443c97a22872cfb463fd8b7ddd141e9f6be59af2f" -dependencies = [ - "peek-poke-derive", -] - -[[package]] -name = "peek-poke-derive" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6fb44a25c5bba983be0fc8592dfaf3e6d0935ce8be0c6b15b2a39507af34a926" -dependencies = [ - "proc-macro2 1.0.18", - "quote 1.0.7", - "syn 1.0.34", - "synstructure", - "unicode-xid 0.2.1", -] - -[[package]] -name = "percent-encoding" -version = "2.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d4fd5641d01c8f18a23da7b6fe29298ff4b55afcccdf78973b24cf3175fee32e" - -[[package]] -name = "phf" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3dfb61232e34fcb633f43d12c58f83c1df82962dcdfa565a4e866ffc17dafe12" -dependencies = [ - "phf_shared", -] - -[[package]] -name = "phf_codegen" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cbffee61585b0411840d3ece935cce9cb6321f01c45477d30066498cd5e1a815" -dependencies = [ - "phf_generator", - "phf_shared", -] - -[[package]] -name = "phf_generator" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "17367f0cc86f2d25802b2c26ee58a7b23faeccf78a396094c13dced0d0182526" -dependencies = [ - "phf_shared", - "rand 0.7.3", -] - -[[package]] -name = "phf_shared" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c00cf8b9eafe68dde5e9eaa2cef8ee84a9336a47d566ec55ca16589633b65af7" -dependencies = [ - "siphasher", -] - -[[package]] -name = "pin-project" -version = "0.4.22" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "12e3a6cdbfe94a5e4572812a0201f8c0ed98c1c452c7b8563ce2276988ef9c17" -dependencies = [ - "pin-project-internal", -] - -[[package]] -name = "pin-project-internal" -version = "0.4.22" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a0ffd45cf79d88737d7cc85bfd5d2894bee1139b356e616fe85dc389c61aaf7" -dependencies = [ - "proc-macro2 1.0.18", - "quote 1.0.7", - "syn 1.0.34", -] - -[[package]] -name = "pin-utils" +name = "wasm-bindings" version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" - -[[package]] -name = "pkg-config" -version = "0.3.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d36492546b6af1463394d46f0c834346f31548646f6ba10849802c9c9a27ac33" - -[[package]] -name = "png" -version = "0.15.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef859a23054bbfee7811284275ae522f0434a3c8e7f4b74bd4a35ae7e1c4a283" -dependencies = [ - "bitflags", - "crc32fast", - "deflate", - "inflate", -] - -[[package]] -name = "ppv-lite86" -version = "0.2.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "237a5ed80e274dbc66f86bd59c1e25edc039660be53194b5fe0a482e0f2612ea" - -[[package]] -name = "proc-macro-hack" -version = "0.5.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e0456befd48169b9f13ef0f0ad46d492cf9d2dbb918bcf38e01eed4ce3ec5e4" - -[[package]] -name = "proc-macro-nested" -version = "0.1.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eba180dafb9038b050a4c280019bbedf9f2467b61e5d892dcad585bb57aadc5a" - -[[package]] -name = "proc-macro2" -version = "0.4.30" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf3d2011ab5c909338f7887f4fc896d35932e29146c12c8d01da6b22a80ba759" -dependencies = [ - "unicode-xid 0.1.0", -] - -[[package]] -name = "proc-macro2" -version = "1.0.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "beae6331a816b1f65d04c45b078fd8e6c93e8071771f41b8163255bbd8d7c8fa" -dependencies = [ - "unicode-xid 0.2.1", -] - -[[package]] -name = "quick-error" -version = "1.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1d01941d82fa2ab50be1e79e6714289dd7cde78eba4c074bc5a4374f650dfe0" - -[[package]] -name = "quote" -version = "0.6.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ce23b6b870e8f94f81fb0a363d65d86675884b34a09043c81e5562f11c1f8e1" -dependencies = [ - "proc-macro2 0.4.30", -] - -[[package]] -name = "quote" -version = "1.0.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aa563d17ecb180e500da1cfd2b028310ac758de548efdd203e18f283af693f37" -dependencies = [ - "proc-macro2 1.0.18", -] - -[[package]] -name = "rand" -version = "0.6.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d71dacdc3c88c1fde3885a3be3fbab9f35724e6ce99467f7d9c5026132184ca" -dependencies = [ - "autocfg 0.1.7", - "libc", - "rand_chacha 0.1.1", - "rand_core 0.4.2", - "rand_hc 0.1.0", - "rand_isaac", - "rand_jitter", - "rand_os", - "rand_pcg 0.1.2", - "rand_xorshift", - "winapi 0.3.9", -] - -[[package]] -name = "rand" -version = "0.7.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a6b1679d49b24bbfe0c803429aa1874472f50d9b363131f0e89fc356b544d03" -dependencies = [ - "getrandom", - "libc", - "rand_chacha 0.2.2", - "rand_core 0.5.1", - "rand_hc 0.2.0", - "rand_pcg 0.2.1", -] - -[[package]] -name = "rand_chacha" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "556d3a1ca6600bfcbab7c7c91ccb085ac7fbbcd70e008a98742e7847f4f7bcef" -dependencies = [ - "autocfg 0.1.7", - "rand_core 0.3.1", -] - -[[package]] -name = "rand_chacha" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4c8ed856279c9737206bf725bf36935d8666ead7aa69b52be55af369d193402" -dependencies = [ - "ppv-lite86", - "rand_core 0.5.1", -] - -[[package]] -name = "rand_core" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a6fdeb83b075e8266dcc8762c22776f6877a63111121f5f8c7411e5be7eed4b" -dependencies = [ - "rand_core 0.4.2", -] - -[[package]] -name = "rand_core" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c33a3c44ca05fa6f1807d8e6743f3824e8509beca625669633be0acbdf509dc" - -[[package]] -name = "rand_core" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90bde5296fc891b0cef12a6d03ddccc162ce7b2aff54160af9338f8d40df6d19" -dependencies = [ - "getrandom", -] - -[[package]] -name = "rand_hc" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b40677c7be09ae76218dc623efbf7b18e34bced3f38883af07bb75630a21bc4" -dependencies = [ - "rand_core 0.3.1", -] - -[[package]] -name = "rand_hc" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca3129af7b92a17112d59ad498c6f81eaf463253766b90396d39ea7a39d6613c" -dependencies = [ - "rand_core 0.5.1", -] - -[[package]] -name = "rand_isaac" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ded997c9d5f13925be2a6fd7e66bf1872597f759fd9dd93513dd7e92e5a5ee08" -dependencies = [ - "rand_core 0.3.1", -] - -[[package]] -name = "rand_jitter" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1166d5c91dc97b88d1decc3285bb0a99ed84b05cfd0bc2341bdf2d43fc41e39b" -dependencies = [ - "libc", - "rand_core 0.4.2", - "winapi 0.3.9", -] - -[[package]] -name = "rand_os" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b75f676a1e053fc562eafbb47838d67c84801e38fc1ba459e8f180deabd5071" -dependencies = [ - "cloudabi", - "fuchsia-cprng", - "libc", - "rand_core 0.4.2", - "rdrand", - "winapi 0.3.9", -] - -[[package]] -name = "rand_pcg" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "abf9b09b01790cfe0364f52bf32995ea3c39f4d2dd011eac241d2914146d0b44" -dependencies = [ - "autocfg 0.1.7", - "rand_core 0.4.2", -] - -[[package]] -name = "rand_pcg" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "16abd0c1b639e9eb4d7c50c0b8100b0d0f849be2349829c740fe8e6eb4816429" -dependencies = [ - "rand_core 0.5.1", -] - -[[package]] -name = "rand_xorshift" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cbf7e9e623549b0e21f6e97cf8ecf247c1a8fd2e8a992ae265314300b2455d5c" -dependencies = [ - "rand_core 0.3.1", -] - -[[package]] -name = "range-alloc" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a871f1e45a3a3f0c73fb60343c811238bb5143a81642e27c2ac7aac27ff01a63" - -[[package]] -name = "raw-window-handle" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0a441a7a6c80ad6473bd4b74ec1c9a4c951794285bf941c2126f607c72e48211" -dependencies = [ - "libc", -] - -[[package]] -name = "rayon" -version = "1.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62f02856753d04e03e26929f820d0a0a337ebe71f849801eea335d464b349080" -dependencies = [ - "autocfg 1.0.0", - "crossbeam-deque", - "either", - "rayon-core", -] - -[[package]] -name = "rayon-core" -version = "1.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e92e15d89083484e11353891f1af602cc661426deb9564c298b270c726973280" -dependencies = [ - "crossbeam-deque", - "crossbeam-queue", - "crossbeam-utils", - "lazy_static 1.4.0", - "num_cpus", -] - -[[package]] -name = "rctree" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be9e29cb19c8fe84169fcb07f8f11e66bc9e6e0280efd4715c54818296f8a4a8" - -[[package]] -name = "rdrand" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "678054eb77286b51581ba43620cc911abf02758c91f93f479767aed0f90458b2" -dependencies = [ - "rand_core 0.3.1", -] - -[[package]] -name = "redox_syscall" -version = "0.1.57" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41cc0f7e4d5d4544e8861606a285bb08d3e70712ccc7d2b84d7c0ccfaf4b05ce" - -[[package]] -name = "regex" -version = "1.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c3780fcf44b193bc4d09f36d2a3c87b251da4a046c87795a0d35f4f927ad8e6" -dependencies = [ - "aho-corasick", - "memchr", - "regex-syntax", - "thread_local", -] - -[[package]] -name = "regex-syntax" -version = "0.6.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26412eb97c6b088a6997e05f69403a802a92d520de2f8e63c2b65f9e0f47c4e8" - -[[package]] -name = "remove_dir_all" -version = "0.5.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3acd125665422973a33ac9d3dd2df85edad0f4ae9b00dafb1a05e43a9f5ef8e7" -dependencies = [ - "winapi 0.3.9", -] - -[[package]] -name = "rustc-demangle" -version = "0.1.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c691c0e608126e00913e33f0ccf3727d5fc84573623b8d65b2df340b5201783" - -[[package]] -name = "rusttype" -version = "0.7.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "310942406a39981bed7e12b09182a221a29e0990f3e7e0c971f131922ed135d5" -dependencies = [ - "rusttype 0.8.3", -] - -[[package]] -name = "rusttype" -version = "0.8.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f61411055101f7b60ecf1041d87fb74205fb20b0c7a723f07ef39174cf6b4c0" -dependencies = [ - "approx", - "ordered-float", - "stb_truetype", -] - -[[package]] -name = "same-file" -version = "1.0.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" -dependencies = [ - "winapi-util", -] - -[[package]] -name = "scoped_threadpool" -version = "0.1.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d51f5df5af43ab3f1360b429fa5e0152ac5ce8c0bd6485cae490332e96846a8" - -[[package]] -name = "scopeguard" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" - -[[package]] -name = "sha2" -version = "0.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9eb6be24e4c23a84d7184280d2722f7f2731fcdd4a9d886efbfe4413e4847ea0" -dependencies = [ - "block-buffer", - "byte-tools", - "digest", - "fake-simd", -] - -[[package]] -name = "siphasher" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa8f3741c7372e75519bd9346068370c9cdaabcc1f9599cbcf2a2719352286b7" - -[[package]] -name = "slab" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c111b5bd5695e56cffe5129854aa230b39c93a305372fdbb2668ca2394eea9f8" - -[[package]] -name = "smallvec" -version = "1.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3757cb9d89161a2f24e1cf78efa0c1fcff485d18e3f55e0aa3480824ddaa0f3f" - -[[package]] -name = "smithay-client-toolkit" -version = "0.6.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "421c8dc7acf5cb205b88160f8b4cc2c5cfabe210e43b2f80f009f4c1ef910f1d" -dependencies = [ - "andrew", - "bitflags", - "dlib", - "lazy_static 1.4.0", - "memmap", - "nix", - "wayland-client", - "wayland-protocols", -] - -[[package]] -name = "spirv_cross" -version = "0.20.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a33a9478e9c78782dd694d05dee074703a9c4c74b511de742b88a7e8149f1b37" -dependencies = [ - "cc", - "js-sys", - "wasm-bindgen", -] - -[[package]] -name = "stb_truetype" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f77b6b07e862c66a9f3e62a07588fee67cd90a9135a2b942409f195507b4fb51" -dependencies = [ - "byteorder", -] - -[[package]] -name = "storage-map" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd0a4829a5c591dc24a944a736d6b1e4053e51339a79fd5d4702c4c999a9c45e" -dependencies = [ - "lock_api", -] - -[[package]] -name = "syn" -version = "0.15.44" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ca4b3b69a77cbe1ffc9e198781b7acb0c7365a883670e8f1c1bc66fba79a5c5" -dependencies = [ - "proc-macro2 0.4.30", - "quote 0.6.13", - "unicode-xid 0.1.0", -] - -[[package]] -name = "syn" -version = "1.0.34" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "936cae2873c940d92e697597c5eee105fb570cd5689c695806f672883653349b" -dependencies = [ - "proc-macro2 1.0.18", - "quote 1.0.7", - "unicode-xid 0.2.1", -] - -[[package]] -name = "synstructure" -version = "0.12.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b834f2d66f734cb897113e34aaff2f1ab4719ca946f9a7358dba8f8064148701" -dependencies = [ - "proc-macro2 1.0.18", - "quote 1.0.7", - "syn 1.0.34", - "unicode-xid 0.2.1", -] - -[[package]] -name = "tempfile" -version = "3.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a6e24d9338a0a5be79593e2fa15a648add6138caa803e2d5bc782c371732ca9" -dependencies = [ - "cfg-if", - "libc", - "rand 0.7.3", - "redox_syscall", - "remove_dir_all", - "winapi 0.3.9", -] - -[[package]] -name = "termcolor" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb6bfa289a4d7c5766392812c0a1f4c1ba45afa1ad47803c11e1f407d846d75f" -dependencies = [ - "winapi-util", -] - -[[package]] -name = "thread_local" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d40c6d1b69745a6ec6fb1ca717914848da4b44ae29d9b3080cbee91d72a69b14" -dependencies = [ - "lazy_static 1.4.0", -] - -[[package]] -name = "tiff" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d7b7c2cfc4742bd8a32f2e614339dd8ce30dbcf676bb262bd63a2327bc5df57d" -dependencies = [ - "byteorder", - "lzw", - "num-derive", - "num-traits", -] - -[[package]] -name = "typenum" -version = "1.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "373c8a200f9e67a0c95e62a4f52fbf80c23b4381c05a17845531982fa99e6b33" - -[[package]] -name = "unicode-xid" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc72304796d0818e357ead4e000d19c9c174ab23dc11093ac919054d20a6a7fc" - -[[package]] -name = "unicode-xid" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7fe0bb3479651439c9112f72b6c505038574c9fbb575ed1bf3b797fa39dd564" - -[[package]] -name = "vec_map" -version = "0.8.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1bddf1187be692e79c5ffeab891132dfb0f236ed36a43c7ed39f1165ee20191" - -[[package]] -name = "void" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a02e4885ed3bc0f2de90ea6dd45ebcbb66dacffe03547fadbb0eeae2770887d" - -[[package]] -name = "walkdir" -version = "2.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "777182bc735b6424e1a57516d35ed72cb8019d85c8c9bf536dccb3445c1a2f7d" -dependencies = [ - "same-file", - "winapi 0.3.9", - "winapi-util", -] - -[[package]] -name = "wasi" -version = "0.9.0+wasi-snapshot-preview1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519" - -[[package]] -name = "wasm-bindgen" -version = "0.2.64" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a634620115e4a229108b71bde263bb4220c483b3f07f5ba514ee8d15064c4c2" -dependencies = [ - "cfg-if", - "wasm-bindgen-macro", -] - -[[package]] -name = "wasm-bindgen-backend" -version = "0.2.64" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3e53963b583d18a5aa3aaae4b4c1cb535218246131ba22a71f05b518098571df" -dependencies = [ - "bumpalo", - "lazy_static 1.4.0", - "log", - "proc-macro2 1.0.18", - "quote 1.0.7", - "syn 1.0.34", - "wasm-bindgen-shared", -] - -[[package]] -name = "wasm-bindgen-macro" -version = "0.2.64" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fcfd5ef6eec85623b4c6e844293d4516470d8f19cd72d0d12246017eb9060b8" -dependencies = [ - "quote 1.0.7", - "wasm-bindgen-macro-support", -] - -[[package]] -name = "wasm-bindgen-macro-support" -version = "0.2.64" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9adff9ee0e94b926ca81b57f57f86d5545cdcb1d259e21ec9bdd95b901754c75" -dependencies = [ - "proc-macro2 1.0.18", - "quote 1.0.7", - "syn 1.0.34", - "wasm-bindgen-backend", - "wasm-bindgen-shared", -] - -[[package]] -name = "wasm-bindgen-shared" -version = "0.2.64" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f7b90ea6c632dd06fd765d44542e234d5e63d9bb917ecd64d79778a13bd79ae" - -[[package]] -name = "wayland-client" -version = "0.23.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af1080ebe0efabcf12aef2132152f616038f2d7dcbbccf7b2d8c5270fe14bcda" -dependencies = [ - "bitflags", - "calloop", - "downcast-rs", - "libc", - "mio", - "nix", - "wayland-commons", - "wayland-scanner", - "wayland-sys", -] - -[[package]] -name = "wayland-commons" -version = "0.23.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb66b0d1a27c39bbce712b6372131c6e25149f03ffb0cd017cf8f7de8d66dbdb" -dependencies = [ - "nix", - "wayland-sys", -] - -[[package]] -name = "wayland-protocols" -version = "0.23.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6cc286643656742777d55dc8e70d144fa4699e426ca8e9d4ef454f4bf15ffcf9" -dependencies = [ - "bitflags", - "wayland-client", - "wayland-commons", - "wayland-scanner", -] - -[[package]] -name = "wayland-scanner" -version = "0.23.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93b02247366f395b9258054f964fe293ddd019c3237afba9be2ccbe9e1651c3d" -dependencies = [ - "proc-macro2 0.4.30", - "quote 0.6.13", - "xml-rs", -] - -[[package]] -name = "wayland-sys" -version = "0.23.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d94e89a86e6d6d7c7c9b19ebf48a03afaac4af6bc22ae570e9a24124b75358f4" -dependencies = [ - "dlib", - "lazy_static 1.4.0", -] - -[[package]] -name = "wgpu" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5dece29f3cd403aabf4056595eabe4b9af56b8bfae12445f097cf8666a41829" -dependencies = [ - "arrayvec", - "parking_lot", - "raw-window-handle", - "smallvec", - "wgpu-core", - "wgpu-native", - "wgpu-types", -] - -[[package]] -name = "wgpu-core" -version = "0.5.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f07fd0b6b3b340465bce96286350d34b7661fb623ef24c3c2b8902ea654cd4e0" -dependencies = [ - "arrayvec", - "bitflags", - "copyless", - "fxhash", - "gfx-backend-dx11", - "gfx-backend-dx12", - "gfx-backend-empty", - "gfx-backend-metal", - "gfx-backend-vulkan", - "gfx-descriptor", - "gfx-hal", - "gfx-memory", - "log", - "parking_lot", - "peek-poke", - "smallvec", - "vec_map", - "wgpu-types", -] - -[[package]] -name = "wgpu-native" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f1ac9838b0715d7911352db1268e34dfd05ef347fbef0b65ae211268316a432" -dependencies = [ - "arrayvec", - "lazy_static 1.4.0", - "libc", - "objc", - "parking_lot", - "raw-window-handle", - "wgpu-core", - "wgpu-types", -] - -[[package]] -name = "wgpu-types" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3474b5ce2ed628e158c2fe4387a469b2ee119604556aa2debd10d830cedc3bc" -dependencies = [ - "bitflags", - "peek-poke", -] - -[[package]] -name = "winapi" -version = "0.2.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "167dc9d6949a9b857f3451275e911c3f44255842c1f7a76f33c55103a909087a" - -[[package]] -name = "winapi" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" -dependencies = [ - "winapi-i686-pc-windows-gnu", - "winapi-x86_64-pc-windows-gnu", -] - -[[package]] -name = "winapi-build" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d315eee3b34aca4797b2da6b13ed88266e6d612562a0c46390af8299fc699bc" - -[[package]] -name = "winapi-i686-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" - -[[package]] -name = "winapi-util" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178" -dependencies = [ - "winapi 0.3.9", -] - -[[package]] -name = "winapi-x86_64-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" - -[[package]] -name = "winit" -version = "0.20.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3ba128780050481f453bec2a115b916dbc6ae79c303dee9bad8b9080bdccd4f5" -dependencies = [ - "android_glue", - "bitflags", - "cocoa 0.19.1", - "core-foundation 0.6.4", - "core-graphics 0.17.3", - "core-video-sys", - "dispatch", - "instant", - "lazy_static 1.4.0", - "libc", - "log", - "mio", - "mio-extras", - "objc", - "parking_lot", - "percent-encoding", - "raw-window-handle", - "smithay-client-toolkit", - "wayland-client", - "winapi 0.3.9", - "x11-dl", -] - -[[package]] -name = "wio" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d129932f4644ac2396cb456385cbf9e63b5b30c6e8dc4820bdca4eb082037a5" -dependencies = [ - "winapi 0.3.9", -] - -[[package]] -name = "ws2_32-sys" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d59cefebd0c892fa2dd6de581e937301d8552cb44489cdff035c6187cb63fa5e" -dependencies = [ - "winapi 0.2.8", - "winapi-build", -] - -[[package]] -name = "x11" -version = "2.18.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77ecd092546cb16f25783a5451538e73afc8d32e242648d54f4ae5459ba1e773" -dependencies = [ - "libc", - "pkg-config", -] - -[[package]] -name = "x11-dl" -version = "2.18.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2bf981e3a5b3301209754218f962052d4d9ee97e478f4d26d4a6eced34c1fef8" -dependencies = [ - "lazy_static 1.4.0", - "libc", - "maybe-uninit", - "pkg-config", -] - -[[package]] -name = "xdg" -version = "2.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d089681aa106a86fade1b0128fb5daf07d5867a509ab036d99988dec80429a57" - -[[package]] -name = "xml-rs" -version = "0.8.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b07db065a5cf61a7e4ba64f29e67db906fb1787316516c4e6e5ff0fea1efcd8a" - -[[package]] -name = "xmlparser" -version = "0.13.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "52613e655f6f11f63c0fe7d1c3b5ef69e44d96df9b65dab296b441ed0e1125f5" diff --git a/Cargo.toml b/Cargo.toml index e7fba78ea..0847a1f32 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,26 +1,7 @@ -[package] -name = "graphite" -version = "0.1.0" -authors = ["Keavon Chambers "] -edition = "2018" - # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html -[dependencies] -image = "0.22" -winit = "0.20" -wgpu = "0.5" -glsl-to-spirv = "0.1" -failure = "0.1.7" -cgmath = "0.17" -palette = "0.5" -futures = "0.3.4" -bytemuck = "1.2.0" -rctree = "0.3.3" -xmlparser = "0.13.1" -regex = "1.3.7" -css-color-parser = "0.1.2" -env_logger = { version = "0.7.1", optional = true } +[workspace] -[features] -debug = ["env_logger"] +members = [ + "packages/*", +] diff --git a/dom_pseudocode.xml b/dom_pseudocode.xml deleted file mode 100644 index f07b20fad..000000000 --- a/dom_pseudocode.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - -Start with the given root component -For each child_component: - Get the component of the associated child_component tag - Create a DomNode for this component - Give this DomNode its width and height and other layout attributes - Recursively load its children \ No newline at end of file diff --git a/gui/README.md b/gui/README.md deleted file mode 100644 index d5bd131ab..000000000 --- a/gui/README.md +++ /dev/null @@ -1,260 +0,0 @@ -# GUI System Explainer - -This directory contains the XML files describing the components which make up Graphite's GUI. - -## Principles - -The framework is inspired by [Vue.js](https://vuejs.org/). -Each component's layout is defined in an XML, and recursively made out of lower-level components. - -Interactivity is provided by script files which expose reactive variables. As these variables are mutated, the component is updated to match the current state. - -## Layout - -The layout engine does a top-down pass through the component tree in order to determine what to render. - -Layout is controlled using predefined attributes, such as `width`, `height`, `x-align`, `y-align`, `gap` or `padding`. - -## Component lifetime - -The children of a component are passed to it as a `children` attribute. For example, looking at the row component: -```xml - - {{INNER_XML}} - -``` -The `children` attribute defines a new variable `INNER_XML` of type `Layout` which can contain more XML layout structure. It has a default value of `[[]]` which refers to an empty layout— XML syntax (for the `Layout` data type) written in a tag's attribute is wrapped in ``[[`` (opening) and `]]` (closing) symbols. In this case the `INNER_XML` variable defaults to empty XML, however it is not strictly useful here because the `children` attribute will always have its value replaced by whatever exists between opening and closing tags when this component is called from elsewhere. - -This is then expanded in the body of the row: `{{INNER_XML}}`. - -## Defining new components - -### Component files - -To define a new component, create a new `.xml` file in this directory. Subdirectories become namespaces for the components (e.g. the file `window/main.xml` defines a component ``). - -### Parameters - -User-defined parameters start with a colon (`:`). - -They are created by adding attributes to a component source file: -`:parameter="VARIABLE_NAME: (VariableType) = defaultValue"` - -# GUI System Markup Language Specification - -## Layouts - -* XML files laying out interface structure with tags for layouts and primitives -* Namespaced with folder name like `` -* Inner XML content bound to the variable specified in the `children` attribute of the root element definition -* All custom attributes are prefixed with a `:` when used as arguments and as parameters -* Root element in each file is the layout and its accepted arguments with a bound variable and default value -* Templating using {{mustaches}} for bound variables and computed values in the associated script -* Each layout has a companion script (Rust or WASM) that exposes computed values for templating -* Each layout acts as a container element used in computing layout measurements - -## GUI layout tree data structure - -* Stores purely the data used by the renderer and shaders -* Updated by the layout system - -## Primitive layouts - -**` | `** Draws a box -* **`children`** *`[xml | none = none]`* - Inner XML stays in the document -* **`:fill`** *`[color | none = none]`* - Fill color for the box -* **`:round`** *`[size | size size size size = 0px]`* - Rounds the corners -* **`:border-thickness`** *`[size = 0px]`* - Thickness of the border inside the box -* **`:border-color`** *`[color | none = none]`* - Color of the border inside the box - -**` | `** Draws an icon from an SVG file and optionally contains child elements -* **`children`** *`[xml | none = none]`* - Inner XML stays in the document -* **`:svg`** *``[string = `missing_svg_alert.svg`]``* - Location of the SVG file -* **`:style`** *```[string = ``]```* - CSS styling to be applied to the SVG, useful for applying templated variables - -**``** Draws text -* **`children`** *```[string = ``]```* - The text to be drawn (eventually this could become XML for styling) -* **`:color`** *`[color | none = [middlegray]]`* - The color of the text -* **`:size`** *`[size = 12px]`* - The size of the text - -**` | `** Wraps content laid out across vertically-adjacent sections, or acts as a spacer -* **`children`** *`[xml | none = none]`* - The elements inside the row - -**``** Wraps content laid out across horizontally-adjacent sections, or acts as a spacer -* **`children`** *`[xml | none = none]`* - The elements inside the column - -**``** Conditionally enables or disables child content if :a equals :b -* **`children`** *`[xml | none = none]`* - The elements to be shown if :a equals :b -* **`:a`** *`[TypeValue = true]`* - The first variable that must equal the second variable -* **`:b`** *`[TypeValue = true]`* - The second variable that must equal the first variable - -## Layout calculation - -**`width`** *`[Dimension = inner]`* -Set the exact content width of the element - -**`height`** *`[Dimension = inner]`* -Set the exact content height of the element - -**`x-align`** *`[Dimension::Percent = 0%]`* -Factor from left (0%) to right (100%) to align content inside this larger element - -**`y-align`** *`[Dimension::Percent = 0%]`* -Factor from top (0%) to bottom (100%) to align content inside this larger element - -**`gap`** *`[Dimension Dimension Dimension Dimension = 0px 0px 0px 0px]`* -Collapses between neighbors, pushes/expands parent set to inner, not part of click target (negative values count against the interior dimension instead of adding to the outside of the dimension?) -* **gap** *[Dimension → a a a a]* - Sugar: Single value for all sides -* **gap** *[Dimension Dimension = a b a b]* - Sugar: Two values for top/bottom and left/right -* **x-gap** *[Dimension = 0px a 0px a]* - Sugar: Single value for left/right -* **x-gap** *[Dimension Dimension = 0px a 0px b]* - Sugar: Two values for left and right -* **y-gap** *[Dimension = a 0px a 0px]* - Sugar: Single value for top/bottom -* **y-gap** *[Dimension Dimension = a 0px b 0px]* - Sugar: Two values for top and bottom - -**`padding`** *`[Dimension Dimension Dimension Dimension = 0]`* -Doesn’t collapse between neighbors, pushes/expands parent set to inner, part of the click target (negative values count against the interior dimension instead of adding to the outside of the dimension?) -* **padding** *[Dimension → a a a a]* - Sugar: Single value for all sides -* **padding** *[Dimension Dimension = a b a b]* - Sugar: Two values for top/bottom and left/right -* **x-padding** *[Dimension = 0px a 0px a]* - Sugar: Single value for left/right -* **x-padding** *[Dimension Dimension = 0px a 0px b]* - Sugar: Two values for left and right -* **y-padding** *[Dimension = a 0px a 0px]* - Sugar: Single value for top/bottom -* **y-padding** *[Dimension Dimension = a 0px b 0px]* - Sugar: Two values for top and bottom - -**`scroll`** *`[Dimension::Percent = 0%]`* -When child elements overflow their container, keep them visible on the top/left (0%) or bottom/right (100%) while clipping on the opposite side - -## Variables - -Parameter -* Attribute: **?: (T1 | … | Tn) = ?** - Declares a parameter with a list of possible types and a required default value - * ```^\s*({{)\s*(\w*)\s*(:)\s*(\()\s*(\w*\s*(?:\|\s*\w*\s*?)*)\s*(\))\s*(=)\s*(\w*)\s*(}})\s*$``` - * ```{{ THE_NAME : (bool | color | inner | percent ) = none }}``` - * ```Value Type: (String, Vec, TypeValue)``` - -Argument -* Attribute: {{?}} - In an attribute, string, or between tags, evaluates to another type value via environment lookup - * ```^\s*({{)\s*(\w*)\s*(}})\s*$``` - * ```{{THE_NAME }}``` - * ```Value Type: String``` - -## Types - -**`Layout`** -* Attribute: **`[[...]]`** - The XML layout language wrapped in double square brackets - Body: **`...`** - XML data - * Value Type: Abstract syntax tree? - -**`AbsolutePx`** -* Attribute: **`?px`** - Absolute size in UI pixels - * `^\s*(-?\d*(?:\.\d*)?)([Pp][Xx])\s*$` - * Value Type: `f32` - -**`Percent`** -* Attribute: **`?%`** - Percentage of the total size of the parent container - * `^\s*(-?\d*(?:\.\d*)?)(%)\s*$` - * Value Type: `f32` - -**`PercentRemainder`** -* Attribute: **`?@`** - Percentage of the remainder of unfilled space within the parent container - * `^\s*(-?\d*(?:\.\d*)?)(@)\s*$` - * Value Type: `f32` - -**`Inner`** -* Attribute: **`inner`** - Use the width/height of the content, where any child percent-based values become inner - * `^\s*([Ii][Nn][Nn][Ee][Rr])\s*$` - * Value Type: N/A - -**`Width`** -* Attribute: **`width`** - Copies the computed width from the current element - * `^\s*([Ww][Ii][Dd][Tt][Hh])\s*$` - * Value Type: N/A - -**`Height`** -* Attribute: **`height`** - Copies the computed height from the current element - * `^\s*([Hh][Ee][Ii][Gg][Hh][Tt])\s*$` - * Value Type: N/A - -**`TemplateString`** -* Attribute: **`` `? … {{?}} …` ``** - A string with arguments inside, wrapped in backticks - Body: **`? {{?}} ? … ? {{?}}`** - Not to be mixed with other sibling XML tags - * ``^\s*`(.*)`\s*$`` - * Value Type: `Vec` - -**`Color`** -* Attribute: **`['?']`** - Literal name read from the standard color palette - Attribute: **`[?]`** - CSS color parsed by [rust-css-color](https://github.com/kalcutter/rust-css-color) - * `^\s*(\[)(.*)(\])\s*$` - * Value Type: `Color` - -**`Bool`** -* Attribute: **`true`** - The true value - Attribute: **`false`** - The false value - * `^\s*([Tt][Rr][Uu][Ee]|[Ff][Aa][Ll][Ss][Ee])\s*$` - * Value Type: `bool` - -**`None`** -* Attribute: **`none`** - Indicates the absence of a value - * `^\s*([Nn][Oo][Nn][Ee])\s*$` - * Value Type: N/A - -## Drawing procedure - -Depth or breadth first traversal, shallow nodes drawn before deeper nodes. - -## Updating and damaged flag -For any element marked damaged, it and all its children are redrawn. - -Resizing panels marks all affected panel containers as damaged so the resized contents are drawn. - -## Antialiased corners - -Pass along the parent node’s uniform, for any fragment located within a corner region, render the parent and blend antialiased GUI rectangle over it based on signed-distance function corner. - -Pixels in the corner regions must be wholly from the parent (must live within the borders of the parent, parent can’t be transparent, parent can’t have a wider overlapping border radius). - -Requires a special case for overlapping parent and child with same border radius in same location so only the child is shown to avoid bleeding doubled antialiased edges. diff --git a/gui/box.xml b/gui/box.xml deleted file mode 100644 index d42c70173..000000000 --- a/gui/box.xml +++ /dev/null @@ -1,3 +0,0 @@ - - {{INNER_XML}} - diff --git a/gui/col.xml b/gui/col.xml deleted file mode 100644 index 6e35a920d..000000000 --- a/gui/col.xml +++ /dev/null @@ -1,3 +0,0 @@ - - {{INNER_XML}} - diff --git a/gui/header/file-menu.xml b/gui/header/file-menu.xml deleted file mode 100644 index 6f122ab1a..000000000 --- a/gui/header/file-menu.xml +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - File - - - Edit - - - Comp - - - View - - - Help - - diff --git a/gui/header/window-buttons.xml b/gui/header/window-buttons.xml deleted file mode 100644 index ef22f25ee..000000000 --- a/gui/header/window-buttons.xml +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - - - - - - - - - - - diff --git a/gui/icon.xml b/gui/icon.xml deleted file mode 100644 index 7cee7db69..000000000 --- a/gui/icon.xml +++ /dev/null @@ -1,3 +0,0 @@ - - {{INNER_XML}} - diff --git a/gui/if.xml b/gui/if.xml deleted file mode 100644 index 2b381dc56..000000000 --- a/gui/if.xml +++ /dev/null @@ -1,3 +0,0 @@ - - {{RESULT}} - diff --git a/gui/input/checkbox-with-dropdown.xml b/gui/input/checkbox-with-dropdown.xml deleted file mode 100644 index 838c5d803..000000000 --- a/gui/input/checkbox-with-dropdown.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - - {{OPTION_LIST}} - - diff --git a/gui/input/checkbox.xml b/gui/input/checkbox.xml deleted file mode 100644 index 6395b190b..000000000 --- a/gui/input/checkbox.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - - - - diff --git a/gui/input/dropdown.xml b/gui/input/dropdown.xml deleted file mode 100644 index 44d261b81..000000000 --- a/gui/input/dropdown.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - {{CURRENT_TEXT}} - - - - - - - diff --git a/gui/row.xml b/gui/row.xml deleted file mode 100644 index 664d2d490..000000000 --- a/gui/row.xml +++ /dev/null @@ -1,3 +0,0 @@ - - {{INNER_XML}} - diff --git a/gui/text.xml b/gui/text.xml deleted file mode 100644 index a4a1564b1..000000000 --- a/gui/text.xml +++ /dev/null @@ -1 +0,0 @@ - diff --git a/gui/viewport/panels.xml b/gui/viewport/panels.xml deleted file mode 100644 index a3c7b48cf..000000000 --- a/gui/viewport/panels.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - Option A - Option B - Option C - - diff --git a/gui/window/main.xml b/gui/window/main.xml deleted file mode 100644 index 65312c4ff..000000000 --- a/gui/window/main.xml +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - - Document 1* - Graphite - - - - - - - - - File: 1.8 MB | Memory: 137 MB | Scratch: 0.7/12.3 GB - Box Select Objects | [⇧G] Move Selection | [⇧R] Rotate Selection | [⇧S] Scale Selection - - - diff --git a/packages/cli/Cargo.toml b/packages/cli/Cargo.toml new file mode 100644 index 000000000..df4a0a7c8 --- /dev/null +++ b/packages/cli/Cargo.toml @@ -0,0 +1,9 @@ +[package] +name = "cli" +version = "0.1.0" +authors = ["Keavon Chambers "] +edition = "2018" + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] diff --git a/packages/cli/src/main.rs b/packages/cli/src/main.rs new file mode 100644 index 000000000..f3095fdca --- /dev/null +++ b/packages/cli/src/main.rs @@ -0,0 +1,3 @@ +fn main() { + println!("Hello, Graphite!"); +} diff --git a/packages/render-engine/Cargo.toml b/packages/render-engine/Cargo.toml new file mode 100644 index 000000000..8e00789bc --- /dev/null +++ b/packages/render-engine/Cargo.toml @@ -0,0 +1,9 @@ +[package] +name = "render-engine" +version = "0.1.0" +authors = ["Keavon Chambers "] +edition = "2018" + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] diff --git a/packages/render-engine/src/lib.rs b/packages/render-engine/src/lib.rs new file mode 100644 index 000000000..909562f6d --- /dev/null +++ b/packages/render-engine/src/lib.rs @@ -0,0 +1,7 @@ +#[cfg(test)] +mod tests { + #[test] + fn it_works() { + assert_eq!(2 + 2, 4); + } +} diff --git a/packages/wasm-bindings/Cargo.toml b/packages/wasm-bindings/Cargo.toml new file mode 100644 index 000000000..cebac436b --- /dev/null +++ b/packages/wasm-bindings/Cargo.toml @@ -0,0 +1,9 @@ +[package] +name = "wasm-bindings" +version = "0.1.0" +authors = ["Keavon Chambers "] +edition = "2018" + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] diff --git a/packages/wasm-bindings/src/lib.rs b/packages/wasm-bindings/src/lib.rs new file mode 100644 index 000000000..909562f6d --- /dev/null +++ b/packages/wasm-bindings/src/lib.rs @@ -0,0 +1,7 @@ +#[cfg(test)] +mod tests { + #[test] + fn it_works() { + assert_eq!(2 + 2, 4); + } +} diff --git a/shaders/shader.frag b/shaders/shader.frag deleted file mode 100644 index e34376580..000000000 --- a/shaders/shader.frag +++ /dev/null @@ -1,25 +0,0 @@ -#version 450 - -layout(location=0) in vec2 v_uv; - -layout(location=0) out vec4 f_color; - -struct Dimensions_u32 { uint width; uint height; }; -struct Corners_f32 { float top_left; float top_right; float bottom_right; float bottom_left; }; -struct Sides_f32 { float top; float right; float bottom; float left; }; - -layout(set=0, binding=0) uniform GuiNodeUniform { - Dimensions_u32 dimensions; - Corners_f32 corners_radius; - Sides_f32 sides_inset; - float border_thickness; - vec4 border_color; - vec4 fill_color; -}; - -layout(set=0, binding=1) uniform texture2D t_texture; -layout(set=0, binding=2) uniform sampler s_texture; - -void main() { - f_color = fill_color * texture(sampler2D(t_texture, s_texture), v_uv / textureSize(sampler2D(t_texture, s_texture), 0) * 500); -} diff --git a/shaders/shader.vert b/shaders/shader.vert deleted file mode 100644 index f4a13ced7..000000000 --- a/shaders/shader.vert +++ /dev/null @@ -1,10 +0,0 @@ -#version 450 - -layout(location=0) in vec2 a_position; - -layout(location=0) out vec2 v_uv; - -void main() { - v_uv = (a_position + 1) / 2; - gl_Position = vec4(a_position, 0.0, 1.0); -} \ No newline at end of file diff --git a/src/application.rs b/src/application.rs deleted file mode 100644 index cd6f6f4c1..000000000 --- a/src/application.rs +++ /dev/null @@ -1,194 +0,0 @@ -use crate::color_palette::ColorPalette; -use crate::gui_node::GuiNode; -use crate::layout_system::LayoutSystem; -use crate::pipeline::Pipeline; -use crate::resource_cache::ResourceCache; -use crate::texture::Texture; -use crate::window_events; -use futures::executor::block_on; -use winit::event::*; -use winit::event_loop::*; -use winit::window::Window; - -pub struct Application { - pub surface: wgpu::Surface, - pub adapter: wgpu::Adapter, - pub device: wgpu::Device, - pub queue: wgpu::Queue, - pub swap_chain_descriptor: wgpu::SwapChainDescriptor, - pub swap_chain: wgpu::SwapChain, - pub shader_cache: ResourceCache, - pub pipeline_cache: ResourceCache, - pub texture_cache: ResourceCache, - pub gui_root: rctree::Node, -} - -impl Application { - pub fn new(window: &Window) -> Self { - // Window as understood by WGPU for rendering onto - let surface = wgpu::Surface::create(window); - - // Represents a GPU, exposes the real GPU device and queue - let adapter = block_on(wgpu::Adapter::request( - &wgpu::RequestAdapterOptions { - power_preference: wgpu::PowerPreference::Default, - compatible_surface: Some(&surface), - }, - wgpu::BackendBit::PRIMARY, - )) - .unwrap(); - - // Requests the device and queue from the adapter - let requested_device = block_on(adapter.request_device(&wgpu::DeviceDescriptor { - extensions: wgpu::Extensions { anisotropic_filtering: false }, - limits: Default::default(), - })); - - // Connection to the physical GPU - let device = requested_device.0; - - // Represents the GPU command queue, to submit CommandBuffers - let queue = requested_device.1; - - // Properties for the swap chain frame buffers - let swap_chain_descriptor = wgpu::SwapChainDescriptor { - usage: wgpu::TextureUsage::OUTPUT_ATTACHMENT, - format: wgpu::TextureFormat::Bgra8UnormSrgb, - width: window.inner_size().width, - height: window.inner_size().height, - present_mode: wgpu::PresentMode::Fifo, - }; - - // Series of frame buffers with images presented to the surface - let swap_chain = device.create_swap_chain(&surface, &swap_chain_descriptor); - - // Resource caches that own the application's shaders, pipelines, and textures - let mut shader_cache = ResourceCache::::new(); - let mut pipeline_cache = ResourceCache::::new(); - let texture_cache = ResourceCache::::new(); - - // Temporary setup below, TODO: move to appropriate place in architecture - - // Data structure maintaining the user interface - let gui_rect_pipeline = Pipeline::new( - &device, - swap_chain_descriptor.format, - Vec::new(), - &mut shader_cache, - ("shaders/shader.vert", "shaders/shader.frag"), - ); - pipeline_cache.set("gui_rect", gui_rect_pipeline); - - // Render quad hierarchy - let gui_root_data = GuiNode::new(swap_chain_descriptor.width, swap_chain_descriptor.height, ColorPalette::Accent.into_color_srgb()); - let gui_root = rctree::Node::new(gui_root_data); - - // Main window in the XML layout language - let mut main_window_layout = LayoutSystem::new(); - main_window_layout.add_window(("window", "main"), (1920, 1080)); - - Self { - surface, - adapter, - device, - queue, - swap_chain_descriptor, - swap_chain, - shader_cache, - pipeline_cache, - texture_cache, - gui_root, - } - } - - // Initializes the event loop for rendering and event handling - pub fn begin_lifecycle(mut self, event_loop: EventLoop<()>, window: Window) { - event_loop.run(move |event, _, control_flow| self.main_event_loop(event, control_flow, &window)); - } - - // Called every time by the event loop - fn main_event_loop(&mut self, event: Event<'_, T>, control_flow: &mut ControlFlow, window: &Window) { - // Wait for the next event to cause a subsequent event loop run, instead of looping instantly as a game would need - *control_flow = ControlFlow::Wait; - - match event { - // Handle all window events (like input and resize) in sequence - Event::WindowEvent { window_id, ref event } if window_id == window.id() => window_events::window_event(self, control_flow, event), - // Handle raw hardware-related events not related to a window - Event::DeviceEvent { .. } => (), - // Handle custom-dispatched events - Event::UserEvent(_) => (), - // Called once every event is handled and the GUI structure is updated - Event::MainEventsCleared => self.update_gui(), - // Resizing or calling `window.request_redraw()` renders the GUI with the queued draw commands - Event::RedrawRequested(_) => self.render(), - // Once all windows have been redrawn - Event::RedrawEventsCleared => (), - Event::NewEvents(_) => (), - Event::Suspended => (), - Event::Resumed => (), - Event::LoopDestroyed => (), - _ => (), - } - } - - fn update_gui(&mut self) {} - - // Render the queue of pipeline draw commands over the current window - fn render(&mut self) { - // Get a frame buffer to render on - let frame = self.swap_chain.get_next_texture().expect("Timeout getting frame buffer texture"); - - // Generates a render pass that commands are applied to, then generates a command buffer when finished - let mut command_encoder = self.device.create_command_encoder(&wgpu::CommandEncoderDescriptor { label: Some("Render Encoder") }); - - // Build an array of draw commands by traversing the GUI element tree - let commands = GuiNode::build_draw_commands_recursive(&self.gui_root, &self.device, &mut self.queue, &self.pipeline_cache, &mut self.texture_cache); - - // Recording of commands while in "rendering mode" that go into a command buffer - let mut render_pass = command_encoder.begin_render_pass(&wgpu::RenderPassDescriptor { - color_attachments: &[wgpu::RenderPassColorAttachmentDescriptor { - attachment: &frame.view, - resolve_target: None, - load_op: wgpu::LoadOp::Clear, - store_op: wgpu::StoreOp::Store, - clear_color: wgpu::Color::BLACK, - }], - depth_stencil_attachment: None, - }); - - // Prepare a variable to reuse the pipeline based on its name - let mut pipeline_name = String::new(); - - // Turn the queue of pipelines each into a command buffer and submit it to the render queue - for i in 0..commands.len() { - // If the previously set pipeline can't be reused, send the GPU the new pipeline to draw with - if pipeline_name != commands[i].pipeline_name { - let pipeline = self.pipeline_cache.get(&commands[i].pipeline_name[..]).unwrap(); - render_pass.set_pipeline(&pipeline.render_pipeline); - pipeline_name = commands[i].pipeline_name.clone(); - } - - // Send the GPU the vertices and triangle indices - render_pass.set_vertex_buffer(0, &commands[i].vertex_buffer, 0, 0); - render_pass.set_index_buffer(&commands[i].index_buffer, 0, 0); - - // Send the GPU the bind group resources - for (index, bind_group) in commands[i].bind_groups.iter().enumerate() { - render_pass.set_bind_group(index as u32, bind_group, &[]); - } - - // Draw call - render_pass.draw_indexed(0..commands[i].index_count, 0, 0..1); - } - - // Done sending render pass commands so we can give up mutation rights to command_encoder - drop(render_pass); - - // Turn the recording of commands into a complete command buffer - let command_buffer = command_encoder.finish(); - - // Submit the command buffer to the GPU command queue - self.queue.submit(&[command_buffer]); - } -} diff --git a/src/color.rs b/src/color.rs deleted file mode 100644 index f7c17fd63..000000000 --- a/src/color.rs +++ /dev/null @@ -1,41 +0,0 @@ -#[repr(C, align(16))] -#[derive(Debug, Copy, Clone, PartialEq)] -pub struct Color { - pub r: f32, - pub g: f32, - pub b: f32, - pub a: f32, -} - -impl Color { - pub fn new(r: f32, g: f32, b: f32, a: f32) -> Self { - Self { r, g, b, a } - } - - #[allow(dead_code)] - pub const TRANSPARENT: Self = Color { r: 0.0, g: 0.0, b: 0.0, a: 0.0 }; - - #[allow(dead_code)] - pub const BLACK: Self = Color { r: 0.0, g: 0.0, b: 0.0, a: 1.0 }; - - #[allow(dead_code)] - pub const WHITE: Self = Color { r: 1.0, g: 1.0, b: 1.0, a: 1.0 }; - - #[allow(dead_code)] - pub const RED: Self = Color { r: 1.0, g: 0.0, b: 0.0, a: 1.0 }; - - #[allow(dead_code)] - pub const YELLOW: Self = Color { r: 1.0, g: 1.0, b: 0.0, a: 1.0 }; - - #[allow(dead_code)] - pub const GREEN: Self = Color { r: 0.0, g: 1.0, b: 0.0, a: 1.0 }; - - #[allow(dead_code)] - pub const CYAN: Self = Color { r: 0.0, g: 1.0, b: 1.0, a: 1.0 }; - - #[allow(dead_code)] - pub const BLUE: Self = Color { r: 0.0, g: 0.0, b: 1.0, a: 1.0 }; - - #[allow(dead_code)] - pub const MAGENTA: Self = Color { r: 1.0, g: 0.0, b: 1.0, a: 1.0 }; -} diff --git a/src/color_palette.rs b/src/color_palette.rs deleted file mode 100644 index 3948c8c28..000000000 --- a/src/color_palette.rs +++ /dev/null @@ -1,91 +0,0 @@ -use crate::color::Color; - -#[allow(dead_code)] -pub enum ColorPalette { - Black, - NearBlack, - MildBlack, - DarkGray, - DimGray, - DullGray, - LowerGray, - MiddleGray, - UpperGray, - PaleGray, - SoftGray, - LightGray, - BrightGray, - MildWhite, - NearWhite, - White, - Accent, -} - -impl ColorPalette { - #[allow(dead_code)] - pub fn into_color_srgb(&self) -> Color { - let grayscale = match self { - ColorPalette::Black => 0 * 17, // #000000 - ColorPalette::NearBlack => 1 * 17, // #111111 - ColorPalette::MildBlack => 2 * 17, // #222222 - ColorPalette::DarkGray => 3 * 17, // #333333 - ColorPalette::DimGray => 4 * 17, // #444444 - ColorPalette::DullGray => 5 * 17, // #555555 - ColorPalette::LowerGray => 6 * 17, // #666666 - ColorPalette::MiddleGray => 7 * 17, // #777777 - ColorPalette::UpperGray => 8 * 17, // #888888 - ColorPalette::PaleGray => 9 * 17, // #999999 - ColorPalette::SoftGray => 10 * 17, // #aaaaaa - ColorPalette::LightGray => 11 * 17, // #bbbbbb - ColorPalette::BrightGray => 12 * 17, // #cccccc - ColorPalette::MildWhite => 13 * 17, // #dddddd - ColorPalette::NearWhite => 14 * 17, // #eeeeee - ColorPalette::White => 15 * 17, // #ffffff - _ => -1, - }; - - if grayscale > -1 { - let value = grayscale as f32 / 255.0; - return Color::new(value, value, value, 1.0); - } - - let rgba = match self { - ColorPalette::Accent => (75, 121, 167, 255), // #4b79a7 - _ => (0, 0, 0, 255), // Unimplemented returns black - }; - - Color::new(rgba.0 as f32 / 255.0, rgba.1 as f32 / 255.0, rgba.2 as f32 / 255.0, rgba.3 as f32 / 255.0) - } - - #[allow(dead_code)] - pub fn into_color_linear(&self) -> Color { - let standard_rgb = ColorPalette::into_color_srgb(self); - - let linear = palette::Srgb::new(standard_rgb.r, standard_rgb.g, standard_rgb.b).into_linear(); - - Color::new(linear.red, linear.green, linear.blue, standard_rgb.a) - } - - pub fn lookup_palette_color(name_in_palette: &str) -> ColorPalette { - match &name_in_palette.to_ascii_lowercase()[..] { - "black" => ColorPalette::Black, - "nearblack" => ColorPalette::NearBlack, - "mildblack" => ColorPalette::MildBlack, - "darkgray" => ColorPalette::DarkGray, - "dimgray" => ColorPalette::DimGray, - "dullgray" => ColorPalette::DullGray, - "lowergray" => ColorPalette::LowerGray, - "middlegray" => ColorPalette::MiddleGray, - "uppergray" => ColorPalette::UpperGray, - "palegray" => ColorPalette::PaleGray, - "softgray" => ColorPalette::SoftGray, - "lightgray" => ColorPalette::LightGray, - "brightgray" => ColorPalette::BrightGray, - "mildwhite" => ColorPalette::MildWhite, - "nearwhite" => ColorPalette::NearWhite, - "white" => ColorPalette::White, - "accent" => ColorPalette::Accent, - _ => panic!("Invalid color lookup of `{}` from the color palette", name_in_palette), - } - } -} diff --git a/src/draw_command.rs b/src/draw_command.rs deleted file mode 100644 index 4236eed01..000000000 --- a/src/draw_command.rs +++ /dev/null @@ -1,25 +0,0 @@ -// use crate::bind_group_resource::BindGroupResource; - -pub struct DrawCommand { - pub pipeline_name: String, - pub bind_groups: Vec, - pub vertex_buffer: wgpu::Buffer, - pub index_buffer: wgpu::Buffer, - pub index_count: u32, -} - -impl DrawCommand { - pub fn new(device: &wgpu::Device, pipeline_name: String, bind_groups: Vec, vertices: &[[f32; 2]], indices: &[u16]) -> Self { - let vertex_buffer = device.create_buffer_with_data(bytemuck::cast_slice(vertices), wgpu::BufferUsage::VERTEX); - let index_buffer = device.create_buffer_with_data(bytemuck::cast_slice(indices), wgpu::BufferUsage::INDEX); - let index_count = indices.len() as u32; - - Self { - pipeline_name, - bind_groups, - vertex_buffer, - index_buffer, - index_count, - } - } -} diff --git a/src/gui_attributes.rs b/src/gui_attributes.rs deleted file mode 100644 index 0763d498a..000000000 --- a/src/gui_attributes.rs +++ /dev/null @@ -1,47 +0,0 @@ -#[repr(C, align(16))] -#[derive(Debug, Copy, Clone)] -pub struct Corners { - pub top_left: T, - pub top_right: T, - pub bottom_right: T, - pub bottom_left: T, -} - -impl Corners { - pub fn new(top_left: T, top_right: T, bottom_right: T, bottom_left: T) -> Self { - Self { - top_left, - top_right, - bottom_right, - bottom_left, - } - } -} - -#[repr(C, align(16))] -#[derive(Debug, Copy, Clone)] -pub struct Sides { - pub top: T, - pub right: T, - pub bottom: T, - pub left: T, -} - -impl Sides { - pub fn new(top: T, right: T, bottom: T, left: T) -> Self { - Self { top, right, bottom, left } - } -} - -#[repr(C, align(16))] -#[derive(Debug, Copy, Clone)] -pub struct Dimensions { - pub width: T, - pub height: T, -} - -impl Dimensions { - pub fn new(width: T, height: T) -> Self { - Self { width, height } - } -} diff --git a/src/gui_node.rs b/src/gui_node.rs deleted file mode 100644 index c1ff1c454..000000000 --- a/src/gui_node.rs +++ /dev/null @@ -1,97 +0,0 @@ -use crate::color::Color; -use crate::draw_command::DrawCommand; -use crate::gui_attributes::*; -use crate::pipeline::Pipeline; -use crate::resource_cache::ResourceCache; -use crate::texture::Texture; - -pub struct GuiNode { - pub form_factor: GuiNodeUniform, - pub pipeline_name: String, -} - -impl GuiNode { - pub fn new(width: u32, height: u32, color: Color) -> Self { - Self { - form_factor: GuiNodeUniform::new(width, height, color), - pipeline_name: String::from("gui_rect"), - } - } - - pub fn build_draw_commands_recursive( - node: &rctree::Node, - device: &wgpu::Device, - queue: &mut wgpu::Queue, - pipeline_cache: &ResourceCache, - texture_cache: &mut ResourceCache, - ) -> Vec { - let mut draw_commands: Vec = Vec::new(); - - for mut subnode in node.descendants() { - let mut subnode_data = subnode.borrow_mut(); - let pipeline = pipeline_cache.get(&subnode_data.pipeline_name[..]).unwrap(); - let command = subnode_data.build_draw_command(device, queue, pipeline, texture_cache); - draw_commands.push(command); - } - - draw_commands - } - - pub fn build_draw_command(&mut self, device: &wgpu::Device, queue: &mut wgpu::Queue, pipeline: &Pipeline, texture_cache: &mut ResourceCache) -> DrawCommand { - const VERTICES: &[[f32; 2]] = &[[-0.5, 0.5], [0.5, 0.5], [0.5, 1.0], [-0.5, 1.0]]; - const INDICES: &[u16] = &[0, 1, 2, 0, 2, 3]; - - let bind_groups = self.build_bind_groups(device, queue, pipeline, texture_cache); - - // Create a draw command with the vertex data then push it to the GPU command queue - DrawCommand::new(device, self.pipeline_name.clone(), bind_groups, VERTICES, INDICES) - } - - pub fn build_bind_groups(&mut self, device: &wgpu::Device, queue: &mut wgpu::Queue, pipeline: &Pipeline, texture_cache: &mut ResourceCache) -> Vec { - // Load the cached texture - let texture = Texture::cached_load(device, queue, "textures/grid.png", texture_cache); - - // Build a staging buffer from the uniform resource data - let binding_staging_buffer = Pipeline::build_binding_staging_buffer(device, &self.form_factor); - - // Construct the bind group for this GUI node - let bind_group = Pipeline::build_bind_group( - device, - &pipeline.bind_group_layout, - vec![ - Pipeline::build_binding_resource(&binding_staging_buffer), - wgpu::BindingResource::TextureView(&texture.texture_view), - wgpu::BindingResource::Sampler(&texture.sampler), - ], - ); - - vec![bind_group] - } -} - -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct GuiNodeUniform { - pub dimensions: Dimensions, - pub corners_radius: Corners, - pub sides_inset: Sides, - pub border_thickness: f32, - pub border_color: Color, - pub fill_color: Color, -} - -impl GuiNodeUniform { - pub fn new(width: u32, height: u32, color: Color) -> Self { - GuiNodeUniform { - dimensions: Dimensions::::new(width, height), - corners_radius: Corners::::new(0.0, 0.0, 0.0, 0.0), - sides_inset: Sides::::new(0.0, 0.0, 0.0, 0.0), - border_thickness: 0.0, - border_color: Color::TRANSPARENT, - fill_color: color, - } - } -} - -unsafe impl bytemuck::Zeroable for GuiNodeUniform {} -unsafe impl bytemuck::Pod for GuiNodeUniform {} diff --git a/src/layout_abstract_syntax.rs b/src/layout_abstract_syntax.rs deleted file mode 100644 index 8d60a713e..000000000 --- a/src/layout_abstract_syntax.rs +++ /dev/null @@ -1,279 +0,0 @@ -use crate::layout_abstract_types::*; - -// AST for a component with info on its definition (from the root element of the XML layout) and a vector of direct child component tags -#[derive(Debug, Clone, PartialEq)] -pub struct FlatComponent { - // The abstract definition of the root node of the component with prop definitions - pub own_info: LayoutComponentDefinition, - // Only stores tags, text elements are disposed of (they'd be meaningless in a tag list) - pub child_components: Vec, -} - -/// A component in its final processed form (after parsing its XML file), with information on its definition with a list of child components with their own children in their `children` attributes -impl FlatComponent { - // Construct a layout component which stores its own root-level component definition (with prop definitions, etc.) and a flat list of its direct child tags, each with an AST in their `children` attribute - pub fn new(own_info: LayoutComponentDefinition, child_components: Vec) -> FlatComponent { - Self { own_info, child_components } - } - - /// Print the component (for debugging) - #[allow(dead_code)] - pub fn debug_print(&self) { - println!("Flat Component: {:#?}", self.own_info); - for tag in &self.child_components { - tag.debug_print(); - } - } -} - -// ==================================================================================================== - -/// Wrapper for either a `LayoutComponentNode` enum or `LayoutComponentDefinition` struct -#[derive(Debug, Clone, PartialEq)] -pub enum LayoutComponentNodeOrDefinition { - LayoutComponentNode(LayoutComponentNode), - LayoutComponentDefinition(LayoutComponentDefinition), -} - -// ==================================================================================================== - -/// AST of `LayoutComponentNode`s which hold either a tag or text node -pub type NodeTree = rctree::Node; - -/// AST similar to `NodeTree` (a tree of `LayoutComponentNode`s) but this holds the wrapped values `LayoutComponentNodeOrDefinition` (unwrap them with `LayoutSystem::node_tree_from_node_or_def_tree()`) -pub type NodeOrDefTree = rctree::Node; - -// ==================================================================================================== - -/// Representation of an XML node with either another XML tag (`LayoutComponentTag`) or a text node (a vector of alternating `TemplateStringSegment::String`s and `TemplateStringSegment::Argument`s) -#[derive(Debug, Clone, PartialEq)] -pub enum LayoutComponentNode { - Tag(LayoutComponentTag), - Text(Vec), -} - -impl LayoutComponentNode { - /// Given a tag name in namespace:name format, construct a `LayoutComponentNode` that wraps a newly constructed `LayoutComponentTag` struct based on the provided name - pub fn new_tag(name: (String, String)) -> Self { - Self::Tag(LayoutComponentTag::new(name)) - } - - /// Given some text hanging out in the XML between tags, construct a `LayoutComponentNode` with that text which simply stores the provided `String` - pub fn new_text(text: Vec) -> Self { - Self::Text(text) - } - - /// Print the component node (for debugging) - #[allow(dead_code)] - pub fn debug_print(&self) { - match self { - LayoutComponentNode::Tag(tag) => tag.debug_print(), - LayoutComponentNode::Text(text) => println!("================> Text Node: {:#?}", text), - } - } -} - -// ==================================================================================================== - -/// Abstract representation of a component based on the definitions of its props in the root tag of a component XML layout -#[derive(Debug, Clone, PartialEq)] -pub struct LayoutComponentDefinition { - /// Name of the component in namespace:name format - pub name: (String, String), - /// Accepted prop definitions, which are prefixed with ':' - pub prop_definitions: Vec, -} - -impl LayoutComponentDefinition { - /// Construct a definition for a layout component given its name in namespace:name format with an (initially) empty set of prop definitions - pub fn new(name: (String, String)) -> Self { - let prop_definitions = vec![]; - Self { name, prop_definitions } - } - - /// Add a prop definition (with its name, valid types, and default value) to this component definition - pub fn add_prop_definition(&mut self, prop_definition: PropDefinition) { - self.prop_definitions.push(prop_definition); - } -} - -// ==================================================================================================== - -/// Abstract representation of a tag inside an abstract component with attributes and children -#[derive(Debug, Clone, PartialEq)] -pub struct LayoutComponentTag { - /// Namespace and name of the tag's referenced component - pub name: (String, String), - /// Layout attributes, which are used by the layout engine - pub layout: LayoutAttributes, - /// Props on this tag, which are prefixed with ':' - pub props: Vec, - /// The special `children` attribute, containing the inner elements of this tag - pub children: Option>, -} - -impl LayoutComponentTag { - /// Construct a tag in an XML layout component based on its referenced component name (in namespace:name format) and empty defaults - pub fn new(name: (String, String)) -> Self { - Self { - name, - layout: Default::default(), - children: None, - props: Vec::new(), - } - } - - /// Provide a sequence of ASTs for this component's special `children` attribute - pub fn set_children(&mut self, children: Vec) { - self.children = Some(children); - } - - /// Add an XML tag attribute to this component (either a layout engine setting, a prop, or an event handler binding) - pub fn add_attribute(&mut self, attribute: Prop) { - // Prop argument (for reactive data system) - if attribute.name.len() > 1 && &attribute.name[..1] == ":" { - self.add_prop(attribute); - } - // Event handler attribute (for event system) - else if attribute.name.len() > 3 && &attribute.name[..3] == "on:" { - todo!("Event attributes not implemented yet"); - } - // Layout attribute (for layout engine) - else { - self.add_layout_attribute(attribute); - } - } - - /// Add an XML tag attribute to this component for a colon-prefixed prop - fn add_prop(&mut self, attribute: Prop) { - self.props.push(attribute); - } - - /// Add an XML tag attribute to this component for a non-prefixed layout engine value - fn add_layout_attribute(&mut self, attribute: Prop) { - match &attribute.name[..] { - // Layout attributes, stored separately - "width" => self.layout.width = attribute.dimension(), - "height" => self.layout.height = attribute.dimension(), - "x-align" => self.layout.x_align = attribute.percent(), - "y-align" => self.layout.y_align = attribute.percent(), - "x-padding" => self.layout.padding.set_horizontal(attribute.dimension()), - "y-padding" => self.layout.padding.set_vertical(attribute.dimension()), - "padding" => self.layout.padding = attribute.box_dimensions(), - "x-gap" => self.layout.gap.set_horizontal(attribute.dimension()), - "y-gap" => self.layout.gap.set_vertical(attribute.dimension()), - "gap" => self.layout.gap = attribute.box_dimensions(), - _ => panic!("Unknown builtin attribute `{}`", attribute.name), - } - } - - /// Print the layout tag (for debugging) - pub fn debug_print(&self) { - println!("Tag Node: {:#?}", self); - if let Some(ref children) = self.children { - for child in children { - for node in child.descendants() { - println!("> Descendant Node: {:#?}", node); - } - } - } - } -} - -// ==================================================================================================== - -/// Name-value pair for a prop used in the prop-passing system, where the name is a `String` and the value sequence is a vector of `TypedValueOrVariableName`s -#[derive(Debug, Clone, PartialEq)] -pub struct Prop { - pub name: String, - pub value_sequence: Vec, -} - -impl Prop { - /// Construct a name-value pair representing an argument on a layout tag given its name and sequence of values - pub fn new(name: String, value_sequence: Vec) -> Self { - Self { name, value_sequence } - } - - /// Extract this attribute's values as typed values - fn values(self) -> Vec { - self.value_sequence - .into_iter() - .map(|value| { - if let TypedValueOrVariableName::TypedValue(typed_value) = value { - typed_value - } - else { - todo!("Variable arguments are not yet supported") - } - }) - .collect() - } - - /// Convert this attribute's value into a single dimension - fn dimension(self) -> Dimension { - let values = self.values(); - assert_eq!(values.len(), 1, "Expected a single value"); - values[0].expect_dimension() - } - - /// Extract a percentage from this attribute's value - fn percent(self) -> f64 { - match self.dimension() { - Dimension::Percent(value) => value, - _ => panic!("Expected a percentage"), - } - } - - /// Convert this attribute's values into box dimensions - fn box_dimensions(self) -> BoxDimensions { - let values = self.values(); - match values.len() { - 1 => { - let value = values[0].expect_dimension(); - BoxDimensions::all(value) - }, - 2 => { - let vertical = values[0].expect_dimension(); - let horizontal = values[1].expect_dimension(); - BoxDimensions::symmetric(vertical, horizontal) - }, - 4 => { - let top = values[0].expect_dimension(); - let right = values[1].expect_dimension(); - let bottom = values[2].expect_dimension(); - let left = values[3].expect_dimension(); - BoxDimensions::new(top, right, bottom, left) - }, - _ => panic!("Expected 1, 2 or 4 values"), - } - } -} - -// ==================================================================================================== - -/// Attributes used by the layout engine to calculate sizing and placement -#[derive(Clone, Debug, PartialEq)] -pub struct LayoutAttributes { - pub width: Dimension, - pub height: Dimension, - pub x_align: f64, - pub y_align: f64, - pub gap: BoxDimensions, - pub padding: BoxDimensions, -} - -impl Default for LayoutAttributes { - /// Provide default values for dimensions, alignment, and outside spacing - fn default() -> Self { - let zero_box = BoxDimensions::all(Dimension::AbsolutePx(0.0)); - Self { - width: Dimension::Inner, - height: Dimension::Inner, - x_align: 0.0, - y_align: 0.0, - gap: zero_box, - padding: zero_box, - } - } -} diff --git a/src/layout_abstract_types.rs b/src/layout_abstract_types.rs deleted file mode 100644 index 87006b6d6..000000000 --- a/src/layout_abstract_types.rs +++ /dev/null @@ -1,146 +0,0 @@ -use crate::color::Color; -use crate::layout_abstract_syntax::*; - -/// Definition of a prop for a component, given in an attribute of the XML root tag -#[derive(Debug, Clone, PartialEq)] -pub struct PropDefinition { - // Name of the variable binding that can be used within the component in {{template tags}} - pub variable_name: String, - // Combinations of allowed sequences of types that can be passed to instances of this component - pub type_sequence_options: Vec>, - // A single sequence of default values that get used if an instance of this component never has the corresponding argument passed to it - pub type_sequence_default: Vec, -} - -impl PropDefinition { - /// Construct a prop definition for a variable accepted by a component definition, with the variable name, valid combinations of types, and the default value sequence - pub fn new(variable_name: String, valid_types: Vec>, default: Vec) -> Self { - Self { - variable_name, - type_sequence_options: valid_types, - type_sequence_default: default, - } - } -} - -// ==================================================================================================== - -/// Wrapper for either a `TypedValue` struct or the name of a prop -#[derive(Debug, Clone, PartialEq)] -pub enum TypedValueOrVariableName { - TypedValue(TypedValue), - VariableName(String), -} - -// ==================================================================================================== - -/// All possible names for types of values in the reactive data and layout system -#[derive(Debug, Clone, PartialEq)] -pub enum TypeName { - Layout, - Integer, - Decimal, - AbsolutePx, - Percent, - PercentRemainder, - Inner, - Width, - Height, - TemplateString, - Color, - Bool, - None, -} - -// ==================================================================================================== - -/// Concrete values for data in the various types allowed by the reactive data and layout system -#[derive(Debug, Clone, PartialEq)] -pub enum TypedValue { - Layout(Vec), - Integer(i64), - Decimal(f64), - Dimension(Dimension), - TemplateString(Vec), - Color(Color), - Bool(bool), - None, -} - -impl TypedValue { - /// Converts this to a dimension, panics if not possible. - pub fn expect_dimension(&self) -> Dimension { - match self { - Self::Dimension(dimension) => *dimension, - _ => panic!("Expected a dimension"), - } - } -} - -// ==================================================================================================== - -/// A piece of a template string, made up of many of these enums concatenated together in alternating order between `String` and `Argument`, where the latter is a value or variable name -#[derive(Debug, Clone, PartialEq)] -pub enum TemplateStringSegment { - String(String), - Argument(TypedValueOrVariableName), -} - -// ==================================================================================================== - -/// A dimension is a measure along an axis. -#[derive(Copy, Clone, Debug, PartialEq)] -pub enum Dimension { - /// Absolute value in pixels. - AbsolutePx(f64), - /// Percent of parent container size along the same axis. - Percent(f64), - /// Percent of free space remaining in parent container. - PercentRemainder(f64), - /// Minimum size required to fit the children. - Inner, - /// Size relative to the width of this component. - Width, - /// Size relative to the height of this component. - Height, -} - -// ==================================================================================================== - -/// Dimensions along the four sides of a box layout -#[derive(Copy, Clone, Debug, PartialEq)] -pub struct BoxDimensions { - pub top: Dimension, - pub right: Dimension, - pub bottom: Dimension, - pub left: Dimension, -} - -impl BoxDimensions { - /// Construct new box dimensions, with values given for each side. - pub fn new(top: Dimension, right: Dimension, bottom: Dimension, left: Dimension) -> Self { - Self { top, right, bottom, left } - } - - /// Construct new box dimensions, with same values used for top-bottom and left-right. - pub fn symmetric(vertical: Dimension, horizontal: Dimension) -> Self { - Self::new(vertical, horizontal, vertical, horizontal) - } - - /// Construct new box dimensions with the same value for all sides. - pub fn all(value: Dimension) -> Self { - Self::new(value, value, value, value) - } - - /// Sets the padding on the top and bottom sides. - pub fn set_vertical(&mut self, value: Dimension) { - self.top = value; - self.bottom = value; - } - - /// Sets the padding on the left and right sides. - pub fn set_horizontal(&mut self, value: Dimension) { - self.left = value; - self.right = value; - } -} diff --git a/src/layout_attribute_parser.rs b/src/layout_attribute_parser.rs deleted file mode 100644 index 0b35916b7..000000000 --- a/src/layout_attribute_parser.rs +++ /dev/null @@ -1,318 +0,0 @@ -use crate::color::Color; -use crate::color_palette::ColorPalette; -use crate::layout_abstract_types::*; -use crate::layout_system::*; - -pub struct AttributeParser { - capture_attribute_prop_definition_regex: regex::Regex, - capture_attribute_type_sequences_regex: regex::Regex, - match_integer_regex: regex::Regex, - match_decimal_regex: regex::Regex, - split_by_string_templates_regex: regex::Regex, - capture_color_name_in_palette_regex: regex::Regex, -} - -impl AttributeParser { - // Prebuild all the regex patterns - pub fn new() -> Self { - let capture_attribute_prop_definition_regex: regex::Regex = regex::Regex::new( - // Prop definition: ?: (?, ... | ...) = ? - r"^\s*(\w*)\s*(:)\s*(\()\s*((?:(?:\w+)(?:\s*,\s*\w+)*)(?:\s*\|\s*(?:(?:\w+)(?:\s*,\s*\w+)*))*)\s*(\))\s*(=)\s*([\s\w'\[\]@%\-.,]+|`[^`]*`|\[\[.*\]\])\s*$", - ) - .unwrap(); - - let capture_attribute_type_sequences_regex: regex::Regex = regex::Regex::new(concat!( - // Argument: {{?}} - r#"^\s*(\{\{)\s*(\w*)\s*(\}\})\s*$|"#, - // Layout: [[?]] - r#"^\s*(\[\[)\s*(.*)\s*(\]\])\s*$|"#, - // Integer: ? - r#"^\s*(-?\d+)\s*$|"#, - // Decimal: ? - r#"^\s*(-?(?:(?:\d+\.\d*)|(?:\d*\.\d+)))\s*$|"#, - // AbsolutePx: ?px - r#"^\s*(-?(?:(?:\d+(?:\.\d*)?)|(?:\d*(?:\.\d+))))([Pp][Xx])\s*$|"#, - // Percent: ?% - r#"^\s*(-?(?:(?:\d+(?:\.\d*)?)|(?:\d*(?:\.\d+))))(%)\s*$|"#, - // PercentRemainder: ?@ - r#"^\s*(-?(?:(?:\d+(?:\.\d*)?)|(?:\d*(?:\.\d+))))(@)\s*$|"#, - // Inner: inner - r#"^\s*([Ii][Nn][Nn][Ee][Rr])\s*$|"#, - // Width: width - r#"^\s*([Ww][Ii][Dd][Tt][Hh])\s*$|"#, - // Height: height - r#"^\s*([Hh][Ee][Ii][Gg][Hh][Tt])\s*$|"#, - // TemplateString: `? ... {{?}} ...` - r#"^\s*(`)(.*)(`)\s*$|"#, - // Color: [?] - r#"^\s*(\[)(.*)(\])\s*$|"#, - // Bool: true/false - r#"^\s*([Tt][Rr][Uu][Ee]|[Ff][Aa][Ll][Ss][Ee])\s*$|"#, - // None: none - r#"^\s*([Nn][Oo][Nn][Ee])\s*$"#, - )) - .unwrap(); - - let match_integer_regex = regex::Regex::new(r"^\s*(-?\d+)\s*$").unwrap(); - - let match_decimal_regex = regex::Regex::new(r"^\s*(-?(?:(?:\d+\.\d*)|(?:\d*\.\d+)))\s*$").unwrap(); - - let split_by_string_templates_regex = regex::Regex::new(r"\{\{|\}\}").unwrap(); - - let capture_color_name_in_palette_regex = regex::Regex::new(r"\s*'(.*)'\s*").unwrap(); - - Self { - capture_attribute_prop_definition_regex, - capture_attribute_type_sequences_regex, - match_integer_regex, - match_decimal_regex, - split_by_string_templates_regex, - capture_color_name_in_palette_regex, - } - } - - pub fn parse_attribute_argument_types(&self, input: &str) -> Vec { - let attribute_types = input.split(",").map(|piece| piece.trim()).collect::>(); - let list = attribute_types - .iter() - .map(|attribute_type| self.parse_attribute_argument_type(attribute_type)) - .collect::>(); - list - } - - pub fn parse_attribute_argument_type(&self, attribute_type: &str) -> TypedValueOrVariableName { - // Match with the regular expression - let captures = self - .capture_attribute_type_sequences_regex - .captures(attribute_type) - .map(|captures| captures.iter().skip(1).flat_map(|c| c).map(|c| c.as_str()).collect::>()); - - // Match against the captured values as a list of tokens - let tokens = captures.as_ref().map(|c| c.as_slice()); - match tokens { - // Variable name: {{?}} - Some(["{{", name, "}}"]) => TypedValueOrVariableName::VariableName(String::from(*name)), - // Layout: [[?]] - Some(["[[", xml_syntax, "]]"]) => { - // Remove any whitespace in order to test if any XML syntax is present - let trimmed = xml_syntax.trim(); - - // Build either an empty vector (for empty XML input) or a vector with the one parsed XML fragment - let layout_entries = if trimmed.len() == 0 { - vec![] - } - else { - let unescaped = Self::unescape_xml(trimmed); - let parsed = LayoutSystem::parse_xml_node(&self, &unescaped[..], false).unwrap(); - // Put the single parsed node in a vector (TODO: this should set any number of parsed nodes once `parse_xml_node` becomes `parse_xml_nodes`) - vec![parsed] - }; - - // Return the `Layout` typed value with the empty vector or vector with the parsed XML fragment - TypedValueOrVariableName::TypedValue(TypedValue::Layout(layout_entries)) - }, - // Integer: ? - Some([value]) if self.match_integer_regex.is_match(value) => { - let integer = value - .parse::() - .expect(&format!("Invalid value `{}` specified in the attribute type `{}` when parsing XML layout", value, attribute_type)[..]); - TypedValueOrVariableName::TypedValue(TypedValue::Integer(integer)) - }, - // Decimal: ? - Some([value]) if self.match_decimal_regex.is_match(value) => { - let decimal = value - .parse::() - .expect(&format!("Invalid value `{}` specified in the attribute type `{}` when parsing XML layout", value, attribute_type)[..]); - TypedValueOrVariableName::TypedValue(TypedValue::Decimal(decimal)) - }, - // AbsolutePx: px - Some([value, px]) if px.eq_ignore_ascii_case("px") => { - let pixels = value - .parse::() - .expect(&format!("Invalid value `{}` specified in the attribute type`{}` when parsing XML layout", value, attribute_type)[..]); - let dimension = Dimension::AbsolutePx(pixels); - TypedValueOrVariableName::TypedValue(TypedValue::Dimension(dimension)) - }, - // Percent: ?% - Some([value, "%"]) => { - let percent = value - .parse::() - .expect(&format!("Invalid value `{}` specified in the attribute type `{}` when parsing XML layout", value, attribute_type)[..]); - let dimension = Dimension::Percent(percent); - TypedValueOrVariableName::TypedValue(TypedValue::Dimension(dimension)) - }, - // PercentRemainder: ?@ - Some([value, "@"]) => { - let percent_remainder = value - .parse::() - .expect(&format!("Invalid value `{}` specified in the attribute type `{}` when parsing XML layout", value, attribute_type)[..]); - let dimension = Dimension::PercentRemainder(percent_remainder); - TypedValueOrVariableName::TypedValue(TypedValue::Dimension(dimension)) - }, - // Inner: inner - Some([inner]) if inner.eq_ignore_ascii_case("inner") => TypedValueOrVariableName::TypedValue(TypedValue::Dimension(Dimension::Inner)), - // Width: width - Some([width]) if width.eq_ignore_ascii_case("width") => TypedValueOrVariableName::TypedValue(TypedValue::Dimension(Dimension::Width)), - // Height: height - Some([height]) if height.eq_ignore_ascii_case("height") => TypedValueOrVariableName::TypedValue(TypedValue::Dimension(Dimension::Height)), - // TemplateString: `? ... {{?}} ...` - Some(["`", string, "`"]) => { - let segments = self.parse_text_template_sequence(string); - TypedValueOrVariableName::TypedValue(TypedValue::TemplateString(segments)) - }, - // Color: [?] - Some(["[", color_name, "]"]) => { - let color = match self.capture_color_name_in_palette_regex.captures(color_name) { - Some(captures) => { - let palette_color = captures - .get(1) - .expect( - &format!( - "Invalid palette color name `{}` specified in the attribute type `{}` when parsing XML layout", - color_name, attribute_type - )[..], - ) - .as_str(); - ColorPalette::lookup_palette_color(palette_color).into_color_srgb() - }, - None => { - let parsed = color_name.parse::(); - let css_color = parsed.expect( - &format!( - "Invalid CSS color name `{}` specified in the attribute type `{}` when parsing XML layout", - color_name, attribute_type - )[..], - ); - Color::new( - css_color.r as f32 / 255.0, - css_color.g as f32 / 255.0, - css_color.b as f32 / 255.0, - css_color.a as f32 / 255.0, - ) - }, - }; - - TypedValueOrVariableName::TypedValue(TypedValue::Color(color)) - }, - // Bool: true/false - Some([true_or_false]) if true_or_false.eq_ignore_ascii_case("true") || true_or_false.eq_ignore_ascii_case("false") => { - let boolean = true_or_false.eq_ignore_ascii_case("true"); - TypedValueOrVariableName::TypedValue(TypedValue::Bool(boolean)) - }, - // None: none - Some([none]) if none.eq_ignore_ascii_case("none") => TypedValueOrVariableName::TypedValue(TypedValue::None), - // Unrecognized type pattern - _ => panic!("Invalid attribute type `{}` when parsing XML layout", attribute_type), - } - } - - pub fn parse_attribute_prop_definition(&self, attribute_declaration: &str) -> PropDefinition { - // Match with the regular expression - let captures = self - .capture_attribute_prop_definition_regex - .captures(attribute_declaration) - .map(|captures| captures.iter().skip(1).flat_map(|c| c).map(|c| c.as_str()).collect::>()); - - // Match against the captured values as a list of tokens - let tokens = captures.as_ref().map(|c| c.as_slice()); - match tokens { - // Prop definition: ?: (?, ... | ...) = ? - Some([name, ":", "(", raw_types_list, ")", "=", default_value]) => { - // Variable name bound in the prop definition - let name = String::from(*name); - - // Split the type sequences up into a list of options separated by vertical bars - let type_sequence_options = String::from(*raw_types_list) - .split("|") - .map(|group| { - // Split each type sequence into individual types separated by commas - group - .split(",") - .map(|individual_type| { - // Remove any whitespace around the type - let individual_type = individual_type.trim(); - - // Return the case-insensitive TypeName enum for the individual type - match &individual_type.to_ascii_lowercase()[..] { - "layout" => TypeName::Layout, - "integer" => TypeName::Integer, - "decimal" => TypeName::Decimal, - "absolutepx" => TypeName::AbsolutePx, - "percent" => TypeName::Percent, - "percentremainder" => TypeName::PercentRemainder, - "inner" => TypeName::Inner, - "width" => TypeName::Width, - "height" => TypeName::Height, - "templatestring" => TypeName::TemplateString, - "color" => TypeName::Color, - "bool" => TypeName::Bool, - "none" => TypeName::None, - _ => panic!( - "Invalid type `{}` specified in the attribute type `{}` when parsing XML layout", - individual_type, attribute_declaration - ), - } - }) - .collect::>() - }) - .collect::>>(); - - // Split the provided default values into a sequence - let default_type_sequence = default_value - .split(",") - .map(|individual_type| match self.parse_attribute_argument_type(individual_type) { - TypedValueOrVariableName::TypedValue(type_value) => type_value, - TypedValueOrVariableName::VariableName(variable_value) => { - panic!( - "Found the default variable name `{:?}` in the attribute declaration `{}` (which only allows typed values) when parsing XML layout", - variable_value, attribute_declaration - ); - }, - }) - .collect::>(); - - // TODO: Verify the default types match the specified allowed types - - // Return the prop definition - PropDefinition::new(name, type_sequence_options, default_type_sequence) - }, - // Unrecognized type pattern - _ => panic!("Invalid attribute attribute declaration `{}` when parsing XML layout", attribute_declaration), - } - } - - /// Extract {{template tags}} from surrounding text and return a vector alternating between text and the argument - pub fn parse_text_template_sequence(&self, input_text: &str) -> Vec { - let mut segments = Vec::::new(); - let mut is_template = false; - - // Alternate between string and handlebars, always starting wtih string even if empty, and push abstract tokens of non-empty ones to the TemplateString sequence - for part in self.split_by_string_templates_regex.split(input_text) { - // Push only non-empty template string segments (a String or Argument) - if !part.is_empty() { - // Based on whether we are alternating to a string or template, push the appropriate abstract token - let segment = match is_template { - false => TemplateStringSegment::String(String::from(part)), - true => TemplateStringSegment::Argument(TypedValueOrVariableName::VariableName(String::from(part))), - }; - segments.push(segment); - } - - // The next iteration will switch from a template to a string or vice versa - is_template = !is_template; - } - - segments - } - - /// Replace escape characters in an XML string, only supports `&, <, >, ", '` - fn unescape_xml(xml: &str) -> String { - // Find and replace each escape character, starting with `&` to avoid unescaping other escape sequences - xml.replace("&", "&") - .replace("<", "<") - .replace(">", ">") - .replace(""", "\"") - .replace("apos;", "'") - .replace("'", "'") - } -} diff --git a/src/layout_system.rs b/src/layout_system.rs deleted file mode 100644 index 5e270f2bf..000000000 --- a/src/layout_system.rs +++ /dev/null @@ -1,379 +0,0 @@ -use crate::layout_abstract_syntax::*; -use crate::layout_abstract_types::*; -use crate::layout_attribute_parser::*; -use crate::resource_cache::ResourceCache; -use crate::window_dom::*; -use std::collections::HashSet; -use std::fs; -use std::io; - -pub struct LayoutSystem<'a> { - windows: Vec>, - loaded_components: ResourceCache, - attribute_parser: AttributeParser, -} - -impl<'a> LayoutSystem<'a> { - /// Construct the `LayoutSystem` with zero windows, an empty cache of component XML layouts, and an `AttributeParser` with its regex parsers - pub fn new() -> Self { - Self { - windows: vec![], - loaded_components: ResourceCache::new(), - attribute_parser: AttributeParser::new(), - } - } - - /// Load and construct a new window from a layout component - pub fn add_window(&'a mut self, name: (&str, &str), window_size: (u32, u32)) { - // Preload the component and its dependencies - self.preload_component(name) - .expect(&format!("Failure loading layout component '{}'", Self::component_name(name))[..]); - - // Get the now-loaded component's namespace:name - let window_root_component_name = Self::component_name(name); - - // Construct the window and save it - let new_window = WindowDom::new(&window_root_component_name[..], window_size, &self.loaded_components); - self.windows.push(new_window); - } - - /// Preload and cache a component by its namespace and name, then recursively explore and repeat for its descendants - pub fn preload_component(&mut self, name: (&str, &str)) -> io::Result<()> { - // Load and parse the XML file's AST for the visited tag - let xml_path = Self::layout_xml_path(name); - let mut component = Self::parse_xml_component(&self.attribute_parser, &xml_path[..], true)?; - - // Keep track of it being loaded to prevent duplicate work during the recursive traversal - let mut already_loaded_layouts = HashSet::new(); - already_loaded_layouts.insert(Self::component_name(name)); - - // Parse and cache components recursively for all tags referenced within this root component - self.explore_component(&mut component, &mut already_loaded_layouts); - - // Save this loaded root-level component to the cache - let component_name = Self::component_name(name); - self.loaded_components.set(&component_name[..], component); - - // Success - Ok(()) - } - - /// Preload and cache every XML component file referenced by tags within a recursive traversal of descendants in the given flat component - fn explore_component(&mut self, component: &mut FlatComponent, already_loaded_layouts: &mut HashSet) { - // Go through each direct child in the list that makes up flat component - for child_tag in &component.child_components { - self.explore_component_tag(child_tag, already_loaded_layouts); - } - - // Go through each prop definition and preload any default values of layouts - for definition in &component.own_info.prop_definitions { - for default in definition.type_sequence_default.iter() { - if let TypedValue::Layout(layouts) = default { - for layout in layouts { - match &*layout.borrow() { - LayoutComponentNode::Tag(tag) => self.explore_component_tag(tag, already_loaded_layouts), - LayoutComponentNode::Text(_) => {}, - } - } - } - } - } - } - - /// Preload and cache every XML component file referenced by tags within a recursive traversal of descendants in the given component tag - fn explore_component_tag(&mut self, tag: &LayoutComponentTag, already_loaded_layouts: &mut HashSet) { - // Determine the cache key of form namespace:name - let (name, namespace) = &tag.name; - let key = Self::component_name((&name[..], &namespace[..])); - - // Load the new component if it isn't already preloaded - if !already_loaded_layouts.contains(&key[..]) && self.loaded_components.get(&key[..]).is_none() { - // Load and parse the component XML file for the visited tag - let xml_path = Self::layout_xml_path((&name[..], &namespace[..])); - let mut component = Self::parse_xml_component(&self.attribute_parser, &xml_path[..], true).unwrap(); - - // Keep track of it being loaded to prevent duplicate work - let key_copy = key.clone(); - already_loaded_layouts.insert(key); - - // Recursively explore the newly loaded component - self.explore_component(&mut component, already_loaded_layouts); - - // Save the loaded component to the cache - self.loaded_components.set(&key_copy[..], component); - } - - // Expore the props with values of type Layout - for argument in &tag.props { - for value in &argument.value_sequence { - if let TypedValueOrVariableName::TypedValue(TypedValue::Layout(layouts)) = value { - for layout in layouts { - match &*layout.borrow() { - LayoutComponentNode::Tag(component_tag) => self.explore_component_tag(component_tag, already_loaded_layouts), - LayoutComponentNode::Text(_) => {}, - } - } - } - } - } - - // Explore the tree of the `children` elements stored in this component - if let Some(ref children) = tag.children { - for child_node in children.iter() { - for descendant in child_node.descendants() { - match &*descendant.borrow() { - LayoutComponentNode::Tag(component_tag) => self.explore_component_tag(component_tag, already_loaded_layouts), - LayoutComponentNode::Text(_) => {}, - } - } - } - } - } - - /// Parse an XML component all the way into a flat component structure - pub fn parse_xml_component(attribute_parser: &AttributeParser, path_or_source: &str, is_path_not_source: bool) -> io::Result { - println!("Parsing XML Component: {}", path_or_source); - let parsed_tree = &mut Self::parse_xml_tree(attribute_parser, path_or_source, is_path_not_source, true)?; - let flat_tree = Self::flatten_component_tree(parsed_tree); - Ok(flat_tree) - } - - /// Parse a fragment of XML layout syntax with a tree of tags (currently only supports a single root node, should eventually implement returning a vector of them) - pub fn parse_xml_node(attribute_parser: &AttributeParser, path_or_source: &str, is_path_not_source: bool) -> io::Result { - let parsed_tree = Self::parse_xml_tree(attribute_parser, path_or_source, is_path_not_source, false)?; - Ok(Self::node_tree_from_node_or_def_tree(&parsed_tree)) - } - - /// Flatten a full XML component AST into a vector of the immediate children and put the descendants of those nodes into `children` attributes - fn flatten_component_tree(tree: &mut NodeOrDefTree) -> FlatComponent { - let own_info = match &*tree.borrow() { - LayoutComponentNodeOrDefinition::LayoutComponentDefinition(definition) => definition.clone(), - LayoutComponentNodeOrDefinition::LayoutComponentNode(LayoutComponentNode::Tag(_)) => panic!("Tag node found in place of component definition"), - LayoutComponentNodeOrDefinition::LayoutComponentNode(LayoutComponentNode::Text(_)) => panic!("Text node found in place of component definition"), - }; - - // Turn all the tag nodes (but not text nodes) into a list of flat child components (with their descendant trees in their `children` attributes) - let child_components = tree - // Get the direct children from this tree node - .children() - // Clone each child abstract tag node (ignoring text nodes) with each of their descendants added to their `children` attribute variable - .filter_map(|child_node| { - // Filter out text nodes because they make no sense as child components - let mut cloned_tag = match &*child_node.borrow() { - LayoutComponentNodeOrDefinition::LayoutComponentNode(LayoutComponentNode::Tag(child_tag)) => child_tag.clone(), - LayoutComponentNodeOrDefinition::LayoutComponentNode(LayoutComponentNode::Text(_)) => return None, - LayoutComponentNodeOrDefinition::LayoutComponentDefinition(_) => panic!("Component definition found in place of tag node"), - }; - - // Clone the tree for this child as `LayoutComponentNode`s and turn its children into a vector, then set that vector as the `children` attribute - let node_within_root = Self::node_tree_from_node_or_def_tree(&child_node); - let children = node_within_root.children().map(|mut child| { - // Child must be detached in order to live on its own in the vector, otherwise it will be cleaned up when its (former) parent is dropped - child.detach(); - child - }).collect::>(); - cloned_tag.set_children(children); - - // Return this `LayoutComponentTag` within the component's root definition tag - Some(cloned_tag) - }) - .collect::>(); - - // Build and return the resulting flat component made from the cloned data for its `own_info` and `child_components` - FlatComponent::new(own_info, child_components) - } - - /// Get an AST root node representing a parsed XML component file or XML source code - pub fn parse_xml_tree(attribute_parser: &AttributeParser, path_or_source: &str, is_path_not_source: bool, component_declaration: bool) -> io::Result { - // XML component file markup source code - let (path, source) = if is_path_not_source { - (path_or_source, fs::read_to_string(path_or_source)?) - } - else { - ("[Inline Attribute XML]", String::from(path_or_source)) - }; - - // XML document parser that feeds token-by-token through the file - let parser = xmlparser::Tokenizer::from(&source[..]); - - // Node stack used to collect descendant nodes while reading deeper into the tree until each reaches its closing tag - let mut stack: Vec = Vec::new(); - // Opening XML tag used to collect the tag name and its various attributes - let mut current_opening_tag: Option = None; - // Top-level node that is popped from the stack when the closing tag is reached at the end of the XML document - let mut final_result: Option = None; - - for token_result in parser { - let token = token_result.expect(&format!("Invalid syntax when parsing XML layout in component: {}", path)[..]); - match token { - // Beginning of an opening tag ( { - // Get the supplied namespace and tag name as owned strings - let name = (String::from(prefix.as_str()), String::from(local.as_str())); - - // If this is the root element and we're parsing a component file, the root tag is the component definition - if stack.is_empty() && component_declaration { - // Construct and store the component definition while attributes are added until its opening tag ends - let definition = LayoutComponentDefinition::new(name); - current_opening_tag = Some(LayoutComponentNodeOrDefinition::LayoutComponentDefinition(definition)); - } - // Otherwise, we're parsing a node inside the root or at the root of a fragment of XML layout syntax - else { - // Construct and store the component node while attributes are added until the opening (or self-closing) tag ends - let tag_node = LayoutComponentNode::new_tag(name); - current_opening_tag = Some(LayoutComponentNodeOrDefinition::LayoutComponentNode(tag_node)); - } - }, - // Any attributes within the current opening tag (... ATTRIBUTE="VALUE" ...) - xmlparser::Token::Attribute { prefix, local, value, .. } => { - // Check if the attribute has an empty prefix (thus, only a colon) - let colon_prefixed = prefix.start() > 0 && (prefix.start() == prefix.end()); - // Set the name to the given name, possibly with a prepended colon - let name = if colon_prefixed { - let slice = local.as_str(); - let mut string = String::with_capacity(slice.len() + 1); - string.push(':'); - string.push_str(slice); - string - } - else { - String::from(local.as_str()) - }; - // Set the value to an ordinary string slice of the given value - let value = value.as_str(); - - // Add the new attribute to the current yet-to-be-closed element - match &mut current_opening_tag { - // Add this attribute as a definition of a prop to the current root-level component definition tag - Some(LayoutComponentNodeOrDefinition::LayoutComponentDefinition(definition)) => { - let prop_definition = attribute_parser.parse_attribute_prop_definition(value); - definition.add_prop_definition(prop_definition); - }, - // Add this attribute as a prop to the current tag - Some(LayoutComponentNodeOrDefinition::LayoutComponentNode(LayoutComponentNode::Tag(tag))) => { - let parsed_attributes = attribute_parser.parse_attribute_argument_types(value); - let attribute_argument = Prop::new(name, parsed_attributes); - tag.add_attribute(attribute_argument); - }, - // It should be impossible to add an attribute when there is no opening tag in progress - _ => unreachable!(), - } - }, - // Either the end of the opening tag (...>) or the end of a self-closing tag (.../>) or an entire closing tag () - xmlparser::Token::ElementEnd { end, .. } => { - match end { - // After adding any attributes, this element's opening tag ends (...>) - xmlparser::ElementEnd::Open => { - // After adding any attributes, we are now a layer deeper in the stack of yet-to-be-closed descendants - let complete_opening_tag = current_opening_tag.take().unwrap(); - let tree_node = rctree::Node::new(complete_opening_tag); - stack.push(tree_node); - }, - // After adding any attributes, this element's self-closing tag ends (.../>) - xmlparser::ElementEnd::Empty => { - // Because a self-closing element does not go deeper, attach this now-complete node directly to its parent - let parent_node = stack.last_mut().expect(&format!("Invalid syntax when parsing XML layout in component: {}", path)[..]); - let complete_self_closing_tag = current_opening_tag.take().unwrap(); - let tree_node = rctree::Node::new(complete_self_closing_tag); - parent_node.append(tree_node); - }, - // After visiting any descendants inside the opening tag, finally the closing tag is reached () - xmlparser::ElementEnd::Close(..) => { - // Pop the element now that descendants have been parsed and we make our way back up the tree one level - let closed_node_with_descendants = stack - .pop() - .expect(&format!("Encountered extra closing tag when parsing XML layout in component: {}", path)[..]); - - // Append this now-complete node to its parent, unless there is no parent, in which case we save this root node as the final result - match stack.last_mut() { - // If a parent node exists - Some(parent_node) => { - parent_node.append(closed_node_with_descendants); - }, - // If this is the root node - None => { - match final_result { - // Save the root element as the final result - None => final_result = Some(closed_node_with_descendants), - // There can only be one root element in the XML document, but this isn't the first one encountered - Some(_) => panic!("Encountered multiple root-level tags when parsing XML layout in component: {}", path), - } - }, - } - }, - } - }, - // A text node in the space between sibling elements (... SOME TEXT ...) - xmlparser::Token::Text { text } => { - // Trim any whitespace from around the string - let text_string = String::from(text.as_str().trim()); - - // If the string isn't all whitespace, append a new text node to the parent - if !text_string.is_empty() { - // Get the tree node which contains this text - let parent_node = stack - .last_mut() - .expect(&format!("Encountered text outside the root tag when parsing XML layout in component: {}", path)[..]); - - // Construct a text node with the provided text - let text_template_sequence = attribute_parser.parse_text_template_sequence(&text_string[..]); - let abstract_text_node = LayoutComponentNodeOrDefinition::LayoutComponentNode(LayoutComponentNode::new_text(text_template_sequence)); - // Put the text node in a new tree node - let tree_node = rctree::Node::new(abstract_text_node); - - // Attach the new text node on the parent in the tree which contains this text - parent_node.append(tree_node); - } - }, - _ => {}, - } - } - - // Return the final result or throw an error - match final_result { - None => panic!("Invalid syntax when parsing XML layout in component: {}", path), - Some(tree) => Ok(tree), - } - } - - /// Get a string in `namespace:name` format (or just `name` for primitives) given a namespace and component name - pub fn component_name(name: (&str, &str)) -> String { - let (namespace, file) = name; - if namespace.len() > 0 { - format!("{}:{}", namespace, file) - } - else { - String::from(file) - } - } - - /// Get the XML file path given a namespace and component name - fn layout_xml_path(name: (&str, &str)) -> String { - let (namespace, file) = name; - if namespace.len() > 0 { - format!("gui/{}/{}.xml", namespace, file) - } - else { - format!("gui/{}.xml", file) - } - } - - /// Convert every element in the tree of `LayoutComponentNodeOrDefinition` wrapper enums into unwrapped `LayoutComponentNode` structs - fn node_tree_from_node_or_def_tree(layout_component_node_or_definition: &NodeOrDefTree) -> NodeTree { - // Unwrap the `LayoutComponentNode` from the root element's value - let cloned_node_data = match &*layout_component_node_or_definition.borrow() { - LayoutComponentNodeOrDefinition::LayoutComponentNode(node) => node.clone(), - LayoutComponentNodeOrDefinition::LayoutComponentDefinition(_) => panic!("Found an unexpected component definition while expecting a node"), - }; - - // Build a new tree of the correct type with the unwrapped data as its root value - let mut tree_result = rctree::Node::new(cloned_node_data); - - // Go through all the direct children of the old tree and append the new recursively converted trees to match the shape of the old tree - for tree_node in layout_component_node_or_definition.children() { - tree_result.append(Self::node_tree_from_node_or_def_tree(&tree_node)); - } - - tree_result - } -} diff --git a/src/main.rs b/src/main.rs deleted file mode 100644 index 91bdf5652..000000000 --- a/src/main.rs +++ /dev/null @@ -1,38 +0,0 @@ -mod application; -mod color; -mod color_palette; -mod draw_command; -mod gui_attributes; -mod gui_node; -mod layout_abstract_syntax; -mod layout_abstract_types; -mod layout_attribute_parser; -mod layout_system; -mod pipeline; -mod resource_cache; -mod shader_stage; -mod texture; -mod window_dom; -mod window_events; - -use application::Application; -use winit::event_loop::EventLoop; -use winit::window::WindowBuilder; - -fn main() { - // Display graphics API errors (requires Vulkan SDK is installed) - #[cfg(feature = "debug")] - env_logger::init(); - - // Handles all window events, user input, and redraws - let event_loop = EventLoop::new(); - - // Application window in the operating system - let window = WindowBuilder::new().with_title("Graphite").build(&event_loop).unwrap(); - - // Initialize the render pipeline - let app = Application::new(&window); - - // Begin the application lifecycle - app.begin_lifecycle(event_loop, window); -} diff --git a/src/pipeline.rs b/src/pipeline.rs deleted file mode 100644 index 734a311fe..000000000 --- a/src/pipeline.rs +++ /dev/null @@ -1,177 +0,0 @@ -use crate::resource_cache::ResourceCache; -use crate::shader_stage; -use std::mem; - -pub struct Pipeline { - pub bind_group_layout: wgpu::BindGroupLayout, - pub render_pipeline: wgpu::RenderPipeline, -} - -impl Pipeline { - pub fn new( - device: &wgpu::Device, - swap_chain_color_format: wgpu::TextureFormat, - extra_layouts: Vec<&wgpu::BindGroupLayout>, - shader_cache: &mut ResourceCache, - shader_pair_path: (&str, &str), - ) -> Self { - // Load the vertex and fragment shaders - let shader_pair = Pipeline::get_shader_pair(device, shader_cache, shader_pair_path); - - // Prepare a bind group layout for the GUI element's texture and form factor data - let bind_group_layout = Pipeline::build_bind_group_layout( - device, - &vec![ - wgpu::BindingType::UniformBuffer { dynamic: false }, - wgpu::BindingType::SampledTexture { - dimension: wgpu::TextureViewDimension::D2, - component_type: wgpu::TextureComponentType::Float, - multisampled: false, - }, - wgpu::BindingType::Sampler { comparison: false }, - ], - ); - - // Combine all bind group layouts - let mut bind_group_layouts = vec![&bind_group_layout]; - bind_group_layouts.append(&mut extra_layouts.clone()); - - // Construct the pipeline - let render_pipeline = Pipeline::build_pipeline(device, swap_chain_color_format, bind_group_layouts, shader_pair); - Self { - bind_group_layout, - render_pipeline, - } - } - - pub fn get_shader_pair<'a>( - device: &wgpu::Device, - shader_cache: &'a mut ResourceCache, - shader_pair_path: (&str, &str), - ) -> (&'a wgpu::ShaderModule, &'a wgpu::ShaderModule) { - // If uncached, construct a vertex shader loaded from its source code file - if shader_cache.get(shader_pair_path.0).is_none() { - let vertex_shader_module = shader_stage::compile_from_glsl(device, shader_pair_path.0, glsl_to_spirv::ShaderType::Vertex).unwrap(); - shader_cache.set(shader_pair_path.0, vertex_shader_module); - } - - // If uncached, construct a fragment shader loaded from its source code file - if shader_cache.get(shader_pair_path.1).is_none() { - let fragment_shader_module = shader_stage::compile_from_glsl(&device, shader_pair_path.1, glsl_to_spirv::ShaderType::Fragment).unwrap(); - shader_cache.set(shader_pair_path.1, fragment_shader_module); - } - - // Get the shader pair - let vertex_shader = shader_cache.get(shader_pair_path.0).unwrap(); - let fragment_shader = shader_cache.get(shader_pair_path.1).unwrap(); - - (vertex_shader, fragment_shader) - } - - pub fn build_bind_group_layouts(device: &wgpu::Device, bind_group_layouts: &Vec>) -> Vec { - bind_group_layouts - .into_iter() - .map(|layout_entry| Self::build_bind_group_layout(device, layout_entry)) - .collect::>() - } - - pub fn build_bind_group_layout(device: &wgpu::Device, bind_group_layout: &Vec) -> wgpu::BindGroupLayout { - device.create_bind_group_layout(&wgpu::BindGroupLayoutDescriptor { - label: None, - bindings: bind_group_layout - .into_iter() - .enumerate() - .map(|(index, binding_type)| wgpu::BindGroupLayoutEntry { - binding: index as u32, - visibility: wgpu::ShaderStage::all(), - ty: binding_type.clone(), - }) - .collect::>() - .as_slice(), - }) - } - - pub fn build_binding_staging_buffer(device: &wgpu::Device, resource: &T) -> wgpu::Buffer { - // Construct a staging buffer with the binary uniform struct data - device.create_buffer_with_data(bytemuck::cast_slice(&[*resource]), wgpu::BufferUsage::UNIFORM | wgpu::BufferUsage::COPY_DST) - } - - pub fn build_binding_resource(resource_buffer: &wgpu::Buffer) -> wgpu::BindingResource { - // Return the buffer as a binding resource - wgpu::BindingResource::Buffer { - buffer: resource_buffer, - range: 0..std::mem::size_of_val(resource_buffer) as wgpu::BufferAddress, - } - } - - pub fn build_bind_group(device: &wgpu::Device, bind_group_layout: &wgpu::BindGroupLayout, binding_resources: Vec) -> wgpu::BindGroup { - let bindings = binding_resources - .into_iter() - .enumerate() - .map(|(index, binding_resource)| wgpu::Binding { - binding: index as u32, - resource: binding_resource, - }) - .collect::>(); - - device.create_bind_group(&wgpu::BindGroupDescriptor { - layout: bind_group_layout, - bindings: bindings.as_slice(), - label: None, - }) - } - - pub fn build_pipeline( - device: &wgpu::Device, - swap_chain_color_format: wgpu::TextureFormat, - bind_group_layouts: Vec<&wgpu::BindGroupLayout>, - shader_pair: (&wgpu::ShaderModule, &wgpu::ShaderModule), - ) -> wgpu::RenderPipeline { - let render_pipeline_layout = device.create_pipeline_layout(&wgpu::PipelineLayoutDescriptor { - bind_group_layouts: bind_group_layouts.as_slice(), - }); - - let (vertex_shader, fragment_shader) = shader_pair; - device.create_render_pipeline(&wgpu::RenderPipelineDescriptor { - layout: &render_pipeline_layout, - vertex_stage: wgpu::ProgrammableStageDescriptor { - module: vertex_shader, - entry_point: "main", - }, - fragment_stage: Some(wgpu::ProgrammableStageDescriptor { - module: fragment_shader, - entry_point: "main", - }), - rasterization_state: Some(wgpu::RasterizationStateDescriptor { - front_face: wgpu::FrontFace::Ccw, - cull_mode: wgpu::CullMode::None, - depth_bias: 0, - depth_bias_slope_scale: 0.0, - depth_bias_clamp: 0.0, - }), - primitive_topology: wgpu::PrimitiveTopology::TriangleList, - color_states: &[wgpu::ColorStateDescriptor { - format: swap_chain_color_format, - color_blend: wgpu::BlendDescriptor::REPLACE, - alpha_blend: wgpu::BlendDescriptor::REPLACE, - write_mask: wgpu::ColorWrite::ALL, - }], - depth_stencil_state: None, - vertex_state: wgpu::VertexStateDescriptor { - index_format: wgpu::IndexFormat::Uint16, - vertex_buffers: &[wgpu::VertexBufferDescriptor { - stride: mem::size_of::<[f32; 2]>() as wgpu::BufferAddress, - step_mode: wgpu::InputStepMode::Vertex, - attributes: &[wgpu::VertexAttributeDescriptor { - offset: 0, - shader_location: 0, - format: wgpu::VertexFormat::Float2, - }], - }], - }, - sample_count: 1, - sample_mask: !0, - alpha_to_coverage_enabled: false, - }) - } -} diff --git a/src/resource_cache.rs b/src/resource_cache.rs deleted file mode 100644 index 510ec59a2..000000000 --- a/src/resource_cache.rs +++ /dev/null @@ -1,49 +0,0 @@ -use std::collections::HashMap; - -#[derive(Copy, Clone, PartialEq, Debug)] -struct CacheID { - index: usize, -} - -impl CacheID { - fn new(index: usize) -> Self { - Self { index } - } -} - -pub struct ResourceCache { - pub resources: Vec, - name_to_id: HashMap, -} - -impl ResourceCache { - pub fn new() -> Self { - let resources = Vec::new(); - let name_to_id = HashMap::new(); - - Self { resources, name_to_id } - } - - #[allow(dead_code)] - pub fn get(&self, name: &str) -> Option<&T> { - match self.name_to_id.get(name) { - Some(id) => self.resources.get(id.index), - None => None, - } - } - - #[allow(dead_code)] - pub fn set(&mut self, name: &str, resource: T) { - match self.name_to_id.get(name) { - Some(id) => { - self.resources[id.index] = resource; - }, - None => { - let last_index = self.name_to_id.len(); - let id = CacheID::new(last_index); - self.name_to_id.insert(String::from(name), id); - self.resources.push(resource); - }, - } - } -} diff --git a/src/shader_stage.rs b/src/shader_stage.rs deleted file mode 100644 index 49166123e..000000000 --- a/src/shader_stage.rs +++ /dev/null @@ -1,17 +0,0 @@ -use std::fs; -use std::io; - -pub fn compile_from_glsl(device: &wgpu::Device, path: &str, shader_type: glsl_to_spirv::ShaderType) -> io::Result { - let source = fs::read_to_string(path)?; - let spirv = match glsl_to_spirv::compile(&source[..], shader_type) { - Ok(spirv_output) => spirv_output, - Err(message) => { - println!("Error compiling GLSL to SPIRV shader: {}", message); - panic!("{}", message); - }, - }; - let compiled = wgpu::read_spirv(spirv)?; - let shader = device.create_shader_module(&compiled); - - Ok(shader) -} diff --git a/src/texture.rs b/src/texture.rs deleted file mode 100644 index 74ee084e3..000000000 --- a/src/texture.rs +++ /dev/null @@ -1,106 +0,0 @@ -use crate::resource_cache::ResourceCache; -use image::GenericImageView; -use std::fs; - -pub struct Texture { - pub texture: wgpu::Texture, - pub texture_view: wgpu::TextureView, - pub sampler: wgpu::Sampler, -} - -impl Texture { - pub fn cached_load<'a>(device: &wgpu::Device, queue: &mut wgpu::Queue, path: &str, texture_cache: &'a mut ResourceCache) -> &'a Texture { - // If uncached, construct a texture loaded from the image file - if texture_cache.get(path).is_none() { - let texture = Texture::from_filepath(device, queue, path).unwrap(); - texture_cache.set(path, texture); - } - texture_cache.get(path).unwrap() - } - - pub fn from_filepath(device: &wgpu::Device, queue: &mut wgpu::Queue, path: &str) -> Result { - // Read the raw bytes from the specified file - let bytes = fs::read(path)?; - - // Construct and return a Texture from the bytes - Texture::from_bytes(device, queue, &bytes[..]) - } - - pub fn from_bytes(device: &wgpu::Device, queue: &mut wgpu::Queue, bytes: &[u8]) -> Result { - // Create an image with the Image library - let image = image::load_from_memory(bytes)?; - - // Construct and return a Texture from the Image - Self::from_image(device, queue, &image) - } - - pub fn from_image(device: &wgpu::Device, queue: &mut wgpu::Queue, image: &image::DynamicImage) -> Result { - // Get data from image - let rgba = image.as_rgba8().unwrap(); - let dimensions = image.dimensions(); - let size = wgpu::Extent3d { - width: dimensions.0, - height: dimensions.1, - depth: 1, - }; - - // Create a buffer on the GPU and load it with the image pixel data - let buffer = device.create_buffer_with_data(&rgba, wgpu::BufferUsage::COPY_SRC); - - // Create an empty texture on the GPU of the correct size for the buffer - let texture = device.create_texture(&wgpu::TextureDescriptor { - label: None, - size, - array_layer_count: 1, - mip_level_count: 1, - sample_count: 1, - dimension: wgpu::TextureDimension::D2, - format: wgpu::TextureFormat::Rgba8UnormSrgb, - usage: wgpu::TextureUsage::SAMPLED | wgpu::TextureUsage::COPY_DST, - }); - - // Use a command encoder to transfer the pixel data buffer into the texture - let mut encoder = device.create_command_encoder(&wgpu::CommandEncoderDescriptor { label: None }); - encoder.copy_buffer_to_texture( - wgpu::BufferCopyView { - buffer: &buffer, - offset: 0, - bytes_per_row: 4 * dimensions.0, - rows_per_image: dimensions.1, - }, - wgpu::TextureCopyView { - texture: &texture, - mip_level: 0, - array_layer: 0, - origin: wgpu::Origin3d::ZERO, - }, - size, - ); - - // Finishing the encoding yields the resulting command buffer that is submitted to the GPU's command queue - let command_buffer = encoder.finish(); - queue.submit(&[command_buffer]); - - // Create the TextureView for this texture - let view = texture.create_default_view(); - - // Create the Sampler for this texture - let sampler = device.create_sampler(&wgpu::SamplerDescriptor { - address_mode_u: wgpu::AddressMode::ClampToEdge, - address_mode_v: wgpu::AddressMode::ClampToEdge, - address_mode_w: wgpu::AddressMode::ClampToEdge, - mag_filter: wgpu::FilterMode::Linear, - min_filter: wgpu::FilterMode::Nearest, - mipmap_filter: wgpu::FilterMode::Nearest, - lod_min_clamp: -100.0, - lod_max_clamp: 100.0, - compare: wgpu::CompareFunction::Always, - }); - - Ok(Self { - texture, - texture_view: view, - sampler, - }) - } -} diff --git a/src/window_dom.rs b/src/window_dom.rs deleted file mode 100644 index 20999167d..000000000 --- a/src/window_dom.rs +++ /dev/null @@ -1,105 +0,0 @@ -use crate::layout_abstract_syntax::*; -use crate::layout_abstract_types::*; -use crate::{layout_system::*, resource_cache::ResourceCache}; -use std::collections::HashMap; - -pub struct WindowDom<'a> { - pub dom: rctree::Node, - loaded_components: &'a ResourceCache, -} - -impl<'a> WindowDom<'a> { - pub fn new(root_component: &str, window_size: (u32, u32), loaded_components: &'a ResourceCache) -> WindowDom<'a> { - let mut layout_attributes = LayoutAttributes::default(); - layout_attributes.width = Dimension::AbsolutePx(window_size.0 as f64); - layout_attributes.height = Dimension::AbsolutePx(window_size.1 as f64); - - let dom = Self::build_dom_from_component(root_component, &layout_attributes, &vec![], loaded_components); - Self { dom, loaded_components } - } - - fn build_dom_from_component( - root_component: &str, - layout_attributes: &LayoutAttributes, - props: &Vec, - loaded_components: &'a ResourceCache, - ) -> rctree::Node { - // Instantiate the DOM node and put it in a tree node - let component = loaded_components.get(root_component).unwrap(); - let dom_node = DomNode::from_component(component, layout_attributes, props); - let mut tree = rctree::Node::new(dom_node); - - // Recursively build the child `DomNode` tree node instances - let child_nodes = component - .child_components - .iter() - .map(|child| { - // Get the child name used as the component cache key - let (namespace, name) = &child.name; - let component_name = LayoutSystem::component_name((namespace, name)); - - // Recursively build the child `DomNode` component instance - Self::build_dom_from_component(&component_name[..], &child.layout, &child.props, loaded_components) - }) - .collect::>(); - - // Append each child `DomNode` tree node - for child in child_nodes { - tree.append(child); - } - - // Return the tree that has been recursively built with sibling and child components - tree - } -} - -pub struct DomNode { - pub cache_name: String, - pub layout_attributes: LayoutAttributes, - pub variable_bindings: HashMap>, -} - -impl DomNode { - pub fn new(cache_name: String, layout_attributes: LayoutAttributes, variable_bindings: HashMap>) -> Self { - Self { - cache_name, - layout_attributes, - variable_bindings, - } - } - - pub fn from_component(component: &FlatComponent, layout_attributes: &LayoutAttributes, props: &Vec) -> Self { - // Cached name of the loaded component - let (namespace, name) = &component.own_info.name; - let cache_name = LayoutSystem::component_name((&namespace[..], &name[..])); - - // Every VARIABLE_NAME binding defined in the prop definitions on this component - let mut variable_bindings = component - .own_info - .prop_definitions - .iter() - .map(|prop_definition| { - ( - // HashMap key is the prop name - prop_definition.variable_name.clone(), - // HashMap value is the prop definition's default value - prop_definition - .type_sequence_default - .iter() - .map(|value| TypedValueOrVariableName::TypedValue(value.clone())) - .collect::>(), - ) - }) - .collect::>(); - // Overwrite the default values for the provided props - for prop in props { - if !variable_bindings.contains_key(&prop.name[..]) { - panic!("Invalid argument {} given to the {} component", prop.name, cache_name); - } - - variable_bindings.insert(prop.name.clone(), prop.value_sequence.clone()); - } - - Self::new(cache_name, layout_attributes.clone(), variable_bindings) - } -} diff --git a/src/window_events.rs b/src/window_events.rs deleted file mode 100644 index 3447fbcd6..000000000 --- a/src/window_events.rs +++ /dev/null @@ -1,70 +0,0 @@ -use crate::application::Application; -use winit::event::*; -use winit::event_loop::ControlFlow; - -pub fn window_event(application: &mut Application, control_flow: &mut ControlFlow, event: &WindowEvent) { - match event { - WindowEvent::Resized(physical_size) => resize(application, *physical_size), - WindowEvent::Moved(_) => (), - WindowEvent::CloseRequested => quit(control_flow), - WindowEvent::Destroyed => (), - WindowEvent::DroppedFile(_) => (), - WindowEvent::HoveredFile(_) => (), - WindowEvent::HoveredFileCancelled => (), - WindowEvent::ReceivedCharacter(_) => (), - WindowEvent::Focused(_) => (), - WindowEvent::KeyboardInput { input, .. } => keyboard_event(application, control_flow, input), - WindowEvent::CursorMoved { .. } => (), - WindowEvent::CursorEntered { .. } => (), - WindowEvent::CursorLeft { .. } => (), - WindowEvent::MouseWheel { .. } => (), - WindowEvent::MouseInput { .. } => (), - WindowEvent::TouchpadPressure { .. } => (), - WindowEvent::AxisMotion { .. } => (), - WindowEvent::Touch(_) => (), - WindowEvent::ScaleFactorChanged { new_inner_size, .. } => resize(application, **new_inner_size), - WindowEvent::ThemeChanged(_) => (), - } -} - -fn keyboard_event(application: &mut Application, control_flow: &mut ControlFlow, input: &KeyboardInput) { - match input { - KeyboardInput { - state: ElementState::Pressed, - virtual_keycode: Some(VirtualKeyCode::Escape), - .. - } => quit(control_flow), - KeyboardInput { - state: ElementState::Pressed, - virtual_keycode: Some(VirtualKeyCode::Space), - .. - } => { - // const VERTICES: &[[f32; 2]] = &[ - // [-0.2, 0.0], - // [0.2, 0.0], - // [0.2, -0.5], - // [-0.2, -0.5], - // ]; - // const INDICES: &[u16] = &[ - // 0, 1, 2, - // 0, 2, 3, - // ]; - - // application.example(VERTICES, INDICES); - }, - _ => *control_flow = ControlFlow::Wait, - } -} - -fn quit(control_flow: &mut ControlFlow) { - *control_flow = ControlFlow::Exit; -} - -fn resize(application: &mut Application, new_size: winit::dpi::PhysicalSize) { - application.swap_chain_descriptor.width = new_size.width; - application.swap_chain_descriptor.height = new_size.height; - - application.swap_chain = application.device.create_swap_chain(&application.surface, &application.swap_chain_descriptor); - - // TODO: Mark root of GUI as dirty to force redraw of everything -} diff --git a/textures/grid.png b/textures/grid.png deleted file mode 100644 index 4ad1b58c6..000000000 Binary files a/textures/grid.png and /dev/null differ