diff options
| author | Tomaka17 <pierre.krieger1708@gmail.com> | 2014-07-27 20:38:27 +0200 | 
|---|---|---|
| committer | Tomaka17 <pierre.krieger1708@gmail.com> | 2014-07-27 20:41:25 +0200 | 
| commit | d824fb94db2f33e56dd641df18b1327d361cae88 (patch) | |
| tree | 44a728d5620604eb7a576ab8daa9658ea91d4811 /src | |
| parent | 6133e17b9a77d21a33f4dc30c3409aa19129cd08 (diff) | |
| download | glutin-d824fb94db2f33e56dd641df18b1327d361cae88.tar.gz glutin-d824fb94db2f33e56dd641df18b1327d361cae88.zip  | |
Draft for monitor API
Diffstat (limited to 'src')
| -rw-r--r-- | src/lib.rs | 7 | ||||
| -rw-r--r-- | src/win32/mod.rs | 5 | ||||
| -rw-r--r-- | src/x11/mod.rs | 4 | 
3 files changed, 10 insertions, 6 deletions
@@ -19,6 +19,8 @@ mod x11;  mod events;  mod hints; +pub struct MonitorID(uint); +  pub struct Window {      window: winimpl::Window,      nosend: std::kinds::marker::NoSend, @@ -26,10 +28,11 @@ pub struct Window {  impl Window {      #[inline] -    pub fn new(dimensions: Option<(uint, uint)>, title: &str, hints: &Hints) +    pub fn new(dimensions: Option<(uint, uint)>, title: &str, +        hints: &Hints, monitor: Option<MonitorID>)          -> Result<Window, String>      { -        let win = try!(winimpl::Window::new(dimensions, title, hints)); +        let win = try!(winimpl::Window::new(dimensions, title, hints, monitor));          Ok(Window{              window: win,              nosend: std::kinds::marker::NoSend, diff --git a/src/win32/mod.rs b/src/win32/mod.rs index 481436c..03c262f 100644 --- a/src/win32/mod.rs +++ b/src/win32/mod.rs @@ -2,7 +2,7 @@ use std::kinds::marker::NoSend;  use std::sync::Mutex;  use std::sync::atomics::AtomicBool;  use std::ptr; -use {Event, Hints}; +use {Event, Hints, MonitorID};  mod event;  mod ffi; @@ -22,7 +22,8 @@ pub struct Window {  local_data_key!(pub WINDOWS_LIST: Mutex<Vec<(ffi::HWND, Sender<Event>)>>)  impl Window { -    pub fn new(dimensions: Option<(uint, uint)>, title: &str, _hints: &Hints) +    pub fn new(dimensions: Option<(uint, uint)>, title: &str, +        _hints: &Hints, _monitor: Option<MonitorID>)          -> Result<Window, String>      {          use std::mem; diff --git a/src/x11/mod.rs b/src/x11/mod.rs index 857ee92..46334af 100644 --- a/src/x11/mod.rs +++ b/src/x11/mod.rs @@ -1,4 +1,4 @@ -use {Event, Hints}; +use {Event, Hints, MonitorID};  use libc;  use std::{mem, ptr};  use std::sync::atomics::AtomicBool; @@ -14,7 +14,7 @@ pub struct Window {  }  impl Window { -    pub fn new(dimensions: Option<(uint, uint)>, title: &str, hints: &Hints) +    pub fn new(dimensions: Option<(uint, uint)>, title: &str, hints: &Hints, _: Option<MonitorID>)          -> Result<Window, String>      {          // calling XOpenDisplay  | 
