24 lines
1.2 KiB
Rust
24 lines
1.2 KiB
Rust
use wayvr_ipc::{
|
|
packet_client::WvrProcessLaunchParams,
|
|
packet_server::{WvrProcess, WvrProcessHandle, WvrWindow, WvrWindowHandle},
|
|
};
|
|
|
|
use crate::{config::GeneralConfig, desktop_finder::DesktopFinder};
|
|
|
|
pub trait DashInterface<T> {
|
|
fn window_list(&mut self, data: &mut T) -> anyhow::Result<Vec<WvrWindow>>;
|
|
fn window_set_visible(&mut self, data: &mut T, handle: WvrWindowHandle, visible: bool) -> anyhow::Result<()>;
|
|
fn window_request_close(&mut self, data: &mut T, handle: WvrWindowHandle) -> anyhow::Result<()>;
|
|
fn process_get(&mut self, data: &mut T, handle: WvrProcessHandle) -> Option<WvrProcess>;
|
|
fn process_launch(&mut self, data: &mut T, params: WvrProcessLaunchParams) -> anyhow::Result<WvrProcessHandle>;
|
|
fn process_list(&mut self, data: &mut T) -> anyhow::Result<Vec<WvrProcess>>;
|
|
fn process_terminate(&mut self, data: &mut T, handle: WvrProcessHandle) -> anyhow::Result<()>;
|
|
fn recenter_playspace(&mut self, data: &mut T) -> anyhow::Result<()>;
|
|
fn desktop_finder<'a>(&'a mut self, data: &'a mut T) -> &'a mut DesktopFinder;
|
|
fn general_config<'a>(&'a mut self, data: &'a mut T) -> &'a mut GeneralConfig;
|
|
fn config_changed(&mut self, data: &mut T);
|
|
fn restart(&mut self, data: &mut T);
|
|
}
|
|
|
|
pub type BoxDashInterface<T> = Box<dyn DashInterface<T>>;
|