use serde::{Deserialize, Serialize};
use zbus::{dbus_proxy, zvariant::Type};
#[derive(Clone, Copy, Debug, PartialEq, Eq, Serialize, Deserialize, Type)]
pub enum Layer {
Invalid,
Background,
Canvas,
Widget,
Mdi,
Popup,
Overlay,
Window,
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Serialize, Deserialize, Type)]
pub enum ScrollType {
TopLeft,
BottomRight,
TopEdge,
BottomEdge,
LeftEdge,
RightEdge,
Anywhere,
}
use crate::CoordType;
#[dbus_proxy(interface = "org.a11y.atspi.Component", assume_defaults = true)]
trait Component {
fn contains(&self, x: i32, y: i32, coord_type: CoordType) -> zbus::Result<bool>;
fn get_accessible_at_point(
&self,
x: i32,
y: i32,
coord_type: CoordType,
) -> zbus::Result<(String, zbus::zvariant::OwnedObjectPath)>;
fn get_alpha(&self) -> zbus::Result<f64>;
fn get_extents(&self, coord_type: CoordType) -> zbus::Result<(i32, i32, i32, i32)>;
fn get_layer(&self) -> zbus::Result<Layer>;
fn get_mdizorder(&self) -> zbus::Result<i16>;
fn get_position(&self, coord_type: CoordType) -> zbus::Result<(i32, i32)>;
fn get_size(&self) -> zbus::Result<(i32, i32)>;
fn grab_focus(&self) -> zbus::Result<bool>;
fn scroll_to(&self, type_: ScrollType) -> zbus::Result<bool>;
fn scroll_to_point(&self, coord_type: CoordType, x: i32, y: i32) -> zbus::Result<bool>;
fn set_extents(
&self,
x: i32,
y: i32,
width: i32,
height: i32,
coord_type: CoordType,
) -> zbus::Result<bool>;
fn set_position(&self, x: i32, y: i32, coord_type: CoordType) -> zbus::Result<bool>;
fn set_size(&self, width: i32, height: i32) -> zbus::Result<bool>;
}
use crate::{AtspiProxy, Interface};
impl<'a> AtspiProxy for ComponentProxy<'a> {
const INTERFACE: Interface = Interface::Component;
}