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 color_eyre::eyre::{self, eyre};
#[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(_output: &Path) -> impl std::future::Future<Output = eyre::Result<()>> {
unsupported_async()
}
pub fn screenshot_bytes() -> impl std::future::Future<Output = eyre::Result<Vec<u8>>> {
unsupported_async()
}
pub fn screenshot_window(
_window_id: u32,
_output: &Path,
) -> impl std::future::Future<Output = eyre::Result<()>> {
unsupported_async()
}
pub fn screenshot_window_bytes(
_window_id: u32,
) -> impl std::future::Future<Output = eyre::Result<Vec<u8>>> {
unsupported_async()
}
pub fn tap(_x: u32, _y: u32) -> impl std::future::Future<Output = eyre::Result<()>> {
unsupported_async()
}
pub fn swipe(
_from: (u32, u32),
_to: (u32, u32),
_duration_ms: Option<u32>,
) -> impl std::future::Future<Output = eyre::Result<()>> {
unsupported_async()
}
pub fn text(_input: &str) -> impl std::future::Future<Output = eyre::Result<()>> {
unsupported_async()
}
}
pub mod platform;
pub mod toolchain;