Introduce a WindowProxy for accessing a subset of functionality

from other threads. This currently provides a way for other threads
to wakeup a blocked event loop on X11. Other platforms have stub
functions that need to be implemented. This is similar to
the functionality of glfwPostEmptyEvent.
This commit is contained in:
Glenn Watson 2014-12-17 14:49:11 +10:00
parent 19d120b8b1
commit 9dc5689eef
8 changed files with 171 additions and 52 deletions

View file

@ -83,6 +83,16 @@ impl Window {
}
}
#[cfg(feature = "window")]
#[deriving(Clone)]
pub struct WindowProxy;
impl WindowProxy {
pub fn wakeup_event_loop(&self) {
// TODO
}
}
impl Window {
/// See the docs in the crate root file.
pub fn is_closed(&self) -> bool {
@ -180,6 +190,10 @@ impl Window {
}
}
pub fn create_window_proxy(&self) -> WindowProxy {
WindowProxy
}
/// See the docs in the crate root file.
// TODO: return iterator
pub fn poll_events(&self) -> Vec<Event> {