iOS Abstract Out the UIView type from winit (#609)

* remove opengl code from winit

* iOS: restrict EventsLoop to be created on the main thread
iOS: Window can only be made once, make Drop on Window thread safe
iOS: make DelegateState owned by Window, cleanup
iOS: fixes from merge (class! macro)

* update the changelog

* Fixed nitpicks
This commit is contained in:
mtak- 2018-07-25 11:49:46 -07:00 committed by Francesca Frangipane
parent 01cb8e59e3
commit 72b24a9348
4 changed files with 128 additions and 114 deletions

View file

@ -1,7 +1,6 @@
#![allow(non_camel_case_types, non_snake_case, non_upper_case_globals)]
use std::ffi::CString;
use std::mem;
use std::os::raw::*;
use objc::runtime::Object;
@ -15,19 +14,11 @@ pub type Boolean = u32;
pub const kCFRunLoopRunHandledSource: i32 = 4;
pub const UIViewAutoresizingFlexibleWidth: NSUInteger = 1 << 1;
pub const UIViewAutoresizingFlexibleHeight: NSUInteger = 1 << 4;
#[cfg(target_pointer_width = "32")]
pub type CGFloat = f32;
#[cfg(target_pointer_width = "64")]
pub type CGFloat = f64;
#[cfg(target_pointer_width = "32")]
pub type NSUInteger = u32;
#[cfg(target_pointer_width = "64")]
pub type NSUInteger = u64;
#[repr(C)]
#[derive(Debug, Clone)]
pub struct CGPoint {
@ -76,6 +67,8 @@ extern {
pub fn longjmp(env: *mut c_void, val: c_int);
}
pub type JmpBuf = [c_int; 27];
pub trait NSString: Sized {
unsafe fn alloc(_: Self) -> id {
msg_send![class!(NSString), alloc]