2015-04-24 09:51:23 +02:00
|
|
|
#![cfg(target_os = "windows")]
|
|
|
|
|
|
2015-07-27 09:52:51 +02:00
|
|
|
pub use api::win32;
|
2015-09-24 09:11:59 +02:00
|
|
|
pub use api::win32::{MonitorId, get_available_monitors, get_primary_monitor};
|
2015-07-27 09:52:51 +02:00
|
|
|
pub use api::win32::{WindowProxy, PollEventsIterator, WaitEventsIterator};
|
2015-04-29 10:19:59 +02:00
|
|
|
|
|
|
|
|
use CreationError;
|
2015-09-21 13:15:43 +02:00
|
|
|
use WindowAttributes;
|
2015-04-29 10:19:59 +02:00
|
|
|
|
2015-07-27 09:52:51 +02:00
|
|
|
use std::ops::{Deref, DerefMut};
|
|
|
|
|
|
2016-05-23 03:17:31 -03:00
|
|
|
#[derive(Clone, Default)]
|
2016-01-07 16:01:18 +01:00
|
|
|
pub struct PlatformSpecificWindowBuilderAttributes;
|
2016-05-23 03:17:31 -03:00
|
|
|
#[derive(Clone, Default)]
|
2016-01-07 16:01:18 +01:00
|
|
|
pub struct PlatformSpecificHeadlessBuilderAttributes;
|
2015-07-27 09:52:51 +02:00
|
|
|
|
|
|
|
|
/// The Win32 implementation of the main `Window` object.
|
|
|
|
|
pub struct Window(win32::Window);
|
|
|
|
|
|
|
|
|
|
impl Window {
|
|
|
|
|
/// See the docs in the crate root file.
|
2015-09-21 14:42:05 +02:00
|
|
|
#[inline]
|
2016-02-23 12:56:23 +01:00
|
|
|
pub fn new(window: &WindowAttributes, _: &PlatformSpecificWindowBuilderAttributes)
|
2016-01-07 16:01:18 +01:00
|
|
|
-> Result<Window, CreationError>
|
2015-09-21 13:15:43 +02:00
|
|
|
{
|
2016-02-23 12:56:23 +01:00
|
|
|
win32::Window::new(window).map(Window)
|
2015-07-27 09:52:51 +02:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
impl Deref for Window {
|
|
|
|
|
type Target = win32::Window;
|
|
|
|
|
|
2015-09-21 14:42:05 +02:00
|
|
|
#[inline]
|
2015-07-27 09:52:51 +02:00
|
|
|
fn deref(&self) -> &win32::Window {
|
|
|
|
|
&self.0
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
impl DerefMut for Window {
|
2015-09-21 14:42:05 +02:00
|
|
|
#[inline]
|
2015-07-27 09:52:51 +02:00
|
|
|
fn deref_mut(&mut self) -> &mut win32::Window {
|
|
|
|
|
&mut self.0
|
|
|
|
|
}
|
|
|
|
|
}
|