1pub mod backend;
5pub mod device;
7pub(crate) mod dynamic_runtime;
8#[cfg(target_os = "macos")]
10pub mod local;
11#[cfg(not(target_os = "macos"))]
13pub mod local {
14 use std::path::Path;
15
16 use eyre::eyre;
17
18 use crate::toolchain::Host;
19
20 #[derive(Debug, Clone)]
22 pub struct WindowInfo {
23 pub window_id: u32,
25 pub name: String,
27 pub owner_pid: i32,
29 pub owner_name: String,
31 pub layer: i32,
33 }
34
35 fn unsupported() -> eyre::Report {
36 eyre!("apple::local is only supported on macOS")
37 }
38
39 fn unsupported_async<T>() -> impl std::future::Future<Output = eyre::Result<T>> {
40 std::future::ready(Err(unsupported()))
41 }
42
43 pub fn list_windows_by_pid(_pid: i32) -> eyre::Result<Vec<WindowInfo>> {
49 Err(unsupported())
50 }
51
52 pub fn screenshot(
54 _host: &Host,
55 _output: &Path,
56 ) -> impl std::future::Future<Output = eyre::Result<()>> {
57 unsupported_async()
58 }
59
60 pub fn screenshot_bytes(
62 _host: &Host,
63 ) -> impl std::future::Future<Output = eyre::Result<Vec<u8>>> {
64 unsupported_async()
65 }
66
67 pub fn screenshot_window(
69 _host: &Host,
70 _window_id: u32,
71 _output: &Path,
72 ) -> impl std::future::Future<Output = eyre::Result<()>> {
73 unsupported_async()
74 }
75
76 pub fn screenshot_window_bytes(
78 _host: &Host,
79 _window_id: u32,
80 ) -> impl std::future::Future<Output = eyre::Result<Vec<u8>>> {
81 unsupported_async()
82 }
83
84 pub fn tap(
86 _host: &Host,
87 _x: u32,
88 _y: u32,
89 ) -> impl std::future::Future<Output = eyre::Result<()>> {
90 unsupported_async()
91 }
92
93 pub fn swipe(
95 _host: &Host,
96 _from: (u32, u32),
97 _to: (u32, u32),
98 _duration_ms: Option<u32>,
99 ) -> impl std::future::Future<Output = eyre::Result<()>> {
100 unsupported_async()
101 }
102
103 pub fn text(_host: &Host, _input: &str) -> impl std::future::Future<Output = eyre::Result<()>> {
105 unsupported_async()
106 }
107}
108pub mod physical;
110pub mod platform;
111pub mod toolchain;