This commit is contained in:
Tsuki 2024-11-07 21:21:01 +08:00
commit b5c617c9bb
14 changed files with 1445 additions and 0 deletions

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
/target

969
Cargo.lock generated Normal file
View File

@ -0,0 +1,969 @@
# This file is automatically @generated by Cargo.
# It is not intended for manual editing.
version = 3
[[package]]
name = "ab_glyph_rasterizer"
version = "0.1.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c71b1793ee61086797f5c80b6efa2b8ffa6d5dd703f118545808a7f2e27f7046"
[[package]]
name = "adler2"
version = "2.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "512761e0bb2578dd7380c6baaa0f4ce03e84f95e960231d1dec8bf4d7d6e2627"
[[package]]
name = "aho-corasick"
version = "1.1.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916"
dependencies = [
"memchr",
]
[[package]]
name = "arrayref"
version = "0.3.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "76a2e8124351fda1ef8aaaa3bbd7ebbcb486bbcd4225aca0aa0d84bb2db8fecb"
[[package]]
name = "arrayvec"
version = "0.7.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7c02d123df017efcdfbd739ef81735b36c5ba83ec3c59c80a9d7ecc718f92e50"
[[package]]
name = "base64"
version = "0.22.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6"
[[package]]
name = "bitflags"
version = "1.3.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a"
[[package]]
name = "bitflags"
version = "2.6.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de"
[[package]]
name = "bytemuck"
version = "1.19.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8334215b81e418a0a7bdb8ef0849474f40bb10c8b71f1c4ed315cff49f32494d"
[[package]]
name = "byteorder"
version = "1.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b"
[[package]]
name = "cfg-if"
version = "1.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"
[[package]]
name = "convert_case"
version = "0.6.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ec182b0ca2f35d8fc196cf3404988fd8b8c739a4d270ff118a398feb0cbec1ca"
dependencies = [
"unicode-segmentation",
]
[[package]]
name = "crc32fast"
version = "1.4.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a97769d94ddab943e4510d138150169a2758b5ef3eb191a9ee688de3e23ef7b3"
dependencies = [
"cfg-if",
]
[[package]]
name = "ctor"
version = "0.2.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "edb49164822f3ee45b17acd4a208cfc1251410cf0cad9a833234c9890774dd9f"
dependencies = [
"quote",
"syn",
]
[[package]]
name = "data-url"
version = "0.3.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5c297a1c74b71ae29df00c3e22dd9534821d60eb9af5a0192823fa2acea70c2a"
[[package]]
name = "fdeflate"
version = "0.3.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "07c6f4c64c1d33a3111c4466f7365ebdcc37c5bd1ea0d62aae2e3d722aacbedb"
dependencies = [
"simd-adler32",
]
[[package]]
name = "flate2"
version = "1.0.34"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a1b589b4dc103969ad3cf85c950899926ec64300a1a46d76c03a6072957036f0"
dependencies = [
"crc32fast",
"miniz_oxide",
]
[[package]]
name = "float-cmp"
version = "0.9.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "98de4bbd547a563b716d8dfa9aad1cb19bfab00f4fa09a6a4ed21dbcf44ce9c4"
[[package]]
name = "fxhash"
version = "0.2.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c31b6d751ae2c7f11320402d34e41349dd1016f8d5d45e48c4312bc8625af50c"
dependencies = [
"byteorder",
]
[[package]]
name = "hilog-sys"
version = "0.1.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "45b9886063966a0bf54a7cdb2d1b772025a2d37127669d94f9845ee4eff296fa"
[[package]]
name = "imagesize"
version = "0.12.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "029d73f573d8e8d63e6d5020011d3255b28c3ba85d6cf870a07184ed23de9284"
[[package]]
name = "kurbo"
version = "0.11.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "89234b2cc610a7dd927ebde6b41dd1a5d4214cffaef4cf1fb2195d592f92518f"
dependencies = [
"arrayvec",
"smallvec",
]
[[package]]
name = "libloading"
version = "0.8.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4979f22fdb869068da03c9f7528f8297c6fd2606bc3a4affe42e6a823fdb8da4"
dependencies = [
"cfg-if",
"windows-targets 0.52.6",
]
[[package]]
name = "log"
version = "0.4.22"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a7a70ba024b9dc04c27ea2f0c0548feb474ec5c54bba33a7f72f873a39d07b24"
[[package]]
name = "makepad-android-state"
version = "0.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "dd004cda8be459fd76954218b76a1249a079fb9360bbca4e724cb7ddb2962857"
dependencies = [
"makepad-jni-sys",
]
[[package]]
name = "makepad-derive-live"
version = "0.4.0"
source = "git+https://github.com/makepad/makepad?branch=rik#1d32c01601713928a2e6695bf87a513f407672d2"
dependencies = [
"makepad-live-id",
"makepad-micro-proc-macro",
]
[[package]]
name = "makepad-derive-wasm-bridge"
version = "0.4.0"
source = "git+https://github.com/makepad/makepad?branch=rik#1d32c01601713928a2e6695bf87a513f407672d2"
dependencies = [
"makepad-micro-proc-macro",
]
[[package]]
name = "makepad-derive-widget"
version = "0.4.0"
source = "git+https://github.com/makepad/makepad?branch=rik#1d32c01601713928a2e6695bf87a513f407672d2"
dependencies = [
"makepad-live-id",
"makepad-micro-proc-macro",
]
[[package]]
name = "makepad-draw"
version = "0.6.0"
source = "git+https://github.com/makepad/makepad?branch=rik#1d32c01601713928a2e6695bf87a513f407672d2"
dependencies = [
"ab_glyph_rasterizer",
"fxhash",
"makepad-html",
"makepad-platform",
"makepad-rustybuzz",
"makepad-vector",
"sdfer",
"unicode-bidi",
"unicode-linebreak",
"unicode-segmentation",
]
[[package]]
name = "makepad-futures"
version = "0.4.0"
source = "git+https://github.com/makepad/makepad?branch=rik#1d32c01601713928a2e6695bf87a513f407672d2"
[[package]]
name = "makepad-futures-legacy"
version = "0.7.0"
source = "git+https://github.com/makepad/makepad?branch=rik#1d32c01601713928a2e6695bf87a513f407672d2"
[[package]]
name = "makepad-html"
version = "0.4.0"
source = "git+https://github.com/makepad/makepad?branch=rik#1d32c01601713928a2e6695bf87a513f407672d2"
dependencies = [
"makepad-live-id",
]
[[package]]
name = "makepad-http"
version = "0.4.0"
source = "git+https://github.com/makepad/makepad?branch=rik#1d32c01601713928a2e6695bf87a513f407672d2"
[[package]]
name = "makepad-jni-sys"
version = "0.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9775cbec5fa0647500c3e5de7c850280a88335d1d2d770e5aa2332b801ba7064"
[[package]]
name = "makepad-live-compiler"
version = "0.5.0"
source = "git+https://github.com/makepad/makepad?branch=rik#1d32c01601713928a2e6695bf87a513f407672d2"
dependencies = [
"makepad-derive-live",
"makepad-live-tokenizer",
"makepad-math",
]
[[package]]
name = "makepad-live-id"
version = "0.4.0"
source = "git+https://github.com/makepad/makepad?branch=rik#1d32c01601713928a2e6695bf87a513f407672d2"
dependencies = [
"makepad-live-id-macros",
]
[[package]]
name = "makepad-live-id-macros"
version = "0.4.0"
source = "git+https://github.com/makepad/makepad?branch=rik#1d32c01601713928a2e6695bf87a513f407672d2"
dependencies = [
"makepad-micro-proc-macro",
]
[[package]]
name = "makepad-live-tokenizer"
version = "0.4.0"
source = "git+https://github.com/makepad/makepad?branch=rik#1d32c01601713928a2e6695bf87a513f407672d2"
dependencies = [
"makepad-live-id",
"makepad-math",
"makepad-micro-serde",
]
[[package]]
name = "makepad-markdown"
version = "0.4.0"
source = "git+https://github.com/makepad/makepad?branch=rik#1d32c01601713928a2e6695bf87a513f407672d2"
dependencies = [
"makepad-live-id",
]
[[package]]
name = "makepad-math"
version = "0.4.0"
source = "git+https://github.com/makepad/makepad?branch=rik#1d32c01601713928a2e6695bf87a513f407672d2"
[[package]]
name = "makepad-micro-proc-macro"
version = "0.4.0"
source = "git+https://github.com/makepad/makepad?branch=rik#1d32c01601713928a2e6695bf87a513f407672d2"
[[package]]
name = "makepad-micro-serde"
version = "0.4.0"
source = "git+https://github.com/makepad/makepad?branch=rik#1d32c01601713928a2e6695bf87a513f407672d2"
dependencies = [
"makepad-live-id",
"makepad-micro-serde-derive",
]
[[package]]
name = "makepad-micro-serde-derive"
version = "0.4.0"
source = "git+https://github.com/makepad/makepad?branch=rik#1d32c01601713928a2e6695bf87a513f407672d2"
dependencies = [
"makepad-micro-proc-macro",
]
[[package]]
name = "makepad-objc-sys"
version = "0.4.0"
source = "git+https://github.com/makepad/makepad?branch=rik#1d32c01601713928a2e6695bf87a513f407672d2"
[[package]]
name = "makepad-platform"
version = "0.6.0"
source = "git+https://github.com/makepad/makepad?branch=rik#1d32c01601713928a2e6695bf87a513f407672d2"
dependencies = [
"hilog-sys",
"makepad-android-state",
"makepad-futures",
"makepad-futures-legacy",
"makepad-http",
"makepad-jni-sys",
"makepad-objc-sys",
"makepad-shader-compiler",
"makepad-wasm-bridge",
"napi-derive-ohos",
"napi-ohos",
"ohos-sys",
"smallvec",
"windows",
"windows-core",
"windows-targets 0.48.5",
]
[[package]]
name = "makepad-rustybuzz"
version = "0.8.0"
source = "git+https://github.com/makepad/makepad?branch=rik#1d32c01601713928a2e6695bf87a513f407672d2"
dependencies = [
"bitflags 1.3.2",
"bytemuck",
"smallvec",
"ttf-parser",
"unicode-bidi-mirroring",
"unicode-ccc",
"unicode-properties",
"unicode-script",
]
[[package]]
name = "makepad-shader-compiler"
version = "0.5.0"
source = "git+https://github.com/makepad/makepad?branch=rik#1d32c01601713928a2e6695bf87a513f407672d2"
dependencies = [
"makepad-live-compiler",
]
[[package]]
name = "makepad-vector"
version = "0.4.0"
source = "git+https://github.com/makepad/makepad?branch=rik#1d32c01601713928a2e6695bf87a513f407672d2"
dependencies = [
"resvg",
"ttf-parser",
]
[[package]]
name = "makepad-wasm-bridge"
version = "0.4.0"
source = "git+https://github.com/makepad/makepad?branch=rik#1d32c01601713928a2e6695bf87a513f407672d2"
dependencies = [
"makepad-derive-wasm-bridge",
"makepad-live-id",
]
[[package]]
name = "makepad-widgets"
version = "0.6.0"
source = "git+https://github.com/makepad/makepad?branch=rik#1d32c01601713928a2e6695bf87a513f407672d2"
dependencies = [
"makepad-derive-widget",
"makepad-draw",
"makepad-html",
"makepad-markdown",
"makepad-zune-jpeg",
"makepad-zune-png",
"unicode-segmentation",
]
[[package]]
name = "makepad-zune-core"
version = "0.2.14"
source = "git+https://github.com/makepad/makepad?branch=rik#1d32c01601713928a2e6695bf87a513f407672d2"
dependencies = [
"bitflags 2.6.0",
]
[[package]]
name = "makepad-zune-inflate"
version = "0.2.54"
source = "git+https://github.com/makepad/makepad?branch=rik#1d32c01601713928a2e6695bf87a513f407672d2"
dependencies = [
"simd-adler32",
]
[[package]]
name = "makepad-zune-jpeg"
version = "0.3.17"
source = "git+https://github.com/makepad/makepad?branch=rik#1d32c01601713928a2e6695bf87a513f407672d2"
dependencies = [
"makepad-zune-core",
]
[[package]]
name = "makepad-zune-png"
version = "0.2.1"
source = "git+https://github.com/makepad/makepad?branch=rik#1d32c01601713928a2e6695bf87a513f407672d2"
dependencies = [
"makepad-zune-core",
"makepad-zune-inflate",
]
[[package]]
name = "memchr"
version = "2.7.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3"
[[package]]
name = "miniz_oxide"
version = "0.8.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e2d80299ef12ff69b16a84bb182e3b9df68b5a91574d3d4fa6e41b65deec4df1"
dependencies = [
"adler2",
"simd-adler32",
]
[[package]]
name = "mp"
version = "0.1.0"
dependencies = [
"makepad-widgets",
]
[[package]]
name = "napi-derive-backend-ohos"
version = "0.0.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f6b18d697bedddd2d4c9f8f76b49fe65bd81ed1c55a7eec21ba40c176c236ddc"
dependencies = [
"convert_case",
"once_cell",
"proc-macro2",
"quote",
"regex",
"syn",
]
[[package]]
name = "napi-derive-ohos"
version = "0.0.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8462d74a2d6c7a671bd610f99f9ba34c739aadd2da4d8dd9f109a7e666cc2ad2"
dependencies = [
"cfg-if",
"convert_case",
"napi-derive-backend-ohos",
"proc-macro2",
"quote",
"syn",
]
[[package]]
name = "napi-ohos"
version = "0.1.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ad5a3bbb2ae61f345b8c11776f2e79fc2bb71d1901af9a5f81f03c9238a05d86"
dependencies = [
"bitflags 2.6.0",
"ctor",
"napi-sys-ohos",
"once_cell",
]
[[package]]
name = "napi-sys-ohos"
version = "0.0.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f101404db01422d034db5afa63eefff6d9c8f66c0894278bc456b4c30954e166"
dependencies = [
"libloading",
]
[[package]]
name = "ohos-sys"
version = "0.2.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8d380ab6c951261a0e44306245bc960b3b3367f099a7da7156bd1a3cacaf783c"
[[package]]
name = "once_cell"
version = "1.20.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1261fe7e33c73b354eab43b1273a57c8f967d0391e80353e51f764ac02cf6775"
[[package]]
name = "pico-args"
version = "0.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5be167a7af36ee22fe3115051bc51f6e6c7054c9348e28deb4f49bd6f705a315"
[[package]]
name = "png"
version = "0.17.14"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "52f9d46a34a05a6a57566bc2bfae066ef07585a6e3fa30fbbdff5936380623f0"
dependencies = [
"bitflags 1.3.2",
"crc32fast",
"fdeflate",
"flate2",
"miniz_oxide",
]
[[package]]
name = "proc-macro2"
version = "1.0.89"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f139b0662de085916d1fb67d2b4169d1addddda1919e696f3252b740b629986e"
dependencies = [
"unicode-ident",
]
[[package]]
name = "quote"
version = "1.0.37"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b5b9d34b8991d19d98081b46eacdd8eb58c6f2b201139f7c5f643cc155a633af"
dependencies = [
"proc-macro2",
]
[[package]]
name = "regex"
version = "1.11.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b544ef1b4eac5dc2db33ea63606ae9ffcfac26c1416a2806ae0bf5f56b201191"
dependencies = [
"aho-corasick",
"memchr",
"regex-automata",
"regex-syntax",
]
[[package]]
name = "regex-automata"
version = "0.4.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "368758f23274712b504848e9d5a6f010445cc8b87a7cdb4d7cbee666c1288da3"
dependencies = [
"aho-corasick",
"memchr",
"regex-syntax",
]
[[package]]
name = "regex-syntax"
version = "0.8.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c"
[[package]]
name = "resvg"
version = "0.42.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "944d052815156ac8fa77eaac055220e95ba0b01fa8887108ca710c03805d9051"
dependencies = [
"log",
"pico-args",
"rgb",
"svgtypes",
"tiny-skia",
"usvg",
]
[[package]]
name = "rgb"
version = "0.8.50"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "57397d16646700483b67d2dd6511d79318f9d057fdbd21a4066aeac8b41d310a"
dependencies = [
"bytemuck",
]
[[package]]
name = "roxmltree"
version = "0.20.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6c20b6793b5c2fa6553b250154b78d6d0db37e72700ae35fad9387a46f487c97"
[[package]]
name = "sdfer"
version = "0.2.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "27fd75ebc7c721a70d202c7cdd2beb108bbe5dfaaea68e06aff4de2f4cc240ed"
[[package]]
name = "simd-adler32"
version = "0.3.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d66dc143e6b11c1eddc06d5c423cfc97062865baf299914ab64caa38182078fe"
[[package]]
name = "simplecss"
version = "0.2.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a11be7c62927d9427e9f40f3444d5499d868648e2edbc4e2116de69e7ec0e89d"
dependencies = [
"log",
]
[[package]]
name = "siphasher"
version = "1.0.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "56199f7ddabf13fe5074ce809e7d3f42b42ae711800501b5b16ea82ad029c39d"
[[package]]
name = "smallvec"
version = "1.13.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67"
[[package]]
name = "strict-num"
version = "0.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6637bab7722d379c8b41ba849228d680cc12d0a45ba1fa2b48f2a30577a06731"
dependencies = [
"float-cmp",
]
[[package]]
name = "svgtypes"
version = "0.15.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "794de53cc48eaabeed0ab6a3404a65f40b3e38c067e4435883a65d2aa4ca000e"
dependencies = [
"kurbo",
"siphasher",
]
[[package]]
name = "syn"
version = "2.0.87"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "25aa4ce346d03a6dcd68dd8b4010bcb74e54e62c90c573f394c46eae99aba32d"
dependencies = [
"proc-macro2",
"quote",
"unicode-ident",
]
[[package]]
name = "tiny-skia"
version = "0.11.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "83d13394d44dae3207b52a326c0c85a8bf87f1541f23b0d143811088497b09ab"
dependencies = [
"arrayref",
"arrayvec",
"bytemuck",
"cfg-if",
"log",
"png",
"tiny-skia-path",
]
[[package]]
name = "tiny-skia-path"
version = "0.11.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9c9e7fc0c2e86a30b117d0462aa261b72b7a99b7ebd7deb3a14ceda95c5bdc93"
dependencies = [
"arrayref",
"bytemuck",
"strict-num",
]
[[package]]
name = "ttf-parser"
version = "0.21.1"
source = "git+https://github.com/makepad/makepad?branch=rik#1d32c01601713928a2e6695bf87a513f407672d2"
[[package]]
name = "unicode-bidi"
version = "0.3.17"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5ab17db44d7388991a428b2ee655ce0c212e862eff1768a455c58f9aad6e7893"
[[package]]
name = "unicode-bidi-mirroring"
version = "0.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "56d12260fb92d52f9008be7e4bca09f584780eb2266dc8fecc6a192bec561694"
[[package]]
name = "unicode-ccc"
version = "0.1.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cc2520efa644f8268dce4dcd3050eaa7fc044fca03961e9998ac7e2e92b77cf1"
[[package]]
name = "unicode-ident"
version = "1.0.13"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e91b56cd4cadaeb79bbf1a5645f6b4f8dc5bde8834ad5894a8db35fda9efa1fe"
[[package]]
name = "unicode-linebreak"
version = "0.1.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3b09c83c3c29d37506a3e260c08c03743a6bb66a9cd432c6934ab501a190571f"
[[package]]
name = "unicode-properties"
version = "0.1.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e70f2a8b45122e719eb623c01822704c4e0907e7e426a05927e1a1cfff5b75d0"
[[package]]
name = "unicode-script"
version = "0.5.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9fb421b350c9aff471779e262955939f565ec18b86c15364e6bdf0d662ca7c1f"
[[package]]
name = "unicode-segmentation"
version = "1.12.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f6ccf251212114b54433ec949fd6a7841275f9ada20dddd2f29e9ceea4501493"
[[package]]
name = "usvg"
version = "0.42.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b84ea542ae85c715f07b082438a4231c3760539d902e11d093847a0b22963032"
dependencies = [
"base64",
"data-url",
"flate2",
"imagesize",
"kurbo",
"log",
"pico-args",
"roxmltree",
"simplecss",
"siphasher",
"strict-num",
"svgtypes",
"tiny-skia-path",
"xmlwriter",
]
[[package]]
name = "windows"
version = "0.56.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1de69df01bdf1ead2f4ac895dc77c9351aefff65b2f3db429a343f9cbf05e132"
dependencies = [
"windows-core",
"windows-targets 0.52.6",
]
[[package]]
name = "windows-core"
version = "0.56.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4698e52ed2d08f8658ab0c39512a7c00ee5fe2688c65f8c0a4f06750d729f2a6"
dependencies = [
"windows-implement",
"windows-interface",
"windows-result",
"windows-targets 0.52.6",
]
[[package]]
name = "windows-implement"
version = "0.56.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f6fc35f58ecd95a9b71c4f2329b911016e6bec66b3f2e6a4aad86bd2e99e2f9b"
dependencies = [
"proc-macro2",
"quote",
"syn",
]
[[package]]
name = "windows-interface"
version = "0.56.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "08990546bf4edef8f431fa6326e032865f27138718c587dc21bc0265bbcb57cc"
dependencies = [
"proc-macro2",
"quote",
"syn",
]
[[package]]
name = "windows-result"
version = "0.1.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5e383302e8ec8515204254685643de10811af0ed97ea37210dc26fb0032647f8"
dependencies = [
"windows-targets 0.52.6",
]
[[package]]
name = "windows-targets"
version = "0.48.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c"
dependencies = [
"windows_aarch64_gnullvm 0.48.5",
"windows_aarch64_msvc 0.48.5",
"windows_i686_gnu 0.48.5",
"windows_i686_msvc 0.48.5",
"windows_x86_64_gnu 0.48.5",
"windows_x86_64_gnullvm 0.48.5",
"windows_x86_64_msvc 0.48.5",
]
[[package]]
name = "windows-targets"
version = "0.52.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973"
dependencies = [
"windows_aarch64_gnullvm 0.52.6",
"windows_aarch64_msvc 0.52.6",
"windows_i686_gnu 0.52.6",
"windows_i686_gnullvm",
"windows_i686_msvc 0.52.6",
"windows_x86_64_gnu 0.52.6",
"windows_x86_64_gnullvm 0.52.6",
"windows_x86_64_msvc 0.52.6",
]
[[package]]
name = "windows_aarch64_gnullvm"
version = "0.48.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8"
[[package]]
name = "windows_aarch64_gnullvm"
version = "0.52.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3"
[[package]]
name = "windows_aarch64_msvc"
version = "0.48.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc"
[[package]]
name = "windows_aarch64_msvc"
version = "0.52.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469"
[[package]]
name = "windows_i686_gnu"
version = "0.48.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e"
[[package]]
name = "windows_i686_gnu"
version = "0.52.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b"
[[package]]
name = "windows_i686_gnullvm"
version = "0.52.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66"
[[package]]
name = "windows_i686_msvc"
version = "0.48.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406"
[[package]]
name = "windows_i686_msvc"
version = "0.52.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66"
[[package]]
name = "windows_x86_64_gnu"
version = "0.48.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e"
[[package]]
name = "windows_x86_64_gnu"
version = "0.52.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78"
[[package]]
name = "windows_x86_64_gnullvm"
version = "0.48.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc"
[[package]]
name = "windows_x86_64_gnullvm"
version = "0.52.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d"
[[package]]
name = "windows_x86_64_msvc"
version = "0.48.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538"
[[package]]
name = "windows_x86_64_msvc"
version = "0.52.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec"
[[package]]
name = "xmlwriter"
version = "0.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ec7a2a501ed189703dba8b08142f057e887dfc4b2cc4db2d343ac6376ba3e0b9"

3
Cargo.toml Normal file
View File

@ -0,0 +1,3 @@
[workspace]
members = ["mp"]

9
mp/Cargo.toml Normal file
View File

@ -0,0 +1,9 @@
[package]
name = "mp"
version = "0.1.0"
edition = "2021"
[dependencies]
makepad-widgets = { git = "https://github.com/makepad/makepad", branch = "rik", version = "0.6.0" }
# makepad-widgets = { path = "/Users/tsuki/projects/makepad/widgets", version = "0.6.0" }

View File

@ -0,0 +1,3 @@
(
slide:4,
)

131
mp/makepad_state0.ron Normal file
View File

@ -0,0 +1,131 @@
(
dock_items:{
ai_first:Tab(
name:"",
template:AiFirstTab,
kind:AiFirst,
),
root:Splitter(
axis:Horizontal,
align:FromA(250),
a:2,
b:split1,
),
run_list_tab:Tab(
name:"Run",
template:RunListTab,
kind:RunList,
),
edit_first:Tab(
name:"",
template:EditFirstTab,
kind:EditFirst,
),
outline_first:Tab(
name:"",
template:OutlineFirstTab,
kind:OutlineFirst,
),
16498222299335161299:Tab(
name:"area.rs",
template:CloseableTab,
kind:CodeEditor,
),
profiler:Tab(
name:"Profiler",
template:ProfilerTab,
kind:Profiler,
),
log_tabs:Tabs(
tabs:[
log_list_tab,
profiler,
],
selected:0,
closable:true,
),
run_tabs:Tabs(
tabs:[
run_first,
ai_first,
],
selected:1,
closable:true,
),
12896495371442290581:Tab(
name:"mod.rs",
template:CloseableTab,
kind:CodeEditor,
),
design_first:Tab(
name:"",
template:DesignFirstTab,
kind:DesignFirst,
),
2:Tabs(
tabs:[
outline_first,
file_tree_tab,
run_list_tab,
search,
design_first,
],
selected:3,
closable:true,
),
log_list_tab:Tab(
name:"Log",
template:LogTab,
kind:LogList,
),
split1:Splitter(
axis:Vertical,
align:FromB(200),
a:split2,
b:log_tabs,
),
12814257210667152176:Tab(
name:"app.rs",
template:CloseableTab,
kind:CodeEditor,
),
search:Tab(
name:"Search",
template:SearchFirstTab,
kind:Search,
),
run_first:Tab(
name:"",
template:RunFirstTab,
kind:RunFirst,
),
file_tree_tab:Tab(
name:"Files",
template:FilesFirstTab,
kind:StudioFileTree,
),
edit_tabs:Tabs(
tabs:[
edit_first,
16498222299335161299,
12896495371442290581,
12814257210667152176,
],
selected:1,
closable:true,
),
split2:Splitter(
axis:Horizontal,
align:FromB(794.23046875),
a:edit_tabs,
b:run_tabs,
),
},
processes:[
],
tab_id_to_file_node_id:{
16498222299335161299:16498222299335161299,
12896495371442290581:12896495371442290581,
12814257210667152176:12814257210667152176,
},
)

58
mp/src/app.rs Normal file
View File

@ -0,0 +1,58 @@
use makepad_widgets::makepad_micro_serde::*;
use makepad_widgets::*;
live_design! {
import makepad_widgets::base::*;
import makepad_widgets::theme_desktop_dark::*;
import crate::app_ui::MainView;
HELLO = "Hello, World!";
App = {{App}} {
ui: <Root> {
<Window> {
window: {inner_size: vec2(2000, 1024)},
caption_bar = {visible: false, caption_label = {label = {text: "SDXL Surf"}}},
hide_caption_on_fullscreen: true,
draw_bg: {
fn pixel(self) -> vec4 {
return mix(#7,#4,self.pos.y);
}
},
body = <MainView>{}
}
}
}
}
#[derive(Live, LiveHook)]
pub struct App {
#[live]
ui: WidgetRef,
}
impl LiveRegister for App {
fn live_register(_cx: &mut Cx) {
crate::makepad_widgets::live_design(_cx);
// crate::makepad_widgets::base::live_design(_cx);
crate::app_ui::live_design(_cx);
crate::widgets::area::live_design(_cx);
}
}
#[derive(SerRon, DeRon)]
struct AppStateRon {
slide: usize,
}
impl MatchEvent for App {}
impl AppMain for App {
fn handle_event(&mut self, cx: &mut Cx, event: &Event) {
self.match_event(cx, event);
self.ui.handle_event(cx, event, &mut Scope::empty());
}
}
app_main!(App);

166
mp/src/app_ui.rs Normal file
View File

@ -0,0 +1,166 @@
use makepad_widgets::*;
live_design! {
import makepad_widgets::base::*;
import makepad_widgets::theme_desktop_dark::*;
import crate::widgets::area::Area;
import makepad_draw::shader::std::*;
HELLO = "Hello, World!";
Group = <RoundedView> {
flow: Down
spacing: 10.
padding: 15.
draw_bg: {
instance border_width: 1.0
instance border_color: (THEME_COLOR_U_2)
}
}
MainView = <View> {
flow: Overlay,
width: Fill,
height: Fill
dock = <Dock> {
height: Fill, width: Fill
root = Splitter {
axis: Horizontal,
align: FromB(300.0),
a: renderer_panel,
b: controller_panel,
}
renderer_panel = Tab {
name: "",
kind: Renderer
}
Renderer = <RectView>{
height: Fill,
width: Fill,
flow: Down,
align: {
x: 0.5,
y: 0.5
},
quad = <Area> {
draw: {
// this example shader is ported from kishimisu's tutorial
fn pixel(self) -> vec4 {
let uv = self.pos - 0.5;
let uv0 = uv;
let finalColor = vec3(0.0);
let i = 0;
for _i in 0..4 { // you cannot refer to _i inside the for loop; use i instead
uv = fract(uv * -1.5) - 0.5;
let d = length(uv) * exp(-length(uv0));
let col = Pal::iq2(length(uv0) + float(i) * .4 + self.time * .4);
d = sin(d*8. + self.time) / 8.;
d = abs(d);
d = pow(0.01 / d, 1.2);
finalColor += col * d;
i = i+1;
}
return vec4(finalColor ,1);
}
}
}
}
controller_panel = Tab {
name: ""
template: StandardTab,
kind: Controller
}
Controller = <RectView> {
draw_bg: { color: (THEME_COLOR_U_1) }
height: Fill, width: Fill
padding: 10.,
flow: Down,
spacing: 15.,
<H4>{ text: "Controller"}
<Group> {
<Slider> {
width: Fill,
height: 30,
draw_slider:{
slider_type: Horizontal
},
}
<Slider> {
width: Fill,
height: 30,
draw_slider:{
slider_type: Horizontal
},
}
<Slider> {
width: Fill,
height: 30,
draw_slider:{
slider_type: Horizontal
},
}
<Button> {
text: "Click me"
width: Fill
}
<CheckBox> {text: "Check me"}
<DropDown>{
height: 24,
width: Fill,
labels: ["ValueOne", "ValueTwo","Thrice","FourthValue","OptionE","Hexagons"],
values: [ ValueOne,ValueTwo,Thrice,FourthValue,OptionE,Hexagons]
}
<Slider> {
width: Fill,
height: 30,
draw_slider:{
slider_type: Horizontal
},
}
}
<H4>{ text: "Input"}
<Group> {
<ButtonGroup> {
spacing: 10.,
<Button> {text: "One"}
<Button> {text: "Two"}
<Button> {text: "Three"}
}
<TextInput> {
width: Fill,
height: Fit,
text: "Text Input"
}
<TextFlowBase> {
width: Fill,
height: Fit,
<Text> {text: "Text Flow"}
}
}
}
}
}
}

7
mp/src/lib.rs Normal file
View File

@ -0,0 +1,7 @@
pub mod app;
pub use makepad_widgets;
pub use makepad_widgets::makepad_draw;
pub use makepad_widgets::makepad_platform;
pub mod app_ui;
pub mod shaders;
pub mod widgets;

3
mp/src/main.rs Normal file
View File

@ -0,0 +1,3 @@
fn main() {
mp::app::app_main();
}

1
mp/src/shaders/mod.rs Normal file
View File

@ -0,0 +1 @@
pub mod ppi;

41
mp/src/shaders/ppi.rs Normal file
View File

@ -0,0 +1,41 @@
use makepad_platform::*;
use makepad_widgets::*;
live_design! {
PPI = {{PPI}} {
fn vertex(self) -> vec4 {
let pos = geometry * vec2(1., 1.);
return vec4(pos, 0., 1.);
}
fn pixel(self) -> vec4 {
return vec4(1., 0., 0., 1.);
}
}
}
#[repr(C)]
#[derive(Live, LiveRegister)]
pub struct PPI {
#[deref]
draw_vars: DrawVars,
#[live]
geometry: GeometryQuad2D,
}
impl LiveHook for PPI {
fn before_apply(&mut self, cx: &mut Cx, apply: &mut Apply, index: usize, nodes: &[LiveNode]) {
self.draw_vars
.before_apply_init_shader(cx, apply, index, nodes, &self.geometry);
}
fn after_apply(&mut self, cx: &mut Cx, apply: &mut Apply, index: usize, nodes: &[LiveNode]) {
self.draw_vars
.after_apply_update_self(cx, apply, index, nodes, &self.geometry);
}
}
impl PPI {
pub fn update_draw_call_vars(&mut self) {}
}

52
mp/src/widgets/area.rs Normal file
View File

@ -0,0 +1,52 @@
use makepad_widgets::makepad_derive_widget::*;
use makepad_widgets::makepad_draw::*;
use makepad_widgets::widget::*;
live_design! {
Area = {{TArea}} {}
}
#[derive(Live, Widget)]
pub struct TArea {
#[redraw]
#[live]
draw: DrawQuad,
#[walk]
walk: Walk,
#[layout]
layout: Layout,
#[live]
time: f32,
#[rust]
next_frame: NextFrame,
}
impl LiveHook for TArea {
fn after_new_from_doc(&mut self, cx: &mut Cx) {
// starts the animation cycle on startup
self.next_frame = cx.new_next_frame();
}
}
#[derive(Clone, DefaultNone)]
pub enum MyWidgetAction {
None,
}
impl Widget for TArea {
fn handle_event(&mut self, cx: &mut Cx, event: &Event, _scope: &mut Scope) {
if let Some(ne) = self.next_frame.is_event(event) {
// update time to use for animation
self.time = (ne.time * 0.001).fract() as f32;
// force updates, so that we can animate in the absence of user-generated events
self.redraw(cx);
self.next_frame = cx.new_next_frame();
}
}
fn draw_walk(&mut self, cx: &mut Cx2d, _scope: &mut Scope, walk: Walk) -> DrawStep {
self.draw.begin(cx, walk, self.layout);
self.draw.end(cx);
DrawStep::done()
}
}

1
mp/src/widgets/mod.rs Normal file
View File

@ -0,0 +1 @@
pub mod area;