diff --git a/src/macos/window.rs b/src/macos/window.rs index aa3cc48..78295fd 100644 --- a/src/macos/window.rs +++ b/src/macos/window.rs @@ -56,7 +56,10 @@ impl WindowHandle { } impl Window { - pub fn open(options: WindowOpenOptions, build: B) -> WindowHandle + pub fn open( + options: WindowOpenOptions, + build: B + ) -> crate::WindowHandle where H: WindowHandler, B: FnOnce(&mut crate::Window) -> H, B: Send + 'static @@ -195,7 +198,7 @@ impl Window { ) } - WindowHandle + crate::WindowHandle(WindowHandle) } } diff --git a/src/win/window.rs b/src/win/window.rs index b5e22ca..75d84ec 100644 --- a/src/win/window.rs +++ b/src/win/window.rs @@ -176,7 +176,10 @@ impl WindowHandle { } impl Window { - pub fn open(options: WindowOpenOptions, build: B) -> WindowHandle + pub fn open( + options: WindowOpenOptions, + build: B + ) -> crate::WindowHandle where H: WindowHandler, B: FnOnce(&mut crate::Window) -> H, B: Send + 'static @@ -252,7 +255,7 @@ impl Window { SetWindowLongPtrA(hwnd, GWLP_USERDATA, Box::into_raw(window_state) as *const _ as _); SetTimer(hwnd, 4242, 13, None); - WindowHandle { hwnd } + crate::WindowHandle(WindowHandle { hwnd }) } } } diff --git a/src/window.rs b/src/window.rs index 9d4c365..0327e16 100644 --- a/src/window.rs +++ b/src/window.rs @@ -9,7 +9,7 @@ use crate::x11 as platform; use crate::macos as platform; -pub struct WindowHandle(platform::WindowHandle); +pub struct WindowHandle(pub(crate) platform::WindowHandle); impl WindowHandle { @@ -31,6 +31,6 @@ impl <'a>Window<'a> { B: FnOnce(&mut Window) -> H, B: Send + 'static { - WindowHandle(platform::Window::open::(options, build)) + platform::Window::open::(options, build) } -} \ No newline at end of file +} diff --git a/src/x11/window.rs b/src/x11/window.rs index 2de1043..946f240 100644 --- a/src/x11/window.rs +++ b/src/x11/window.rs @@ -44,7 +44,10 @@ impl WindowHandle { type WindowOpenResult = Result<(), ()>; impl Window { - pub fn open(options: WindowOpenOptions, build: B) -> WindowHandle + pub fn open( + options: WindowOpenOptions, + build: B + ) -> crate::WindowHandle where H: WindowHandler, B: FnOnce(&mut crate::Window) -> H, B: Send + 'static @@ -60,7 +63,7 @@ impl Window { // FIXME: placeholder types for returning errors in the future let _ = rx.recv(); - WindowHandle { thread } + crate::WindowHandle(WindowHandle { thread }) } fn window_thread(options: WindowOpenOptions, build: B,