1 #![cfg(target_os = "macos")]
2 
3 pub use self::events_loop::{EventsLoop, Proxy as EventsLoopProxy};
4 pub use self::monitor::MonitorId;
5 pub use self::window::{Id as WindowId, PlatformSpecificWindowBuilderAttributes, Window2};
6 use std::sync::Arc;
7 
8 #[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
9 pub struct DeviceId;
10 
11 impl DeviceId {
dummy() -> Self12     pub unsafe fn dummy() -> Self {
13         DeviceId
14     }
15 }
16 
17 use {CreationError};
18 
19 pub struct Window {
20     pub window: Arc<Window2>,
21 }
22 
23 impl ::std::ops::Deref for Window {
24     type Target = Window2;
25     #[inline]
deref(&self) -> &Window226     fn deref(&self) -> &Window2 {
27         &*self.window
28     }
29 }
30 
31 impl Window {
32 
new(events_loop: &EventsLoop, attributes: ::WindowAttributes, pl_attribs: PlatformSpecificWindowBuilderAttributes) -> Result<Self, CreationError>33     pub fn new(events_loop: &EventsLoop,
34                attributes: ::WindowAttributes,
35                pl_attribs: PlatformSpecificWindowBuilderAttributes) -> Result<Self, CreationError>
36     {
37         let weak_shared = Arc::downgrade(&events_loop.shared);
38         let window = Arc::new(try!(Window2::new(weak_shared, attributes, pl_attribs)));
39         let weak_window = Arc::downgrade(&window);
40         events_loop.shared.windows.lock().unwrap().push(weak_window);
41         Ok(Window { window: window })
42     }
43 
44 }
45 
46 mod events_loop;
47 mod ffi;
48 mod monitor;
49 mod util;
50 mod view;
51 mod window;
52