unify platforms: simplify imports
This commit is contained in:
parent
6450bff368
commit
a8c7c707d2
2 changed files with 6 additions and 6 deletions
|
@ -58,7 +58,7 @@ impl WindowHandle {
|
||||||
impl Window {
|
impl Window {
|
||||||
pub fn open<H, B>(options: WindowOpenOptions, build: B) -> WindowHandle
|
pub fn open<H, B>(options: WindowOpenOptions, build: B) -> WindowHandle
|
||||||
where H: WindowHandler,
|
where H: WindowHandler,
|
||||||
B: FnOnce(&mut crate::window::Window) -> H,
|
B: FnOnce(&mut crate::Window) -> H,
|
||||||
B: Send + 'static
|
B: Send + 'static
|
||||||
{
|
{
|
||||||
let _pool = unsafe { NSAutoreleasePool::new(nil) };
|
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 {
|
let window_state_arc = Arc::new(WindowState {
|
||||||
window,
|
window,
|
||||||
|
@ -221,7 +221,7 @@ impl <H: WindowHandler>WindowState<H> {
|
||||||
|
|
||||||
pub(super) fn trigger_event(&mut self, event: Event){
|
pub(super) fn trigger_event(&mut self, event: Event){
|
||||||
self.window_handler.on_event(
|
self.window_handler.on_event(
|
||||||
&mut crate::window::Window(&mut self.window),
|
&mut crate::Window(&mut self.window),
|
||||||
event
|
event
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
@ -73,7 +73,7 @@ unsafe extern "system" fn wnd_proc<H: WindowHandler>(
|
||||||
if !win_ptr.is_null() {
|
if !win_ptr.is_null() {
|
||||||
let window_state = &*(win_ptr as *const RefCell<WindowState<H>>);
|
let window_state = &*(win_ptr as *const RefCell<WindowState<H>>);
|
||||||
let mut window = Window { hwnd };
|
let mut window = Window { hwnd };
|
||||||
let mut window = crate::window::Window(&mut window);
|
let mut window = crate::Window(&mut window);
|
||||||
|
|
||||||
match msg {
|
match msg {
|
||||||
WM_MOUSEMOVE => {
|
WM_MOUSEMOVE => {
|
||||||
|
@ -178,7 +178,7 @@ impl WindowHandle {
|
||||||
impl Window {
|
impl Window {
|
||||||
pub fn open<H, B>(options: WindowOpenOptions, build: B) -> WindowHandle
|
pub fn open<H, B>(options: WindowOpenOptions, build: B) -> WindowHandle
|
||||||
where H: WindowHandler,
|
where H: WindowHandler,
|
||||||
B: FnOnce(&mut crate::window::Window) -> H,
|
B: FnOnce(&mut crate::Window) -> H,
|
||||||
B: Send + 'static
|
B: Send + 'static
|
||||||
{
|
{
|
||||||
unsafe {
|
unsafe {
|
||||||
|
@ -241,7 +241,7 @@ impl Window {
|
||||||
);
|
);
|
||||||
// todo: manage error ^
|
// 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 {
|
let window_state = Box::new(RefCell::new(WindowState {
|
||||||
window_class,
|
window_class,
|
||||||
|
|
Loading…
Add table
Reference in a new issue