winit-sonoma-fix/src/platform/windows/mod.rs

45 lines
1 KiB
Rust
Raw Normal View History

2015-04-24 17:51:23 +10:00
#![cfg(target_os = "windows")]
pub use api::win32;
2015-09-24 17:11:59 +10:00
pub use api::win32::{MonitorId, get_available_monitors, get_primary_monitor};
pub use api::win32::{WindowProxy, PollEventsIterator, WaitEventsIterator};
use CreationError;
2015-09-21 21:15:43 +10:00
use WindowAttributes;
use std::ops::{Deref, DerefMut};
#[derive(Clone, Default)]
2016-01-08 02:01:18 +11:00
pub struct PlatformSpecificWindowBuilderAttributes;
#[derive(Clone, Default)]
2016-01-08 02:01:18 +11:00
pub struct PlatformSpecificHeadlessBuilderAttributes;
/// 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 22:42:05 +10:00
#[inline]
pub fn new(window: &WindowAttributes, _: &PlatformSpecificWindowBuilderAttributes)
2016-01-08 02:01:18 +11:00
-> Result<Window, CreationError>
2015-09-21 21:15:43 +10:00
{
win32::Window::new(window).map(Window)
}
}
impl Deref for Window {
type Target = win32::Window;
2015-09-21 22:42:05 +10:00
#[inline]
fn deref(&self) -> &win32::Window {
&self.0
}
}
impl DerefMut for Window {
2015-09-21 22:42:05 +10:00
#[inline]
fn deref_mut(&mut self) -> &mut win32::Window {
&mut self.0
}
}