pub mod backend;
pub mod device;
pub(crate) mod dynamic_runtime;
#[cfg(target_os = "macos")]
pub mod local;
#[cfg(not(target_os = "macos"))]
pub mod local {
use std::path::Path;
use eyre::eyre;
use crate::toolchain::Host;
#[derive(Debug, Clone)]
pub struct WindowInfo {
pub window_id: u32,
pub name: String,
pub owner_pid: i32,
pub owner_name: String,
pub layer: i32,
}
fn unsupported() -> eyre::Report {
eyre!("apple::local is only supported on macOS")
}
fn unsupported_async<T>() -> impl std::future::Future<Output = eyre::Result<T>> {
std::future::ready(Err(unsupported()))
}
pub fn list_windows_by_pid(_pid: i32) -> eyre::Result<Vec<WindowInfo>> {
Err(unsupported())
}
pub fn screenshot(
_host: &Host,
_output: &Path,
) -> impl std::future::Future<Output = eyre::Result<()>> {
unsupported_async()
}
pub fn screenshot_bytes(
_host: &Host,
) -> impl std::future::Future<Output = eyre::Result<Vec<u8>>> {
unsupported_async()
}
pub fn screenshot_window(
_host: &Host,
_window_id: u32,
_output: &Path,
) -> impl std::future::Future<Output = eyre::Result<()>> {
unsupported_async()
}
pub fn screenshot_window_bytes(
_host: &Host,
_window_id: u32,
) -> impl std::future::Future<Output = eyre::Result<Vec<u8>>> {
unsupported_async()
}
pub fn tap(
_host: &Host,
_x: u32,
_y: u32,
) -> impl std::future::Future<Output = eyre::Result<()>> {
unsupported_async()
}
pub fn swipe(
_host: &Host,
_from: (u32, u32),
_to: (u32, u32),
_duration_ms: Option<u32>,
) -> impl std::future::Future<Output = eyre::Result<()>> {
unsupported_async()
}
pub fn text(_host: &Host, _input: &str) -> impl std::future::Future<Output = eyre::Result<()>> {
unsupported_async()
}
}
pub mod physical;
pub mod platform;
pub mod toolchain;