├── .github └── workflows │ └── build.yml ├── .gitignore ├── .vscode └── settings.json ├── Cargo.lock ├── Cargo.toml ├── README.md ├── deps.ts ├── examples ├── helloworld.js └── sample.ts ├── mod.ts ├── plugin.ts ├── scripts ├── _util.ts ├── build.ts ├── dev.ts ├── fmt.ts ├── lint.ts └── run.ts ├── src ├── event.rs ├── helpers.rs ├── lib.rs └── scripts │ ├── dom_loader.js │ └── webview.js └── wry.ts /.github/workflows/build.yml: -------------------------------------------------------------------------------- 1 | name: Release 2 | 3 | on: 4 | push: 5 | branches: 6 | - main 7 | paths: 8 | - "Cargo.toml" 9 | - "src/**" 10 | - ".github/workflows/**" 11 | 12 | jobs: 13 | build: 14 | name: ${{ matrix.kind }} ${{ matrix.os }} 15 | runs-on: ${{ matrix.os }} 16 | timeout-minutes: 60 17 | strategy: 18 | matrix: 19 | os: [macOS-latest, windows-latest, ubuntu-latest] 20 | 21 | env: 22 | GH_ACTIONS: true 23 | RUST_BACKTRACE: full 24 | 25 | steps: 26 | - name: Clone repository 27 | uses: actions/checkout@v2 28 | 29 | - name: Install stable rust toolchain 30 | uses: actions-rs/toolchain@v1 31 | with: 32 | profile: minimal 33 | toolchain: stable 34 | override: true 35 | 36 | - name: Log versions 37 | run: | 38 | rustc --version 39 | cargo --version 40 | - name: Cache cargo registry 41 | uses: actions/cache@v1 42 | with: 43 | path: ~/.cargo/registry 44 | key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }} 45 | - name: Cache cargo index 46 | uses: actions/cache@v1 47 | with: 48 | path: ~/.cargo/git 49 | key: ${{ runner.os }}-cargo-index-${{ hashFiles('**/Cargo.lock') }} 50 | - name: Cache cargo build 51 | uses: actions/cache@v1 52 | with: 53 | path: target 54 | key: ${{ runner.os }}-cargo-build-target-${{ hashFiles('**/Cargo.lock') }} 55 | 56 | - name: Remove Some Cache 57 | if: matrix.os == 'windows-latest' 58 | run: | 59 | rm target/release/gn_root -Recurse -ErrorAction Ignore 60 | rm target/debug/gn_root -Recurse -ErrorAction Ignore 61 | - name: Install webkit2gtk 62 | if: matrix.os == 'ubuntu-latest' 63 | run: | 64 | sudo apt-get update 65 | sudo apt-get install libwebkit2gtk-4.0-dev 66 | - name: Run cargo build 67 | uses: actions-rs/cargo@v1 68 | with: 69 | command: build 70 | args: --release 71 | 72 | - name: Release Plugin 73 | uses: softprops/action-gh-release@master 74 | env: 75 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 76 | with: 77 | tag_name: "wry_deno release" 78 | draft: true 79 | files: | 80 | target/release/libwry_deno.dylib 81 | target/release/libwry_deno.so 82 | target/release/wry_deno.dll -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /target 2 | -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "deno.enable": false, 3 | "deno.lint": false 4 | } -------------------------------------------------------------------------------- /Cargo.lock: -------------------------------------------------------------------------------- 1 | # This file is automatically @generated by Cargo. 2 | # It is not intended for manual editing. 3 | [[package]] 4 | name = "ab_glyph_rasterizer" 5 | version = "0.1.4" 6 | source = "registry+https://github.com/rust-lang/crates.io-index" 7 | checksum = "d9fe5e32de01730eb1f6b7f5b51c17e03e2325bf40a74f754f04f130043affff" 8 | 9 | [[package]] 10 | name = "adler" 11 | version = "1.0.2" 12 | source = "registry+https://github.com/rust-lang/crates.io-index" 13 | checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" 14 | 15 | [[package]] 16 | name = "adler32" 17 | version = "1.2.0" 18 | source = "registry+https://github.com/rust-lang/crates.io-index" 19 | checksum = "aae1277d39aeec15cb388266ecc24b11c80469deae6067e17a1a7aa9e5c1f234" 20 | 21 | [[package]] 22 | name = "andrew" 23 | version = "0.3.1" 24 | source = "registry+https://github.com/rust-lang/crates.io-index" 25 | checksum = "8c4afb09dd642feec8408e33f92f3ffc4052946f6b20f32fb99c1f58cd4fa7cf" 26 | dependencies = [ 27 | "bitflags", 28 | "rusttype", 29 | "walkdir", 30 | "xdg", 31 | "xml-rs", 32 | ] 33 | 34 | [[package]] 35 | name = "anyhow" 36 | version = "1.0.40" 37 | source = "registry+https://github.com/rust-lang/crates.io-index" 38 | checksum = "28b2cd92db5cbd74e8e5028f7e27dd7aa3090e89e4f2a197cc7c8dfb69c7063b" 39 | 40 | [[package]] 41 | name = "async-channel" 42 | version = "1.6.1" 43 | source = "registry+https://github.com/rust-lang/crates.io-index" 44 | checksum = "2114d64672151c0c5eaa5e131ec84a74f06e1e559830dabba01ca30605d66319" 45 | dependencies = [ 46 | "concurrent-queue", 47 | "event-listener", 48 | "futures-core", 49 | ] 50 | 51 | [[package]] 52 | name = "atk" 53 | version = "0.9.0" 54 | source = "registry+https://github.com/rust-lang/crates.io-index" 55 | checksum = "812b4911e210bd51b24596244523c856ca749e6223c50a7fbbba3f89ee37c426" 56 | dependencies = [ 57 | "atk-sys", 58 | "bitflags", 59 | "glib", 60 | "glib-sys", 61 | "gobject-sys", 62 | "libc", 63 | ] 64 | 65 | [[package]] 66 | name = "atk-sys" 67 | version = "0.10.0" 68 | source = "registry+https://github.com/rust-lang/crates.io-index" 69 | checksum = "f530e4af131d94cc4fa15c5c9d0348f0ef28bac64ba660b6b2a1cf2605dedfce" 70 | dependencies = [ 71 | "glib-sys", 72 | "gobject-sys", 73 | "libc", 74 | "system-deps", 75 | ] 76 | 77 | [[package]] 78 | name = "autocfg" 79 | version = "1.0.1" 80 | source = "registry+https://github.com/rust-lang/crates.io-index" 81 | checksum = "cdb031dd78e28731d87d56cc8ffef4a8f36ca26c38fe2de700543e627f8a464a" 82 | 83 | [[package]] 84 | name = "bitflags" 85 | version = "1.2.1" 86 | source = "registry+https://github.com/rust-lang/crates.io-index" 87 | checksum = "cf1de2fe8c75bc145a2f577add951f8134889b4795d47466a54a5c846d691693" 88 | 89 | [[package]] 90 | name = "block" 91 | version = "0.1.6" 92 | source = "registry+https://github.com/rust-lang/crates.io-index" 93 | checksum = "0d8c1fef690941d3e7788d328517591fecc684c084084702d6ff1641e993699a" 94 | 95 | [[package]] 96 | name = "bytemuck" 97 | version = "1.5.1" 98 | source = "registry+https://github.com/rust-lang/crates.io-index" 99 | checksum = "bed57e2090563b83ba8f83366628ce535a7584c9afa4c9fc0612a03925c6df58" 100 | 101 | [[package]] 102 | name = "byteorder" 103 | version = "1.4.3" 104 | source = "registry+https://github.com/rust-lang/crates.io-index" 105 | checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" 106 | 107 | [[package]] 108 | name = "cache-padded" 109 | version = "1.1.1" 110 | source = "registry+https://github.com/rust-lang/crates.io-index" 111 | checksum = "631ae5198c9be5e753e5cc215e1bd73c2b466a3565173db433f52bb9d3e66dba" 112 | 113 | [[package]] 114 | name = "cairo-rs" 115 | version = "0.9.1" 116 | source = "registry+https://github.com/rust-lang/crates.io-index" 117 | checksum = "c5c0f2e047e8ca53d0ff249c54ae047931d7a6ebe05d00af73e0ffeb6e34bdb8" 118 | dependencies = [ 119 | "bitflags", 120 | "cairo-sys-rs", 121 | "glib", 122 | "glib-sys", 123 | "gobject-sys", 124 | "libc", 125 | "thiserror", 126 | ] 127 | 128 | [[package]] 129 | name = "cairo-sys-rs" 130 | version = "0.10.0" 131 | source = "registry+https://github.com/rust-lang/crates.io-index" 132 | checksum = "2ed2639b9ad5f1d6efa76de95558e11339e7318426d84ac4890b86c03e828ca7" 133 | dependencies = [ 134 | "glib-sys", 135 | "libc", 136 | "system-deps", 137 | ] 138 | 139 | [[package]] 140 | name = "calloop" 141 | version = "0.6.5" 142 | source = "registry+https://github.com/rust-lang/crates.io-index" 143 | checksum = "0b036167e76041694579972c28cf4877b4f92da222560ddb49008937b6a6727c" 144 | dependencies = [ 145 | "log", 146 | "nix 0.18.0", 147 | ] 148 | 149 | [[package]] 150 | name = "cargo_gn" 151 | version = "0.0.15" 152 | source = "registry+https://github.com/rust-lang/crates.io-index" 153 | checksum = "5ba7d7f7b201dfcbc314b14f2176c92f8ba521dab538b40e426ffed25ed7cd80" 154 | 155 | [[package]] 156 | name = "cc" 157 | version = "1.0.67" 158 | source = "registry+https://github.com/rust-lang/crates.io-index" 159 | checksum = "e3c69b077ad434294d3ce9f1f6143a2a4b89a8a2d54ef813d85003a4fd1137fd" 160 | 161 | [[package]] 162 | name = "cfg-if" 163 | version = "0.1.10" 164 | source = "registry+https://github.com/rust-lang/crates.io-index" 165 | checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" 166 | 167 | [[package]] 168 | name = "cfg-if" 169 | version = "1.0.0" 170 | source = "registry+https://github.com/rust-lang/crates.io-index" 171 | checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" 172 | 173 | [[package]] 174 | name = "cocoa" 175 | version = "0.24.0" 176 | source = "registry+https://github.com/rust-lang/crates.io-index" 177 | checksum = "6f63902e9223530efb4e26ccd0cf55ec30d592d3b42e21a28defc42a9586e832" 178 | dependencies = [ 179 | "bitflags", 180 | "block", 181 | "cocoa-foundation", 182 | "core-foundation 0.9.1", 183 | "core-graphics 0.22.2", 184 | "foreign-types", 185 | "libc", 186 | "objc", 187 | ] 188 | 189 | [[package]] 190 | name = "cocoa-foundation" 191 | version = "0.1.0" 192 | source = "registry+https://github.com/rust-lang/crates.io-index" 193 | checksum = "7ade49b65d560ca58c403a479bb396592b155c0185eada742ee323d1d68d6318" 194 | dependencies = [ 195 | "bitflags", 196 | "block", 197 | "core-foundation 0.9.1", 198 | "core-graphics-types", 199 | "foreign-types", 200 | "libc", 201 | "objc", 202 | ] 203 | 204 | [[package]] 205 | name = "color_quant" 206 | version = "1.1.0" 207 | source = "registry+https://github.com/rust-lang/crates.io-index" 208 | checksum = "3d7b894f5411737b7867f4827955924d7c254fc9f4d91a6aad6b097804b1018b" 209 | 210 | [[package]] 211 | name = "com" 212 | version = "0.2.0" 213 | source = "registry+https://github.com/rust-lang/crates.io-index" 214 | checksum = "5a30a2b2a013da986dc5cc3eda3d19c0d59d53f835be1b2356eb8d00f000c793" 215 | dependencies = [ 216 | "com_macros", 217 | ] 218 | 219 | [[package]] 220 | name = "com_macros" 221 | version = "0.2.0" 222 | source = "registry+https://github.com/rust-lang/crates.io-index" 223 | checksum = "7606b05842fea68ddcc89e8053b8860ebcb2a0ba8d6abfe3a148e5d5a8d3f0c1" 224 | dependencies = [ 225 | "com_macros_support", 226 | "proc-macro2", 227 | "syn", 228 | ] 229 | 230 | [[package]] 231 | name = "com_macros_support" 232 | version = "0.2.0" 233 | source = "registry+https://github.com/rust-lang/crates.io-index" 234 | checksum = "97e9a6d20f4ac8830e309a455d7e9416e65c6af5a97c88c55fbb4c2012e107da" 235 | dependencies = [ 236 | "proc-macro2", 237 | "quote", 238 | "syn", 239 | ] 240 | 241 | [[package]] 242 | name = "concurrent-queue" 243 | version = "1.2.2" 244 | source = "registry+https://github.com/rust-lang/crates.io-index" 245 | checksum = "30ed07550be01594c6026cff2a1d7fe9c8f683caa798e12b68694ac9e88286a3" 246 | dependencies = [ 247 | "cache-padded", 248 | ] 249 | 250 | [[package]] 251 | name = "core-foundation" 252 | version = "0.7.0" 253 | source = "registry+https://github.com/rust-lang/crates.io-index" 254 | checksum = "57d24c7a13c43e870e37c1556b74555437870a04514f7685f5b354e090567171" 255 | dependencies = [ 256 | "core-foundation-sys 0.7.0", 257 | "libc", 258 | ] 259 | 260 | [[package]] 261 | name = "core-foundation" 262 | version = "0.9.1" 263 | source = "registry+https://github.com/rust-lang/crates.io-index" 264 | checksum = "0a89e2ae426ea83155dccf10c0fa6b1463ef6d5fcb44cee0b224a408fa640a62" 265 | dependencies = [ 266 | "core-foundation-sys 0.8.2", 267 | "libc", 268 | ] 269 | 270 | [[package]] 271 | name = "core-foundation-sys" 272 | version = "0.7.0" 273 | source = "registry+https://github.com/rust-lang/crates.io-index" 274 | checksum = "b3a71ab494c0b5b860bdc8407ae08978052417070c2ced38573a9157ad75b8ac" 275 | 276 | [[package]] 277 | name = "core-foundation-sys" 278 | version = "0.8.2" 279 | source = "registry+https://github.com/rust-lang/crates.io-index" 280 | checksum = "ea221b5284a47e40033bf9b66f35f984ec0ea2931eb03505246cd27a963f981b" 281 | 282 | [[package]] 283 | name = "core-graphics" 284 | version = "0.19.2" 285 | source = "registry+https://github.com/rust-lang/crates.io-index" 286 | checksum = "b3889374e6ea6ab25dba90bb5d96202f61108058361f6dc72e8b03e6f8bbe923" 287 | dependencies = [ 288 | "bitflags", 289 | "core-foundation 0.7.0", 290 | "foreign-types", 291 | "libc", 292 | ] 293 | 294 | [[package]] 295 | name = "core-graphics" 296 | version = "0.22.2" 297 | source = "registry+https://github.com/rust-lang/crates.io-index" 298 | checksum = "269f35f69b542b80e736a20a89a05215c0ce80c2c03c514abb2e318b78379d86" 299 | dependencies = [ 300 | "bitflags", 301 | "core-foundation 0.9.1", 302 | "core-graphics-types", 303 | "foreign-types", 304 | "libc", 305 | ] 306 | 307 | [[package]] 308 | name = "core-graphics-types" 309 | version = "0.1.1" 310 | source = "registry+https://github.com/rust-lang/crates.io-index" 311 | checksum = "3a68b68b3446082644c91ac778bf50cd4104bfb002b5a6a7c44cca5a2c70788b" 312 | dependencies = [ 313 | "bitflags", 314 | "core-foundation 0.9.1", 315 | "foreign-types", 316 | "libc", 317 | ] 318 | 319 | [[package]] 320 | name = "core-video-sys" 321 | version = "0.1.4" 322 | source = "registry+https://github.com/rust-lang/crates.io-index" 323 | checksum = "34ecad23610ad9757664d644e369246edde1803fcb43ed72876565098a5d3828" 324 | dependencies = [ 325 | "cfg-if 0.1.10", 326 | "core-foundation-sys 0.7.0", 327 | "core-graphics 0.19.2", 328 | "libc", 329 | "objc", 330 | ] 331 | 332 | [[package]] 333 | name = "crc32fast" 334 | version = "1.2.1" 335 | source = "registry+https://github.com/rust-lang/crates.io-index" 336 | checksum = "81156fece84ab6a9f2afdb109ce3ae577e42b1228441eded99bd77f627953b1a" 337 | dependencies = [ 338 | "cfg-if 1.0.0", 339 | ] 340 | 341 | [[package]] 342 | name = "crossbeam" 343 | version = "0.7.3" 344 | source = "registry+https://github.com/rust-lang/crates.io-index" 345 | checksum = "69323bff1fb41c635347b8ead484a5ca6c3f11914d784170b158d8449ab07f8e" 346 | dependencies = [ 347 | "cfg-if 0.1.10", 348 | "crossbeam-channel 0.4.4", 349 | "crossbeam-deque 0.7.3", 350 | "crossbeam-epoch 0.8.2", 351 | "crossbeam-queue", 352 | "crossbeam-utils 0.7.2", 353 | ] 354 | 355 | [[package]] 356 | name = "crossbeam-channel" 357 | version = "0.4.4" 358 | source = "registry+https://github.com/rust-lang/crates.io-index" 359 | checksum = "b153fe7cbef478c567df0f972e02e6d736db11affe43dfc9c56a9374d1adfb87" 360 | dependencies = [ 361 | "crossbeam-utils 0.7.2", 362 | "maybe-uninit", 363 | ] 364 | 365 | [[package]] 366 | name = "crossbeam-channel" 367 | version = "0.5.0" 368 | source = "registry+https://github.com/rust-lang/crates.io-index" 369 | checksum = "dca26ee1f8d361640700bde38b2c37d8c22b3ce2d360e1fc1c74ea4b0aa7d775" 370 | dependencies = [ 371 | "cfg-if 1.0.0", 372 | "crossbeam-utils 0.8.3", 373 | ] 374 | 375 | [[package]] 376 | name = "crossbeam-deque" 377 | version = "0.7.3" 378 | source = "registry+https://github.com/rust-lang/crates.io-index" 379 | checksum = "9f02af974daeee82218205558e51ec8768b48cf524bd01d550abe5573a608285" 380 | dependencies = [ 381 | "crossbeam-epoch 0.8.2", 382 | "crossbeam-utils 0.7.2", 383 | "maybe-uninit", 384 | ] 385 | 386 | [[package]] 387 | name = "crossbeam-deque" 388 | version = "0.8.0" 389 | source = "registry+https://github.com/rust-lang/crates.io-index" 390 | checksum = "94af6efb46fef72616855b036a624cf27ba656ffc9be1b9a3c931cfc7749a9a9" 391 | dependencies = [ 392 | "cfg-if 1.0.0", 393 | "crossbeam-epoch 0.9.3", 394 | "crossbeam-utils 0.8.3", 395 | ] 396 | 397 | [[package]] 398 | name = "crossbeam-epoch" 399 | version = "0.8.2" 400 | source = "registry+https://github.com/rust-lang/crates.io-index" 401 | checksum = "058ed274caafc1f60c4997b5fc07bf7dc7cca454af7c6e81edffe5f33f70dace" 402 | dependencies = [ 403 | "autocfg", 404 | "cfg-if 0.1.10", 405 | "crossbeam-utils 0.7.2", 406 | "lazy_static", 407 | "maybe-uninit", 408 | "memoffset 0.5.6", 409 | "scopeguard", 410 | ] 411 | 412 | [[package]] 413 | name = "crossbeam-epoch" 414 | version = "0.9.3" 415 | source = "registry+https://github.com/rust-lang/crates.io-index" 416 | checksum = "2584f639eb95fea8c798496315b297cf81b9b58b6d30ab066a75455333cf4b12" 417 | dependencies = [ 418 | "cfg-if 1.0.0", 419 | "crossbeam-utils 0.8.3", 420 | "lazy_static", 421 | "memoffset 0.6.3", 422 | "scopeguard", 423 | ] 424 | 425 | [[package]] 426 | name = "crossbeam-queue" 427 | version = "0.2.3" 428 | source = "registry+https://github.com/rust-lang/crates.io-index" 429 | checksum = "774ba60a54c213d409d5353bda12d49cd68d14e45036a285234c8d6f91f92570" 430 | dependencies = [ 431 | "cfg-if 0.1.10", 432 | "crossbeam-utils 0.7.2", 433 | "maybe-uninit", 434 | ] 435 | 436 | [[package]] 437 | name = "crossbeam-utils" 438 | version = "0.7.2" 439 | source = "registry+https://github.com/rust-lang/crates.io-index" 440 | checksum = "c3c7c73a2d1e9fc0886a08b93e98eb643461230d5f1925e4036204d5f2e261a8" 441 | dependencies = [ 442 | "autocfg", 443 | "cfg-if 0.1.10", 444 | "lazy_static", 445 | ] 446 | 447 | [[package]] 448 | name = "crossbeam-utils" 449 | version = "0.8.3" 450 | source = "registry+https://github.com/rust-lang/crates.io-index" 451 | checksum = "e7e9d99fa91428effe99c5c6d4634cdeba32b8cf784fc428a2a687f61a952c49" 452 | dependencies = [ 453 | "autocfg", 454 | "cfg-if 1.0.0", 455 | "lazy_static", 456 | ] 457 | 458 | [[package]] 459 | name = "darling" 460 | version = "0.10.2" 461 | source = "registry+https://github.com/rust-lang/crates.io-index" 462 | checksum = "0d706e75d87e35569db781a9b5e2416cff1236a47ed380831f959382ccd5f858" 463 | dependencies = [ 464 | "darling_core", 465 | "darling_macro", 466 | ] 467 | 468 | [[package]] 469 | name = "darling_core" 470 | version = "0.10.2" 471 | source = "registry+https://github.com/rust-lang/crates.io-index" 472 | checksum = "f0c960ae2da4de88a91b2d920c2a7233b400bc33cb28453a2987822d8392519b" 473 | dependencies = [ 474 | "fnv", 475 | "ident_case", 476 | "proc-macro2", 477 | "quote", 478 | "strsim", 479 | "syn", 480 | ] 481 | 482 | [[package]] 483 | name = "darling_macro" 484 | version = "0.10.2" 485 | source = "registry+https://github.com/rust-lang/crates.io-index" 486 | checksum = "d9b5a2f4ac4969822c62224815d069952656cadc7084fdca9751e6d959189b72" 487 | dependencies = [ 488 | "darling_core", 489 | "quote", 490 | "syn", 491 | ] 492 | 493 | [[package]] 494 | name = "deflate" 495 | version = "0.8.6" 496 | source = "registry+https://github.com/rust-lang/crates.io-index" 497 | checksum = "73770f8e1fe7d64df17ca66ad28994a0a623ea497fa69486e14984e715c5d174" 498 | dependencies = [ 499 | "adler32", 500 | "byteorder", 501 | ] 502 | 503 | [[package]] 504 | name = "deno_core" 505 | version = "0.77.1" 506 | source = "registry+https://github.com/rust-lang/crates.io-index" 507 | checksum = "5ea6b5f04b9336050413741233eef45f01379ae7ac2ca88ff2ee1bb21081a131" 508 | dependencies = [ 509 | "anyhow", 510 | "futures", 511 | "indexmap", 512 | "lazy_static", 513 | "libc", 514 | "log", 515 | "pin-project", 516 | "rusty_v8", 517 | "serde", 518 | "serde_json", 519 | "smallvec", 520 | "url", 521 | ] 522 | 523 | [[package]] 524 | name = "deno_json_op" 525 | version = "0.1.1" 526 | source = "registry+https://github.com/rust-lang/crates.io-index" 527 | checksum = "2f1e1d5bba7a8fb46d573a8ac66de5ed0f30ea19801c42c1b1905712b0997537" 528 | dependencies = [ 529 | "quote", 530 | "syn", 531 | ] 532 | 533 | [[package]] 534 | name = "derivative" 535 | version = "2.2.0" 536 | source = "registry+https://github.com/rust-lang/crates.io-index" 537 | checksum = "fcc3dd5e9e9c0b295d6e1e4d811fb6f157d5ffd784b8d202fc62eac8035a770b" 538 | dependencies = [ 539 | "proc-macro2", 540 | "quote", 541 | "syn", 542 | ] 543 | 544 | [[package]] 545 | name = "dispatch" 546 | version = "0.2.0" 547 | source = "registry+https://github.com/rust-lang/crates.io-index" 548 | checksum = "bd0c93bb4b0c6d9b77f4435b0ae98c24d17f1c45b2ff844c6151a07256ca923b" 549 | 550 | [[package]] 551 | name = "dlib" 552 | version = "0.4.2" 553 | source = "registry+https://github.com/rust-lang/crates.io-index" 554 | checksum = "b11f15d1e3268f140f68d390637d5e76d849782d971ae7063e0da69fe9709a76" 555 | dependencies = [ 556 | "libloading 0.6.7", 557 | ] 558 | 559 | [[package]] 560 | name = "dlib" 561 | version = "0.5.0" 562 | source = "registry+https://github.com/rust-lang/crates.io-index" 563 | checksum = "ac1b7517328c04c2aa68422fc60a41b92208182142ed04a25879c26c8f878794" 564 | dependencies = [ 565 | "libloading 0.7.0", 566 | ] 567 | 568 | [[package]] 569 | name = "downcast-rs" 570 | version = "1.2.0" 571 | source = "registry+https://github.com/rust-lang/crates.io-index" 572 | checksum = "9ea835d29036a4087793836fa931b08837ad5e957da9e23886b29586fb9b6650" 573 | 574 | [[package]] 575 | name = "either" 576 | version = "1.6.1" 577 | source = "registry+https://github.com/rust-lang/crates.io-index" 578 | checksum = "e78d4f1cc4ae33bbfc157ed5d5a5ef3bc29227303d595861deb238fcec4e9457" 579 | 580 | [[package]] 581 | name = "event-listener" 582 | version = "2.5.1" 583 | source = "registry+https://github.com/rust-lang/crates.io-index" 584 | checksum = "f7531096570974c3a9dcf9e4b8e1cede1ec26cf5046219fb3b9d897503b9be59" 585 | 586 | [[package]] 587 | name = "fnv" 588 | version = "1.0.7" 589 | source = "registry+https://github.com/rust-lang/crates.io-index" 590 | checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" 591 | 592 | [[package]] 593 | name = "foreign-types" 594 | version = "0.3.2" 595 | source = "registry+https://github.com/rust-lang/crates.io-index" 596 | checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" 597 | dependencies = [ 598 | "foreign-types-shared", 599 | ] 600 | 601 | [[package]] 602 | name = "foreign-types-shared" 603 | version = "0.1.1" 604 | source = "registry+https://github.com/rust-lang/crates.io-index" 605 | checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" 606 | 607 | [[package]] 608 | name = "form_urlencoded" 609 | version = "1.0.1" 610 | source = "registry+https://github.com/rust-lang/crates.io-index" 611 | checksum = "5fc25a87fa4fd2094bffb06925852034d90a17f0d1e05197d4956d3555752191" 612 | dependencies = [ 613 | "matches", 614 | "percent-encoding", 615 | ] 616 | 617 | [[package]] 618 | name = "fslock" 619 | version = "0.1.6" 620 | source = "registry+https://github.com/rust-lang/crates.io-index" 621 | checksum = "b14c83e47c73f7d62d907ae24a1a98e9132df3c33eb6c54fcf4bce0dbc41d5af" 622 | dependencies = [ 623 | "libc", 624 | "winapi", 625 | ] 626 | 627 | [[package]] 628 | name = "futures" 629 | version = "0.3.13" 630 | source = "registry+https://github.com/rust-lang/crates.io-index" 631 | checksum = "7f55667319111d593ba876406af7c409c0ebb44dc4be6132a783ccf163ea14c1" 632 | dependencies = [ 633 | "futures-channel", 634 | "futures-core", 635 | "futures-executor", 636 | "futures-io", 637 | "futures-sink", 638 | "futures-task", 639 | "futures-util", 640 | ] 641 | 642 | [[package]] 643 | name = "futures-channel" 644 | version = "0.3.13" 645 | source = "registry+https://github.com/rust-lang/crates.io-index" 646 | checksum = "8c2dd2df839b57db9ab69c2c9d8f3e8c81984781937fe2807dc6dcf3b2ad2939" 647 | dependencies = [ 648 | "futures-core", 649 | "futures-sink", 650 | ] 651 | 652 | [[package]] 653 | name = "futures-core" 654 | version = "0.3.13" 655 | source = "registry+https://github.com/rust-lang/crates.io-index" 656 | checksum = "15496a72fabf0e62bdc3df11a59a3787429221dd0710ba8ef163d6f7a9112c94" 657 | 658 | [[package]] 659 | name = "futures-executor" 660 | version = "0.3.13" 661 | source = "registry+https://github.com/rust-lang/crates.io-index" 662 | checksum = "891a4b7b96d84d5940084b2a37632dd65deeae662c114ceaa2c879629c9c0ad1" 663 | dependencies = [ 664 | "futures-core", 665 | "futures-task", 666 | "futures-util", 667 | ] 668 | 669 | [[package]] 670 | name = "futures-io" 671 | version = "0.3.13" 672 | source = "registry+https://github.com/rust-lang/crates.io-index" 673 | checksum = "d71c2c65c57704c32f5241c1223167c2c3294fd34ac020c807ddbe6db287ba59" 674 | 675 | [[package]] 676 | name = "futures-macro" 677 | version = "0.3.13" 678 | source = "registry+https://github.com/rust-lang/crates.io-index" 679 | checksum = "ea405816a5139fb39af82c2beb921d52143f556038378d6db21183a5c37fbfb7" 680 | dependencies = [ 681 | "proc-macro-hack", 682 | "proc-macro2", 683 | "quote", 684 | "syn", 685 | ] 686 | 687 | [[package]] 688 | name = "futures-sink" 689 | version = "0.3.13" 690 | source = "registry+https://github.com/rust-lang/crates.io-index" 691 | checksum = "85754d98985841b7d4f5e8e6fbfa4a4ac847916893ec511a2917ccd8525b8bb3" 692 | 693 | [[package]] 694 | name = "futures-task" 695 | version = "0.3.13" 696 | source = "registry+https://github.com/rust-lang/crates.io-index" 697 | checksum = "fa189ef211c15ee602667a6fcfe1c1fd9e07d42250d2156382820fba33c9df80" 698 | 699 | [[package]] 700 | name = "futures-util" 701 | version = "0.3.13" 702 | source = "registry+https://github.com/rust-lang/crates.io-index" 703 | checksum = "1812c7ab8aedf8d6f2701a43e1243acdbcc2b36ab26e2ad421eb99ac963d96d1" 704 | dependencies = [ 705 | "futures-channel", 706 | "futures-core", 707 | "futures-io", 708 | "futures-macro", 709 | "futures-sink", 710 | "futures-task", 711 | "memchr", 712 | "pin-project-lite", 713 | "pin-utils", 714 | "proc-macro-hack", 715 | "proc-macro-nested", 716 | "slab", 717 | ] 718 | 719 | [[package]] 720 | name = "gdk" 721 | version = "0.13.2" 722 | source = "registry+https://github.com/rust-lang/crates.io-index" 723 | checksum = "db00839b2a68a7a10af3fa28dfb3febaba3a20c3a9ac2425a33b7df1f84a6b7d" 724 | dependencies = [ 725 | "bitflags", 726 | "cairo-rs", 727 | "cairo-sys-rs", 728 | "gdk-pixbuf", 729 | "gdk-sys", 730 | "gio", 731 | "gio-sys", 732 | "glib", 733 | "glib-sys", 734 | "gobject-sys", 735 | "libc", 736 | "pango", 737 | ] 738 | 739 | [[package]] 740 | name = "gdk-pixbuf" 741 | version = "0.9.0" 742 | source = "registry+https://github.com/rust-lang/crates.io-index" 743 | checksum = "8f6dae3cb99dd49b758b88f0132f8d401108e63ae8edd45f432d42cdff99998a" 744 | dependencies = [ 745 | "gdk-pixbuf-sys", 746 | "gio", 747 | "gio-sys", 748 | "glib", 749 | "glib-sys", 750 | "gobject-sys", 751 | "libc", 752 | ] 753 | 754 | [[package]] 755 | name = "gdk-pixbuf-sys" 756 | version = "0.10.0" 757 | source = "registry+https://github.com/rust-lang/crates.io-index" 758 | checksum = "3bfe468a7f43e97b8d193a762b6c5cf67a7d36cacbc0b9291dbcae24bfea1e8f" 759 | dependencies = [ 760 | "gio-sys", 761 | "glib-sys", 762 | "gobject-sys", 763 | "libc", 764 | "system-deps", 765 | ] 766 | 767 | [[package]] 768 | name = "gdk-sys" 769 | version = "0.10.0" 770 | source = "registry+https://github.com/rust-lang/crates.io-index" 771 | checksum = "0a9653cfc500fd268015b1ac055ddbc3df7a5c9ea3f4ccef147b3957bd140d69" 772 | dependencies = [ 773 | "cairo-sys-rs", 774 | "gdk-pixbuf-sys", 775 | "gio-sys", 776 | "glib-sys", 777 | "gobject-sys", 778 | "libc", 779 | "pango-sys", 780 | "pkg-config", 781 | "system-deps", 782 | ] 783 | 784 | [[package]] 785 | name = "getrandom" 786 | version = "0.1.16" 787 | source = "registry+https://github.com/rust-lang/crates.io-index" 788 | checksum = "8fc3cb4d91f53b50155bdcfd23f6a4c39ae1969c2ae85982b135750cccaf5fce" 789 | dependencies = [ 790 | "cfg-if 1.0.0", 791 | "libc", 792 | "wasi", 793 | ] 794 | 795 | [[package]] 796 | name = "gif" 797 | version = "0.11.2" 798 | source = "registry+https://github.com/rust-lang/crates.io-index" 799 | checksum = "5a668f699973d0f573d15749b7002a9ac9e1f9c6b220e7b165601334c173d8de" 800 | dependencies = [ 801 | "color_quant", 802 | "weezl", 803 | ] 804 | 805 | [[package]] 806 | name = "gio" 807 | version = "0.9.1" 808 | source = "registry+https://github.com/rust-lang/crates.io-index" 809 | checksum = "1fb60242bfff700772dae5d9e3a1f7aa2e4ebccf18b89662a16acb2822568561" 810 | dependencies = [ 811 | "bitflags", 812 | "futures", 813 | "futures-channel", 814 | "futures-core", 815 | "futures-io", 816 | "futures-util", 817 | "gio-sys", 818 | "glib", 819 | "glib-sys", 820 | "gobject-sys", 821 | "libc", 822 | "once_cell", 823 | "thiserror", 824 | ] 825 | 826 | [[package]] 827 | name = "gio-sys" 828 | version = "0.10.1" 829 | source = "registry+https://github.com/rust-lang/crates.io-index" 830 | checksum = "5e24fb752f8f5d2cf6bbc2c606fd2bc989c81c5e2fe321ab974d54f8b6344eac" 831 | dependencies = [ 832 | "glib-sys", 833 | "gobject-sys", 834 | "libc", 835 | "system-deps", 836 | "winapi", 837 | ] 838 | 839 | [[package]] 840 | name = "glib" 841 | version = "0.10.3" 842 | source = "registry+https://github.com/rust-lang/crates.io-index" 843 | checksum = "0c685013b7515e668f1b57a165b009d4d28cb139a8a989bbd699c10dad29d0c5" 844 | dependencies = [ 845 | "bitflags", 846 | "futures-channel", 847 | "futures-core", 848 | "futures-executor", 849 | "futures-task", 850 | "futures-util", 851 | "glib-macros", 852 | "glib-sys", 853 | "gobject-sys", 854 | "libc", 855 | "once_cell", 856 | ] 857 | 858 | [[package]] 859 | name = "glib-macros" 860 | version = "0.10.1" 861 | source = "registry+https://github.com/rust-lang/crates.io-index" 862 | checksum = "41486a26d1366a8032b160b59065a59fb528530a46a49f627e7048fb8c064039" 863 | dependencies = [ 864 | "anyhow", 865 | "heck", 866 | "itertools", 867 | "proc-macro-crate", 868 | "proc-macro-error", 869 | "proc-macro2", 870 | "quote", 871 | "syn", 872 | ] 873 | 874 | [[package]] 875 | name = "glib-sys" 876 | version = "0.10.1" 877 | source = "registry+https://github.com/rust-lang/crates.io-index" 878 | checksum = "c7e9b997a66e9a23d073f2b1abb4dbfc3925e0b8952f67efd8d9b6e168e4cdc1" 879 | dependencies = [ 880 | "libc", 881 | "system-deps", 882 | ] 883 | 884 | [[package]] 885 | name = "gobject-sys" 886 | version = "0.10.0" 887 | source = "registry+https://github.com/rust-lang/crates.io-index" 888 | checksum = "952133b60c318a62bf82ee75b93acc7e84028a093e06b9e27981c2b6fe68218c" 889 | dependencies = [ 890 | "glib-sys", 891 | "libc", 892 | "system-deps", 893 | ] 894 | 895 | [[package]] 896 | name = "gtk" 897 | version = "0.9.2" 898 | source = "registry+https://github.com/rust-lang/crates.io-index" 899 | checksum = "2f022f2054072b3af07666341984562c8e626a79daa8be27b955d12d06a5ad6a" 900 | dependencies = [ 901 | "atk", 902 | "bitflags", 903 | "cairo-rs", 904 | "cairo-sys-rs", 905 | "cc", 906 | "gdk", 907 | "gdk-pixbuf", 908 | "gdk-pixbuf-sys", 909 | "gdk-sys", 910 | "gio", 911 | "gio-sys", 912 | "glib", 913 | "glib-sys", 914 | "gobject-sys", 915 | "gtk-sys", 916 | "libc", 917 | "once_cell", 918 | "pango", 919 | "pango-sys", 920 | "pkg-config", 921 | ] 922 | 923 | [[package]] 924 | name = "gtk-sys" 925 | version = "0.10.0" 926 | source = "registry+https://github.com/rust-lang/crates.io-index" 927 | checksum = "89acda6f084863307d948ba64a4b1ef674e8527dddab147ee4cdcc194c880457" 928 | dependencies = [ 929 | "atk-sys", 930 | "cairo-sys-rs", 931 | "gdk-pixbuf-sys", 932 | "gdk-sys", 933 | "gio-sys", 934 | "glib-sys", 935 | "gobject-sys", 936 | "libc", 937 | "pango-sys", 938 | "system-deps", 939 | ] 940 | 941 | [[package]] 942 | name = "hashbrown" 943 | version = "0.9.1" 944 | source = "registry+https://github.com/rust-lang/crates.io-index" 945 | checksum = "d7afe4a420e3fe79967a00898cc1f4db7c8a49a9333a29f8a4bd76a253d5cd04" 946 | 947 | [[package]] 948 | name = "heck" 949 | version = "0.3.2" 950 | source = "registry+https://github.com/rust-lang/crates.io-index" 951 | checksum = "87cbf45460356b7deeb5e3415b5563308c0a9b057c85e12b06ad551f98d0a6ac" 952 | dependencies = [ 953 | "unicode-segmentation", 954 | ] 955 | 956 | [[package]] 957 | name = "hermit-abi" 958 | version = "0.1.18" 959 | source = "registry+https://github.com/rust-lang/crates.io-index" 960 | checksum = "322f4de77956e22ed0e5032c359a0f1273f1f7f0d79bfa3b8ffbc730d7fbcc5c" 961 | dependencies = [ 962 | "libc", 963 | ] 964 | 965 | [[package]] 966 | name = "ident_case" 967 | version = "1.0.1" 968 | source = "registry+https://github.com/rust-lang/crates.io-index" 969 | checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" 970 | 971 | [[package]] 972 | name = "idna" 973 | version = "0.2.2" 974 | source = "registry+https://github.com/rust-lang/crates.io-index" 975 | checksum = "89829a5d69c23d348314a7ac337fe39173b61149a9864deabd260983aed48c21" 976 | dependencies = [ 977 | "matches", 978 | "unicode-bidi", 979 | "unicode-normalization", 980 | ] 981 | 982 | [[package]] 983 | name = "image" 984 | version = "0.23.14" 985 | source = "registry+https://github.com/rust-lang/crates.io-index" 986 | checksum = "24ffcb7e7244a9bf19d35bf2883b9c080c4ced3c07a9895572178cdb8f13f6a1" 987 | dependencies = [ 988 | "bytemuck", 989 | "byteorder", 990 | "color_quant", 991 | "gif", 992 | "jpeg-decoder", 993 | "num-iter", 994 | "num-rational", 995 | "num-traits", 996 | "png", 997 | "scoped_threadpool", 998 | "tiff", 999 | ] 1000 | 1001 | [[package]] 1002 | name = "indexmap" 1003 | version = "1.6.2" 1004 | source = "registry+https://github.com/rust-lang/crates.io-index" 1005 | checksum = "824845a0bf897a9042383849b02c1bc219c2383772efcd5c6f9766fa4b81aef3" 1006 | dependencies = [ 1007 | "autocfg", 1008 | "hashbrown", 1009 | ] 1010 | 1011 | [[package]] 1012 | name = "infer" 1013 | version = "0.3.6" 1014 | source = "registry+https://github.com/rust-lang/crates.io-index" 1015 | checksum = "0803735b9511d0956c68902a6513ca867819d6e43397adb6a5e903e2f09db734" 1016 | 1017 | [[package]] 1018 | name = "instant" 1019 | version = "0.1.9" 1020 | source = "registry+https://github.com/rust-lang/crates.io-index" 1021 | checksum = "61124eeebbd69b8190558df225adf7e4caafce0d743919e5d6b19652314ec5ec" 1022 | dependencies = [ 1023 | "cfg-if 1.0.0", 1024 | ] 1025 | 1026 | [[package]] 1027 | name = "itertools" 1028 | version = "0.9.0" 1029 | source = "registry+https://github.com/rust-lang/crates.io-index" 1030 | checksum = "284f18f85651fe11e8a991b2adb42cb078325c996ed026d994719efcfca1d54b" 1031 | dependencies = [ 1032 | "either", 1033 | ] 1034 | 1035 | [[package]] 1036 | name = "itoa" 1037 | version = "0.4.7" 1038 | source = "registry+https://github.com/rust-lang/crates.io-index" 1039 | checksum = "dd25036021b0de88a0aff6b850051563c6516d0bf53f8638938edbb9de732736" 1040 | 1041 | [[package]] 1042 | name = "javascriptcore-rs" 1043 | version = "0.10.0" 1044 | source = "registry+https://github.com/rust-lang/crates.io-index" 1045 | checksum = "5ecc697657edc9cd3d85d5ec6941f74cc9bb2ae84bec320f55c9397c5a8d8722" 1046 | dependencies = [ 1047 | "glib", 1048 | "javascriptcore-rs-sys", 1049 | ] 1050 | 1051 | [[package]] 1052 | name = "javascriptcore-rs-sys" 1053 | version = "0.2.0" 1054 | source = "registry+https://github.com/rust-lang/crates.io-index" 1055 | checksum = "3f46ada8a08dcd75a10afae872fbfb51275df4a8ae0d46b8cc7c708f08dd2998" 1056 | dependencies = [ 1057 | "libc", 1058 | ] 1059 | 1060 | [[package]] 1061 | name = "jni-sys" 1062 | version = "0.3.0" 1063 | source = "registry+https://github.com/rust-lang/crates.io-index" 1064 | checksum = "8eaf4bc02d17cbdd7ff4c7438cafcdf7fb9a4613313ad11b4f8fefe7d3fa0130" 1065 | 1066 | [[package]] 1067 | name = "jpeg-decoder" 1068 | version = "0.1.22" 1069 | source = "registry+https://github.com/rust-lang/crates.io-index" 1070 | checksum = "229d53d58899083193af11e15917b5640cd40b29ff475a1fe4ef725deb02d0f2" 1071 | dependencies = [ 1072 | "rayon", 1073 | ] 1074 | 1075 | [[package]] 1076 | name = "lazy_static" 1077 | version = "1.4.0" 1078 | source = "registry+https://github.com/rust-lang/crates.io-index" 1079 | checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" 1080 | 1081 | [[package]] 1082 | name = "libc" 1083 | version = "0.2.91" 1084 | source = "registry+https://github.com/rust-lang/crates.io-index" 1085 | checksum = "8916b1f6ca17130ec6568feccee27c156ad12037880833a3b842a823236502e7" 1086 | 1087 | [[package]] 1088 | name = "libloading" 1089 | version = "0.6.7" 1090 | source = "registry+https://github.com/rust-lang/crates.io-index" 1091 | checksum = "351a32417a12d5f7e82c368a66781e307834dae04c6ce0cd4456d52989229883" 1092 | dependencies = [ 1093 | "cfg-if 1.0.0", 1094 | "winapi", 1095 | ] 1096 | 1097 | [[package]] 1098 | name = "libloading" 1099 | version = "0.7.0" 1100 | source = "registry+https://github.com/rust-lang/crates.io-index" 1101 | checksum = "6f84d96438c15fcd6c3f244c8fce01d1e2b9c6b5623e9c711dc9286d8fc92d6a" 1102 | dependencies = [ 1103 | "cfg-if 1.0.0", 1104 | "winapi", 1105 | ] 1106 | 1107 | [[package]] 1108 | name = "lock_api" 1109 | version = "0.4.2" 1110 | source = "registry+https://github.com/rust-lang/crates.io-index" 1111 | checksum = "dd96ffd135b2fd7b973ac026d28085defbe8983df057ced3eb4f2130b0831312" 1112 | dependencies = [ 1113 | "scopeguard", 1114 | ] 1115 | 1116 | [[package]] 1117 | name = "log" 1118 | version = "0.4.14" 1119 | source = "registry+https://github.com/rust-lang/crates.io-index" 1120 | checksum = "51b9bbe6c47d51fc3e1a9b945965946b4c44142ab8792c50835a980d362c2710" 1121 | dependencies = [ 1122 | "cfg-if 1.0.0", 1123 | ] 1124 | 1125 | [[package]] 1126 | name = "malloc_buf" 1127 | version = "0.0.6" 1128 | source = "registry+https://github.com/rust-lang/crates.io-index" 1129 | checksum = "62bb907fe88d54d8d9ce32a3cceab4218ed2f6b7d35617cafe9adf84e43919cb" 1130 | dependencies = [ 1131 | "libc", 1132 | ] 1133 | 1134 | [[package]] 1135 | name = "matches" 1136 | version = "0.1.8" 1137 | source = "registry+https://github.com/rust-lang/crates.io-index" 1138 | checksum = "7ffc5c5338469d4d3ea17d269fa8ea3512ad247247c30bd2df69e68309ed0a08" 1139 | 1140 | [[package]] 1141 | name = "maybe-uninit" 1142 | version = "2.0.0" 1143 | source = "registry+https://github.com/rust-lang/crates.io-index" 1144 | checksum = "60302e4db3a61da70c0cb7991976248362f30319e88850c487b9b95bbf059e00" 1145 | 1146 | [[package]] 1147 | name = "memchr" 1148 | version = "2.3.4" 1149 | source = "registry+https://github.com/rust-lang/crates.io-index" 1150 | checksum = "0ee1c47aaa256ecabcaea351eae4a9b01ef39ed810004e298d2511ed284b1525" 1151 | 1152 | [[package]] 1153 | name = "memmap2" 1154 | version = "0.1.0" 1155 | source = "registry+https://github.com/rust-lang/crates.io-index" 1156 | checksum = "d9b70ca2a6103ac8b665dc150b142ef0e4e89df640c9e6cf295d189c3caebe5a" 1157 | dependencies = [ 1158 | "libc", 1159 | ] 1160 | 1161 | [[package]] 1162 | name = "memoffset" 1163 | version = "0.5.6" 1164 | source = "registry+https://github.com/rust-lang/crates.io-index" 1165 | checksum = "043175f069eda7b85febe4a74abbaeff828d9f8b448515d3151a14a3542811aa" 1166 | dependencies = [ 1167 | "autocfg", 1168 | ] 1169 | 1170 | [[package]] 1171 | name = "memoffset" 1172 | version = "0.6.3" 1173 | source = "registry+https://github.com/rust-lang/crates.io-index" 1174 | checksum = "f83fb6581e8ed1f85fd45c116db8405483899489e38406156c25eb743554361d" 1175 | dependencies = [ 1176 | "autocfg", 1177 | ] 1178 | 1179 | [[package]] 1180 | name = "miniz_oxide" 1181 | version = "0.3.7" 1182 | source = "registry+https://github.com/rust-lang/crates.io-index" 1183 | checksum = "791daaae1ed6889560f8c4359194f56648355540573244a5448a83ba1ecc7435" 1184 | dependencies = [ 1185 | "adler32", 1186 | ] 1187 | 1188 | [[package]] 1189 | name = "miniz_oxide" 1190 | version = "0.4.4" 1191 | source = "registry+https://github.com/rust-lang/crates.io-index" 1192 | checksum = "a92518e98c078586bc6c934028adcca4c92a53d6a958196de835170a01d84e4b" 1193 | dependencies = [ 1194 | "adler", 1195 | "autocfg", 1196 | ] 1197 | 1198 | [[package]] 1199 | name = "mio" 1200 | version = "0.7.11" 1201 | source = "registry+https://github.com/rust-lang/crates.io-index" 1202 | checksum = "cf80d3e903b34e0bd7282b218398aec54e082c840d9baf8339e0080a0c542956" 1203 | dependencies = [ 1204 | "libc", 1205 | "log", 1206 | "miow", 1207 | "ntapi", 1208 | "winapi", 1209 | ] 1210 | 1211 | [[package]] 1212 | name = "mio-misc" 1213 | version = "1.0.0" 1214 | source = "registry+https://github.com/rust-lang/crates.io-index" 1215 | checksum = "c0826571dd48cc55b6310c06daad1a037ccec60c6eb056be7844995140482690" 1216 | dependencies = [ 1217 | "crossbeam", 1218 | "crossbeam-queue", 1219 | "log", 1220 | "mio", 1221 | "rand", 1222 | ] 1223 | 1224 | [[package]] 1225 | name = "miow" 1226 | version = "0.3.7" 1227 | source = "registry+https://github.com/rust-lang/crates.io-index" 1228 | checksum = "b9f1c5b025cda876f66ef43a113f91ebc9f4ccef34843000e0adf6ebbab84e21" 1229 | dependencies = [ 1230 | "winapi", 1231 | ] 1232 | 1233 | [[package]] 1234 | name = "ndk" 1235 | version = "0.3.0" 1236 | source = "registry+https://github.com/rust-lang/crates.io-index" 1237 | checksum = "8794322172319b972f528bf90c6b467be0079f1fa82780ffb431088e741a73ab" 1238 | dependencies = [ 1239 | "jni-sys", 1240 | "ndk-sys", 1241 | "num_enum", 1242 | "thiserror", 1243 | ] 1244 | 1245 | [[package]] 1246 | name = "ndk-glue" 1247 | version = "0.3.0" 1248 | source = "registry+https://github.com/rust-lang/crates.io-index" 1249 | checksum = "c5caf0c24d51ac1c905c27d4eda4fa0635bbe0de596b8f79235e0b17a4d29385" 1250 | dependencies = [ 1251 | "lazy_static", 1252 | "libc", 1253 | "log", 1254 | "ndk", 1255 | "ndk-macro", 1256 | "ndk-sys", 1257 | ] 1258 | 1259 | [[package]] 1260 | name = "ndk-macro" 1261 | version = "0.2.0" 1262 | source = "registry+https://github.com/rust-lang/crates.io-index" 1263 | checksum = "05d1c6307dc424d0f65b9b06e94f88248e6305726b14729fd67a5e47b2dc481d" 1264 | dependencies = [ 1265 | "darling", 1266 | "proc-macro-crate", 1267 | "proc-macro2", 1268 | "quote", 1269 | "syn", 1270 | ] 1271 | 1272 | [[package]] 1273 | name = "ndk-sys" 1274 | version = "0.2.1" 1275 | source = "registry+https://github.com/rust-lang/crates.io-index" 1276 | checksum = "c44922cb3dbb1c70b5e5f443d63b64363a898564d739ba5198e3a9138442868d" 1277 | 1278 | [[package]] 1279 | name = "nix" 1280 | version = "0.18.0" 1281 | source = "registry+https://github.com/rust-lang/crates.io-index" 1282 | checksum = "83450fe6a6142ddd95fb064b746083fc4ef1705fe81f64a64e1d4b39f54a1055" 1283 | dependencies = [ 1284 | "bitflags", 1285 | "cc", 1286 | "cfg-if 0.1.10", 1287 | "libc", 1288 | ] 1289 | 1290 | [[package]] 1291 | name = "nix" 1292 | version = "0.20.0" 1293 | source = "registry+https://github.com/rust-lang/crates.io-index" 1294 | checksum = "fa9b4819da1bc61c0ea48b63b7bc8604064dd43013e7cc325df098d49cd7c18a" 1295 | dependencies = [ 1296 | "bitflags", 1297 | "cc", 1298 | "cfg-if 1.0.0", 1299 | "libc", 1300 | ] 1301 | 1302 | [[package]] 1303 | name = "nom" 1304 | version = "6.1.2" 1305 | source = "registry+https://github.com/rust-lang/crates.io-index" 1306 | checksum = "e7413f999671bd4745a7b624bd370a569fb6bc574b23c83a3c5ed2e453f3d5e2" 1307 | dependencies = [ 1308 | "memchr", 1309 | "version_check", 1310 | ] 1311 | 1312 | [[package]] 1313 | name = "ntapi" 1314 | version = "0.3.6" 1315 | source = "registry+https://github.com/rust-lang/crates.io-index" 1316 | checksum = "3f6bb902e437b6d86e03cce10a7e2af662292c5dfef23b65899ea3ac9354ad44" 1317 | dependencies = [ 1318 | "winapi", 1319 | ] 1320 | 1321 | [[package]] 1322 | name = "num-integer" 1323 | version = "0.1.44" 1324 | source = "registry+https://github.com/rust-lang/crates.io-index" 1325 | checksum = "d2cc698a63b549a70bc047073d2949cce27cd1c7b0a4a862d08a8031bc2801db" 1326 | dependencies = [ 1327 | "autocfg", 1328 | "num-traits", 1329 | ] 1330 | 1331 | [[package]] 1332 | name = "num-iter" 1333 | version = "0.1.42" 1334 | source = "registry+https://github.com/rust-lang/crates.io-index" 1335 | checksum = "b2021c8337a54d21aca0d59a92577a029af9431cb59b909b03252b9c164fad59" 1336 | dependencies = [ 1337 | "autocfg", 1338 | "num-integer", 1339 | "num-traits", 1340 | ] 1341 | 1342 | [[package]] 1343 | name = "num-rational" 1344 | version = "0.3.2" 1345 | source = "registry+https://github.com/rust-lang/crates.io-index" 1346 | checksum = "12ac428b1cb17fce6f731001d307d351ec70a6d202fc2e60f7d4c5e42d8f4f07" 1347 | dependencies = [ 1348 | "autocfg", 1349 | "num-integer", 1350 | "num-traits", 1351 | ] 1352 | 1353 | [[package]] 1354 | name = "num-traits" 1355 | version = "0.2.14" 1356 | source = "registry+https://github.com/rust-lang/crates.io-index" 1357 | checksum = "9a64b1ec5cda2586e284722486d802acf1f7dbdc623e2bfc57e65ca1cd099290" 1358 | dependencies = [ 1359 | "autocfg", 1360 | ] 1361 | 1362 | [[package]] 1363 | name = "num_cpus" 1364 | version = "1.13.0" 1365 | source = "registry+https://github.com/rust-lang/crates.io-index" 1366 | checksum = "05499f3756671c15885fee9034446956fff3f243d6077b91e5767df161f766b3" 1367 | dependencies = [ 1368 | "hermit-abi", 1369 | "libc", 1370 | ] 1371 | 1372 | [[package]] 1373 | name = "num_enum" 1374 | version = "0.5.1" 1375 | source = "registry+https://github.com/rust-lang/crates.io-index" 1376 | checksum = "226b45a5c2ac4dd696ed30fa6b94b057ad909c7b7fc2e0d0808192bced894066" 1377 | dependencies = [ 1378 | "derivative", 1379 | "num_enum_derive", 1380 | ] 1381 | 1382 | [[package]] 1383 | name = "num_enum_derive" 1384 | version = "0.5.1" 1385 | source = "registry+https://github.com/rust-lang/crates.io-index" 1386 | checksum = "1c0fd9eba1d5db0994a239e09c1be402d35622277e35468ba891aa5e3188ce7e" 1387 | dependencies = [ 1388 | "proc-macro-crate", 1389 | "proc-macro2", 1390 | "quote", 1391 | "syn", 1392 | ] 1393 | 1394 | [[package]] 1395 | name = "objc" 1396 | version = "0.2.7" 1397 | source = "registry+https://github.com/rust-lang/crates.io-index" 1398 | checksum = "915b1b472bc21c53464d6c8461c9d3af805ba1ef837e1cac254428f4a77177b1" 1399 | dependencies = [ 1400 | "malloc_buf", 1401 | ] 1402 | 1403 | [[package]] 1404 | name = "objc_id" 1405 | version = "0.1.1" 1406 | source = "registry+https://github.com/rust-lang/crates.io-index" 1407 | checksum = "c92d4ddb4bd7b50d730c215ff871754d0da6b2178849f8a2a2ab69712d0c073b" 1408 | dependencies = [ 1409 | "objc", 1410 | ] 1411 | 1412 | [[package]] 1413 | name = "once_cell" 1414 | version = "1.7.2" 1415 | source = "registry+https://github.com/rust-lang/crates.io-index" 1416 | checksum = "af8b08b04175473088b46763e51ee54da5f9a164bc162f615b91bc179dbf15a3" 1417 | 1418 | [[package]] 1419 | name = "owned_ttf_parser" 1420 | version = "0.6.0" 1421 | source = "registry+https://github.com/rust-lang/crates.io-index" 1422 | checksum = "9f923fb806c46266c02ab4a5b239735c144bdeda724a50ed058e5226f594cde3" 1423 | dependencies = [ 1424 | "ttf-parser", 1425 | ] 1426 | 1427 | [[package]] 1428 | name = "pango" 1429 | version = "0.9.1" 1430 | source = "registry+https://github.com/rust-lang/crates.io-index" 1431 | checksum = "9937068580bebd8ced19975938573803273ccbcbd598c58d4906efd4ac87c438" 1432 | dependencies = [ 1433 | "bitflags", 1434 | "glib", 1435 | "glib-sys", 1436 | "gobject-sys", 1437 | "libc", 1438 | "once_cell", 1439 | "pango-sys", 1440 | ] 1441 | 1442 | [[package]] 1443 | name = "pango-sys" 1444 | version = "0.10.0" 1445 | source = "registry+https://github.com/rust-lang/crates.io-index" 1446 | checksum = "24d2650c8b62d116c020abd0cea26a4ed96526afda89b1c4ea567131fdefc890" 1447 | dependencies = [ 1448 | "glib-sys", 1449 | "gobject-sys", 1450 | "libc", 1451 | "system-deps", 1452 | ] 1453 | 1454 | [[package]] 1455 | name = "parking_lot" 1456 | version = "0.11.1" 1457 | source = "registry+https://github.com/rust-lang/crates.io-index" 1458 | checksum = "6d7744ac029df22dca6284efe4e898991d28e3085c706c972bcd7da4a27a15eb" 1459 | dependencies = [ 1460 | "instant", 1461 | "lock_api", 1462 | "parking_lot_core", 1463 | ] 1464 | 1465 | [[package]] 1466 | name = "parking_lot_core" 1467 | version = "0.8.3" 1468 | source = "registry+https://github.com/rust-lang/crates.io-index" 1469 | checksum = "fa7a782938e745763fe6907fc6ba86946d72f49fe7e21de074e08128a99fb018" 1470 | dependencies = [ 1471 | "cfg-if 1.0.0", 1472 | "instant", 1473 | "libc", 1474 | "redox_syscall", 1475 | "smallvec", 1476 | "winapi", 1477 | ] 1478 | 1479 | [[package]] 1480 | name = "percent-encoding" 1481 | version = "2.1.0" 1482 | source = "registry+https://github.com/rust-lang/crates.io-index" 1483 | checksum = "d4fd5641d01c8f18a23da7b6fe29298ff4b55afcccdf78973b24cf3175fee32e" 1484 | 1485 | [[package]] 1486 | name = "pin-project" 1487 | version = "1.0.6" 1488 | source = "registry+https://github.com/rust-lang/crates.io-index" 1489 | checksum = "bc174859768806e91ae575187ada95c91a29e96a98dc5d2cd9a1fed039501ba6" 1490 | dependencies = [ 1491 | "pin-project-internal", 1492 | ] 1493 | 1494 | [[package]] 1495 | name = "pin-project-internal" 1496 | version = "1.0.6" 1497 | source = "registry+https://github.com/rust-lang/crates.io-index" 1498 | checksum = "a490329918e856ed1b083f244e3bfe2d8c4f336407e4ea9e1a9f479ff09049e5" 1499 | dependencies = [ 1500 | "proc-macro2", 1501 | "quote", 1502 | "syn", 1503 | ] 1504 | 1505 | [[package]] 1506 | name = "pin-project-lite" 1507 | version = "0.2.6" 1508 | source = "registry+https://github.com/rust-lang/crates.io-index" 1509 | checksum = "dc0e1f259c92177c30a4c9d177246edd0a3568b25756a977d0632cf8fa37e905" 1510 | 1511 | [[package]] 1512 | name = "pin-utils" 1513 | version = "0.1.0" 1514 | source = "registry+https://github.com/rust-lang/crates.io-index" 1515 | checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" 1516 | 1517 | [[package]] 1518 | name = "pkg-config" 1519 | version = "0.3.19" 1520 | source = "registry+https://github.com/rust-lang/crates.io-index" 1521 | checksum = "3831453b3449ceb48b6d9c7ad7c96d5ea673e9b470a1dc578c2ce6521230884c" 1522 | 1523 | [[package]] 1524 | name = "png" 1525 | version = "0.16.8" 1526 | source = "registry+https://github.com/rust-lang/crates.io-index" 1527 | checksum = "3c3287920cb847dee3de33d301c463fba14dda99db24214ddf93f83d3021f4c6" 1528 | dependencies = [ 1529 | "bitflags", 1530 | "crc32fast", 1531 | "deflate", 1532 | "miniz_oxide 0.3.7", 1533 | ] 1534 | 1535 | [[package]] 1536 | name = "ppv-lite86" 1537 | version = "0.2.10" 1538 | source = "registry+https://github.com/rust-lang/crates.io-index" 1539 | checksum = "ac74c624d6b2d21f425f752262f42188365d7b8ff1aff74c82e45136510a4857" 1540 | 1541 | [[package]] 1542 | name = "proc-macro-crate" 1543 | version = "0.1.5" 1544 | source = "registry+https://github.com/rust-lang/crates.io-index" 1545 | checksum = "1d6ea3c4595b96363c13943497db34af4460fb474a95c43f4446ad341b8c9785" 1546 | dependencies = [ 1547 | "toml", 1548 | ] 1549 | 1550 | [[package]] 1551 | name = "proc-macro-error" 1552 | version = "1.0.4" 1553 | source = "registry+https://github.com/rust-lang/crates.io-index" 1554 | checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" 1555 | dependencies = [ 1556 | "proc-macro-error-attr", 1557 | "proc-macro2", 1558 | "quote", 1559 | "syn", 1560 | "version_check", 1561 | ] 1562 | 1563 | [[package]] 1564 | name = "proc-macro-error-attr" 1565 | version = "1.0.4" 1566 | source = "registry+https://github.com/rust-lang/crates.io-index" 1567 | checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" 1568 | dependencies = [ 1569 | "proc-macro2", 1570 | "quote", 1571 | "version_check", 1572 | ] 1573 | 1574 | [[package]] 1575 | name = "proc-macro-hack" 1576 | version = "0.5.19" 1577 | source = "registry+https://github.com/rust-lang/crates.io-index" 1578 | checksum = "dbf0c48bc1d91375ae5c3cd81e3722dff1abcf81a30960240640d223f59fe0e5" 1579 | 1580 | [[package]] 1581 | name = "proc-macro-nested" 1582 | version = "0.1.7" 1583 | source = "registry+https://github.com/rust-lang/crates.io-index" 1584 | checksum = "bc881b2c22681370c6a780e47af9840ef841837bc98118431d4e1868bd0c1086" 1585 | 1586 | [[package]] 1587 | name = "proc-macro2" 1588 | version = "1.0.24" 1589 | source = "registry+https://github.com/rust-lang/crates.io-index" 1590 | checksum = "1e0704ee1a7e00d7bb417d0770ea303c1bccbabf0ef1667dae92b5967f5f8a71" 1591 | dependencies = [ 1592 | "unicode-xid", 1593 | ] 1594 | 1595 | [[package]] 1596 | name = "quote" 1597 | version = "1.0.9" 1598 | source = "registry+https://github.com/rust-lang/crates.io-index" 1599 | checksum = "c3d0b9745dc2debf507c8422de05d7226cc1f0644216dfdfead988f9b1ab32a7" 1600 | dependencies = [ 1601 | "proc-macro2", 1602 | ] 1603 | 1604 | [[package]] 1605 | name = "rand" 1606 | version = "0.7.3" 1607 | source = "registry+https://github.com/rust-lang/crates.io-index" 1608 | checksum = "6a6b1679d49b24bbfe0c803429aa1874472f50d9b363131f0e89fc356b544d03" 1609 | dependencies = [ 1610 | "getrandom", 1611 | "libc", 1612 | "rand_chacha", 1613 | "rand_core", 1614 | "rand_hc", 1615 | ] 1616 | 1617 | [[package]] 1618 | name = "rand_chacha" 1619 | version = "0.2.2" 1620 | source = "registry+https://github.com/rust-lang/crates.io-index" 1621 | checksum = "f4c8ed856279c9737206bf725bf36935d8666ead7aa69b52be55af369d193402" 1622 | dependencies = [ 1623 | "ppv-lite86", 1624 | "rand_core", 1625 | ] 1626 | 1627 | [[package]] 1628 | name = "rand_core" 1629 | version = "0.5.1" 1630 | source = "registry+https://github.com/rust-lang/crates.io-index" 1631 | checksum = "90bde5296fc891b0cef12a6d03ddccc162ce7b2aff54160af9338f8d40df6d19" 1632 | dependencies = [ 1633 | "getrandom", 1634 | ] 1635 | 1636 | [[package]] 1637 | name = "rand_hc" 1638 | version = "0.2.0" 1639 | source = "registry+https://github.com/rust-lang/crates.io-index" 1640 | checksum = "ca3129af7b92a17112d59ad498c6f81eaf463253766b90396d39ea7a39d6613c" 1641 | dependencies = [ 1642 | "rand_core", 1643 | ] 1644 | 1645 | [[package]] 1646 | name = "raw-window-handle" 1647 | version = "0.3.3" 1648 | source = "registry+https://github.com/rust-lang/crates.io-index" 1649 | checksum = "0a441a7a6c80ad6473bd4b74ec1c9a4c951794285bf941c2126f607c72e48211" 1650 | dependencies = [ 1651 | "libc", 1652 | ] 1653 | 1654 | [[package]] 1655 | name = "rayon" 1656 | version = "1.5.0" 1657 | source = "registry+https://github.com/rust-lang/crates.io-index" 1658 | checksum = "8b0d8e0819fadc20c74ea8373106ead0600e3a67ef1fe8da56e39b9ae7275674" 1659 | dependencies = [ 1660 | "autocfg", 1661 | "crossbeam-deque 0.8.0", 1662 | "either", 1663 | "rayon-core", 1664 | ] 1665 | 1666 | [[package]] 1667 | name = "rayon-core" 1668 | version = "1.9.0" 1669 | source = "registry+https://github.com/rust-lang/crates.io-index" 1670 | checksum = "9ab346ac5921dc62ffa9f89b7a773907511cdfa5490c572ae9be1be33e8afa4a" 1671 | dependencies = [ 1672 | "crossbeam-channel 0.5.0", 1673 | "crossbeam-deque 0.8.0", 1674 | "crossbeam-utils 0.8.3", 1675 | "lazy_static", 1676 | "num_cpus", 1677 | ] 1678 | 1679 | [[package]] 1680 | name = "redox_syscall" 1681 | version = "0.2.5" 1682 | source = "registry+https://github.com/rust-lang/crates.io-index" 1683 | checksum = "94341e4e44e24f6b591b59e47a8a027df12e008d73fd5672dbea9cc22f4507d9" 1684 | dependencies = [ 1685 | "bitflags", 1686 | ] 1687 | 1688 | [[package]] 1689 | name = "rusttype" 1690 | version = "0.9.2" 1691 | source = "registry+https://github.com/rust-lang/crates.io-index" 1692 | checksum = "dc7c727aded0be18c5b80c1640eae0ac8e396abf6fa8477d96cb37d18ee5ec59" 1693 | dependencies = [ 1694 | "ab_glyph_rasterizer", 1695 | "owned_ttf_parser", 1696 | ] 1697 | 1698 | [[package]] 1699 | name = "rusty_v8" 1700 | version = "0.16.0" 1701 | source = "registry+https://github.com/rust-lang/crates.io-index" 1702 | checksum = "a50f63f3030b5a676b9f6e7d53bf1f880904973c2350a3f034dbf82facca0b4f" 1703 | dependencies = [ 1704 | "bitflags", 1705 | "cargo_gn", 1706 | "fslock", 1707 | "lazy_static", 1708 | "libc", 1709 | "which", 1710 | ] 1711 | 1712 | [[package]] 1713 | name = "ryu" 1714 | version = "1.0.5" 1715 | source = "registry+https://github.com/rust-lang/crates.io-index" 1716 | checksum = "71d301d4193d031abdd79ff7e3dd721168a9572ef3fe51a1517aba235bd8f86e" 1717 | 1718 | [[package]] 1719 | name = "same-file" 1720 | version = "1.0.6" 1721 | source = "registry+https://github.com/rust-lang/crates.io-index" 1722 | checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" 1723 | dependencies = [ 1724 | "winapi-util", 1725 | ] 1726 | 1727 | [[package]] 1728 | name = "scoped-tls" 1729 | version = "1.0.0" 1730 | source = "registry+https://github.com/rust-lang/crates.io-index" 1731 | checksum = "ea6a9290e3c9cf0f18145ef7ffa62d68ee0bf5fcd651017e586dc7fd5da448c2" 1732 | 1733 | [[package]] 1734 | name = "scoped_threadpool" 1735 | version = "0.1.9" 1736 | source = "registry+https://github.com/rust-lang/crates.io-index" 1737 | checksum = "1d51f5df5af43ab3f1360b429fa5e0152ac5ce8c0bd6485cae490332e96846a8" 1738 | 1739 | [[package]] 1740 | name = "scopeguard" 1741 | version = "1.1.0" 1742 | source = "registry+https://github.com/rust-lang/crates.io-index" 1743 | checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" 1744 | 1745 | [[package]] 1746 | name = "serde" 1747 | version = "1.0.125" 1748 | source = "registry+https://github.com/rust-lang/crates.io-index" 1749 | checksum = "558dc50e1a5a5fa7112ca2ce4effcb321b0300c0d4ccf0776a9f60cd89031171" 1750 | dependencies = [ 1751 | "serde_derive", 1752 | ] 1753 | 1754 | [[package]] 1755 | name = "serde_derive" 1756 | version = "1.0.125" 1757 | source = "registry+https://github.com/rust-lang/crates.io-index" 1758 | checksum = "b093b7a2bb58203b5da3056c05b4ec1fed827dcfdb37347a8841695263b3d06d" 1759 | dependencies = [ 1760 | "proc-macro2", 1761 | "quote", 1762 | "syn", 1763 | ] 1764 | 1765 | [[package]] 1766 | name = "serde_json" 1767 | version = "1.0.64" 1768 | source = "registry+https://github.com/rust-lang/crates.io-index" 1769 | checksum = "799e97dc9fdae36a5c8b8f2cae9ce2ee9fdce2058c57a93e6099d919fd982f79" 1770 | dependencies = [ 1771 | "indexmap", 1772 | "itoa", 1773 | "ryu", 1774 | "serde", 1775 | ] 1776 | 1777 | [[package]] 1778 | name = "serde_millis" 1779 | version = "0.1.1" 1780 | source = "registry+https://github.com/rust-lang/crates.io-index" 1781 | checksum = "e6e2dc780ca5ee2c369d1d01d100270203c4ff923d2a4264812d723766434d00" 1782 | dependencies = [ 1783 | "serde", 1784 | ] 1785 | 1786 | [[package]] 1787 | name = "slab" 1788 | version = "0.4.2" 1789 | source = "registry+https://github.com/rust-lang/crates.io-index" 1790 | checksum = "c111b5bd5695e56cffe5129854aa230b39c93a305372fdbb2668ca2394eea9f8" 1791 | 1792 | [[package]] 1793 | name = "smallvec" 1794 | version = "1.6.1" 1795 | source = "registry+https://github.com/rust-lang/crates.io-index" 1796 | checksum = "fe0f37c9e8f3c5a4a66ad655a93c74daac4ad00c441533bf5c6e7990bb42604e" 1797 | 1798 | [[package]] 1799 | name = "smithay-client-toolkit" 1800 | version = "0.12.3" 1801 | source = "registry+https://github.com/rust-lang/crates.io-index" 1802 | checksum = "4750c76fd5d3ac95fa3ed80fe667d6a3d8590a960e5b575b98eea93339a80b80" 1803 | dependencies = [ 1804 | "andrew", 1805 | "bitflags", 1806 | "calloop", 1807 | "dlib 0.4.2", 1808 | "lazy_static", 1809 | "log", 1810 | "memmap2", 1811 | "nix 0.18.0", 1812 | "wayland-client", 1813 | "wayland-cursor", 1814 | "wayland-protocols", 1815 | ] 1816 | 1817 | [[package]] 1818 | name = "soup-sys" 1819 | version = "0.10.0" 1820 | source = "registry+https://github.com/rust-lang/crates.io-index" 1821 | checksum = "c3c7adf08565630bbb71f955f11f8a68464817ded2703a3549747c235b58a13e" 1822 | dependencies = [ 1823 | "bitflags", 1824 | "gio-sys", 1825 | "glib-sys", 1826 | "gobject-sys", 1827 | "libc", 1828 | "pkg-config", 1829 | "system-deps", 1830 | ] 1831 | 1832 | [[package]] 1833 | name = "strsim" 1834 | version = "0.9.3" 1835 | source = "registry+https://github.com/rust-lang/crates.io-index" 1836 | checksum = "6446ced80d6c486436db5c078dde11a9f73d42b57fb273121e160b84f63d894c" 1837 | 1838 | [[package]] 1839 | name = "strum" 1840 | version = "0.18.0" 1841 | source = "registry+https://github.com/rust-lang/crates.io-index" 1842 | checksum = "57bd81eb48f4c437cadc685403cad539345bf703d78e63707418431cecd4522b" 1843 | 1844 | [[package]] 1845 | name = "strum_macros" 1846 | version = "0.18.0" 1847 | source = "registry+https://github.com/rust-lang/crates.io-index" 1848 | checksum = "87c85aa3f8ea653bfd3ddf25f7ee357ee4d204731f6aa9ad04002306f6e2774c" 1849 | dependencies = [ 1850 | "heck", 1851 | "proc-macro2", 1852 | "quote", 1853 | "syn", 1854 | ] 1855 | 1856 | [[package]] 1857 | name = "syn" 1858 | version = "1.0.67" 1859 | source = "registry+https://github.com/rust-lang/crates.io-index" 1860 | checksum = "6498a9efc342871f91cc2d0d694c674368b4ceb40f62b65a7a08c3792935e702" 1861 | dependencies = [ 1862 | "proc-macro2", 1863 | "quote", 1864 | "unicode-xid", 1865 | ] 1866 | 1867 | [[package]] 1868 | name = "system-deps" 1869 | version = "1.3.2" 1870 | source = "registry+https://github.com/rust-lang/crates.io-index" 1871 | checksum = "0f3ecc17269a19353b3558b313bba738b25d82993e30d62a18406a24aba4649b" 1872 | dependencies = [ 1873 | "heck", 1874 | "pkg-config", 1875 | "strum", 1876 | "strum_macros", 1877 | "thiserror", 1878 | "toml", 1879 | "version-compare", 1880 | ] 1881 | 1882 | [[package]] 1883 | name = "tauri-winit" 1884 | version = "0.24.0" 1885 | source = "registry+https://github.com/rust-lang/crates.io-index" 1886 | checksum = "02d5ed63af8ca000701df8a14d9dc6bc2a1decdecfe610eb4b4b3e08406a77c5" 1887 | dependencies = [ 1888 | "bitflags", 1889 | "cocoa", 1890 | "core-foundation 0.9.1", 1891 | "core-graphics 0.22.2", 1892 | "core-video-sys", 1893 | "dispatch", 1894 | "instant", 1895 | "lazy_static", 1896 | "libc", 1897 | "log", 1898 | "mio", 1899 | "mio-misc", 1900 | "ndk", 1901 | "ndk-glue", 1902 | "ndk-sys", 1903 | "objc", 1904 | "parking_lot", 1905 | "percent-encoding", 1906 | "raw-window-handle", 1907 | "scopeguard", 1908 | "serde", 1909 | "smithay-client-toolkit", 1910 | "wayland-client", 1911 | "winapi", 1912 | "x11-dl", 1913 | ] 1914 | 1915 | [[package]] 1916 | name = "thiserror" 1917 | version = "1.0.24" 1918 | source = "registry+https://github.com/rust-lang/crates.io-index" 1919 | checksum = "e0f4a65597094d4483ddaed134f409b2cb7c1beccf25201a9f73c719254fa98e" 1920 | dependencies = [ 1921 | "thiserror-impl", 1922 | ] 1923 | 1924 | [[package]] 1925 | name = "thiserror-impl" 1926 | version = "1.0.24" 1927 | source = "registry+https://github.com/rust-lang/crates.io-index" 1928 | checksum = "7765189610d8241a44529806d6fd1f2e0a08734313a35d5b3a556f92b381f3c0" 1929 | dependencies = [ 1930 | "proc-macro2", 1931 | "quote", 1932 | "syn", 1933 | ] 1934 | 1935 | [[package]] 1936 | name = "tiff" 1937 | version = "0.6.1" 1938 | source = "registry+https://github.com/rust-lang/crates.io-index" 1939 | checksum = "9a53f4706d65497df0c4349241deddf35f84cee19c87ed86ea8ca590f4464437" 1940 | dependencies = [ 1941 | "jpeg-decoder", 1942 | "miniz_oxide 0.4.4", 1943 | "weezl", 1944 | ] 1945 | 1946 | [[package]] 1947 | name = "tinyvec" 1948 | version = "1.1.1" 1949 | source = "registry+https://github.com/rust-lang/crates.io-index" 1950 | checksum = "317cca572a0e89c3ce0ca1f1bdc9369547fe318a683418e42ac8f59d14701023" 1951 | dependencies = [ 1952 | "tinyvec_macros", 1953 | ] 1954 | 1955 | [[package]] 1956 | name = "tinyvec_macros" 1957 | version = "0.1.0" 1958 | source = "registry+https://github.com/rust-lang/crates.io-index" 1959 | checksum = "cda74da7e1a664f795bb1f8a87ec406fb89a02522cf6e50620d016add6dbbf5c" 1960 | 1961 | [[package]] 1962 | name = "toml" 1963 | version = "0.5.8" 1964 | source = "registry+https://github.com/rust-lang/crates.io-index" 1965 | checksum = "a31142970826733df8241ef35dc040ef98c679ab14d7c3e54d827099b3acecaa" 1966 | dependencies = [ 1967 | "serde", 1968 | ] 1969 | 1970 | [[package]] 1971 | name = "ttf-parser" 1972 | version = "0.6.2" 1973 | source = "registry+https://github.com/rust-lang/crates.io-index" 1974 | checksum = "3e5d7cd7ab3e47dda6e56542f4bbf3824c15234958c6e1bd6aaa347e93499fdc" 1975 | 1976 | [[package]] 1977 | name = "unicode-bidi" 1978 | version = "0.3.4" 1979 | source = "registry+https://github.com/rust-lang/crates.io-index" 1980 | checksum = "49f2bd0c6468a8230e1db229cff8029217cf623c767ea5d60bfbd42729ea54d5" 1981 | dependencies = [ 1982 | "matches", 1983 | ] 1984 | 1985 | [[package]] 1986 | name = "unicode-normalization" 1987 | version = "0.1.17" 1988 | source = "registry+https://github.com/rust-lang/crates.io-index" 1989 | checksum = "07fbfce1c8a97d547e8b5334978438d9d6ec8c20e38f56d4a4374d181493eaef" 1990 | dependencies = [ 1991 | "tinyvec", 1992 | ] 1993 | 1994 | [[package]] 1995 | name = "unicode-segmentation" 1996 | version = "1.7.1" 1997 | source = "registry+https://github.com/rust-lang/crates.io-index" 1998 | checksum = "bb0d2e7be6ae3a5fa87eed5fb451aff96f2573d2694942e40543ae0bbe19c796" 1999 | 2000 | [[package]] 2001 | name = "unicode-xid" 2002 | version = "0.2.1" 2003 | source = "registry+https://github.com/rust-lang/crates.io-index" 2004 | checksum = "f7fe0bb3479651439c9112f72b6c505038574c9fbb575ed1bf3b797fa39dd564" 2005 | 2006 | [[package]] 2007 | name = "url" 2008 | version = "2.2.1" 2009 | source = "registry+https://github.com/rust-lang/crates.io-index" 2010 | checksum = "9ccd964113622c8e9322cfac19eb1004a07e636c545f325da085d5cdde6f1f8b" 2011 | dependencies = [ 2012 | "form_urlencoded", 2013 | "idna", 2014 | "matches", 2015 | "percent-encoding", 2016 | "serde", 2017 | ] 2018 | 2019 | [[package]] 2020 | name = "version-compare" 2021 | version = "0.0.10" 2022 | source = "registry+https://github.com/rust-lang/crates.io-index" 2023 | checksum = "d63556a25bae6ea31b52e640d7c41d1ab27faba4ccb600013837a3d0b3994ca1" 2024 | 2025 | [[package]] 2026 | name = "version_check" 2027 | version = "0.9.3" 2028 | source = "registry+https://github.com/rust-lang/crates.io-index" 2029 | checksum = "5fecdca9a5291cc2b8dcf7dc02453fee791a280f3743cb0905f8822ae463b3fe" 2030 | 2031 | [[package]] 2032 | name = "walkdir" 2033 | version = "2.3.2" 2034 | source = "registry+https://github.com/rust-lang/crates.io-index" 2035 | checksum = "808cf2735cd4b6866113f648b791c6adc5714537bc222d9347bb203386ffda56" 2036 | dependencies = [ 2037 | "same-file", 2038 | "winapi", 2039 | "winapi-util", 2040 | ] 2041 | 2042 | [[package]] 2043 | name = "wasi" 2044 | version = "0.9.0+wasi-snapshot-preview1" 2045 | source = "registry+https://github.com/rust-lang/crates.io-index" 2046 | checksum = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519" 2047 | 2048 | [[package]] 2049 | name = "wayland-client" 2050 | version = "0.28.5" 2051 | source = "registry+https://github.com/rust-lang/crates.io-index" 2052 | checksum = "06ca44d86554b85cf449f1557edc6cc7da935cc748c8e4bf1c507cbd43bae02c" 2053 | dependencies = [ 2054 | "bitflags", 2055 | "downcast-rs", 2056 | "libc", 2057 | "nix 0.20.0", 2058 | "scoped-tls", 2059 | "wayland-commons", 2060 | "wayland-scanner", 2061 | "wayland-sys", 2062 | ] 2063 | 2064 | [[package]] 2065 | name = "wayland-commons" 2066 | version = "0.28.5" 2067 | source = "registry+https://github.com/rust-lang/crates.io-index" 2068 | checksum = "8bd75ae380325dbcff2707f0cd9869827ea1d2d6d534cff076858d3f0460fd5a" 2069 | dependencies = [ 2070 | "nix 0.20.0", 2071 | "once_cell", 2072 | "smallvec", 2073 | "wayland-sys", 2074 | ] 2075 | 2076 | [[package]] 2077 | name = "wayland-cursor" 2078 | version = "0.28.5" 2079 | source = "registry+https://github.com/rust-lang/crates.io-index" 2080 | checksum = "b37e5455ec72f5de555ec39b5c3704036ac07c2ecd50d0bffe02d5fe2d4e65ab" 2081 | dependencies = [ 2082 | "nix 0.20.0", 2083 | "wayland-client", 2084 | "xcursor", 2085 | ] 2086 | 2087 | [[package]] 2088 | name = "wayland-protocols" 2089 | version = "0.28.5" 2090 | source = "registry+https://github.com/rust-lang/crates.io-index" 2091 | checksum = "95df3317872bcf9eec096c864b69aa4769a1d5d6291a5b513f8ba0af0efbd52c" 2092 | dependencies = [ 2093 | "bitflags", 2094 | "wayland-client", 2095 | "wayland-commons", 2096 | "wayland-scanner", 2097 | ] 2098 | 2099 | [[package]] 2100 | name = "wayland-scanner" 2101 | version = "0.28.5" 2102 | source = "registry+https://github.com/rust-lang/crates.io-index" 2103 | checksum = "389d680d7bd67512dc9c37f39560224327038deb0f0e8d33f870900441b68720" 2104 | dependencies = [ 2105 | "proc-macro2", 2106 | "quote", 2107 | "xml-rs", 2108 | ] 2109 | 2110 | [[package]] 2111 | name = "wayland-sys" 2112 | version = "0.28.5" 2113 | source = "registry+https://github.com/rust-lang/crates.io-index" 2114 | checksum = "2907bd297eef464a95ba9349ea771611771aa285b932526c633dc94d5400a8e2" 2115 | dependencies = [ 2116 | "dlib 0.5.0", 2117 | "lazy_static", 2118 | "pkg-config", 2119 | ] 2120 | 2121 | [[package]] 2122 | name = "webkit2gtk" 2123 | version = "0.11.0" 2124 | source = "registry+https://github.com/rust-lang/crates.io-index" 2125 | checksum = "02b7e9eb04d30f8423e9c8435f686f42bc497cfcac2cfe4b43ce4139fb1a7cb6" 2126 | dependencies = [ 2127 | "bitflags", 2128 | "cairo-rs", 2129 | "gdk", 2130 | "gdk-sys", 2131 | "gio", 2132 | "gio-sys", 2133 | "glib", 2134 | "glib-sys", 2135 | "gobject-sys", 2136 | "gtk", 2137 | "gtk-sys", 2138 | "javascriptcore-rs", 2139 | "libc", 2140 | "webkit2gtk-sys", 2141 | ] 2142 | 2143 | [[package]] 2144 | name = "webkit2gtk-sys" 2145 | version = "0.13.0" 2146 | source = "registry+https://github.com/rust-lang/crates.io-index" 2147 | checksum = "72d10cf73685359cd8611740db241a231f4d74d7e353348dc5332a1a132d6f24" 2148 | dependencies = [ 2149 | "atk-sys", 2150 | "bitflags", 2151 | "cairo-sys-rs", 2152 | "gdk-pixbuf-sys", 2153 | "gdk-sys", 2154 | "gio-sys", 2155 | "glib-sys", 2156 | "gobject-sys", 2157 | "gtk-sys", 2158 | "javascriptcore-rs-sys", 2159 | "libc", 2160 | "pango-sys", 2161 | "pkg-config", 2162 | "soup-sys", 2163 | ] 2164 | 2165 | [[package]] 2166 | name = "webview2" 2167 | version = "0.1.0-beta.1" 2168 | source = "registry+https://github.com/rust-lang/crates.io-index" 2169 | checksum = "6c0fa7367f4de0e4bca5730a297027f15d2e1f06227809efa47621eb55f08610" 2170 | dependencies = [ 2171 | "com", 2172 | "once_cell", 2173 | "webview2-sys", 2174 | "widestring", 2175 | "winapi", 2176 | ] 2177 | 2178 | [[package]] 2179 | name = "webview2-sys" 2180 | version = "0.1.0-beta.1" 2181 | source = "registry+https://github.com/rust-lang/crates.io-index" 2182 | checksum = "b53f9c920933ddff6481d525c3e0d14327843c82074c44522b97dcf6da5ad456" 2183 | dependencies = [ 2184 | "com", 2185 | "winapi", 2186 | ] 2187 | 2188 | [[package]] 2189 | name = "weezl" 2190 | version = "0.1.4" 2191 | source = "registry+https://github.com/rust-lang/crates.io-index" 2192 | checksum = "4a32b378380f4e9869b22f0b5177c68a5519f03b3454fde0b291455ddbae266c" 2193 | 2194 | [[package]] 2195 | name = "which" 2196 | version = "4.1.0" 2197 | source = "registry+https://github.com/rust-lang/crates.io-index" 2198 | checksum = "b55551e42cbdf2ce2bedd2203d0cc08dba002c27510f86dab6d0ce304cba3dfe" 2199 | dependencies = [ 2200 | "either", 2201 | "libc", 2202 | ] 2203 | 2204 | [[package]] 2205 | name = "widestring" 2206 | version = "0.4.3" 2207 | source = "registry+https://github.com/rust-lang/crates.io-index" 2208 | checksum = "c168940144dd21fd8046987c16a46a33d5fc84eec29ef9dcddc2ac9e31526b7c" 2209 | 2210 | [[package]] 2211 | name = "winapi" 2212 | version = "0.3.9" 2213 | source = "registry+https://github.com/rust-lang/crates.io-index" 2214 | checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" 2215 | dependencies = [ 2216 | "winapi-i686-pc-windows-gnu", 2217 | "winapi-x86_64-pc-windows-gnu", 2218 | ] 2219 | 2220 | [[package]] 2221 | name = "winapi-i686-pc-windows-gnu" 2222 | version = "0.4.0" 2223 | source = "registry+https://github.com/rust-lang/crates.io-index" 2224 | checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" 2225 | 2226 | [[package]] 2227 | name = "winapi-util" 2228 | version = "0.1.5" 2229 | source = "registry+https://github.com/rust-lang/crates.io-index" 2230 | checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178" 2231 | dependencies = [ 2232 | "winapi", 2233 | ] 2234 | 2235 | [[package]] 2236 | name = "winapi-x86_64-pc-windows-gnu" 2237 | version = "0.4.0" 2238 | source = "registry+https://github.com/rust-lang/crates.io-index" 2239 | checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" 2240 | 2241 | [[package]] 2242 | name = "wry" 2243 | version = "0.6.2" 2244 | source = "registry+https://github.com/rust-lang/crates.io-index" 2245 | checksum = "13aef0e08a7be78d18e22ffbd70de6bc25bedfb31aaf8b630720d540aab6305c" 2246 | dependencies = [ 2247 | "async-channel", 2248 | "cairo-rs", 2249 | "cocoa", 2250 | "core-graphics 0.22.2", 2251 | "gdk", 2252 | "gdk-pixbuf", 2253 | "gio", 2254 | "glib", 2255 | "gtk", 2256 | "image", 2257 | "infer", 2258 | "libc", 2259 | "log", 2260 | "objc", 2261 | "objc_id", 2262 | "once_cell", 2263 | "serde", 2264 | "serde_json", 2265 | "tauri-winit", 2266 | "thiserror", 2267 | "url", 2268 | "webkit2gtk", 2269 | "webview2", 2270 | "winapi", 2271 | ] 2272 | 2273 | [[package]] 2274 | name = "wry_deno" 2275 | version = "0.1.2" 2276 | dependencies = [ 2277 | "deno_core", 2278 | "deno_json_op", 2279 | "gio", 2280 | "gtk", 2281 | "serde", 2282 | "serde_millis", 2283 | "tauri-winit", 2284 | "webkit2gtk", 2285 | "wry", 2286 | ] 2287 | 2288 | [[package]] 2289 | name = "x11-dl" 2290 | version = "2.18.5" 2291 | source = "registry+https://github.com/rust-lang/crates.io-index" 2292 | checksum = "2bf981e3a5b3301209754218f962052d4d9ee97e478f4d26d4a6eced34c1fef8" 2293 | dependencies = [ 2294 | "lazy_static", 2295 | "libc", 2296 | "maybe-uninit", 2297 | "pkg-config", 2298 | ] 2299 | 2300 | [[package]] 2301 | name = "xcursor" 2302 | version = "0.3.3" 2303 | source = "registry+https://github.com/rust-lang/crates.io-index" 2304 | checksum = "3a9a231574ae78801646617cefd13bfe94be907c0e4fa979cfd8b770aa3c5d08" 2305 | dependencies = [ 2306 | "nom", 2307 | ] 2308 | 2309 | [[package]] 2310 | name = "xdg" 2311 | version = "2.2.0" 2312 | source = "registry+https://github.com/rust-lang/crates.io-index" 2313 | checksum = "d089681aa106a86fade1b0128fb5daf07d5867a509ab036d99988dec80429a57" 2314 | 2315 | [[package]] 2316 | name = "xml-rs" 2317 | version = "0.8.3" 2318 | source = "registry+https://github.com/rust-lang/crates.io-index" 2319 | checksum = "b07db065a5cf61a7e4ba64f29e67db906fb1787316516c4e6e5ff0fea1efcd8a" 2320 | -------------------------------------------------------------------------------- /Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "wry_deno" 3 | version = "0.1.2" 4 | authors = ["David Lemarier "] 5 | edition = "2018" 6 | 7 | [lib] 8 | crate-type = ["cdylib"] 9 | 10 | [dependencies] 11 | deno_core = "0.77.1" 12 | deno_json_op = "0.1.1" 13 | wry = "0.6.2" 14 | serde = { version = "1.0", features = ["derive"] } 15 | serde_millis = "0.1.1" 16 | 17 | [target."cfg(target_os = \"linux\")".dependencies] 18 | webkit2gtk = { version = "0.11", features = [ "v2_8" ] } 19 | gtk = "0.9" 20 | gio = "0.9" 21 | 22 | [target."cfg(target_os = \"windows\")".dependencies] 23 | tauri-winit = { version = "0.24", features = ["serde"] } 24 | 25 | [target."cfg(target_os = \"macos\")".dependencies] 26 | tauri-winit = { version = "0.24", features = ["serde"] } -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ## wry deno bindings 2 | 3 | Attention this is only a proof of concept. API will changes in a close futures. 4 | You can use it for fun tho! 5 | 6 | ```bash 7 | deno run --unstable -A https://raw.githubusercontent.com/lemarier/wry-deno/main/examples/helloworld.js 8 | ``` 9 | 10 | ## Example 11 | 12 | ```typescript 13 | import { Wry } from "https://raw.githubusercontent.com/lemarier/wry_deno/main/mod.ts"; 14 | import { listenAndServe } from "https://deno.land/std/http/server.ts"; 15 | 16 | const wryApplication = new Wry("http://localhost:8000"); 17 | 18 | listenAndServe({ port: 8000 }, (req) => { 19 | req.respond({ body: `Hello from Deno ${Deno.version.deno}` }); 20 | }); 21 | 22 | wryApplication.run(({event}) => { 23 | switch (event) { 24 | case 'close': 25 | Deno.exit() 26 | break; 27 | case 'windowCreated': 28 | console.log("It works! Window created , if webview didn't show, try to resize window"); 29 | break; 30 | case 'domContentLoaded': 31 | console.log("It works! domContentLoaded") 32 | break; 33 | } 34 | }); 35 | ``` 36 | 37 | ### Known issue: 38 | - [ ] Window need to be resized to load the webview on macos. 39 | - [x] Linux build do not works as it didnt use winit. -------------------------------------------------------------------------------- /deps.ts: -------------------------------------------------------------------------------- 1 | export { delay } from "https://deno.land/std/async/mod.ts"; 2 | export { Plug } from "https://deno.land/x/plug/mod.ts"; -------------------------------------------------------------------------------- /examples/helloworld.js: -------------------------------------------------------------------------------- 1 | import { Application as Oak } from "https://deno.land/x/oak/mod.ts"; 2 | import { listenAndServe } from "https://deno.land/std/http/server.ts"; 3 | import { Wry } from '../mod.ts' 4 | 5 | const wryApplication = new Wry("http://localhost:8080"); 6 | const oakApplication = new Oak(); 7 | 8 | oakApplication.use((ctx) => { 9 | ctx.response.body = `Deno: ${Deno.version.deno} Typescript: ${Deno.version.typescript}`; 10 | }); 11 | 12 | // using OAK without blocking the thread 13 | listenAndServe({ port: 8080 }, async (request) => { 14 | const response = await oakApplication.handle(request); 15 | if (response) { 16 | request.respond(response); 17 | } 18 | }); 19 | 20 | wryApplication.run(({event}) => { 21 | switch (event) { 22 | case 'close': 23 | Deno.exit() 24 | break; 25 | case 'windowCreated': 26 | console.log("It works! Window created , if webview didn't show, try to resize window"); 27 | break; 28 | case 'domContentLoaded': 29 | console.log("It works! domContentLoaded") 30 | break; 31 | } 32 | }); 33 | -------------------------------------------------------------------------------- /examples/sample.ts: -------------------------------------------------------------------------------- 1 | import { Wry } from "https://raw.githubusercontent.com/lemarier/wry_deno/main/mod.ts"; 2 | import { listenAndServe } from "https://deno.land/std/http/server.ts"; 3 | 4 | const wryApplication = new Wry("http://localhost:8000"); 5 | 6 | listenAndServe({ port: 8000 }, (req) => { 7 | req.respond({ body: `Hello from Deno ${Deno.version.deno}` }); 8 | }); 9 | 10 | wryApplication.run(({event}) => { 11 | switch (event) { 12 | case 'close': 13 | Deno.exit() 14 | break; 15 | case 'windowCreated': 16 | console.log("It works! Window created , if webview didn't show, try to resize window"); 17 | break; 18 | case 'domContentLoaded': 19 | console.log("It works! domContentLoaded") 20 | break; 21 | } 22 | }); -------------------------------------------------------------------------------- /mod.ts: -------------------------------------------------------------------------------- 1 | export * from "./wry.ts"; 2 | 3 | import { load, unload } from "./plugin.ts"; 4 | 5 | await load(); 6 | 7 | // deno-lint-ignore ban-ts-comment 8 | // @ts-ignore 9 | if (typeof window !== "undefined") window.addEventListener("unload", unload); -------------------------------------------------------------------------------- /plugin.ts: -------------------------------------------------------------------------------- 1 | import { Plug } from "./deps.ts"; 2 | 3 | const VERSION = "0.1.2"; 4 | const PLUGIN_URL = Deno.env.get("PLUGIN_URL") ?? 5 | `https://github.com/lemarier/wry_deno/releases/download/${VERSION}/`; 6 | const DEBUG = Boolean(Deno.env.get("DEBUG")); 7 | 8 | const encoder = new TextEncoder(); 9 | const decoder = new TextDecoder(); 10 | 11 | let rid: number | undefined; 12 | 13 | function deserialize(text: string): unknown { 14 | return JSON.parse( 15 | text.replace(/([^\"]+\"\:\s*)(\d{16,})/g, '$1"$2n"'), 16 | (_, v) => { 17 | if (typeof v === "string" && /^\d{16,}n$/.test(v)) { 18 | v = BigInt(v.slice(0, -1)); 19 | } 20 | 21 | return v; 22 | }, 23 | ); 24 | } 25 | 26 | function serialize(value: unknown, space?: number): string { 27 | return JSON.stringify(value, (_, v) => { 28 | if (typeof v === "bigint") { 29 | v = v.toString() + "n"; 30 | } 31 | return v; 32 | }, space).replace(/(?:\")(\d{16,})(?:n\")/g, "$1"); 33 | } 34 | 35 | function decode(data: Uint8Array): unknown { 36 | const text = decoder.decode(data); 37 | return deserialize(text); 38 | } 39 | 40 | function encode(data: unknown): Uint8Array { 41 | const text = serialize(data); 42 | return encoder.encode(text); 43 | } 44 | 45 | export type Result = { err: string } | { ok: T }; 46 | 47 | export function sync(op: string, data: unknown = {}): T { 48 | if (rid === undefined) { 49 | throw "The plugin must be initialized before use"; 50 | } 51 | 52 | const opId = Plug.getOpId(op); 53 | const response = Plug.core.dispatch(opId, encode(data))!; 54 | 55 | return decode(response) as T; 56 | } 57 | 58 | export function unwrap(result: Result): T { 59 | if ("err" in result) { 60 | throw (result as { err: string }).err; 61 | } 62 | 63 | if ("ok" in result) { 64 | return (result as { ok: T }).ok; 65 | } 66 | 67 | throw `Invalid result (${JSON.stringify(result)})`; 68 | } 69 | 70 | /** 71 | * Loads the plugin 72 | */ 73 | export async function load(cache = !DEBUG) { 74 | unload(); 75 | rid = await Plug.prepare({ 76 | name: "wry_deno", 77 | url: PLUGIN_URL, 78 | policy: cache ? Plug.CachePolicy.STORE : Plug.CachePolicy.NONE, 79 | }); 80 | } 81 | 82 | /** 83 | * Frees the plugin 84 | */ 85 | export function unload() { 86 | if (rid !== undefined) Deno.close(rid); 87 | rid = undefined; 88 | } -------------------------------------------------------------------------------- /scripts/_util.ts: -------------------------------------------------------------------------------- 1 | export async function requires(...executables: string[]) { 2 | const where = Deno.build.os === "windows" ? "where" : "which"; 3 | 4 | for (const executable of executables) { 5 | const process = Deno.run({ 6 | cmd: [where, executable], 7 | stderr: "null", 8 | stdin: "null", 9 | stdout: "null", 10 | }); 11 | 12 | if (!(await process.status()).success) { 13 | console.error(`Could not find required build tool ${executable}`); 14 | } 15 | } 16 | } 17 | 18 | export async function run( 19 | msg: string, 20 | cmd: string[], 21 | env?: { [key: string]: string }, 22 | ) { 23 | console.log(msg); 24 | 25 | const process = Deno.run({ cmd, env }); 26 | 27 | if (!(await process.status()).success) { 28 | console.error(`${msg} failed`); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /scripts/build.ts: -------------------------------------------------------------------------------- 1 | import { requires, run } from "./_util.ts"; 2 | 3 | export async function build(mshtml: boolean) { 4 | await requires("cargo"); 5 | 6 | const command = ["cargo", "build", "--release"]; 7 | 8 | if (mshtml) { 9 | command.push("--no-default-features"); 10 | } 11 | 12 | await run("building rust", command); 13 | } 14 | 15 | if (import.meta.main) { 16 | await build(Deno.args.includes("mshtml")); 17 | } 18 | -------------------------------------------------------------------------------- /scripts/dev.ts: -------------------------------------------------------------------------------- 1 | import { build } from "./build.ts"; 2 | import { run } from "./run.ts"; 3 | 4 | export async function dev( 5 | file: string, 6 | mshtml: boolean, 7 | ) { 8 | await build(mshtml); 9 | await run(file); 10 | } 11 | 12 | if (import.meta.main) { 13 | await dev(Deno.args[0], Deno.args.includes("mshtml")); 14 | } 15 | -------------------------------------------------------------------------------- /scripts/fmt.ts: -------------------------------------------------------------------------------- 1 | import { requires, run } from "./_util.ts"; 2 | 3 | export async function fmt() { 4 | await requires("cargo", "deno"); 5 | 6 | await run("formatting rust", ["cargo", "fmt"]); 7 | await run("formatting deno", ["deno", "fmt"]); 8 | } 9 | 10 | if (import.meta.main) { 11 | fmt(); 12 | } 13 | -------------------------------------------------------------------------------- /scripts/lint.ts: -------------------------------------------------------------------------------- 1 | import { requires, run } from "./_util.ts"; 2 | 3 | export async function lint() { 4 | await requires("cargo", "deno"); 5 | 6 | await run("linting rust", ["cargo", "clippy"]); 7 | await run("linting deno", ["deno", "--unstable", "lint"]); 8 | } 9 | 10 | if (import.meta.main) { 11 | lint(); 12 | } 13 | -------------------------------------------------------------------------------- /scripts/run.ts: -------------------------------------------------------------------------------- 1 | import * as util from "./_util.ts"; 2 | 3 | export async function run(file: string) { 4 | await util.requires("deno"); 5 | 6 | await util.run( 7 | `running`, 8 | ["deno", "run", "-Ar", "--unstable", file], 9 | { 10 | PLUGIN_URL: "./target/release", 11 | DEBUG: "true", 12 | }, 13 | ); 14 | } 15 | 16 | if (import.meta.main) { 17 | await run(Deno.args[0]); 18 | } 19 | -------------------------------------------------------------------------------- /src/event.rs: -------------------------------------------------------------------------------- 1 | use deno_core::serde::Serialize; 2 | 3 | #[derive(Debug, Clone, Serialize)] 4 | #[serde(rename_all = "camelCase", tag = "event")] 5 | pub enum Event { 6 | WindowCreated, 7 | DomContentLoaded, 8 | Undefined, 9 | Close, 10 | Suspended, 11 | Resumed, 12 | } 13 | 14 | #[cfg(not(target_os = "linux"))] 15 | impl From> for Event { 16 | fn from(event: winit::event::Event<()>) -> Self { 17 | match event { 18 | winit::event::Event::Suspended => Event::Suspended, 19 | winit::event::Event::Resumed => Event::Resumed, 20 | winit::event::Event::WindowEvent { 21 | event: winit::event::WindowEvent::CloseRequested, 22 | .. 23 | } => Event::Close, 24 | _ => Event::Undefined, 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/helpers.rs: -------------------------------------------------------------------------------- 1 | use deno_core::serde::{Deserialize, Serialize}; 2 | #[cfg(not(target_os = "linux"))] 3 | use winit::dpi::{LogicalSize, PhysicalSize, Size}; 4 | 5 | #[derive(Debug, Clone, Serialize)] 6 | #[serde(rename_all = "camelCase", tag = "event")] 7 | pub enum WebViewStatus { 8 | Initialized, 9 | WindowCreated, 10 | } 11 | #[cfg(not(target_os = "linux"))] 12 | #[derive(Deserialize)] 13 | #[serde(rename_all = "camelCase", remote = "Size")] 14 | pub enum SizeDef { 15 | Physical(PhysicalSize), 16 | Logical(LogicalSize), 17 | } 18 | -------------------------------------------------------------------------------- /src/lib.rs: -------------------------------------------------------------------------------- 1 | use std::cell::RefCell; 2 | use std::collections::HashMap; 3 | 4 | use deno_core::error::anyhow; 5 | use deno_core::error::AnyError; 6 | use deno_core::plugin_api::Interface; 7 | use deno_core::plugin_api::Op; 8 | use deno_core::plugin_api::ZeroCopyBuf; 9 | use deno_core::serde_json::json; 10 | use deno_core::serde_json::Value; 11 | use deno_json_op::json_op; 12 | 13 | #[cfg(not(target_os = "linux"))] 14 | use winit::{ 15 | dpi::Size, 16 | event_loop::{ControlFlow, EventLoop}, 17 | platform::run_return::EventLoopExtRunReturn, 18 | window::Window, 19 | }; 20 | 21 | #[cfg(target_os = "linux")] 22 | use gio::{ApplicationExt as GioApplicationExt, Cancellable}; 23 | #[cfg(target_os = "linux")] 24 | use gtk::{Application as GtkApp, ApplicationWindow, GtkWindowExt, Inhibit, WidgetExt}; 25 | 26 | use wry::webview::{RpcRequest, WebView, WebViewBuilder}; 27 | 28 | mod event; 29 | mod helpers; 30 | 31 | use event::Event; 32 | use helpers::WebViewStatus; 33 | 34 | #[cfg(not(target_os = "linux"))] 35 | use helpers::SizeDef; 36 | 37 | thread_local! { 38 | static INDEX: RefCell = RefCell::new(0); 39 | #[cfg(target_os = "linux")] 40 | static GTK_APPLICATION: RefCell = RefCell::new(GtkApp::new(None, Default::default()).unwrap()); 41 | #[cfg(not(target_os = "linux"))] 42 | static EVENT_LOOP: RefCell> = RefCell::new(EventLoop::new()); 43 | static WEBVIEW_MAP: RefCell> = RefCell::new(HashMap::new()); 44 | static WEBVIEW_STATUS: RefCell> = RefCell::new(HashMap::new()); 45 | static STACK_MAP: RefCell>> = RefCell::new(HashMap::new()); 46 | } 47 | 48 | #[no_mangle] 49 | pub fn deno_plugin_init(interface: &mut dyn Interface) { 50 | // main Ops who should be merged into 1 so they can share the same opstate and we 51 | // ca remove our thread_local pollution 52 | interface.register_op("wry_new", wry_new); 53 | interface.register_op("wry_loop", wry_loop); 54 | interface.register_op("wry_step", wry_step); 55 | 56 | // disable that on linux for now, we need to bind different functions 57 | #[cfg(not(target_os = "linux"))] 58 | interface.register_op("wry_set_minimized", wry_set_minimized); 59 | #[cfg(not(target_os = "linux"))] 60 | interface.register_op("wry_set_maximized", wry_set_maximized); 61 | #[cfg(not(target_os = "linux"))] 62 | interface.register_op("wry_set_visible", wry_set_visible); 63 | #[cfg(not(target_os = "linux"))] 64 | interface.register_op("wry_set_inner_size", wry_set_inner_size); 65 | } 66 | 67 | #[json_op] 68 | fn wry_new(json: Value, _zero_copy: &mut [ZeroCopyBuf]) -> Result { 69 | let url = json["url"].as_str().unwrap(); 70 | let mut id = 0; 71 | INDEX.with(|cell| { 72 | id = cell.replace_with(|&mut i| i + 1); 73 | }); 74 | 75 | return WEBVIEW_MAP.with(|cell| { 76 | let mut webviews = cell.borrow_mut(); 77 | 78 | #[cfg(target_os = "linux")] 79 | let mut window: Option = None; 80 | 81 | #[cfg(not(target_os = "linux"))] 82 | let mut window: Option = None; 83 | 84 | #[cfg(target_os = "linux")] 85 | GTK_APPLICATION.with(|cell| { 86 | let app = cell.borrow(); 87 | let cancellable: Option<&Cancellable> = None; 88 | app.register(cancellable) 89 | .expect("Unable to register window"); 90 | let gtk_window = ApplicationWindow::new(&app.clone()); 91 | gtk_window.set_default_size(800, 600); 92 | gtk_window.set_title("Basic example"); 93 | gtk_window.show_all(); 94 | 95 | gtk_window.connect_delete_event(move |_window, _event| { 96 | STACK_MAP.with(|cell| { 97 | let mut stack_map = cell.borrow_mut(); 98 | if let Some(stack) = stack_map.get_mut(&id) { 99 | stack.push(Event::Close); 100 | } else { 101 | panic!("Could not find stack with id {} to push onto stack", id); 102 | } 103 | }); 104 | Inhibit(false) 105 | }); 106 | 107 | // save our window 108 | window = Some(gtk_window); 109 | }); 110 | 111 | #[cfg(not(target_os = "linux"))] 112 | EVENT_LOOP.with(|cell| { 113 | let event_loop = cell.borrow(); 114 | window = Some(Window::new(&event_loop).expect("Unable to create window")); 115 | }); 116 | 117 | let webview = WebViewBuilder::new(window.expect("Window not created")) 118 | .unwrap() 119 | // inject a DOMContentLoaded listener to send a RPC request 120 | .initialize_script( 121 | format!( 122 | r#" 123 | {dom_loader} 124 | "#, 125 | dom_loader = include_str!("scripts/dom_loader.js"), 126 | ) 127 | .as_str(), 128 | ) 129 | .load_url(url)? 130 | .set_rpc_handler(Box::new(move |req: RpcRequest| { 131 | // this is a sample RPC test to check if we can get everything to work together 132 | let response = None; 133 | if &req.method == "domContentLoaded" { 134 | STACK_MAP.with(|cell| { 135 | let mut stack_map = cell.borrow_mut(); 136 | if let Some(stack) = stack_map.get_mut(&id) { 137 | stack.push(Event::DomContentLoaded); 138 | } else { 139 | panic!("Could not find stack with id {} to push onto stack", id); 140 | } 141 | }); 142 | } 143 | response 144 | })) 145 | .build()?; 146 | 147 | webviews.insert(id, webview); 148 | STACK_MAP.with(|cell| { 149 | cell.borrow_mut().insert(id, Vec::new()); 150 | }); 151 | 152 | // Set status to Initialized 153 | // on next loop we will mark this as window created 154 | WEBVIEW_STATUS.with(|cell| { 155 | cell.borrow_mut().insert(id, WebViewStatus::Initialized); 156 | }); 157 | 158 | Ok(json!(id)) 159 | }); 160 | } 161 | 162 | #[json_op] 163 | fn wry_loop(json: Value, _zero_copy: &mut [ZeroCopyBuf]) -> Result { 164 | let id = json["id"].as_u64().unwrap(); 165 | let mut should_stop_loop = false; 166 | 167 | #[cfg(target_os = "linux")] 168 | { 169 | should_stop_loop = gtk::main_iteration_do(false) == false; 170 | // set this webview as WindowCreated if needed 171 | WEBVIEW_MAP.with(|cell| { 172 | let webview_map = cell.borrow(); 173 | if let Some(webview) = webview_map.get(&id) { 174 | WEBVIEW_STATUS.with(|cell| { 175 | let mut status_map = cell.borrow_mut(); 176 | if let Some(status) = status_map.get_mut(&id) { 177 | match status { 178 | &mut WebViewStatus::Initialized => { 179 | *status = WebViewStatus::WindowCreated; 180 | STACK_MAP.with(|cell| { 181 | let mut stack_map = cell.borrow_mut(); 182 | if let Some(stack) = stack_map.get_mut(&id) { 183 | stack.push(Event::WindowCreated); 184 | } else { 185 | panic!( 186 | "Could not find stack with id {} to push onto stack", 187 | id 188 | ); 189 | } 190 | }); 191 | } 192 | _ => {} 193 | }; 194 | } 195 | }); 196 | }; 197 | }); 198 | } 199 | 200 | #[cfg(not(target_os = "linux"))] 201 | EVENT_LOOP.with(|cell| { 202 | let event_loop = &mut *cell.borrow_mut(); 203 | event_loop.run_return(|event, _, control_flow| { 204 | *control_flow = ControlFlow::Exit; 205 | 206 | WEBVIEW_MAP.with(|cell| { 207 | let webview_map = cell.borrow(); 208 | 209 | if let Some(webview) = webview_map.get(&id) { 210 | match event { 211 | winit::event::Event::WindowEvent { 212 | event: winit::event::WindowEvent::CloseRequested, 213 | .. 214 | } => { 215 | should_stop_loop = true; 216 | } 217 | winit::event::Event::WindowEvent { 218 | event: winit::event::WindowEvent::Resized(_), 219 | .. 220 | } => { 221 | webview.resize().unwrap(); 222 | } 223 | winit::event::Event::MainEventsCleared => { 224 | webview.window().request_redraw(); 225 | } 226 | winit::event::Event::RedrawRequested(_) => {} 227 | _ => (), 228 | }; 229 | 230 | // set this webview as WindowCreated if needed 231 | WEBVIEW_STATUS.with(|cell| { 232 | let mut status_map = cell.borrow_mut(); 233 | if let Some(status) = status_map.get_mut(&id) { 234 | match status { 235 | &mut WebViewStatus::Initialized => { 236 | *status = WebViewStatus::WindowCreated; 237 | STACK_MAP.with(|cell| { 238 | 239 | let mut stack_map = cell.borrow_mut(); 240 | if let Some(stack) = stack_map.get_mut(&id) { 241 | stack.push(Event::WindowCreated); 242 | } else { 243 | panic!("Could not find stack with id {} to push onto stack", id); 244 | } 245 | }); 246 | } 247 | _ => {} 248 | }; 249 | } 250 | }); 251 | } 252 | }); 253 | 254 | // add our event inside our stack to be pulled by the next step 255 | STACK_MAP.with(|cell| { 256 | let mut stack_map = cell.borrow_mut(); 257 | if let Some(stack) = stack_map.get_mut(&id) { 258 | let wry_event = Event::from(event); 259 | match wry_event { 260 | Event::Undefined => {} 261 | _ => { 262 | stack.push(wry_event); 263 | } 264 | }; 265 | } else { 266 | panic!("Could not find stack with id {} to push onto stack", id); 267 | } 268 | }); 269 | }); 270 | }); 271 | 272 | Ok(json!(should_stop_loop)) 273 | } 274 | 275 | #[json_op] 276 | fn wry_step(json: Value, _zero_copy: &mut [ZeroCopyBuf]) -> Result { 277 | let id = json["id"].as_u64().unwrap(); 278 | STACK_MAP.with(|cell| { 279 | let mut stack_map = cell.borrow_mut(); 280 | if let Some(stack) = stack_map.get_mut(&id) { 281 | let ret = stack.clone(); 282 | stack.clear(); 283 | Ok(json!(ret)) 284 | } else { 285 | Err(anyhow!("Could not find stack with id: {}", id)) 286 | } 287 | }) 288 | } 289 | 290 | #[cfg(not(target_os = "linux"))] 291 | #[json_op] 292 | fn wry_set_minimized(json: Value, _zero_copy: &mut [ZeroCopyBuf]) -> Result { 293 | let minimized = json["minimized"].as_bool().unwrap(); 294 | let id = json["id"].as_u64().unwrap(); 295 | WEBVIEW_MAP.with(|cell| { 296 | let webview_map = cell.borrow(); 297 | 298 | if let Some(webview) = webview_map.get(&id) { 299 | webview.window().set_minimized(minimized); 300 | Ok(json!(true)) 301 | } else { 302 | Err(anyhow!("Could not find stack with id: {}", id)) 303 | } 304 | }) 305 | } 306 | 307 | #[cfg(not(target_os = "linux"))] 308 | #[json_op] 309 | fn wry_set_maximized(json: Value, _zero_copy: &mut [ZeroCopyBuf]) -> Result { 310 | let maximized = json["maximized"].as_bool().unwrap(); 311 | let id = json["id"].as_u64().unwrap(); 312 | WEBVIEW_MAP.with(|cell| { 313 | let webview_map = cell.borrow(); 314 | 315 | if let Some(webview) = webview_map.get(&id) { 316 | webview.window().set_maximized(maximized); 317 | Ok(json!(true)) 318 | } else { 319 | Err(anyhow!("Could not find stack with id: {}", id)) 320 | } 321 | }) 322 | } 323 | 324 | #[cfg(not(target_os = "linux"))] 325 | #[json_op] 326 | fn wry_set_inner_size(json: Value, _zero_copy: &mut [ZeroCopyBuf]) -> Result { 327 | let size: Size = SizeDef::deserialize(json["size"].to_owned()).unwrap(); 328 | let id = json["id"].as_u64().unwrap(); 329 | WEBVIEW_MAP.with(|cell| { 330 | let webview_map = cell.borrow(); 331 | 332 | if let Some(webview) = webview_map.get(&id) { 333 | webview.window().set_inner_size(size); 334 | Ok(json!(true)) 335 | } else { 336 | Err(anyhow!("Could not find stack with id: {}", id)) 337 | } 338 | }) 339 | } 340 | 341 | #[cfg(not(target_os = "linux"))] 342 | #[json_op] 343 | fn wry_set_visible(json: Value, _zero_copy: &mut [ZeroCopyBuf]) -> Result { 344 | let visible = json["visible"].as_bool().unwrap(); 345 | let id = json["id"].as_u64().unwrap(); 346 | WEBVIEW_MAP.with(|cell| { 347 | let webview_map = cell.borrow(); 348 | 349 | if let Some(webview) = webview_map.get(&id) { 350 | webview.window().set_visible(visible); 351 | Ok(json!(true)) 352 | } else { 353 | Err(anyhow!("Could not find stack with id: {}", id)) 354 | } 355 | }) 356 | } 357 | -------------------------------------------------------------------------------- /src/scripts/dom_loader.js: -------------------------------------------------------------------------------- 1 | function ____rpcDomContentLoaded() { 2 | rpc.call("domContentLoaded", null); 3 | }; 4 | 5 | window.addEventListener("DOMContentLoaded", function () { ____rpcDomContentLoaded(); }); -------------------------------------------------------------------------------- /src/scripts/webview.js: -------------------------------------------------------------------------------- 1 | class Webview { 2 | constructor(url) { 3 | this.id = Deno.core.jsonOpSync('wry_new', { url }); 4 | } 5 | 6 | loop() { 7 | return Deno.core.jsonOpSync('wry_loop', { id: this.id }) === false; 8 | } 9 | 10 | step() { 11 | return Deno.core.jsonOpSync('wry_step', { id: this.id }); 12 | } 13 | 14 | run( 15 | callback, 16 | delta = 1000/30, 17 | ) { 18 | return new Promise((resolve) => { 19 | const interval = setInterval(() => { 20 | const success = this.loop(); 21 | 22 | if (callback !== undefined) { 23 | const events = this.step(); 24 | 25 | for (const event of events) { 26 | callback(event); 27 | } 28 | } 29 | 30 | if (!success) { 31 | resolve(); 32 | clearInterval(interval); 33 | } 34 | }, delta); 35 | }); 36 | } 37 | } -------------------------------------------------------------------------------- /wry.ts: -------------------------------------------------------------------------------- 1 | import { sync, unwrap } from "./plugin.ts"; 2 | 3 | type Event = { 4 | event: string 5 | } 6 | 7 | export type Size = { physical: PhysicalSize } | { logical: LogicalSize }; 8 | export type PhysicalSize = { width: number; height: number }; 9 | export type LogicalSize = { width: number; height: number }; 10 | 11 | export class Wry { 12 | readonly id: bigint; 13 | 14 | constructor(url: string) { 15 | this.id = unwrap(sync("wry_new", { url })); 16 | } 17 | 18 | set_minimized(minimized: boolean): boolean { 19 | return unwrap(sync("wry_set_minimized", { id: this.id, minimized })); 20 | } 21 | 22 | set_maximized(maximized: boolean): boolean { 23 | return unwrap(sync("wry_set_maximized", { id: this.id, maximized })); 24 | } 25 | 26 | set_visible(visible: boolean): boolean { 27 | return unwrap(sync("wry_set_visible", { id: this.id, visible })); 28 | } 29 | 30 | set_inner_size(size: Size): void { 31 | unwrap(sync("wry_set_inner_size", { id: this.id, size })); 32 | } 33 | 34 | loop(): boolean { 35 | return unwrap(sync("wry_loop", { id: this.id })) === false; 36 | } 37 | 38 | step(): Event[] { 39 | return unwrap(sync("wry_step", { id: this.id })); 40 | } 41 | 42 | run( 43 | callback?: (events: Event) => void, 44 | delta = 1, 45 | ): Promise { 46 | return new Promise((resolve) => { 47 | const interval = setInterval(() => { 48 | const success = this.loop(); 49 | 50 | if (callback !== undefined) { 51 | const events = this.step(); 52 | 53 | for (const event of events) { 54 | callback(event); 55 | } 56 | } 57 | 58 | if (!success) { 59 | resolve(); 60 | clearInterval(interval); 61 | } 62 | }, delta); 63 | }); 64 | } 65 | } 66 | --------------------------------------------------------------------------------