feat(client): redesign native UI, themes, settings and avatars
Separate conversation drafts and voice view state, add native settings and restricted CSS themes, implement validated avatar cropping, and refresh dependencies with documented desktop compatibility backports.
This commit is contained in:
parent
44d284a568
commit
8e5ab56611
276 changed files with 53546 additions and 3399 deletions
104
patches/atspi-proxies/Cargo.toml
vendored
Normal file
104
patches/atspi-proxies/Cargo.toml
vendored
Normal file
|
|
@ -0,0 +1,104 @@
|
|||
# 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 = "atspi-proxies"
|
||||
version = "0.13.0"
|
||||
build = false
|
||||
include = [
|
||||
"LICENSE-*",
|
||||
"README.md",
|
||||
"src/**/*",
|
||||
]
|
||||
autolib = false
|
||||
autobins = false
|
||||
autoexamples = false
|
||||
autotests = false
|
||||
autobenches = false
|
||||
description = "AT-SPI2 proxies to query or manipulate UI objects"
|
||||
homepage = "https://github.com/odilia-app/atspi"
|
||||
readme = "README.md"
|
||||
keywords = [
|
||||
"a11y",
|
||||
"accessibility",
|
||||
"linux",
|
||||
"screen-reader",
|
||||
"tts",
|
||||
]
|
||||
categories = [
|
||||
"accessibility",
|
||||
"api-bindings",
|
||||
]
|
||||
license = "Apache-2.0 OR MIT"
|
||||
repository = "https://github.com/odilia-app/atspi"
|
||||
|
||||
[package.metadata.release]
|
||||
publish = true
|
||||
release = true
|
||||
|
||||
[features]
|
||||
default = ["wrappers"]
|
||||
wrappers = []
|
||||
|
||||
[lib]
|
||||
name = "atspi_proxies"
|
||||
path = "src/lib.rs"
|
||||
|
||||
[dependencies.atspi-common]
|
||||
version = "0.13.0"
|
||||
|
||||
[dependencies.serde]
|
||||
version = "^1.0.200"
|
||||
features = ["derive"]
|
||||
default-features = false
|
||||
|
||||
[dependencies.zbus]
|
||||
version = "6.1"
|
||||
features = ["default-rt", "proxy", "service", "object-manager"]
|
||||
default-features = false
|
||||
|
||||
[dev-dependencies.atspi-common]
|
||||
version = "0.13.0"
|
||||
|
||||
[dev-dependencies.byteorder]
|
||||
version = "1.4"
|
||||
|
||||
[dev-dependencies.futures-lite]
|
||||
version = "2.6.0"
|
||||
default-features = false
|
||||
|
||||
[dev-dependencies.rename-item]
|
||||
version = "0.1.0"
|
||||
|
||||
[dev-dependencies.serde_json]
|
||||
version = "1.0.96"
|
||||
|
||||
[dev-dependencies.serde_plain]
|
||||
version = "1.0.1"
|
||||
|
||||
[dev-dependencies.tokio]
|
||||
version = "1.38.2"
|
||||
features = [
|
||||
"macros",
|
||||
"rt-multi-thread",
|
||||
]
|
||||
default-features = false
|
||||
|
||||
[dev-dependencies.tokio-stream]
|
||||
version = "0.1.1"
|
||||
|
||||
[dev-dependencies.tokio-test]
|
||||
version = "0.4.2"
|
||||
|
||||
[dev-dependencies.tracing]
|
||||
version = "0.1.40"
|
||||
201
patches/atspi-proxies/LICENSE-APACHE2.txt
vendored
Normal file
201
patches/atspi-proxies/LICENSE-APACHE2.txt
vendored
Normal file
|
|
@ -0,0 +1,201 @@
|
|||
Apache License
|
||||
Version 2.0, January 2004
|
||||
http://www.apache.org/licenses/
|
||||
|
||||
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
||||
|
||||
1. Definitions.
|
||||
|
||||
"License" shall mean the terms and conditions for use, reproduction,
|
||||
and distribution as defined by Sections 1 through 9 of this document.
|
||||
|
||||
"Licensor" shall mean the copyright owner or entity authorized by
|
||||
the copyright owner that is granting the License.
|
||||
|
||||
"Legal Entity" shall mean the union of the acting entity and all
|
||||
other entities that control, are controlled by, or are under common
|
||||
control with that entity. For the purposes of this definition,
|
||||
"control" means (i) the power, direct or indirect, to cause the
|
||||
direction or management of such entity, whether by contract or
|
||||
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
||||
outstanding shares, or (iii) beneficial ownership of such entity.
|
||||
|
||||
"You" (or "Your") shall mean an individual or Legal Entity
|
||||
exercising permissions granted by this License.
|
||||
|
||||
"Source" form shall mean the preferred form for making modifications,
|
||||
including but not limited to software source code, documentation
|
||||
source, and configuration files.
|
||||
|
||||
"Object" form shall mean any form resulting from mechanical
|
||||
transformation or translation of a Source form, including but
|
||||
not limited to compiled object code, generated documentation,
|
||||
and conversions to other media types.
|
||||
|
||||
"Work" shall mean the work of authorship, whether in Source or
|
||||
Object form, made available under the License, as indicated by a
|
||||
copyright notice that is included in or attached to the work
|
||||
(an example is provided in the Appendix below).
|
||||
|
||||
"Derivative Works" shall mean any work, whether in Source or Object
|
||||
form, that is based on (or derived from) the Work and for which the
|
||||
editorial revisions, annotations, elaborations, or other modifications
|
||||
represent, as a whole, an original work of authorship. For the purposes
|
||||
of this License, Derivative Works shall not include works that remain
|
||||
separable from, or merely link (or bind by name) to the interfaces of,
|
||||
the Work and Derivative Works thereof.
|
||||
|
||||
"Contribution" shall mean any work of authorship, including
|
||||
the original version of the Work and any modifications or additions
|
||||
to that Work or Derivative Works thereof, that is intentionally
|
||||
submitted to Licensor for inclusion in the Work by the copyright owner
|
||||
or by an individual or Legal Entity authorized to submit on behalf of
|
||||
the copyright owner. For the purposes of this definition, "submitted"
|
||||
means any form of electronic, verbal, or written communication sent
|
||||
to the Licensor or its representatives, including but not limited to
|
||||
communication on electronic mailing lists, source code control systems,
|
||||
and issue tracking systems that are managed by, or on behalf of, the
|
||||
Licensor for the purpose of discussing and improving the Work, but
|
||||
excluding communication that is conspicuously marked or otherwise
|
||||
designated in writing by the copyright owner as "Not a Contribution."
|
||||
|
||||
"Contributor" shall mean Licensor and any individual or Legal Entity
|
||||
on behalf of whom a Contribution has been received by Licensor and
|
||||
subsequently incorporated within the Work.
|
||||
|
||||
2. Grant of Copyright License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
copyright license to reproduce, prepare Derivative Works of,
|
||||
publicly display, publicly perform, sublicense, and distribute the
|
||||
Work and such Derivative Works in Source or Object form.
|
||||
|
||||
3. Grant of Patent License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
(except as stated in this section) patent license to make, have made,
|
||||
use, offer to sell, sell, import, and otherwise transfer the Work,
|
||||
where such license applies only to those patent claims licensable
|
||||
by such Contributor that are necessarily infringed by their
|
||||
Contribution(s) alone or by combination of their Contribution(s)
|
||||
with the Work to which such Contribution(s) was submitted. If You
|
||||
institute patent litigation against any entity (including a
|
||||
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
||||
or a Contribution incorporated within the Work constitutes direct
|
||||
or contributory patent infringement, then any patent licenses
|
||||
granted to You under this License for that Work shall terminate
|
||||
as of the date such litigation is filed.
|
||||
|
||||
4. Redistribution. You may reproduce and distribute copies of the
|
||||
Work or Derivative Works thereof in any medium, with or without
|
||||
modifications, and in Source or Object form, provided that You
|
||||
meet the following conditions:
|
||||
|
||||
(a) You must give any other recipients of the Work or
|
||||
Derivative Works a copy of this License; and
|
||||
|
||||
(b) You must cause any modified files to carry prominent notices
|
||||
stating that You changed the files; and
|
||||
|
||||
(c) You must retain, in the Source form of any Derivative Works
|
||||
that You distribute, all copyright, patent, trademark, and
|
||||
attribution notices from the Source form of the Work,
|
||||
excluding those notices that do not pertain to any part of
|
||||
the Derivative Works; and
|
||||
|
||||
(d) If the Work includes a "NOTICE" text file as part of its
|
||||
distribution, then any Derivative Works that You distribute must
|
||||
include a readable copy of the attribution notices contained
|
||||
within such NOTICE file, excluding those notices that do not
|
||||
pertain to any part of the Derivative Works, in at least one
|
||||
of the following places: within a NOTICE text file distributed
|
||||
as part of the Derivative Works; within the Source form or
|
||||
documentation, if provided along with the Derivative Works; or,
|
||||
within a display generated by the Derivative Works, if and
|
||||
wherever such third-party notices normally appear. The contents
|
||||
of the NOTICE file are for informational purposes only and
|
||||
do not modify the License. You may add Your own attribution
|
||||
notices within Derivative Works that You distribute, alongside
|
||||
or as an addendum to the NOTICE text from the Work, provided
|
||||
that such additional attribution notices cannot be construed
|
||||
as modifying the License.
|
||||
|
||||
You may add Your own copyright statement to Your modifications and
|
||||
may provide additional or different license terms and conditions
|
||||
for use, reproduction, or distribution of Your modifications, or
|
||||
for any such Derivative Works as a whole, provided Your use,
|
||||
reproduction, and distribution of the Work otherwise complies with
|
||||
the conditions stated in this License.
|
||||
|
||||
5. Submission of Contributions. Unless You explicitly state otherwise,
|
||||
any Contribution intentionally submitted for inclusion in the Work
|
||||
by You to the Licensor shall be under the terms and conditions of
|
||||
this License, without any additional terms or conditions.
|
||||
Notwithstanding the above, nothing herein shall supersede or modify
|
||||
the terms of any separate license agreement you may have executed
|
||||
with Licensor regarding such Contributions.
|
||||
|
||||
6. Trademarks. This License does not grant permission to use the trade
|
||||
names, trademarks, service marks, or product names of the Licensor,
|
||||
except as required for reasonable and customary use in describing the
|
||||
origin of the Work and reproducing the content of the NOTICE file.
|
||||
|
||||
7. Disclaimer of Warranty. Unless required by applicable law or
|
||||
agreed to in writing, Licensor provides the Work (and each
|
||||
Contributor provides its Contributions) on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
implied, including, without limitation, any warranties or conditions
|
||||
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
||||
PARTICULAR PURPOSE. You are solely responsible for determining the
|
||||
appropriateness of using or redistributing the Work and assume any
|
||||
risks associated with Your exercise of permissions under this License.
|
||||
|
||||
8. Limitation of Liability. In no event and under no legal theory,
|
||||
whether in tort (including negligence), contract, or otherwise,
|
||||
unless required by applicable law (such as deliberate and grossly
|
||||
negligent acts) or agreed to in writing, shall any Contributor be
|
||||
liable to You for damages, including any direct, indirect, special,
|
||||
incidental, or consequential damages of any character arising as a
|
||||
result of this License or out of the use or inability to use the
|
||||
Work (including but not limited to damages for loss of goodwill,
|
||||
work stoppage, computer failure or malfunction, or any and all
|
||||
other commercial damages or losses), even if such Contributor
|
||||
has been advised of the possibility of such damages.
|
||||
|
||||
9. Accepting Warranty or Additional Liability. While redistributing
|
||||
the Work or Derivative Works thereof, You may choose to offer,
|
||||
and charge a fee for, acceptance of support, warranty, indemnity,
|
||||
or other liability obligations and/or rights consistent with this
|
||||
License. However, in accepting such obligations, You may act only
|
||||
on Your own behalf and on Your sole responsibility, not on behalf
|
||||
of any other Contributor, and only if You agree to indemnify,
|
||||
defend, and hold each Contributor harmless for any liability
|
||||
incurred by, or claims asserted against, such Contributor by reason
|
||||
of your accepting any such warranty or additional liability.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
APPENDIX: How to apply the Apache License to your work.
|
||||
|
||||
To apply the Apache License to your work, attach the following
|
||||
boilerplate notice, with the fields enclosed by brackets "[]"
|
||||
replaced with your own identifying information. (Don't include
|
||||
the brackets!) The text should be enclosed in the appropriate
|
||||
comment syntax for the file format. We also recommend that a
|
||||
file or class name and description of purpose be included on the
|
||||
same "printed page" as the copyright notice for easier
|
||||
identification within third-party archives.
|
||||
|
||||
Copyright [yyyy] [name of copyright owner]
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
19
patches/atspi-proxies/LICENSE-MIT.txt
vendored
Normal file
19
patches/atspi-proxies/LICENSE-MIT.txt
vendored
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
Copyright (c) 2022 Tait Hoyem <tait@tait.tech>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
4
patches/atspi-proxies/README.md
vendored
Normal file
4
patches/atspi-proxies/README.md
vendored
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
# `atspi-proxies`
|
||||
|
||||
An internal crate used by other `atspi-*` crates.
|
||||
This handles direct communication with DBus.
|
||||
9
patches/atspi-proxies/VNOX-PATCH.md
vendored
Normal file
9
patches/atspi-proxies/VNOX-PATCH.md
vendored
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
# Vnox maintenance patch: atspi-proxies 0.13.0
|
||||
|
||||
Source: published crates.io atspi-proxies 0.13.0, original licenses included.
|
||||
|
||||
This is a maintained-parent compatibility backport, not a fork of an unmaintained D-Bus codec. Vnox updates dependencies/imports to maintained zbus 6, which merged zvariant and zbus_names. The original package version identifies its API baseline; no version is spoofed to suppress RustSec.
|
||||
|
||||
The Slint Winit patch additionally uses Winit's supported crossfont CSD backend to avoid the unmaintained ttf-parser chain while retaining Wayland client-side title decorations.
|
||||
|
||||
Remove this patch once upstream publishes the equivalent migration. Changes must be tested with full client build, native rendering, accessibility/portal interfaces and RustSec audit.
|
||||
339
patches/atspi-proxies/src/accessible.rs
vendored
Normal file
339
patches/atspi-proxies/src/accessible.rs
vendored
Normal file
|
|
@ -0,0 +1,339 @@
|
|||
//! # `AccessibleProxy`
|
||||
//!
|
||||
//! A handle for a remote object implementing the `org.a11y.atspi.Accessible`
|
||||
//! interface.
|
||||
//!
|
||||
//! Accessible is the interface which is implemented by all accessible objects.
|
||||
//!
|
||||
|
||||
use crate::common::{InterfaceSet, ObjectRef, RelationType, Role, StateSet};
|
||||
use crate::AtspiError;
|
||||
use atspi_common::object_ref::ObjectRefOwned;
|
||||
use zbus::names::BusName;
|
||||
|
||||
/// # `AccessibleProxy`
|
||||
///
|
||||
/// A handle for a remote object implementing the `org.a11y.atspi.Accessible`
|
||||
/// interface.
|
||||
///
|
||||
/// Accessible is the interface which is implemented by all accessible objects.
|
||||
///
|
||||
#[zbus::proxy(
|
||||
interface = "org.a11y.atspi.Accessible",
|
||||
default_path = "/org/a11y/atspi/accessible/root",
|
||||
assume_defaults = true
|
||||
)]
|
||||
pub trait Accessible {
|
||||
/// Returns an [`ObjectRef`] which refers to the `Application` object of the application.
|
||||
/// This object will have [`Application`] interface implemented.
|
||||
///
|
||||
/// The application object is the root of the accessibility hierarchy for the application.
|
||||
/// It is the only object in the hierarchy that does not have a parent.
|
||||
///
|
||||
/// ## Notes
|
||||
/// The application object is the only object in the accessibility hierarchy that is
|
||||
/// guaranteed to be persistent for the lifetime of the application.
|
||||
/// All other objects in the accessibility hierarchy may be created and destroyed dynamically.
|
||||
///
|
||||
/// [`ObjectRef`]: [`crate::common::events::ObjectRef`]
|
||||
/// [`Application`]: [`crate::application::ApplicationProxy`]
|
||||
fn get_application(&self) -> zbus::Result<ObjectRefOwned>;
|
||||
|
||||
/// Gets a list of name/value pairs of attributes or annotations for this object.
|
||||
///
|
||||
/// ## Disambiguation
|
||||
/// For typographic, textual, or textually-semantic attributes,
|
||||
/// see [`TextProxy`]'s [`get_attributes`] method instead.
|
||||
///
|
||||
/// [`TextProxy`]: [`crate::text::TextProxy`]
|
||||
/// [`get_attributes`]: [`crate::text::TextProxy#method.get_attributes`]
|
||||
fn get_attributes(&self) -> zbus::Result<std::collections::HashMap<String, String>>;
|
||||
|
||||
/// Retrieve child by index (starting from 0),
|
||||
///
|
||||
/// Queries the N-th accessible child of `self`. It is expected that this
|
||||
/// will correspond to the order that the [`get_children`] method would return.
|
||||
///
|
||||
/// ## Notes
|
||||
/// Implementations vary in their behavior when the index is out of range.
|
||||
/// GTK4 returns an error, while atk-adaptor (e.g. Gtk3) returns the
|
||||
/// null object path "/org/a11y/atspi/null".
|
||||
///
|
||||
/// Documentation advises implementors to return a `DBus` Error when the index is
|
||||
/// out of range, to "keep the type system gods happy".
|
||||
///
|
||||
/// [`get_children`]: #method.get_children
|
||||
fn get_child_at_index(&self, index: i32) -> zbus::Result<ObjectRefOwned>;
|
||||
|
||||
/// Retrieves a list of the object's accessible children.
|
||||
///
|
||||
/// Each array element is an [`Accessible`] representing the accessible child object.
|
||||
///
|
||||
/// ## Registry
|
||||
///
|
||||
/// On the [`Accessible`] interface of `org.a11y.atspi.Registry`, the registry daemon, this method retrieves a list
|
||||
/// of all accessible applications' root objects on the bus.
|
||||
///
|
||||
/// [`Accessible`]: [`crate::accessible::AccessibleProxy`]
|
||||
fn get_children(&self) -> zbus::Result<Vec<ObjectRefOwned>>;
|
||||
|
||||
/// This object resides in its parent's list of children.
|
||||
/// This returns its position in this list of children, starting from 0.
|
||||
///
|
||||
/// The function returns -1 if the object does not have a parent or
|
||||
/// if an exception occurs.
|
||||
fn get_index_in_parent(&self) -> zbus::Result<i32>;
|
||||
|
||||
/// Returns an [`InterfaceSet`] accessible interface names supported by the `self` object.
|
||||
/// [`InterfaceSet`]: [`crate::common::InterfaceSet`]
|
||||
fn get_interfaces(&self) -> zbus::Result<InterfaceSet>;
|
||||
|
||||
/// Gets a `String` corresponding to the name of the role played by an object,
|
||||
/// translated to the current locale.
|
||||
///
|
||||
/// ## Notes
|
||||
///
|
||||
/// This method will return useful values for roles that fall outside the
|
||||
/// enumeration used in the [`get_role`] method.
|
||||
///
|
||||
/// For applications, implementing this method is optional, and it may be removed
|
||||
/// in a future version of the API.
|
||||
///
|
||||
/// For example, [`libatspi`] will only call it in the event of an unknown role.
|
||||
///
|
||||
/// [`libatspi`]: <https://gitlab.gnome.org/GNOME/at-spi2-core/main/atspi>
|
||||
/// [`get_role`]: #method.get_role
|
||||
fn get_localized_role_name(&self) -> zbus::Result<String>;
|
||||
|
||||
/// Returns a set of relationships between the this `self` object and others.
|
||||
///
|
||||
/// This vector of tuples contains a [`RelationType`] and a vector of [`Accessible`]'s to which that
|
||||
/// relationship applies.
|
||||
/// These relationships allow for better identification of how objects are associated with one another.
|
||||
///
|
||||
/// For example, the relationship [`RelationType::LabelledBy`] can be used to identify labeling information
|
||||
/// that should accompany the accessible [`name`] property when presenting an object's content or identity
|
||||
/// to the end user.
|
||||
///
|
||||
/// Similarly, [`RelationType::ControllerFor`] can be used to specify the context in which a valuator is useful
|
||||
/// and/or the other UI components that are directly affected by user interactions with the valuator.
|
||||
/// Common examples include the association of scrollbars with the viewport or panel that they control.
|
||||
///
|
||||
/// [`RelationType`]: [`crate::common::RelationType`]
|
||||
/// [`RelationType::LabelledBy`]: [`crate::common::RelationType::LabelledBy`]
|
||||
/// [`RelationType::ControllerFor`]: [`crate::common::RelationType::ControllerFor`]
|
||||
/// [`name`]: #method.name
|
||||
/// [`Accessible`]: [`crate::common::events::Accessible`]
|
||||
fn get_relation_set(&self) -> zbus::Result<Vec<(RelationType, Vec<ObjectRefOwned>)>>;
|
||||
|
||||
/// Gets the [`Role`] that the current accessible object represents.
|
||||
///
|
||||
/// Roles make it possible for various UI toolkits to expose their controls to
|
||||
/// assistive technologies (ATs) with a standard interface, regardless of toolkit.
|
||||
///
|
||||
/// For example, a widget that acts like a conventional push button
|
||||
/// (appears unpressed; presses when acted upon; invokes a certain action
|
||||
/// when pressed) can expose an [`Role::Button`] role.
|
||||
///
|
||||
/// [`Role::Button`]: [`crate::common::Role::Button`]
|
||||
/// [`Role`]: [`crate::common::Role`]
|
||||
fn get_role(&self) -> zbus::Result<Role>;
|
||||
|
||||
/// Gets a `String` corresponding to the name of the role played by an object,
|
||||
/// translated to the current locale.
|
||||
///
|
||||
/// ## Notes
|
||||
///
|
||||
/// This method will return useful values for roles that fall outside the
|
||||
/// enumeration used in the `get_role` method.
|
||||
///
|
||||
/// For applications, implementing this method is optional, and it may be removed
|
||||
/// in a future version of the API.
|
||||
///
|
||||
/// [`libatspi`]: <https://gitlab.gnome.org/GNOME/at-spi2-core/main/atspi>
|
||||
/// [`libatspi`]: <https://gitlab.gnome.org/GNOME/at-spi2-core/>
|
||||
fn get_role_name(&self) -> zbus::Result<String>;
|
||||
|
||||
/// Method to retrieve the [`StateSet`] of states currently held by `self`.
|
||||
/// [`StateSet`]: [`crate::common::StateSet`]
|
||||
fn get_state(&self) -> zbus::Result<StateSet>;
|
||||
|
||||
/// Application-specific identifier for the current object.
|
||||
///
|
||||
/// A special id given to an object.
|
||||
/// Accessible application developers can use this to give a special id to an object
|
||||
/// to use in tests, for example, "`my_widget`".
|
||||
///
|
||||
/// Note that there is no way to directly find an object by its id;
|
||||
/// a test program may have to recursively get the children to find a specific id.
|
||||
/// This is because accessible objects can be created dynamically, and they do not always
|
||||
/// correspond to a static view of an application's data.
|
||||
#[zbus(property)]
|
||||
fn accessible_id(&self) -> zbus::Result<String>;
|
||||
|
||||
/// Number of accessible children for the current object.
|
||||
#[zbus(property)]
|
||||
fn child_count(&self) -> zbus::Result<i32>;
|
||||
|
||||
/// Human-readable, localized description of `self` in more detail.
|
||||
///
|
||||
/// This is a longer description than the [`Name`][name] property.
|
||||
///
|
||||
/// For example, a button might have a name of "OK", but a description of "OK button".
|
||||
///
|
||||
/// While the Name property is meant to be a short string that screen readers say
|
||||
/// during normal navigation, the Description property is for when the user asks for
|
||||
/// more detail.
|
||||
///
|
||||
/// [name]: #method.name
|
||||
#[zbus(property)]
|
||||
fn description(&self) -> zbus::Result<String>;
|
||||
|
||||
/// Unix locale for the current object.
|
||||
///
|
||||
/// This is a string in the form of "`language_territory.codeset`".
|
||||
/// For example, "en_US.UTF-8" or "de_DE.UTF-8".
|
||||
///
|
||||
/// For an application, this may be the locale for the language that the application
|
||||
/// shows in its user interface.
|
||||
///
|
||||
/// For a document being shown in an application, or a paragraph within a document,
|
||||
/// the locale may refer to that object exclusively. For example:
|
||||
/// an application may be showing itself in English ("en"), but it may be used to
|
||||
/// display a document in Spanish ("es").
|
||||
/// In the latter case, a screen reader will want to know that it should switch to
|
||||
/// Spanish while reading the document.
|
||||
#[zbus(property)]
|
||||
fn locale(&self) -> zbus::Result<String>;
|
||||
|
||||
/// Human-readable, localized, short name for the object.
|
||||
///
|
||||
/// Applications should have this set for objects which do not
|
||||
/// have a [`RelationType::LabelledBy`] relation.
|
||||
///
|
||||
/// Consider a widget to select RGB colors by setting three sliders.
|
||||
/// The names for the sliders would be "Red", "Green", "Blue", respectively, or
|
||||
/// their translations to application's locale. The names would be unnecessary if each
|
||||
/// slider had a `LabeledBy` relation to corresponding labels visible in the user
|
||||
/// interface.
|
||||
///
|
||||
/// [`RelationType::LabelledBy`]: [`crate::common::RelationType::LabelledBy`]
|
||||
#[zbus(property)]
|
||||
fn name(&self) -> zbus::Result<String>;
|
||||
|
||||
/// `ObjectRef` parent object of the current object.
|
||||
///
|
||||
/// Null parent:
|
||||
/// If the object has no parent (e.g. the application's root object is being queried),
|
||||
/// The application should return "" for the application name name and "/org/a11y/atspi/null"
|
||||
/// for the object path.
|
||||
///
|
||||
/// Root object:
|
||||
/// An application must have a single root object, called "/org/a11y/atspi/accessible/root".
|
||||
/// All other objects should have that one as their highest-level ancestor.
|
||||
#[zbus(property)]
|
||||
fn parent(&self) -> zbus::Result<ObjectRefOwned>;
|
||||
|
||||
/// Help text for the current object.
|
||||
#[zbus(property)]
|
||||
fn help_text(&self) -> zbus::Result<String>;
|
||||
}
|
||||
|
||||
impl TryFrom<AccessibleProxy<'_>> for ObjectRefOwned {
|
||||
type Error = AtspiError;
|
||||
fn try_from(proxy: AccessibleProxy<'_>) -> Result<ObjectRefOwned, Self::Error> {
|
||||
let sender = proxy.inner().destination();
|
||||
let path = proxy.inner().path();
|
||||
let object_ref = ObjectRef::try_from_bus_name_and_path(sender.into(), path.into())?;
|
||||
Ok(ObjectRefOwned::from(object_ref))
|
||||
}
|
||||
}
|
||||
|
||||
impl TryFrom<&AccessibleProxy<'_>> for ObjectRefOwned {
|
||||
type Error = AtspiError;
|
||||
fn try_from(proxy: &AccessibleProxy<'_>) -> Result<ObjectRefOwned, Self::Error> {
|
||||
let sender = proxy.inner().destination().clone();
|
||||
let path = proxy.inner().path().clone();
|
||||
let object_ref = ObjectRef::try_from_bus_name_and_path(sender, path)?;
|
||||
Ok(ObjectRefOwned::from(object_ref))
|
||||
}
|
||||
}
|
||||
|
||||
pub trait ObjectRefExt {
|
||||
/// Returns an [`AccessibleProxy`], the handle to the object's `Accessible` interface.
|
||||
///
|
||||
/// # Errors
|
||||
/// If the `ObjectRef` is null, this method returns an error.
|
||||
/// Users are advised to check if the `ObjectRef` is null before calling this method.
|
||||
fn as_accessible_proxy(
|
||||
&self,
|
||||
conn: &zbus::Connection,
|
||||
) -> impl std::future::Future<Output = Result<AccessibleProxy<'_>, AtspiError>> + Send;
|
||||
|
||||
/// Returns an [`AccessibleProxy`], the handle to the object's `Accessible` interface.
|
||||
///
|
||||
/// # Errors
|
||||
/// If the `ObjectRef` is null, this method returns an error.
|
||||
/// Users are advised to check if the `ObjectRef` is null before calling this method.
|
||||
fn into_accessible_proxy(
|
||||
self,
|
||||
conn: &zbus::Connection,
|
||||
) -> impl std::future::Future<Output = Result<AccessibleProxy<'_>, AtspiError>> + Send;
|
||||
}
|
||||
|
||||
impl ObjectRefExt for ObjectRefOwned {
|
||||
async fn as_accessible_proxy(
|
||||
&self,
|
||||
conn: &zbus::Connection,
|
||||
) -> Result<AccessibleProxy<'_>, AtspiError> {
|
||||
if self.is_null() {
|
||||
return Err(AtspiError::NullRef(
|
||||
"`as_accessible_proxy` called on null-reference ObjectRef",
|
||||
));
|
||||
}
|
||||
|
||||
let name: BusName = self.name().ok_or(AtspiError::MissingName)?.clone().into();
|
||||
let path = self.path();
|
||||
|
||||
AccessibleProxy::builder(conn)
|
||||
.destination(name)
|
||||
.path(path)
|
||||
.cache_properties(zbus::proxy::CacheProperties::No)
|
||||
.build()
|
||||
.await
|
||||
.map_err(AtspiError::from)
|
||||
}
|
||||
|
||||
async fn into_accessible_proxy(
|
||||
self,
|
||||
conn: &zbus::Connection,
|
||||
) -> Result<AccessibleProxy<'_>, AtspiError> {
|
||||
if self.is_null() {
|
||||
return Err(AtspiError::NullRef(
|
||||
"`into_accessible_proxy` called on null-reference ObjectRef",
|
||||
));
|
||||
}
|
||||
|
||||
let name: BusName = self.name().ok_or(AtspiError::MissingName)?.clone().into();
|
||||
let path = self.path();
|
||||
|
||||
AccessibleProxy::builder(conn)
|
||||
.destination(name)
|
||||
.path(path)
|
||||
.cache_properties(zbus::proxy::CacheProperties::No)
|
||||
.build()
|
||||
.await
|
||||
.map_err(AtspiError::from)
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use crate::accessible::Role;
|
||||
|
||||
#[test]
|
||||
fn test_output_of_role_name() {
|
||||
assert_eq!(Role::Invalid.name(), "invalid");
|
||||
assert_eq!(Role::PushButtonMenu.name(), "push button menu");
|
||||
}
|
||||
}
|
||||
131
patches/atspi-proxies/src/action.rs
vendored
Normal file
131
patches/atspi-proxies/src/action.rs
vendored
Normal file
|
|
@ -0,0 +1,131 @@
|
|||
//! # [`ActionProxy`]
|
||||
//!
|
||||
//! A handle for a remote object implementing the `org.a11y.atspi.Action`
|
||||
//! interface.
|
||||
//!
|
||||
//! The `Action` interface allows exploring and invoking the actions of a
|
||||
//! user-actionable UI component.
|
||||
//!
|
||||
//! For example, a button may expose a "click" action - a popup menu may
|
||||
//! expose an "open" action.
|
||||
//!
|
||||
//! Components which are not "passive" providers of UI information should
|
||||
//! implement this interface, unless there is a more specialized interface for
|
||||
//! interaction like [`org.a11y.atspi.Text`][TextProxy] or [`org.a11y.atspi.Value`][ValueProxy].
|
||||
//!
|
||||
//! [ActionProxy]: crate::action::ActionProxy
|
||||
//! [TextProxy]: crate::text::TextProxy
|
||||
//! [ValueProxy]: crate::value::ValueProxy
|
||||
|
||||
use atspi_common::Action;
|
||||
|
||||
/// A handle for a remote object implementing the `org.a11y.atspi.Action`
|
||||
/// interface.
|
||||
///
|
||||
/// The `Action` interface allows exploring and invoking the actions of a
|
||||
/// user-actionable UI component.
|
||||
///
|
||||
/// For example, a button may expose a "click" action - a popup menu may
|
||||
/// expose an "open" action.
|
||||
///
|
||||
/// Components which are not "passive" providers of UI information should
|
||||
/// implement this interface, unless there is a more specialized interface for
|
||||
/// interaction like [`org.a11y.atspi.Text`][TextProxy] or [`org.a11y.atspi.Value`][ValueProxy].
|
||||
///
|
||||
/// [TextProxy]: crate::text::TextProxy
|
||||
/// [ValueProxy]: crate::value::ValueProxy
|
||||
#[zbus::proxy(interface = "org.a11y.atspi.Action", assume_defaults = true)]
|
||||
pub trait Action {
|
||||
/// Performs the specified action on the object.
|
||||
///
|
||||
/// Returns: Ok(true) on success, Ok(false) otherwise.
|
||||
///
|
||||
/// # Arguments
|
||||
///
|
||||
/// * `index` - The index of the action to perform.
|
||||
fn do_action(&self, index: i32) -> zbus::Result<bool>;
|
||||
|
||||
/// Returns an array of localized name, localized
|
||||
/// description, keybinding for the actions that an object
|
||||
/// supports.
|
||||
///
|
||||
/// See [`get_key_binding`] method for a description of that
|
||||
/// field's syntax.
|
||||
///
|
||||
/// This is equivalent to using the methods [`get_localized_name`],
|
||||
/// [`get_description`] and [`get_key_binding`] for each action,
|
||||
/// but with a single call and thus less `DBus` traffic.
|
||||
///
|
||||
/// By convention, if there is more than one action available,
|
||||
/// the first one is considered the "default" action of the object.
|
||||
///
|
||||
/// [`get_key_binding`]: ActionProxy#method.get_key_binding
|
||||
/// [`get_localized_name`]: ActionProxy#method.get_localized_name
|
||||
/// [`get_description`]: ActionProxy#method.get_description
|
||||
fn get_actions(&self) -> zbus::Result<Vec<Action>>;
|
||||
|
||||
/// Returns the localized description for the action at the specified
|
||||
/// index, starting at zero.
|
||||
///
|
||||
/// For example, a screen reader will read out this description when
|
||||
/// the user asks for extra detail on an action.
|
||||
/// For example, "Clicks the button" for the "click" action of a button.
|
||||
fn get_description(&self, index: i32) -> zbus::Result<String>;
|
||||
|
||||
/// Returns the keybinding for the action, specified by a
|
||||
/// zero-based index.
|
||||
///
|
||||
/// Gets the keybinding which can be used to invoke this action,
|
||||
/// if one exists.
|
||||
///
|
||||
/// The string returned should contain localized, human-readable,
|
||||
/// key sequences as they would appear when displayed on screen.
|
||||
/// It must be in the format "mnemonic;sequence;shortcut".
|
||||
///
|
||||
/// - The mnemonic key activates the object if it is presently
|
||||
/// enabled on screen.
|
||||
/// This typically corresponds to the underlined letter within
|
||||
/// the widget. Example: "n" in a traditional "Ṉew..." menu
|
||||
/// item or the "a" in "Apply" for a button.
|
||||
///
|
||||
/// - The sequence is the full list of keys which invoke the action
|
||||
/// even if the relevant element is not currently shown on screen.
|
||||
/// For instance, for a menu item the sequence is the keybindings
|
||||
/// used to open the parent menus before invoking.
|
||||
///
|
||||
/// The sequence string is colon-delimited. Example: "Alt+F:N" in a
|
||||
/// traditional "Ṉew..." menu item.
|
||||
///
|
||||
/// - The shortcut, if it exists, will invoke the same action without
|
||||
/// showing the component or its enclosing menus or dialogs.
|
||||
/// Example: "Ctrl+N" in a traditional "Ṉew..." menu item.
|
||||
/// The shortcut string is colon-delimited. Example: "Ctrl+N" in a
|
||||
/// traditional "Ṉew..." menu item.
|
||||
///
|
||||
/// Example: For a traditional "Ṉew..." menu item, the expected return
|
||||
/// value would be: "N;Alt+F:N;Ctrl+N" for the English locale and
|
||||
/// "N;Alt+D:N;Strg+N" for the German locale.
|
||||
/// If, hypothetically, this menu item lacked a mnemonic, it would be
|
||||
/// represented by ";;Ctrl+N" and ";;Strg+N" respectively.
|
||||
///
|
||||
/// If there is no key binding for this action, "" is returned.
|
||||
fn get_key_binding(&self, index: i32) -> zbus::Result<String>;
|
||||
|
||||
/// Returns a short, localized name for the action at the specified by a
|
||||
/// zero-based index.
|
||||
///
|
||||
/// This is what screen readers will read out during normal navigation.
|
||||
/// For example, "Click" for a button.
|
||||
fn get_localized_name(&self, index: i32) -> zbus::Result<String>;
|
||||
|
||||
/// Returns a machine-readable name for the action at the specified,
|
||||
/// zero-based index.
|
||||
fn get_name(&self, index: i32) -> zbus::Result<String>;
|
||||
|
||||
/// Returns the number of available actions.
|
||||
///
|
||||
/// By convention, if there is more than one action available,
|
||||
/// the first one is considered the "default" action of the object.
|
||||
#[zbus(property)]
|
||||
fn nactions(&self) -> zbus::Result<i32>;
|
||||
}
|
||||
163
patches/atspi-proxies/src/application.rs
vendored
Normal file
163
patches/atspi-proxies/src/application.rs
vendored
Normal file
|
|
@ -0,0 +1,163 @@
|
|||
//! # [`ApplicationProxy`]
|
||||
//!
|
||||
//! A handle for a remote object implementing the `org.a11y.atspi.Application`
|
||||
//! interface.
|
||||
//!
|
||||
//! `Application` is the interface which is implemented by each accessible application.
|
||||
//! It is implemented for the root object of an application.
|
||||
//!
|
||||
//! It provides information about the application itself.
|
||||
//!
|
||||
//! ## Status
|
||||
//!
|
||||
//! A number of methods and properties of this interface have fallen in disuse or
|
||||
//! are / may be deprecated in the future.
|
||||
//!
|
||||
//! * [`id`]
|
||||
//! * [`set_id`]
|
||||
//! * [`atspi_version`]
|
||||
//! * [`get_locale`]
|
||||
//!
|
||||
//! [`toolkit_name`] and [`version`] are still in use.
|
||||
//!
|
||||
//! See the documentation of the individual methods and properties for details.
|
||||
//!
|
||||
//! [`ApplicationProxy`]: crate::application::ApplicationProxy
|
||||
//! [`id`]: ApplicationProxy#method.id
|
||||
//! [`set_id`]: ApplicationProxy#method.set_id
|
||||
//! [`atspi_version`]: ApplicationProxy#method.atspi_version
|
||||
//! [`get_locale`]: ApplicationProxy#method.get_locale
|
||||
//! [`toolkit_name`]: ApplicationProxy#method.toolkit_name
|
||||
//! [`version`]: ApplicationProxy#method.version
|
||||
//!
|
||||
|
||||
/// `Application` is the interface which is implemented by each accessible application.
|
||||
/// It is implemented for the root object of an application.
|
||||
///
|
||||
/// It provides information about the application itself.
|
||||
///
|
||||
/// ## Status
|
||||
///
|
||||
/// A number of methods and properties of this interface have fallen in disuse or
|
||||
/// are / may be deprecated in the future.
|
||||
///
|
||||
/// * [`id`]
|
||||
/// * [`set_id`]
|
||||
/// * [`atspi_version`]
|
||||
/// * [`get_locale`]
|
||||
///
|
||||
/// [`toolkit_name`] and [`version`] are still in use.
|
||||
///
|
||||
/// See the documentation of the individual methods and properties for details.
|
||||
///
|
||||
/// [`id`]: ApplicationProxy#method.id
|
||||
/// [`set_id`]: ApplicationProxy#method.set_id
|
||||
/// [`atspi_version`]: ApplicationProxy#method.atspi_version
|
||||
/// [`get_locale`]: ApplicationProxy#method.get_locale
|
||||
/// [`toolkit_name`]: ApplicationProxy#method.toolkit_name
|
||||
/// [`version`]: ApplicationProxy#method.version
|
||||
///
|
||||
#[zbus::proxy(
|
||||
interface = "org.a11y.atspi.Application",
|
||||
default_path = "/org/a11y/atspi/accessible/root",
|
||||
assume_defaults = true
|
||||
)]
|
||||
pub trait Application {
|
||||
/// Method to retrieve the application's locale.
|
||||
///
|
||||
/// ## Deprecation
|
||||
///
|
||||
/// This method is likely to be removed in the future.
|
||||
///
|
||||
/// There is no need to call this method because there is also
|
||||
/// [`locale`] which offers the same functionality
|
||||
/// at the accessible object level.
|
||||
///
|
||||
/// See also: [Orca issues: "Plans for per-object locale?"](<https://gitlab.gnome.org/GNOME/orca/-/issues/260>)
|
||||
///
|
||||
/// member: `GetLocale`, type: method
|
||||
///
|
||||
/// [`locale`]: crate::accessible::AccessibleProxy#method.locale
|
||||
fn get_locale(&self, lctype: u32) -> zbus::Result<String>;
|
||||
|
||||
/// retrieves AT-SPI2 version.
|
||||
///
|
||||
/// Applications are advised to return "2.1" here, thus that is what
|
||||
/// users should expect.
|
||||
///
|
||||
/// This was intended to be the version of the atspi interfaces
|
||||
/// that the application supports, but atspi will probably move to
|
||||
/// using versioned interface names instead.
|
||||
///
|
||||
/// member: `AtspiVersion`, type: property
|
||||
#[zbus(property)]
|
||||
fn atspi_version(&self) -> zbus::Result<String>;
|
||||
|
||||
/// Retrieve numerical id of the application.
|
||||
///
|
||||
/// The 'id' is set an arbitrary numerical id when
|
||||
/// an application registers with the registry.
|
||||
///
|
||||
/// When a freshly-started application uses the
|
||||
/// [`org.a11y.atspi.Socket`]'s [`embed`] method to
|
||||
/// register with the accessibility registry, the
|
||||
/// registry will set a numerical id on the application.
|
||||
///
|
||||
/// ## status
|
||||
///
|
||||
/// The property has fallen in disuse.
|
||||
///
|
||||
/// As per [AT-SPI2-CORE issue #82](<https://gitlab.gnome.org/GNOME/at-spi2-core/-/issues/82>)
|
||||
/// it may turn out that this id is not actually used subsequently.
|
||||
/// This is a remnant of the time when registryd actually had to
|
||||
/// make up identifiers for each application.
|
||||
/// With `DBus`, however, it is the bus that assigns unique names to applications that
|
||||
/// connect to it.
|
||||
///
|
||||
/// Applications or toolkits can remember the `Id` passed when the accessibility
|
||||
/// registry sets this property, and return it back when the property is read.
|
||||
///
|
||||
/// member: `Id`, type: property
|
||||
///
|
||||
/// [`embed`]: crate::socket::SocketProxy#method.embed
|
||||
/// [`org.a11y.atspi.Socket`]: crate::socket::SocketProxy
|
||||
#[zbus(property)]
|
||||
fn id(&self) -> zbus::Result<i32>;
|
||||
|
||||
/// Set ID of the application.
|
||||
///
|
||||
/// This method is used by the accessibility registry to set the
|
||||
/// application's id.
|
||||
///
|
||||
/// ## status
|
||||
///
|
||||
/// The property has fallen in disuse.
|
||||
///
|
||||
/// See [`id`] for details.
|
||||
///
|
||||
/// member: `Id`, type: property
|
||||
///
|
||||
/// [`id`]: crate::application::ApplicationProxy#method.id
|
||||
#[zbus(property)]
|
||||
fn set_id(&self, value: i32) -> zbus::Result<()>;
|
||||
|
||||
/// Retrieves the name of the toolkit used to implement the application's
|
||||
/// user interface.
|
||||
///
|
||||
/// member: `ToolkitName`, type: property
|
||||
#[zbus(property)]
|
||||
fn toolkit_name(&self) -> zbus::Result<String>;
|
||||
|
||||
/// Returns the version of the toolkit used to implement the
|
||||
/// application's user interface.
|
||||
///
|
||||
/// member: `Version`, type: property
|
||||
#[zbus(property)]
|
||||
fn version(&self) -> zbus::Result<String>;
|
||||
|
||||
/// Method to obtain the unix socket address.
|
||||
/// The unix socket can be used to setup a connection, to perform peer-to-peer (P2P) method calls.
|
||||
///
|
||||
/// Known implementors include `Gtk3` and `Firefox`.
|
||||
fn get_application_bus_address(&self) -> zbus::Result<String>;
|
||||
}
|
||||
49
patches/atspi-proxies/src/bus.rs
vendored
Normal file
49
patches/atspi-proxies/src/bus.rs
vendored
Normal file
|
|
@ -0,0 +1,49 @@
|
|||
//! # `DBus` interface proxies for: `org.a11y.Status`, `org.a11y.Bus`
|
||||
//!
|
||||
//! This code was generated by `zbus-xmlgen` `2.0.1` from `DBus` introspection data.
|
||||
//! Source: `Interface '/org/a11y/bus' from service 'org.a11y.Bus' on session bus`.
|
||||
//!
|
||||
//! You may prefer to adapt it, instead of using it verbatim.
|
||||
//!
|
||||
//! More information can be found in the
|
||||
//! [Writing a client proxy](https://dbus.pages.freedesktop.org/zbus/client.html)
|
||||
//! section of the zbus documentation.
|
||||
//!
|
||||
//! This `DBus` object implements
|
||||
//! [standard `DBus` interfaces](https://dbus.freedesktop.org/doc/dbus-specification.html),
|
||||
//! (`org.freedesktop.DBus.*`) for which the following zbus proxies can be used:
|
||||
//!
|
||||
//! * [`zbus::fdo::PropertiesProxy`]
|
||||
//! * [`zbus::fdo::IntrospectableProxy`]
|
||||
//! * [`zbus::fdo::PeerProxy`]
|
||||
//!
|
||||
//! …consequently `zbus-xmlgen` did not generate code for the above interfaces.
|
||||
|
||||
#[zbus::proxy(
|
||||
interface = "org.a11y.Status",
|
||||
default_service = "org.a11y.Bus",
|
||||
default_path = "/org/a11y/bus"
|
||||
)]
|
||||
pub trait Status {
|
||||
/// `IsEnabled` property
|
||||
#[zbus(property)]
|
||||
fn is_enabled(&self) -> zbus::Result<bool>;
|
||||
#[zbus(property)]
|
||||
fn set_is_enabled(&self, value: bool) -> zbus::Result<()>;
|
||||
|
||||
/// `ScreenReaderEnabled` property
|
||||
#[zbus(property)]
|
||||
fn screen_reader_enabled(&self) -> zbus::Result<bool>;
|
||||
#[zbus(property)]
|
||||
fn set_screen_reader_enabled(&self, value: bool) -> zbus::Result<()>;
|
||||
}
|
||||
|
||||
#[zbus::proxy(
|
||||
interface = "org.a11y.Bus",
|
||||
default_service = "org.a11y.Bus",
|
||||
default_path = "/org/a11y/bus"
|
||||
)]
|
||||
pub trait Bus {
|
||||
/// `GetAddress` method
|
||||
fn get_address(&self) -> zbus::Result<String>;
|
||||
}
|
||||
18
patches/atspi-proxies/src/cache.rs
vendored
Normal file
18
patches/atspi-proxies/src/cache.rs
vendored
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
//! # `DBus` interface proxy for: `org.a11y.atspi.Cache`
|
||||
//!
|
||||
//! This code was generated by `zbus-xmlgen` `2.0.1` from `DBus` introspection data.
|
||||
//! Source: `Cache.xml`.
|
||||
//!
|
||||
|
||||
use crate::common::{CacheItem, LegacyCacheItem};
|
||||
|
||||
#[zbus::proxy(interface = "org.a11y.atspi.Cache", default_path = "/org/a11y/atspi/cache")]
|
||||
pub trait Cache {
|
||||
/// `GetItems` method
|
||||
fn get_items(&self) -> zbus::Result<Vec<CacheItem>>;
|
||||
|
||||
/// `GetItems` method to support legacy servers (old Qt-based applications and old AT-SPI
|
||||
/// registry daemons)
|
||||
#[zbus(name = "GetItems")]
|
||||
fn get_legacy_items(&self) -> zbus::Result<Vec<LegacyCacheItem>>;
|
||||
}
|
||||
101
patches/atspi-proxies/src/collection.rs
vendored
Normal file
101
patches/atspi-proxies/src/collection.rs
vendored
Normal file
|
|
@ -0,0 +1,101 @@
|
|||
//! # [`CollectionProxy`]
|
||||
//!
|
||||
//! A handle to a remote object implementing the `org.a11y.atspi.Collection`
|
||||
//! interface.
|
||||
//!
|
||||
//! `Collection` is the interface which is implemented by objects that contain
|
||||
//! other objects, such as a window or a table.
|
||||
//!
|
||||
//! See the documentation on the individual methods for details:
|
||||
//!
|
||||
//! * [`get_matches`](struct.CollectionProxy.html#method.get_matches)
|
||||
//! * [`get_matches_from`](struct.CollectionProxy.html#method.get_matches_from)
|
||||
//! * [`get_matches_to`](struct.CollectionProxy.html#method.get_matches_to)
|
||||
//!
|
||||
//! [`CollectionProxy`]: crate::collection::CollectionProxy
|
||||
|
||||
use atspi_common::object_ref::ObjectRefOwned;
|
||||
|
||||
use crate::common::{ObjectMatchRule, SortOrder, TreeTraversalType};
|
||||
|
||||
#[zbus::proxy(interface = "org.a11y.atspi.Collection", assume_defaults = true)]
|
||||
pub trait Collection {
|
||||
/// The active descendant of the given object.
|
||||
///
|
||||
/// May not be implemented by any known toolkit or private implementation.
|
||||
///
|
||||
/// See [atspi/collection.c](https://gitlab.gnome.org/GNOME/at-spi2-core/-/blob/main/atspi/atspi-collection.c?ref_type=heads#L272)
|
||||
///
|
||||
fn get_active_descendant(&self) -> zbus::Result<ObjectRefOwned>;
|
||||
|
||||
/// Retrieves a list of objects that match the specified `ObjectMatchRule`, ordered according to `SortOrder` and limited by the count parameter.
|
||||
///
|
||||
/// # Arguments
|
||||
///
|
||||
/// * `rule` - An [`ObjectMatchRule`] describing the match criteria.
|
||||
/// * `sortby` - A [`SortOrder`] specifying the way the results are to be sorted.
|
||||
/// * `count` - The maximum number of results to return, or 0 for no limit.
|
||||
/// * `traverse` - Not supported.
|
||||
///
|
||||
/// [`ObjectMatchRule`]: [`atspi_common::object_match::ObjectMatchRule`]
|
||||
/// [`SortOrder`]: [`atspi_common::SortOrder`]
|
||||
fn get_matches(
|
||||
&self,
|
||||
rule: ObjectMatchRule,
|
||||
sortby: SortOrder,
|
||||
count: i32,
|
||||
traverse: bool,
|
||||
) -> zbus::Result<Vec<ObjectRefOwned>>;
|
||||
|
||||
/// Retrieves objects from the collection, after `current_object`, matching a given `rule`.
|
||||
///
|
||||
/// # Arguments
|
||||
///
|
||||
/// * `current_object` - The object at which to start searching.
|
||||
/// * `rule` - An [`ObjectMatchRule`] describing the match criteria.
|
||||
/// * `sortby` - A [`SortOrder`] specifying the way the results are to be sorted.
|
||||
/// * `tree` - A [`TreeTraversalType`] specifying restrictions on the objects to be traversed.
|
||||
/// * `count` - The maximum number of results to return, or 0 for no limit.
|
||||
/// * `traverse` - Not supported by the known implementation (atk-collection).
|
||||
///
|
||||
/// [`ObjectMatchRule`]: atspi_common::object_match::ObjectMatchRule
|
||||
/// [`SortOrder`]: atspi_common::SortOrder
|
||||
/// [`TreeTraversalType`]: atspi_common::TreeTraversalType
|
||||
fn get_matches_from(
|
||||
&self,
|
||||
current_object: &zbus::wire::ObjectPath<'_>,
|
||||
rule: ObjectMatchRule,
|
||||
sortby: SortOrder,
|
||||
tree: TreeTraversalType,
|
||||
count: i32,
|
||||
traverse: bool,
|
||||
) -> zbus::Result<Vec<ObjectRefOwned>>;
|
||||
|
||||
/// Retrieves objects from the collection, before `current_object`, matching a given `rule`.
|
||||
///
|
||||
/// # Arguments
|
||||
///
|
||||
/// * `current_object` - The object at which to start searching.
|
||||
/// * `rule` - An [`ObjectMatchRule`] describing the match criteria.
|
||||
/// * `sortby` - A [`SortOrder`] specifying the way the results are to be sorted.
|
||||
/// * `tree` - A [`TreeTraversalType`] specifying restrictions on the objects to be traversed.
|
||||
/// * `limit_scope` - If `true`, only descendants of `current_object`'s parent will be returned.
|
||||
/// Otherwise (if `false`), any accessible may be returned if it would preceed `current_object` in a flattened hierarchy.
|
||||
/// * `count` - The maximum number of results to return, or 0 for no limit.
|
||||
/// * `traverse` - Not supported by the known implementation (atk-collection).
|
||||
///
|
||||
/// [`ObjectMatchRule`]: atspi_common::object_match::ObjectMatchRule
|
||||
/// [`SortOrder`]: atspi_common::SortOrder
|
||||
/// [`TreeTraversalType`]: atspi_common::TreeTraversalType
|
||||
#[allow(clippy::too_many_arguments)]
|
||||
fn get_matches_to(
|
||||
&self,
|
||||
current_object: &zbus::wire::ObjectPath<'_>,
|
||||
rule: ObjectMatchRule,
|
||||
sortby: SortOrder,
|
||||
tree: TreeTraversalType,
|
||||
limit_scope: bool,
|
||||
count: i32,
|
||||
traverse: bool,
|
||||
) -> zbus::Result<Vec<ObjectRefOwned>>;
|
||||
}
|
||||
74
patches/atspi-proxies/src/component.rs
vendored
Normal file
74
patches/atspi-proxies/src/component.rs
vendored
Normal file
|
|
@ -0,0 +1,74 @@
|
|||
//! # `DBus` interface proxy for: `org.a11y.atspi.Component`
|
||||
//!
|
||||
//! This code was generated by `zbus-xmlgen` `2.0.1` from `DBus` introspection data.
|
||||
//! Source: `Component.xml`.
|
||||
//!
|
||||
//! You may prefer to adapt it, instead of using it verbatim.
|
||||
//!
|
||||
//! More information can be found in the
|
||||
//! [Writing a client proxy](https://dbus.pages.freedesktop.org/zbus/client.html)
|
||||
//! section of the zbus documentation.
|
||||
//!
|
||||
|
||||
use crate::common::{CoordType, Layer, ScrollType};
|
||||
use atspi_common::object_ref::ObjectRefOwned;
|
||||
|
||||
#[zbus::proxy(interface = "org.a11y.atspi.Component", assume_defaults = true)]
|
||||
pub trait Component {
|
||||
/// `Contains` method
|
||||
fn contains(&self, x: i32, y: i32, coord_type: CoordType) -> zbus::Result<bool>;
|
||||
|
||||
/// `GetAccessibleAtPoint` method
|
||||
/// To get an accessible at a point inside a frame of a particular app, you must use `CoordType::Window`
|
||||
fn get_accessible_at_point(
|
||||
&self,
|
||||
x: i32,
|
||||
y: i32,
|
||||
coord_type: CoordType,
|
||||
) -> zbus::Result<ObjectRefOwned>;
|
||||
|
||||
/// `GetAlpha` method
|
||||
fn get_alpha(&self) -> zbus::Result<f64>;
|
||||
|
||||
/// `GetExtents` method
|
||||
fn get_extents(&self, coord_type: CoordType) -> zbus::Result<(i32, i32, i32, i32)>;
|
||||
|
||||
/// `GetLayer` method
|
||||
fn get_layer(&self) -> zbus::Result<Layer>;
|
||||
|
||||
/// `GetMDIZOrder` method
|
||||
#[zbus(name = "GetMDIZOrder")]
|
||||
fn get_mdiz_order(&self) -> zbus::Result<i16>;
|
||||
|
||||
/// `GetPosition` method
|
||||
/// To get the position of a frame of a particular app, you must use `CoordType::Screen`
|
||||
fn get_position(&self, coord_type: CoordType) -> zbus::Result<(i32, i32)>;
|
||||
|
||||
/// `GetSize` method
|
||||
fn get_size(&self) -> zbus::Result<(i32, i32)>;
|
||||
|
||||
/// `GrabFocus` method
|
||||
fn grab_focus(&self) -> zbus::Result<bool>;
|
||||
|
||||
/// `ScrollTo` method
|
||||
fn scroll_to(&self, type_: ScrollType) -> zbus::Result<bool>;
|
||||
|
||||
/// `ScrollToPoint` method
|
||||
fn scroll_to_point(&self, coord_type: CoordType, x: i32, y: i32) -> zbus::Result<bool>;
|
||||
|
||||
/// `SetExtents` method
|
||||
fn set_extents(
|
||||
&self,
|
||||
x: i32,
|
||||
y: i32,
|
||||
width: i32,
|
||||
height: i32,
|
||||
coord_type: CoordType,
|
||||
) -> zbus::Result<bool>;
|
||||
|
||||
/// `SetPosition` method
|
||||
fn set_position(&self, x: i32, y: i32, coord_type: CoordType) -> zbus::Result<bool>;
|
||||
|
||||
/// `SetSize` method
|
||||
fn set_size(&self, width: i32, height: i32) -> zbus::Result<bool>;
|
||||
}
|
||||
126
patches/atspi-proxies/src/device_event_controller.rs
vendored
Normal file
126
patches/atspi-proxies/src/device_event_controller.rs
vendored
Normal file
|
|
@ -0,0 +1,126 @@
|
|||
//! # `DBus` interface proxy for: `org.a11y.atspi.DeviceEventController`
|
||||
//!
|
||||
//! This code was generated by `zbus-xmlgen` `2.0.1` from `DBus` introspection data.
|
||||
//! Source: `DeviceEventController.xml`.
|
||||
//!
|
||||
//! You may prefer to adapt it, instead of using it verbatim.
|
||||
//!
|
||||
//! More information can be found in the
|
||||
//! [Writing a client proxy](https://dbus.pages.freedesktop.org/zbus/client.html)
|
||||
//! section of the zbus documentation.
|
||||
//!
|
||||
|
||||
use serde::{Deserialize, Serialize};
|
||||
use zbus::wire::Type;
|
||||
|
||||
#[derive(Clone, Copy, Debug, PartialEq, Eq, Serialize, Deserialize, Type)]
|
||||
#[repr(u32)]
|
||||
pub enum EventType {
|
||||
KeyPressed,
|
||||
KeyReleased,
|
||||
ButtonPressed,
|
||||
ButtonReleased,
|
||||
}
|
||||
|
||||
#[derive(Clone, Copy, Debug, PartialEq, Eq, Serialize, Deserialize, Type)]
|
||||
#[repr(u32)]
|
||||
pub enum KeySynthType {
|
||||
Press,
|
||||
Release,
|
||||
Pressrelease,
|
||||
Sym,
|
||||
String,
|
||||
Lockmodifiers,
|
||||
Unlockmodifiers,
|
||||
}
|
||||
|
||||
#[derive(Clone, Copy, Debug, PartialEq, Eq, Serialize, Deserialize, Type)]
|
||||
pub struct DeviceEvent<'a> {
|
||||
pub event_type: EventType,
|
||||
pub id: i32,
|
||||
pub hw_code: i32,
|
||||
pub modifiers: i32,
|
||||
pub timestamp: i32,
|
||||
pub event_string: &'a str,
|
||||
pub is_text: bool,
|
||||
}
|
||||
|
||||
#[derive(Clone, Copy, Debug, PartialEq, Eq, Serialize, Deserialize, Type)]
|
||||
pub struct EventListenerMode {
|
||||
/// Whether events are delivered synchronously, before the currently focused application sees them.
|
||||
/// If `false`, events may be delivered asynchronously, which means in some
|
||||
/// cases they may already have been delivered to the
|
||||
/// application before the AT client receives the notification.
|
||||
pub synchronous: bool,
|
||||
/// Whether events may be consumed by the AT client.
|
||||
/// Requires [`EventListenerMode::synchronous`] to be set to `true`.
|
||||
pub preemptive: bool,
|
||||
/// If `true`, indicates that events are received not from the application toolkit layer,
|
||||
/// but from the device driver or windowing system subsystem.
|
||||
pub global: bool,
|
||||
}
|
||||
|
||||
#[derive(Clone, Copy, Debug, PartialEq, Eq, Serialize, Deserialize, Type)]
|
||||
pub struct KeyDefinition<'a> {
|
||||
pub keycode: i32,
|
||||
pub keysym: i32,
|
||||
pub keystring: &'a str,
|
||||
pub unused: i32,
|
||||
}
|
||||
|
||||
#[zbus::proxy(
|
||||
interface = "org.a11y.atspi.DeviceEventController",
|
||||
default_path = "/org/a11y/atspi/registry/deviceeventcontroller",
|
||||
default_service = "org.a11y.atspi.Registry"
|
||||
)]
|
||||
pub trait DeviceEventController {
|
||||
/// `DeregisterDeviceEventListener` method
|
||||
fn deregister_device_event_listener(
|
||||
&self,
|
||||
listener: &zbus::wire::ObjectPath<'_>,
|
||||
types: EventType,
|
||||
) -> zbus::Result<()>;
|
||||
|
||||
/// `DeregisterKeystrokeListener` method
|
||||
fn deregister_keystroke_listener(
|
||||
&self,
|
||||
listener: &zbus::wire::ObjectPath<'_>,
|
||||
keys: &[KeyDefinition<'_>],
|
||||
mask: u32,
|
||||
type_: EventType,
|
||||
) -> zbus::Result<()>;
|
||||
|
||||
/// `GenerateKeyboardEvent` method
|
||||
fn generate_keyboard_event(
|
||||
&self,
|
||||
keycode: i32,
|
||||
keystring: &str,
|
||||
type_: KeySynthType,
|
||||
) -> zbus::Result<()>;
|
||||
|
||||
/// `GenerateMouseEvent` method
|
||||
fn generate_mouse_event(&self, x: i32, y: i32, event_name: &str) -> zbus::Result<()>;
|
||||
|
||||
/// `NotifyListenersAsync` method
|
||||
fn notify_listeners_async(&self, event: &DeviceEvent<'_>) -> zbus::Result<()>;
|
||||
|
||||
/// `NotifyListenersSync` method
|
||||
fn notify_listeners_sync(&self, event: &DeviceEvent<'_>) -> zbus::Result<bool>;
|
||||
|
||||
/// `RegisterDeviceEventListener` method
|
||||
fn register_device_event_listener(
|
||||
&self,
|
||||
listener: &zbus::wire::ObjectPath<'_>,
|
||||
types: EventType,
|
||||
) -> zbus::Result<bool>;
|
||||
|
||||
/// `RegisterKeystrokeListener` method
|
||||
fn register_keystroke_listener(
|
||||
&self,
|
||||
listener: &zbus::wire::ObjectPath<'_>,
|
||||
keys: &[KeyDefinition<'_>],
|
||||
mask: u32,
|
||||
type_: &[EventType],
|
||||
mode: &EventListenerMode,
|
||||
) -> zbus::Result<bool>;
|
||||
}
|
||||
19
patches/atspi-proxies/src/device_event_listener.rs
vendored
Normal file
19
patches/atspi-proxies/src/device_event_listener.rs
vendored
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
//! # `DBus` interface proxy for: `org.a11y.atspi.DeviceEventListener`
|
||||
//!
|
||||
//! This code was generated by `zbus-xmlgen` `2.0.1` from `DBus` introspection data.
|
||||
//! Source: `DeviceEventListener.xml`.
|
||||
//!
|
||||
//! You may prefer to adapt it, instead of using it verbatim.
|
||||
//!
|
||||
//! More information can be found in the
|
||||
//! [Writing a client proxy](https://dbus.pages.freedesktop.org/zbus/client.html)
|
||||
//! section of the zbus documentation.
|
||||
//!
|
||||
|
||||
use crate::device_event_controller::DeviceEvent;
|
||||
|
||||
#[zbus::proxy(interface = "org.a11y.atspi.DeviceEventListener", assume_defaults = true)]
|
||||
pub trait DeviceEventListener {
|
||||
/// `NotifyEvent` method
|
||||
fn notify_event(&self, event: &DeviceEvent<'_>) -> zbus::Result<bool>;
|
||||
}
|
||||
39
patches/atspi-proxies/src/document.rs
vendored
Normal file
39
patches/atspi-proxies/src/document.rs
vendored
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
//! # `DBus` interface proxy for: `org.a11y.atspi.Document`
|
||||
//!
|
||||
//! This code was generated by `zbus-xmlgen` `2.0.1` from `DBus` introspection data.
|
||||
//! Source: `Document.xml`.
|
||||
//!
|
||||
//! You may prefer to adapt it, instead of using it verbatim.
|
||||
//!
|
||||
//! More information can be found in the
|
||||
//! [Writing a client proxy](https://dbus.pages.freedesktop.org/zbus/client.html)
|
||||
//! section of the zbus documentation.
|
||||
//!
|
||||
|
||||
use crate::common::TextSelection;
|
||||
|
||||
#[zbus::proxy(interface = "org.a11y.atspi.Document", assume_defaults = true)]
|
||||
pub trait Document {
|
||||
/// `GetTextSelections` method
|
||||
fn get_text_selections(&self) -> zbus::Result<Vec<TextSelection>>;
|
||||
|
||||
/// `SetTextSelections` method
|
||||
fn set_text_selections(&self, selections: Vec<TextSelection>) -> zbus::Result<bool>;
|
||||
|
||||
/// `GetAttributeValue` method
|
||||
fn get_attribute_value(&self, attributename: &str) -> zbus::Result<String>;
|
||||
|
||||
/// `GetAttributes` method
|
||||
fn get_attributes(&self) -> zbus::Result<std::collections::HashMap<String, String>>;
|
||||
|
||||
/// `GetLocale` method
|
||||
fn get_locale(&self) -> zbus::Result<String>;
|
||||
|
||||
/// `CurrentPageNumber` property
|
||||
#[zbus(property)]
|
||||
fn current_page_number(&self) -> zbus::Result<i32>;
|
||||
|
||||
/// `PageCount` property
|
||||
#[zbus(property)]
|
||||
fn page_count(&self) -> zbus::Result<i32>;
|
||||
}
|
||||
32
patches/atspi-proxies/src/editable_text.rs
vendored
Normal file
32
patches/atspi-proxies/src/editable_text.rs
vendored
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
//! # `DBus` interface proxy for: `org.a11y.atspi.EditableText`
|
||||
//!
|
||||
//! This code was generated by `zbus-xmlgen` `2.0.1` from `DBus` introspection data.
|
||||
//! Source: `EditableText.xml`.
|
||||
//!
|
||||
//! You may prefer to adapt it, instead of using it verbatim.
|
||||
//!
|
||||
//! More information can be found in the
|
||||
//! [Writing a client proxy](https://dbus.pages.freedesktop.org/zbus/client.html)
|
||||
//! section of the zbus documentation.
|
||||
//!
|
||||
|
||||
#[zbus::proxy(interface = "org.a11y.atspi.EditableText", assume_defaults = true)]
|
||||
pub trait EditableText {
|
||||
/// `CopyText` method
|
||||
fn copy_text(&self, start_pos: i32, end_pos: i32) -> zbus::Result<()>;
|
||||
|
||||
/// `CutText` method
|
||||
fn cut_text(&self, start_pos: i32, end_pos: i32) -> zbus::Result<bool>;
|
||||
|
||||
/// `DeleteText` method
|
||||
fn delete_text(&self, start_pos: i32, end_pos: i32) -> zbus::Result<bool>;
|
||||
|
||||
/// `InsertText` method
|
||||
fn insert_text(&self, position: i32, text: &str, length: i32) -> zbus::Result<bool>;
|
||||
|
||||
/// `PasteText` method
|
||||
fn paste_text(&self, position: i32) -> zbus::Result<bool>;
|
||||
|
||||
/// `SetTextContents` method
|
||||
fn set_text_contents(&self, new_contents: &str) -> zbus::Result<bool>;
|
||||
}
|
||||
38
patches/atspi-proxies/src/hyperlink.rs
vendored
Normal file
38
patches/atspi-proxies/src/hyperlink.rs
vendored
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
//! # `DBus` interface proxy for: `org.a11y.atspi.Hyperlink`
|
||||
//!
|
||||
//! This code was generated by `zbus-xmlgen` `2.0.1` from `DBus` introspection data.
|
||||
//! Source: `Hyperlink.xml`.
|
||||
//!
|
||||
//! You may prefer to adapt it, instead of using it verbatim.
|
||||
//!
|
||||
//! More information can be found in the
|
||||
//! [Writing a client proxy](https://dbus.pages.freedesktop.org/zbus/client.html)
|
||||
//! section of the zbus documentation.
|
||||
//!
|
||||
|
||||
use atspi_common::object_ref::ObjectRefOwned;
|
||||
|
||||
#[zbus::proxy(interface = "org.a11y.atspi.Hyperlink", assume_defaults = true)]
|
||||
pub trait Hyperlink {
|
||||
/// `GetObject` method
|
||||
fn get_object(&self, i: i32) -> zbus::Result<ObjectRefOwned>;
|
||||
|
||||
/// `GetURI` method
|
||||
#[zbus(name = "GetURI")]
|
||||
fn get_uri(&self, i: i32) -> zbus::Result<String>;
|
||||
|
||||
/// `IsValid` method
|
||||
fn is_valid(&self) -> zbus::Result<bool>;
|
||||
|
||||
/// `EndIndex` property
|
||||
#[zbus(property)]
|
||||
fn end_index(&self) -> zbus::Result<i32>;
|
||||
|
||||
/// `NAnchors` property
|
||||
#[zbus(property)]
|
||||
fn n_anchors(&self) -> zbus::Result<i16>;
|
||||
|
||||
/// `StartIndex` property
|
||||
#[zbus(property)]
|
||||
fn start_index(&self) -> zbus::Result<i32>;
|
||||
}
|
||||
25
patches/atspi-proxies/src/hypertext.rs
vendored
Normal file
25
patches/atspi-proxies/src/hypertext.rs
vendored
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
//! # `DBus` interface proxy for: `org.a11y.atspi.Hypertext`
|
||||
//!
|
||||
//! This code was generated by `zbus-xmlgen` `2.0.1` from `DBus` introspection data.
|
||||
//! Source: `Hypertext.xml`.
|
||||
//!
|
||||
//! You may prefer to adapt it, instead of using it verbatim.
|
||||
//!
|
||||
//! More information can be found in the
|
||||
//! [Writing a client proxy](https://dbus.pages.freedesktop.org/zbus/client.html)
|
||||
//! section of the zbus documentation.
|
||||
//!
|
||||
|
||||
use atspi_common::object_ref::ObjectRefOwned;
|
||||
|
||||
#[zbus::proxy(interface = "org.a11y.atspi.Hypertext", assume_defaults = true)]
|
||||
pub trait Hypertext {
|
||||
/// `GetLink` method
|
||||
fn get_link(&self, link_index: i32) -> zbus::Result<ObjectRefOwned>;
|
||||
|
||||
/// `GetLinkIndex` method
|
||||
fn get_link_index(&self, character_index: i32) -> zbus::Result<i32>;
|
||||
|
||||
/// `GetNLinks` method
|
||||
fn get_nlinks(&self) -> zbus::Result<i32>;
|
||||
}
|
||||
33
patches/atspi-proxies/src/image.rs
vendored
Normal file
33
patches/atspi-proxies/src/image.rs
vendored
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
//! # `DBus` interface proxy for: `org.a11y.atspi.Image`
|
||||
//!
|
||||
//! This code was generated by `zbus-xmlgen` `2.0.1` from `DBus` introspection data.
|
||||
//! Source: `Image.xml`.
|
||||
//!
|
||||
//! You may prefer to adapt it, instead of using it verbatim.
|
||||
//!
|
||||
//! More information can be found in the
|
||||
//! [Writing a client proxy](https://dbus.pages.freedesktop.org/zbus/client.html)
|
||||
//! section of the zbus documentation.
|
||||
//!
|
||||
|
||||
use crate::CoordType;
|
||||
|
||||
#[zbus::proxy(interface = "org.a11y.atspi.Image", assume_defaults = true)]
|
||||
pub trait Image {
|
||||
/// `GetImageExtents` method
|
||||
fn get_image_extents(&self, coord_type: CoordType) -> zbus::Result<(i32, i32, i32, i32)>;
|
||||
|
||||
/// `GetImagePosition` method
|
||||
fn get_image_position(&self, coord_type: CoordType) -> zbus::Result<(i32, i32)>;
|
||||
|
||||
/// `GetImageSize` method
|
||||
fn get_image_size(&self) -> zbus::Result<(i32, i32)>;
|
||||
|
||||
/// `ImageDescription` property
|
||||
#[zbus(property)]
|
||||
fn image_description(&self) -> zbus::Result<String>;
|
||||
|
||||
/// `ImageLocale` property
|
||||
#[zbus(property)]
|
||||
fn image_locale(&self) -> zbus::Result<String>;
|
||||
}
|
||||
32
patches/atspi-proxies/src/lib.rs
vendored
Normal file
32
patches/atspi-proxies/src/lib.rs
vendored
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
//! All proxy structures for communicating using AT-SPI.
|
||||
//! Each proxy uses a different interface for communication.
|
||||
|
||||
#![deny(clippy::all, clippy::pedantic, clippy::cargo, unsafe_code, rustdoc::all)]
|
||||
#![allow(clippy::multiple_crate_versions)]
|
||||
|
||||
pub use atspi_common as common;
|
||||
|
||||
pub mod accessible;
|
||||
pub mod action;
|
||||
pub mod application;
|
||||
pub mod bus;
|
||||
pub mod cache;
|
||||
pub mod collection;
|
||||
pub mod component;
|
||||
pub mod device_event_controller;
|
||||
pub mod device_event_listener;
|
||||
pub mod document;
|
||||
pub mod editable_text;
|
||||
pub mod proxy_ext;
|
||||
pub use common::{events, AtspiError, CoordType, Interface, InterfaceSet};
|
||||
|
||||
pub mod hyperlink;
|
||||
pub mod hypertext;
|
||||
pub mod image;
|
||||
pub mod registry;
|
||||
pub mod selection;
|
||||
pub mod socket;
|
||||
pub mod table;
|
||||
pub mod table_cell;
|
||||
pub mod text;
|
||||
pub mod value;
|
||||
307
patches/atspi-proxies/src/proxy_ext.rs
vendored
Normal file
307
patches/atspi-proxies/src/proxy_ext.rs
vendored
Normal file
|
|
@ -0,0 +1,307 @@
|
|||
use crate::{
|
||||
accessible::AccessibleProxy, action::ActionProxy, application::ApplicationProxy,
|
||||
cache::CacheProxy, collection::CollectionProxy, component::ComponentProxy,
|
||||
document::DocumentProxy, editable_text::EditableTextProxy, hyperlink::HyperlinkProxy,
|
||||
hypertext::HypertextProxy, image::ImageProxy, selection::SelectionProxy, table::TableProxy,
|
||||
table_cell::TableCellProxy, text::TextProxy, value::ValueProxy, AtspiError,
|
||||
};
|
||||
use atspi_common::{Interface, InterfaceSet, Result};
|
||||
|
||||
/// Acquire the other interface proxies an object may have implemented.
|
||||
///
|
||||
/// Equip objects with conversions to proxies of the objects' implemented interfaces
|
||||
/// by extending `AccessibleProxy`.
|
||||
///
|
||||
/// The `proxies` method returns a `Proxies` struct.
|
||||
pub trait ProxyExt<'a> {
|
||||
/// Get `Proxies` for the current object.
|
||||
fn proxies(&self) -> impl std::future::Future<Output = Result<Proxies<'a>>>;
|
||||
}
|
||||
|
||||
/// An object for safe conversion to the related interface proxies.
|
||||
#[derive(Clone, Debug)]
|
||||
pub struct Proxies<'a> {
|
||||
interfaces: InterfaceSet,
|
||||
proxy: zbus::Proxy<'a>,
|
||||
}
|
||||
|
||||
impl<'a> ProxyExt<'a> for AccessibleProxy<'a> {
|
||||
async fn proxies(&self) -> Result<Proxies<'a>> {
|
||||
let iface_set: InterfaceSet = self.get_interfaces().await?;
|
||||
let proxy = self.inner().clone();
|
||||
|
||||
Ok(Proxies { interfaces: iface_set, proxy })
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a> Proxies<'a> {
|
||||
/// Get the `Action` interface proxy.
|
||||
///
|
||||
/// # Errors
|
||||
///
|
||||
/// Returns an error if the interface is not available.
|
||||
pub async fn action(&self) -> Result<ActionProxy<'a>> {
|
||||
if self.interfaces.contains(Interface::Action) {
|
||||
Ok(ActionProxy::builder(self.proxy.connection())
|
||||
.cache_properties(zbus::proxy::CacheProperties::No)
|
||||
.destination(self.proxy.destination())
|
||||
.path(self.proxy.path())
|
||||
.build()
|
||||
.await?)
|
||||
} else {
|
||||
Err(AtspiError::InterfaceNotAvailable("Action"))
|
||||
}
|
||||
}
|
||||
|
||||
/// Get the `Application` interface proxy.
|
||||
///
|
||||
/// # Errors
|
||||
///
|
||||
/// Returns an error if the interface is not available.
|
||||
pub async fn application(&self) -> Result<ApplicationProxy<'a>> {
|
||||
if self.interfaces.contains(Interface::Application) {
|
||||
Ok(ApplicationProxy::builder(self.proxy.connection())
|
||||
.cache_properties(zbus::proxy::CacheProperties::No)
|
||||
.destination(self.proxy.destination())
|
||||
.path(self.proxy.path())
|
||||
.build()
|
||||
.await?)
|
||||
} else {
|
||||
Err(AtspiError::InterfaceNotAvailable("Application"))
|
||||
}
|
||||
}
|
||||
|
||||
/// Get the `Cache` interface proxy.
|
||||
///
|
||||
/// # Errors
|
||||
///
|
||||
/// Returns an error if the interface is not available.
|
||||
pub async fn cache(&self) -> Result<CacheProxy<'a>> {
|
||||
if self.interfaces.contains(Interface::Cache) {
|
||||
Ok(CacheProxy::builder(self.proxy.connection())
|
||||
.cache_properties(zbus::proxy::CacheProperties::No)
|
||||
.destination(self.proxy.destination())
|
||||
.path(self.proxy.path())
|
||||
.build()
|
||||
.await?)
|
||||
} else {
|
||||
Err(AtspiError::InterfaceNotAvailable("Cache"))
|
||||
}
|
||||
}
|
||||
|
||||
/// Get the `Collection` interface proxy.
|
||||
///
|
||||
/// # Errors
|
||||
///
|
||||
/// Returns an error if the interface is not available.
|
||||
pub async fn collection(&self) -> Result<CollectionProxy<'a>> {
|
||||
if self.interfaces.contains(Interface::Collection) {
|
||||
Ok(CollectionProxy::builder(self.proxy.connection())
|
||||
.cache_properties(zbus::proxy::CacheProperties::No)
|
||||
.destination(self.proxy.destination())
|
||||
.path(self.proxy.path())
|
||||
.build()
|
||||
.await?)
|
||||
} else {
|
||||
Err(AtspiError::InterfaceNotAvailable("Collection"))
|
||||
}
|
||||
}
|
||||
|
||||
/// Get the `Component` interface proxy.
|
||||
///
|
||||
/// # Errors
|
||||
///
|
||||
/// Returns an error if the interface is not available.
|
||||
pub async fn component(&self) -> Result<ComponentProxy<'a>> {
|
||||
if self.interfaces.contains(Interface::Component) {
|
||||
Ok(ComponentProxy::builder(self.proxy.connection())
|
||||
.cache_properties(zbus::proxy::CacheProperties::No)
|
||||
.destination(self.proxy.destination())
|
||||
.path(self.proxy.path())
|
||||
.build()
|
||||
.await?)
|
||||
} else {
|
||||
Err(AtspiError::InterfaceNotAvailable("Component"))
|
||||
}
|
||||
}
|
||||
|
||||
/// Get the `Document` interface proxy.
|
||||
///
|
||||
/// # Errors
|
||||
///
|
||||
/// Returns an error if the interface is not available.
|
||||
pub async fn document(&self) -> Result<DocumentProxy<'a>> {
|
||||
if self.interfaces.contains(Interface::Document) {
|
||||
Ok(DocumentProxy::builder(self.proxy.connection())
|
||||
.cache_properties(zbus::proxy::CacheProperties::No)
|
||||
.destination(self.proxy.destination())
|
||||
.path(self.proxy.path())
|
||||
.build()
|
||||
.await?)
|
||||
} else {
|
||||
Err(AtspiError::InterfaceNotAvailable("Document"))
|
||||
}
|
||||
}
|
||||
|
||||
/// Get the `EditableText` interface proxy.
|
||||
///
|
||||
/// # Errors
|
||||
///
|
||||
/// Returns an error if the interface is not available.
|
||||
pub async fn editable_text(&self) -> Result<EditableTextProxy<'a>> {
|
||||
if self.interfaces.contains(Interface::EditableText) {
|
||||
Ok(EditableTextProxy::builder(self.proxy.connection())
|
||||
.cache_properties(zbus::proxy::CacheProperties::No)
|
||||
.destination(self.proxy.destination())
|
||||
.path(self.proxy.path())
|
||||
.build()
|
||||
.await?)
|
||||
} else {
|
||||
Err(AtspiError::InterfaceNotAvailable("EditableText"))
|
||||
}
|
||||
}
|
||||
|
||||
/// Get the `Hyperlink` interface proxy.
|
||||
///
|
||||
/// # Errors
|
||||
///
|
||||
/// Returns an error if the interface is not available.
|
||||
pub async fn hyperlink(&self) -> Result<HyperlinkProxy<'a>> {
|
||||
if self.interfaces.contains(Interface::Hyperlink) {
|
||||
Ok(HyperlinkProxy::builder(self.proxy.connection())
|
||||
.cache_properties(zbus::proxy::CacheProperties::No)
|
||||
.destination(self.proxy.destination())
|
||||
.path(self.proxy.path())
|
||||
.build()
|
||||
.await?)
|
||||
} else {
|
||||
Err(AtspiError::InterfaceNotAvailable("Hyperlink"))
|
||||
}
|
||||
}
|
||||
|
||||
/// Get the `Hypertext` interface proxy.
|
||||
///
|
||||
/// # Errors
|
||||
///
|
||||
/// Returns an error if the interface is not available.
|
||||
pub async fn hypertext(&self) -> Result<HypertextProxy<'a>> {
|
||||
if self.interfaces.contains(Interface::Hypertext) {
|
||||
Ok(HypertextProxy::builder(self.proxy.connection())
|
||||
.cache_properties(zbus::proxy::CacheProperties::No)
|
||||
.destination(self.proxy.destination())
|
||||
.path(self.proxy.path())
|
||||
.build()
|
||||
.await?)
|
||||
} else {
|
||||
Err(AtspiError::InterfaceNotAvailable("Hypertext"))
|
||||
}
|
||||
}
|
||||
|
||||
/// Get the `Image` interface proxy.
|
||||
///
|
||||
/// # Errors
|
||||
///
|
||||
/// Returns an error if the interface is not available.
|
||||
pub async fn image(&self) -> Result<ImageProxy<'a>> {
|
||||
if self.interfaces.contains(Interface::Image) {
|
||||
Ok(ImageProxy::builder(self.proxy.connection())
|
||||
.cache_properties(zbus::proxy::CacheProperties::No)
|
||||
.destination(self.proxy.destination())
|
||||
.path(self.proxy.path())
|
||||
.build()
|
||||
.await?)
|
||||
} else {
|
||||
Err(AtspiError::InterfaceNotAvailable("Image"))
|
||||
}
|
||||
}
|
||||
|
||||
/// Get the `Registry` interface proxy.
|
||||
///
|
||||
/// # Errors
|
||||
///
|
||||
/// Returns an error if the interface is not available.
|
||||
pub async fn selection(&self) -> Result<SelectionProxy<'a>> {
|
||||
if self.interfaces.contains(Interface::Selection) {
|
||||
Ok(SelectionProxy::builder(self.proxy.connection())
|
||||
.cache_properties(zbus::proxy::CacheProperties::No)
|
||||
.destination(self.proxy.destination())
|
||||
.path(self.proxy.path())
|
||||
.build()
|
||||
.await?)
|
||||
} else {
|
||||
Err(AtspiError::InterfaceNotAvailable("Selection"))
|
||||
}
|
||||
}
|
||||
|
||||
/// Get the `Table` interface proxy.
|
||||
///
|
||||
/// # Errors
|
||||
///
|
||||
/// Returns an error if the interface is not available.
|
||||
pub async fn table(&self) -> Result<TableProxy<'a>> {
|
||||
if self.interfaces.contains(Interface::Table) {
|
||||
Ok(TableProxy::builder(self.proxy.connection())
|
||||
.cache_properties(zbus::proxy::CacheProperties::No)
|
||||
.destination(self.proxy.destination())
|
||||
.path(self.proxy.path())
|
||||
.build()
|
||||
.await?)
|
||||
} else {
|
||||
Err(AtspiError::InterfaceNotAvailable("Table"))
|
||||
}
|
||||
}
|
||||
|
||||
/// Get the `TableCell` interface proxy.
|
||||
///
|
||||
/// # Errors
|
||||
///
|
||||
/// Returns an error if the interface is not available.
|
||||
pub async fn table_cell(&self) -> Result<TableCellProxy<'a>> {
|
||||
if self.interfaces.contains(Interface::TableCell) {
|
||||
Ok(TableCellProxy::builder(self.proxy.connection())
|
||||
.cache_properties(zbus::proxy::CacheProperties::No)
|
||||
.destination(self.proxy.destination())
|
||||
.path(self.proxy.path())
|
||||
.build()
|
||||
.await?)
|
||||
} else {
|
||||
Err(AtspiError::InterfaceNotAvailable("TableCell"))
|
||||
}
|
||||
}
|
||||
|
||||
/// Get the `Text` interface proxy.
|
||||
///
|
||||
/// # Errors
|
||||
///
|
||||
/// Returns an error if the interface is not available.
|
||||
pub async fn text(&self) -> Result<TextProxy<'a>> {
|
||||
if self.interfaces.contains(Interface::Text) {
|
||||
Ok(TextProxy::builder(self.proxy.connection())
|
||||
.cache_properties(zbus::proxy::CacheProperties::No)
|
||||
.destination(self.proxy.destination())
|
||||
.path(self.proxy.path())
|
||||
.build()
|
||||
.await?)
|
||||
} else {
|
||||
Err(AtspiError::InterfaceNotAvailable("Text"))
|
||||
}
|
||||
}
|
||||
|
||||
/// Get the `Value` interface proxy.
|
||||
///
|
||||
/// # Errors
|
||||
///
|
||||
/// Returns an error if the interface is not available.
|
||||
pub async fn value(&self) -> Result<ValueProxy<'a>> {
|
||||
if self.interfaces.contains(Interface::Value) {
|
||||
Ok(ValueProxy::builder(self.proxy.connection())
|
||||
.cache_properties(zbus::proxy::CacheProperties::No)
|
||||
.destination(self.proxy.destination())
|
||||
.path(self.proxy.path())
|
||||
.build()
|
||||
.await?)
|
||||
} else {
|
||||
Err(AtspiError::InterfaceNotAvailable("Value"))
|
||||
}
|
||||
}
|
||||
}
|
||||
30
patches/atspi-proxies/src/registry.rs
vendored
Normal file
30
patches/atspi-proxies/src/registry.rs
vendored
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
//! # `DBus` interface proxy for: `org.a11y.atspi.Registry`
|
||||
//!
|
||||
//! This code was generated by `zbus-xmlgen` `2.0.1` from `DBus` introspection data.
|
||||
//! Source: `Registry.xml`.
|
||||
//!
|
||||
//! You may prefer to adapt it, instead of using it verbatim.
|
||||
//!
|
||||
//! More information can be found in the
|
||||
//! [Writing a client proxy](https://dbus.pages.freedesktop.org/zbus/client.html)
|
||||
//! section of the zbus documentation.
|
||||
//!
|
||||
|
||||
use zbus::names::OwnedBusName;
|
||||
|
||||
#[zbus::proxy(
|
||||
interface = "org.a11y.atspi.Registry",
|
||||
default_service = "org.a11y.atspi.Registry",
|
||||
default_path = "/org/a11y/atspi/registry"
|
||||
)]
|
||||
pub trait Registry {
|
||||
/// `DeregisterEvent` method
|
||||
fn deregister_event(&self, event: &str) -> zbus::Result<()>;
|
||||
|
||||
/// `GetRegisteredEvents` method
|
||||
#[zbus(name = "GetRegisteredEvents")]
|
||||
fn registered_events(&self) -> zbus::Result<Vec<(OwnedBusName, String)>>;
|
||||
|
||||
/// `RegisterEvent` method
|
||||
fn register_event(&self, event: &str) -> zbus::Result<()>;
|
||||
}
|
||||
1
patches/atspi-proxies/src/result.rs
vendored
Normal file
1
patches/atspi-proxies/src/result.rs
vendored
Normal file
|
|
@ -0,0 +1 @@
|
|||
pub type AtspiResult<T> = Result<T, crate::AtspiError>;
|
||||
40
patches/atspi-proxies/src/selection.rs
vendored
Normal file
40
patches/atspi-proxies/src/selection.rs
vendored
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
//! # `DBus` interface proxy for: `org.a11y.atspi.Selection`
|
||||
//!
|
||||
//! This code was generated by `zbus-xmlgen` `2.0.1` from `DBus` introspection data.
|
||||
//! Source: `Selection.xml`.
|
||||
//!
|
||||
//! You may prefer to adapt it, instead of using it verbatim.
|
||||
//!
|
||||
//! More information can be found in the
|
||||
//! [Writing a client proxy](https://dbus.pages.freedesktop.org/zbus/client.html)
|
||||
//! section of the zbus documentation.
|
||||
//!
|
||||
use atspi_common::object_ref::ObjectRefOwned;
|
||||
|
||||
#[zbus::proxy(interface = "org.a11y.atspi.Selection", assume_defaults = true)]
|
||||
pub trait Selection {
|
||||
/// `ClearSelection` method
|
||||
fn clear_selection(&self) -> zbus::Result<bool>;
|
||||
|
||||
/// `DeselectChild` method
|
||||
fn deselect_child(&self, child_index: i32) -> zbus::Result<bool>;
|
||||
|
||||
/// `DeselectSelectedChild` method
|
||||
fn deselect_selected_child(&self, selected_child_index: i32) -> zbus::Result<bool>;
|
||||
|
||||
/// `GetSelectedChild` method
|
||||
fn get_selected_child(&self, selected_child_index: i32) -> zbus::Result<ObjectRefOwned>;
|
||||
|
||||
/// `IsChildSelected` method
|
||||
fn is_child_selected(&self, child_index: i32) -> zbus::Result<bool>;
|
||||
|
||||
/// `SelectAll` method
|
||||
fn select_all(&self) -> zbus::Result<bool>;
|
||||
|
||||
/// `SelectChild` method
|
||||
fn select_child(&self, child_index: i32) -> zbus::Result<bool>;
|
||||
|
||||
/// `NSelectedChildren` property
|
||||
#[zbus(property)]
|
||||
fn nselected_children(&self) -> zbus::Result<i32>;
|
||||
}
|
||||
48
patches/atspi-proxies/src/socket.rs
vendored
Normal file
48
patches/atspi-proxies/src/socket.rs
vendored
Normal file
|
|
@ -0,0 +1,48 @@
|
|||
//! # `DBus` interface proxy for: `org.a11y.atspi.Socket`
|
||||
//!
|
||||
//! This code was generated by `zbus-xmlgen` `2.0.1` from `DBus` introspection data.
|
||||
//! Source: `Socket.xml`.
|
||||
//!
|
||||
//! You may prefer to adapt it, instead of using it verbatim.
|
||||
//!
|
||||
//! More information can be found in the
|
||||
//! [Writing a client proxy](https://dbus.pages.freedesktop.org/zbus/client.html)
|
||||
//! section of the zbus documentation.
|
||||
//!
|
||||
|
||||
use atspi_common::object_ref::ObjectRefOwned;
|
||||
|
||||
#[zbus::proxy(
|
||||
interface = "org.a11y.atspi.Socket",
|
||||
default_path = "/org/a11y/atspi/accessible/root",
|
||||
default_service = "org.a11y.atspi.Registry"
|
||||
)]
|
||||
pub trait Socket {
|
||||
/// @plug: a string for the unique bus name of the application, and an object path
|
||||
/// for the application's' root object.
|
||||
///
|
||||
/// This is the entry point for an application that wants to register itself against
|
||||
/// the accessibility registry. The application's root object, which it passes in
|
||||
/// @plug, must support the org.a11y.atspi.Application interface.
|
||||
///
|
||||
/// When an application calls this method on the registry, the following handshake happens:
|
||||
///
|
||||
/// * Application calls this method on the registry to identify itself.
|
||||
/// * The registry sets the "Id" property on the org.a11y.atspi.Application interface on the @plug object.
|
||||
/// * The Embed method returns with the bus name and object path for the registry's root object.
|
||||
/// Returns: the bus name and object path of the registry's root object.
|
||||
fn embed(&self, plug: &(&str, zbus::wire::ObjectPath<'_>)) -> zbus::Result<ObjectRefOwned>;
|
||||
|
||||
/// This method is called by a socket to inform the plug that it is being
|
||||
/// embedded. The plug should register the embedding socket as its parent.
|
||||
fn embedded(&self, path: zbus::wire::ObjectPath<'_>) -> zbus::Result<()>;
|
||||
|
||||
/// Unembed method
|
||||
/// @plug: a string for the unique bus name of the application, and an object path
|
||||
/// for the application's' root object.
|
||||
///
|
||||
/// Unregisters an application from the accesibility registry. It is not necessary to
|
||||
/// call this method; the accessibility registry detects when an application
|
||||
/// disconnects from the bus.
|
||||
fn unembed(&self, plug: &(&str, zbus::wire::ObjectPath<'_>)) -> zbus::Result<()>;
|
||||
}
|
||||
103
patches/atspi-proxies/src/table.rs
vendored
Normal file
103
patches/atspi-proxies/src/table.rs
vendored
Normal file
|
|
@ -0,0 +1,103 @@
|
|||
//! # `DBus` interface proxy for: `org.a11y.atspi.Table`
|
||||
//!
|
||||
//! This code was generated by `zbus-xmlgen` `2.0.1` from `DBus` introspection data.
|
||||
//! Source: `Table.xml`.
|
||||
//!
|
||||
//! You may prefer to adapt it, instead of using it verbatim.
|
||||
//!
|
||||
//! More information can be found in the
|
||||
//! [Writing a client proxy](https://dbus.pages.freedesktop.org/zbus/client.html)
|
||||
//! section of the zbus documentation.
|
||||
//!
|
||||
|
||||
use atspi_common::object_ref::ObjectRefOwned;
|
||||
|
||||
#[zbus::proxy(interface = "org.a11y.atspi.Table", assume_defaults = true)]
|
||||
pub trait Table {
|
||||
/// `AddColumnSelection` method
|
||||
fn add_column_selection(&self, column: i32) -> zbus::Result<bool>;
|
||||
|
||||
/// `AddRowSelection` method
|
||||
fn add_row_selection(&self, row: i32) -> zbus::Result<bool>;
|
||||
|
||||
/// `GetAccessibleAt` method
|
||||
fn get_accessible_at(&self, row: i32, column: i32) -> zbus::Result<ObjectRefOwned>;
|
||||
|
||||
/// `GetColumnAtIndex` method
|
||||
fn get_column_at_index(&self, index: i32) -> zbus::Result<i32>;
|
||||
|
||||
/// `GetColumnDescription` method
|
||||
fn get_column_description(&self, column: i32) -> zbus::Result<String>;
|
||||
|
||||
/// `GetColumnExtentAt` method
|
||||
fn get_column_extent_at(&self, row: i32, column: i32) -> zbus::Result<i32>;
|
||||
|
||||
/// `GetColumnHeader` method
|
||||
fn get_column_header(&self, column: i32) -> zbus::Result<ObjectRefOwned>;
|
||||
|
||||
/// `GetIndexAt` method
|
||||
fn get_index_at(&self, row: i32, column: i32) -> zbus::Result<i32>;
|
||||
|
||||
/// `GetRowAtIndex` method
|
||||
fn get_row_at_index(&self, index: i32) -> zbus::Result<i32>;
|
||||
|
||||
/// `GetRowColumnExtentsAtIndex` method
|
||||
fn get_row_column_extents_at_index(
|
||||
&self,
|
||||
index: i32,
|
||||
) -> zbus::Result<(bool, i32, i32, i32, i32, bool)>;
|
||||
|
||||
/// `GetRowDescription` method
|
||||
fn get_row_description(&self, row: i32) -> zbus::Result<String>;
|
||||
|
||||
/// `GetRowExtentAt` method
|
||||
fn get_row_extent_at(&self, row: i32, column: i32) -> zbus::Result<i32>;
|
||||
|
||||
/// `GetRowHeader` method
|
||||
fn get_row_header(&self, row: i32) -> zbus::Result<ObjectRefOwned>;
|
||||
|
||||
/// `GetSelectedColumns` method
|
||||
fn get_selected_columns(&self) -> zbus::Result<Vec<i32>>;
|
||||
|
||||
/// `GetSelectedRows` method
|
||||
fn get_selected_rows(&self) -> zbus::Result<Vec<i32>>;
|
||||
|
||||
/// `IsColumnSelected` method
|
||||
fn is_column_selected(&self, column: i32) -> zbus::Result<bool>;
|
||||
|
||||
/// `IsRowSelected` method
|
||||
fn is_row_selected(&self, row: i32) -> zbus::Result<bool>;
|
||||
|
||||
/// `IsSelected` method
|
||||
fn is_selected(&self, row: i32, column: i32) -> zbus::Result<bool>;
|
||||
|
||||
/// `RemoveColumnSelection` method
|
||||
fn remove_column_selection(&self, column: i32) -> zbus::Result<bool>;
|
||||
|
||||
/// `RemoveRowSelection` method
|
||||
fn remove_row_selection(&self, row: i32) -> zbus::Result<bool>;
|
||||
|
||||
/// `Caption` property
|
||||
#[zbus(property)]
|
||||
fn caption(&self) -> zbus::Result<ObjectRefOwned>;
|
||||
|
||||
/// `NColumns` property
|
||||
#[zbus(property)]
|
||||
fn ncolumns(&self) -> zbus::Result<i32>;
|
||||
|
||||
/// `NRows` property
|
||||
#[zbus(property)]
|
||||
fn nrows(&self) -> zbus::Result<i32>;
|
||||
|
||||
/// `NSelectedColumns` property
|
||||
#[zbus(property)]
|
||||
fn nselected_columns(&self) -> zbus::Result<i32>;
|
||||
|
||||
/// `NSelectedRows` property
|
||||
#[zbus(property)]
|
||||
fn nselected_rows(&self) -> zbus::Result<i32>;
|
||||
|
||||
/// `Summary` property
|
||||
#[zbus(property)]
|
||||
fn summary(&self) -> zbus::Result<ObjectRefOwned>;
|
||||
}
|
||||
41
patches/atspi-proxies/src/table_cell.rs
vendored
Normal file
41
patches/atspi-proxies/src/table_cell.rs
vendored
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
//! # `DBus` interface proxy for: `org.a11y.atspi.TableCell`
|
||||
//!
|
||||
//! This code was generated by `zbus-xmlgen` `2.0.1` from `DBus` introspection data.
|
||||
//! Source: `TableCell.xml`.
|
||||
//!
|
||||
//! You may prefer to adapt it, instead of using it verbatim.
|
||||
//!
|
||||
//! More information can be found in the
|
||||
//! [Writing a client proxy](https://dbus.pages.freedesktop.org/zbus/client.html)
|
||||
//! section of the zbus documentation.
|
||||
//!
|
||||
|
||||
use atspi_common::object_ref::ObjectRefOwned;
|
||||
|
||||
#[zbus::proxy(interface = "org.a11y.atspi.TableCell", assume_defaults = true)]
|
||||
pub trait TableCell {
|
||||
/// `GetColumnHeaderCells` method
|
||||
fn get_column_header_cells(&self) -> zbus::Result<Vec<ObjectRefOwned>>;
|
||||
|
||||
/// `GetRowColumnSpan` method
|
||||
fn get_row_column_span(&self) -> zbus::Result<(bool, i32, i32, i32, i32)>;
|
||||
|
||||
/// `GetRowHeaderCells` method
|
||||
fn get_row_header_cells(&self) -> zbus::Result<Vec<ObjectRefOwned>>;
|
||||
|
||||
/// `ColumnSpan` property
|
||||
#[zbus(property)]
|
||||
fn column_span(&self) -> zbus::Result<i32>;
|
||||
|
||||
/// `Position` property
|
||||
#[zbus(property)]
|
||||
fn position(&self) -> zbus::Result<(i32, i32)>;
|
||||
|
||||
/// `RowSpan` property
|
||||
#[zbus(property)]
|
||||
fn row_span(&self) -> zbus::Result<i32>;
|
||||
|
||||
/// `Table` property
|
||||
#[zbus(property)]
|
||||
fn table(&self) -> zbus::Result<ObjectRefOwned>;
|
||||
}
|
||||
143
patches/atspi-proxies/src/text.rs
vendored
Normal file
143
patches/atspi-proxies/src/text.rs
vendored
Normal file
|
|
@ -0,0 +1,143 @@
|
|||
//! # `DBus` interface proxy for: `org.a11y.atspi.Text`
|
||||
//!
|
||||
//! This code was generated by `zbus-xmlgen` `2.0.1` from `DBus` introspection data.
|
||||
//! Source: `Text.xml`.
|
||||
//!
|
||||
//! You may prefer to adapt it, instead of using it verbatim.
|
||||
//!
|
||||
//! More information can be found in the
|
||||
//! [Writing a client proxy](https://dbus.pages.freedesktop.org/zbus/client.html)
|
||||
//! section of the zbus documentation.
|
||||
//!
|
||||
#![allow(clippy::too_many_arguments)]
|
||||
// this is to silence clippy due to zbus expanding parameter expressions
|
||||
|
||||
use crate::common::{ClipType, CoordType, Granularity};
|
||||
|
||||
#[zbus::proxy(interface = "org.a11y.atspi.Text", assume_defaults = true)]
|
||||
pub trait Text {
|
||||
/// `AddSelection` method
|
||||
fn add_selection(&self, start_offset: i32, end_offset: i32) -> zbus::Result<bool>;
|
||||
|
||||
/// `GetAttributeRun` method
|
||||
fn get_attribute_run(
|
||||
&self,
|
||||
offset: i32,
|
||||
include_defaults: bool,
|
||||
) -> zbus::Result<(std::collections::HashMap<String, String>, i32, i32)>;
|
||||
|
||||
/// `GetAttributeValue` method
|
||||
fn get_attribute_value(&self, offset: i32, attribute_name: &str) -> zbus::Result<String>;
|
||||
|
||||
/// `GetAttributes` method
|
||||
fn get_attributes(
|
||||
&self,
|
||||
offset: i32,
|
||||
) -> zbus::Result<(std::collections::HashMap<String, String>, i32, i32)>;
|
||||
|
||||
/// `GetBoundedRanges` method
|
||||
fn get_bounded_ranges(
|
||||
&self,
|
||||
x: i32,
|
||||
y: i32,
|
||||
width: i32,
|
||||
height: i32,
|
||||
coord_type: CoordType,
|
||||
x_clip_type: ClipType,
|
||||
y_clip_type: ClipType,
|
||||
) -> zbus::Result<Vec<(i32, i32, String, zbus::wire::OwnedVariant)>>;
|
||||
|
||||
/// `GetCharacterAtOffset` method
|
||||
fn get_character_at_offset(&self, offset: i32) -> zbus::Result<i32>;
|
||||
|
||||
/// `GetCharacterExtents` method
|
||||
fn get_character_extents(
|
||||
&self,
|
||||
offset: i32,
|
||||
coord_type: CoordType,
|
||||
) -> zbus::Result<(i32, i32, i32, i32)>;
|
||||
|
||||
/// `GetDefaultAttributeSet` method
|
||||
fn get_default_attribute_set(&self) -> zbus::Result<std::collections::HashMap<String, String>>;
|
||||
|
||||
/// `GetDefaultAttributes` method
|
||||
fn get_default_attributes(&self) -> zbus::Result<std::collections::HashMap<String, String>>;
|
||||
|
||||
/// `GetNSelections` method
|
||||
fn get_nselections(&self) -> zbus::Result<i32>;
|
||||
|
||||
/// `GetOffsetAtPoint` method
|
||||
fn get_offset_at_point(&self, x: i32, y: i32, coord_type: CoordType) -> zbus::Result<i32>;
|
||||
|
||||
/// `GetRangeExtents` method
|
||||
fn get_range_extents(
|
||||
&self,
|
||||
start_offset: i32,
|
||||
end_offset: i32,
|
||||
coord_type: CoordType,
|
||||
) -> zbus::Result<(i32, i32, i32, i32)>;
|
||||
|
||||
/// `GetSelection` method
|
||||
fn get_selection(&self, selection_num: i32) -> zbus::Result<(i32, i32)>;
|
||||
|
||||
/// `GetStringAtOffset` method
|
||||
fn get_string_at_offset(
|
||||
&self,
|
||||
offset: i32,
|
||||
granularity: Granularity,
|
||||
) -> zbus::Result<(String, i32, i32)>;
|
||||
|
||||
/// `GetText` method
|
||||
/// This should be called with explicitly known offsets. Calling with an arbitrary
|
||||
/// large offset can cause undefined behavior or no text to be returned.
|
||||
fn get_text(&self, start_offset: i32, end_offset: i32) -> zbus::Result<String>;
|
||||
|
||||
/// `GetTextAfterOffset` method
|
||||
fn get_text_after_offset(&self, offset: i32, type_: u32) -> zbus::Result<(String, i32, i32)>;
|
||||
|
||||
/// `GetTextAtOffset` method
|
||||
fn get_text_at_offset(&self, offset: i32, type_: u32) -> zbus::Result<(String, i32, i32)>;
|
||||
|
||||
/// `GetTextBeforeOffset` method
|
||||
fn get_text_before_offset(&self, offset: i32, type_: u32) -> zbus::Result<(String, i32, i32)>;
|
||||
|
||||
/// `RemoveSelection` method
|
||||
fn remove_selection(&self, selection_num: i32) -> zbus::Result<bool>;
|
||||
|
||||
/// `ScrollSubstringTo` method
|
||||
fn scroll_substring_to(
|
||||
&self,
|
||||
start_offset: i32,
|
||||
end_offset: i32,
|
||||
type_: u32,
|
||||
) -> zbus::Result<bool>;
|
||||
|
||||
/// `ScrollSubstringToPoint` method
|
||||
fn scroll_substring_to_point(
|
||||
&self,
|
||||
start_offset: i32,
|
||||
end_offset: i32,
|
||||
type_: u32,
|
||||
x: i32,
|
||||
y: i32,
|
||||
) -> zbus::Result<bool>;
|
||||
|
||||
/// `SetCaretOffset` method
|
||||
fn set_caret_offset(&self, offset: i32) -> zbus::Result<bool>;
|
||||
|
||||
/// `SetSelection` method
|
||||
fn set_selection(
|
||||
&self,
|
||||
selection_num: i32,
|
||||
start_offset: i32,
|
||||
end_offset: i32,
|
||||
) -> zbus::Result<bool>;
|
||||
|
||||
/// `CaretOffset` property
|
||||
#[zbus(property)]
|
||||
fn caret_offset(&self) -> zbus::Result<i32>;
|
||||
|
||||
/// `CharacterCount` property
|
||||
#[zbus(property)]
|
||||
fn character_count(&self) -> zbus::Result<i32>;
|
||||
}
|
||||
38
patches/atspi-proxies/src/value.rs
vendored
Normal file
38
patches/atspi-proxies/src/value.rs
vendored
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
//! # `DBus` interface proxy for: `org.a11y.atspi.Value`
|
||||
//!
|
||||
//! This code was generated by `zbus-xmlgen` `2.0.1` from `DBus` introspection data.
|
||||
//! Source: `Value.xml`.
|
||||
//!
|
||||
//! You may prefer to adapt it, instead of using it verbatim.
|
||||
//!
|
||||
//! More information can be found in the
|
||||
//! [Writing a client proxy](https://dbus.pages.freedesktop.org/zbus/client.html)
|
||||
//! section of the zbus documentation.
|
||||
//!
|
||||
|
||||
#[zbus::proxy(interface = "org.a11y.atspi.Value", assume_defaults = true)]
|
||||
pub trait Value {
|
||||
/// `CurrentValue` property
|
||||
#[zbus(property)]
|
||||
fn current_value(&self) -> zbus::Result<f64>;
|
||||
|
||||
/// Set `CurrentValue` property
|
||||
#[zbus(property)]
|
||||
fn set_current_value(&self, value: f64) -> zbus::Result<()>;
|
||||
|
||||
/// `MaximumValue` property
|
||||
#[zbus(property)]
|
||||
fn maximum_value(&self) -> zbus::Result<f64>;
|
||||
|
||||
/// `MinimumIncrement` property
|
||||
#[zbus(property)]
|
||||
fn minimum_increment(&self) -> zbus::Result<f64>;
|
||||
|
||||
/// `MinimumValue` property
|
||||
#[zbus(property)]
|
||||
fn minimum_value(&self) -> zbus::Result<f64>;
|
||||
|
||||
/// `Text` property
|
||||
#[zbus(property)]
|
||||
fn text(&self) -> zbus::Result<String>;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue