diff --git a/macos/src/lib.rs b/macos/src/lib.rs index 19f5ca3..ca9047e 100644 --- a/macos/src/lib.rs +++ b/macos/src/lib.rs @@ -11,6 +11,8 @@ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. +#[macro_use] +extern crate objc; use objc::runtime::{Class, Object}; use objc_foundation::{INSArray, INSObject, INSString}; @@ -40,7 +42,7 @@ impl Clipboard { Ok(Clipboard { pasteboard }) } - fn read(&self) -> Result> { + pub fn read(&self) -> Result> { let string_class: Id = { let cls: Id = unsafe { Id::from_ptr(class("NSString")) }; unsafe { transmute(cls) } @@ -66,7 +68,7 @@ impl Clipboard { } } - fn write(&mut self, data: String) -> Result<(), Box> { + pub fn write(&mut self, data: String) -> Result<(), Box> { let string_array = NSArray::from_vec(vec![NSString::from_str(&data)]); let _: usize = unsafe { msg_send![self.pasteboard, clearContents] }; let success: bool = diff --git a/src/platform/not_linux.rs b/src/platform/not_linux.rs index c2d7616..5311d38 100644 --- a/src/platform/not_linux.rs +++ b/src/platform/not_linux.rs @@ -1,5 +1,8 @@ use crate::ClipboardProvider; +use raw_window_handle::HasRawWindowHandle; +use std::error::Error; + pub fn new_clipboard( _window: &W, ) -> Result, Box> {