pub struct LinuxDesktopBackend;Expand description
Linux desktop backend. Methods are implemented in this module.
Trait Implementations§
Source§impl Clone for LinuxDesktopBackend
impl Clone for LinuxDesktopBackend
impl Copy for LinuxDesktopBackend
Source§impl Debug for LinuxDesktopBackend
impl Debug for LinuxDesktopBackend
Source§impl Default for LinuxDesktopBackend
impl Default for LinuxDesktopBackend
Source§impl DesktopBackend for LinuxDesktopBackend
impl DesktopBackend for LinuxDesktopBackend
Source§fn screenshot(&self, region: Option<Region>) -> Result<Frame, ComputerError>
fn screenshot(&self, region: Option<Region>) -> Result<Frame, ComputerError>
Capture the desktop, or a logical region of it, as RGBA pixels.
Source§fn move_mouse(&self, x: i32, y: i32) -> Result<(), ComputerError>
fn move_mouse(&self, x: i32, y: i32) -> Result<(), ComputerError>
Move the pointer without clicking.
Source§fn simulate_click(
&self,
x: i32,
y: i32,
button: MouseButton,
) -> Result<(), ComputerError>
fn simulate_click( &self, x: i32, y: i32, button: MouseButton, ) -> Result<(), ComputerError>
Move the pointer to
(x, y) and click once.Source§fn simulate_type(&self, text: &str) -> Result<(), ComputerError>
fn simulate_type(&self, text: &str) -> Result<(), ComputerError>
Type Unicode text into the focused control.
Source§fn simulate_key(
&self,
modifiers: &[Modifier],
key: &str,
) -> Result<(), ComputerError>
fn simulate_key( &self, modifiers: &[Modifier], key: &str, ) -> Result<(), ComputerError>
Press modifiers, tap
key, then release the modifiers. Read moreSource§fn simulate_scroll(&self, dx: i32, dy: i32) -> Result<(), ComputerError>
fn simulate_scroll(&self, dx: i32, dy: i32) -> Result<(), ComputerError>
Scroll by wheel steps. Positive
dy scrolls down. Positive dx scrolls right.Source§fn cursor_position(&self) -> Result<(i32, i32), ComputerError>
fn cursor_position(&self) -> Result<(i32, i32), ComputerError>
Current pointer position in logical pixels.
Source§fn list_displays(&self) -> Result<Vec<DisplayInfo>, ComputerError>
fn list_displays(&self) -> Result<Vec<DisplayInfo>, ComputerError>
Connected displays. Does not capture pixels.
Source§fn display_block(&self) -> Option<ComputerError>
fn display_block(&self) -> Option<ComputerError>
Locked, asleep, or no display.
None when capture may proceed. Read moreSource§fn frontmost(&self) -> FrontmostInfo
fn frontmost(&self) -> FrontmostInfo
Frontmost application and window. Never panics; missing data is
None.Source§fn inspect_accessibility(
&self,
app_name: Option<&str>,
) -> Result<String, ComputerError>
fn inspect_accessibility( &self, app_name: Option<&str>, ) -> Result<String, ComputerError>
Accessibility tree as a JSON string, when the platform can produce one.
Source§fn list_apps(&self, all: bool) -> Result<Vec<AppInfo>, ComputerError>
fn list_apps(&self, all: bool) -> Result<Vec<AppInfo>, ComputerError>
Running applications.
all includes accessory and prohibited apps.Source§fn list_windows(&self) -> Result<WindowList, ComputerError>
fn list_windows(&self) -> Result<WindowList, ComputerError>
On-screen windows in z-order. Index 0 is front.
Source§fn launch(&self, app: &str) -> Result<LaunchResult, ComputerError>
fn launch(&self, app: &str) -> Result<LaunchResult, ComputerError>
Launch an application by name, bundle id, or path.
Source§fn activate(
&self,
app: &str,
window: Option<&str>,
) -> Result<LaunchResult, ComputerError>
fn activate( &self, app: &str, window: Option<&str>, ) -> Result<LaunchResult, ComputerError>
Bring an application forward.
window selects a window inside it.Source§fn quit(&self, app: &str, force: bool) -> Result<QuitResult, ComputerError>
fn quit(&self, app: &str, force: bool) -> Result<QuitResult, ComputerError>
Ask an application to quit.
force uses a forced terminate where the OS has one.Source§fn doctor(&self, options: DoctorOptions) -> Result<DoctorReport, ComputerError>
fn doctor(&self, options: DoctorOptions) -> Result<DoctorReport, ComputerError>
Permission probe.
options.prompt may show a system prompt on macOS. Read moreSource§fn tree(&self, query: &TreeQuery) -> Result<TreeReport, ComputerError>
fn tree(&self, query: &TreeQuery) -> Result<TreeReport, ComputerError>
Numbered accessibility tree for the key window.
Source§fn end_session(&self, session: Option<&str>) -> Result<Vec<i32>, ComputerError>
fn end_session(&self, session: Option<&str>) -> Result<Vec<i32>, ComputerError>
Restore accessibility flags recorded for
session. Read moreSource§fn element_action(
&self,
request: &ElementRequest,
) -> Result<ElementOutcome, ElementError>
fn element_action( &self, request: &ElementRequest, ) -> Result<ElementOutcome, ElementError>
Press, focus, set a value, select text, perform an action, scroll, or type
into one cached element. The element is revalidated before the action.
Source§fn perform_input(&self, job: &InputJob) -> Result<InputReport, ComputerError>
fn perform_input(&self, job: &InputJob) -> Result<InputReport, ComputerError>
Run one input tier. The default posts nothing. Read more
Source§fn capture_screen(
&self,
region: Option<Region>,
) -> Result<RawCapture, ComputerError>
fn capture_screen( &self, region: Option<Region>, ) -> Result<RawCapture, ComputerError>
Desktop or region capture plus the map inputs (origin and logical size).
Source§fn capture_window(
&self,
target: &WindowTarget,
) -> Result<RawCapture, ComputerError>
fn capture_window( &self, target: &WindowTarget, ) -> Result<RawCapture, ComputerError>
Capture one window. macOS uses ScreenCaptureKit. Other platforms crop
the desktop image when the bounds are known.
Walk
app’s menu bar. The macOS backend uses
AXMenuBar -> AXMenuBarItem -> AXMenu. Other platforms return
unsupported. depth caps recursion; out-of-depth submenus are
reported as a single placeholder child.Press one menu item by
">"-separated titles. A miss is
element_not_found. A disabled item is execution_failed.Source§fn apple_event(
&self,
_app: &str,
_script: &str,
_language: AppleEventLanguage,
) -> Result<AppleEventReport, ComputerError>
fn apple_event( &self, _app: &str, _script: &str, _language: AppleEventLanguage, ) -> Result<AppleEventReport, ComputerError>
Run an Apple event via
osascript. macOS only. script is the body
passed with -e; it never goes through a shell. The script body is
never logged verbatim; only its byte count and SHA-256 are recorded.Source§fn dock_list(&self) -> Result<DockListReport, ComputerError>
fn dock_list(&self) -> Result<DockListReport, ComputerError>
List Dock items. macOS only.
Source§fn dock_click(&self, _title: &str) -> Result<DockClickReport, ComputerError>
fn dock_click(&self, _title: &str) -> Result<DockClickReport, ComputerError>
Click a Dock item by title. macOS only. A miss is
element_not_found.Source§fn spaces(&self) -> Result<SpacesReport, ComputerError>
fn spaces(&self) -> Result<SpacesReport, ComputerError>
Group on-screen windows by the screen that contains each window’s
center. Mission Control moves are not attempted; the skylight feature,
when active, may opt into best-effort space moves.
Source§fn browser_url(&self, pid: i32) -> Result<Option<String>, ComputerError>
fn browser_url(&self, pid: i32) -> Result<Option<String>, ComputerError>
Page URL for a browser process.
Ok(None) when the platform has no URL. Read moreSource§fn peek_element(
&self,
app: Option<&str>,
window: Option<&str>,
session: Option<&str>,
index: u32,
) -> Result<Option<ElementPeek>, ComputerError>
fn peek_element( &self, app: Option<&str>, window: Option<&str>, session: Option<&str>, index: u32, ) -> Result<Option<ElementPeek>, ComputerError>
Title and secure bit of a cached element.
Ok(None) when it is not cached. Read moreSource§fn user_input_pause_warning(&self) -> Option<&'static str>
fn user_input_pause_warning(&self) -> Option<&'static str>
Install the listen-only user-input tap when this process should pause. Read more
Source§fn hit_test(&self, x: i32, y: i32) -> Result<Option<HitInfo>, ComputerError>
fn hit_test(&self, x: i32, y: i32) -> Result<Option<HitInfo>, ComputerError>
Hit-test a screen point. macOS reports the element under the point.
Other platforms return
Ok(None) and the coordinate click still runs.Source§fn input_support(&self) -> Capabilities
fn input_support(&self) -> Capabilities
Whether background event posting exists. The stub overrides this.
Source§fn marks_for_tree(
&self,
_query: &TreeQuery,
_map: &ScreenshotMap,
) -> Result<Vec<MarkBox>, ComputerError>
fn marks_for_tree( &self, _query: &TreeQuery, _map: &ScreenshotMap, ) -> Result<Vec<MarkBox>, ComputerError>
Walk the latest tree and return rectangles in image pixels plus the
label to draw (
n for tree index). The screenshot command uses
these for the --marks overlay. Read moreSource§fn recognize_text(
&self,
_image: &RgbaImage,
_map: &ScreenshotMap,
) -> Result<OcrResult, ComputerError>
fn recognize_text( &self, _image: &RgbaImage, _map: &ScreenshotMap, ) -> Result<OcrResult, ComputerError>
Run OCR on one captured image and return the redacted, screen-remapped
blocks.
image is the prepared shot’s pixels.Source§fn secure_ocr_frames(
&self,
_query: &TreeQuery,
_map: &ScreenshotMap,
) -> Result<Vec<ImageRect>, ComputerError>
fn secure_ocr_frames( &self, _query: &TreeQuery, _map: &ScreenshotMap, ) -> Result<Vec<ImageRect>, ComputerError>
Image-pixel rectangles of every secure element in the latest tree.
The OCR dispatcher drops recognized text whose block falls inside
any of these rectangles. The default returns an empty list, which
matches every non-macOS platform and the mock backend. Read more
Source§fn clipboard_get(&self) -> Result<ClipboardContents, ComputerError>
fn clipboard_get(&self) -> Result<ClipboardContents, ComputerError>
Read the clipboard. The default uses the system pasteboard outside tests. Read more
Source§fn clipboard_set_text(&self, text: &str) -> Result<(), ComputerError>
fn clipboard_set_text(&self, text: &str) -> Result<(), ComputerError>
Write clipboard text. Empty text is refused before this is called.
Source§fn clipboard_set_image(
&self,
width: u32,
height: u32,
rgba: &[u8],
) -> Result<(), ComputerError>
fn clipboard_set_image( &self, width: u32, height: u32, rgba: &[u8], ) -> Result<(), ComputerError>
Write an RGBA image to the clipboard.
Source§fn release_held(&self) -> Result<(), ComputerError>
fn release_held(&self) -> Result<(), ComputerError>
Release mouse buttons and keys this process still holds. Read more
Auto Trait Implementations§
impl Freeze for LinuxDesktopBackend
impl RefUnwindSafe for LinuxDesktopBackend
impl Send for LinuxDesktopBackend
impl Sync for LinuxDesktopBackend
impl Unpin for LinuxDesktopBackend
impl UnsafeUnpin for LinuxDesktopBackend
impl UnwindSafe for LinuxDesktopBackend
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more