mirror of
https://github.com/rust-windowing/winit.git
synced 2026-09-03 07:10:05 -04:00
MonitorID now defined by the implementations
This commit is contained in:
@@ -23,7 +23,8 @@ mod x11;
|
|||||||
mod events;
|
mod events;
|
||||||
mod hints;
|
mod hints;
|
||||||
|
|
||||||
pub struct MonitorID(uint);
|
/// Identifier for a monitor.
|
||||||
|
pub struct MonitorID(winimpl::MonitorID);
|
||||||
|
|
||||||
/// Represents an OpenGL context and the Window or environment around it.
|
/// Represents an OpenGL context and the Window or environment around it.
|
||||||
///
|
///
|
||||||
@@ -85,7 +86,12 @@ impl Window {
|
|||||||
hints: &Hints, monitor: Option<MonitorID>)
|
hints: &Hints, monitor: Option<MonitorID>)
|
||||||
-> Result<Window, String>
|
-> Result<Window, String>
|
||||||
{
|
{
|
||||||
|
// extracting the monitor ID
|
||||||
|
let monitor = monitor.map(|id| { let MonitorID(id) = id; id });
|
||||||
|
|
||||||
|
// creating the window
|
||||||
let win = try!(winimpl::Window::new(dimensions, title, hints, monitor));
|
let win = try!(winimpl::Window::new(dimensions, title, hints, monitor));
|
||||||
|
|
||||||
Ok(Window{
|
Ok(Window{
|
||||||
window: win,
|
window: win,
|
||||||
nosend: std::kinds::marker::NoSend,
|
nosend: std::kinds::marker::NoSend,
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ use std::kinds::marker::NoSend;
|
|||||||
use std::sync::Mutex;
|
use std::sync::Mutex;
|
||||||
use std::sync::atomics::AtomicBool;
|
use std::sync::atomics::AtomicBool;
|
||||||
use std::ptr;
|
use std::ptr;
|
||||||
use {Event, Hints, MonitorID};
|
use {Event, Hints};
|
||||||
|
|
||||||
mod event;
|
mod event;
|
||||||
mod ffi;
|
mod ffi;
|
||||||
@@ -17,6 +17,8 @@ pub struct Window {
|
|||||||
nosend: NoSend,
|
nosend: NoSend,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub struct MonitorID(uint);
|
||||||
|
|
||||||
/// Stores the list of all the windows.
|
/// Stores the list of all the windows.
|
||||||
/// Only available on callback thread.
|
/// Only available on callback thread.
|
||||||
local_data_key!(pub WINDOWS_LIST: Mutex<Vec<(ffi::HWND, Sender<Event>)>>)
|
local_data_key!(pub WINDOWS_LIST: Mutex<Vec<(ffi::HWND, Sender<Event>)>>)
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
use {Event, Hints, MonitorID};
|
use {Event, Hints};
|
||||||
use libc;
|
use libc;
|
||||||
use std::{mem, ptr};
|
use std::{mem, ptr};
|
||||||
use std::sync::atomics::AtomicBool;
|
use std::sync::atomics::AtomicBool;
|
||||||
@@ -14,6 +14,8 @@ pub struct Window {
|
|||||||
wm_delete_window: ffi::Atom,
|
wm_delete_window: ffi::Atom,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub struct MonitorID(uint);
|
||||||
|
|
||||||
impl Window {
|
impl Window {
|
||||||
pub fn new(dimensions: Option<(uint, uint)>, title: &str, hints: &Hints, _: Option<MonitorID>)
|
pub fn new(dimensions: Option<(uint, uint)>, title: &str, hints: &Hints, _: Option<MonitorID>)
|
||||||
-> Result<Window, String>
|
-> Result<Window, String>
|
||||||
|
|||||||
Reference in New Issue
Block a user