2019-09-06 22:38:13 +00:00
|
|
|
#[cfg(target_os = "windows")]
|
|
|
|
mod windows;
|
|
|
|
|
|
|
|
#[cfg(target_os = "linux")]
|
|
|
|
mod linux;
|
|
|
|
|
|
|
|
#[cfg(target_os = "macos")]
|
|
|
|
mod macos;
|
|
|
|
|
|
|
|
pub trait ClipboardManager {
|
|
|
|
fn get_clipboard(&self) -> Option<String>;
|
|
|
|
fn set_clipboard(&self, payload: &str);
|
|
|
|
}
|
|
|
|
|
|
|
|
// LINUX IMPLEMENTATION
|
|
|
|
#[cfg(target_os = "linux")]
|
|
|
|
pub fn get_manager() -> impl ClipboardManager {
|
2019-09-13 20:57:53 +00:00
|
|
|
linux::LinuxClipboardManager::new()
|
2019-09-07 20:23:04 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// WINDOWS IMPLEMENTATION
|
|
|
|
#[cfg(target_os = "windows")]
|
|
|
|
pub fn get_manager() -> impl ClipboardManager {
|
2019-09-10 16:23:27 +00:00
|
|
|
windows::WindowsClipboardManager::new()
|
2019-09-09 13:15:01 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// MAC IMPLEMENTATION
|
|
|
|
#[cfg(target_os = "macos")]
|
|
|
|
pub fn get_manager() -> impl ClipboardManager {
|
|
|
|
macos::MacClipboardManager::new()
|
2019-09-06 22:38:13 +00:00
|
|
|
}
|