1
0
Fork 0

unify platforms: simplify imports

This commit is contained in:
Joakim Frostegård 2020-11-23 22:26:27 +01:00
parent 6450bff368
commit a8c7c707d2
2 changed files with 6 additions and 6 deletions

View file

@ -58,7 +58,7 @@ impl WindowHandle {
impl Window {
pub fn open<H, B>(options: WindowOpenOptions, build: B) -> WindowHandle
where H: WindowHandler,
B: FnOnce(&mut crate::window::Window) -> H,
B: FnOnce(&mut crate::Window) -> H,
B: Send + 'static
{
let _pool = unsafe { NSAutoreleasePool::new(nil) };
@ -155,7 +155,7 @@ impl Window {
},
};
let window_handler = build(&mut crate::window::Window(&mut window));
let window_handler = build(&mut crate::Window(&mut window));
let window_state_arc = Arc::new(WindowState {
window,
@ -221,7 +221,7 @@ impl <H: WindowHandler>WindowState<H> {
pub(super) fn trigger_event(&mut self, event: Event){
self.window_handler.on_event(
&mut crate::window::Window(&mut self.window),
&mut crate::Window(&mut self.window),
event
);
}

View file

@ -73,7 +73,7 @@ unsafe extern "system" fn wnd_proc<H: WindowHandler>(
if !win_ptr.is_null() {
let window_state = &*(win_ptr as *const RefCell<WindowState<H>>);
let mut window = Window { hwnd };
let mut window = crate::window::Window(&mut window);
let mut window = crate::Window(&mut window);
match msg {
WM_MOUSEMOVE => {
@ -178,7 +178,7 @@ impl WindowHandle {
impl Window {
pub fn open<H, B>(options: WindowOpenOptions, build: B) -> WindowHandle
where H: WindowHandler,
B: FnOnce(&mut crate::window::Window) -> H,
B: FnOnce(&mut crate::Window) -> H,
B: Send + 'static
{
unsafe {
@ -241,7 +241,7 @@ impl Window {
);
// todo: manage error ^
let handler = build(&mut crate::window::Window(&mut Window { hwnd }));
let handler = build(&mut crate::Window(&mut Window { hwnd }));
let window_state = Box::new(RefCell::new(WindowState {
window_class,