Make size/position types generic over pixel type (#1277)

* Begin implementing DPI generics

* Fix multithreaded example

* Format

* Fix serde test

* hopefully fix most of the errors

* Fix dpi module errors

* More error fixings

* Format

* fix macos errors

* Another error pass

* Replace bad type signatures

* more fixins
This commit is contained in:
Osspial 2020-01-04 01:33:07 -05:00
parent b16042a047
commit 3a1e694c2f
40 changed files with 388 additions and 336 deletions

View file

@ -73,10 +73,10 @@ pub unsafe fn set_style_mask_sync(ns_window: id, ns_view: id, mask: NSWindowStyl
struct SetContentSizeData {
ns_window: id,
size: LogicalSize,
size: LogicalSize<f64>,
}
impl SetContentSizeData {
fn new_ptr(ns_window: id, size: LogicalSize) -> *mut Self {
fn new_ptr(ns_window: id, size: LogicalSize<f64>) -> *mut Self {
Box::into_raw(Box::new(SetContentSizeData { ns_window, size }))
}
}
@ -98,7 +98,7 @@ extern "C" fn set_content_size_callback(context: *mut c_void) {
}
// `setContentSize:` isn't thread-safe either, though it doesn't log any errors
// and just fails silently. Anyway, GCD to the rescue!
pub unsafe fn set_content_size_async(ns_window: id, size: LogicalSize) {
pub unsafe fn set_content_size_async(ns_window: id, size: LogicalSize<f64>) {
let context = SetContentSizeData::new_ptr(ns_window, size);
dispatch_async_f(
dispatch_get_main_queue(),