use std::ffi; use types::raw; pub struct WinRaw { view: *mut ffi::c_void, } impl From<*mut ffi::c_void> for WinRaw { fn from(value: *mut ffi::c_void) -> Self { Self { view: value } } } unsafe impl Send for WinRaw {} unsafe impl Sync for WinRaw {} impl raw::HasWindowHandle for WinRaw { fn window_handle(&self) -> Result, raw::HandleError> { if let Some(view) = std::ptr::NonNull::new(self.view) { Ok(unsafe { raw::WindowHandle::borrow_raw(raw::RawWindowHandle::AppKit(raw::AppKitWindowHandle::new(view))) }) } else { Err(raw::HandleError::Unavailable) } } } impl raw::HasDisplayHandle for WinRaw { fn display_handle(&self) -> Result, raw::HandleError> { Ok(unsafe { raw::DisplayHandle::borrow_raw(raw::RawDisplayHandle::AppKit(raw::AppKitDisplayHandle::new())) }) } }