@@ -9,11 +9,12 @@ use cocoa::{
9
9
} ,
10
10
} ;
11
11
use core_graphics:: display:: CGDisplay ;
12
+ use dispatch:: ffi:: { dispatch_async_f, dispatch_get_main_queue, dispatch_sync_f} ;
12
13
use objc:: runtime:: { BOOL , Class , Object , Sel , YES } ;
13
14
14
15
pub use util:: * ;
15
16
use { dpi:: LogicalSize , window:: MouseCursor } ;
16
- use platform_impl:: platform:: { dispatch :: * , ffi, window:: SharedState } ;
17
+ use platform_impl:: platform:: { ffi, window:: SharedState } ;
17
18
18
19
pub const EMPTY_RANGE : ffi:: NSRange = ffi:: NSRange {
19
20
location : ffi:: NSNotFound as NSUInteger ,
@@ -115,15 +116,15 @@ pub unsafe fn set_style_mask_async(nswindow: id, nsview: id, mask: NSWindowStyle
115
116
dispatch_async_f (
116
117
dispatch_get_main_queue ( ) ,
117
118
context as * mut _ ,
118
- Some ( set_style_mask_callback) ,
119
+ set_style_mask_callback,
119
120
) ;
120
121
}
121
122
pub unsafe fn set_style_mask_sync ( nswindow : id , nsview : id , mask : NSWindowStyleMask ) {
122
123
let context = SetStyleMaskData :: new_ptr ( nswindow, nsview, mask) ;
123
124
dispatch_sync_f (
124
125
dispatch_get_main_queue ( ) ,
125
126
context as * mut _ ,
126
- Some ( set_style_mask_callback) ,
127
+ set_style_mask_callback,
127
128
) ;
128
129
}
129
130
@@ -162,7 +163,7 @@ pub unsafe fn set_content_size_async(nswindow: id, size: LogicalSize) {
162
163
dispatch_async_f (
163
164
dispatch_get_main_queue ( ) ,
164
165
context as * mut _ ,
165
- Some ( set_content_size_callback) ,
166
+ set_content_size_callback,
166
167
) ;
167
168
}
168
169
@@ -195,7 +196,7 @@ pub unsafe fn set_frame_top_left_point_async(nswindow: id, point: NSPoint) {
195
196
dispatch_async_f (
196
197
dispatch_get_main_queue ( ) ,
197
198
context as * mut _ ,
198
- Some ( set_frame_top_left_point_callback) ,
199
+ set_frame_top_left_point_callback,
199
200
) ;
200
201
}
201
202
@@ -227,7 +228,7 @@ pub unsafe fn set_level_async(nswindow: id, level: ffi::NSWindowLevel) {
227
228
dispatch_async_f (
228
229
dispatch_get_main_queue ( ) ,
229
230
context as * mut _ ,
230
- Some ( set_level_callback) ,
231
+ set_level_callback,
231
232
) ;
232
233
}
233
234
@@ -298,7 +299,7 @@ pub unsafe fn toggle_full_screen_async(
298
299
dispatch_async_f (
299
300
dispatch_get_main_queue ( ) ,
300
301
context as * mut _ ,
301
- Some ( toggle_full_screen_callback) ,
302
+ toggle_full_screen_callback,
302
303
) ;
303
304
}
304
305
@@ -327,7 +328,7 @@ pub unsafe fn order_out_async(nswindow: id) {
327
328
dispatch_async_f (
328
329
dispatch_get_main_queue ( ) ,
329
330
context as * mut _ ,
330
- Some ( order_out_callback) ,
331
+ order_out_callback,
331
332
) ;
332
333
}
333
334
@@ -356,7 +357,7 @@ pub unsafe fn make_key_and_order_front_async(nswindow: id) {
356
357
dispatch_async_f (
357
358
dispatch_get_main_queue ( ) ,
358
359
context as * mut _ ,
359
- Some ( make_key_and_order_front_callback) ,
360
+ make_key_and_order_front_callback,
360
361
) ;
361
362
}
362
363
@@ -387,7 +388,7 @@ pub unsafe fn close_async(nswindow: id) {
387
388
dispatch_async_f (
388
389
dispatch_get_main_queue ( ) ,
389
390
context as * mut _ ,
390
- Some ( close_callback) ,
391
+ close_callback,
391
392
) ;
392
393
}
393
394
0 commit comments