Impl HasRawDisplayHandle on Window, not WindowHandle
This commit is contained in:
parent
5c23c62030
commit
eb94b4d7ab
|
@ -69,12 +69,6 @@ unsafe impl HasRawWindowHandle for WindowHandle {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
unsafe impl HasRawDisplayHandle for WindowHandle {
|
|
||||||
fn raw_display_handle(&self) -> RawDisplayHandle {
|
|
||||||
RawDisplayHandle::AppKit(AppKitDisplayHandle::empty())
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
struct ParentHandle {
|
struct ParentHandle {
|
||||||
_close_requested: Arc<AtomicBool>,
|
_close_requested: Arc<AtomicBool>,
|
||||||
is_open: Arc<AtomicBool>,
|
is_open: Arc<AtomicBool>,
|
||||||
|
@ -354,7 +348,7 @@ impl Window {
|
||||||
|
|
||||||
#[cfg(feature = "opengl")]
|
#[cfg(feature = "opengl")]
|
||||||
fn create_gl_context(ns_window: Option<id>, ns_view: id, config: GlConfig) -> GlContext {
|
fn create_gl_context(ns_window: Option<id>, ns_view: id, config: GlConfig) -> GlContext {
|
||||||
let mut handle = AppKitHandle::empty();
|
let mut handle = AppKitWindowHandle::empty();
|
||||||
handle.ns_window = ns_window.unwrap_or(ptr::null_mut()) as *mut c_void;
|
handle.ns_window = ns_window.unwrap_or(ptr::null_mut()) as *mut c_void;
|
||||||
handle.ns_view = ns_view as *mut c_void;
|
handle.ns_view = ns_view as *mut c_void;
|
||||||
let handle = RawWindowHandleWrapper { handle: RawWindowHandle::AppKit(handle) };
|
let handle = RawWindowHandleWrapper { handle: RawWindowHandle::AppKit(handle) };
|
||||||
|
@ -493,6 +487,12 @@ unsafe impl HasRawWindowHandle for Window {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
unsafe impl HasRawDisplayHandle for Window {
|
||||||
|
fn raw_display_handle(&self) -> RawDisplayHandle {
|
||||||
|
RawDisplayHandle::AppKit(AppKitDisplayHandle::empty())
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
pub fn copy_to_clipboard(string: &str) {
|
pub fn copy_to_clipboard(string: &str) {
|
||||||
unsafe {
|
unsafe {
|
||||||
let pb = NSPasteboard::generalPasteboard(nil);
|
let pb = NSPasteboard::generalPasteboard(nil);
|
||||||
|
|
|
@ -97,12 +97,6 @@ unsafe impl HasRawWindowHandle for WindowHandle {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
unsafe impl HasRawDisplayHandle for WindowHandle {
|
|
||||||
fn raw_display_handle(&self) -> RawDisplayHandle {
|
|
||||||
RawDisplayHandle::Windows(WindowsDisplayHandle::empty())
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
struct ParentHandle {
|
struct ParentHandle {
|
||||||
is_open: Rc<Cell<bool>>,
|
is_open: Rc<Cell<bool>>,
|
||||||
}
|
}
|
||||||
|
@ -773,6 +767,12 @@ unsafe impl HasRawWindowHandle for Window<'_> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
unsafe impl HasRawDisplayHandle for Window<'_> {
|
||||||
|
fn raw_display_handle(&self) -> RawDisplayHandle {
|
||||||
|
RawDisplayHandle::Windows(WindowsDisplayHandle::empty())
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
pub fn copy_to_clipboard(data: &str) {
|
pub fn copy_to_clipboard(data: &str) {
|
||||||
todo!()
|
todo!()
|
||||||
}
|
}
|
||||||
|
|
|
@ -50,12 +50,6 @@ unsafe impl HasRawWindowHandle for WindowHandle {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
unsafe impl HasRawDisplayHandle for WindowHandle {
|
|
||||||
fn raw_display_handle(&self) -> RawDisplayHandle {
|
|
||||||
self.window_handle.raw_display_handle()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
pub trait WindowHandler {
|
pub trait WindowHandler {
|
||||||
fn on_frame(&mut self, window: &mut Window);
|
fn on_frame(&mut self, window: &mut Window);
|
||||||
fn on_event(&mut self, window: &mut Window, event: Event) -> EventStatus;
|
fn on_event(&mut self, window: &mut Window, event: Event) -> EventStatus;
|
||||||
|
@ -137,6 +131,12 @@ unsafe impl<'a> HasRawWindowHandle for Window<'a> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
unsafe impl<'a> HasRawDisplayHandle for Window<'a> {
|
||||||
|
fn raw_display_handle(&self) -> RawDisplayHandle {
|
||||||
|
self.window.raw_display_handle()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
unsafe impl HasRawWindowHandle for RawWindowHandleWrapper {
|
unsafe impl HasRawWindowHandle for RawWindowHandleWrapper {
|
||||||
fn raw_window_handle(&self) -> RawWindowHandle {
|
fn raw_window_handle(&self) -> RawWindowHandle {
|
||||||
self.handle
|
self.handle
|
||||||
|
|
|
@ -64,12 +64,6 @@ unsafe impl HasRawWindowHandle for WindowHandle {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
unsafe impl HasRawDisplayHandle for WindowHandle {
|
|
||||||
fn raw_display_handle(&self) -> RawDisplayHandle {
|
|
||||||
RawDisplayHandle::Xlib(XlibDisplayHandle::empty())
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
struct ParentHandle {
|
struct ParentHandle {
|
||||||
close_requested: Arc<AtomicBool>,
|
close_requested: Arc<AtomicBool>,
|
||||||
is_open: Arc<AtomicBool>,
|
is_open: Arc<AtomicBool>,
|
||||||
|
@ -703,6 +697,12 @@ unsafe impl HasRawWindowHandle for Window {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
unsafe impl HasRawDisplayHandle for Window {
|
||||||
|
fn raw_display_handle(&self) -> RawDisplayHandle {
|
||||||
|
RawDisplayHandle::Xlib(XlibDisplayHandle::empty())
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
fn mouse_id(id: u8) -> MouseButton {
|
fn mouse_id(id: u8) -> MouseButton {
|
||||||
match id {
|
match id {
|
||||||
1 => MouseButton::Left,
|
1 => MouseButton::Left,
|
||||||
|
|
Loading…
Reference in a new issue