feat: a11y

This commit is contained in:
Ashley Wulber 2024-10-31 18:09:09 -04:00 committed by Ashley Wulber
parent 931f5db558
commit 6210012924
5 changed files with 84 additions and 0 deletions

View file

@ -13,6 +13,7 @@ members = [
"timedate",
"upower",
"bluez",
"a11y",
]
[workspace.dependencies]

7
a11y/Cargo.toml Normal file
View file

@ -0,0 +1,7 @@
[package]
name = "cosmic-dbus-a11y"
version = "0.1.0"
edition = "2021"
[dependencies]
zbus.workspace = true

31
a11y/src/bus.rs Normal file
View file

@ -0,0 +1,31 @@
//! # D-Bus interface proxy for: `org.a11y.Bus`
//!
//! This code was generated by `zbus-xmlgen` `5.0.0` from D-Bus introspection data.
//! Source: `Interface '/org/a11y/bus' from service 'org.a11y.Bus' on system bus`.
//!
//! You may prefer to adapt it, instead of using it verbatim.
//!
//! More information can be found in the [Writing a client proxy] section of the zbus
//! documentation.
//!
//! This type implements the [D-Bus standard interfaces], (`org.freedesktop.DBus.*`) for which the
//! following zbus API can be used:
//!
//! * [`zbus::fdo::PropertiesProxy`]
//! * [`zbus::fdo::IntrospectableProxy`]
//! * [`zbus::fdo::PeerProxy`]
//!
//! Consequently `zbus-xmlgen` did not generate code for the above interfaces.
//!
//! [Writing a client proxy]: https://dbus2.github.io/zbus/client.html
//! [D-Bus standard interfaces]: https://dbus.freedesktop.org/doc/dbus-specification.html#standard-interfaces,
use zbus::proxy;
#[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>;
}

5
a11y/src/lib.rs Normal file
View file

@ -0,0 +1,5 @@
mod bus;
mod status;
pub use bus::*;
pub use status::*;

40
a11y/src/status.rs Normal file
View file

@ -0,0 +1,40 @@
//! # D-Bus interface proxy for: `org.a11y.Status`
//!
//! This code was generated by `zbus-xmlgen` `5.0.0` from D-Bus introspection data.
//! Source: `Interface '/org/a11y/bus' from service 'org.a11y.Bus' on system bus`.
//!
//! You may prefer to adapt it, instead of using it verbatim.
//!
//! More information can be found in the [Writing a client proxy] section of the zbus
//! documentation.
//!
//! This type implements the [D-Bus standard interfaces], (`org.freedesktop.DBus.*`) for which the
//! following zbus API can be used:
//!
//! * [`zbus::fdo::PropertiesProxy`]
//! * [`zbus::fdo::IntrospectableProxy`]
//! * [`zbus::fdo::PeerProxy`]
//!
//! Consequently `zbus-xmlgen` did not generate code for the above interfaces.
//!
//! [Writing a client proxy]: https://dbus2.github.io/zbus/client.html
//! [D-Bus standard interfaces]: https://dbus.freedesktop.org/doc/dbus-specification.html#standard-interfaces,
use zbus::proxy;
#[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<()>;
}