1 | // Copyright 2016 Avraham Weinstock |
2 | // |
3 | // Licensed under the Apache License, Version 2.0 (the "License"); |
4 | // you may not use this file except in compliance with the License. |
5 | // You may obtain a copy of the License at |
6 | // |
7 | // http://www.apache.org/licenses/LICENSE-2.0 |
8 | // |
9 | // Unless required by applicable law or agreed to in writing, software |
10 | // distributed under the License is distributed on an "AS IS" BASIS, |
11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
12 | // See the License for the specific language governing permissions and |
13 | // limitations under the License. |
14 | #![deny (clippy::all, clippy::if_not_else, clippy::enum_glob_use)] |
15 | |
16 | mod common; |
17 | pub use crate::common::ClipboardProvider; |
18 | |
19 | #[cfg (all( |
20 | unix, |
21 | not(any( |
22 | target_os = "macos" , |
23 | target_os = "android" , |
24 | target_os = "ios" , |
25 | target_os = "emscripten" |
26 | )) |
27 | ))] |
28 | #[cfg (feature = "wayland" )] |
29 | pub mod wayland_clipboard; |
30 | #[cfg (all( |
31 | unix, |
32 | not(any( |
33 | target_os = "macos" , |
34 | target_os = "android" , |
35 | target_os = "ios" , |
36 | target_os = "emscripten" |
37 | )) |
38 | ))] |
39 | #[cfg (feature = "x11" )] |
40 | pub mod x11_clipboard; |
41 | |
42 | #[cfg (windows)] |
43 | pub mod windows_clipboard; |
44 | |
45 | #[cfg (target_os = "macos" )] |
46 | pub mod osx_clipboard; |
47 | |
48 | pub mod nop_clipboard; |
49 | |
50 | #[cfg (all( |
51 | unix, |
52 | not(any( |
53 | target_os = "macos" , |
54 | target_os = "android" , |
55 | target_os = "ios" , |
56 | target_os = "emscripten" |
57 | )) |
58 | ))] |
59 | #[cfg (feature = "x11" )] |
60 | pub type ClipboardContext = x11_clipboard::X11ClipboardContext; |
61 | #[cfg (windows)] |
62 | pub type ClipboardContext = windows_clipboard::WindowsClipboardContext; |
63 | #[cfg (target_os = "macos" )] |
64 | pub type ClipboardContext = osx_clipboard::OSXClipboardContext; |
65 | #[cfg (target_os = "android" )] |
66 | pub type ClipboardContext = nop_clipboard::NopClipboardContext; // TODO: implement AndroidClipboardContext |
67 | #[cfg (target_os = "ios" )] |
68 | pub type ClipboardContext = nop_clipboard::NopClipboardContext; // TODO: implement IOSClipboardContext |
69 | #[cfg (not(any( |
70 | unix, |
71 | windows, |
72 | target_os = "macos" , |
73 | target_os = "android" , |
74 | target_os = "ios" , |
75 | target_os = "emscripten" |
76 | )))] |
77 | pub type ClipboardContext = nop_clipboard::NopClipboardContext; |
78 | |