Vendor dependencies for 0.3.0 release

This commit is contained in:
2025-09-27 10:29:08 -05:00
parent 0c8d39d483
commit 82ab7f317b
26803 changed files with 16134934 additions and 0 deletions

1
vendor/accesskit/.cargo-checksum.json vendored Normal file
View File

@@ -0,0 +1 @@
{"files":{"CHANGELOG.md":"0610bcadd91949bcc2dbd8cad91b64e70ac51232e22b14d82e3d5bc06c0ae4fe","Cargo.lock":"33801abd7926c32c171e6859bdb01d452c1370564b206d7b4061b2fefafc2c5b","Cargo.toml":"824ab03b2dd1596e36441bcdc067845f2643aa11488cb3582e8bf9160c7c6f71","README.md":"b2bb57a4bb7554d7ec0ce918ba31460d4add9f8a81ac502bc96d7b078297c3a1","src/geometry.rs":"2f2c37da6a856f1463c593bd2c01d07f237951556c3f72594cb05a2561afa7ed","src/lib.rs":"ac9f010278a4b8520093ef535cb738714c8521910b421fdefaeb4a9b67d2b186"},"package":"becf0eb5215b6ecb0a739c31c21bd83c4f326524c9b46b7e882d77559b60a529"}

372
vendor/accesskit/CHANGELOG.md vendored Normal file
View File

@@ -0,0 +1,372 @@
# Changelog
## [0.18.0](https://github.com/AccessKit/accesskit/compare/accesskit-v0.17.1...accesskit-v0.18.0) (2025-03-06)
### ⚠ BREAKING CHANGES
* Drop `Tree::app_name` ([#492](https://github.com/AccessKit/accesskit/issues/492))
### Features
* Android adapter ([#500](https://github.com/AccessKit/accesskit/issues/500)) ([7e65ac7](https://github.com/AccessKit/accesskit/commit/7e65ac77d7e108ac5b9f3722f488a2fdf2e3b3e0))
### Bug Fixes
* Update pyo3 to 0.23 ([#512](https://github.com/AccessKit/accesskit/issues/512)) ([93d3a27](https://github.com/AccessKit/accesskit/commit/93d3a27ac4af60eef4a1faf26392a6f7ff69cf81))
### Code Refactoring
* Drop `Tree::app_name` ([#492](https://github.com/AccessKit/accesskit/issues/492)) ([089794c](https://github.com/AccessKit/accesskit/commit/089794c8f74957e91a19ae3df508e2a892f39ebc))
## [0.17.1](https://github.com/AccessKit/accesskit/compare/accesskit-v0.17.0...accesskit-v0.17.1) (2024-11-23)
### Bug Fixes
* Fix some broken links in the documentation ([#484](https://github.com/AccessKit/accesskit/issues/484)) ([0a51225](https://github.com/AccessKit/accesskit/commit/0a5122561c6f6aca5cf802464220056d763040f8))
## [0.17.0](https://github.com/AccessKit/accesskit/compare/accesskit-v0.16.3...accesskit-v0.17.0) (2024-10-31)
### ⚠ BREAKING CHANGES
* Drop the `is_hovered` property ([#479](https://github.com/AccessKit/accesskit/issues/479))
* Rename `name` to `label` and use `value` for label content ([#475](https://github.com/AccessKit/accesskit/issues/475))
* Rename `NodeBuilder` to `Node` and the old `Node` to `FrozenNode` ([#476](https://github.com/AccessKit/accesskit/issues/476))
* Rename `Role::InlineTextBox` to `TextRun` ([#473](https://github.com/AccessKit/accesskit/issues/473))
* Drop `DefaultActionVerb` ([#472](https://github.com/AccessKit/accesskit/issues/472))
* Make the core crate no-std ([#468](https://github.com/AccessKit/accesskit/issues/468))
### Features
* Make the core crate no-std ([#468](https://github.com/AccessKit/accesskit/issues/468)) ([2fa0d3f](https://github.com/AccessKit/accesskit/commit/2fa0d3f5b2b7ac11ef1751c133706f29e548bd6d))
### Bug Fixes
* Drop the `is_hovered` property ([#479](https://github.com/AccessKit/accesskit/issues/479)) ([95dfdb6](https://github.com/AccessKit/accesskit/commit/95dfdb6c88f7d705f6a7283cb8524168a9f542b2))
### Code Refactoring
* Drop `DefaultActionVerb` ([#472](https://github.com/AccessKit/accesskit/issues/472)) ([ef3b003](https://github.com/AccessKit/accesskit/commit/ef3b0038224459094f650368412650bc3b69526b))
* Rename `name` to `label` and use `value` for label content ([#475](https://github.com/AccessKit/accesskit/issues/475)) ([e0053a5](https://github.com/AccessKit/accesskit/commit/e0053a5399929e8e0d4f07aa18de604ed8766ace))
* Rename `NodeBuilder` to `Node` and the old `Node` to `FrozenNode` ([#476](https://github.com/AccessKit/accesskit/issues/476)) ([7d8910e](https://github.com/AccessKit/accesskit/commit/7d8910e35f7bc0543724cc124941a3bd0304bcc0))
* Rename `Role::InlineTextBox` to `TextRun` ([#473](https://github.com/AccessKit/accesskit/issues/473)) ([29fa341](https://github.com/AccessKit/accesskit/commit/29fa34125a811bd3a0f9da579a9f35c9da90bf29))
## [0.16.3](https://github.com/AccessKit/accesskit/compare/accesskit-v0.16.2...accesskit-v0.16.3) (2024-10-08)
### Bug Fixes
* Eliminate duplicate definitions ([#461](https://github.com/AccessKit/accesskit/issues/461)) ([59826d4](https://github.com/AccessKit/accesskit/commit/59826d4500ddfe880181f7087f9fe83ff2209fc4))
## [0.16.2](https://github.com/AccessKit/accesskit/compare/accesskit-v0.16.1...accesskit-v0.16.2) (2024-10-07)
### Bug Fixes
* Don't use a macro to generate Action debug helper function ([#459](https://github.com/AccessKit/accesskit/issues/459)) ([ed1fb73](https://github.com/AccessKit/accesskit/commit/ed1fb7370780c9dd15028cdfd13e2065642bf490))
* Update minimum supported Rust version to 1.75 ([#457](https://github.com/AccessKit/accesskit/issues/457)) ([fc622fe](https://github.com/AccessKit/accesskit/commit/fc622fe7657c80a4eedad6f6cded11d2538b54d5))
## [0.16.1](https://github.com/AccessKit/accesskit/compare/accesskit-v0.16.0...accesskit-v0.16.1) (2024-09-24)
### Bug Fixes
* Improve debug representation of `Node` and `NodeBuilder` ([#452](https://github.com/AccessKit/accesskit/issues/452)) ([119aa1d](https://github.com/AccessKit/accesskit/commit/119aa1dca8fe734112ecbd59568c876b336ccb6c))
## [0.16.0](https://github.com/AccessKit/accesskit/compare/accesskit-v0.15.0...accesskit-v0.16.0) (2024-06-29)
### ⚠ BREAKING CHANGES
* Optimize serialization and make it compatible with more data formats ([#437](https://github.com/AccessKit/accesskit/issues/437))
* Rename the `StaticText` role to `Label` ([#434](https://github.com/AccessKit/accesskit/issues/434))
### Code Refactoring
* Optimize serialization and make it compatible with more data formats ([#437](https://github.com/AccessKit/accesskit/issues/437)) ([5a80d3a](https://github.com/AccessKit/accesskit/commit/5a80d3ae46cfe85780d4900f4fa9f4feaba52053))
* Rename the `StaticText` role to `Label` ([#434](https://github.com/AccessKit/accesskit/issues/434)) ([7086bc0](https://github.com/AccessKit/accesskit/commit/7086bc0fad446d3ed4a0fd5eff641a1e75f6c599))
## [0.15.0](https://github.com/AccessKit/accesskit/compare/accesskit-v0.14.0...accesskit-v0.15.0) (2024-06-09)
### Features
* Add `author_id` property ([#424](https://github.com/AccessKit/accesskit/issues/424)) ([0d1c56f](https://github.com/AccessKit/accesskit/commit/0d1c56f0bdde58715e1c69f6015df600cb7cb8c1))
### Bug Fixes
* Add explicit cargo features for `enumn` and `pyo3` ([#425](https://github.com/AccessKit/accesskit/issues/425)) ([71ad45b](https://github.com/AccessKit/accesskit/commit/71ad45be1651409ee6918cf835b656e6b5e0fe2d))
## [0.14.0](https://github.com/AccessKit/accesskit/compare/accesskit-v0.13.0...accesskit-v0.14.0) (2024-04-30)
### ⚠ BREAKING CHANGES
* Clean up table roles and properties ([#393](https://github.com/AccessKit/accesskit/issues/393))
* Drop `SortDirection::Unsorted` ([#391](https://github.com/AccessKit/accesskit/issues/391))
* Rename `hierarchical_level` to `level` ([#390](https://github.com/AccessKit/accesskit/issues/390))
* Drop `NodeClassSet` ([#389](https://github.com/AccessKit/accesskit/issues/389))
* Rename `Checked` to `Toggled`; drop `ToggleButton` role ([#388](https://github.com/AccessKit/accesskit/issues/388))
### Features
* Add the `owns` relation ([#392](https://github.com/AccessKit/accesskit/issues/392)) ([fd668dd](https://github.com/AccessKit/accesskit/commit/fd668ddc4b64cb05ab3600972b3d3823a037f2d5))
### Bug Fixes
* Increase minimum supported Rust version to `1.70` ([#396](https://github.com/AccessKit/accesskit/issues/396)) ([a8398b8](https://github.com/AccessKit/accesskit/commit/a8398b847aa003de91042ac45e33126fc2cae053))
### Code Refactoring
* Clean up table roles and properties ([#393](https://github.com/AccessKit/accesskit/issues/393)) ([e34dad9](https://github.com/AccessKit/accesskit/commit/e34dad94448a5321ece9def3f2e054aa5f62dd79))
* Drop `NodeClassSet` ([#389](https://github.com/AccessKit/accesskit/issues/389)) ([1b153ed](https://github.com/AccessKit/accesskit/commit/1b153ed51f8421cdba2dc98beca2e8f5f8c781bc))
* Drop `SortDirection::Unsorted` ([#391](https://github.com/AccessKit/accesskit/issues/391)) ([b86f484](https://github.com/AccessKit/accesskit/commit/b86f484b7e6645e63362896b744a71ec758f810d))
* Rename `Checked` to `Toggled`; drop `ToggleButton` role ([#388](https://github.com/AccessKit/accesskit/issues/388)) ([6bc040b](https://github.com/AccessKit/accesskit/commit/6bc040b7cf75cdbd6a019cc380d8dbce804b3c81))
* Rename `hierarchical_level` to `level` ([#390](https://github.com/AccessKit/accesskit/issues/390)) ([2d61e01](https://github.com/AccessKit/accesskit/commit/2d61e01fffff1265b348c141715f6f9b6fe4081b))
## [0.13.0](https://github.com/AccessKit/accesskit/compare/accesskit-v0.12.3...accesskit-v0.13.0) (2024-04-14)
### ⚠ BREAKING CHANGES
* New approach to lazy initialization ([#375](https://github.com/AccessKit/accesskit/issues/375))
### Code Refactoring
* New approach to lazy initialization ([#375](https://github.com/AccessKit/accesskit/issues/375)) ([9baebdc](https://github.com/AccessKit/accesskit/commit/9baebdceed7300389b6768815d7ae48f1ce401e4))
## [0.12.3](https://github.com/AccessKit/accesskit/compare/accesskit-v0.12.2...accesskit-v0.12.3) (2024-03-07)
### Bug Fixes
* Derive `PartialOrd` and `Ord` on `NodeId` ([#363](https://github.com/AccessKit/accesskit/issues/363)) ([ce3bba1](https://github.com/AccessKit/accesskit/commit/ce3bba1e043d650c406d8814b4f33e9104199c8b))
* Make `NodeClassSet::new` const ([#368](https://github.com/AccessKit/accesskit/issues/368)) ([11d2968](https://github.com/AccessKit/accesskit/commit/11d2968464d50c3e3f55e9a872d0d454c19e7e51))
## [0.12.2](https://github.com/AccessKit/accesskit/compare/accesskit-v0.12.1...accesskit-v0.12.2) (2024-01-03)
### Bug Fixes
* Bump pyo3; add `rename_all` attribute to enums ([#330](https://github.com/AccessKit/accesskit/issues/330)) ([5a4c6f3](https://github.com/AccessKit/accesskit/commit/5a4c6f399837d67b066451a8fb4d43d03c8acb8b))
* Document the `role_description` node property ([#331](https://github.com/AccessKit/accesskit/issues/331)) ([936fa2c](https://github.com/AccessKit/accesskit/commit/936fa2c23190c5d7cd4eb880612295785a009721))
## [0.12.1](https://github.com/AccessKit/accesskit/compare/accesskit-v0.12.0...accesskit-v0.12.1) (2023-11-04)
### Bug Fixes
* Add missing semicolons when not returning anything ([#303](https://github.com/AccessKit/accesskit/issues/303)) ([38d4de1](https://github.com/AccessKit/accesskit/commit/38d4de1442247e701047d75122a9638a2ed99b1f))
## [0.12.0](https://github.com/AccessKit/accesskit/compare/accesskit-v0.11.2...accesskit-v0.12.0) (2023-09-27)
### ⚠ BREAKING CHANGES
* Allow providing app_name, toolkit_name and toolkit_version in Tree, remove parameters from unix adapter constructor ([#291](https://github.com/AccessKit/accesskit/issues/291))
* Make `ActionHandler::do_action` take `&mut self` ([#296](https://github.com/AccessKit/accesskit/issues/296))
* Clean up roles and properties ([#289](https://github.com/AccessKit/accesskit/issues/289))
* Drop next/previous focus properties ([#288](https://github.com/AccessKit/accesskit/issues/288))
* Drop `Tree::root_scroller` ([#279](https://github.com/AccessKit/accesskit/issues/279))
* Decouple in-tree focus from host window/view focus ([#278](https://github.com/AccessKit/accesskit/issues/278))
* Switch to simple unsigned 64-bit integer for node IDs ([#276](https://github.com/AccessKit/accesskit/issues/276))
### Features
* Add role for terminals ([#282](https://github.com/AccessKit/accesskit/issues/282)) ([ddbef37](https://github.com/AccessKit/accesskit/commit/ddbef37158b57f56217317b480e40d58f83a9c24))
* Allow providing app_name, toolkit_name and toolkit_version in Tree, remove parameters from unix adapter constructor ([#291](https://github.com/AccessKit/accesskit/issues/291)) ([5313860](https://github.com/AccessKit/accesskit/commit/531386023257150f49b5e4be942f359855fb7cb6))
### Bug Fixes
* Drop `Tree::root_scroller` ([#279](https://github.com/AccessKit/accesskit/issues/279)) ([fc6c4e0](https://github.com/AccessKit/accesskit/commit/fc6c4e0091d5b257a3869a468fca144a1453cebc))
* Drop next/previous focus properties ([#288](https://github.com/AccessKit/accesskit/issues/288)) ([d35c7c1](https://github.com/AccessKit/accesskit/commit/d35c7c149a650dfedf1b031c0668adad585659fa))
* Support the pyo3 crate in all public enums ([#270](https://github.com/AccessKit/accesskit/issues/270)) ([9b12d0c](https://github.com/AccessKit/accesskit/commit/9b12d0c3d828d4c847510b611d891872c4666984))
### Code Refactoring
* Clean up roles and properties ([#289](https://github.com/AccessKit/accesskit/issues/289)) ([4fc9c55](https://github.com/AccessKit/accesskit/commit/4fc9c55c91812472593923d93ff89d75ff305ee4))
* Decouple in-tree focus from host window/view focus ([#278](https://github.com/AccessKit/accesskit/issues/278)) ([d360d20](https://github.com/AccessKit/accesskit/commit/d360d20cf951e7643b81a5303006c9f7daa5bd56))
* Make `ActionHandler::do_action` take `&mut self` ([#296](https://github.com/AccessKit/accesskit/issues/296)) ([4fc7846](https://github.com/AccessKit/accesskit/commit/4fc7846d732d61fb45c023060ebab96801a0053e))
* Switch to simple unsigned 64-bit integer for node IDs ([#276](https://github.com/AccessKit/accesskit/issues/276)) ([3eadd48](https://github.com/AccessKit/accesskit/commit/3eadd48ec47854faa94a94ebf910ec08f514642f))
## [0.11.2](https://github.com/AccessKit/accesskit/compare/accesskit-v0.11.1...accesskit-v0.11.2) (2023-08-08)
### Bug Fixes
* Support the enumn crate in all public enums ([#264](https://github.com/AccessKit/accesskit/issues/264)) ([b9b3cd1](https://github.com/AccessKit/accesskit/commit/b9b3cd18fccdd6526fb4f58c13eb91599452a3d6))
## [0.11.1](https://github.com/AccessKit/accesskit/compare/accesskit-v0.11.0...accesskit-v0.11.1) (2023-07-30)
### Bug Fixes
* Fix broken intra-doc-link. ([#262](https://github.com/AccessKit/accesskit/issues/262)) ([63c1715](https://github.com/AccessKit/accesskit/commit/63c17152d1eb8ae6ff19c2bc4a6756372bc490c2))
## [0.11.0](https://github.com/AccessKit/accesskit/compare/accesskit-v0.10.1...accesskit-v0.11.0) (2023-03-29)
### Features
* Add C bindings ([#230](https://github.com/AccessKit/accesskit/issues/230)) ([7f7f4c7](https://github.com/AccessKit/accesskit/commit/7f7f4c755890ab8210a5a8bf8e237ba6a51dd205))
## [0.10.1](https://github.com/AccessKit/accesskit/compare/accesskit-v0.10.0...accesskit-v0.10.1) (2023-02-20)
### Bug Fixes
* Set appropriate representations on all public types that will be exposed via FFI ([54e82f6](https://github.com/AccessKit/accesskit/commit/54e82f673f5c7b46d9077fe5f946305800862bf0))
## [0.10.0](https://github.com/AccessKit/accesskit/compare/accesskit-v0.9.0...accesskit-v0.10.0) (2023-02-12)
### ⚠ BREAKING CHANGES
* Move thread synchronization into platform adapters; drop parking_lot ([#212](https://github.com/AccessKit/accesskit/issues/212))
### Code Refactoring
* Move thread synchronization into platform adapters; drop parking_lot ([#212](https://github.com/AccessKit/accesskit/issues/212)) ([5df52e5](https://github.com/AccessKit/accesskit/commit/5df52e5545faddf6a51905409013c2f5be23981e))
## [0.9.0](https://github.com/AccessKit/accesskit/compare/accesskit-v0.8.1...accesskit-v0.9.0) (2023-02-05)
### ⚠ BREAKING CHANGES
* Make `Node` opaque and optimize it for size ([#205](https://github.com/AccessKit/accesskit/issues/205))
### Code Refactoring
* Make `Node` opaque and optimize it for size ([#205](https://github.com/AccessKit/accesskit/issues/205)) ([4811152](https://github.com/AccessKit/accesskit/commit/48111521439b76c1a8687418a4b20f9b705eac6d))
## [0.8.1](https://github.com/AccessKit/accesskit/compare/accesskit-v0.8.0...accesskit-v0.8.1) (2022-12-04)
### Documentation
* Fix outdated documentation for `TreeUpdate` ([#182](https://github.com/AccessKit/accesskit/issues/182)) ([dd658c7](https://github.com/AccessKit/accesskit/commit/dd658c70df55b2234a0346220362b0b9a40bb41d))
## [0.8.0](https://www.github.com/AccessKit/accesskit/compare/accesskit-v0.7.0...accesskit-v0.8.0) (2022-11-17)
### ⚠ BREAKING CHANGES
* Be opinionated about coordinates after all (#151)
### Code Refactoring
* Be opinionated about coordinates after all ([#151](https://www.github.com/AccessKit/accesskit/issues/151)) ([91a29a1](https://www.github.com/AccessKit/accesskit/commit/91a29a1bf99bca39e9a00a744025533924e45190))
## [0.7.0](https://www.github.com/AccessKit/accesskit/compare/accesskit-v0.6.1...accesskit-v0.7.0) (2022-11-11)
### ⚠ BREAKING CHANGES
* Text range support (#145)
* Drop the `ignored` field and implement generic filtered tree traversal (#143)
### Features
* Text range support ([#145](https://www.github.com/AccessKit/accesskit/issues/145)) ([455e6f7](https://www.github.com/AccessKit/accesskit/commit/455e6f73bc058644d299c06eeeda9cc4cbe8844f))
### Code Refactoring
* Drop the `ignored` field and implement generic filtered tree traversal ([#143](https://www.github.com/AccessKit/accesskit/issues/143)) ([a4befe6](https://www.github.com/AccessKit/accesskit/commit/a4befe6e8a5afbe4a52dfd09eb87fdf2078d6c1d))
### [0.6.1](https://www.github.com/AccessKit/accesskit/compare/accesskit-v0.6.0...accesskit-v0.6.1) (2022-10-10)
### Bug Fixes
* **common:** Restore compatibility with Rust 1.61 ([#139](https://www.github.com/AccessKit/accesskit/issues/139)) ([d8c6b16](https://www.github.com/AccessKit/accesskit/commit/d8c6b166c83796bfd6d748df60136029a9ec81d2))
## [0.6.0](https://www.github.com/AccessKit/accesskit/compare/accesskit-v0.5.1...accesskit-v0.6.0) (2022-10-09)
### ⚠ BREAKING CHANGES
* Wrap `TreeUpdate` nodes in `Arc` (#135)
* Store node ID in `TreeUpdate`, not `accesskit::Node` (#132)
### Bug Fixes
* Don't try to optimize tree updates with unchanged nodes ([#138](https://www.github.com/AccessKit/accesskit/issues/138)) ([7721719](https://www.github.com/AccessKit/accesskit/commit/7721719fb0ab90bf41cc30dd0469c7de90228fe9))
### Code Refactoring
* Store node ID in `TreeUpdate`, not `accesskit::Node` ([#132](https://www.github.com/AccessKit/accesskit/issues/132)) ([0bb86dd](https://www.github.com/AccessKit/accesskit/commit/0bb86ddb298cb5a253a91f07be0bad8b84b2fda3))
* Wrap `TreeUpdate` nodes in `Arc` ([#135](https://www.github.com/AccessKit/accesskit/issues/135)) ([907bc18](https://www.github.com/AccessKit/accesskit/commit/907bc1820b80d95833b6c5c3acaa2a8a4e93a6c2))
### [0.5.1](https://www.github.com/AccessKit/accesskit/compare/accesskit-v0.5.0...accesskit-v0.5.1) (2022-10-03)
### Bug Fixes
* **common:** Write a README specifically for the accesskit crate ([#130](https://www.github.com/AccessKit/accesskit/issues/130)) ([0c2f5cf](https://www.github.com/AccessKit/accesskit/commit/0c2f5cf71bdacf3142bff77defea36eeb2b4e1e9)), closes [#129](https://www.github.com/AccessKit/accesskit/issues/129)
## [0.5.0](https://www.github.com/AccessKit/accesskit/compare/accesskit-v0.4.0...accesskit-v0.5.0) (2022-09-23)
### ⚠ BREAKING CHANGES
* Basic live regions (#128)
### Features
* Basic live regions ([#128](https://www.github.com/AccessKit/accesskit/issues/128)) ([03d745b](https://www.github.com/AccessKit/accesskit/commit/03d745b891147175bde2693cc10b96a2f6e31f39))
### Bug Fixes
* **common:** Enable the serde feature when the schemars feature is turned on ([#122](https://www.github.com/AccessKit/accesskit/issues/122)) ([126b6e1](https://www.github.com/AccessKit/accesskit/commit/126b6e13294bee2b4c905a78147b49d763a61d05))
* **common:** Skip `ActionRequest::data` if it is `None` during serialization ([#123](https://www.github.com/AccessKit/accesskit/issues/123)) ([2d88ea8](https://www.github.com/AccessKit/accesskit/commit/2d88ea8518c99692beacfb955ef0bd4f388a4908))
## [0.4.0](https://www.github.com/AccessKit/accesskit/compare/accesskit-v0.3.0...accesskit-v0.4.0) (2022-07-22)
### ⚠ BREAKING CHANGES
* String indices are always in UTF-8 code units (#114)
* Drop unused tree IDs (#113)
* Switch to NonZeroU128 for NodeIDs (#99)
### Features
* **common:** Conversion from `NonZeroU64` to `NodeId` ([#112](https://www.github.com/AccessKit/accesskit/issues/112)) ([b7adfb9](https://www.github.com/AccessKit/accesskit/commit/b7adfb906cb09107be71a148b5199ba87df2a6b3))
### Bug Fixes
* **common:** Various documentation fixes and improvements ([#111](https://www.github.com/AccessKit/accesskit/issues/111)) ([4d27234](https://www.github.com/AccessKit/accesskit/commit/4d27234195e96de65bf55869877405cb5e45f6fc))
* Migrate to 2021 edition ([#115](https://www.github.com/AccessKit/accesskit/issues/115)) ([f2333c8](https://www.github.com/AccessKit/accesskit/commit/f2333c8ce17d46aab6fc190338ab4cfcf8569f9e))
* Switch to NonZeroU128 for NodeIDs ([#99](https://www.github.com/AccessKit/accesskit/issues/99)) ([25a1a52](https://www.github.com/AccessKit/accesskit/commit/25a1a52c4562b163bfcc8c625a233c00a41aacf2))
### Code Refactoring
* Drop unused tree IDs ([#113](https://www.github.com/AccessKit/accesskit/issues/113)) ([ca60770](https://www.github.com/AccessKit/accesskit/commit/ca607702cee13c93fe538d2faec88e474261f7ab))
* String indices are always in UTF-8 code units ([#114](https://www.github.com/AccessKit/accesskit/issues/114)) ([386ca0a](https://www.github.com/AccessKit/accesskit/commit/386ca0a89c42fd201843f617b2fd6b6d1de77f59))
## [0.3.0](https://www.github.com/AccessKit/accesskit/compare/accesskit-v0.2.0...accesskit-v0.3.0) (2021-12-29)
### ⚠ BREAKING CHANGES
* Drop `TreeUpdate::clear` (#96)
### Code Refactoring
* Drop `TreeUpdate::clear` ([#96](https://www.github.com/AccessKit/accesskit/issues/96)) ([38f520b](https://www.github.com/AccessKit/accesskit/commit/38f520b960c6db7b3927b369aee206ee6bc5e8aa))

269
vendor/accesskit/Cargo.lock generated vendored Normal file
View File

@@ -0,0 +1,269 @@
# This file is automatically @generated by Cargo.
# It is not intended for manual editing.
version = 3
[[package]]
name = "accesskit"
version = "0.18.0"
dependencies = [
"enumn",
"pyo3",
"schemars",
"serde",
]
[[package]]
name = "autocfg"
version = "1.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa"
[[package]]
name = "cfg-if"
version = "1.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"
[[package]]
name = "dyn-clone"
version = "1.0.11"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "68b0cf012f1230e43cd00ebb729c6bb58707ecfa8ad08b52ef3a4ccd2697fc30"
[[package]]
name = "enumn"
version = "0.1.14"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2f9ed6b3789237c8a0c1c505af1c7eb2c560df6186f01b098c3a1064ea532f38"
dependencies = [
"proc-macro2",
"quote",
"syn",
]
[[package]]
name = "heck"
version = "0.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea"
[[package]]
name = "indoc"
version = "2.0.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1e186cfbae8084e513daff4240b4797e342f988cecda4fb6c939150f96315fd8"
[[package]]
name = "itoa"
version = "1.0.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "453ad9f582a441959e5f0d088b02ce04cfe8d51a8eaf077f12ac6d3e94164ca6"
[[package]]
name = "libc"
version = "0.2.169"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b5aba8db14291edd000dfcc4d620c7ebfb122c613afb886ca8803fa4e128a20a"
[[package]]
name = "memoffset"
version = "0.9.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5a634b1c61a95585bd15607c6ab0c4e5b226e695ff2800ba0cdccddf208c406c"
dependencies = [
"autocfg",
]
[[package]]
name = "once_cell"
version = "1.19.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92"
[[package]]
name = "portable-atomic"
version = "1.9.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cc9c68a3f6da06753e9335d63e27f6b9754dd1920d941135b7ea8224f141adb2"
[[package]]
name = "proc-macro2"
version = "1.0.87"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b3e4daa0dcf6feba26f985457cdf104d4b4256fc5a09547140f3631bb076b19a"
dependencies = [
"unicode-ident",
]
[[package]]
name = "pyo3"
version = "0.23.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "57fe09249128b3173d092de9523eaa75136bf7ba85e0d69eca241c7939c933cc"
dependencies = [
"cfg-if",
"indoc",
"libc",
"memoffset",
"once_cell",
"portable-atomic",
"pyo3-build-config",
"pyo3-ffi",
"pyo3-macros",
"unindent",
]
[[package]]
name = "pyo3-build-config"
version = "0.23.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1cd3927b5a78757a0d71aa9dff669f903b1eb64b54142a9bd9f757f8fde65fd7"
dependencies = [
"once_cell",
"target-lexicon",
]
[[package]]
name = "pyo3-ffi"
version = "0.23.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "dab6bb2102bd8f991e7749f130a70d05dd557613e39ed2deeee8e9ca0c4d548d"
dependencies = [
"libc",
"pyo3-build-config",
]
[[package]]
name = "pyo3-macros"
version = "0.23.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "91871864b353fd5ffcb3f91f2f703a22a9797c91b9ab497b1acac7b07ae509c7"
dependencies = [
"proc-macro2",
"pyo3-macros-backend",
"quote",
"syn",
]
[[package]]
name = "pyo3-macros-backend"
version = "0.23.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "43abc3b80bc20f3facd86cd3c60beed58c3e2aa26213f3cda368de39c60a27e4"
dependencies = [
"heck",
"proc-macro2",
"pyo3-build-config",
"quote",
"syn",
]
[[package]]
name = "quote"
version = "1.0.37"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b5b9d34b8991d19d98081b46eacdd8eb58c6f2b201139f7c5f643cc155a633af"
dependencies = [
"proc-macro2",
]
[[package]]
name = "ryu"
version = "1.0.13"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f91339c0467de62360649f8d3e185ca8de4224ff281f66000de5eb2a77a79041"
[[package]]
name = "schemars"
version = "0.8.21"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "09c024468a378b7e36765cd36702b7a90cc3cba11654f6685c8f233408e89e92"
dependencies = [
"dyn-clone",
"schemars_derive",
"serde",
"serde_json",
]
[[package]]
name = "schemars_derive"
version = "0.8.21"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b1eee588578aff73f856ab961cd2f79e36bc45d7ded33a7562adba4667aecc0e"
dependencies = [
"proc-macro2",
"quote",
"serde_derive_internals",
"syn",
]
[[package]]
name = "serde"
version = "1.0.210"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c8e3592472072e6e22e0a54d5904d9febf8508f65fb8552499a1abc7d1078c3a"
dependencies = [
"serde_derive",
]
[[package]]
name = "serde_derive"
version = "1.0.210"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "243902eda00fad750862fc144cea25caca5e20d615af0a81bee94ca738f1df1f"
dependencies = [
"proc-macro2",
"quote",
"syn",
]
[[package]]
name = "serde_derive_internals"
version = "0.29.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "18d26a20a969b9e3fdf2fc2d9f21eda6c40e2de84c9408bb5d3b05d499aae711"
dependencies = [
"proc-macro2",
"quote",
"syn",
]
[[package]]
name = "serde_json"
version = "1.0.94"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1c533a59c9d8a93a09c6ab31f0fd5e5f4dd1b8fc9434804029839884765d04ea"
dependencies = [
"itoa",
"ryu",
"serde",
]
[[package]]
name = "syn"
version = "2.0.79"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "89132cd0bf050864e1d38dc3bbc07a0eb8e7530af26344d3d2bbbef83499f590"
dependencies = [
"proc-macro2",
"quote",
"unicode-ident",
]
[[package]]
name = "target-lexicon"
version = "0.12.16"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "61c41af27dd6d1e27b1b16b489db798443478cef1f06a660c96db617ba5de3b1"
[[package]]
name = "unicode-ident"
version = "1.0.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e5464a87b239f13a63a501f2701565754bae92d243d4bb7eb12f6d57d2269bf4"
[[package]]
name = "unindent"
version = "0.2.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c7de7d73e1754487cb58364ee906a499937a0dfabd86bcb980fa99ec8c8fa2ce"

76
vendor/accesskit/Cargo.toml vendored Normal file
View File

@@ -0,0 +1,76 @@
# THIS FILE IS AUTOMATICALLY GENERATED BY CARGO
#
# When uploading crates to the registry Cargo will automatically
# "normalize" Cargo.toml files for maximal compatibility
# with all versions of Cargo and also rewrite `path` dependencies
# to registry (e.g., crates.io) dependencies.
#
# If you are reading this file be aware that the original Cargo.toml
# will likely look very different (and much more reasonable).
# See Cargo.toml.orig for the original contents.
[package]
edition = "2021"
rust-version = "1.77.2"
name = "accesskit"
version = "0.18.0"
authors = ["The AccessKit contributors"]
build = false
autolib = false
autobins = false
autoexamples = false
autotests = false
autobenches = false
description = "UI accessibility infrastructure across platforms"
readme = "README.md"
keywords = [
"gui",
"ui",
"accessibility",
]
categories = ["gui"]
license = "MIT OR Apache-2.0"
repository = "https://github.com/AccessKit/accesskit"
[package.metadata.docs.rs]
features = [
"schemars",
"serde",
]
[lib]
name = "accesskit"
path = "src/lib.rs"
[dependencies.enumn]
version = "0.1.6"
optional = true
[dependencies.pyo3]
version = "0.23"
optional = true
[dependencies.schemars]
version = "0.8.7"
optional = true
[dependencies.serde]
version = "1.0"
features = [
"alloc",
"derive",
]
optional = true
default-features = false
[features]
enumn = ["dep:enumn"]
pyo3 = ["dep:pyo3"]
schemars = [
"dep:schemars",
"serde",
]
serde = [
"dep:serde",
"enumn",
]

13
vendor/accesskit/README.md vendored Normal file
View File

@@ -0,0 +1,13 @@
# AccessKit
This is the shared cross-platform crate for [AccessKit](https://accesskit.dev/). It defines the data structures that represent an accessibility tree, and the trait for handling action requests from assistive technologies.
To use AccessKit in your application or toolkit, you will also need a platform adapter. The following platform adapters are currently available:
* [accesskit_windows](https://crates.io/crates/accesskit_windows): exposes an AccessKit tree on Windows using the UI Automation API
* [accesskit_macos](https://crates.io/crates/accesskit_macos): exposes an AccessKit tree on MacOS through the Cocoa `NSAccessibility` protocol
* [accesskit_unix](https://crates.io/crates/accesskit_unix): exposes an AccessKit tree on Linux and Unix systems through the AT-SPI protocol
* [accesskit_android](https://crates.io/crates/accesskit_android): exposes an AccessKit tree on Android through the Java-based Android accessibility API
* [accesskit_winit](https://crates.io/crates/accesskit_winit): wraps other platform adapters for use with the [winit](https://crates.io/crates/winit) windowing library
Some platform adapters include simple examples.

866
vendor/accesskit/src/geometry.rs vendored Normal file
View File

@@ -0,0 +1,866 @@
// Copyright 2023 The AccessKit Authors. All rights reserved.
// Licensed under the Apache License, Version 2.0 (found in
// the LICENSE-APACHE file) or the MIT license (found in
// the LICENSE-MIT file), at your option.
// Derived from kurbo.
// Copyright 2018 The kurbo Authors.
// Licensed under the Apache License, Version 2.0 (found in
// the LICENSE-APACHE file) or the MIT license (found in
// the LICENSE-MIT file), at your option.
use core::{
fmt,
ops::{Add, AddAssign, Div, DivAssign, Mul, MulAssign, Neg, Sub, SubAssign},
};
/// A 2D affine transform. Derived from [kurbo](https://github.com/linebender/kurbo).
#[derive(Clone, Copy, Debug, PartialEq)]
#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))]
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[repr(C)]
pub struct Affine([f64; 6]);
impl Affine {
/// The identity transform.
pub const IDENTITY: Affine = Affine::scale(1.0);
/// A transform that is flipped on the y-axis. Useful for converting between
/// y-up and y-down spaces.
pub const FLIP_Y: Affine = Affine::new([1.0, 0., 0., -1.0, 0., 0.]);
/// A transform that is flipped on the x-axis.
pub const FLIP_X: Affine = Affine::new([-1.0, 0., 0., 1.0, 0., 0.]);
/// Construct an affine transform from coefficients.
///
/// If the coefficients are `(a, b, c, d, e, f)`, then the resulting
/// transformation represents this augmented matrix:
///
/// ```text
/// | a c e |
/// | b d f |
/// | 0 0 1 |
/// ```
///
/// Note that this convention is transposed from PostScript and
/// Direct2D, but is consistent with the
/// [Wikipedia](https://en.wikipedia.org/wiki/Affine_transformation)
/// formulation of affine transformation as augmented matrix. The
/// idea is that `(A * B) * v == A * (B * v)`, where `*` is the
/// [`Mul`](core::ops::Mul) trait.
#[inline]
pub const fn new(c: [f64; 6]) -> Affine {
Affine(c)
}
/// An affine transform representing uniform scaling.
#[inline]
pub const fn scale(s: f64) -> Affine {
Affine([s, 0.0, 0.0, s, 0.0, 0.0])
}
/// An affine transform representing non-uniform scaling
/// with different scale values for x and y
#[inline]
pub const fn scale_non_uniform(s_x: f64, s_y: f64) -> Affine {
Affine([s_x, 0.0, 0.0, s_y, 0.0, 0.0])
}
/// An affine transform representing translation.
#[inline]
pub fn translate<V: Into<Vec2>>(p: V) -> Affine {
let p = p.into();
Affine([1.0, 0.0, 0.0, 1.0, p.x, p.y])
}
/// Creates an affine transformation that takes the unit square to the given rectangle.
///
/// Useful when you want to draw into the unit square but have your output fill any rectangle.
/// In this case push the `Affine` onto the transform stack.
pub fn map_unit_square(rect: Rect) -> Affine {
Affine([rect.width(), 0., 0., rect.height(), rect.x0, rect.y0])
}
/// Get the coefficients of the transform.
#[inline]
pub fn as_coeffs(self) -> [f64; 6] {
self.0
}
/// Compute the determinant of this transform.
pub fn determinant(self) -> f64 {
self.0[0] * self.0[3] - self.0[1] * self.0[2]
}
/// Compute the inverse transform.
///
/// Produces NaN values when the determinant is zero.
pub fn inverse(self) -> Affine {
let inv_det = self.determinant().recip();
Affine([
inv_det * self.0[3],
-inv_det * self.0[1],
-inv_det * self.0[2],
inv_det * self.0[0],
inv_det * (self.0[2] * self.0[5] - self.0[3] * self.0[4]),
inv_det * (self.0[1] * self.0[4] - self.0[0] * self.0[5]),
])
}
/// Compute the bounding box of a transformed rectangle.
///
/// Returns the minimal `Rect` that encloses the given `Rect` after affine transformation.
/// If the transform is axis-aligned, then this bounding box is "tight", in other words the
/// returned `Rect` is the transformed rectangle.
///
/// The returned rectangle always has non-negative width and height.
pub fn transform_rect_bbox(self, rect: Rect) -> Rect {
let p00 = self * Point::new(rect.x0, rect.y0);
let p01 = self * Point::new(rect.x0, rect.y1);
let p10 = self * Point::new(rect.x1, rect.y0);
let p11 = self * Point::new(rect.x1, rect.y1);
Rect::from_points(p00, p01).union(Rect::from_points(p10, p11))
}
/// Is this map finite?
#[inline]
pub fn is_finite(&self) -> bool {
self.0[0].is_finite()
&& self.0[1].is_finite()
&& self.0[2].is_finite()
&& self.0[3].is_finite()
&& self.0[4].is_finite()
&& self.0[5].is_finite()
}
/// Is this map NaN?
#[inline]
pub fn is_nan(&self) -> bool {
self.0[0].is_nan()
|| self.0[1].is_nan()
|| self.0[2].is_nan()
|| self.0[3].is_nan()
|| self.0[4].is_nan()
|| self.0[5].is_nan()
}
}
impl Default for Affine {
#[inline]
fn default() -> Affine {
Affine::IDENTITY
}
}
impl Mul<Point> for Affine {
type Output = Point;
#[inline]
fn mul(self, other: Point) -> Point {
Point::new(
self.0[0] * other.x + self.0[2] * other.y + self.0[4],
self.0[1] * other.x + self.0[3] * other.y + self.0[5],
)
}
}
impl Mul for Affine {
type Output = Affine;
#[inline]
fn mul(self, other: Affine) -> Affine {
Affine([
self.0[0] * other.0[0] + self.0[2] * other.0[1],
self.0[1] * other.0[0] + self.0[3] * other.0[1],
self.0[0] * other.0[2] + self.0[2] * other.0[3],
self.0[1] * other.0[2] + self.0[3] * other.0[3],
self.0[0] * other.0[4] + self.0[2] * other.0[5] + self.0[4],
self.0[1] * other.0[4] + self.0[3] * other.0[5] + self.0[5],
])
}
}
impl MulAssign for Affine {
#[inline]
fn mul_assign(&mut self, other: Affine) {
*self = self.mul(other);
}
}
impl Mul<Affine> for f64 {
type Output = Affine;
#[inline]
fn mul(self, other: Affine) -> Affine {
Affine([
self * other.0[0],
self * other.0[1],
self * other.0[2],
self * other.0[3],
self * other.0[4],
self * other.0[5],
])
}
}
/// A 2D point. Derived from [kurbo](https://github.com/linebender/kurbo).
#[derive(Clone, Copy, Default, PartialEq)]
#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))]
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[repr(C)]
pub struct Point {
/// The x coordinate.
pub x: f64,
/// The y coordinate.
pub y: f64,
}
impl Point {
/// The point (0, 0).
pub const ZERO: Point = Point::new(0., 0.);
/// The point at the origin; (0, 0).
pub const ORIGIN: Point = Point::new(0., 0.);
/// Create a new `Point` with the provided `x` and `y` coordinates.
#[inline]
pub const fn new(x: f64, y: f64) -> Self {
Point { x, y }
}
/// Convert this point into a `Vec2`.
#[inline]
pub const fn to_vec2(self) -> Vec2 {
Vec2::new(self.x, self.y)
}
}
impl From<(f64, f64)> for Point {
#[inline]
fn from(v: (f64, f64)) -> Point {
Point { x: v.0, y: v.1 }
}
}
impl From<Point> for (f64, f64) {
#[inline]
fn from(v: Point) -> (f64, f64) {
(v.x, v.y)
}
}
impl Add<Vec2> for Point {
type Output = Point;
#[inline]
fn add(self, other: Vec2) -> Self {
Point::new(self.x + other.x, self.y + other.y)
}
}
impl AddAssign<Vec2> for Point {
#[inline]
fn add_assign(&mut self, other: Vec2) {
*self = Point::new(self.x + other.x, self.y + other.y);
}
}
impl Sub<Vec2> for Point {
type Output = Point;
#[inline]
fn sub(self, other: Vec2) -> Self {
Point::new(self.x - other.x, self.y - other.y)
}
}
impl SubAssign<Vec2> for Point {
#[inline]
fn sub_assign(&mut self, other: Vec2) {
*self = Point::new(self.x - other.x, self.y - other.y);
}
}
impl Add<(f64, f64)> for Point {
type Output = Point;
#[inline]
fn add(self, (x, y): (f64, f64)) -> Self {
Point::new(self.x + x, self.y + y)
}
}
impl AddAssign<(f64, f64)> for Point {
#[inline]
fn add_assign(&mut self, (x, y): (f64, f64)) {
*self = Point::new(self.x + x, self.y + y);
}
}
impl Sub<(f64, f64)> for Point {
type Output = Point;
#[inline]
fn sub(self, (x, y): (f64, f64)) -> Self {
Point::new(self.x - x, self.y - y)
}
}
impl SubAssign<(f64, f64)> for Point {
#[inline]
fn sub_assign(&mut self, (x, y): (f64, f64)) {
*self = Point::new(self.x - x, self.y - y);
}
}
impl Sub<Point> for Point {
type Output = Vec2;
#[inline]
fn sub(self, other: Point) -> Vec2 {
Vec2::new(self.x - other.x, self.y - other.y)
}
}
impl fmt::Debug for Point {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "({:?}, {:?})", self.x, self.y)
}
}
/// A rectangle. Derived from [kurbo](https://github.com/linebender/kurbo).
#[derive(Clone, Copy, Default, PartialEq)]
#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))]
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[repr(C)]
pub struct Rect {
/// The minimum x coordinate (left edge).
pub x0: f64,
/// The minimum y coordinate (top edge in y-down spaces).
pub y0: f64,
/// The maximum x coordinate (right edge).
pub x1: f64,
/// The maximum y coordinate (bottom edge in y-down spaces).
pub y1: f64,
}
impl From<(Point, Point)> for Rect {
fn from(points: (Point, Point)) -> Rect {
Rect::from_points(points.0, points.1)
}
}
impl From<(Point, Size)> for Rect {
fn from(params: (Point, Size)) -> Rect {
Rect::from_origin_size(params.0, params.1)
}
}
impl Add<Vec2> for Rect {
type Output = Rect;
#[inline]
fn add(self, v: Vec2) -> Rect {
Rect::new(self.x0 + v.x, self.y0 + v.y, self.x1 + v.x, self.y1 + v.y)
}
}
impl Sub<Vec2> for Rect {
type Output = Rect;
#[inline]
fn sub(self, v: Vec2) -> Rect {
Rect::new(self.x0 - v.x, self.y0 - v.y, self.x1 - v.x, self.y1 - v.y)
}
}
impl fmt::Debug for Rect {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
if f.alternate() {
write!(
f,
"Rect {{ origin: {:?}, size: {:?} }}",
self.origin(),
self.size()
)
} else {
write!(
f,
"Rect {{ x0: {:?}, y0: {:?}, x1: {:?}, y1: {:?} }}",
self.x0, self.y0, self.x1, self.y1
)
}
}
}
impl Rect {
/// The empty rectangle at the origin.
pub const ZERO: Rect = Rect::new(0., 0., 0., 0.);
/// A new rectangle from minimum and maximum coordinates.
#[inline]
pub const fn new(x0: f64, y0: f64, x1: f64, y1: f64) -> Rect {
Rect { x0, y0, x1, y1 }
}
/// A new rectangle from two points.
///
/// The result will have non-negative width and height.
#[inline]
pub fn from_points(p0: impl Into<Point>, p1: impl Into<Point>) -> Rect {
let p0 = p0.into();
let p1 = p1.into();
Rect::new(p0.x, p0.y, p1.x, p1.y).abs()
}
/// A new rectangle from origin and size.
///
/// The result will have non-negative width and height.
#[inline]
pub fn from_origin_size(origin: impl Into<Point>, size: impl Into<Size>) -> Rect {
let origin = origin.into();
Rect::from_points(origin, origin + size.into().to_vec2())
}
/// Create a new `Rect` with the same size as `self` and a new origin.
#[inline]
pub fn with_origin(self, origin: impl Into<Point>) -> Rect {
Rect::from_origin_size(origin, self.size())
}
/// Create a new `Rect` with the same origin as `self` and a new size.
#[inline]
pub fn with_size(self, size: impl Into<Size>) -> Rect {
Rect::from_origin_size(self.origin(), size)
}
/// The width of the rectangle.
///
/// Note: nothing forbids negative width.
#[inline]
pub fn width(&self) -> f64 {
self.x1 - self.x0
}
/// The height of the rectangle.
///
/// Note: nothing forbids negative height.
#[inline]
pub fn height(&self) -> f64 {
self.y1 - self.y0
}
/// Returns the minimum value for the x-coordinate of the rectangle.
#[inline]
pub fn min_x(&self) -> f64 {
self.x0.min(self.x1)
}
/// Returns the maximum value for the x-coordinate of the rectangle.
#[inline]
pub fn max_x(&self) -> f64 {
self.x0.max(self.x1)
}
/// Returns the minimum value for the y-coordinate of the rectangle.
#[inline]
pub fn min_y(&self) -> f64 {
self.y0.min(self.y1)
}
/// Returns the maximum value for the y-coordinate of the rectangle.
#[inline]
pub fn max_y(&self) -> f64 {
self.y0.max(self.y1)
}
/// The origin of the rectangle.
///
/// This is the top left corner in a y-down space and with
/// non-negative width and height.
#[inline]
pub fn origin(&self) -> Point {
Point::new(self.x0, self.y0)
}
/// The size of the rectangle.
#[inline]
pub fn size(&self) -> Size {
Size::new(self.width(), self.height())
}
/// Take absolute value of width and height.
///
/// The resulting rect has the same extents as the original, but is
/// guaranteed to have non-negative width and height.
#[inline]
pub fn abs(&self) -> Rect {
let Rect { x0, y0, x1, y1 } = *self;
Rect::new(x0.min(x1), y0.min(y1), x0.max(x1), y0.max(y1))
}
/// The area of the rectangle.
#[inline]
pub fn area(&self) -> f64 {
self.width() * self.height()
}
/// Whether this rectangle has zero area.
///
/// Note: a rectangle with negative area is not considered empty.
#[inline]
pub fn is_empty(&self) -> bool {
self.area() == 0.0
}
/// Returns `true` if `point` lies within `self`.
#[inline]
pub fn contains(&self, point: Point) -> bool {
point.x >= self.x0 && point.x < self.x1 && point.y >= self.y0 && point.y < self.y1
}
/// The smallest rectangle enclosing two rectangles.
///
/// Results are valid only if width and height are non-negative.
#[inline]
pub fn union(&self, other: Rect) -> Rect {
Rect::new(
self.x0.min(other.x0),
self.y0.min(other.y0),
self.x1.max(other.x1),
self.y1.max(other.y1),
)
}
/// Compute the union with one point.
///
/// This method includes the perimeter of zero-area rectangles.
/// Thus, a succession of `union_pt` operations on a series of
/// points yields their enclosing rectangle.
///
/// Results are valid only if width and height are non-negative.
pub fn union_pt(&self, pt: Point) -> Rect {
Rect::new(
self.x0.min(pt.x),
self.y0.min(pt.y),
self.x1.max(pt.x),
self.y1.max(pt.y),
)
}
/// The intersection of two rectangles.
///
/// The result is zero-area if either input has negative width or
/// height. The result always has non-negative width and height.
#[inline]
pub fn intersect(&self, other: Rect) -> Rect {
let x0 = self.x0.max(other.x0);
let y0 = self.y0.max(other.y0);
let x1 = self.x1.min(other.x1);
let y1 = self.y1.min(other.y1);
Rect::new(x0, y0, x1.max(x0), y1.max(y0))
}
}
/// A 2D size. Derived from [kurbo](https://github.com/linebender/kurbo).
#[derive(Clone, Copy, Default, PartialEq)]
#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))]
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[repr(C)]
pub struct Size {
/// The width.
pub width: f64,
/// The height.
pub height: f64,
}
impl Size {
/// A size with zero width or height.
pub const ZERO: Size = Size::new(0., 0.);
/// Create a new `Size` with the provided `width` and `height`.
#[inline]
pub const fn new(width: f64, height: f64) -> Self {
Size { width, height }
}
/// Convert this size into a [`Vec2`], with `width` mapped to `x` and `height`
/// mapped to `y`.
#[inline]
pub const fn to_vec2(self) -> Vec2 {
Vec2::new(self.width, self.height)
}
}
impl fmt::Debug for Size {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{:?}W×{:?}H", self.width, self.height)
}
}
impl MulAssign<f64> for Size {
#[inline]
fn mul_assign(&mut self, other: f64) {
*self = Size {
width: self.width * other,
height: self.height * other,
};
}
}
impl Mul<Size> for f64 {
type Output = Size;
#[inline]
fn mul(self, other: Size) -> Size {
other * self
}
}
impl Mul<f64> for Size {
type Output = Size;
#[inline]
fn mul(self, other: f64) -> Size {
Size {
width: self.width * other,
height: self.height * other,
}
}
}
impl DivAssign<f64> for Size {
#[inline]
fn div_assign(&mut self, other: f64) {
*self = Size {
width: self.width / other,
height: self.height / other,
};
}
}
impl Div<f64> for Size {
type Output = Size;
#[inline]
fn div(self, other: f64) -> Size {
Size {
width: self.width / other,
height: self.height / other,
}
}
}
impl Add<Size> for Size {
type Output = Size;
#[inline]
fn add(self, other: Size) -> Size {
Size {
width: self.width + other.width,
height: self.height + other.height,
}
}
}
impl AddAssign<Size> for Size {
#[inline]
fn add_assign(&mut self, other: Size) {
*self = *self + other;
}
}
impl Sub<Size> for Size {
type Output = Size;
#[inline]
fn sub(self, other: Size) -> Size {
Size {
width: self.width - other.width,
height: self.height - other.height,
}
}
}
impl SubAssign<Size> for Size {
#[inline]
fn sub_assign(&mut self, other: Size) {
*self = *self - other;
}
}
impl From<(f64, f64)> for Size {
#[inline]
fn from(v: (f64, f64)) -> Size {
Size {
width: v.0,
height: v.1,
}
}
}
impl From<Size> for (f64, f64) {
#[inline]
fn from(v: Size) -> (f64, f64) {
(v.width, v.height)
}
}
/// A 2D vector. Derived from [kurbo](https://github.com/linebender/kurbo).
///
/// This is intended primarily for a vector in the mathematical sense,
/// but it can be interpreted as a translation, and converted to and
/// from a point (vector relative to the origin) and size.
#[derive(Clone, Copy, Default, Debug, PartialEq)]
#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))]
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[repr(C)]
pub struct Vec2 {
/// The x-coordinate.
pub x: f64,
/// The y-coordinate.
pub y: f64,
}
impl Vec2 {
/// The vector (0, 0).
pub const ZERO: Vec2 = Vec2::new(0., 0.);
/// Create a new vector.
#[inline]
pub const fn new(x: f64, y: f64) -> Vec2 {
Vec2 { x, y }
}
/// Convert this vector into a `Point`.
#[inline]
pub const fn to_point(self) -> Point {
Point::new(self.x, self.y)
}
/// Convert this vector into a `Size`.
#[inline]
pub const fn to_size(self) -> Size {
Size::new(self.x, self.y)
}
}
impl From<(f64, f64)> for Vec2 {
#[inline]
fn from(v: (f64, f64)) -> Vec2 {
Vec2 { x: v.0, y: v.1 }
}
}
impl From<Vec2> for (f64, f64) {
#[inline]
fn from(v: Vec2) -> (f64, f64) {
(v.x, v.y)
}
}
impl Add for Vec2 {
type Output = Vec2;
#[inline]
fn add(self, other: Vec2) -> Vec2 {
Vec2 {
x: self.x + other.x,
y: self.y + other.y,
}
}
}
impl AddAssign for Vec2 {
#[inline]
fn add_assign(&mut self, other: Vec2) {
*self = Vec2 {
x: self.x + other.x,
y: self.y + other.y,
}
}
}
impl Sub for Vec2 {
type Output = Vec2;
#[inline]
fn sub(self, other: Vec2) -> Vec2 {
Vec2 {
x: self.x - other.x,
y: self.y - other.y,
}
}
}
impl SubAssign for Vec2 {
#[inline]
fn sub_assign(&mut self, other: Vec2) {
*self = Vec2 {
x: self.x - other.x,
y: self.y - other.y,
}
}
}
impl Mul<f64> for Vec2 {
type Output = Vec2;
#[inline]
fn mul(self, other: f64) -> Vec2 {
Vec2 {
x: self.x * other,
y: self.y * other,
}
}
}
impl MulAssign<f64> for Vec2 {
#[inline]
fn mul_assign(&mut self, other: f64) {
*self = Vec2 {
x: self.x * other,
y: self.y * other,
};
}
}
impl Mul<Vec2> for f64 {
type Output = Vec2;
#[inline]
fn mul(self, other: Vec2) -> Vec2 {
other * self
}
}
impl Div<f64> for Vec2 {
type Output = Vec2;
/// Note: division by a scalar is implemented by multiplying by the reciprocal.
///
/// This is more efficient but has different roundoff behavior than division.
#[inline]
#[allow(clippy::suspicious_arithmetic_impl)]
fn div(self, other: f64) -> Vec2 {
self * other.recip()
}
}
impl DivAssign<f64> for Vec2 {
#[inline]
fn div_assign(&mut self, other: f64) {
self.mul_assign(other.recip());
}
}
impl Neg for Vec2 {
type Output = Vec2;
#[inline]
fn neg(self) -> Vec2 {
Vec2 {
x: -self.x,
y: -self.y,
}
}
}

2490
vendor/accesskit/src/lib.rs vendored Normal file

File diff suppressed because it is too large Load Diff