Refactor Windows factory code
This commit is contained in:
parent
43a49ccc86
commit
bbf07a0ac0
|
@ -25,9 +25,7 @@ pub fn get_manager() -> impl ClipboardManager {
|
||||||
// WINDOWS IMPLEMENTATION
|
// WINDOWS IMPLEMENTATION
|
||||||
#[cfg(target_os = "windows")]
|
#[cfg(target_os = "windows")]
|
||||||
pub fn get_manager() -> impl ClipboardManager {
|
pub fn get_manager() -> impl ClipboardManager {
|
||||||
let manager = windows::WindowsClipboardManager{};
|
windows::WindowsClipboardManager::new()
|
||||||
manager.initialize();
|
|
||||||
manager
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// MAC IMPLEMENTATION
|
// MAC IMPLEMENTATION
|
||||||
|
|
|
@ -5,11 +5,13 @@ pub struct WindowsClipboardManager {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
impl super::ClipboardManager for WindowsClipboardManager {
|
impl WindowsClipboardManager {
|
||||||
fn initialize(&self) {
|
pub fn new() -> WindowsClipboardManager {
|
||||||
// TODO: check if xclip is present and log an error otherwise.
|
WindowsClipboardManager{}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl super::ClipboardManager for WindowsClipboardManager {
|
||||||
fn get_clipboard(&self) -> Option<String> {
|
fn get_clipboard(&self) -> Option<String> {
|
||||||
unimplemented!();
|
unimplemented!();
|
||||||
}
|
}
|
||||||
|
@ -17,8 +19,4 @@ impl super::ClipboardManager for WindowsClipboardManager {
|
||||||
fn set_clipboard(&self, payload: &str) {
|
fn set_clipboard(&self, payload: &str) {
|
||||||
unimplemented!();
|
unimplemented!();
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
impl WindowsClipboardManager {
|
|
||||||
|
|
||||||
}
|
}
|
|
@ -26,9 +26,7 @@ pub fn get_manager() -> impl SystemManager {
|
||||||
// WINDOWS IMPLEMENTATION
|
// WINDOWS IMPLEMENTATION
|
||||||
#[cfg(target_os = "windows")]
|
#[cfg(target_os = "windows")]
|
||||||
pub fn get_manager() -> impl SystemManager {
|
pub fn get_manager() -> impl SystemManager {
|
||||||
let manager = windows::WindowsSystemManager{};
|
windows::WindowsSystemManager::new()
|
||||||
manager.initialize();
|
|
||||||
manager
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// MAC IMPLEMENTATION
|
// MAC IMPLEMENTATION
|
||||||
|
|
|
@ -5,6 +5,12 @@ pub struct WindowsSystemManager {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl WindowsSystemManager {
|
||||||
|
pub fn new() -> WindowsSystemManager {
|
||||||
|
WindowsSystemManager{}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
impl super::SystemManager for WindowsSystemManager {
|
impl super::SystemManager for WindowsSystemManager {
|
||||||
fn get_current_window_title(&self) -> Option<String> {
|
fn get_current_window_title(&self) -> Option<String> {
|
||||||
unsafe {
|
unsafe {
|
||||||
|
@ -41,10 +47,4 @@ impl super::SystemManager for WindowsSystemManager {
|
||||||
|
|
||||||
None
|
None
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
unsafe impl Send for WindowsSystemManager {}
|
|
||||||
|
|
||||||
impl WindowsSystemManager {
|
|
||||||
|
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user