diff --git a/Cargo.toml b/Cargo.toml index 0e1d35d..0554e79 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -13,6 +13,7 @@ members = [ "timedate", "upower", "bluez", + "a11y", ] [workspace.dependencies] diff --git a/a11y/Cargo.toml b/a11y/Cargo.toml new file mode 100644 index 0000000..a2b54c2 --- /dev/null +++ b/a11y/Cargo.toml @@ -0,0 +1,7 @@ +[package] +name = "cosmic-dbus-a11y" +version = "0.1.0" +edition = "2021" + +[dependencies] +zbus.workspace = true diff --git a/a11y/src/bus.rs b/a11y/src/bus.rs new file mode 100644 index 0000000..82bb63c --- /dev/null +++ b/a11y/src/bus.rs @@ -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; +} diff --git a/a11y/src/lib.rs b/a11y/src/lib.rs new file mode 100644 index 0000000..9bb6a3d --- /dev/null +++ b/a11y/src/lib.rs @@ -0,0 +1,5 @@ +mod bus; +mod status; + +pub use bus::*; +pub use status::*; diff --git a/a11y/src/status.rs b/a11y/src/status.rs new file mode 100644 index 0000000..7556996 --- /dev/null +++ b/a11y/src/status.rs @@ -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; + #[zbus(property)] + fn set_is_enabled(&self, value: bool) -> zbus::Result<()>; + + /// ScreenReaderEnabled property + #[zbus(property)] + fn screen_reader_enabled(&self) -> zbus::Result; + #[zbus(property)] + fn set_screen_reader_enabled(&self, value: bool) -> zbus::Result<()>; +}